Compare commits

...

2894 Commits

Author SHA1 Message Date
David Garske
9c87f979a7 Merge pull request #3586 from tmael/cc310_tests
Fix Cryptocell and revert test.c use of static const
2020-12-22 16:58:25 -08:00
Daniel Pouzzner
f06361ddf6 add WOLFSSL_SMALL_STACK_STATIC macro, and use it to conditionally declare const byte vectors in test.c static for stack depth control -- currently only enabled for linuxkm, but should be compatible with any target with a TLB (virtual memory). 2020-12-22 17:12:57 -06:00
David Garske
90b14e260d Merge pull request #3588 from JacobBarthelmeh/Release
fix regression of --enable-wpas=small build
2020-12-22 14:32:33 -08:00
Tesfa Mael
56071ac21f Fix for Cryptocell tests 2020-12-22 16:23:16 -06:00
Jacob Barthelmeh
81980aa7b6 fix regression of --enable-wpas=small build 2020-12-23 01:30:34 +07:00
Chris Conlon
85d0a71747 Merge pull request #3587 from JacobBarthelmeh/Release
add blog link to README and adjust for nginx build
2020-12-22 08:50:21 -07:00
Jacob Barthelmeh
8ecc2f1771 add blog link to README and adjust for nginx build 2020-12-22 20:14:38 +07:00
toddouska
5eddcb24dd Merge pull request #3584 from JacobBarthelmeh/Release
prepare for release 4.6.0
2020-12-21 14:20:14 -08:00
toddouska
8b48353c18 Merge pull request #3585 from dgarske/async_rel
Fixes in preparation for release
2020-12-21 14:15:45 -08:00
David Garske
53e79f1053 Fix for mp_radix_size with radix 2 and mp_int equal to zero. Fix applies to normal and fast math only. ZD11419. 2020-12-21 12:41:32 -08:00
Jacob Barthelmeh
47c186df34 prepare for release 4.6.0 2020-12-22 02:33:58 +07:00
David Garske
b4111e2f65 Fix for possible leaks with wc_ecc_sign_set_k when building with WOLFSSL_CUSTOM_CURVES enabled. ZD11416. 2020-12-21 11:27:14 -08:00
Chris Conlon
476a3e5d4f fix wc_curve25519_generic() ifdef on NXP LTC builds 2020-12-21 23:57:39 +07:00
David Garske
1c0a6b92ad Fix RSA hash warning for operations with no hash specified. 2020-12-21 08:37:15 -08:00
David Garske
28420b6e4d Fix for building with --with-intelqa and custom curves disabled. 2020-12-21 08:36:48 -08:00
Jacob Barthelmeh
8c16bd2450 fix for infer memory leak report and for clang unused warning 2020-12-21 17:24:35 +07:00
Jacob Barthelmeh
5bd9c1b60d fix for haproxy build 2020-12-21 17:24:35 +07:00
Jacob Barthelmeh
4de1c1b037 add cert gen to lighty build for function wolfSSL_PEM_write_bio_X509 2020-12-21 17:24:35 +07:00
Jacob Barthelmeh
4ef5956757 fix for declaring variable with Windows build 2020-12-21 17:24:35 +07:00
Jacob Barthelmeh
f30d4c1b0b fix for nightly g++ build test 2020-12-21 17:24:35 +07:00
JacobBarthelmeh
9c64630c56 Merge pull request #3582 from douzzer/scan-build-fix-20201218
fix deadstore in ssl.c warned by LLVM11 scan-build.
2020-12-21 17:23:13 +07:00
Daniel Pouzzner
4d1d891a34 src/ssl.c: fix deadstore in wolfSSL_PEM_X509_X509_CRL_X509_PKEY_read_bio() warned by LLVM11 scan-build. 2020-12-18 17:30:25 -06:00
toddouska
0df41d865f Merge pull request #3580 from douzzer/fix-mp-read-bin-bit-accounting
fix mp_read_unsigned_bin() calculation of mp_int.used_bits
2020-12-18 14:41:16 -08:00
toddouska
fcf060b19b Merge pull request #3581 from cconlon/releasefixes_selftest
Release fixes for CAVP selftest builds
2020-12-18 14:15:53 -08:00
toddouska
ea3c385021 Merge pull request #3579 from SparkiDev/sp_math_all_4096
SP math all: enable 4096-bit support by default for x64
2020-12-18 14:14:36 -08:00
toddouska
7e5f838f48 Merge pull request #3577 from dgarske/releasefixes_async
Release fixes for asynchronous crypto
2020-12-18 14:10:01 -08:00
toddouska
fe92d29eb5 Merge pull request #3574 from cconlon/releasefixes
Release fixes for Jenkins tests, example client
2020-12-18 14:06:27 -08:00
toddouska
cdc0753bfb Merge pull request #3571 from JacobBarthelmeh/Testing
Some initial testing and clean up
2020-12-18 14:05:26 -08:00
toddouska
814ed3f5a6 Merge pull request #3439 from julek-wolfssl/libest
Compatibility layer additions for cisco/libest
2020-12-18 14:03:34 -08:00
toddouska
bdd4799400 Merge pull request #3578 from SparkiDev/x509_len
ASN X509: Don't allow any more data after signature
2020-12-18 09:54:39 -08:00
Chris Conlon
a222be1fa3 rename dup to dupl, fix variable shadow warning on i386 selftest compiler 2020-12-18 10:53:55 -07:00
Chris Conlon
ae984508cc fix CAVP selftest v2 build, issue with pkcs7.h 2020-12-18 10:26:19 -07:00
Juliusz Sosinowicz
6226edb394 Use CSR with smaller key size 4096 -> 2048 2020-12-18 12:48:25 +01:00
Daniel Pouzzner
b0ec2bf058 wolfcrypt/src/integer.c: fix mp_read_unsigned_bin() accounting on mp_int.used_bits to avoid spurious .used > .alloc condition at loop exit. 2020-12-18 02:05:18 -06:00
Sean Parkinson
7f5a85ae85 Reduce stack usage 2020-12-18 13:15:50 +10:00
Sean Parkinson
e452b74470 SP math all: enable 4096-bit support by default for x64 2020-12-18 10:20:33 +10:00
David Garske
e49409b13a Fix api.c tests using "free()" instead of "XFREE" causing issues with custom allocators. 2020-12-17 16:08:46 -08:00
Sean Parkinson
a4f8a21b9b ASN X509: Don't allow any more data after signature 2020-12-18 10:02:38 +10:00
David Garske
ce0a2f3bc9 Fixes for Cavium Nitrox and Intel QuickAssist. 2020-12-17 15:53:28 -08:00
David Garske
73a5ee5ffb Fix for async post handshake auth. The re-handshake was not resetting the processReply state. 2020-12-17 15:10:11 -08:00
Chris Conlon
420a040774 fix WOLFSSL_ASYNC_CRYPT usage in test.c, test_wolfSSL_OBJ_ln() in api.c 2020-12-17 11:08:36 -07:00
Jacob Barthelmeh
97bc5e870c fix for default OCSP cmp value and fix for WOLFSSL_NO_CLIENT_AUTH build 2020-12-18 00:36:00 +07:00
Chris Conlon
e8785666c4 fix NXP LTC build with wc_curve25519_generic(), only supports single basepoint 2020-12-17 09:50:18 -07:00
toddouska
b11b08bb10 Merge pull request #3543 from WKJay/master
Port for RT-Thread
2020-12-17 08:36:09 -08:00
Juliusz Sosinowicz
f2694134b0 Fix after rebase 2020-12-17 17:28:29 +01:00
Chris Conlon
71c6654687 Merge pull request #3573 from douzzer/scripts-nix-unportable-timeout-wrapper
scripts/: nix `timeout` wrappers in ocsp-stapling[2].test
2020-12-17 09:13:43 -07:00
Juliusz Sosinowicz
c03744db61 Refactor wc_CheckPrivateKey
- Change wc_CheckPrivateKey to wc_CheckPrivateKeyCert and wc_CheckPrivateKey
- wolfSSL_X509_check_private_key no longer needs to decode cert to check key
- Fix scope in api.c
2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
dc266bc524 Call X509_REQ_get_extensions and X509_get_ext_by_NID on a CSR object 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
383df620bf Add CSR test with Extension Request attribute 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
24b89928dc Code review names changes and refactoring 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
3231cfe9e0 Refactor extension stack generation 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
8b9f8029a8 Sanity check protocol version. 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
22ae66dfe1 wolfSSL_BIO_do_connect should look for a socket bio in the chain 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
2dd28ec5b3 Check if downgrading is allowed in SetSSL_CTX
Pkcs7 cert limit based on build
2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
77c730361e Jenkins fixes 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
25f5427bdd Rebase and test fixes 2020-12-17 14:27:46 +01:00
Juliusz Sosinowicz
b528a1a344 Plug memory leaks 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
7df8f2e2bb Internal unit tests 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
f5c463148f check null 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
031ce68546 Differentiate between server and client sessions
This is important is the client and server share memory space. If a server and client both save the same session in SessionCache it may cause inconsistencies. The hash of the sessionID will be the same causing one of the sides to overwrite the other. A possible problem is that the peer certificate will be incorrect for one of the sides.
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
8edeaae3e2 Add DSA support to x509 certs 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
031ca80fe7 Fix max SSL version handling for client
Enable CRL when adding one to store
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
2197748a51 Implement wolfSSL_X509_check_private_key 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
cb84213ffd Support more extensions 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
cd20512b90 wolfSSL_X509_REQ_add1_attr_by_txt for libest 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
911d5968b4 Store more certs in PKCS7 struct 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
acf3156fac Dynamically allocate memory in wolfSSL_i2d_PKCS7_bio 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
c405c3477f Protect against invalid write in RsaPad_PSS 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
2a9bb906a9 Implement wolfSSL_BIO_*_connect and wolfSSL_BIO_set_conn_port
Forgot to commit csr.dsa.pem for api.c
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
78a20ec3ae Extension manipulation 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
65c6a71bde Init wolfSSL_X509_REQ_add_extensions 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
6a635b339c Fixes
- Fix challengePw copy in ReqCertFromX509
- Proper header length in wolfSSL_PEM_X509_X509_CRL_X509_PKEY_read_bio
- Special case for extended key usage in wolfSSL_OBJ_cmp
- Numerical input in wolfSSL_OBJ_txt2obj can just be encoded with EncodePolicyOID. Searching for the sum can return wrong values since they are not unique.
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
b808124a47 Add DSA support to ConfirmSignature and add DSAwithSHA256 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
2a20896e44 Add CRL loading to wolfSSL_PEM_X509_INFO_read_bio 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
86d2177876 wolfSSL_X509_resign_cert updates x509 der buffer as well 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
932ef25e79 Set default digest NID 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
2689d499b9 Tests starting to pass 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
ff7b8d3715 Don't attempt TLS 1.3 if server options disable it 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
2e2beb279d WIP 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
8e62bf2588 Pass libest estclient_simple example 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
aaba7ed286 OpenSSL Compat layer
Implement/stub:
- wolfSSL_X509V3_EXT_add_nconf
- wolfSSL_EVP_PKEY_copy_parameters
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
ff2574b3cb OpenSSL Compat layer
Implment/stub:
- wolfSSL_X509_NAME_delete_entry
- wolfSSL_X509_get_ext_by_OBJ
- wolfSSL_a2i_ASN1_INTEGER
- X509V3_parse_list
- wolfSSL_TXT_DB_write
- wolfSSL_TXT_DB_insert
- wolfSSL_EVP_PKEY_get_default_digest_nid
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
753a3babc8 OpenSSL Compat layer
Implement/stub:
- wolfSSL_NCONF_get_number
- wolfSSL_EVP_PKEY_CTX_ctrl_str
- wolfSSL_PKCS12_verify_mac
- wc_PKCS12_verify_ex
- wolfSSL_BIO_new_fd
- wolfSSL_X509_sign_ctx
- wolfSSL_ASN1_STRING_cmp
- wolfSSL_ASN1_TIME_set_string
- X509V3_EXT_add_nconf
- X509V3_set_nconf
Implement TXT_DB functionality:
- wolfSSL_TXT_DB_read
- wolfSSL_TXT_DB_free
- wolfSSL_TXT_DB_create_index
- wolfSSL_TXT_DB_get_by_index
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
e7f1d39456 OpenSSL Compat layer
Implement WOLFSSL_CONF_VALUE:
- wolfSSL_CONF_VALUE_new
- wolfSSL_CONF_VALUE_new_values
- wolfSSL_CONF_add_string
- wolfSSL_X509V3_conf_free
- wolfSSL_sk_CONF_VALUE_push
- wolfSSL_NCONF_load
- wolfSSL_NCONF_free
- wolfSSL_CONF_new_section
- wolfSSL_CONF_get_section
Implment some buffer functions
- wolfSSL_strlcat
- wolfSSL_strlcpy
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
42d4f35a98 Implement OpenSSL Compat API:
- Implement lhash as a stack with hash members
- wolfSSL_lh_retrieve
- wolfSSL_LH_strhash
- IMPLEMENT_LHASH_COMP_FN
- IMPLEMENT_LHASH_HASH_FN
- wolfSSL_sk_CONF_VALUE_new
- wolfSSL_sk_CONF_VALUE_free
- wolfSSL_sk_CONF_VALUE_num
- wolfSSL_sk_CONF_VALUE_value
- wolfSSL_NCONF_new
- wolfSSL_NCONF_get_string
- wolfSSL_NCONF_get_section
- wolfSSL_lh_WOLFSSL_CONF_VALUE_retrieve
- wolfSSL_CONF_modules_load
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
be98404b3b Implement wolfSSL_X509_REQ_verify 2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
4aa30d0bde Add CSR parsing capabilities to ParseCertRelative and wc_GetPubX509
- wolfSSL_BIO_get_mem_data now returns the last memory BIO in the chain
- Change wolfSSL_BIO_pending calls to wolfSSL_BIO_get_len calls to get accurate length depending on BIO
- Refactor X509 and X509_REQ functions to reuse similar code
- X509 and X509_REQ i2d functions now generate their DER outputs instead of returning the input DER
- Signature generated by wolfSSL_X509_resign_cert is now saved in the x509->sig buffer and added when calling *i2d
- Add test_wolfSSL_d2i_X509_REQ
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
1a50d8e028 WIP
- wolfSSL_BIO_ctrl_pending ignore BASE64 bio's as well now
- Save the last Finished messages sent or received in the WOLFSSL struct
- Implement wolfSSL_CTX_set_max_proto_version
- wolfSSL_d2i_X509_bio now uses wolfSSL_BIO_read so that the entire chain is properly read from the BIO
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
a7ec58003e PKCS7 changes
- Allow PKCS7_EncodeSigned to be called with a zero content length
- wc_HashUpdate now doesn't error out on zero length data
- First cert in wolfSSL_PKCS7_encode_certs is treated as main cert and the PKCS7 struct is initialized with it
- wolfSSL_BIO_get_mem_data returns the buffer from the last bio in chain
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
85b1196b08 Implement/stub:
- X509_REQ_print_fp
- X509_print_fp
- DHparams_dup
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
728f4ce892 Implement/stub:
- wc_DhKeyCopy
- SSL_CTX_set_srp_strength
- SSL_get_srp_username
- X509_REQ_get_attr_by_NID
- X509_REQ_get_attr
- X509_ATTRIBUTE
- wolfSSL_DH_dup
Add srp.h file with SRP_MINIMAL_N
2020-12-17 14:26:49 +01:00
Juliusz Sosinowicz
b52e11d3d4 Implement/stub the following:
- X509_get0_extensions
- X509_to_X509_REQ
- i2d_X509_REQ_bio
- X509v3_get_ext_count
- i2d_PKCS7_bio
Additional changes:
- Added a wc_PKCS7_VerifySignedData call to wolfSSL_d2i_PKCS7_bio to populate the PKCS7 struct with parsed values
- wc_PKCS7_VerifySignedData_ex -> wc_PKCS7_VerifySignedData
2020-12-17 14:26:30 +01:00
Juliusz Sosinowicz
3721d80e84 Implement wolfSSL_PKCS7_to_stack and wolfSSL_d2i_ASN1_OBJECT
- I also implemented wolfSSL_c2i_ASN1_OBJECT which was previously a stub.
- More configure.ac flags added to libest option
2020-12-17 14:26:30 +01:00
Juliusz Sosinowicz
1e26238f49 Implement/stub the following functions:
- X509_REQ_sign_ctx
- X509_REQ_get_subject_name
- X509_REQ_set_version
- X509_NAME_print_ex_fp
- X509_STORE_CTX_get0_parent_ctx
- wolfSSL_PKCS7_encode_certs

Add cms.h file to avoid including the OpenSSL version.
2020-12-17 14:26:30 +01:00
Juliusz Sosinowicz
777bdb28bc Implement/stub the following:
- `NID_pkcs9_challengePassword` - added
- `wolfSSL_OPENSSL_cleanse` - implemented
- `wolfSSL_X509_REQ_add1_attr_by_NID` - stubbed
- `wolfSSL_c2i_ASN1_OBJECT` - stubbed
2020-12-17 14:26:30 +01:00
Juliusz Sosinowicz
7bd0b2eb44 Implement ASN1_get_object 2020-12-17 14:26:30 +01:00
Juliusz Sosinowicz
a9d502ef85 Add --enable-libest option to configure.ac
Refactoring and adding defines for functions
2020-12-17 14:26:30 +01:00
WKJay
641a2a8cb0 update RTTHREAD/readme.md 2020-12-17 08:44:45 +08:00
WKJay
498e3eb6fe Add include.am 2020-12-17 08:42:53 +08:00
Chris Conlon
6d9cf6b31e fix for wc_AesFeedbackCFB8() on big endian platforms 2020-12-16 16:38:38 -07:00
toddouska
b4fddf3f24 Merge pull request #3572 from dgarske/zd11381
Fix for `wc_SetAltNamesBuffer`
2020-12-16 15:33:12 -08:00
Daniel Pouzzner
eeefe043ec scripts/: nix timeout wrappers in ocsp-stapling.test and ocsp-stapling2.test, for portability. 2020-12-16 17:31:53 -06:00
Chris Conlon
7e1a066963 Merge pull request #3555 from kojo1/doc-PSS_Sign-Verify
Doc wc_RsaPSS_Sign/Verify/CheckPadding
2020-12-16 15:18:24 -07:00
David Garske
51c3f87811 Fix for wc_SetAltNamesBuffer broken in PR #2728. The SetAltNames was changed in PR 2728 to rebuild the SAN OID, so only the flattened list of DNS entries is required. Fix is in SetAltNamesFromDcert to use already has a parsed DecodedCert and flatten the alt names DNS_Entry list. ZD 11381 2020-12-16 12:28:28 -08:00
Chris Conlon
502e471cde fix spelling of Nitrox in configure option summary 2020-12-16 13:08:32 -07:00
Chris Conlon
f375cff685 enable AES-CTR for libsignal build 2020-12-16 12:44:01 -07:00
Chris Conlon
16ce8e077a only call wolfSSL_UseKeyShare() in example client with TLS 1.3 2020-12-16 12:06:35 -07:00
Jacob Barthelmeh
9a968bdf53 disable XChaCha with armasm 2020-12-17 01:58:36 +07:00
Jacob Barthelmeh
a948066f86 some infer fixes 2020-12-17 01:49:48 +07:00
JacobBarthelmeh
f6c3eae1de g++ build fix 2020-12-16 15:05:33 -05:00
toddouska
5f30727b32 Merge pull request #3531 from vppillai/patch-1
support TNGTLS certificate loading for Harmony3
2020-12-16 09:21:28 -08:00
toddouska
7f20b97927 Merge pull request #3569 from SparkiDev/cppcheck_fixes_5
cppcheck: fixes
2020-12-16 09:04:59 -08:00
toddouska
cee91c91f5 Merge pull request #3532 from julek-wolfssl/nginx-1.7.7
Changes for Nginx 1.7.7
2020-12-16 09:01:27 -08:00
toddouska
b0464c93e2 Merge pull request #3542 from SparkiDev/sp_mod_odd
SP: ensure modulus/prime is odd before performing RSA/DH/ModExp ops
2020-12-16 08:51:10 -08:00
Vysakh P Pillai
3063264f00 formatting updates 2020-12-16 18:05:58 +05:30
Vysakh P Pillai
63f8fbe92f update formatting 2020-12-16 17:59:36 +05:30
Sean Parkinson
6dc06993bf SP: ensure modulus/prime is odd before performing RSA/DH/ModExp ops 2020-12-16 21:49:09 +10:00
Sean Parkinson
75c062a298 cppcheck: fixes 2020-12-16 17:28:20 +10:00
Takashi Kojo
010c8db54e duplicated \ingroup, missing closing comment 2020-12-16 08:52:12 +09:00
Sean Parkinson
922ca916a9 Merge pull request #3554 from ejohnstown/psk-fix
PSK Alert
2020-12-16 09:40:04 +10:00
toddouska
bab2f55661 Merge pull request #3563 from SparkiDev/base64_cr
Base64: Cache attack resistant decode
2020-12-15 15:16:09 -08:00
Daniel Pouzzner
7f44247954 Merge pull request #3567 from SparkiDev/sp_math_fix
SP math all: fixes for different compilers and configs
2020-12-15 15:37:25 -06:00
Juliusz Sosinowicz
575f4ba140 Nginx 1.7.7 changes
- Push error when decryption fails
- If wolfSSL_CTX_use_certificate keeps passed in cert then it should either copy it or increase its reference counter
- Make wolfSSL_PEM_read_bio_DHparams available with FIPS
2020-12-15 19:32:55 +01:00
JacobBarthelmeh
e0b0c329b3 build fix for --enable-afalg 2020-12-15 10:50:57 -07:00
Jacob Barthelmeh
c048ce5f99 build fix for --enable-ip-alt-name 2020-12-15 23:56:04 +07:00
toddouska
38a11368e0 Merge pull request #3557 from JacobBarthelmeh/Cert-Report2
Strict alt names check with DIR name constraint
2020-12-15 08:51:55 -08:00
toddouska
f362c6ecf5 Merge pull request #3562 from SparkiDev/session_mutex
SESSION mutex: copying a session overwrote mutex
2020-12-15 08:50:57 -08:00
Vysakh P Pillai
aa2e02807d Avoid conversions to PEM and register DER certificate chain 2020-12-15 16:15:36 +05:30
Sean Parkinson
356b419532 SP math all: fixes for different compilers and configs 2020-12-15 17:37:59 +10:00
Sean Parkinson
972d6cfefc Base64: Cache attack resistant decode 2020-12-15 17:22:02 +10:00
Sean Parkinson
52f63ca44b SESSION mutex: copying a session overwrote mutex
New session creation function, NewSession, that doesn't initialize
mutex.
Calling functions, wolfSSL_SESSION_new() and wolfSSL_SESSION_copy(),
initialize the mutex.
2020-12-15 17:20:40 +10:00
Sean Parkinson
65d0cc62fd Merge pull request #3566 from douzzer/STACK_SIZE_CHECKPOINT_WITH_MAX_CHECK-decl-order
C89 decl order in STACK_SIZE_CHECKPOINT_WITH_MAX_CHECK()
2020-12-15 17:01:22 +10:00
WKJay
4f15cfde16 Add rt-thread porting files 2020-12-15 14:49:49 +08:00
Daniel Pouzzner
87e5b55033 don't special case get_digit_count for SP, i.e. eliminate sp_get_digit_count(), to fix -Waddress in sp_get_digit_count macro use in api.c:test_get_digit_count() (sp_get_digit_count() was a non-inline function before commit 91d23d3f5a (sp-math-all)). 2020-12-14 20:14:39 -06:00
John Safranek
123c713658 Key Change
Move the setting of the key in the handshake from right before
sending the finished message to between building change cipher spec
and sending it. This way there won't be any opportunity to send a
message after the change cipher spec that won't be encrypted.
2020-12-14 18:13:26 -08:00
John Safranek
f8e674e45d PSK Alert
When the server cannot match the client's identity, the server sends a unknown_psk_identity alert to the client.
2020-12-14 17:56:19 -08:00
toddouska
7fe24daf6c Merge pull request #3561 from dgarske/st_cube_rel
ST Cube Pack Fixes
2020-12-14 16:20:18 -08:00
toddouska
3f6a444bef Merge pull request #3564 from SparkiDev/tls13_add_sess
TLS 1.3: Don't add a session without a ticket
2020-12-14 16:09:52 -08:00
toddouska
43182b9389 Merge pull request #3548 from gstrauss/HAVE_SNI
put all SNI code behind simpler preprocessor directive HAVE_SNI
2020-12-14 16:08:53 -08:00
Daniel Pouzzner
70808647ef move decl of _ret to top in STACK_SIZE_CHECKPOINT_WITH_MAX_CHECK(), for C89 happiness. 2020-12-14 17:50:28 -06:00
toddouska
bd871280d7 Merge pull request #3497 from elms/erf32/se_acceleration
ERF32: HW acceleration
2020-12-14 15:43:15 -08:00
toddouska
56e2c0e268 Merge pull request #3534 from douzzer/linuxkm-cryptonly
--enable-linuxkm --enable-cryptonly
2020-12-14 15:14:54 -08:00
David Garske
428c6b4301 Merge pull request #3523 from SparkiDev/pkcs11_fixes_2
Pkcs11 fixes 2
2020-12-14 14:09:26 -08:00
David Garske
032b289835 Merge pull request #3559 from tmael/cc310_ecc_k
Fix Cryptocell ecc build err
2020-12-14 10:50:30 -08:00
Sean Parkinson
fb5b415e83 TLS 1.3: Don't add a session without a ticket
TLS 1.3 doesn't support resumption with PSK (session ticket or with the
PSK callback).
2020-12-14 14:03:31 +10:00
David Garske
337e95e52b Fix for AES GCM with hardware crypto and missing wc_AesSetKeyLocal. Broken in PR #3388. 2020-12-13 13:59:30 -08:00
David Garske
757c07801a Updates to v4.5.1. 2020-12-13 13:59:30 -08:00
Tesfa Mael
4ee5ae0115 Fix Cryptocell ecc build err 2020-12-11 15:12:42 -08:00
Takashi Kojo
b2a66a10f4 add XXX_ex APIs, corret spelling, descriptions 2020-12-12 07:29:24 +09:00
John Safranek
0e9926bd83 Merge pull request #3553 from haydenroche5/cert_status_fix
Fix OCSP cert status check in internal.c
2020-12-11 13:27:29 -08:00
Daniel Pouzzner
2804cb2521 wolfcrypt/test/test.c: more smallstack refactoring in aes_test(). 2020-12-11 14:17:25 -06:00
Daniel Pouzzner
0b42f3ae72 wolfcrypt/src/dsa.c: disable MSVC warning C4127 (compiler bug) as in wolfcrypt/src/tfm.c and src/internal.c. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
f2e1595eef wolfcrypt/src/dsa.c: use do{}while(0) with break, rather than goto, for top level flow control in wc_DsaSign() and wc_DsaVerify() smallstack refactor. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
53c6d33695 test.c:aes_test(): add WOLFSSL_SMALL_STACK codepaths for WOLFSSL_AESNI test. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
1c0df61247 wolfssl/test.h and wolfcrypt/test/test.c: add STACK_SIZE_CHECKPOINT_WITH_MAX_CHECK(), recognize macro WOLFSSL_TEST_MAX_RELATIVE_STACK_BYTES, and add to wolfcrypt_test() runtime settability of relative cumulative stack depth assert threshold using "-s stacksize". 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
2ed75402b8 wc_DsaSign(): removal several redundant mp_clear()s preceded by mp_forcezero()s. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
bfff28ab28 ecc.c: fix mp_init_multi() vs mp_clear() dynamics in wc_ecc_verify_hash_ex() and mp_sqrtmod_prime(). 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
ec96e5ad74 wolfSSL_BN_is_odd(): fix function signature to match header (unsigned long reverted to WOLFSSL_BN_ULONG). 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
525382fb13 test.c:pkcs7authenveloped_run_vectors(): small stack refactor, and reenable for WOLFSSL_LINUXKM. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
18984abc9e configure.ac: replace --enable-stacksize-verbose with --enable-stacksize=verbose, and change _LINUXKM_DEFAULTS ENABLED_SP_DEFAULT and ENABLED_SP_MATH_ALL_DEFAULT from small to yes. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
4efa85dc03 linuxkm/module_hooks.c: add support for WOLFCRYPT_ONLY. 2020-12-11 14:16:44 -06:00
Daniel Pouzzner
f73fc23282 ecc.c: add smallstack codepaths to ecc_mul2add(). 2020-12-11 14:16:44 -06:00
David Garske
cb8c6608f3 Merge pull request #3558 from douzzer/fix-mp_mod_2d-sub-byte-clearing
fix mp_mod_2d() for DIGIT_BIT != sizeof(mp_digit)*8
2020-12-11 08:43:51 -08:00
Elms
40087f1fd0 SiLabs: AES return code fixup and comment cleanup 2020-12-10 22:56:11 -08:00
Sean Parkinson
8b2bd1277a Merge pull request #3551 from douzzer/fix-unit-test-EVP-arc4-32-bit
32 bit targets vs test_wolfSSL_EVP_X_STATE_LEN()
2020-12-11 16:46:10 +10:00
Sean Parkinson
3e8e7aa17f Merge pull request #3550 from douzzer/sp-math-all-sp-word-typo
sp_int.c: fix typos in _sp_mul_4() and _sp_sqr_4().
2020-12-11 16:16:48 +10:00
Daniel Pouzzner
ef1284165f wolfcrypt/src/integer.c: fix sub-byte clearing step of mp_mod_2d() to work when DIGIT_BIT != sizeof(mp_digit)*8. 2020-12-10 23:50:30 -06:00
Jacob Barthelmeh
04e22b0747 add restriction to excluded DIR name constraint 2020-12-11 10:00:11 +07:00
Jacob Barthelmeh
f00263889b add test case 2020-12-11 08:20:48 +07:00
Sean Parkinson
a075540343 Merge pull request #3552 from tmael/shiftNeg
Check shift value
2020-12-11 10:19:27 +10:00
Tesfa Mael
9042843e42 Fix shift and clear digits 2020-12-10 16:13:30 -08:00
toddouska
2c652151ac Merge pull request #3510 from SparkiDev/sp_modinv_nct
SP modinv: add non-constant time modinv
2020-12-10 16:06:12 -08:00
toddouska
cb61dc7d2f Merge pull request #3522 from douzzer/cleanups-20201119
misc cleanups re sp-math-all, FIPS, smallstack
2020-12-10 15:58:33 -08:00
Takashi Kojo
47f7e46ffe Add wc_RsaPSS_Sign/Verify/CheckPadding 2020-12-11 07:58:39 +09:00
Jacob Barthelmeh
17f32c3e05 add strict check on name constraints with DIR alt names 2020-12-11 05:22:46 +07:00
Daniel Pouzzner
e9a79b2e0d configure.ac: fix rebase error, re enable-sp-asm on ARM. 2020-12-10 14:46:22 -06:00
Glenn Strauss
59cefd2c99 match preproc defs around wolfSSL_ctrl()
match preproc defs around wolfSSL_ctrl() in src/ssl.c
2020-12-10 15:46:20 -05:00
Glenn Strauss
9d095066eb wrap SNI-related code with HAVE_SNI
perhaps some of this code should additionally be wrapped in
-  #ifndef NO_WOLFSSL_SERVER

It is fragile and ugly to litter the code with the likes of
-  #if defined(OPENSSL_ALL) || (defined(OPENSSL_EXTRA) && (defined(HAVE_STUNNEL) || \
-                               defined(WOLFSSL_NGINX) || defined(HAVE_LIGHTY) || \
-                               defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_OPENSSH) ))
while it is much clearer and much more maintainable to wrap SNI-related
code with an SNI-specific feature-define HAVE_SNI (and possibly further
restrict with feature-define #ifndef NO_WOLFSSL_SERVER).
2020-12-10 15:46:20 -05:00
Daniel Pouzzner
f4af6c053c wolfssl/openssl/aes.h: restore ALIGN16 attribute to pad member of struct WOLFSSL_AES_KEY. 2020-12-10 14:21:19 -06:00
Daniel Pouzzner
0fa4bde5b5 configure.ac: move --enable-sp-asm handling to follow --enable-sp-math-all handling, so that $ENABLED_SP requirement is properly met. 2020-12-10 14:21:08 -06:00
Daniel Pouzzner
f277339528 add explicit casts to XMALLOC()s, even for (void *), to avoid warnings in C++ and MSVC/MSVS builds, and to avoid false positives on simple text searches. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
f47cdfcaed wolfcrypt/test/test.c: fix skipped initialization warned by LLVM11 scan-build. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
3b8e7d546a sp_int.h: force C linkage, so that enable-sp-math-all is compatible with CC=g++. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
741098c108 sp_int.c, srp.c: fixes for 5 deadcode.DeadStores found by LLVM11 scan-build. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
f49e9bf954 dsa.c, srp.c, wolfcrypt/test/test.c: smallstack refactors: wc_DsaExportKeyRaw(), wc_DsaSign(), wc_SrpSetKey(), ecc_test_cdh_vectors(), ecc_test_custom_curves(). 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
1fc2c7714c hmac.c: include wc_port.h rather than settings.h, to pick up WOLFSSL_LINUXKM namespace tweaks. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
f4ecaf05c0 openssl/aes.h: refactor WOLFSSL_AES_KEY typedef to inline sizeof(Aes) long words, rather than computing the size of Aes from its members. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
b723c7ddbe bn.h and ssl.c: define WOLFSSL_BN_ULONG to be target-native unsigned long, revert *_word() bn.h API functions to use WOLFSSL_BN_ULONG, and change wolfSSL_BN_get_word() to return WOLFSSL_BN_ULONG rather than unsigned long, for consistency. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
27a6de2c2f configure.ac, wolfssl/wolfcrypt/settings.h, wolfssl/wolfcrypt/wc_port.h: update linuxkm defaults and settings for compatibility with sp-math-all, and change linuxkm default math from sp-math to sp-math-all; refactor enable-all and enable-all-crypto logic to allow piecemeal exclusion of options from the command line. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
78b2b3ca3b ssl.c:wolfSSL_BN_get_word_1(): remove dead logic inadvertently retained. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
f7bf0a78fb test.c:ecc_test_curve_size(): use a macro, not a static const size_t, for size of exportBuf, to make MS Visual Studio happy. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
89e6b1eebc wc_ecc_mulmod_ex(): be more careful freeing temp key. 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
e6b587772f fix pointer type clash in wolfSSL_BN_mod_word(); restore accidentally removed WOLFSSL_KEY_GEN gate in dsa_test(). 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
cbc190f13c wolfcrypt/src/ecc.c: smallstack refactors of wc_ecc_mulmod_ex() and mp_sqrtmod_prime(). 2020-12-10 14:16:21 -06:00
Daniel Pouzzner
ad2cb67047 wolfcrypt/test/test.c: _SMALL_STACK refactors of dsa_test(), srp_test(), openssl_pkey1_test(), and ecc_test_curve_size(); add missing FIPS gates. 2020-12-10 14:16:20 -06:00
Daniel Pouzzner
5286cb1a46 optimize domain check in wolfcrypt/src/integer.c and wolfcrypt/src/tfm.c. 2020-12-10 14:16:20 -06:00
Daniel Pouzzner
53cfa55941 src/ssl.c and wolfssl/openssl/bn.h: refactor _word mp routines to consistently accept/return target-native unsigned long type, for compatibility with sp-math-all. needed because WOLFSSL_BN_ULONG can, surprisingly, be only 16 bits, when sp-math-all in a 32 bit build. 2020-12-10 14:16:20 -06:00
Daniel Pouzzner
7cfe1e2143 sha3.h: rename struct Sha3 to struct wc_Sha3 for consistency, and compatibility with FIPS source. 2020-12-10 14:16:20 -06:00
Daniel Pouzzner
cfc08cc13f configure.ac: remove smallstackcache from linuxkm default options; add several feature exclusions to enable-all and enable-all-crypto to make them compatible with fips=ready; render the FIPS option in the feature summary at end. 2020-12-10 14:16:20 -06:00
Daniel Pouzzner
2a2ba896ec documentation typo: wc_InitSha356() sounds like an interesting algorithm but, alas, we will have to settle for wc_InitSha256(). 2020-12-10 14:16:20 -06:00
Daniel Pouzzner
c5e2ccabb1 fix --enable-stacksize-verbose: relocate declarations for HAVE_STACK_SIZE_VERBOSE global variables from wolfssl/test.h to wolfssl/wolfcrypt/logging.h, matching their location in wolfcrypt/src/logging.c. 2020-12-10 14:16:20 -06:00
toddouska
b93109cf1c Merge pull request #3540 from SparkiDev/int_toradix_fix
MP integer: fix map string for toradix and read_radix
2020-12-10 12:01:45 -08:00
toddouska
cd3b91a8fe Merge pull request #3536 from SparkiDev/arm64_rev
ByteReverseWord32 AARCH64: Use proper instruction - REV32
2020-12-10 11:59:00 -08:00
Elms
9ba78eb825 SiLabs: Clarify comments and fix sig buffer size 2020-12-10 10:45:55 -08:00
Hayden Roche
a6378de4f0 Fix OCSP cert status check in internal.c
I missed one line in internal.c when I recently modified the OCSP ASN code.
2020-12-10 10:32:30 -06:00
Tesfa Mael
4bd49d2b28 Update with a proper check 2020-12-09 17:05:56 -08:00
Elms
93fc37f87b SiLabs: add cleanup and address PR comments 2020-12-09 16:28:39 -08:00
Sean Parkinson
2862a9ce56 SP modinv: add non-constant time modinv
Can only be used in ECC verify - sign operation must be constant time.
Not used for small code.
2020-12-10 09:24:22 +10:00
Tesfa Mael
44903ff8ae Check shift value 2020-12-09 15:04:28 -08:00
John Safranek
ad1118326b Merge pull request #3546 from dgarske/gh_no_rng
Fix for `WC_NO_RNG` with GreenHills
2020-12-09 14:30:44 -08:00
Chris Conlon
21625ab0c2 Merge pull request #3533 from JacobBarthelmeh/PKCS7
fix for PKCS7 decompress
2020-12-09 14:00:42 -07:00
Elms
586a75302b SiLabs: extra check on importing key to se_key buffer 2020-12-09 12:54:24 -08:00
Daniel Pouzzner
181f439028 api.c: in test_wolfSSL_EVP_X_STATE_LEN(), fix assert on size of EVP state to work on 32 bit targets. 2020-12-09 14:04:16 -06:00
Daniel Pouzzner
2de261c2de sp_int.c: fix typos in _sp_mul_4() and _sp_sqr_4(). 2020-12-09 12:10:46 -06:00
toddouska
f31b41fcca Merge pull request #3495 from haydenroche5/httpd
Add OpenSSL compatibility functions for latest version of Apache httpd
2020-12-09 09:55:13 -08:00
toddouska
b7aa0ebf57 Merge pull request #3458 from julek-wolfssl/EVP_Cipher-api
EVP_Cipher should return length written.
2020-12-09 09:52:44 -08:00
toddouska
367f28b917 Merge pull request #3443 from SparkiDev/tls13_psk_no_dhe
TLS 1.3: PSK only
2020-12-09 09:45:34 -08:00
toddouska
7834dee991 Merge pull request #3503 from SparkiDev/dtls_mtu_write
DTLS MTU: check MTU on write
2020-12-09 09:42:44 -08:00
toddouska
6c62899ea8 Merge pull request #3535 from SparkiDev/sp_fixes_4
SP: change implicit casting downs to be explicit
2020-12-09 09:25:57 -08:00
toddouska
0b78137dfa Merge pull request #3537 from SparkiDev/sp_int_configs
SP math all: fixes for configurations that don't specify size
2020-12-09 09:16:46 -08:00
toddouska
cbf8e754e0 Merge pull request #3541 from SparkiDev/rsavfy_sp
SP: Get RSA verify only to build with DH
2020-12-09 09:15:45 -08:00
toddouska
b726ec52d2 Merge pull request #3547 from haydenroche5/benchmarking_tput
Fix RX/TX throughput reporting in example server.
2020-12-09 09:15:00 -08:00
David Garske
ec6163c0f6 Merge pull request #3549 from ejohnstown/sniffer-fix
Sniffer Test Filename Fix
2020-12-09 08:18:51 -08:00
John Safranek
3e8bad7ae9 Sniffer Test Filename Fix
1. When using multiple filenames, keep the original entered string
   around so it may be reused for each IP address.
2. Strip the trailing newline from the entered filename list.
2020-12-08 17:16:34 -08:00
Sean Parkinson
d34b0072a2 ARM: identify ARM CPU for Thumb and Cortex
Better detailed check of CPU architecture for 32-bit byte reversal asm
2020-12-09 08:54:18 +10:00
Hayden Roche
5fdc4cf6e1 Fix RX/TX throughput reporting in example server.
- I observed that client TX throughput < client RX throughput, but server TX
  throughput > server RX throughput. Turns out this is just a typo in the
  printing of the stats. The RX stat was being printed as the TX stat and vice-
  versa.
- I added a note to scripts/benchmark.test about a 2 second sleep we do waiting
  for the server to come up. If you were to time this script with the time
  command, you'll see that 2 seconds in the result, which might be confusing
  if you didn't realize the sleep was there.
2020-12-08 16:49:09 -06:00
Elms
ef4db5b808 SiLabs: simplify init 2020-12-08 13:16:13 -08:00
Elms
620fe2da14 SiLabs: Fix tests and wc_ecc_import_private_key 2020-12-08 12:22:35 -08:00
David Garske
9ced741ef3 Fix for WC_NO_RNG with GreenHills. 2020-12-08 12:16:41 -08:00
Jacob Barthelmeh
bc50b7b836 fix order of arguments with PKCS7 decompression 2020-12-08 23:11:59 +07:00
Jacob Barthelmeh
081cea7405 set optional limit on max decompression buffer size 2020-12-08 20:16:27 +07:00
Elms
919c2a2dfb SiLabs: address PR comments to cleanup 2020-12-07 16:16:11 -08:00
Elms
3abc4719ae SiLabs: cleanup TODOs 2020-12-07 15:32:44 -08:00
Elms
44243278a5 SiLabs: renable ecc_ssh_test and disable AES non-12Byte IV 2020-12-07 15:04:00 -08:00
WKJay
227faedcc7 Port for RT-Thread 2020-12-07 16:22:28 +08:00
Sean Parkinson
9b894048fd PKCS #11: only open/close session when performing op, use C_Sign for RSA
Was opening and closing sessions when operations not compiled in were
being attempted (e.g. hashing during certificate signing).
C_Sign can be used with X509 RSA (raw) as it does the same operations as
C_Decrypt. Use the function matching hig level operation where
supported.
Make debugging functions take a CK_ULONG rather than an int - to avoid
casting.
2020-12-07 10:15:43 +10:00
Sean Parkinson
dbe4ce0e24 SP: Get RSA verify only to build with DH
Fix configuration: --enable-rsavfy --enable-sp --enable-cryptonly
[--enable-sp-asm]
2020-12-07 09:46:14 +10:00
Sean Parkinson
9bbef90546 MP integer: fix map string for toradix and read_radix 2020-12-07 09:12:53 +10:00
Glenn Strauss
034248b964 add more missing HAVE_LIGHTY 2020-12-05 15:52:17 -05:00
Sean Parkinson
281ba96bd0 SP math all: fixes for configurations that don't specify size 2020-12-04 16:47:11 +10:00
Sean Parkinson
d475463c91 Merge pull request #3528 from JacobBarthelmeh/Testing
fix build with ARM64 SP, FP_ECC and WC_NO_CACHE_RESISTANT
2020-12-04 12:17:24 +10:00
Sean Parkinson
a72393eb33 ByteReverseWord32 AARCH64: Use proper instruction - REV32 2020-12-04 12:05:33 +10:00
Sean Parkinson
56cb4c8ea7 SP: change implicit casting downs to be explicit 2020-12-04 11:52:39 +10:00
Hayden Roche
03c7e52f5f Add OpenSSL compatibility functions for Apache httpd's OCSP module. 2020-12-03 11:22:43 -06:00
Hayden Roche
bca43654df Make changes to OCSP ASN code.
- Use OcspEntry in OcspResponse instead of CertStatus. OcspEntry is more
  analogous to an OCSP SingleResponse, which contains issuer name and key
  hashes. Correspondingly, remove these hashes from OcspResponse, since they'll
  now be stored per SingleResponse in an OcspEntry.
- Add a hashAlgoOID to OcspEntry (corresponds to hashAlgorithm in CertId in RFC
  6960). This makes OcspEntry more closely resemble an OCSP SingleResponse.
- Change WOLFSSL_OCSP_CERTID to map to OcspEntry. OcspEntry contains all the
  information that an OCSP CertID contains, and is a better fit than
  OcspRequest.
- Add a pointer to the raw CertId in an OCSP SingleResponse to OcspEntry, along
  with a size field to indicate how many bytes the CertId occupies. This will
  be used in an OpenSSL compatibility function, i2d_OCSP_CERTID, which yields
  the raw bytes of the CertId.
2020-12-03 11:22:43 -06:00
Vysakh P Pillai
c31f20706b use const variable as the size for an array 2020-12-03 22:25:28 +05:30
Jacob Barthelmeh
fbf56bcf96 fix for PKCS7 decompress 2020-12-03 18:57:25 +07:00
Vysakh P Pillai
376cac5ab1 Implement review comments 2020-12-03 08:25:40 +05:30
toddouska
69d642206d Merge pull request #3513 from SparkiDev/ecc_vfy_r_s_check
ECC verify: validate r and s before any use
2020-12-02 14:33:38 -08:00
toddouska
9f5141a333 Merge pull request #3524 from SparkiDev/ocsp_resp_free
OCSP callback: call embed free in test callback
2020-12-02 13:48:09 -08:00
toddouska
b4c7b5e6ce Merge pull request #3525 from SparkiDev/tls13_session
TLS 1.3: always add session when sending finished message
2020-12-02 13:47:38 -08:00
toddouska
36b73b738b Merge pull request #3526 from SparkiDev/aes_prefetch
AES: When not X86_64, PreFetch*() not used
2020-12-02 13:28:58 -08:00
toddouska
d75a983766 Merge pull request #3527 from SparkiDev/ecc_safe
ECC add and dbl point: always use safe add and dbl
2020-12-02 13:28:10 -08:00
toddouska
0be45e731b Merge pull request #3529 from SparkiDev/ocsp_single_ext
OCSP: Handle extensions in singleResponse
2020-12-02 13:26:46 -08:00
Vysakh P Pillai
3a2675fb63 implement additional review comments 2020-12-02 22:30:02 +05:30
Vysakh P Pillai
9e475b01be implement review comments 2020-12-02 22:15:02 +05:30
Kaleb Himes
fd158411e8 Merge pull request #3494 from JacobBarthelmeh/CSharp
pin the C# verify callback
2020-12-02 06:08:41 -07:00
Vysakh P Pillai
ecc6ec4d97 support TNGTLS certificate loading for Harmony3
Changes to atmel.c file that lets a user to
1. Use Harmony3 generated configurations to initialize the device in atmel_init().
2. Read the device   certificate chain from ECC608 TNGTLS and initialize the ctx with it to use as device certificate. 
    - This is the true purpose of going with TNGTLS
2020-12-02 13:53:46 +05:30
Sean Parkinson
3d9b4f10f0 AES: When not X86_64, PreFetch*() not used
When WC_INLINE is defined then compiler doesn't mind. Otherwise, this is
a warning.
2020-12-02 09:04:48 +10:00
Juliusz Sosinowicz
0d87dfa493 EVP_Cipher should return length written. 2020-12-01 18:36:36 +01:00
Elms
dbcb42e509 SiLabs: fix unused variable #if 2020-12-01 08:56:01 -08:00
Sean Parkinson
9b5b9fd85d OCSP: Handle extensions in singleResponse 2020-12-01 16:41:20 +10:00
Elms
099ed25da8 SiLabs: fixing compiler warnings and better error checking 2020-11-30 21:01:49 -08:00
Elms
e1e8ca48c3 SiLabs: README and include updates 2020-11-30 21:01:49 -08:00
Elms
9f7ef0b3e6 SiLabs: Add ECC hardware acceleration support 2020-11-30 21:01:49 -08:00
Elms
a9f8b6e5b7 SiLabs: TRNG hardware acceleration 2020-11-30 21:01:49 -08:00
Elms
e501346047 SiLabs: add AES-CCM hardware acceleration support 2020-11-30 21:01:49 -08:00
Elms
79c31a5f2c SiLbs: SHA and AES-{GCM,CBC} hardware acceleration using se_manager 2020-11-30 21:01:49 -08:00
Elms
1899a72d27 Micrium: benchmark fixes
* Time update for v5.8 to avoid rollover issues
 * define `XSNPRINTF`
 * `printf` based on Micrium version
2020-11-30 16:32:30 -08:00
Elms
6e21f547ff Micrium: fix compiler warnings 2020-11-30 16:32:30 -08:00
Elms
0cbf8c7f28 Micrium: readme url fix and add additional link to k70 example with TCP 2020-11-30 16:32:30 -08:00
Elms
165cb443e7 Micrium v5.8 support
* OS error type change from uc OS3 to v5
 * detect if network or TCP is available
 * XMEMCMP change workaround
2020-11-30 16:32:30 -08:00
John Safranek
6fc64263f2 Merge pull request #3519 from julek-wolfssl/scr-timeout
Adapt wolfSSL_dtls_got_timeout to secure renegotiation usage
2020-11-30 11:40:35 -08:00
JacobBarthelmeh
42a63e8cc8 fix build with ARM64 SP, FP_ECC and WC_NO_CACHE_RESISTANT 2020-11-29 20:26:55 -08:00
Sean Parkinson
6bb38a1066 ECC add and dbl point: always use safe add and dbl
Can be using basepoint or public key at any time. Can't tell difference.
Always use the safe versions.
For private key operations, only working on the basepoint and will never
do any timinig different operations.
No impact on performance.
2020-11-30 11:44:50 +10:00
Sean Parkinson
22a8be412b TLS 1.3: always add session when sending finished message 2020-11-27 09:46:02 +10:00
Sean Parkinson
40154d69cf OCSP callback: call embed free
Leaks memory if not called.

Configuration:
	./configure --disable-shared --enable-ocsp --enable-sni
C_EXTRA_FLAGS="-DWOLFSSL_NONBLOCK_OCSP"
Leaking test:
	valgrind ./examples/client/client -X -C -h www.globalsign.com -p
443 -A certs/external/ca-globalsign-root.pem -g -o -N -v d -S
www.globalsign.com
2020-11-27 09:16:24 +10:00
Sean Parkinson
35acfa0f42 SP ECC: check the length of public key ordinates and private key
Do quick bit length check before loading the MP integers into fixed size
arrays.
Changed ECC to use SP key check function if SP enabled and not only with
SP Math.
2020-11-27 08:49:30 +10:00
Sean Parkinson
38740a1caa Fix dynamic type name 2020-11-27 08:37:16 +10:00
Sean Parkinson
5ca8e8f87c PKCS#11: Label fixes and add support for checking private key
Check private key matches the public key passed in.
Need to use a new API to pass in the token to use to perform PKCS #11
operations with.
2020-11-27 08:37:16 +10:00
Sean Parkinson
43aeac4cf4 PKCS #11 SSL: detect key size when certificate set 2020-11-27 08:31:45 +10:00
Sean Parkinson
19f10cd382 PKCS #11: implement identifying keys by label 2020-11-27 08:31:45 +10:00
toddouska
84a9e16805 Merge pull request #3388 from SparkiDev/aesgcm_4bit_table
AES-GCM: GMULT using 4-bit table
2020-11-25 15:45:28 -08:00
toddouska
86bbaad7fa Merge pull request #3505 from kojo1/EVP-gcm
set tag for zero inl case 2
2020-11-25 15:43:27 -08:00
toddouska
dc76a4d522 Merge pull request #3511 from cconlon/zd11268
return err from fp_invmod_slow() when fp_add() fails
2020-11-25 15:41:12 -08:00
toddouska
e882159a02 Merge pull request #3516 from cconlon/zd11287
wc_ecc_rs_to_sig(): move r and s zero check before StoreECC_DSA_Sig()
2020-11-25 15:36:30 -08:00
David Garske
9f07f3e96e Merge pull request #3520 from ejohnstown/vrf-fix
Verify Callback Fix
2020-11-25 11:37:06 -08:00
JacobBarthelmeh
1668b7060c Merge pull request #3500 from cconlon/zd11011v2
PKCS#7: verify extracted public key in wc_PKCS7_InitWithCert
2020-11-26 02:26:08 +07:00
JacobBarthelmeh
719403cd0c Merge pull request #3509 from kojo1/openssl-version
OPENSSL_VERSION_NUMBER to be defined by the user
2020-11-26 02:10:24 +07:00
toddouska
a0cd75081d Merge pull request #3514 from SparkiDev/aesni_sse4
AESNI compile flags: clang doesn't need -msse4
2020-11-25 08:55:35 -08:00
Sean Parkinson
ca5ffc0743 AESNI compile flags: clang can't have -msse4
Setting the SSE4 architecture with clang creates executables that can't
run on old machines.
2020-11-25 10:32:42 +10:00
Sean Parkinson
d0703f8931 AES-GCM: GMULT using 4-bit table
When 64-bit data type available and not big endian code is faster.
--enable-aesgcm=4bit
2020-11-25 08:47:50 +10:00
John Safranek
4baf923218 Verify Callback Fix
1. Removed a flag set that would force all certificates in a chain
   to be verified. There was a compile time option to make that happen
   already.
2. Replace some options for some test failure test cases that were added
   and immediately removed.
(ZD 11292)
2020-11-24 11:46:10 -08:00
Juliusz Sosinowicz
95132b1c55 Make renegotiation information available outside of OPENSSL_EXTRA 2020-11-24 17:03:40 +01:00
Juliusz Sosinowicz
41d58465c0 Adapt wolfSSL_dtls_got_timeout to secure renegotiation usage
Reset DTLS stored messages on a FreeHandshakeResources call even if secure renegotiation is enabled. Without this, in a server initiated rehandshake, the server would keep old messages (ChangeCipherSpec and Finished) even when it sent a HelloRequest message.
2020-11-24 16:06:35 +01:00
Sean Parkinson
b1f9aba0ca SP div: stop overflow on divide 2020-11-24 16:14:14 +10:00
Sean Parkinson
b9a2725429 ECC verify: validate r and s before any use
SP code assumes r and s are valid values.
Code for ATECC508A, ATECC608A and CRYPTOCELL assumes that the r and s
are the size of the key when converting to byte arrays.
2020-11-24 16:14:14 +10:00
John Safranek
f5c2bef78f Merge pull request #3492 from julek-wolfssl/dtls-scr-optimizations
Save the HelloRequest message just like other handshake mesasges
2020-11-20 11:50:51 -08:00
Juliusz Sosinowicz
69bea008dd Save the HelloRequest message just like other handshake mesasges
Implement a timeout mechanism for non-blocking sockets
2020-11-20 11:41:19 +01:00
John Safranek
2d79e38436 Merge pull request #3485 from julek-wolfssl/dtls-scr-seq-correct-num
Fix overlapping sequence number error.
2020-11-19 14:19:13 -08:00
Chris Conlon
64429693ff add MP_ZERO_E unit tests for wc_ecc_rs_to_sig() 2020-11-19 14:41:02 -07:00
Chris Conlon
f8fd3f8bc1 wc_ecc_rs_to_sig: check r,s for zero before StoreECC_DSA_Sig() 2020-11-19 14:35:35 -07:00
Chris Conlon
1d599272e7 add unit test for wc_PKCS7_InitWithCert() with malformed cert 2020-11-19 14:19:55 -07:00
David Garske
d4c59e369e Merge pull request #3335 from julek-wolfssl/RSA-PSS-padding-in-EVP_Digest-API
Enable RSA-PSS padding in EVP_Digest* API
2020-11-19 09:31:12 -08:00
toddouska
43f8eac8ba Merge pull request #3362 from SparkiDev/sp_math_all
Implement all relevant mp functions in sp_int
2020-11-19 08:10:11 -08:00
Sean Parkinson
91d23d3f5a Implement all relevant mp functions in sp_int 2020-11-19 11:58:14 +10:00
toddouska
aa9ed17afa Merge pull request #3512 from dgarske/openssl_pem
Fix for missing `wolfSSL_PEM_write_bio_PrivateKey` with WebRTC
2020-11-18 16:17:46 -08:00
toddouska
de6f1c1ae2 Merge pull request #3508 from JacobBarthelmeh/DH
fix for no filesystem build with DH test case
2020-11-18 16:15:42 -08:00
toddouska
3808865f57 Merge pull request #3504 from SparkiDev/fp_div_oob_read
TFM div: fix initial value of size in q so clamping doesn't OOB read
2020-11-18 16:15:08 -08:00
toddouska
ca281f976e Merge pull request #3493 from dgarske/zd11245
Sniffer fixes for handling TCP `out-of-range sequence number`
2020-11-18 16:14:09 -08:00
Takashi Kojo
7c68136a8b OPENSSL_VERSION_NUMBER to be defined by the user 2020-11-19 09:13:05 +09:00
toddouska
a280df1892 Merge pull request #3488 from kabuobeid/x509_objtxt_lname
Return long names instead of short names in wolfSSL_OBJ_obj2txt().
2020-11-18 16:10:46 -08:00
toddouska
6860d419c6 Merge pull request #3483 from SparkiDev/mp_rshb_word
rshb: handle cases of shift amount being multiple of DIGIT_BIT
2020-11-18 16:07:57 -08:00
toddouska
b0979f4225 Merge pull request #3476 from dgarske/sniffer_hrr
Fixes for TLS sniffer with v1.3 (HRR and Certs)
2020-11-18 16:07:11 -08:00
toddouska
3adeff672b Merge pull request #3472 from SparkiDev/pickhashsigalgo_rework
TLS PickHashSigAlgo: rework
2020-11-18 15:58:59 -08:00
toddouska
dedde4c058 Merge pull request #3456 from JacobBarthelmeh/Certs
strict certificate version allowed from client
2020-11-18 15:55:50 -08:00
toddouska
9183c35fb8 Merge pull request #3446 from haydenroche5/client_want_write_sim
Add an option to the example client to simulate WANT_WRITE errors.
2020-11-18 15:54:09 -08:00
toddouska
9bde34ef5b Merge pull request #3438 from douzzer/harmonize-CCM8-cipher-names
add "CCM8" variants to cipher_names "CCM-8" ciphers, for OpenSSL compat
2020-11-18 15:52:52 -08:00
Chris Conlon
f02187eef7 fix additional err returns in fp_invmod_slow() 2020-11-18 16:29:13 -07:00
Sean Parkinson
d8b58286d1 TLS 1.3: PSK only
Support building with only TLS 1.3 and PSK without code for (EC)DHE and
certificates.
Minimise build size for this configuration.
2020-11-19 09:21:24 +10:00
Chris Conlon
fa08930921 Merge pull request #3498 from ethanlooney/30th_branch
Added unit tests for blake2b
2020-11-18 13:34:21 -07:00
David Garske
4cfe5a1bc1 Fix for missing wolfSSL_PEM_write_bio_PrivateKey with WebRTC. If keygen or certgen is not specified this was incorrectly being excluded with opensslextra or opensslall. 2020-11-18 11:30:53 -08:00
Chris Conlon
68744c4da0 return err from fp_invmod_slow() when fp_add() fails 2020-11-18 10:25:15 -07:00
tmael
3b552fecc9 Merge pull request #3481 from dgarske/no_ecc
Fixes for various build configurations
2020-11-17 17:11:27 -08:00
Sean Parkinson
c17f8b58e4 Merge pull request #3506 from dgarske/sp_check_ecc
Fixes for SP math only with ECC check key
2020-11-18 09:19:54 +10:00
Ethan Looney
3692c760b9 Changed key to size BLAKE2B_KEYBYTES 2020-11-17 14:03:08 -07:00
Chris Conlon
3640bf241c Merge pull request #3507 from ethanlooney/32nd_branch
Doxygen - Removed link/button to annotated.html page as it is currently broken
2020-11-17 13:40:27 -07:00
Juliusz Sosinowicz
a0a3a2b74c Review changes 2020-11-17 19:15:12 +01:00
David Garske
508ba85b69 Fixes for SP math only with ECC check key. Fix SP math when loading an ECC public only and calling wc_ecc_check_key. Fix for missing ecc_check_privkey_gen with SP math only. Applies to: /configure --enable-sp --enable-sp-math CFLAGS="-DWOLFSSL_VALIDATE_ECC_IMPORT". 2020-11-17 08:13:08 -08:00
David Garske
8fe6186621 Merge pull request #3496 from haydenroche5/pre_commit_stash_fix
Modify pre-commit.sh to only stash and stash pop if there are modified files not add to the index
2020-11-17 07:54:50 -08:00
Juliusz Sosinowicz
b4754d5706 CAVP, Windows, and FIPS tests 2020-11-17 15:06:35 +01:00
Juliusz Sosinowicz
d18e2d7386 Refactoring and use salt length discover if available 2020-11-17 15:06:35 +01:00
Juliusz Sosinowicz
fa03113460 enum wc_HashType switch
switch needs to handle all possible enum values or else the compiler generates warnings
2020-11-17 15:04:57 +01:00
Juliusz Sosinowicz
248dd12993 Enable RSA-PSS padding in EVP_Digest* API 2020-11-17 15:04:57 +01:00
Jacob Barthelmeh
9cdbff8ee7 fix for no filesystem build with DH test case 2020-11-17 18:27:32 +07:00
Ethan Looney
7467b4c456 Removed link/button to annotated.html page as it is currently broken 2020-11-16 14:25:22 -07:00
Ethan Looney
549c446aaa Removed leftovers from merge conflict 2020-11-16 13:17:49 -07:00
David Garske
710cb7c9f5 Fixes for ECC tests with WOLFSSL_NO_MALLOC defined. 2020-11-16 12:17:30 -08:00
David Garske
e5a0a264b3 Fix for coverity report with possible use of uninitialized value "err" in WC_ECC_NONBLOCK case. More fixes for building with WOLFSSL_NO_MALLOC. 2020-11-16 12:17:28 -08:00
David Garske
40387ab0a0 Fixes for building with WOLFSSL_NO_MALLOC and/or NO_ASN_CRYPT defined. 2020-11-16 12:17:28 -08:00
David Garske
f3b176d7e3 Fix for unused parameter with NO_ASN in ECC. 2020-11-16 12:17:28 -08:00
David Garske
4a790cd024 Fixes for building with --disable-ecc and --disable-dh. 2020-11-16 12:17:27 -08:00
Ethan Looney
48f2d917b9 Added unit tests for blake2b 2020-11-16 13:06:51 -07:00
Chris Conlon
4e37036cba Merge pull request #3499 from ethanlooney/31st_branch
Added blake2s unit tests
2020-11-16 09:37:31 -07:00
JacobBarthelmeh
4efbb2fc70 Merge pull request #3418 from cconlon/zd11003
PKCS#7: check PKCS7 VerifySignedData content length against total bundle size
2020-11-16 18:14:41 +07:00
Takashi Kojo
10380c6850 (ctx->gcmBuffer != NULL && ctx->gcmBufferLen == 0) 2020-11-16 15:48:39 +09:00
Sean Parkinson
a00c75c51b DTLS MTU: check MTU on write 2020-11-16 09:30:04 +10:00
Sean Parkinson
837de435ba TFM div: fix initial value of size in q so clamping doesn't OOB read 2020-11-16 09:29:13 +10:00
David Garske
e9f0cb234b Merge pull request #3425 from haydenroche5/cmake
CMake improvements
2020-11-14 08:35:54 -08:00
Chris Conlon
c436bc44e6 verify extracted public key in wc_PKCS7_InitWithCert 2020-11-13 17:23:40 -07:00
Ethan Looney
0541a59edd Added blake2s unit tests 2020-11-13 14:43:50 -07:00
Hayden Roche
cd61fbd0fe Modify pre-commit.sh to only stash and stash pop if there are modified files not
added to the index.

Before this change, if there was nothing to stash, the last thing you stashed
would get popped at the end of the script.
2020-11-13 13:38:58 -06:00
Kareem Abuobeid
da06ef8c3f Return long names instead of short names in wolfSSL_OBJ_obj2txt(). 2020-11-13 12:03:26 -07:00
David Garske
d4e1340027 Merge pull request #3486 from douzzer/refactor-gccish-macros
sha256.c/sha512.c: refactor 4 instances of gccism ({}) to WC_INLINE functions
2020-11-13 09:26:00 -08:00
Hayden Roche
8f6c21d600 CMake improvements.
- Begin adding options to enable/disable different features.
- Increase minimum CMake version to 3.2.
- Support installation of the built files.
- Add checks for necessary include files, functions etc.
- Generate options.h and config.h.
- Use GNUInstallDirs to support installation, which is designed to be somewhat
  cross-platform.
- Export wolfssl CMake target during installation, so others using CMake can
  link against wolfssl easily.
- Disallow in-source builds.
- Place the generation of BUILD_* flags (controlled with AM_CONDITIONALs
  in configure.ac) in a separate function in functions.cmake,
  generate_build_flags.
- Implement the logic to conditionally add source files from
  src/include.am in a function in functions.cmake, generate_lib_src_list.
- Exclude tls_bench from Windows. Doesn't compile with MSVC. WIP.
- Update INSTALL with latest CMake build instructions.
- Add a cmake/include.am to ensure CMake files get added to the distribution.
2020-11-13 11:25:04 -06:00
David Garske
7f559b1d1a Merge pull request #3487 from ejohnstown/sbf
Scan-Build Fixes
2020-11-13 09:24:17 -08:00
Hayden Roche
3d5c747ed5 Modify a couple tests to use WANT_WRITE simulation. 2020-11-13 10:35:56 -06:00
Hayden Roche
2fc594d319 Modify example server to be resilient to WANT_WRITE errors. 2020-11-13 10:33:10 -06:00
Hayden Roche
e035eb8f8a Add an option to the example client to simulate WANT_WRITE errors.
- Add this option as "-6."
- Turn on non-blocking mode if WANT_WRITE simulation is enabled.
- Create a send IO callback that gets registered when this option is turned on.
  This callback alternates between letting the TX through and returning a
  WANT_WRITE error.
2020-11-13 10:30:24 -06:00
John Safranek
28be1d0cb3 Scan-Build Fixes
1. Fix some potential uninitialized pointer errors in the functions sp_RsaPublic_2048, sp_RsaPublic_3072, and sp_RsaPublic_4096 for small stack builds.

To recreate:
    $ scan-build ./configure --enable-sp=small --enable-smallstack --enable-smallstackcache CPPFLAGS="-DECC_CACHE_CURVE -DHAVE_WOLF_BIGINT"
2020-11-12 20:58:25 -08:00
John Safranek
1e348b991d Scan-Build Fixes
1. Fix a potential dereference of NULL pointer.

To recreate:
    $ scan-build ./configure --enable-sp --enable-sp-asm --enable-sp-math
2020-11-12 20:58:17 -08:00
Jacob Barthelmeh
3773d33070 pin the C# verify callback 2020-11-13 11:57:20 +07:00
JacobBarthelmeh
a8333b09a0 memory cleanup with test case 2020-11-12 20:24:47 -08:00
David Garske
f02cc650a2 Fixes for handling TCP out-of-range sequence number. 2020-11-12 16:09:09 -08:00
David Garske
c7053e9a36 Fix scenario where FreeHandshakeResources is called and server hello is recevied and WOLFSSL arrays is NULL. 2020-11-12 16:09:00 -08:00
Chris Conlon
53c6698678 Merge pull request #3445 from kojo1/EVP-gcm
set tag for zero inl case
2020-11-12 15:49:45 -07:00
Chris Conlon
735fb19ea9 break out on error parsing PKCS#7 SignedData inner OCTET_STRING 2020-11-12 15:44:25 -07:00
David Garske
b931b1bd4d Fix to not allow free for globally cached sessions. Resolves a false-positive scan-build warning. 2020-11-12 12:51:41 -08:00
John Safranek
38867ae2bf Scan-Build Fixes
1. Added a check to see if the "d" in sp_div() ended up with a negative used length. Return error if so.

To recreate:
    $ scan-build ./configure --enable-sp --enable-sp-asm --enable-sp-math
2020-11-12 10:24:11 -08:00
David Garske
cdf44f6ff6 Pass static ephemeral keys for TLS v1.2 as well. 2020-11-12 09:18:24 -08:00
John Safranek
e996a7d15b Scan-Build Fixes
1. Fixed a couple possible 0 byte allocations.
2. Fixed a couple missed frees due to error conditions.
3. Fixed a possible double free.

To recreate:
    $ scan-build ./configure --disable-shared --enable-opensslextra=x509small --disable-memory
    $ scan-build ./configure --disable-shared --enable-opensslextra --disable-memory
2020-11-12 09:06:59 -08:00
David Garske
a6f2081af1 Fixes for key loading errors in snifftest application. 2020-11-12 08:59:11 -08:00
David Garske
a53b734c83 Fix for client_hello keyshare with multiple entries. Fix for change_cipher_spec after finished. 2020-11-12 08:59:11 -08:00
David Garske
ea21ddf540 Fix to only free existing key in SetStaticEphemeralKey if the incoming algorithm type has been specified. 2020-11-12 08:59:11 -08:00
David Garske
5cda549d00 Allow passing multiple keys (comma separated) with the sniffer test tool. This allows setting both DH and ECC static ephemeral keys. Do not fail on resume not found. 2020-11-12 08:59:11 -08:00
David Garske
720919198f Fix for Scan-buld and when building without ECC or DH. 2020-11-12 08:59:11 -08:00
David Garske
71d9f1e9bd Static ephemeral refactor to support loading both DHE and ECDHE keys. Added ability to specify key using snifftest input at run-time. Improved snifftest key loading for named keys and static ephemeral. 2020-11-12 08:59:11 -08:00
David Garske
1c87f3bdc1 Improve sniffer resume logic. 2020-11-12 08:59:10 -08:00
David Garske
d208779974 Added test case for TLS v1.3 with HRR (hello_retry_request) 2020-11-12 08:59:10 -08:00
David Garske
b74f0fb6b8 Fixes for sniffer with hello_retry_request. Fix for TLS v1.3 certificate processing. 2020-11-12 08:59:10 -08:00
David Garske
c7bb602a30 Merge pull request #3482 from douzzer/scan-build-fixes-20201110
scan-build fixes -- 1 null deref, 34 unused results
2020-11-12 07:45:45 -08:00
Daniel Pouzzner
1cbc2e8608 openssl.test: recognize TLS13-AES128-CCM-8-SHA256 and TLS13-AES128-CCM8-SHA256 as equivalent while iterating through $wolf_ciphers. 2020-11-11 23:23:28 -06:00
Daniel Pouzzner
7850d71ccb add wolfSSL_get_cipher_suite_from_name(); add flags arg to GetCipherSuiteFromName(); fix GetCipherSuiteFromName() to prevent spurious substring matching; add SUITE_ALIAS() macros for use defining CipherSuiteInfo, and add CipherSuiteInfo.flags slot and associated logic, to allow alternative cipher names to be recognized; add "CCM8" cipher name variants wherever applicable, including the unit.test conf files, to recognize and test the OpenSSL variants; add tests in client_test() and server_test() to confirm correct forward and backward mapping of cipher names/aliases. 2020-11-11 22:47:47 -06:00
Daniel Pouzzner
68ebca8573 wolfcrypt/test/test.c: fix typos in aesgcm_test() malloc checks. 2020-11-11 22:47:47 -06:00
toddouska
d3e3b21c83 Merge pull request #3393 from dgarske/zd11104
Fix for TLS ECDH (static DH) with non-standard curves
2020-11-11 14:22:37 -08:00
toddouska
197c85289b Merge pull request #3468 from SparkiDev/sp_c_mul_d
SP C32/64 mul_d: large div needs mul_d to propagate carry
2020-11-11 14:06:25 -08:00
Daniel Pouzzner
f96fbdb7d1 sha256.c/sha512.c: refactor 4 instances of gccism ({}) to WC_INLINE functions. 2020-11-11 13:44:26 -06:00
Daniel Pouzzner
5fe1586688 fix 34 deadcode.DeadStores detected by llvm11 scan-build. 2020-11-11 13:04:14 -06:00
JacobBarthelmeh
fe2dcf76fe Merge pull request #3413 from cconlon/zd11011
PKCS#7: check PKCS7 SignedData private key is valid before using it
2020-11-11 22:55:03 +07:00
Jacob Barthelmeh
4705ebde88 add guard on test case for cert gen 2020-11-11 21:53:52 +07:00
Juliusz Sosinowicz
d49038ae24 Fix overlapping sequence number error.
wolfSSL wants to use the same sequence number for the ServerHello as the ClientHello. This is an issue when this sequence number is already taken.
2020-11-11 15:35:05 +01:00
Jacob Barthelmeh
979216d595 add test case for rejecting version 2 x509 2020-11-11 18:57:09 +07:00
Sean Parkinson
5f0d788bfb TLS PickHashSigAlgo: rework
Make default to pick lowest hash with RSA and ECC (TLS 1.2 and lower).
WOLFSSL_STRONGEST_HASH_SIG picks the strongest hash.
WOLFSSL_ECDSA_MATCH_HASH will pick the hash to match the ECC curve.
2020-11-11 10:06:09 +10:00
Sean Parkinson
f5561b926c rshb: handle cases of shift amount being multiple of DIGIT_BIT
tfm.c and integer.c fixed
2020-11-11 10:04:14 +10:00
Takashi Kojo
d7ea8b953b fold long lines 2020-11-11 08:43:16 +09:00
Takashi Kojo
eab3bf9ab4 Add a test case for zero len plain text 2020-11-11 08:43:16 +09:00
Takashi Kojo
417ff1b0f2 set tag for zero len case 2020-11-11 08:43:16 +09:00
David Garske
68209f91fb Merge pull request #3465 from kaleb-himes/DOX_UPDATE_wc_RsaPublicEncrypt
Address report on issue #3161
2020-11-10 14:52:20 -08:00
David Garske
fcd73135f5 Merge pull request #3479 from tmael/ocsp_NULL
Check <hash> input parameter in GetCA
2020-11-10 14:46:05 -08:00
Daniel Pouzzner
958fec3b45 internal.c:ProcessPeerCerts(): fix a core.NullDereference detected by llvm9 and llvm11 scan-builds. 2020-11-10 16:40:28 -06:00
Chris Conlon
7b50cddf8c Merge pull request #3387 from ethanlooney/27th_branch
Added unit test for evp.c
2020-11-10 13:27:33 -07:00
David Garske
8645e9754e Only set ssl->ecdhCurveOID if not already populated. 2020-11-10 09:47:38 -08:00
David Garske
1d531fe13b Peer review fixes. 2020-11-10 09:47:37 -08:00
David Garske
fa1af37470 Fix for FIPS ready CAVP tests. For now it requires ECC 192-bit. 2020-11-10 09:47:37 -08:00
David Garske
5de80d8e41 Further refactor the minimum ECC key size. Adds --with-eccminsz=BITS option. Fix for FIPSv2 which includes 192-bit support. If WOLFSSL_MIN_ECC_BITS is defined that will be used. 2020-11-10 09:47:37 -08:00
David Garske
b13848e568 Fix tests to handle ECC < 224 not enabled. 2020-11-10 09:47:37 -08:00
David Garske
6bd98afdd0 Only allow TLS ECDH key sizes < 160-bits if ECC_WEAK_CURVES is defined. 2020-11-10 09:47:37 -08:00
David Garske
c697520826 Disable ECC key sizes < 224 bits by default. Added --enable-eccweakcurves or ECC_WEAK_CURVES to enable smaller key sizes. Currently this option is automatically enabled if WOLFSSL_MIN_ECC_BITS is less than 224-bits. 2020-11-10 09:47:36 -08:00
David Garske
62dca90e74 Fix for server-side reporting of curve in wolfSSL_get_curve_name if client_hello includes ffdhe, but ECC curve is used. 2020-11-10 09:47:36 -08:00
David Garske
d7dee5d9e6 Fix for ECC minimum key size, which is 112 bits. 2020-11-10 09:47:36 -08:00
David Garske
6ac1fc5cff Fix include.am typo. 2020-11-10 09:47:36 -08:00
David Garske
10f459f891 Added TLS v1.2 and v1.3 test cases for ECC Koblitz and Brainpool curves (both server auth and mutual auth). Cipher suites: ECDHE-ECDSA-AES128-GCM-SHA256, ECDH-ECDSA-AES128-GCM-SHA256 and TLS13-AES128-GCM-SHA256. 2020-11-10 09:47:36 -08:00
David Garske
fb9ed686cb Fix for TLS with non-standard curves. The generted ECC ephemeral key did not use the same curve type as peer. Only the server was populating ssl->ecdhCurveOID. Now the curveOID is populated for both and as a fail-safe the peer key curve is used as default (when available). 2020-11-10 09:47:36 -08:00
David Garske
045fc4d686 Fixes to support overriding minimum key sizes for examples. 2020-11-10 09:47:36 -08:00
David Garske
bfb6138fc5 Merge pull request #3480 from douzzer/fix-sniffer-printf-null-Wformat-overflow
TraceSetNamedServer() null arg default vals; FIPS wc_MakeRsaKey() PRIME_GEN_E retries; external.test config dependencies
2020-11-10 09:37:36 -08:00
Daniel Pouzzner
5625929c83 scripts/external.test: skip test when -UHAVE_ECC. 2020-11-10 01:27:45 -06:00
Daniel Pouzzner
196ae63eb2 scripts/external.test: skip test when -DWOLFSSL_SNIFFER (staticCipherList in client.c is incompatible). 2020-11-10 00:03:02 -06:00
Daniel Pouzzner
bd38124814 ssl.c: refactor wolfSSL_RSA_generate_key() and wolfSSL_RSA_generate_key_ex() to retry failed wc_MakeRsaKey() on PRIME_GEN_E when -DHAVE_FIPS, matching non-FIPS behavior, to eliminate exposed nondeterministic failures due to finite failCount. 2020-11-09 21:24:34 -06:00
toddouska
3050f28890 Merge pull request #3467 from cconlon/rc2vs
rc2.c to Visual Studio projects, fix warnings
2020-11-09 13:52:03 -08:00
David Garske
f02c3aab2e Merge pull request #3475 from ejohnstown/nsup
Hush Unused Param Warning
2020-11-09 11:04:05 -08:00
Daniel Pouzzner
4b1a779fcc tests: fix for fips-test -Wunused-variable on "rng" 2020-11-09 11:54:49 -06:00
David Garske
7e3efa3792 Merge pull request #3474 from douzzer/lighttpd-update-1.4.56
lighttpd support update for v1.4.56
2020-11-09 09:24:58 -08:00
Tesfa Mael
a5caf1be01 Check for NULL 2020-11-09 08:45:48 -08:00
Daniel Pouzzner
22bcceb2d3 src/sniffer.c: guard against null arguments to TraceSetNamedServer(), to eliminate -Werror=format-overflow= warnings from gcc. 2020-11-06 17:40:12 -06:00
Chris Conlon
c0c452b0a1 reset content length in PKCS7_VerifySignedData for multiPart OCTET_STRING bundles 2020-11-06 16:36:58 -07:00
Kaleb Himes
937a7ce8ce Merge pull request #3448 from dgarske/crypto_cb
Improve the crypto callback for ASN
2020-11-06 15:26:11 -07:00
John Safranek
884a9b59ab Merge pull request #3461 from dgarske/fips_ready_wopensslextra
Fix for FIPS ready with openssl compat
2020-11-06 13:14:06 -08:00
Ethan Looney
a6e0d3eb29 Changed hardcoded values to variables, changed where some variables were defined, etc 2020-11-06 14:04:27 -07:00
Chris Conlon
ac4c8a0112 Merge pull request #3419 from ethanlooney/29th_branch
Added case for Logging.c unit test
2020-11-06 13:10:24 -07:00
toddouska
4110297b62 Merge pull request #3473 from embhorn/zd11198
wc_SetIssuerRaw should copy raw subject to issuer
2020-11-06 10:48:37 -08:00
toddouska
b4e7f196df Merge pull request #3470 from SparkiDev/config_fix_3
TLS configurations fixes
2020-11-06 10:35:51 -08:00
toddouska
3f25cda354 Merge pull request #3469 from SparkiDev/cpuid_sp_asm
cpuid and SP ASM: ensure WOLFSSL_X86_64_BUILD is defined
2020-11-06 10:34:40 -08:00
John Safranek
abd6f6ce18 Hush Unused Param Warning
Removed a guard check for NO_WOLFSSL_STUB from wolfSSL_X509_print_ex().
To recreate:

    $ ./configure --enable-opensslextra CPPFLAGS="-DNO_WOLFSSL_STUB"
    $ make
2020-11-06 10:30:47 -08:00
toddouska
f3d961b1b1 Merge pull request #3453 from dgarske/ZD11159
Fix for possible memory leak when overriding error for verify callback
2020-11-06 10:18:52 -08:00
toddouska
f9ec7c472a Merge pull request #3440 from ejohnstown/ntf3
Nightly Test Fix
2020-11-06 10:15:23 -08:00
Hayden Roche
2cad844d29 Merge pull request #3421 from dgarske/apache_httpd
Apache httpd w/TLS 1.3 support
2020-11-06 12:14:58 -06:00
David Garske
0d2e28ce80 Fix for error: unused function 'MonthStr' 2020-11-06 10:11:48 -08:00
Daniel Pouzzner
dcff103c84 tests/api.c: fixes for compilability re NO_BIO 2020-11-05 22:19:16 -06:00
Daniel Pouzzner
4030523eb5 ssl.c: remove duplicate definition of wolfSSL_CTX_check_private_key(). 2020-11-05 21:57:33 -06:00
Glenn Strauss
f9e48ee361 build updates for lighttpd: recommend -DNO_BIO
(cherry picked from commit bfe12839e18ccc3ab95cfc33b34c875ebe55c14a)
2020-11-05 20:40:43 -06:00
Glenn Strauss
92c3296e13 preprocessor -DNO_BIO to omit OpenSSL BIO API 2020-11-05 20:40:43 -06:00
Glenn Strauss
030eb9347c lighttpd: allow ssl3, tls1.0 if explicitly enabled 2020-11-05 20:40:43 -06:00
Glenn Strauss
7cee131e37 restore --enable-lighty with --enable-all
protect lighttpd recommendations (and recommended restrictions)
to when building wolfSSL specifically for use by lighttpd, and
omit these optional settings when building `--enable-all`
2020-11-05 20:40:43 -06:00
David Garske
a9a495270c Fix to disable CRL monitor for single threaded or lighttpd. Do not set --enable-lighty with --enable-all. 2020-11-05 20:40:43 -06:00
Glenn Strauss
daca327ba3 expose (get|set)_(app|ex)_data with HAVE_EX_DATA
when OPENSSL_EXTRA_X509_SMALL is set
2020-11-05 20:40:43 -06:00
Glenn Strauss
d01616a357 unhide some non-fs funcs hidden by NO_FILESYSTEM 2020-11-05 20:40:43 -06:00
Glenn Strauss
bcf1f0375b build updates for lighttpd: recommended flags 2020-11-05 20:40:43 -06:00
Glenn Strauss
f4e2db831e enable SNI_Callback for lighttpd 2020-11-05 20:40:43 -06:00
Glenn Strauss
be7592fb43 implement wolfSSL_dup_CA_list()
wolfSSL_dup_CA_list() duplicates a WOLF_STACK_OF(WOLFSSL_X509_NAME)

(replaces stub function)
2020-11-05 20:40:43 -06:00
Glenn Strauss
e5ed227a87 build updates for lighttpd: -DOPENSSL_ALL
avoid potential for WolfSSL to silently omit expected functionality
2020-11-05 20:40:43 -06:00
Glenn Strauss
503de43cbd build updates for lighttpd
Update configure.ac and various #ifdefs to enable WolfSSL to
build features for use by lighttpd.

Change signature of wolfSSL_GetVersion() to take const arg.
Pass (const WOLFSSL*) to wolfSSL_GetVersion() for use with
SSL_CTX_set_info_callback(), where OpenSSL callback takes (const SSL *)
2020-11-05 20:40:43 -06:00
kaleb-himes
182a3e6bc2 Also addressing opensslall, pkcs7 and combinations 2020-11-05 17:29:30 -07:00
Ethan Looney
232ac03bbe Changed it to only the inverse 2020-11-05 14:38:23 -07:00
Ethan Looney
0aee4b78cd Changed md5 to sha256 in DigestFinal_ex function 2020-11-05 14:36:42 -07:00
Eric Blankenhorn
a92e31f6cb Fix from review 2020-11-05 14:47:10 -06:00
David Garske
d784bd61cd Merge pull request #3462 from kabuobeid/wolfrand_freescale_ecc_fix
Fix build issue when building wolfrand on a Freescale platform.
2020-11-05 12:29:49 -08:00
Ethan Looney
06f1a1870d Added inverse case 2020-11-05 13:05:15 -07:00
David Garske
1dc7293b19 Fix the return code. openssl uses void on these, but let's go ahead and do a return code. 2020-11-05 09:31:12 -08:00
David Garske
063fb2cfa0 Merge pull request #3455 from douzzer/linuxkm-install-rules
add "module", "modules_install", and "clean_module" rules for linuxkm
2020-11-05 09:09:35 -08:00
Kaleb Himes
648c5e4735 Merge pull request #3471 from douzzer/fix-scan-build-20201104
fix various possibly spurious scan-build null deref reports.
2020-11-05 09:36:42 -07:00
Eric Blankenhorn
fa9a0a4b49 Copy raw subject to issuer 2020-11-05 09:06:02 -06:00
Daniel Pouzzner
5751319e00 fix various possibly spurious scan-build null deref reports. 2020-11-04 23:11:42 -06:00
Kaleb Himes
b40543b342 Merge pull request #3466 from douzzer/fix-benchmark-dh-key-size
fix bench_dh() key size initialization
2020-11-04 20:33:06 -07:00
Sean Parkinson
78309cd7aa SP C32/64 mul_d: large div needs mul_d to propagate carry
Change implementation to pre-calc products to allow for reordering of
operations.
2020-11-05 12:50:33 +10:00
Sean Parkinson
8a42ee7ffd TLS configurations fixes
--enable-leanpsk --disable-tls13:
    ensure WriteSEQ is defined when !WOLFSSL_NO_TLS12 (tls.c)

CFLAGS=-DWOLFSSL_NO_CLIENT_AUTH -disable-tls13"
TLS server was expecting certificate from peer when verifyPeer is
set. Fix with checks for !WOLFSSL_NO_CLIENT_AUTH.
2020-11-05 12:21:19 +10:00
Sean Parkinson
2588fe366e cpuid and SP ASM: ensure WOLFSSL_X86_64_BUILD is defined
WOLFSSL_X86_64_BUILD is defined only when fast math is enabled.
Define it when SP ASM is enabled and on an x86_64 host.
Undo cpuid code being enabled when WOLFSSL_SP_ASM as it shouldn't for
non-Intel CPUs.
2020-11-05 11:16:27 +10:00
Kareem Abuobeid
37952b2776 Fix build issue when building wolfrand on a Freescale platform. 2020-11-04 16:52:59 -07:00
David Garske
3b4ec74174 Fixes for openssl compatibility. Added SSL_CTX_set_post_handshake_auth and SSL_set_post_handshake_auth API's for enabling or disabling post handshake authentication for TLS v1.3. 2020-11-04 15:05:50 -08:00
David Garske
eb19306f16 Merge pull request #3459 from haydenroche5/sniffer_fixes
Fix a couple of issues related to the sniffer.
2020-11-04 14:09:43 -08:00
Daniel Pouzzner
2d149b1bef benchmark.c: backport fixes to bench_dh() DH key size initialization from SparkiDev:sp_math_all. 2020-11-04 15:35:58 -06:00
Daniel Pouzzner
3858bda7e9 add "module", "modules_install", and "clean_module" rules to BUILD_LINUXKM section of Makefile.am, and add working install rule to linuxkm/Makefile, so that "make module" and "make modules_install" now work when --enable-linuxkm; fix "make dist" logic in Makefile.am and scripts/include.am to be unaffected by --enable-linuxkm; don't build wolfcrypt/benchmark or testwolfcrypt when --enable-linuxkm and --enable-crypttests. 2020-11-04 14:13:39 -06:00
Chris Conlon
6953049305 fix Visual Studio type conversion warnings 2020-11-04 11:11:40 -07:00
Chris Conlon
83b0847e66 add rc2.c to Visual Studio projects 2020-11-04 10:37:47 -07:00
kaleb-himes
288ad68b4d Address report on issue #3161 2020-11-04 10:37:46 -07:00
Hayden Roche
3b1c536418 Fix a couple of issues related to the sniffer.
- Fix an issue in sniffer.c where some pointer math was giving a warning.
- Fix an issue in snifftest.c where a local variable was never read.
- Ignore non-TCP/IP packets in snifftest.c. Fixes some tests with pcaps with
  other types of packets.
2020-11-04 10:46:11 -06:00
David Garske
00dd22adc4 Merge pull request #3464 from SparkiDev/sha512_valgrind_fix
SHA-512 AVX2: use register for wk other than rsp
2020-11-04 07:15:04 -08:00
Sean Parkinson
235ea98b90 SHA-512 AVX2: use register for wk other than rsp
Valgrind thinks that stack values are uninitialised when the stack
pointer is added to.
The asm code was moving rsp around rather than use another register.
Put length to hash onto stack and use that register instead.
2020-11-04 12:02:34 +10:00
toddouska
b76ac0b842 Merge pull request #3442 from SparkiDev/config_fix_2
Configuration fixes
2020-11-03 14:48:49 -08:00
toddouska
e52efc7a8a Merge pull request #3441 from SparkiDev/ecdsa_vfy_safe
ECDSA verification: handle doubling of infinity
2020-11-03 14:47:45 -08:00
toddouska
2acef1c114 Merge pull request #3436 from haydenroche5/chacha_msvc_fix
Fix MSVC compile issue in chacha.c.
2020-11-03 14:44:43 -08:00
toddouska
63bf5dc56c Merge pull request #3426 from SparkiDev/rsa_pss_fix
RSA-PSS: Handle edge case with encoding message to hash
2020-11-03 14:43:56 -08:00
toddouska
3cce86d7a8 Merge pull request #3420 from dgarske/small_pk
ECC memory reductions with key and signature parsing
2020-11-03 14:42:43 -08:00
toddouska
9f9901e10e Merge pull request #3417 from douzzer/fix-ipv6-ocsp-tests
Fix ipv6 ocsp tests
2020-11-03 14:38:32 -08:00
David Garske
d6b219bd38 Fix for ./configure --enable-fips=ready --enable-opensslextra. 2020-11-03 14:23:08 -08:00
Ethan Looney
813a94ab9a Added bad and good case to EVP_DigestFinal_ex test 2020-11-03 14:57:30 -07:00
Jacob Barthelmeh
39d0b032e8 strict certificate version allowed from client 2020-11-03 19:30:56 +07:00
David Garske
f8176dd646 Merge pull request #3454 from SparkiDev/sp_def_fix
SP C64/32: Fix define check
2020-11-02 17:07:56 -08:00
Sean Parkinson
b3f6c483bf SP C64/32: Fix define check
WOLFSSL_SP_DH -> WOLFSSL_HAVE_SP_DH
2020-11-03 08:42:55 +10:00
Ethan Looney
48073fb678 Removed unnecessary test 2020-11-02 14:22:01 -07:00
Ethan Looney
cf05a060f7 Removed cases that caused fips test to fail 2020-11-02 14:16:02 -07:00
Ethan Looney
05d01dcccd Added if defined checks for rc4 and fips 2020-11-02 14:11:07 -07:00
Ethan Looney
251f3e15d4 Added fips check for specific size 2020-11-02 14:11:07 -07:00
Ethan Looney
7412374496 Changed from hardcoded values, changed types and deleted comments 2020-11-02 14:11:07 -07:00
Ethan Looney
8122c031bf Added ifdef's, changed key sizes to relevant sizes 2020-11-02 14:11:07 -07:00
Ethan Looney
b46f87ffe6 Added unit test for evp.c 2020-11-02 14:11:07 -07:00
David Garske
89c39dcfe5 Fix for possible memory leak when overriding error for verify callback on cert 0 (peer) if OPENSSL_EXTRA or OPENSSL_EXTRA_X509_SMALL and KEEP_PEER_CERT is not defined. 2020-11-02 12:04:56 -08:00
John Safranek
29c7351fe0 Merge pull request #3383 from kaleb-himes/ACVP_TESTING_UPDATE
In ACVP testing NIST needs to see failed decryption output
2020-11-02 10:42:28 -08:00
Chris Conlon
87abb5257e Merge pull request #3447 from dgarske/microchip
Fixes for building with Microchip
2020-11-02 10:09:13 -07:00
JacobBarthelmeh
a411dab74f Merge pull request #3410 from cconlon/zd11001
PKCS#7: Reset variables correctly in VerifySignedData
2020-11-02 11:33:52 +08:00
John Safranek
d24add10f2 Nightly Test Fix
When performing a fast_mp_montgomery_reduce(), scan-build didn't like
that the destination buffer was fully zeroed out. We were only zeroing
what was expected to be used. This zeroes only the expected to be used
section of the output buffer.
2020-11-01 18:58:05 -08:00
David Garske
0df5079f8b Fixes for building with Microchip. The min/max patch allows non PIC32MZ parts to build in MPLABX. The cryptoauthlib already defines SHA_BLOCK_SIZE, so undef to prevent redef error. 2020-10-30 12:46:14 -07:00
Ethan Looney
8728eaf93f Removed duplicate return check and added return check 2020-10-30 13:19:12 -06:00
David Garske
64b081f3c9 Improve the SHA256 crypto callback for ASN, so a wc_Sha/wcSha256 context exists for certificate hashing. 2020-10-30 12:18:19 -07:00
Chris Conlon
54fe98716d Merge pull request #3415 from kojo1/config-options
Config options
2020-10-30 11:55:11 -06:00
David Garske
e4f3f8b80a Further tuning of the zero trim / is leading set logic for new ECC signature encoding/decoding API's. 2020-10-29 15:59:51 -07:00
Sean Parkinson
bd3841c7d1 Merge pull request #3444 from julek-wolfssl/aad-reset
AAD should be reset on Init call
2020-10-30 08:11:26 +10:00
David Garske
95c8a48285 Trim leading zero's first, then check for MSB being set. 2020-10-29 08:38:55 -07:00
Juliusz Sosinowicz
aff14091e0 AAD should be reset on Init call 2020-10-29 12:13:35 +01:00
Sean Parkinson
320afab227 Configuration fixes
--enable-sp --enable-sp-asm --disable-fastmath:
    cpuid.h - check for WOLFSSL_SP_ASM as well

-enable-curve448 --enable-ed448 --disable-rsa --disable-dh
--enable-tls13 --disable-ecc --enable-certgen --enable-keygen:
    api.c - certificate loaded that was RSA but RSA disabled

--enable-sp --enable-sp-asm --enable-sp-math:
    cpuid.c - check for WOLFSSL_SP_ASM as well

--disable-shared --disable-ecc --disable-dh --enable-cryptonly
--enable-rsavfy --disable-asn --disable-rng --disable-filesystem:
    test.c - rsa_test()

'CC=clang -fsanitize=address' '-enable-distro' '--enable-stacksize':
testsuit.c - echoclient_test_wrapper needs to free ECC FP cache when
it is in a separate thread
2020-10-29 16:21:06 +10:00
Sean Parkinson
32ea0910de ECDSA verification: handle doubling of infinity 2020-10-29 12:12:01 +10:00
David Garske
ef7a987759 Peer review fixes. 2020-10-28 17:09:15 -07:00
Daniel Pouzzner
7d177e78d7 don't include wolfssl/options.h in logging.c, use AM_CFLAGS (not wolfssl/options.h) to communicate HAVE_WC_INTROSPECTION to the compiler, and use config.h (not wolfssl/options.h) to communicate LIBWOLFSSL_CONFIGURE_ARGS and LIBWOLFSSL_GLOBAL_CFLAGS to the compiler (for logging.c). 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
fda84576b0 name the new introspection routines wolfSSL_configure_args() and wolfSSL_global_cflags() for consistency, and move the prototypes to logging.h. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
139b0431cb ocsp-stapling*.test: prefix waited servers with "timeout 60" to avoid deadlock failure modes; grep output from "openssl s_client" in "test interop fail case" for expected error message ("self signed certificate in certificate chain"). 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
a5d96721ac wolfcrypt/src: remove wc_debug.c and move its contents to logging.c. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
0568ec304f pass -4 flag to openssl and nc only when IPV6_SUPPORTED. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
94a3f86dcd scripts/ocsp-stapling*.test: check if IPv6 is supported by the installed openssl and nc executables, and if not, don't attempt to wrestle the version. with no IPv6 support, and an --enable-ipv6 wolfssl build, skip the test entirely. also, restore a couple -b (bind-all-interfaces) flags to examples/server/server recipes in case that's useful. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
94d4ea3a57 examples/client/client.c:client_usage_msg[][]: add correct sensing and reporting of WOLFSSL_SP_4096. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
1ba0883f4c introspection tweaks: rename wolfcrypt/src/debug.c to wolfcrypt/src/wc_debug.c; restore BUILD_WC_DEBUG gating for autotools inclusion of wc_debug.o and disable opportunistically when ENABLED_LEANTLS, ENABLED_LEANPSK, or ENABLED_LOWRESOURCE; add HAVE_WC_INTROSPECTION gate for libwolfssl_configure_args() and libwolfssl_global_cflags(). 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
f37c25f9c0 wc_XChaCha20Poly1305_crypt_oneshot(): use ForceZero, not XMEMSET(), to safely clear the AEAD state before return. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
7a5cbaa9bc fix scripts/ocsp-stapling*.test to accommodate IPv6 examples/ client/server build. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
b918e1fd4c examples/: add -@ and -# flags to client and server, printing libwolfssl_configure_args() and libwolfssl_global_cflags() respectively. 2020-10-28 17:28:05 -05:00
Daniel Pouzzner
8be2d7690a add API functions libwolfssl_configure_args() and libwolfssl_global_cflags() to retrieve build parameters at runtime. 2020-10-28 17:28:01 -05:00
toddouska
931eea30f5 Merge pull request #3397 from cconlon/rc2
RC2 ECB/CBC and PKCS#12 Integration
2020-10-28 15:06:47 -07:00
Hayden Roche
90258b6f34 Fix MSVC compile issue in chacha.c.
Use XMEMSET instead of initializing with {}.
2020-10-28 14:57:59 -05:00
toddouska
112cce8cf2 Merge pull request #3407 from SparkiDev/pkcs11_sign_vfy
PKCS #11: changes for signing and loading RSA public key from private
2020-10-28 12:53:58 -07:00
toddouska
6a98601895 Merge pull request #3427 from SparkiDev/ecdsa_shamir_precomp
ECC Shamir's Trick: infinity in precomp
2020-10-28 12:08:40 -07:00
toddouska
3a9758f257 Merge pull request #3433 from dgarske/sniffer_sni
Fix for Sniffer with SSLv3 where SNI is not supported
2020-10-28 12:06:37 -07:00
David Garske
a15769b12e Merge pull request #3435 from ejohnstown/ntf2
Nightly Test Fix 2
2020-10-28 06:39:15 -07:00
Hayden Roche
91f0d8bfef Fix MSVC compile issue in chacha.c.
MSVC generates a syntax error when you initialize
an array with {}. {0} has the same effect and compiles.
2020-10-27 21:14:15 -05:00
David Garske
4277ec62f9 Merge pull request #3431 from kaleb-himes/NO_FILESYSTEM_FIX
Remove file system constraint on wolfSSL_CTX_check_private_key()
2020-10-27 15:25:59 -07:00
John Safranek
6a77a8d8d6 Compatibility Layer
When making a AUTHORITY KEY object, if the ASN1 OBJECT fails, the key object is leaked.
2020-10-27 14:51:35 -07:00
David Garske
a43d239271 Fix for Sniffer with SSLv3 where SNI is not supported. ZD 11169. 2020-10-27 11:26:02 -07:00
David Garske
76e84e0830 Merge pull request #3423 from ejohnstown/nightly-test-fix
Nightly Scan-Build Test Fixes
2020-10-27 08:31:19 -07:00
kaleb-himes
f934fb03bd Remove file system constraint on wolfSSL_CTX_check_private_key() 2020-10-27 08:57:46 -06:00
Sean Parkinson
fb2288c46d RSA-PSS: Handle edge case with encoding message to hash
When the key is small relative to the digest (1024-bit key, 64-byte
hash, 61-byte salt length), the internal message to hash is larger than
the output size.
Allocate a buffer for the message when this happens.
2020-10-27 12:39:06 +10:00
John Safranek
7dbd6102d2 Compatibility Layer
When wolfSSL_X509_NAME_ENTRY_create_by_txt() needs to make a new ASN.1 object ID, actually store it in the name entry.
2020-10-26 16:10:44 -07:00
David Garske
2ebb47ec32 Merge pull request #3424 from douzzer/fix-save-vector-registers-gating
wc_port.h: improve/fix gating on {SAVE,RESTORE}_VECTOR_REGISTERS()
2020-10-26 15:33:00 -07:00
Daniel Pouzzner
fd5a309a47 wc_port.h: improve gating on {SAVE,RESTORE}_VECTOR_REGISTERS() to assure no-op fallback definitions in non-autotools builds. 2020-10-26 12:06:18 -05:00
Sean Parkinson
74b834a78c Merge pull request #3422 from ejohnstown/ecc-name
Tautological Name Fix
2020-10-26 10:12:51 +10:00
John Safranek
9c1049f112 Compatibility Layer
1. Changed the ASN1_OBJECT member of the X509_NAME_ENTRY to be a pointer
   rather than an object. It could lead to a double free on the name
   entry.
2. The ASN1_OBJECT allocator should set the dynamic flag, as the
   deallocator is the one that uses it.
3. General changes to treat the member as a pointer rather than a
   member.
4. In the api test, we were iterating over the name members in the name
   checking the NIDs. After the loop we freed the name member object.
   This led to a double free error.
2020-10-25 14:38:07 -07:00
John Safranek
f5f883597e RSA PSS Fix
1. Change the utility function in wc_encrypt that returns the size of a
   hash to initialize the size to HASH_TYPE_E, like the other utility
   functions.
2. When getting the hash size returns an error, RSA-PSS verify inline
   should return a BAD_FUNC_ARG error.
2020-10-24 13:06:42 -07:00
John Safranek
3f5620089e PKCS7: In EncodeEncryptedData, free the attribs and flattenedAttribs if
they were allocated, not based on if they should be allocated.
2020-10-24 12:41:10 -07:00
John Safranek
bfccf35eaf Tautological Name Fix
Depending on the build option WOLFSSL_ECC_CURVE_STATIC, the name in the
ecc_set may be a pointer (default) or an array. With the above set with
the CFLAG -Wtautological-pointer-compare you'll get a build error.
Changed the comparison in the for loop with this problem to check the
name's pointer only if appropriate.
2020-10-23 15:23:16 -07:00
Takashi Kojo
277edbb514 fix for --disable-tls13 --enable-sniffer 2020-10-24 07:14:43 +09:00
Takashi Kojo
02536461e6 fix for --enable-opensslall --disable-sha224 2020-10-24 07:06:24 +09:00
David Garske
685a35e097 Add missing stdint.h reference. 2020-10-23 13:42:25 -07:00
Chris Conlon
e24ac4211d Merge pull request #3405 from kojo1/EVP-gcm-zero
set tag including if(inl == 0) case
2020-10-23 14:35:47 -06:00
Ethan Looney
a5f86729f9 Deleted comment 2020-10-23 13:52:06 -06:00
David Garske
a50e88430f Add OPENSSL_init_crypto and OPENSSL_init_ssl API's. 2020-10-23 12:13:08 -07:00
David Garske
6dbc1cb75d Add support for TLS v1.3 compatibility API SSL_verify_client_post_handshake for the server-side to support rehandshake. Required for Apache v2.4.39 with TLS v1.3. 2020-10-23 12:13:08 -07:00
David Garske
589057245f Improvement to ECC wc_ecc_rs_raw_to_sig to reduce memory use (avoid the mp_int). Additional test cases. Fixes for previous function changes. 2020-10-23 11:00:46 -07:00
Chris Conlon
c27d5f57c4 check PKCS7 content length is not larger than bundle if not using separate header/footer 2020-10-23 09:56:34 -07:00
John Safranek
a7b325f542 Merge pull request #3414 from kabuobeid/wolfrand_build_fix
Fix wolfrand build failure.
2020-10-22 22:54:05 -07:00
Sean Parkinson
24af0497b5 PKCS #11: changes for signing and loading RSA public key from private 2020-10-23 14:02:59 +10:00
David Garske
ff092c02d2 Merge pull request #3396 from SparkiDev/fips_armasm
FIPS ARMASM: get build working
2020-10-22 15:26:24 -07:00
David Garske
05094460b2 Merge pull request #3353 from douzzer/XChaCha
XChaCha
2020-10-22 15:25:56 -07:00
Kareem Abuobeid
42583b5270 Fix wolfrand build failure, caused by defining NO_ASN without NO_CERTS. 2020-10-22 14:48:37 -07:00
Ethan Looney
2bd761bb4c Added a case for logging.c unit test with debug not enabled 2020-10-22 14:51:07 -06:00
David Garske
0065756efc Improvement to ECC wc_ecc_sig_to_rs to reduce memory use (avoid the mp_int). 2020-10-22 13:34:19 -07:00
David Garske
cb8e625e32 Fix to allow import of private key with ATECC. Its okay to load private key material into ecc_key struct. 2020-10-22 13:26:00 -07:00
tmael
6265006553 Merge pull request #3403 from elms/cppcheck/cleaup_fixes
Address some cppcheck issues
2020-10-22 12:56:19 -07:00
David Garske
be8e4d1949 Fix to reduce memory use with small stack on ECC key import. 2020-10-22 12:41:49 -07:00
Chris Conlon
1ced948391 check PKCS7 SignedData private key is valid before using it 2020-10-22 10:37:11 -07:00
Chris Conlon
df382f382f fix case in PKCS7_VerifySignedData where pkiMsgSz may not be set correctly 2020-10-22 09:23:32 -07:00
David Garske
f75dc4727d Merge pull request #3408 from ejohnstown/opt-fix
Example Client OCSP Option Fix
2020-10-22 09:00:04 -07:00
Chris Conlon
5e78a0107d check Rc2EcbEncrypt/Decrypt returns during CBC ops 2020-10-22 09:57:34 -06:00
Chris Conlon
d1f13a6570 rearrange Rc2 struct for optimal alignment 2020-10-22 09:43:40 -06:00
John Safranek
e28303b40a In DoServerKeyExchange(), when reading the DH key from the server, the
client was checking it too strictly. The pubkey value should be checked
as strictly as the generator, for too large. The public key value is
checked mathematically elsewhere.
2020-10-21 21:47:32 -07:00
Daniel Pouzzner
81849e64b8 scripts/openssl.test: for "-psk" cases, use "-psk key", not "-psk=key", for OpenSSL 1.0.2 compatibility. 2020-10-21 23:30:14 -05:00
John Safranek
ca7161a86f Example Client OCSP Option Fix
1. Before checking to see if the must staple flag is on the 'W' option,
   check the length of myoptarg.
2020-10-21 23:23:45 -05:00
John Safranek
d2dac8e4b8 Example Client OCSP Option Fix
1. Before checking to see if the must staple flag is on the 'W' option,
   check the length of myoptarg.
2020-10-21 13:30:51 -07:00
Daniel Pouzzner
b468ea77ea linuxkm: use EXPORT_SYMBOL_NS(x, WOLFSSL) if available, else fall back to EXPORT_SYMBOL(x). 2020-10-21 14:37:43 -05:00
Daniel Pouzzner
c910c94824 rename API wc_XChaCha20Poly1305_{encrypt,decrypt}_oneshot to wc_XChaCha20Poly1305_{Encrypt,Decrypt} for consistency; remove stray debugging printf in XChaCha20Poly1305_test(). 2020-10-21 14:36:46 -05:00
Daniel Pouzzner
299e88a993 minor fixes and commentary. 2020-10-21 14:08:41 -05:00
Daniel Pouzzner
99b76241bd wolfcrypt/test/test.c: remove debugging printf in XChaCha20Poly1305_test(). 2020-10-21 14:08:41 -05:00
Daniel Pouzzner
e1d3f2c7b4 chacha20_poly1305.c: add _SMALL_STACK code in wc_XChaCha20Poly1305_crypt_oneshot(). 2020-10-21 14:08:41 -05:00
Daniel Pouzzner
1949378d61 wc_Chacha_purge_current_block(): init "scratch" buffer to zeros, to avoid "garbage value" warnings. 2020-10-21 14:08:41 -05:00
Daniel Pouzzner
f65947ae09 rename wc_XChaCha_init() to wc_XChacha_SetKey() for consistency, and add a counter argument to provide for future random access scenarios; refactor wc_Chacha_purge_current_block() to use a dummy wc_Chacha_Process() call for intrinsically correct counter dynamics. 2020-10-21 14:08:41 -05:00
Daniel Pouzzner
6142c22948 add wc_XChaCha_init(), wc_XChaCha20Poly1305_Init(), wc_XChaCha20Poly1305_encrypt_oneshot(), wc_XChaCha20Poly1305_decrypt_oneshot(), and wc_Poly1305_EncodeSizes64(). also, remove redundant arg check (typo) in wc_Poly1305Update(). 2020-10-21 14:08:41 -05:00
Elms
c3dba3f9af Add additional checks to sp_ecc_point_new 2020-10-21 09:59:39 -07:00
Sean Parkinson
00ee24b998 ECC Shamir's Trick: infinity in precomp
Code now handles generating and having infinity in the precomp.
2020-10-21 11:58:31 +10:00
toddouska
e4eda3e125 Merge pull request #3384 from SparkiDev/tls13_sess_tick_compat
TLS session tickets: cannot share between TLS 1.3 and TLS 1.2
2020-10-20 15:56:03 -07:00
toddouska
7aae784a53 Merge pull request #3399 from dgarske/zd11128
Fix for TLS sniffer with non-standard curves
2020-10-20 15:14:53 -07:00
toddouska
7c38be407c Merge pull request #3398 from dgarske/async_test
Fixes for `--enable-asynccrypt` tests
2020-10-20 15:13:51 -07:00
toddouska
a1afc6ca4f Merge pull request #3389 from tmael/ocsp_status
Process multiple OCSP responses
2020-10-20 15:11:42 -07:00
toddouska
1e43d65d2a Merge pull request #3392 from SparkiDev/ocsp_must_staple
TLS OCSP Stapling: MUST staple option
2020-10-20 15:07:08 -07:00
Sean Parkinson
ffd55ac1fe Merge pull request #3406 from ejohnstown/dh-fix-2
DH Fix 2
2020-10-21 08:05:42 +10:00
toddouska
c863ca54a3 Merge pull request #3308 from julek-wolfssl/thread-safety
Introduce thread safety to unsafe functions in wolfSSL
2020-10-20 14:56:04 -07:00
toddouska
7c89d10e53 Merge pull request #3260 from julek-wolfssl/non-blocking-scr
(D)TLS non-blocking SCR with example
2020-10-20 13:45:19 -07:00
John Safranek
2c5a4ba508 DH Fix 2
1. Add some missing frees for the error cases when the server DH public
   key is rejected.
2020-10-20 10:32:09 -07:00
David Garske
a575403ca3 Merge pull request #3404 from haydenroche5/cmake
Tweak CMakeLists.txt
2020-10-20 06:58:00 -07:00
Takashi Kojo
6767646e54 set tag for zero len case 2020-10-20 19:11:35 +09:00
Sean Parkinson
ebde736ee7 Merge pull request #3400 from ejohnstown/dh-fix
DH Fix
2020-10-20 11:45:18 +10:00
David Garske
fb35013bf2 Merge pull request #3402 from douzzer/lkm-kernel_time_t
Linux __kernel_time_t version test
2020-10-19 17:28:48 -07:00
Hayden Roche
06977ebbdf Tweak CMakeLists.txt
- Change minimum CMake version from 2.6 to 3.0, which has support for targets.
- Favor explicit file lists in CMakeLists.txt over globs.
- Use target_compile_options to specify -DNO_MAIN_DRIVER for the unit_test target.
2020-10-19 16:38:51 -05:00
Hayden Roche
31b6c507f9 Tweak CMakeLists.txt
- Add generated CMake files/directories to .gitignore.
- Use lowercase for CMake commands, UPPERCASE for variables.
- Favor the CMake "option" command over SET(... CACHE BOOL ...).
- Use CMAKE_CURRENT_SOURCE_DIR in place of CMAKE_CURRENT_BINARY_DIR.
- Use CMAKE_USE_PTHREADS_INIT instead of CMAKE_HAVE_PTHREAD_H.
- Use target_include_directories on the wolfssl library target instead of include_directories.
2020-10-19 16:07:48 -05:00
Elms
86b2118550 Address some cppcheck issues 2020-10-19 11:47:53 -07:00
Daniel Pouzzner
48f4b927f6 wc_port.h: fix threshold of change in __kernel_time_t typedef from kernel 5.0.0 to 5.5.0 to accommodate Ubuntu 20.02 (kernel 5.4) -- see 2a785996cc (diff-2cd5bedb19d5e0a575d6f73a6c3290ecf8d9c01eb7567ba6fa282cb1b0ce2d54) 2020-10-19 13:27:00 -05:00
John Safranek
cd05ed3347 iDH Fix
1. Changed the bounds of checking the key from comparisons to constants
   to comparisons against WOLFSSL object settings for the DH key bounds.
2. Removed redundant bounds check on the server's prime.
2020-10-19 08:08:04 -07:00
Chris Conlon
79dea1c85c add test-servercert-rc2.p12 to include.am 2020-10-19 08:01:19 -06:00
Juliusz Sosinowicz
147cb8e60c Jenkins scope fixes 2020-10-19 12:46:11 +02:00
Sean Parkinson
f0d400a506 Merge pull request #3401 from kojo1/EVPcipher_tbl
cipher_tbl for EVP_get_cipherbyname
2020-10-19 14:28:59 +10:00
Takashi Kojo
a87f7c9185 cipher_tbl for EVP_get_cipherbyname 2020-10-19 06:17:15 +09:00
John Safranek
4f8c2b971f Move the binSz check variable to a spot where it is only declared in the same condition it is used and initialize it to zero. 2020-10-17 19:07:44 -07:00
John Safranek
fc86e6a960 Fix a double error return. 2020-10-16 18:18:47 -07:00
John Safranek
ec0aab1a23 DH Fix
1. Check the length values for the DH key domain and public key in the
   server key exchange message to make sure they are within the bounds
   set by the configuration. (Minimum key size is 2048 bits for DH.)
2020-10-16 16:28:27 -07:00
David Garske
85b4170047 Fix for TLS sniffer with non-standard curves. If curve not provided in key share data, then use private key curve. ZD 11128. 2020-10-16 16:13:42 -07:00
David Garske
fbd98be7af Fixes for --enable-asynccrypt tests after PR #3244. 2020-10-16 15:55:17 -07:00
John Safranek
4364700c01 DH Fix
These changes fix several fuzz testing reports. (ZD 11088 and ZD 11101)
1. In GetDhPublicKey(), the DH Pubkey is owned by the SSL session. It
   doesn't need to be in the check for weOwnDh before freeing. There
   could be a chance it leaks.
2. In GeneratePublicDh() and GeneratePrivateDh(), the size of the
   destination buffer should be stored at the location pointed to by the
   size pointer. Check that before writing into the destination buffer.
3. Ensure the size of the private and public key values are in the size
   value before generating or getting the DH keys.
2020-10-16 15:35:23 -07:00
Chris Conlon
d4bbe529fb switch RC2 struct name to Rc2 for consistent camel case across algorithms 2020-10-16 15:19:47 -06:00
Chris Conlon
062df01737 add PKCS12 RC2 test case, example p12 bundle 2020-10-16 12:02:20 -06:00
Chris Conlon
2c0f4b619e add RC2-40-CBC support to PKCS#12 parsing 2020-10-16 12:02:20 -06:00
Chris Conlon
0854efe168 add API unit tests for RC2 2020-10-16 12:02:20 -06:00
Chris Conlon
a6923ff100 initial implementation of RC2-CBC 2020-10-16 12:02:16 -06:00
Chris Conlon
4c75037bdb initial implementation of RC2-ECB 2020-10-16 12:00:56 -06:00
David Garske
b58ea5842a wolfSSL RC2 template. 2020-10-16 11:46:40 -06:00
Juliusz Sosinowicz
24030d5f32 Move globalRNG and co to ssl.c 2020-10-16 17:33:28 +02:00
David Garske
ab88ab160c Merge pull request #3395 from douzzer/misc-fixes-20201015
misc fixes for coverage and buildability
2020-10-16 07:28:48 -07:00
Sean Parkinson
aeb44c5352 FIPS ARMASM: get build working 2020-10-16 16:41:18 +10:00
Sean Parkinson
07e69829d7 TLS 1.3 PSK: fix for session ticket timeout
Return straightaway if the ticket is out of date.
Need to fallback to full handshake.
2020-10-16 14:48:29 +10:00
Sean Parkinson
a595e3cc48 Merge pull request #3394 from ejohnstown/wolfssh-update
wolfSSH Update
2020-10-16 09:08:37 +10:00
Sean Parkinson
60b0b0170b TLS OCSP Stapling: MUST staple option
Can enable OCSP Must Staple option to mean that if the client sends a
request for an OCSP Staple then it must receive a response.
2020-10-16 09:03:27 +10:00
David Garske
9793414d78 Merge pull request #3381 from SparkiDev/ecc_ct_fix
ECC mulmod: some curves can't do order-1
2020-10-15 14:46:46 -07:00
Daniel Pouzzner
eb7a79aa5e misc fixes for coverage and buildability: add MD2 to --enable-all*; fix spelling of "Sno" to "no" for $ENABLED_BLAKE2S default; when ENABLED_QSH add -DWOLFSSL_STATIC_DH -DWOLFSSL_STATIC_PSK (relates to ZD11073); add missing gating for !defined(WOLFSSL_DEVCRYPTO) in api.c:test_wc_Sha256FinalRaw(); fix tests/api.c:IsValidCipherSuite() to build under gcc10 (relates to ZD11073). 2020-10-15 15:05:29 -05:00
John Safranek
69ac13c2e9 wolfSSH Update
Originally, wolfSSH required some algorithms to be enabled in wolfCrypt
to work correctly. wolfSSH is now more flexible with how wolfCrypt is
configured, and these combinations do not have to be restricted.
2020-10-15 11:37:31 -07:00
David Garske
49b3fb21c8 Merge pull request #3391 from ejohnstown/autoconf-fix
Automake Fixes
2020-10-15 10:12:27 -07:00
Sean Parkinson
134e1be189 TLS session tickets: cannot share between TLS 1.3 and TLS 1.2
When parsing ticket, check TLS version to see whether they are version
compatible.
2020-10-15 13:02:06 +10:00
John Safranek
c2bb359eb4 Automake Fixes
1. A couple cert scripts don't need to be included in the makefile or the distribution.
2020-10-14 17:23:58 -07:00
toddouska
f69fa13e02 Merge pull request #3357 from guidovranken/StoreECC_DSA_Sig-fix
Improve StoreECC_DSA_Sig bounds checking
2020-10-14 16:53:46 -07:00
David Garske
b18d43abb9 Fix for possible uninitialized use of prev. 2020-10-14 15:52:51 -07:00
toddouska
026ba4e750 Merge pull request #3368 from dgarske/zd11057
Fix for possible malformed encrypted key with DES3 causing negative length
2020-10-14 15:32:48 -07:00
David Garske
751f64b4aa Fix for OCSP single response last optional part handling and restore original size arg since its required for the ASN elements. 2020-10-14 14:55:18 -07:00
David Garske
10b1884993 Added support for handling an OCSP response with multiple status responses. 2020-10-14 14:47:24 -07:00
toddouska
1c4b15d427 Merge pull request #3369 from dgarske/sniffer_ccm
Add AES CCM support to sniffer
2020-10-14 14:31:57 -07:00
toddouska
8898abcc99 Merge pull request #3378 from dgarske/zd11085
Fixes SSLv3 use of ECDH in sniffer
2020-10-14 14:30:15 -07:00
toddouska
3f4bf9144b Merge pull request #3366 from SparkiDev/pkcs11_lookup
PKCS #11: improve key lookup
2020-10-14 14:22:56 -07:00
Tesfa Mael
5ac3e7d542 Process multiple ocsp responses 2020-10-14 01:10:07 -07:00
David Garske
232028d03b Merge pull request #3386 from ejohnstown/dh-maint
Fuzz Fix
2020-10-13 15:47:11 -07:00
David Garske
b68828d3c9 Merge pull request #3361 from tmael/ocsp-nocheck
Add support for id-pkix-ocsp-nocheck
2020-10-13 15:46:02 -07:00
David Garske
048a3a8d5b Merge pull request #3374 from JacobBarthelmeh/Testing
NO_FILESYSTEM build on Windows
2020-10-13 13:26:46 -07:00
John Safranek
422683f4c3 Fuzz Fix
GetPublicDhKey() assumes the ssl session owns the DH public key parts, and
tries to free them. They belong to the CTX initially, so it shouldn't be
freeing them, necessarily.

1. Add a check for weOwnDh first, then free the buffers if needed.
2. If there is a problem reading the keys, free the new buffers before exiting.
3. Set weOwnDh once the buffers and values have been stored
   successfully.
2020-10-13 10:15:58 -07:00
Jacob Barthelmeh
6aa0eacc62 use correct key buffer for example private key 2020-10-13 09:26:54 -06:00
Sean Parkinson
f0db2c177e ECC mulmod: some curves can't do order-1
Change implementation of timing resistant scalar multiplication to use
Joye double-add ladder.
No longer have fake operations being performed therefore can remove the
order adding operations.
Still need to check for boundary condition: order-1 wil not work with
SECP256K1 as it results in an add of order/2 and (order/2)+1 times base
point which are the negatives of each other. The sum is infinity and not
handled by maths.
Added mp_cond_swap_t - Conditionally swap in constant time.
2020-10-13 09:55:35 +10:00
David Garske
0d685e4f28 Merge pull request #3358 from douzzer/wolfSSL_get_ocsp_producedDate
add wolfSSL_get_ocsp_producedDate().
2020-10-12 15:21:10 -07:00
David Garske
de6164df5a Merge pull request #3382 from ejohnstown/aes-clear
AES Clear Temp
2020-10-12 15:17:00 -07:00
David Garske
4396e10500 Merge pull request #3379 from ejohnstown/mfix
Maintenance Fixes
2020-10-12 14:53:56 -07:00
Chris Conlon
1f78297c5c Merge pull request #3372 from miyazakh/Renesas_APRA6M
added set up guide for APRA6M board
2020-10-12 14:23:06 -06:00
Chris Conlon
2a1efda140 Merge pull request #3380 from kojo1/mqx
minor fix for MQX, Kinetis
2020-10-12 14:03:20 -06:00
kaleb-himes
8826823724 In ACVP testing NIST needs to see failed decryption output 2020-10-12 12:05:44 -06:00
John Safranek
5ead4386b3 AES Clear Temp
ForceZero()'ed a couple local variables that have keying material at some point.
2020-10-12 10:30:34 -07:00
John Safranek
0ca202f389 Rename SKIP_SUITE to something more descriptive. Add some comments. 2020-10-12 09:49:02 -07:00
Tesfa Mael
a4bfa0dec7 Add support for id-pkix-ocsp-nocheck 2020-10-11 19:47:50 -07:00
Takashi Kojo
ce97eadae1 fix for MQX 2020-10-11 06:57:33 +09:00
Daniel Pouzzner
9de5eea1d9 configure.ac: supplement AC_CHECK_FUNCS() (function link test) with AC_CHECK_DECLS() (function declaration test) to avoid false positives. fixes various build failure modes. 2020-10-09 22:18:51 -05:00
Hideki Miyazaki
bf59d169dd Update include.am to include new README files 2020-10-10 09:57:05 +09:00
John Safranek
a05a305d70 Fix unused parameters in SKIP_SUITE. 2020-10-09 15:59:14 -07:00
John Safranek
6cfb038d11 Fix a bad ifdef. 2020-10-09 15:54:44 -07:00
John Safranek
2d85061c47 Maintenance Fixes
Improve the reporting of the NTRU based cipher suites with the function
wolfSSL_sk_CIPHER_description().
2020-10-09 15:01:39 -07:00
John Safranek
d8299e2764 Maintenance Fixes
When building the list of ciphers with wolfSSL_get_ciphers_compat(),
skip the fake indicator ciphers like the renegotiation indication
and the quantum-safe hybrid since they do not have encryption or mac
algorithms associated to them.
2020-10-09 15:01:38 -07:00
John Safranek
aeeeb666a7 Maintenance Fixes
1. The test_wolfSSL_X509V3_EXT_print() test was using stderr for output,
   changed to stdout.
2. A call to XFREAD wasn't typecasting its output to the size of the
   variable getting the output in decodedCertCache_test().
2020-10-09 15:01:32 -07:00
John Safranek
724eb96047 Merge pull request #3377 from douzzer/PR3371
fix pkcs7compressed_test() (test gated on HAVE_LIBZ), broken by PR#3244.
2020-10-09 15:00:15 -07:00
David Garske
f3fbb921c0 Fixes SSLv3 use of ECDH. The public key length byte needs to be skipped for import with SSLv3 and TLS (not TLS v1.3). ZD 11085 2020-10-09 12:01:41 -07:00
Daniel Pouzzner
29d4de6307 fix pkcs7compressed_test() (test gated on HAVE_LIBZ), broken by PR#3244. 2020-10-09 12:42:14 -05:00
JacobBarthelmeh
bfb10ddfb5 NO_FILESYSTEM build on Windows 2020-10-09 09:45:00 -07:00
David Garske
3e69318ac7 Merge pull request #3373 from danielinux/imx-rt1060-shaonly-fix
Fixed SHA256 support for IMX-RT1060
2020-10-09 09:30:11 -07:00
Daniele Lacamera
9cb2c9f1ac Fixed SHA256 support for IMX-RT1060 2020-10-09 13:36:53 +02:00
Hideki Miyazaki
1765eeddb2 added set up guide for APRA6M board
added TLS 1.3 settings into user_settings.h
2020-10-09 19:52:20 +09:00
Daniel Pouzzner
570f55a0e3 wolfSSL_get_ocsp_producedDate*(): gate on !defined(NO_ASN_TIME), and in client_test(), gate call to strftime() on HAVE_STRFTIME and add fallback code; add HAVE_STRFTIME test to configure.ac. 2020-10-08 23:26:28 -05:00
Daniel Pouzzner
7a77b6d990 rename wolfSSL_get_ocsp_producedDate(WOLFSSL *, struct tm *) to wolfSSL_get_ocsp_producedDate_tm(), and add wolfSSL_get_ocsp_producedDate() accessing the raw ASN.1 producedDate; fix location of prototypes in ssl.h to obtain proper conditionalization; omit frivolous nullness test on ssl->ocspProducedDate (always true). 2020-10-08 22:47:16 -05:00
Daniel Pouzzner
e162d0f889 add wolfSSL_get_ocsp_producedDate(). 2020-10-08 22:47:16 -05:00
toddouska
4d11e3c83b Merge pull request #3365 from SparkiDev/ticket_align
SSL session ticket: decrypted ticket access aligned
2020-10-08 15:01:41 -07:00
toddouska
8bc3d33c4e Merge pull request #3360 from SparkiDev/ecc_safe_add
ECC add points: more cases where add point is a double or infinity
2020-10-08 14:55:04 -07:00
toddouska
f0c5fb76bb Merge pull request #3359 from ejohnstown/tfm-read-radix-16
TFM Read Radix 16 OOB Read
2020-10-08 14:52:42 -07:00
toddouska
c69e9927fa Merge pull request #3354 from SparkiDev/mac_arm_asm_2
ARM ASM ChaCha20: Fix calc of left over bytes
2020-10-08 14:49:33 -07:00
toddouska
6b4b92a549 Merge pull request #3356 from embhorn/zd11044
Allow wolfSSL_EVP_get_hashinfo with x509small
2020-10-08 14:48:28 -07:00
toddouska
e0f3ceefa2 Merge pull request #3349 from vaintroub/remove_gccism
#3348  - Fix MSVC build
2020-10-08 14:47:15 -07:00
David Garske
8a57eead51 Add AES CCM support to sniffer. ZD 11078. 2020-10-08 13:58:31 -07:00
David Garske
d33d100526 Fix for possible malformed encrypted key with DES3 causing negative length. If length is less than DES_BLOCK_SIZE then it could result in a negative der->length. ZD 11057 2020-10-08 13:07:07 -07:00
JacobBarthelmeh
46f8f53268 Merge pull request #3367 from kaleb-himes/NTRU_MAINTENANCE
Fix NTRU + QSH build
2020-10-08 14:04:21 -06:00
kaleb-himes
d9eaeb4a3b Fix NTRU + QSH build 2020-10-08 09:13:00 -06:00
Sean Parkinson
15aa0a2f8c PKCS #11: improve key lookup
Refactor the find key by template to eliminate duplicate code.
Improve documentation.
Add more informative debugging information.
2020-10-08 13:36:30 +10:00
Sean Parkinson
4f6c1db9a2 Merge pull request #3355 from douzzer/enable-more-all
--enable-all coverage update, plus --enable-all-crypto and --enable-linuxkm-defaults
2020-10-08 09:52:56 +10:00
Sean Parkinson
257551b134 ECC add points: more cases where add point is a double or infinity
Extract method to perform safe point add (handling double and infinity
result).
Replace all instances of the extracted code.
2020-10-08 09:26:10 +10:00
Sean Parkinson
8d82fb2add SSL session ticket: decrypted ticket access aligned
Decrypted session ticket using encrypted ticket buffer.
Alignment not correct on platforms requiring 32-bit aligned access.
Copy the decrypted data into temporary for access.
Also zeroize the unencrypted tickets after use.
2020-10-08 08:56:49 +10:00
Sean Parkinson
270da3c33c Merge pull request #3364 from dgarske/zd11064
Fix for sniffer without TLS v1.3
2020-10-08 08:10:21 +10:00
David Garske
4f3632c7a6 Fix for sniffer without TLS v1.3 (--enable-sniffer --disable-tls13). ZD11064. 2020-10-07 11:08:05 -07:00
Daniel Pouzzner
1c492dc0b6 cosmetic cleanups. 2020-10-06 22:14:08 -05:00
John Safranek
413b0d171d TFM Read Radix 16 OOB Read
Change the location of the update of the write index when in
fp_read_radix_16(). It will do multiple writes into a word, and update
the index when the word is full and there is more to write. If there
isn't more to write, the index isn't incremented. This ensures the used
value in the mp_digit is correct, and not off-by-one when the last word
is full.
2020-10-06 17:03:03 -07:00
Guido Vranken
4c5c1d5dac Improve StoreECC_DSA_Sig bounds checking 2020-10-06 23:11:50 +02:00
Eric Blankenhorn
6bc34cb1a8 Allow wolfSSL_EVP_get_hashinfo with x509small 2020-10-06 11:18:08 -05:00
Juliusz Sosinowicz
a7fdfbaf40 Passing scr-app-data in to -i to client sends a message during SCR
Modify mygetopt so that if an argument expects a value and that value is the next argument then myoptarg is set to a NULL pointer.
2020-10-06 17:28:23 +02:00
Daniel Pouzzner
c18f7010cf configure.ac: remove enable_apachehttpd and enable_secure_renegotiation from new --enable-all (valgrind woes). 2020-10-02 18:54:45 -05:00
Kaleb Himes
84ee1509b7 Merge pull request #3311 from tmael/neclab
Update release notes
2020-10-02 15:50:20 -06:00
Daniel Pouzzner
d900e57ae4 improve --enable-linuxkm-defaults fidelity. 2020-10-01 18:07:48 -05:00
Chris Conlon
232eb6a620 Merge pull request #3323 from danielinux/nxp_imxrt_dcp
Added support for NXP DCP (i.MX-RT series)
2020-10-01 16:44:58 -06:00
Daniel Pouzzner
a522207b14 fix memory leaks in src/internal.c:DoSessionTicket() and testsuite/testsuite.c:file_test(). 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
2ed8f93592 src/internal.c: fix memory leaks in ProcessPeerCerts() and GetDhPublicKey(). 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
7fb8457459 fix whitespace. 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
c37ba164bf configure.ac: don't include enable_certgencache=yes in --enable-all[-crypto] feature sets, to avoid memory leak false alarms. 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
24b20352f8 configure.ac: refactor-for-clarity enable-all[-crypto] feature selection logic conditionalized on sp-math and linuxkm. 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
a3185310ca tests/api.c: clean up and parameterize key/buffers sizes in test_wc_CheckProbablePrime(). 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
70474659a0 wc_ShaFinal(): remove superfluous ret=0 when WOLF_CRYPTO_CB, complained by PRB-scan-build-distro-check. 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
fd3815c708 configure.ac: include enable_xchacha in --enable-all-crypto. 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
a4bd213099 configure.ac: improve --enable-all coverage and make it compatible with --enable-sp-math, add --enable-all-crypto (crypto-only subset of --enable-all), and add --enable-linuxkm-defaults ("Enable feature defaults for Linux Kernel Module"). 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
79978f5c7a ecc_check_pubkey_order(): add missing braces. 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
3ef242e889 tests/api.c: change RSA keysize from 1024 to 2048 for sp-math compatibility, in test_wc_CheckProbablePrime(), test_wc_CheckProbablePrime(), test_wc_RsaPSS_Verify(), test_wc_RsaPSS_VerifyCheck(), test_wc_RsaPSS_VerifyCheck(), test_wc_RsaPSS_VerifyCheckInline(), and test_wolfSSL_DC_cert(). 2020-10-01 14:38:26 -05:00
Daniele Lacamera
cec3d542d1 Rework of DCP after reviewer's comments.
- using wolfSSL_CryptHwMutexLock/UnLock as DCP mutex.
- fixed AES Free
- using separate per-channel key store
2020-10-01 11:36:03 -07:00
Daniele Lacamera
ce62f46442 Fixed comments 2020-10-01 11:36:03 -07:00
Daniele Lacamera
9244bbbf83 NXP-DCP: Fixed AES-GCM setkey; added AES direct. 2020-10-01 11:36:03 -07:00
Daniele Lacamera
05098f7ab8 Reentrant DCP driver. DCP protected by mutex. 2020-10-01 11:36:03 -07:00
Daniele Lacamera
a07f9ded63 Added support for NXP DCP (i.MX-RT series) 2020-10-01 11:36:03 -07:00
David Garske
050252e5d4 Merge pull request #3340 from kabuobeid/fsanitize_thread
Fix issues found by -fsanitize=thread.
2020-10-01 11:28:05 -07:00
Kareem Abuobeid
d59784e646 Fix issues found by -fsanitize=thread. 2020-09-30 14:24:20 -07:00
toddouska
20d28e1b65 Merge pull request #3221 from julek-wolfssl/wolfSSL_dtls_import-const-buf
Change buffer in wolfSSL_dtls_import to be const
2020-09-30 10:45:25 -07:00
toddouska
bb6c612209 Merge pull request #3312 from kabuobeid/apple_arm64
Added instructions for building for Apple ARM64.
2020-09-30 10:44:22 -07:00
toddouska
74259fe9ce Merge pull request #3351 from dgarske/sniffer_sesstick
Fix for sniffer with TLS v1.2 session ticket
2020-09-30 10:42:56 -07:00
toddouska
9bfe4f1fb2 Merge pull request #3341 from SparkiDev/fp_sqr_size
TFM mp_sqr: error on number overflow
2020-09-30 10:35:01 -07:00
Sean Parkinson
f76165a3fa ARM ASM ChaCha20: Fix calc of left over bytes 2020-09-30 15:57:33 +10:00
Sean Parkinson
a1991da458 TFM mp_sqr: error on number overflow
Change mp_sqr to return an error if the result won't fit into the fixed
length dp.
2020-09-30 08:54:20 +10:00
Kareem Abuobeid
0a791a957e Added instructions for building for Apple ARM64. 2020-09-29 15:12:34 -07:00
toddouska
fc988ad3e7 Merge pull request #3325 from julek-wolfssl/openssl-compat-aes-gcm-2-part-aad
Buffer AAD in wolfSSL_EVP_CipherUpdate_GCM  so that whole value is hashed
2020-09-29 13:46:44 -07:00
toddouska
d415bbf2eb Merge pull request #3346 from SparkiDev/mac_arm_asm
ARM asm: fixes for compiling on Mac and ChaCha20 streaming
2020-09-29 13:36:13 -07:00
David Garske
3e0d478543 Fix for sniffer with TLS v1.2 session ticket. Logic broken in PR #3044. ZD 10926. 2020-09-29 11:11:32 -07:00
Juliusz Sosinowicz
2153009efa Fix access violation in Visual Studio Test 2020-09-29 19:47:58 +02:00
Vladislav Vaintroub
efe7c42775 Fix MSVC build
Don't use GCC-specific extensions

Fixes #3348
2020-09-29 18:00:21 +02:00
Juliusz Sosinowicz
52be7c94b8 Introduce thread safety to unsafe functions in wolfSSL
Add warnings to one shot hash functions
2020-09-29 16:29:45 +02:00
Juliusz Sosinowicz
78e003e7de Plug leak 2020-09-29 12:24:59 +02:00
Sean Parkinson
66ed9b1522 ARM asm: fixes for compiling on Mac and ChaCha20 streaming
Don't set the CPU to generic on Mac.
Implement streaming for ChaCha20.
2020-09-29 13:38:02 +10:00
Sean Parkinson
46b9531bec Merge pull request #3345 from dgarske/sp_spell
Fix spelling error and sync with latest scripts
2020-09-29 08:46:52 +10:00
David Garske
30a74e0597 Merge pull request #3343 from ejohnstown/test-ecc521
Test ECC-521 Only
2020-09-28 14:06:42 -07:00
Juliusz Sosinowicz
07f6c19156 Update EVP_CIPHER to handle multi-part AAD 2020-09-28 20:42:23 +02:00
David Garske
a85c93e44a Fix spelling error and sync with latest scripts. 2020-09-28 10:41:31 -07:00
toddouska
d01dae00bc Merge pull request #3342 from SparkiDev/arm64_clang_fix
SP ARM64: Fix assembly for clang
2020-09-28 09:57:19 -07:00
John Safranek
dbf18b8532 Test ECC-521 Only
Update benchmark and wolfcrypt test to support using only ECC-521 in a custom curve list.
2020-09-28 09:22:24 -07:00
Chris Conlon
d143015059 Merge pull request #3336 from ethanlooney/26th_branch
Added unit test for Des3
2020-09-28 10:14:31 -06:00
Juliusz Sosinowicz
942168c62d Add decrypt tests 2020-09-28 15:59:50 +02:00
Sean Parkinson
b61b3e34dd SP ARM64: Fix assembly for clang
clang doesn't auto correct size of register (declared byte n but 64-bit
usage)
clang doesn't always handle use of x29 (FP or Frame Pointer) in inline
assembly code correctly - reworked sp_2048_sqr_8 to not use x29.
2020-09-28 12:35:58 +10:00
David Garske
7d33312f4b Merge pull request #3339 from ejohnstown/dtls-flag
DTLS Flag
2020-09-25 17:05:22 -07:00
toddouska
e1f54b1df1 Merge pull request #3296 from dgarske/sniffer_fixes
Fixes for Sniffer (Max Fragment, ECC Static and SNI)
2020-09-25 12:50:07 -07:00
toddouska
8266680ab7 Merge pull request #3338 from SparkiDev/dh_fips3
DH EXTRA test: Disable DH test unless not FIPS or FIPS > 2
2020-09-25 12:42:40 -07:00
Ethan Looney
e49505fbb8 Added key free 2020-09-25 13:42:19 -06:00
toddouska
6f1d626671 Merge pull request #3337 from SparkiDev/evp_xts_3
EVP AES XTS: check correct define
2020-09-25 12:42:09 -07:00
toddouska
2d97acadc9 Merge pull request #3331 from dgarske/armasm
Fixes for ARM ASM and API unit test bad build macros
2020-09-25 12:41:30 -07:00
John Safranek
b36877c20b DTLS Flag
Fix an ifdef flag that should have been WOLFSSL_DTLS, not HAVE_DTLS.
2020-09-25 10:49:34 -07:00
Juliusz Sosinowicz
84f0fc56ef check ClientWrite return 2020-09-25 11:35:23 +02:00
Juliusz Sosinowicz
7e38b6bee6 Test 2 part GCM data and EVP context re-use 2020-09-25 11:03:58 +02:00
Sean Parkinson
c798c7f396 DH EXTRA test: Disable DH test unless not FIPS or FIPS > 2
statickeys/dh-ffdhe2048.der is an alternate format that is supported
when WOLFSSL_DH_EXTRA is defined.
The decoding is not supported when FIPS and FIPS version is less than 3.
Fix test to not use file unless not FIPS or FIPS > 2.
2020-09-25 11:41:59 +10:00
Sean Parkinson
d514189710 EVP AES XTS: check correct define
HAVE_AES_CTX -> WOLFSSL_AES_XTS
2020-09-25 11:17:04 +10:00
David Garske
5ef5c279b5 Fix for previous max fragment commit to correctly process a TLS packet with multiple handshake messages. Fix to free the wolfSSL objects first then wolfSSL_CTX. 2020-09-24 15:53:12 -07:00
David Garske
bbaf4090b8 Fixes for sniffer when using static ECC keys. Adds TLS v1.2 ECC key fallback detection and fixes new ECC RNG requirement for timing resistance. 2020-09-24 15:03:26 -07:00
Ethan Looney
4662690fdc Added unit test for Des3 2020-09-24 14:05:14 -06:00
David Garske
7cfbc598ed Fix to not assume TLS v1.3 based on extended key share extension. 2020-09-24 13:05:01 -07:00
David Garske
bc960a9c25 Fix for sniffer with SNI enabled to properly handle WOLFSSL_SUCCESS error code in ProcessClientHello. ZD 10926 2020-09-24 13:05:01 -07:00
David Garske
adedde7d16 Fix to not treat cert/key not found as error in myWatchCb and WOLFSSL_SNIFFER_WATCH. The key can be pased as argument to ./snifftest and if built with sniffer watch let's keep trying to parse instead of throwing an error. 2020-09-24 13:05:01 -07:00
David Garske
7e2d44ba9a Fix possible unused rhSize. 2020-09-24 13:05:01 -07:00
David Garske
b5163bd1fa Added support for 802.11Q VLAN frames. Fix build error with unused "ret" when building with WOLFSSL_SNIFFER_WATCH. Fixed bad characters in sniffer README.md configure example. 2020-09-24 13:05:01 -07:00
David Garske
ce1c1fe0a6 Fix for sniffer using HAVE_MAX_FRAGMENT in "certificate" type message. ZD 10903 2020-09-24 13:05:01 -07:00
toddouska
1668f6f626 Merge pull request #3244 from douzzer/20200820-linuxkm
Linux Kernel Module support
2020-09-24 12:57:22 -07:00
toddouska
1eed409bdf Merge pull request #3332 from SparkiDev/sp_cortexm_fix_1
SP Cortex-M4 assembly: Fix for GCC compile
2020-09-24 12:55:21 -07:00
toddouska
1e293e4be4 Merge pull request #3321 from SparkiDev/evp_xts_2
EVP CIPHER: fix block size, mode and table
2020-09-24 12:49:38 -07:00
toddouska
d75d3108b0 Merge pull request #3314 from SparkiDev/evp_hmac_sha3
Test wolfSSL_HMAC with SHA-3
2020-09-24 12:48:40 -07:00
Chris Conlon
b3fc5eb254 Merge pull request #3326 from ethanlooney/25th_branch
Added unit tests for PKCS7
2020-09-24 13:33:57 -06:00
Chris Conlon
679b107044 Merge pull request #3333 from miyazakh/espidf_pkcs7
add user settings of pkcs7 for ESP-IDF port
2020-09-24 09:58:00 -06:00
Chris Conlon
6780e5eb0b Merge pull request #3290 from ethanlooney/22nd_branch
Added unit tests for RSA.c
2020-09-24 09:54:11 -06:00
Hideki Miyazaki
a22b2085b1 add settings for pkcs7
add wrapper to check the return value of snprintf

fixed unit test

fixed uninitialized variable
2020-09-24 17:20:45 +09:00
David Garske
3adb64b196 Merge pull request #3330 from ejohnstown/tfm-no-64bit
TFM NO 64-BIT
2020-09-23 18:47:48 -07:00
Sean Parkinson
ec59acbae0 SP Cortex-M4 assembly: Fix for GCC compile
b<cond>.n not allowed with GCC.
Fix sizeof to use tmp_arr not tmp which is now a pointer.
2020-09-24 11:03:50 +10:00
Daniel Pouzzner
09b9ac8b86 add AM_CONDITIONAL([BUILD_DEBUG],...) to configure.ac, and use it to gate inclusion of wolfcrypt/src/debug.c in src/include.am; remove superfluous includes from wolfcrypt/src/debug.c. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
6a3da9477e fix --enable-stacksize[-verbose] (HAVE_STACK_SIZE[_VERBOSE]) to work correctly in testsuite.c. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
38cb4a2d69 blake2{b,s}.c: return and propagate meaningful error codes. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
fda22f851a random.c: use "DRBG_internal", not "__DRBG", for typedef struct DRBG_internal, to avoid possible conflict with reserved-label restrictions with some compilers. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
6a7a87545a wc_MakeRsaKey(): add missing allocation failure checks for WOLFSSL_SMALL_STACK. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
0f3283ce7b add wc_curve25519_generic(). 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
4742a17006 configure.ac: move AC_ARG_ENABLE([linuxkm] before AC_ARG_ENABLE([filesystem], and add ENABLED_FILESYSTEM_DEFAULT=no when ENABLED_LINUXKM. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
529549f117 settings.h: protect against double definitions in _LINUXKM case. 2020-09-23 18:32:17 -05:00
Daniel Pouzzner
fc592e8434 tests/api.c: in test_wc_PKCS7_BER(), provide for !NO_DES3 && !NO_RSA && WOLFSSL_SP_MATH case. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
10bf7a2086 examples/: fix undersized array lengths in client_usage_msg and server_usage_msg. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8a6216363d ecc.c: add (void)rng to wc_ecc_mulmod_ex2() to cover WOLFSSL_SP_MATH case. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a571378b5f blake2.h/blake2b.c: fix typos. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
0c9ba76a93 fix rebase error on aes.c 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
60506af5f5 add WOLFSSL_API wrappers wc_InitBlake2b_WithKey(), wc_InitBlake2s_WithKey(), and wc_curve25519_make_priv(). 2020-09-23 18:32:16 -05:00
David Garske
c0823c8a7e Refactor of AES wc_AesSetKeyLocal and wc_AesSetKey for software only use. Added missing aes argument check on wc_AesSetKeyDirect. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a75f88cbcd wolfssl/test.h: gate strerror() in err_sys_with_errno() on HAVE_STRING_H && HAVE_ERRNO_H as in PR #3291. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
bf054838a1 wc_port.h: WOLFSSL_LINUXKM: fix typo in WOLFSSL_ARMASM definition of RESTORE_VECTOR_REGISTERS(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
da6a5566b6 wc_port.h: for WOLFSSL_LINUXKM, gate kernel includes and libwolfssl-specific preprocessor directives on BUILDING_WOLFSSL, to avoid disrupting environment for builds of other kernel components. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
185994cb0b scripts/: tweak scripts/include.am to run ocsp tests before rather than after testsuite and unit.test; revert POSIXish scripts/*.test to use /bin/sh. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8b53b181dd add bwrapping on all other scripts/*.test except those that make Internet connections, and remove test for setuid bit, as some systems are configured to not require setuid/CAP_NET_ADMIN for CLONE_NEWNET. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
1c3415e26f wolfssl/test.h:err_sys_with_errno(): printing the errno msg seems to blow up all the parse tests, so only do it when -DDEBUG_TEST_ERR_SYS_WITH_ERRNO. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
1ebd851b2e wolfssl/test.h: if SO_REUSEPORT is defined, use it in tcp_listen() and udp_accept(). also, add err_sys_with_errno(), identical to err_sys() unless defined(HAVE_STRING_H) && defined(HAVE_ERRNO_H), in which case strerror(errno) is appended to the rendered message. changed to use err_sys_with_errno() wherever applicable. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
62bbef2f2e wolfcrypt/test/test.c: add missing gating for -DBENCH_EMBEDDED. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
92fa0f18f0 Makefile.am: use an aux variable to add linuxkm to $SUBDIRS when BUILD_LINUXKM is true, to avoid recursion into linuxkm/ for "make distdir". solution by John Safranek, with a million thanks. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
291febb270 configure.ac: clean up AC_ARG_ENABLE() for linuxkm, and make AC_ARG_WITH for linux-source and linux-arch unconditional. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
2609fa9aeb test.c:rsa_test(): fix cpp gating for clearing of keypub buffer. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
453698ba27 add explanatory comments for do_div(), used when WOLFSSL_LINUXKM. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8496a64ed4 linuxkm/Kbuild: the x86 _asm object files still reference "_GLOBAL_OFFSET_TABLE_", so they can't work in the kernel as-is. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
7c2aefcfdd linuxkm: enable the rest of the _asm implementations for x86, wrapped in {SAVE,RESTORE}_VECTOR_REGISTERS(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
331fe47eb6 linuxkm: add ASFLAGS_FPU_DISABLE_SIMD_ENABLE ASFLAGS_FPU_ENABLE_SIMD_DISABLE ASFLAGS_FPUSIMD_DISABLE ASFLAGS_FPUSIMD_ENABLE to facilitate erroring for unexpected fp/simd instructions in Kbuild, while allowing expected ones. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
96fe6dc049 test.h: fix math in final "stack used" message when -DHAVE_STACK_SIZE_VERBOSE. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
60a686f48c tidying suggested by Sean in review. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a9cad51b65 sp_mod_word(): add unoptimized alternative if -U__GNUC__. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
c8cd042bdd configure.ac: for linuxkm, make --enable-sp-math the default, and add additional exclusions --enable-fastrsa and --with-libz. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5f972d2ae6 test.c: now that sp math is fixed and working in linuxkm, reenable prime_test() for WOLFSSL_LINUXKM, and add a small stack refactor for it. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
fdbd6addd0 sp_int.c: add sp_mod_word() gated on WOLFSSL_SP_MOD_WORD_RP for runtimes lacking intrinsic support for int128 % int64; for linuxkm, use WOLFSSL_SP_DIV_WORD_HALF and the new WOLFSSL_SP_MOD_WORD_RP. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8f130f3642 test.c: tweaks to accommodate clang's belligerent -Wparentheses-equality. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
447a238e8e test.c: missed a _SMALL_STACK spot in rsa_ecc_certgen_test(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5bfb5a3a83 test.c: fix missed spot in rsa_certgen_test(), and do another _SMALL_STACK refactor of a missed object in rsa_ecc_certgen_test(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
fdf87fe152 test.c: another missed spot. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
ebca451c93 test.c: missed a spot -- inadvertently unused return value. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
99501ffefd m4/ax_linuxkm.m4: use test "$var" = "" construct, not test -z "$var", for maximal portability. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
43c12ede50 ge448_double_scalarmult_vartime(): streamline WOLFSSL_SMALL_STACK refactor. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
80961ea913 test.c:ecc_decode_test(): WOLFSSL_SMALL_STACK refactor 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5801719ac3 wolfcrypt/src/asn.c:wc_GetKeyOID(): stack->heap refactor. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
dbe0273bf4 test.c: additional WOLFSSL_SMALL_STACK refactoring, covering --enable-sp-math and various missed spots. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
4f5bbbdca8 rsa.c:wc_CheckProbablePrime(): WOLFSSL_SMALL_STACK refactor 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
af6bd1d163 configure.ac: tidying linuxkm reqs/exclusions tests at end. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
16267a1889 configure.ac: error when ENABLED_LINUXKM but $KERNEL_ARCH is empty (no default, no user value). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
cd88a2c7df wolfcrypt/test/test.c: when WOLFSSL_LINUXKM, don't do the large-malloc-incurring wc_scrypt()s in scrypt_test(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
76cba38971 wolfcrypt/src/ge_448.c: redo small stack refactor of ge448_double_scalarmult_vartime(), so that when -UWOLFSSL_SMALL_STACK, code is effectively unchanged. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
f4981d4c91 linuxkm/module_exports.c.template: include openssl compat layer headers in case user configuration needs them. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8331079c36 configure.ac: --enable-compkey gates in the recursive do_mp_jacobi(). mutex with --enable-linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
dc4b15a265 test.c: fix gating on heap deallocation in hc128_test() to match earlier tweak to gating on allocation. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
b52d50d903 test.c: various improvements and fixes pursuant to dgarske's comments on PR #3244 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a80b0c1982 test.c: don't exclude prime_test when -DOLD_PRIME_CHECK, but to exclude it when -DWOLFSSL_LINUXKM. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
170322956b wolfssl/test.h: polish implementation of HAVE_STACK_SIZE_VERBOSE, now enabled with --enable-stacksize-verbose; internal symbol renamed from original DEBUG_STACK_SIZE_VERBOSE, helper functions and macros refactored to be formally threadsafe and to track the overall high water mark (reports same "stack used" value as --enable-stacksize after final return); add "setting stack relative offset reference mark in funcname() to x" message at entry; add configure mutexing of --enable-stacksize[-verbose] relative to --enable-linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
63e3eae416 src/wolfio.c: update patch to wolfIO_HttpProcessResponse() (PR #3204). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
b99908ae66 configure.ac: refactor test -z "${KERNEL_ROOT}" into "${KERNEL_ROOT}" = "", and remove new AM_CFLAGS="$AM_CFLAGS -msse4" (bringing back identical to logic in master) now that $CFLAGS_SIMD_ENABLE et al take care of it. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
d033b1fe24 m4/ax_linuxkm.m4: add autosensing of -msse4. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5589565051 linuxkm: add autotools detection of usable compiler flags for enabling and disabling SIMD and fp registers and auto-vectorization, and integrate into linuxkm makefiles. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5d1bea4ff7 linuxkm/Makefile: rename KERNEL_OPT to KERNEL_EXTRA_CFLAGS. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
767f1972e3 aes.{c,h}: move SIMD includes from aes.h to aes.c, to avoid compiler errors on other .c's compiled -mno-sse for linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5504d9cd4e linuxkm: dial in SIMD options in Kbuild; add boilerplate at the top of all files added for linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
4f38fb2f78 linuxkm/Kbuild: gate EXPORT_SYMBOL(wolfcrypt_test) on -UNO_CRYPT_TEST. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
cd14cfb092 linuxkm: override-disable SIMD instructions for all .c.o's, with exceptions enumerated in Kbuild (currently only aes.c), and couple -msse with -fno-builtin-functions; export ENABLED_ASM for use as a pivot in Kbuild; use asm/i387.h, not asm/simd.h, for kernel_fpu_{begin,end}() protos. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
3626332334 wolfcrypt/src/aes.c for linuxkm: add missing vector register push/pops. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
87b2384cac linuxkm settings.h: define NO_STDIO_FILESYSTEM 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
69052ff535 linuxkm: explanatory message and error exit on attempted make install. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
e881d92366 add linuxkm/module_exports.c.template to linuxkm/include.am $EXTRA_DIST. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
05bca8b0ee when BUILD_LINUXKM, suppress building the library; rename $KROOT/$KARCH to $KERNEL_ROOT/$KERNEL_ARCH; remove SIMD enablement from linuxkm CFLAGS; add linuxkm support for -DKERNEL_OPT=x. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
360c749703 add {SAVE,RESTORE}_VECTOR_REGISTERS() macros for kernel_fpu_{begin,end} when WOLFSSL_LINUXKM, to allow safe use of AESNI and SIMD instructions in the kernel. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
2c564a7728 update .gitignore with more artifacts from linuxkm build. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
9549a5f973 linuxkm: add linuxkm/module_exports.c.template, and autogenerate linuxkm/module_exports.c. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
e8b69f8a6a dh_test(): fix missing casts for XMALLOC(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
7bc33f4ec1 linuxkm: retain noinline from kernel headers, and use it directly in wolfssl/wolfcrypt/sp.h. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
9aa3a4c559 linuxkm/Kbuild: make dependency on get_thread_size order-only, to suppress frivolous rebuilds on kernel 4.x. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
f440089e92 dh_test(): fix typo (undersized dynamic buffers). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8b19a9b58c benchmark.c: fix always-true tests for DECLARE_VAR_IS_HEAP_ALLOC. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
f106fea0d8 rsa_no_pad_test(): fix uninited pointer. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
4ea8b46177 dh_test(): refactor remaining bare returns to ERROR_OUT(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
2ee218761e dh_test(): missed a spot in last commit. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
ca1a991de5 wolfcrypt/test/test.c: fix an error-path leak in dh_test(), and deal with possible -Wdeclaration-after-statement for XFILE file. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a7381f8a48 test.c:rsa_test(): fix uninited pointer 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
6c32a730c2 more work on DECLARE_VAR -- fix allocation failure handling in bench_rsa_helper() to avoid uninitialized variables. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
426de2101a more work on DECLARE_VAR -- proper handling of failed allocations. WIP. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
d8e71e8dd2 linuxkm/Kbuild: disable objtool on AESNI asm objects -- they work in the kernel as-is, despite "unannotated intra-function call" and "BP used as a scratch register" warnings. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
3c91ce9342 wolfcrypt/src/sp_int.c: undo 8efb1142f1f2744ff128033df8a3a2d43e42fd93 to take dgarske's better wc_bigint_init()-based take on it (aa870861921a317cca9a978a75a7de127809e100). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
d7450b85f7 linuxkm/Makefile: use -Wno-declaration-after-statement (needed for heapful DECLARE_VAR() et al). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
c5d28c16b5 wolfcrypt/src/sp_int.c: clear whole struct in sp_init() and sp_init_multi(), to fix uninited pointer free()s in sp_free() when --enable-sp-math -DHAVE_WOLF_BIGINT. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
9b7c753165 wolfssl/wolfcrypt/types.h: make DECLARE_VAR() et al use heap allocation not only when WOLFSSL_ASYNC_CRYPT but also when WOLFSSL_SMALL_STACK. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
ce8f2e65de wolfcrypt/src/sha256.c: undo c801de9d23c2f3348b84fdb8d893f81e6c3c2849 (dgarske has better&correct fix in 76e1760f915934bdc4911f3ae41abe6803ae094a). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
571bf897c4 wolfcrypt/test/test.c: stack->heap refactor for dh_test(). 2020-09-23 18:32:15 -05:00
David Garske
66b59bda9b Fix for expected fail test in openssl_test for partial block. Fix for mp_test with ECC disabled, which uses mp_init_copy. 2020-09-23 18:32:15 -05:00
David Garske
0f8cf32122 Fix for possible leak in openssl_test because EVP free not called with WOLFSSL_SMALL_STACK_CACHE (SHA256/SHA512). Added return code checking to the openssl_test in wolfCrypt test. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
32e30d23c6 wolfcrypt/test/test.c: fix uninitialized values in aesofb_test(). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
e09487de1f sha256.c: add missing _SMALL_STACK_CACHE initialization in InitSha256(). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
922b023aea wolfcrypt/src/random.c: rename the DRBG internal type __DRBG, because some customer is compiling libwolfssl with a "g++" override, which precludes typedefs and structs with different types but equal labels. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
9611f7abfd linuxkm/Makefile: add no-op distdir rule. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
03fe9c15c0 linuxkm/Makefile: add do-nothing dist rule, and refactor setness tests for libwolfssl.ko to be make-dist-compatible. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
f56c6d1d8f wolfcrypt/test/test.c and wolfssl/test.h: implement DEBUG_STACK_SIZE_VERBOSE, measuring and reporting stack usage separately for each test. to use, ./configure --enable-stacksize && make CFLAGS+=-DDEBUG_STACK_SIZE_VERBOSE; also, remove a throwaway dev pragma that snuck into an earlier commit. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
925afe3b74 cast XMALLOC() return values assiduously, for Visual Studio compatibility. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
195b5d2d2c lkm: add linuxkm/include.am, and include it in Makefile.am. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
d86b0601b9 lkm: tweak Kbuild to work on 4.x (hardcoded fallback stack size); add linuxkm/get_thread_size.c. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
c194fb3beb lkm: add autodetection of kernel stack frame size; reactivate objtool scrutiny since _asm files are indeed not yet kernel-compatible; delete linuxkm/lkm_testcrypto.c and use wolfcrypt/test/test.c. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
535822f4df wolfcrypt/test/test.c: refactor for stack size and namespace control, allowing embedding of wolfcrypt_test() in kernel module. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
f5975d95db src/ssl.c: use heap for workspace in wolfSSL_X509_sign(), wolfSSL_d2i_RSAPrivateKey_bio(), and wolfSSL_CTX_use_RSAPrivateKey(). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
9ca94d6ca7 wolfcrypt/src/ge_448.c: refactor ge448_double_scalarmult_vartime() to use heap for workspace unless WOLFSSL_NO_MALLOC. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
1735bd7430 lkm_testcrypto.c: refactor subtests at end of dh_test() to use ERROR_OUT() with proper codes. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
217ec4ebd3 lkm: tweaks to self-test dynamics/messages. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
554879da00 lkm: self-test working now (certain options, which ones TBD, crash kernel). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
34fd53b4fc linuxkm: WIP support for wolfcrypt_test() at module load time. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
0c35998178 linuxkm/module_hooks.c: log "cleanup complete" at unload time. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
92df5692b1 wolfcrypt/src/ecc.c: revert to commit g0fa5af9, which has all the necessary fixes. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
0cfe9ca5d6 configure.ac: --enable-linuxkm: improved defaults and consistency checking. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
92406e17ca wolfssl/wolfcrypt/settings.h: for _LINUXKM, set WOLFSSL_SP_DIV_64 to help avoid gcc xdivti3() references. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
5efdee4277 wolfssl/wolfcrypt/types.h: tweak _LINUXKM macros XMALLOC(), XFREE(), and XREALLOC() to dummy-use "heap" and "dynamic type" arguments. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
add78dfba9 wolfcrypt/src/sp_int.c: add _LINUXKM do_div codepaths for a couple more 64 bit divisions, in sp_div_word() and sp_mod_d(). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
9ab1df690a wolfcrypt/src/ecc.c: fix uncompilable !WOLFSSL_SP_MATH && WOLFSSL_SMALL_STACK_CACHE implementations of ecc_key_tmp_init() and ecc_key_tmp_free() (the latter misnamed ecc_key_tmp_final()). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
836915d05f linuxkm: configure.ac more incompatible options: --enable-fastmath, --enable-iopool, and --enable-fips; linuxkm/Makefile: reduce -Wframe-larger-than from 65536 to kernel-compatible 5000; wolfssl/wolfcrypt/settings.h: unset HAVE_THREAD_LS when WOLFSSL_LINUXKM; wolfssl/wolfcrypt/types.h: when NO_INLINE and __GNUC__, #define WC_INLINE __attribute__((unused)) rather than to nothing to avoid -Wunused-function warnings; wolfssl/wolfcrypt/wc_port.h: #undef noinline after Linux kernel header includes (another macro conflict). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
03d5a4eadd wolfcrypt/src/integer.c: mp_div_d(): refactor another 64 bit division to use do_div() when WOLFSSL_LINUXKM. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
2a3fd57b36 linuxkm/Kbuild, linuxkm/module_hooks.c: tweaks for buildability on kernel 4.9 (may also fix build on 3.x). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
2591479866 linuxkm: add macros mapping malloc(), free(), and realloc() to the kernel equivalents, don't set WOLFSSL_NO_MALLOC, and reduce -Wframe-larger-than= from 256k to 64k; tweak fix for HAVE_INTEL_RDSEED conflict with WOLFSSL_LINUXKM; add clean rule to linuxkm/Makefile. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
911b23d2b4 configure.ac: check for incompatible combinations, and restore check for non-empty $KROOT when --enable-linuxkm. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
2bcdfce6df wolfcrypt/src/evp.c: tweak to silence gcc -Wmaybe-uninitialized. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
dff5344d82 configure.ac: when --enable-asm (default on), for gcc amd64 target always include -msse4 even if not --enable-intelasm (it's needed for TFM_X86_64 inline asm). 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
c0d831ea3a whoops, can't assert on non-empty "$(AM_CCASFLAGS)$(CCASFLAGS)" in linuxkm/Makefile -- they are often legitimately empty. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
1aa15632ce initial buildability of full libwolfssl.ko loadable kernel module for Linux via ./configure --enable-linuxkm && make. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
0e480d1a14 Linux KM compilability cont'd: conform to C89isms (declarations before statements); iffdef WOLFSSL_LINUXKM use do_div() for long long division rather than C operator (avoids unresolvable compile-time callouts to libgcc function); misc gating and relocations for includes. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
603da9e747 fix whitespace. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
14e3da9206 .gitignore: add *~ for emacs backup files. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
bc1c85842d WIP: autotools support for LKM 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
0f783077f8 fix stray whitespace 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
dd825d90c4 more LKM WIP: polish up the struct DRBG refactor ("struct DRBG_internal"), tweaks for buildability on 3.x kernels (now builds on 3.x, 4.x, and 5.x up to 5.8.1), move a slew of #[un]def[ines] from wc_port.h to settings.h where they belong, misc cleanup. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
3c2155f4a9 linuxkm WIP -- update for kernels 4.9.x (LTS representative) and 5.8.x (latest). 2020-09-23 18:32:15 -05:00
David Garske
6425ebb60e Linux Kernel Module support using "--enable-linuxkm". 2020-09-23 18:32:15 -05:00
David Garske
8d2c8b0c89 And the CAVP self test. 2020-09-23 16:23:55 -07:00
Sean Parkinson
4136e132b2 EVP CIPHER: fix block size, mode and table
Block size incorrect for GCM - 1.
Add block size for more ciphers in wolfSSL_EVP_CIPHER_block_size().
Add more ciphers to WOLFSSL_CIPHER_mode().
Cipher table was compiling in entries without support.
2020-09-24 09:18:25 +10:00
toddouska
1c07de883c Merge pull request #3306 from SparkiDev/tls13_pha_psk
TLS 1.3: Post-handshake Authentication and resumption secret
2020-09-23 16:06:55 -07:00
David Garske
f77157bfea Looks like FinalRaw was added post FIPS v2. 2020-09-23 16:06:21 -07:00
David Garske
5e1c0f886f Fix for FIPS and raw hash API's. 2020-09-23 15:59:35 -07:00
David Garske
3c28fe3640 Fixes for bad build options around new hash unit tests. Cleanup indent and newlines. 2020-09-23 15:45:31 -07:00
David Garske
b34bf65b66 Fix for --enable-armasm missing wc_Sha256FinalRaw. Reproduced with ./configure --enable-all --enable-cryptocb --enable-armasm && make. 2020-09-23 15:32:43 -07:00
toddouska
2bb8427ab2 Merge pull request #3320 from dgarske/stmcube
STM32 Cube Pack and AES GCM improvements
2020-09-23 14:39:53 -07:00
Chris Conlon
b7fb202ad3 Merge pull request #3294 from miyazakh/espidf_win
Add setup script for ESP-IDF windows
2020-09-23 14:15:17 -06:00
Ethan Looney
95995d2272 Removed forgotten comment 2020-09-23 13:42:33 -06:00
Ethan Looney
59294708a8 Changed test function call, uses internal AssertIntEQ instead of single call 2020-09-23 13:22:59 -06:00
David Garske
c46301f111 Merge pull request #3328 from ejohnstown/fips-ready-fix
FIPS Ready Windows Fix
2020-09-23 12:18:23 -07:00
John Safranek
9dfbf896a8 TFM NO 64-BIT
When diabling 64-bit fastmath using the flag NO_TFM_64BIT, the sizes of
fp_digit and fp_word get smaller. Using them in math with an int gives
incorrect values. Changed the fp_cmp_mag_ct to return a fp_digit since
its return value is used with an fp_digit. Compare its result against
a FP_LT cast as a fp_digit.
2020-09-23 12:17:41 -07:00
David Garske
ecd5a015eb Merge pull request #3317 from ejohnstown/evp-fix
EVP Fix
2020-09-23 11:10:07 -07:00
toddouska
b0998fb030 Merge pull request #3327 from SparkiDev/pkcs11_ecc
PKCS#11 fix: Generate ECC key for decrypt/sign or derive
2020-09-23 09:28:53 -07:00
toddouska
ad00cf0fc8 Merge pull request #3268 from dr-m/intel-intrinsics
Use Intel intrinsic functions for RDSEED and RDRAND
2020-09-23 09:24:47 -07:00
toddouska
2f74817e32 Merge pull request #3288 from embhorn/zd10901
Fix mp_radix_size off by 1 error
2020-09-23 09:19:02 -07:00
toddouska
cee99de6e1 Merge pull request #3324 from JacobBarthelmeh/Testing
fix WOLFSSL_X509_NAME parse of empty field and add test case
2020-09-23 09:15:24 -07:00
Sean Parkinson
4ed3438be0 TLS 1.3: Post-handshake Authentication and resumption secret
The master secret in arrays is not available post-handshake.
Use the master secret in the session when calculating resumption secret.
2020-09-23 17:09:06 +10:00
John Safranek
07e1baadc9 EVP Fix
Change a few missed strings to use the constant names.
2020-09-22 15:55:46 -07:00
David Garske
f1effea638 Improve the IDE/WIN10 readme to clarify the difference between this and IDE/WIN. 2020-09-22 15:55:08 -07:00
Sean Parkinson
e539322a88 PKCS#11 fix: Generate ECC key for decrypt/sign or derive
Add debugging information to PKCS#11.
2020-09-23 08:30:22 +10:00
John Safranek
54c4258c4b FIPS Ready Windows Fix
1. Modify the WIN10 FIPS solution user_settings.h to check for a
   FIPS Ready flag and to override HAVE_FIPS_VERSION to 3 if set.
2. Removed some redundant constants from the EVP file.
2020-09-22 15:23:36 -07:00
David Garske
41ebc9161a Fix include.am for the renamed configuration example wolfSSL_conf.h 2020-09-22 15:18:11 -07:00
David Garske
99d96246bd Fix for STM32 issue with some Cube HAL versions (such as F777) which could modify non-block aligned bytes in the output buffer during decrypt. For TLS these bytes are the authentication tag. Workaround is to save off the incoming expected authentication tag. ZD 10961. 2020-09-22 15:04:30 -07:00
Ethan Looney
1d4e7d8278 Added unit tests for PKCS7 2020-09-22 14:50:08 -06:00
Juliusz Sosinowicz
77969ae042 Buffer AAD in wolfSSL_EVP_CipherUpdate_GCM so that whole value is hashed 2020-09-22 21:58:57 +02:00
Ethan Looney
53b82fccdb Fixed valgrind issues -2 2020-09-22 13:26:52 -06:00
John Safranek
87d042e37d EVP Fix
Clean up a bad guard check for AES-CTR.
2020-09-22 09:46:27 -07:00
Chris Conlon
8816577824 Merge pull request #3319 from kojo1/no_dh
fix NO_DH guard
2020-09-22 10:33:01 -06:00
John Safranek
fc425b74fc EVP Fix
Add a few more guard flag checks to leave out things appropriately.
2020-09-22 09:06:30 -07:00
David Garske
4922baee30 Updates to README.md. Fix tabs to spaces. 2020-09-22 08:26:20 -07:00
Marko Mäkelä
99a481b28e Use Intel intrinsic functions for RDSEED and RDRAND
Starting with GCC 9 or clang 9, we can actually use <immintrin.h>
without any problems. We only have to flag such
functions where such instructions are being used.

The benefit of using intrinsic functions over inline assembler
is that the compiler is given more flexibility. In particular,
clang -fsanitize=memory (MemorySanitizer, MSAN) will not raise
bogus alarms about memory being uninitialized.

Both intrinsic functions are available starting with GCC 5 and
clang 3.8. The RDRAND wrapper is available starting with clang 3.7
via <immintrin.h>. Before GCC 9 and clang 9, the RDSEED wrapper is
not available via <immintrin.h> but via <x86intrin.h>, and only after
jumping through some hoops to enable it.
2020-09-22 09:45:46 +03:00
Jacob Barthelmeh
cb3338bd57 fix WOLFSSL_X509_NAME parse of empty feild and add test case 2020-09-21 18:44:13 -06:00
Sean Parkinson
f4db9c8986 Test wolfSSL_HMAC with SHA-3
Add more support for HMAC with SHA-3.
2020-09-22 09:39:09 +10:00
David Garske
0f48ae77ef Added the wolfSSL configuration template that is used for the Cube pack. This will be the source for the template going forward. Added some useful debugging options and increased the timeout for the TLS example. 2020-09-21 15:35:35 -07:00
Takashi Kojo
83cdd1c314 fix NO_DH guard 2020-09-22 07:30:21 +09:00
David Garske
deaf3b4b40 Merge pull request #3318 from wolfSSL/revert-3310-stmcubemx/add_401
Revert "stmcubemx: add flags for STM32F401"
2020-09-21 15:05:10 -07:00
toddouska
d3ac2eebe3 Revert "stmcubemx: add flags for STM32F401" 2020-09-21 15:02:56 -07:00
elms
3067e28c4a Merge pull request #3310 from elms/stmcubemx/add_401
stmcubemx: add flags for STM32F401
2020-09-21 14:46:50 -07:00
John Safranek
4f8dbf4f3e EVP Fix
There are some cases when the EVP wrapper code could call strncmp with
a null pointer. This was refactored to remove this possibility.
2020-09-21 14:31:42 -07:00
toddouska
47a720bdc6 Merge pull request #3315 from SparkiDev/evp_xts
EVP XTS key length: two keys used so double length
2020-09-21 13:56:35 -07:00
toddouska
b0dca724d4 Merge pull request #3303 from dgarske/spcortexm
Fixes for building with SP Cortex-M ASM in Rowley CrossWorks and the GCC-ARM examples
2020-09-21 13:53:36 -07:00
toddouska
0e66f9d835 Merge pull request #3299 from dgarske/ocsp_certchain
Fix for possible NULL use if certChain not loaded and OCSP cert request called
2020-09-21 13:40:21 -07:00
toddouska
1274a01dc7 Merge pull request #3289 from dgarske/wpas_small
Fixes for building `--enable-wpas=small` with WPA Supplicant v2.7
2020-09-21 13:37:58 -07:00
toddouska
0f6d391ea1 Merge pull request #3295 from SparkiDev/tls13_p521
TLS 1.3: Fix P-521 algorithm matching
2020-09-21 13:36:48 -07:00
toddouska
117d0e3916 Merge pull request #3273 from dgarske/xilinx_vitis
Xilinx SDK / Vitis improvements
2020-09-21 13:31:06 -07:00
toddouska
793a7bd8c7 Merge pull request #3228 from SparkiDev/expired_cert_crl
Script to find exipred CRLs and certificates
2020-09-21 13:29:32 -07:00
Sean Parkinson
d7525f0f86 EVP XTS key length: two keys used so double length 2020-09-21 11:02:07 +10:00
Hideki Miyazaki
0fd65a2ae3 added ESP-IDF setup script for windows
fixed warnings when using v4.0 esp-idf

added new file, setup_win.bat to include.am
2020-09-20 17:13:39 +09:00
Kaleb Himes
5afd313912 Merge pull request #3298 from ejohnstown/fix-client-usage
Fix Client Usage
2020-09-18 17:32:19 -06:00
Tesfa Mael
f1b4c52c78 Update release note credits 2020-09-18 13:11:10 -07:00
Elms
13c54627e2 stmcubemx: add flags for STM32F401 2020-09-18 09:17:32 -07:00
David Garske
b4aed22eb1 Remove execute bit on files. 2020-09-18 09:16:31 -07:00
David Garske
3eb12cc8e9 Port for Xilinx (xilffs) file system support. 2020-09-18 09:16:31 -07:00
David Garske
0ae9adcfd9 Add Xilinx SDK printf support. 2020-09-18 09:16:31 -07:00
David Garske
63e993b9c1 Fix to allow XTIME override for Xilinx. Spelling fixes in Xilinx README.md. 2020-09-18 09:16:31 -07:00
David Garske
b4c964f729 Fix for possible NULL buffer use if certChain not loaded and OCSP cert request called. 2020-09-18 09:15:44 -07:00
David Garske
135cf1680f Fixes for building with SP Cortex-M ASM in Rowley CrossWorks and the generic IDE/GCC-ARM examples. 2020-09-18 09:15:21 -07:00
David Garske
9deb85ceb1 Fixes to reduce code size. 2020-09-18 09:14:41 -07:00
David Garske
cd6283d3a2 Fix last commit macro logic. 2020-09-18 09:14:41 -07:00
David Garske
d37adefe98 Fixes for edge case builds with certificate req/gen/ext without --enable-opensslextra. 2020-09-18 09:14:41 -07:00
David Garske
d61be6f030 Restore the normal --enable-wpas macro. 2020-09-18 09:14:41 -07:00
David Garske
780e8a4619 Fixes for building --enable-wpas=small with WPA Supplicant v2.7. 2020-09-18 09:14:41 -07:00
Kaleb Himes
eb466668ce Merge pull request #3304 from douzzer/20200917-fix-script-races-and-bwrap-unit-test
20200917 fix script races and bwrap unit test
2020-09-18 08:33:16 -06:00
Sean Parkinson
409daa665d Script to find exipred CRLs and certificates
Check for expiration in 3 months.
First argument is the offset. e.g. "+1 year"
2020-09-18 11:26:27 +10:00
Sean Parkinson
d63ff07edc TLS 1.3: Fix P-521 algorithm matching
Digest size compared to key size - P521 has large key size.
Fixed to round down.
Added P-521 keys and certificates.
Added testing of P-521 keys and certificcates to unittest.
2020-09-18 10:51:55 +10:00
Daniel Pouzzner
a1d231b4dc tests/api.c:test_wolfSSL_ERR_print_errors(): add missing gating on !defined(NO_ERROR_STRINGS). 2020-09-17 12:03:44 -05:00
Daniel Pouzzner
cc1d016d1e configure.ac: define BUILD_TESTS as ENABLED_EXAMPLES, rather than ENABLED_EXAMPLES && !ENABLED_LEANTLS; add missing preprocessor gating in tests/api.c test_wolfSSL_EVP_Digest() and test_wolfSSL_i2d_PrivateKey(). 2020-09-17 12:03:44 -05:00
Daniel Pouzzner
9df9fb7936 unit.test: add bwrap wrapper script at scripts/unit.test. 2020-09-17 12:03:44 -05:00
Daniel Pouzzner
5ed2fe8092 scripts/: more race elimination/mitigation. 2020-09-17 12:03:44 -05:00
Daniel Pouzzner
26901d1cd9 scripts/ocsp-stapling2.test: eliminate races. 2020-09-17 12:03:44 -05:00
David Garske
d22de947b7 Merge pull request #3300 from elms/fix/sp_iar_v6.70
CortexM SP ASM compiling for IAR 6.70
2020-09-17 09:41:52 -07:00
Elms
cd077d74c1 CortexM SP ASM compiling for IAR 6.70
* asm can handle pointers but not arrays, use redirection pointers
 * branch width must be specified explicitly
2020-09-16 16:23:51 -07:00
toddouska
0694eafb5e Merge pull request #3286 from dgarske/aesctr_aesni
Fix for AES CTR with AESNI
2020-09-16 15:11:11 -07:00
toddouska
fe92fa6f3f Merge pull request #3282 from SparkiDev/sp_mod_exp_bits
SP mod exp: support exponents of different lengths
2020-09-16 15:07:31 -07:00
toddouska
86e5a2c528 Merge pull request #3276 from SparkiDev/jacobi_iterative
ECC mp_jacobi: iterative implementation
2020-09-16 15:04:20 -07:00
toddouska
85da1a1d0a Merge pull request #3271 from SparkiDev/tls13_peek
TLS 1.3: allow wolfSSL_peek() to return WANT_READ
2020-09-16 15:02:42 -07:00
toddouska
533bc099eb Merge pull request #3265 from SparkiDev/cpuid_set
Allow the CPU Id flags to be programmatically set
2020-09-16 15:00:30 -07:00
toddouska
ab7408f7d6 Merge pull request #3258 from dgarske/nxp_hw
Fixes for NXP MMCAU/LTC mutex locking and build
2020-09-16 14:57:58 -07:00
toddouska
a3fca7f593 Merge pull request #3247 from JacobBarthelmeh/Compatibility-Layer
Compatiblity Layer Fixes for serial number / ASN1 time / and order of name components
2020-09-16 14:53:51 -07:00
John Safranek
30443dbf23 Fix Client Usage
A string in the client's usage text was made optional depending on the
NO_PSK option, but there was still an attempt to print it. This lead to
a NULL being printed instead. Fixed the print statement.
2020-09-16 13:37:01 -07:00
Juliusz Sosinowicz
04b4ef3e3b Don't send null byte 2020-09-16 14:02:51 +02:00
Ethan Looney
da4478bdf1 Fixed valgrind issues 2020-09-15 12:58:52 -06:00
Kaleb Himes
b22d2a2195 Merge pull request #3291 from douzzer/ocsp-stapling-script-happy-birthday
fix birthday problem in ocsp-stapling*.test
2020-09-15 08:47:39 -06:00
Eric Blankenhorn
5d69c9f1dc Move neg check 2020-09-15 09:12:45 -05:00
Daniel Pouzzner
b669f8eeb9 scripts/: tweak scripts/include.am to run ocsp tests before rather than after testsuite and unit.test; revert POSIXish scripts/*.test to use /bin/sh. 2020-09-14 16:06:45 -05:00
Eric Blankenhorn
6451c4e471 Fix for negative values 2020-09-14 10:00:02 -05:00
Juliusz Sosinowicz
b9527600f4 Return size of consumed buffer 2020-09-14 09:22:47 +02:00
Daniel Pouzzner
d8dc6be5b9 scripts/ocsp-stapling2.test: try using a static prechecked port for the servers on ready_file5 too. 2020-09-12 01:13:35 -05:00
Daniel Pouzzner
51046d45d3 add bwrapping on all other scripts/*.test except those that make Internet connections, and remove test for setuid bit, as some systems are configured to not require setuid/CAP_NET_ADMIN for CLONE_NEWNET. 2020-09-12 00:20:38 -05:00
Daniel Pouzzner
1e9971f64c scripts/ocsp-stapling*.test: add bwrap attempt at top, to isolate network namespace. 2020-09-11 18:20:27 -05:00
David Garske
2ac5835ee8 Fix for CAAM to evaluate before the keylen check. Added checking to make sure keylen cannot overrun buffer. 2020-09-11 15:07:31 -07:00
Daniel Pouzzner
8f25456f86 scripts/ocsp-stapling*.test, wolfssl/test.h: refactor scripts/ocsp-stapling*.test for orthogonality and robustness, with retries and early failure detection. also, reduce sleeps in ocsp-stapling-with-ca-as-responder.test to 0.1, matching sleeps in other 2 scripts. finally, in wolfssl/test.h, #ifdef SO_REUSEPORT do that when binding ports, and add optional rendering of errno strings for failed syscalls using err_sys_with_errno() when -DDEBUG_TEST_ERR_SYS_WITH_ERRNO. 2020-09-11 15:30:37 -05:00
Ethan Looney
a466a57f1d Added fips check and cast variable to word32 2020-09-11 14:28:10 -06:00
John Safranek
3e77dcab5d Merge pull request #3285 from julek-wolfssl/DtlsCheckWindow-window-check
Fix window check
2020-09-11 11:35:02 -07:00
John Safranek
01ad4d59a1 Merge pull request #3263 from douzzer/20200828-neg-SN-invalid-padding
GetASNInt(): check for invalid padding on negative integer.
2020-09-11 08:48:43 -07:00
Eric Blankenhorn
4688f5fa59 Handle leading zero 2020-09-11 08:39:34 -05:00
David Garske
6fcdd848c9 Refactor of AES wc_AesSetKeyLocal and wc_AesSetKey for software only use. Added missing aes argument check on wc_AesSetKeyDirect. 2020-09-10 15:57:36 -07:00
Sean Parkinson
5010572856 Merge pull request #3287 from dgarske/sp_mask
Fix for wrong cast type and added "U" and "UL".
2020-09-11 08:14:13 +10:00
Ethan Looney
7dce2e7f2c Added unit tests for RSA.c 2020-09-10 14:47:51 -06:00
Eric Blankenhorn
78a1670334 Fix mp_radix_size off by 1 error 2020-09-10 09:58:26 -05:00
David Garske
f68eee0788 Fix for wrong cast type and added "U" and "UL". 2020-09-09 16:35:05 -07:00
Sean Parkinson
7a0fba20cf Merge pull request #3281 from dgarske/sp_mask
Fix in SP math for casting signed -1 to unsigned
2020-09-10 08:43:30 +10:00
David Garske
dfc8ed5a73 Fix for AES CTR with AESNI. The flag to indicate use of AES was not set with wc_AesSetKeyDirect. 2020-09-09 14:53:08 -07:00
Juliusz Sosinowicz
e34ccaf481 Fix window check
If `curLT` then diff needs to be decremented. For example: `diff` = 1 represents last packet so it would be the `window[idx] & (1 << 0)` bit of the window variable.
2020-09-09 23:27:49 +02:00
Juliusz Sosinowicz
a65ffe15bc Implement non-blocking SCR on server side 2020-09-09 21:41:20 +02:00
Chris Conlon
29a840aee0 Merge pull request #3280 from dgarske/ebsnet
Fix for bad pre-processor logic
2020-09-09 13:17:45 -06:00
Sean Parkinson
3ecbc7762a SP mod exp: support exponents of different lengths 2020-09-09 15:23:04 +10:00
John Safranek
39b5448601 Merge pull request #3279 from dgarske/minor_fixes
Minor build fixes for typo and CMake
2020-09-08 16:45:52 -07:00
David Garske
b8bdeec940 Fix in SP math for casting signed -1 to unsigned. 2020-09-08 14:18:09 -07:00
JacobBarthelmeh
58e03b2d26 Merge pull request #3272 from embhorn/zd10650
Check for non-blocking return code in BioSend
2020-09-08 14:25:16 -06:00
David Garske
7b8fa42ae1 Fix for bad pre-processor logic. Some compilers are unhappy with the #sslpro even in a block of code not used! 2020-09-08 13:12:11 -07:00
David Garske
6f5a7e87c5 Fix for CMake to only set ranlib arguments for Mac. Fix for stray typo of , -> ;. Fixes #3275 and Fixes #3278 2020-09-08 11:07:12 -07:00
Juliusz Sosinowicz
234705a80c Change buffer in wolfSSL_dtls_import to be const 2020-09-08 09:25:34 +02:00
Sean Parkinson
6fb1feadc7 ECC mp_jacobi: iterative implementation
Slightly faster and less stack used.
2020-09-08 10:05:52 +10:00
Sean Parkinson
5b43977b95 Merge pull request #3277 from julek-wolfssl/failing-nightly-532c2f5
wolfSSL_SESSION_free: Fix failing nightly
2020-09-08 08:11:37 +10:00
Juliusz Sosinowicz
ee2d051536 Fix failing nightly
Failed tests when configured with `./configure --enable-dtls --enable-opensslextra --enable-sessioncerts`. Valgrind discovered a use after free bug. Nulling session->peer fixes the issue.
2020-09-07 14:36:57 +02:00
Sean Parkinson
93bb12ce86 TLS 1.3: allow wolfSSL_peek() to return WANT_READ
When handshake message is processed in wolfSSL_peek() then return
WANT_READ from peek instead of blocking waiting for application data.

Server may send an alert if the client certificate is invalid.
The server also may send NewSesionTicket after client has sent finished
message.
To detect alert before handling application data, then the socket needs
to be checked for data. If the data is an alert then wolfSSL_peek() will
handle the alert, but if it is a NewSessionTicket then wolfSSL_peek()
will process it and block waiting for application data - so return
WANT_READ if no application data seen after processing handshake
message.
2020-09-07 08:30:24 +10:00
Sean Parkinson
70854b8eec Allow the CPU Id flags to be programmatically set 2020-09-04 09:01:27 +10:00
toddouska
7fd51cf9d9 Merge pull request #3267 from SparkiDev/no_client_auth
Get builds with WOLFSSL_NO_CLIENT_AUTH compiling and testing
2020-09-03 15:55:38 -07:00
David Garske
e2b0b11732 Fix for AES CBC with NXP MMCAU locking. 2020-09-03 15:28:45 -07:00
David Garske
a9ff89eafa Refactor of the MMCAU and LTC hardware mutex locking. 2020-09-03 15:28:45 -07:00
David Garske
e791b78d23 Fix to add wrapper for new timing resistant wc_ecc_mulmod_ex2 function version in HW ECC acceleration. Broken in PR #2982. 2020-09-03 15:26:10 -07:00
toddouska
8753b5b947 Merge pull request #3257 from kojo1/user-mutex
fix guard, user define mutex
2020-09-03 15:21:53 -07:00
toddouska
a626ac39f2 Merge pull request #3253 from SparkiDev/chacha20_stream_fix
ChaCha20: Enable streaming with Intel x86_64 asm
2020-09-03 15:18:00 -07:00
toddouska
862eea3962 Merge pull request #3252 from SparkiDev/fe448_32bit_fix
Curve448: fix 32-bit implementation
2020-09-03 15:12:28 -07:00
toddouska
d8ee6fc96d Merge pull request #3251 from SparkiDev/rsa_pkcs11_dox
Add doxygen comments for wc_InitRsaKey_Id()
2020-09-03 15:10:20 -07:00
toddouska
9901eb9272 Merge pull request #3249 from SparkiDev/tls13_early_data_fix
TLS 1.3 Early Data: fix
2020-09-03 14:49:39 -07:00
toddouska
db805524de Merge pull request #3248 from SparkiDev/aes_cbc_oob
AES-CBC check for input size of 0
2020-09-03 13:40:34 -07:00
Jacob Barthelmeh
682b1468b8 free test certificate when test is done 2020-09-02 16:05:05 -06:00
toddouska
b3acd57de5 Merge pull request #3254 from dgarske/leaks
Fixes valgrind leak reports (related to small stack cache)
2020-09-02 10:44:49 -07:00
toddouska
9268de229a Merge pull request #3266 from dgarske/unit_test
Fix for DH compute key compatibility function failure
2020-09-02 10:23:23 -07:00
JacobBarthelmeh
914905f1bc Merge pull request #3193 from embhorn/zd10457_b
Fix CheckHostName matching
2020-09-02 10:36:02 -06:00
toddouska
6f56c3c800 Merge pull request #3204 from dgarske/ocsp_nonblock
Fix for OCSP response in non-blocking mode and testing script improvements
2020-09-01 15:56:52 -07:00
Chris Conlon
97241331ac Merge pull request #3246 from ethanlooney/23rd_branch
Added ecc.c unit tests to api.c - final PR
2020-09-01 14:44:14 -06:00
Jacob Barthelmeh
fd2074da00 fix for order of components in issuer when using compatiblity layer api to generate cert 2020-09-01 09:27:45 -06:00
Sean Parkinson
89b9a77eca Get builds with WOLFSSL_NO_CLIENT_AUTH compiling and testing
Fix build for no client or server and no client auth.
Fix tests to detect when no client auth compiled and test is trying to
do client auth.
2020-09-01 15:27:46 +10:00
David Garske
c587ff72d2 Fix for occasional unit.test failure in test_wolfSSL_EVP_PKEY_derive. 2020-08-31 14:04:51 -07:00
Ethan Looney
568184f53f Changed len from hardcoded value to sizeof oid 2020-08-31 13:42:23 -06:00
Ethan Looney
c8d93d4d5e Added ecc.c unit tests to api.c 2020-08-31 13:42:23 -06:00
David Garske
e9b1ceae7e Merge pull request #3255 from tmael/big_endian
Make ByteReverseWords available for big and little endian
2020-08-31 07:34:50 -07:00
David Garske
28b2be37cd Merge pull request #3259 from ejohnstown/sniffer-no-oldtls
Sniffer without OldTls
2020-08-31 07:34:24 -07:00
Sean Parkinson
54c8774103 ChaCha20: Enable streaming with Intel x86_64 asm 2020-08-31 09:06:51 +10:00
Sean Parkinson
91c131fbd8 Curve448: fix 32-bit implementation
Fix small define check
2020-08-31 09:05:06 +10:00
Sean Parkinson
db864be6a4 TLS 1.3 Early Data: fix
Will process early data packets now.
Added test to check output of server for early data being received.
2020-08-31 09:03:05 +10:00
Sean Parkinson
d2802f2d15 Merge pull request #3264 from dgarske/iar_sp
Fix for building SP math with IAR
2020-08-31 08:40:50 +10:00
Sean Parkinson
f444c63560 Merge pull request #3262 from julek-wolfssl/missing-cipherExtraData-2
HAVE_SESSION_TICKET can also be defined without TLS 1.2
2020-08-31 08:34:54 +10:00
David Garske
5692135819 Fix for building SP math with IAR to force noinline. ZD 10839 2020-08-28 11:04:28 -07:00
Daniel Pouzzner
9c76f19625 GetASNInt(): check for invalid padding on negative integer. 2020-08-28 12:43:21 -05:00
Juliusz Sosinowicz
c6d1d524fc HAVE_SESSION_TICKET can also be defined without TLS 1.2 2020-08-28 16:05:28 +02:00
Juliusz Sosinowicz
605b274442 Jenkins fixes 2020-08-28 12:04:11 +02:00
Sean Parkinson
015c73686f Merge pull request #3261 from dgarske/zd10848
Fixes for several implicit cast warnings
2020-08-28 16:49:03 +10:00
David Garske
94b0dcb7e9 Peer review feedback to add explicit parenthesis on cast. 2020-08-27 16:18:54 -07:00
David Garske
0d2e37cc42 Fixes for several implicit cast warnings. ZD 10848. 2020-08-27 13:51:55 -07:00
Juliusz Sosinowicz
52df9d6c69 TLS and DTLS both need to support APP DATA during SCR
Also some misc fixes
2020-08-27 21:13:19 +02:00
David Garske
21d17b17d0 Fix typo in code comment for ECC curve cache. Fix for valgrind report of possible use of uninitialized value with ChaCha/Poly AEAD test. 2020-08-27 12:01:24 -07:00
David Garske
32b46e344d Fix for ECC curve cache without custom curves enabled. 2020-08-27 11:18:55 -07:00
David Garske
3e685fdb5b Fix for DTLS DoClientHello HMAC free (function has another exit point). 2020-08-27 10:02:15 -07:00
Jacob Barthelmeh
ab52bcf43d add overried for max entries and certificate generation size 2020-08-26 19:22:57 -06:00
John Safranek
5b39976cc0 Sniffer without OldTls
1. Put a guard around the call to DeriveKeys() when building with
  --enable-sniffer --disable-oldtls. Disabling OldTls removes the
  DeriveKeys() function. Similar logic used in internal.c.
2020-08-26 16:47:44 -07:00
Eric Blankenhorn
ea5c290d60 Fix CheckHostName matching 2020-08-26 14:03:17 -05:00
David Garske
9af0e5528e New openssl_test return code checking requires fix from PR #3243. 2020-08-26 10:22:00 -07:00
Tesfa Mael
b90acc91d0 Make ByteReverseWords available for big and little endian 2020-08-26 10:13:06 -07:00
David Garske
1b2b3de2c9 Fixes for missing free calls on hash tests. 2020-08-26 09:48:46 -07:00
David Garske
6d5731b8e9 Fixes for HMAC_CTX cleanup not being called to free SHA2 resources with WOLFSSL_SMALL_STACK_CACHE. Added return code checking and cleanup for openssl_test. 2020-08-26 09:45:26 -07:00
David Garske
5c76afc41c Fix for SHA256 missing initialization of small stack cache variable. Fixes issue with Intel ASM and WOLFSSL_SMALL_STACK_CACHE 2020-08-26 09:44:32 -07:00
David Garske
3878af96cd Fix for SP init and free with HAVE_WOLF_BIGINT. Fix for sp_free macro typo. Fix to expose mp_init_copy with ECC disabled because its used by mp_test. 2020-08-26 09:42:29 -07:00
David Garske
61545df606 Fix to make sure DTLS cookie HMAC free gets called. Note: This does not cover the many error case paths. 2020-08-26 09:41:26 -07:00
David Garske
14e1489365 Fix for SRP leaks with WOLFSSL_SMALL_STACK_CACHE 2020-08-26 09:41:09 -07:00
Jacob Barthelmeh
bc58dde700 fix for serial number containing 0's and for RNG fail case 2020-08-26 00:03:39 -06:00
Sean Parkinson
e2b5de2657 Add doxygen comments for wc_InitRsaKey_Id() 2020-08-26 09:04:40 +10:00
David Garske
6a984da53f Fixes and Improvements to OCSP scripts. Fix for OCSP test with IPV6 enabled (use -b bind to any on server). Fix to use random port number for the oscp-stapling.test script. Reduce delay times in scripts. 2020-08-25 10:55:41 -07:00
Juliusz Sosinowicz
8b934624f5 DTLS non-blocking scrwith example 2020-08-25 11:26:20 +02:00
Sean Parkinson
3a25faea60 AES-CBC check for input size of 0
Don't need to do anything when size is 0.
2020-08-25 13:36:45 +10:00
Jacob Barthelmeh
ef9beaf271 adjust sanity check on serial number size to match fix 2020-08-24 18:15:05 -06:00
Jacob Barthelmeh
c7136498ec add test case 2020-08-24 17:19:03 -06:00
Jacob Barthelmeh
c4a6fba591 fix for ASN1 time and serial number 2020-08-24 17:00:19 -06:00
toddouska
d077efcbb3 Merge pull request #3237 from SparkiDev/mp_oob_1
Fix out of bounds read when writing to very long buffer
2020-08-24 15:28:00 -07:00
toddouska
c5cab6afba Merge pull request #3236 from dgarske/retcheck
Various fixes and improvements (return codes, build warns and func doc)
2020-08-24 15:27:04 -07:00
toddouska
7e6100593e Merge pull request #3223 from SparkiDev/fp_gcd_fix
Check the error return from fp_mod in fp_gcd
2020-08-24 15:24:20 -07:00
toddouska
cf208901fd Merge pull request #3218 from guidovranken/wc_PKCS12_PBKDF_ex-leak-fix
In wc_PKCS12_PBKDF_ex, free outer loop variable if inner loop fails
2020-08-24 15:23:47 -07:00
David Garske
a23b30bc18 Merge pull request #3245 from tmael/ctx_pKey
Correct a mismatch of directives
2020-08-24 14:39:43 -07:00
David Garske
749025963e Merge pull request #3239 from SparkiDev/ed448_cast
Ed448: Fix compiler warning Intel -m32
2020-08-24 10:13:25 -07:00
David Garske
7ee2b61a5a Peer review feedback to also check EAGAIN and always have supported. 2020-08-24 08:18:25 -07:00
David Garske
47cc8d232a Fix in ED448 wc_ed448_check_key function for possible dereference of a null pointer. 2020-08-24 07:31:06 -07:00
Sean Parkinson
4f44df96dc MP: integer OOB write fix
mp_to_unsigned_bin_len() now checks length passed in is greater than or
equal length to write.
2020-08-24 22:48:52 +10:00
Sean Parkinson
955a53dce3 Ed448: Fix compiler warning Intel -m32 2020-08-24 16:29:48 +10:00
Sean Parkinson
e30361e186 Fix out of bounds read when writing to very long buffer
mp_to_unsigned_bin_len() didn't handle buffers longer than maximum MP
size. Fixed tfm and sp_int versions.
2020-08-24 09:18:07 +10:00
David Garske
085f55195a Fix for handling OCSP response in non-blocking mode. 2020-08-21 15:50:34 -07:00
David Garske
7d45e85b03 Add ED448 to the "all" options. 2020-08-21 15:47:02 -07:00
David Garske
083f143c89 Fixes for warnings with minimum ECC build. 2020-08-21 15:47:02 -07:00
David Garske
51c2960407 Added function comment for wolfSSL_i2a_ASN1_OBJECT. Added heap context for wolfSSL_CertManagerCheckOCSP 2020-08-21 15:47:02 -07:00
David Garske
5f059306fd Fix for case with ssl->error not being set. 2020-08-21 15:47:02 -07:00
David Garske
03b7ac559a Fix for example return code checking. 2020-08-21 15:47:02 -07:00
toddouska
44e575b8c4 Merge pull request #3227 from dgarske/release-4.5.0-async
Release 4.5.0 async
2020-08-21 15:34:20 -07:00
David Garske
fd2aece058 Fix for building ECC_CACHE_CURVE without WOLFSSL_CUSTOM_CURVES. 2020-08-20 16:16:18 -07:00
David Garske
3fbaccc8a1 Fix for API unit test test_wolfSSL_X509_sign, which can have a varying length depending on if MSB is set. About 1 in 200 tests would fail. 2020-08-20 15:33:28 -07:00
David Garske
dd517fd81c Fixed several compiler warnings with inline variable declaration, deprecated func decl and small stack use of invaid memory (heap). Thanks @douzzer for these. 2020-08-20 15:13:43 -07:00
David Garske
92cf0d7b10 Fix numerous maybe-uninitialized errors in WOLFSSL_SP_SMALL and WOLFSSL_SMALL_STACK cases. 2020-08-20 15:05:20 -07:00
David Garske
25f9d15980 Fix for benchmark example when using the ECC encrypt (--enable-eccencrypt) and timing resistance. New timing resistance RNG requirements for ECC Shared Secret. 2020-08-20 14:25:06 -07:00
David Garske
1d55b2f526 Fixes for several memory leaks related to HAVE_WOLF_BIGINT. 2020-08-20 14:25:06 -07:00
David Garske
79c0fd3f29 Fix for ECC make key test not waiting for async completion. 2020-08-20 14:25:05 -07:00
David Garske
0011b7b376 Fix possible ECC curve cache leak for custom curves. Fix possible memory leak with wc_DhKeyDecode and WOLFSSL_DH_EXTRA. Fix leak in dh_test with new call to DH key import. 2020-08-20 14:25:05 -07:00
toddouska
0fa5af9929 Merge pull request #3224 from ejohnstown/release-update
Release v4.5.0 Supplement
2020-08-20 09:34:58 -07:00
John Safranek
05671d183c update README/ChangeLog 2020-08-19 10:53:26 -07:00
Sean Parkinson
549c47de65 Handle when k is 1 or order + 1 for timing resistant ECC 2020-08-19 10:50:37 -07:00
John Safranek
362e328180 NTRU fixes
1. When configuring for NTRU, enable static RSA.
2. The echoserver should not try to use NTRU with TLSv1.3.
2020-08-19 10:46:03 -07:00
David Garske
1f10e77b0f Fix for SP math with WOLFSSL_VALIDATE_ECC_KEYGEN. Fixes logic error on point x/y zero check. 2020-08-19 09:30:32 -07:00
John Safranek
55632a0567 Two more out of order DTLS message fixes. 2020-08-18 17:54:25 -07:00
Sean Parkinson
38b717eb42 Clear MP in ECC to free allocated memory 2020-08-18 17:54:25 -07:00
John Safranek
113753370d Long Test Fixes
1. Sniffer was trying to log a NULL pointer as a string. Logged a string instead.
2. Few misc fixes in ECC.
2020-08-18 17:54:25 -07:00
Tesfa Mael
fbe0e04388 Correct mismatch of directives 2020-08-18 16:44:43 -07:00
Sean Parkinson
3a7ad4f03b Check the error return from fp_mod in fp_gcd
Error can occur when using small stack and memory allocation fails.
2020-08-19 08:50:27 +10:00
John Safranek
6e49a63e50 fix call to MakeAnyCert from wc_MakeNtruCert(); it was missing the new parameter 2020-08-17 17:12:11 -07:00
John Safranek
c1090cff3f update rpm-spec.in 2020-08-17 14:42:20 -07:00
toddouska
028bddd7ab Merge pull request #3215 from ejohnstown/release-4.5.0
Release Update
2020-08-17 13:51:23 -07:00
John Safranek
5c6da52ac1 Update release notes. 2020-08-17 09:20:53 -07:00
Sean Parkinson
cb5d6a5c12 Check ECC scalar before multiplication
A k with more bits than in order doesn't work in ECC scalar
multiplication.
Check private key length in wc_ecc_check_key()
Check private key length in ecc_make_pub_ex()
2020-08-17 08:39:39 -07:00
John Safranek
3be7f3ea3a Reject DTLS application data messages in epoch 0 as out of order. 2020-08-14 17:21:39 -07:00
John Safranek
ef5271dd9f fips-check script shouldn't force FIPS-ready build to be v2. 2020-08-14 14:31:50 -07:00
John Safranek
3f6861ee82 FIPS Ready Fix with ECC Timing Resistance
Commit 6467de5 added some timing resistance to ECC shared secret
agreement. It involved adding an RNG object to the ecc keys so
a random z value can be added to the mix. The older FIPS release
has ECC outside the boundary, so it uses the new ECC code. FIPSv2
has ECC inside the boundary, but all the TLS code checks for that
version of FIPS and leaves out the calls to the new functions as
it is using an older version of ecc.c. FIPS Ready uses the latest
version of ecc.c but compiles as FIPSv2. So, the code outside of
the crypto layer is treating ECC as FIPSv2 and not calling the new
functions, but the crypto layer assumes the RNG should be present,
and errs out on testing.
1. Added a separate option for FIPS Ready to the enable-fips
   configure option. `--enable-fips=ready`. It will treat FIPS
   Ready as the next kind of FIPS release. FIPS Ready will be
   treated like FIPS v3 in the build.
2. Changed the C preprocessor checks for FIPS version 2 to be
   checks for not version 2, with respect to ECC Timing Resistance
   and FIPS builds.
2020-08-14 10:54:55 -07:00
John Safranek
1dc0a76436 Patch from Jacob. When parsing a certificate name, if an item is unknown, its NID is set to 0. Don't try to add NID's of 0. 2020-08-13 17:01:26 -07:00
John Safranek
e16496512e Merge pull request #3216 from SparkiDev/rel_fixes_1
Fixes from C++ and address access checking
2020-08-13 15:32:16 -07:00
Eric Blankenhorn
7744f0d543 Check for non-blocking return code in BioSend 2020-08-13 15:33:20 -05:00
John Safranek
7e6863e78b resolving build issues for FIPSv2 OE2 with --enable-opensslextra 2020-08-13 13:24:44 -07:00
John Safranek
64084bcba2 Add a void to the empty parameter list for the function wolfSSL_SESSION_new(). 2020-08-13 13:18:29 -07:00
Guido Vranken
087fa7cbec In wc_PKCS12_PBKDF_ex, free outer loop variable if inner loop fails 2020-08-13 19:22:36 +02:00
Sean Parkinson
bc74bfebdd Fixes from C++ and address access checking
Fix access of table for cache resistance.
Don't name variable public or private.
Cast from void*
2020-08-13 15:19:49 +10:00
John Safranek
ceed98b952 Modify the openssl test script to run the openssl commands in an eval. 2020-08-12 16:59:10 -07:00
John Safranek
3bd27f7912 fix a bad path in renewcerts 2020-08-12 15:17:21 -07:00
John Safranek
95337e666c Release Update
1. Update the usual versions.
2. Update README and ChangeLog.
3. Modify genecc and renewcerts to update two certificate files that had expired.
4. Update the expired certificate files.
2020-08-12 14:43:47 -07:00
John Safranek
e30341ea83 Merge pull request #3190 from embhorn/zd10712
Sanity check key sizes
2020-08-12 09:37:40 -07:00
toddouska
21ed05b85e Merge pull request #3214 from dgarske/snifferFreeFix
Fix for SSL sniffer free to properly cleanup globals
2020-08-11 20:27:09 -07:00
toddouska
fa146870bd Merge pull request #3155 from julek-wolfssl/openssh-fixes-cherry-picked
Additional OpenSSL compat stuff for OpenSSH
2020-08-11 16:32:31 -07:00
toddouska
532c2f50e8 Merge pull request #3083 from julek-wolfssl/openssl-compat-X509V3_EXT_i2d
Implement more OpenSSL compatibility functions
2020-08-11 15:01:41 -07:00
David Garske
65bcc03885 Fix for SSL sniffer free to properly cleanup globals (resolves issue with then calling ssl_InitSniffer -> ssl_FreeSniffer then ssl_InitSniffer again). ZD 10757. 2020-08-11 14:07:32 -07:00
toddouska
1681ed1b85 Merge pull request #3211 from cconlon/jniconfig
Update "enable-jni" option for current JSSE requirements
2020-08-11 12:39:54 -07:00
Jacob Barthelmeh
5cede22d1e wait to set size till after sanity check 2020-08-11 12:59:01 -06:00
Daniel Pouzzner
e4fe6b6573 Merge pull request #3210 from dgarske/rsa_checkkey_sp
Fix for `unit.test` error with SP and RSA 1024-bit key gen
2020-08-11 12:00:41 -05:00
toddouska
87a00df2ea Merge pull request #3118 from julek-wolfssl/aead-only-fix
Check for WOLFSSL_AEAD_ONLY in wolfSSL_dtls_import_internal
2020-08-11 09:33:47 -07:00
toddouska
4e6bc02257 Merge pull request #2982 from SparkiDev/ecc_sc
ECC now calls mp_submod_ct and mp_addmod_ct
2020-08-11 09:26:56 -07:00
JacobBarthelmeh
8b7f588aaf Merge pull request #3108 from SparkiDev/openssl_interop
Update OpenSSL interopability testing
2020-08-11 09:42:43 -06:00
Juliusz Sosinowicz
6e14b224da Add NULL check in wolfSSL_EC_POINT_invert 2020-08-11 10:11:48 +02:00
Sean Parkinson
93cdfd7132 Update OpenSSL interopability testing
Added TLS 1.3 testing.
Added Ed25519 and Ed448 testing.
Added tesitng of OpenSSL client against wolfSSL server.
Fixed builds of Curve25519/Curve448/Ed25519/Ed448 in different
configurations.
2020-08-11 16:44:45 +10:00
Sean Parkinson
6467de5a88 Randomize z ordinates in scalar mult when timing resistant
An RNG is required for shared secret calculation now.
Use wc_ecc_set_rng() to set an RNG against the ECC object.
ECC verification does not need timing resistance and does not randomize
z ordinates.
2020-08-11 16:12:47 +10:00
Sean Parkinson
3ce933c90a Make fp_montgomery_reduce constant time 2020-08-11 16:12:10 +10:00
Sean Parkinson
0102902445 Add and use a mp_cmp_mag that is constant time. 2020-08-11 16:12:10 +10:00
Sean Parkinson
8b05160349 Reworked ECC mulmod and fix size of k
When using wc_ecc_mulmod_ex2(), the k size can be fixed to be one bit
longer than order.
2020-08-11 16:12:10 +10:00
Sean Parkinson
9ef9671886 ECC uses CT vers of addmod, submod and div_2_mod
The TFM implementations of mp_submod_ct, mp_addmod_ct,
mp_div_2_mod_t are more resilient to side-channels.
2020-08-11 16:12:10 +10:00
toddouska
4f30e37094 Merge pull request #3074 from julek-wolfssl/dtls-multiple-app-records
Handle 2+ dtls APP data records in one udp packet
2020-08-10 14:52:04 -07:00
toddouska
242df3d11a Merge pull request #3209 from SparkiDev/jenkins_fixes_1
Fixes from Jenkins failures
2020-08-10 14:30:27 -07:00
toddouska
98b4272e5b Merge pull request #3202 from ejohnstown/abi-server
ABI Update for Server
2020-08-10 14:25:05 -07:00
David Garske
26aaf473db Fix for unit.test error with RSA 1024-bit key gen when using ./configure --enable-keygen --enable-sp. Issue started in PR #3119 2020-08-10 12:40:29 -07:00
Juliusz Sosinowicz
a50affb408 Malloc enough space 2020-08-10 16:08:46 +02:00
Eric Blankenhorn
50647ccdb1 Sanity check key sizes 2020-08-10 07:19:33 -05:00
Juliusz Sosinowicz
ef4b29ebc7 Jenkins fixes 2020-08-10 12:49:18 +02:00
Juliusz Sosinowicz
55d4817956 Jenkins fixes 2020-08-10 12:39:16 +02:00
Juliusz Sosinowicz
da190b8177 Don't map back to affine in wc_ecc_mulmod. It is done in ecc_map later. 2020-08-10 12:33:18 +02:00
Sean Parkinson
3444b115ba Fix valgrind check to ignore bash leak 2020-08-10 14:02:50 +10:00
Sean Parkinson
0232239959 Ignore test-log-dump-to-file.txt
Sometimes left behind by unit.test
2020-08-10 12:46:53 +10:00
Sean Parkinson
7bb2a69161 Fix memory leak in api.c
When testing wc_ecc_import_raw(), the mp_int's in the ecc object are
initialized.
For small math, this throws away the allocated buffer.
Must free the object before importing.
2020-08-10 12:42:46 +10:00
Sean Parkinson
72d1352bd6 Fix ARM builds
Need to include options.h in assembly now.
bufPt declared in block but not outside.
poly1305_block and poly1305_blocks need prototype - declaration in
wolfcrypt/src/port/arm/armv8-poly1305.c (__arch64__ only).
2020-08-10 11:59:10 +10:00
Sean Parkinson
920c97963c Fix Jenikins failure - ToTraditional not declared
./configure --disable-asn --disable-ecc -disable-rsa --enable-psk
--enable-testcert
2020-08-10 10:57:07 +10:00
Sean Parkinson
19ade820b0 Merge pull request #3208 from dgarske/sp_nonblock
Fixes and improvements for SP ECC non-blocking
2020-08-10 09:59:23 +10:00
David Garske
b25eccb07e Merge pull request #3203 from tmael/libwebsockets
Enable HAVE_EX_DATA for libwebsockets
2020-08-08 14:34:18 -07:00
David Garske
62e78b7cf4 Fix state machine after script rebase. 2020-08-07 16:56:58 -07:00
David Garske
bc03b5793c Add state for ECC verify non-blocking and mont_inv_order to reduce maximum blocking time. 2020-08-07 16:48:16 -07:00
David Garske
f7fcef5f32 Fix for build error / typo for ECC 256-bit non-blocking only. 2020-08-07 16:47:08 -07:00
David Garske
c0a664a8e5 Merge pull request #3200 from douzzer/20200805
Add an error-checking wc_curve25519_make_pub() routine to the API for use by Wireguard
2020-08-07 16:32:52 -07:00
toddouska
1724347f7a Merge pull request #3091 from julek-wolfssl/sess-serialization
Expose session serialization outside of `OPENSSL_EXTRA`
2020-08-07 15:41:27 -07:00
toddouska
89e6f3bcd5 Merge pull request #3206 from SparkiDev/ed448_oob
ED448: Fix out of bounds read in import public
2020-08-07 15:36:11 -07:00
toddouska
17cc941b29 Merge pull request #3195 from SparkiDev/sp_ecc_cache
SP ECC Cache Resitance
2020-08-07 15:35:06 -07:00
JacobBarthelmeh
dd6238fb77 Merge pull request #3174 from embhorn/zd10655
Fix CheckAltNames to handle IP type
2020-08-07 16:04:56 -06:00
Daniel Pouzzner
0faff24a65 refactor wc_curve25519_make_key() to use wc_curve25519_make_pub() to complete the pair. also, add call to fe_init() in the non-NXP codepath of wc_curve25519_make_pub() (note fe_init() is currently a no-op). 2020-08-07 13:02:35 -05:00
Juliusz Sosinowicz
cbd9b3717f Map points to Montgomery form for arithmetic. 2020-08-07 18:18:30 +02:00
Juliusz Sosinowicz
ea6edb6913 Fix memory leak 2020-08-07 17:39:48 +02:00
Chris Conlon
b03e1dd2a9 Merge pull request #3197 from ethanlooney/19th_branch
Added asn.c unit tests
2020-08-07 09:25:50 -06:00
Eric Blankenhorn
064bfa583d Fix CheckAltNames to handle IP type 2020-08-07 10:12:56 -05:00
David Garske
9e1012b48a Merge pull request #3205 from SparkiDev/sp_fixes_3
SP ECC: initialize infinity in make key
2020-08-07 07:12:04 -07:00
Sean Parkinson
4c00af1136 ED448: Fix out of bounds read in import public
Fix formatting
2020-08-07 14:11:11 +10:00
Sean Parkinson
1ea3dc5f55 SP ECC: initialize infinity in make key 2020-08-07 12:15:31 +10:00
Daniel Pouzzner
f6acbd5f97 test_wc_curve25519_make_pub(): fix order of args to wc_curve25519_make_pub(). 2020-08-06 18:37:00 -05:00
Tesfa Mael
6379ca8e10 libwebsockets requires *CRYPTO_EX_DATA* APIs 2020-08-06 16:29:39 -07:00
Daniel Pouzzner
c325001d0d note argument endianness and return values in intro comment for wc_curve25519_make_pub(). 2020-08-06 18:07:39 -05:00
toddouska
82d927d40f Merge pull request #3199 from dgarske/openssl_sha
Fix for building openssl compat without SHA-1
2020-08-06 15:59:26 -07:00
Daniel Pouzzner
0f59e632e1 tests/api.c: add test_wc_curve25519_make_pub(); fix some old stray tabs; remove weird extra string-terminating null in test_wolfSSL_sk_CIPHER_description(). 2020-08-06 17:52:48 -05:00
Daniel Pouzzner
758665e347 Fix for TLS anonymous cipher and PKCS11 cast warnings. (author=dgarske) 2020-08-06 17:49:55 -05:00
Sean Parkinson
132adeac14 Merge pull request #3188 from julek-wolfssl/missing-cipherExtraData
Move `cipherExtraData` so that it is available when HAVE_SESSION_TICKET
2020-08-07 08:18:57 +10:00
Daniel Pouzzner
52a2222c79 curve25519.c: call the new API routine wc_curve25519_make_pub(), not wc_curve25519(), for clarity and consistency (hat tip to Jacob). 2020-08-06 14:48:29 -05:00
John Safranek
14ff41a88c ABI Update for Server
Added WOLFSSL_ABI tags to the functions wolfTLSv1_2_server(),
wolfTLSv1_3_server(), and wolfSSL_accept().
2020-08-06 11:17:25 -07:00
toddouska
e121139178 Merge pull request #3179 from ejohnstown/suitesz
Suite Size Check
2020-08-06 11:05:10 -07:00
toddouska
15be5476e9 Merge pull request #3185 from SparkiDev/fp_check_max
tfm: Check for overflow and return error (fixed max size)
2020-08-06 10:54:26 -07:00
toddouska
4e9d49556e Merge pull request #3194 from SparkiDev/unit_fix_1
Fix unit.test to not fail randomly
2020-08-06 10:51:12 -07:00
toddouska
462f4f9e45 Merge pull request #3196 from cconlon/cavpmarvell
Add fips-check.sh target for marvell-linux-selftest, selftest v2 support
2020-08-06 10:45:03 -07:00
Daniel Pouzzner
b2e7c09b71 ksdk_port.c: third time's the charm? (typo, s/curve25529_bCurveParam/curve25519_bCurveParam) 2020-08-06 12:02:01 -05:00
Daniel Pouzzner
7ae789dbb0 wolfcrypt/src/curve25519.c: fix typo in wc_curve25519() -- CURVE25519_KEYSIZE, not CURVE25519_KEY_SIZE; add static kCurve25519BasePoint at top level 2020-08-06 11:45:54 -05:00
Daniel Pouzzner
5cad0b10e5 fix typo in wolfcrypt/src/port/nxp/ksdk_port.c ("curve_bCurveParam" vs correct curve25529_bCurveParam) introduced in aadec345ab. 2020-08-06 11:35:04 -05:00
Ethan Looney
77bb300409 Removed unnecessary pointers, matched Xfree arugments and checked the return values of generated keys 2020-08-06 09:21:41 -07:00
Ethan Looney
afcb40724e Added proper ifdef's to EccPrivateKeyToDer 2020-08-06 08:06:06 -07:00
David Garske
435eabfb4b Fix build error with unused variables. Added compat function for X509_add_ext. 2020-08-06 07:51:04 -07:00
Juliusz Sosinowicz
25619119b4 Change implicit conversions to explicit conversions 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
f1e2a3c8b9 Code review changes 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
139a192185 Implement wolfSSL_d2i_X509_NAME 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
ca3a608408 Implement functions
- `wolfSSL_d2i_ECPrivateKey`
- `wolfSSL_EC_POINT_add`
- `wolfSSL_EC_POINT_invert`
2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
2529ce21b0 Implement wolfSSL_EC_GROUP_dup 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
ea8dd31de0 Implement wolfSSL_i2d_PUBKEY and refactor wolfSSL_i2d_PrivateKey 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
1f0d6d5f31 New functions implemented
- `EC_POINT_is_on_curve`
- `i2d_EC_PUBKEY`
- `i2d_ECPrivateKey`
- `wc_ecc_point_is_on_curve`
2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
88b9bf3fba Fix memory leak with EncryptDerKey 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
e131d6be5b group->curve_nid is now set to the real NID of the curve 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz
471a9bd9fd Handle 2+ dtls APP data records in one udp packet
Just return one message at a time if processing application data
2020-08-06 14:03:38 +02:00
Juliusz Sosinowicz
c28b7b59c3 Fix jenkins leaks 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz
ad2e710563 Fix missing free 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz
a6651a21f8 Fix segfault 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz
229c5e9563 wolfSSL_X509V3_EXT_i2d cont. 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz
dfee8d0346 wolfSSL_X509V3_EXT_i2d now copies structs instead of trying to convert to DER format 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz
fe1f815761 wolfSSL_X509V3_EXT_i2d: NID_ext_key_usage 2020-08-06 13:45:36 +02:00
Juliusz Sosinowicz
e89015b58a WIP: wolfSSL_X509V3_EXT_i2d 2020-08-06 13:45:36 +02:00
Juliusz Sosinowicz
3621af9996 Implement new OpenSSL API
- i2d_PKCS8PrivateKey_bio
- X509V3_EXT_i2d
- SSL_renegotiate_pending
2020-08-06 13:45:36 +02:00
Juliusz Sosinowicz
42c8f8f9b5 Check for WOLFSSL_AEAD_ONLY in wolfSSL_dtls_import_internal 2020-08-06 13:44:09 +02:00
Daniel Pouzzner
18178e056d add missing const qualifiers to arch variants of curve25519(), and to nxp_ltc_curve25519(). 2020-08-05 21:12:50 -05:00
David Garske
4a167c0f2c Merge pull request #3119 from tmael/do178-fix
DO-178 fix
2020-08-05 16:30:00 -07:00
Sean Parkinson
8afd629a30 Fix unit.test to not fail randomly
Get the serial number from the certificate to calculate the encoding size.
Fix making of the certificate to copy serial number out if not already set.
2020-08-06 08:52:21 +10:00
Ethan Looney
9671901de6 Added a free call to SetSubjectBuffer 2020-08-05 15:52:09 -07:00
Sean Parkinson
83caf39caa SP ECC Cache Resitance
SP ECC improved cache attack resistant implementation.
On by defualt and turn off with WC_NO_CACHE_RESISTANT.
2020-08-06 08:21:08 +10:00
Chris Conlon
e5e87db6aa add HAVE_EX_DATA, OPENSSL_ALL, HAVE_ALPN to enable-jni configure option 2020-08-05 15:43:26 -06:00
David Garske
c421445ba9 Added no SHA-1 hash support for OPENSSL compatibility. Fix for ./configure --enable-opensslextra --disable-sha. This allows using SHA2-256 for the hashing including the derived issuerHash and subjectHash. Adds issuer hash openssl compatibility function X509_issuer_name_hash. 2020-08-05 14:43:24 -07:00
Daniel Pouzzner
ffa2cdd2d1 add public function wc_curve25519() "compute the public key from an existing private key, using bare vectors."; rename existing _LOCAL functions wc_curve25519_GetBasePoint() and wc_curve25519() to nxp_ltc_curve25519_GetBasePoint() and nxp_ltc_curve25519() respectively; add const qualifiers opportunistically to existing _LOCAL function curve25519() 2020-08-05 16:28:17 -05:00
Ethan Looney
49e5d8efea Added additional ifdef's to Ed25519 functions and cast derSz to word32 2020-08-05 12:31:50 -07:00
Ethan Looney
633e950942 Added asn.c unit tests 2020-08-05 10:57:32 -07:00
Chris Conlon
d12b80abdf Merge pull request #3192 from ethanlooney/21st_branch
Added check for wolfmath.c for digits == 0 and test for api.c
2020-08-05 09:51:51 -06:00
JacobBarthelmeh
1034139214 Merge pull request #3081 from kaleb-himes/GH2998_REWORK_FOLLOWUP
Cleanup of example client/server buffer sizes
2020-08-05 09:31:30 -06:00
Sean Parkinson
6c4bcb3b59 tfm: Check for overflow and return error (fixed max size) 2020-08-05 10:42:32 +10:00
Tesfa Mael
5d7649c959 Review comment in sp_int file 2020-08-04 15:37:20 -07:00
Daniel Pouzzner
def3192073 Merge pull request #3189 from SparkiDev/ed448_pkcb_fix
Fix calls to Ed448 sign and verify in test.h
2020-08-04 17:23:45 -05:00
toddouska
0bdaa2d572 Merge pull request #3169 from dgarske/stmcube
STM Cube fixes and documentation improvements
2020-08-04 15:08:04 -07:00
Ethan Looney
42856287ee Added check for wolfmath.c for digits == 0 and test for api.c 2020-08-04 13:25:10 -07:00
toddouska
8d00b015c1 Merge pull request #3182 from dgarske/configall_noold
Fix to NOT enable SSLV3 and TLS v1.0 with `--enable-all`
2020-08-04 12:25:59 -07:00
Chris Conlon
5641e2ae50 Merge pull request #3173 from ethanlooney/18th_branch
Added unit tests for wolfmath.c
2020-08-04 09:10:21 -06:00
Sean Parkinson
c6f83645fe Fix calls to Ed448 sign and verify in test.h 2020-08-04 09:56:14 +10:00
toddouska
0df2da47ff Merge pull request #3180 from embhorn/zd10697
Fix OOB in fp_read_radix_16
2020-08-03 16:44:01 -07:00
toddouska
a536e8acd6 Merge pull request #3187 from SparkiDev/config_fix_1
Fixes for different configurations
2020-08-03 16:41:50 -07:00
toddouska
48be407852 Merge pull request #3186 from SparkiDev/rsa_pss_oob
RSA PSS check input length is hash length
2020-08-03 16:41:15 -07:00
toddouska
87f5dac3c4 Merge pull request #3170 from kaleb-himes/FIPS_USER_SETTINGS
Remove fixed len constraint in FIPS mode
2020-08-03 16:35:26 -07:00
toddouska
bfb4b2079b Merge pull request #3163 from dgarske/nrf52
Fixes for building against latest nRF52 SDK
2020-08-03 16:33:49 -07:00
toddouska
3e84f1c53f Merge pull request #2882 from dgarske/example_configs
Added area for template user_settings files in `examples/config`
2020-08-03 16:32:57 -07:00
Ethan Looney
7f381275b1 Removed comment and changed len equal to variables instead of numbers 2020-08-03 13:31:11 -07:00
Juliusz Sosinowicz
6c92116124 Move cipherExtraData so that it is available when HAVE_SESSION_TICKET 2020-08-03 15:32:49 +02:00
Sean Parkinson
d0969ea1ce Fixes for different configurations
Fix SkipInt() to work with DSA.
Fix protection around SetBitString16Bit() - when WOLFSSL_CERT_GEN and
WOLFSSL_CERT_EXT defined is only use.
WOLFSSL_RSA_VERIFY_ONLY and PSS means testing of PSS won't work.
Fix g++ build around ASN1_SEQUENCE - const variable required to be
initialized.
2020-08-03 14:55:09 +10:00
Sean Parkinson
3ffa4350e8 RSA PSS check input length is hash length
Input is the hash of the message and the hash type is the hash used to
generate the hash/input.
2020-08-03 12:17:03 +10:00
David Garske
4f91d60d22 Fixes for build issues without OPENSSL_EXTRA defined. 2020-07-31 15:25:58 -07:00
David Garske
776b1a2d17 Fix for ED25519 with user_settings.h. Fixes for build warnings. Fix spelling error. Added template for wolfBoot key/sign tools. 2020-07-31 15:17:53 -07:00
David Garske
197c21a508 Fix for --enable-all (also used by --enable-distro) to NOT enable SSLV3 and TLS v1.0. 2020-07-31 13:54:08 -07:00
Eric Blankenhorn
d21d95c629 Fix OOB in fp_read_radix_16 2020-07-31 15:19:40 -05:00
David Garske
3531b581b5 Added return code check wolfSSL_CryptHwMutexInit 2020-07-31 12:01:09 -07:00
David Garske
904241cba4 Fix to only init the RNG once for nRF51/nRF52x. 2020-07-31 11:56:32 -07:00
John Safranek
fd4f8fe7a0 Suite Size Check
1. Check that the cipher suite size is even when doing the Client
   Hello message.
2. Check that the cipher suite size is a multiple of three when doing
   the Old Client Hello message.
3. Check that the hash/signature algorithm list size is even when
   processing the extensions.
2020-07-31 11:44:24 -07:00
toddouska
ff08a01f94 Merge pull request #3171 from SparkiDev/tls13_fin_fix
TLS 1.3: Client requires cert_vfy before finished when not PSK
2020-07-31 11:28:24 -07:00
toddouska
e7fe460fac Merge pull request #2746 from dgarske/cmake
Adds CMake support to wolfSSL
2020-07-31 11:14:59 -07:00
David Garske
71cc5381ad Added new examples/config area with template user_settings.h files and instructions for using. 2020-07-31 11:01:58 -07:00
Ethan Looney
b627610cde Added bad test cases for get_digit and corrected comment formatting 2020-07-31 09:44:10 -07:00
David Garske
db20fb6ca1 Fixes for using CMake with Visual Studio. Improvements to documentation for portability. 2020-07-30 16:44:36 -07:00
David Garske
c30ffad622 Fix for STM PKA ECC parameters. Improvements to the STM AES GCM code. Cleanup of hardware mutex code. 2020-07-30 16:00:19 -07:00
David Garske
48e1dfc910 Remove the STM Cube .ioc files. These examples have been moved to the wolf Cube pack (https://www.wolfssl.com/files/ide/I-CUBE-WOLFSSL-WOLFSSL.pack) 2020-07-30 14:45:52 -07:00
Ethan Looney
c52930bb8a Added freerng to 'test_mp_rand' 2020-07-30 09:37:05 -07:00
Tesfa Mael
d03971e233 Add comment to clarify errno in test 2020-07-30 09:18:45 -07:00
Tesfa Mael
493510e2ea Review comments 2020-07-30 09:18:45 -07:00
Tesfa Mael
4cc7f9e4a9 Check correct returned value 2020-07-30 09:18:45 -07:00
Tesfa Mael
cebb283822 DO-178 changes 2020-07-30 09:18:45 -07:00
Ethan Looney
3381eb2094 Added tests for Sha512.c 2020-07-30 09:18:45 -07:00
Kaleb Himes
d96f86fcd9 Merge branch 'master' into GH2998_REWORK_FOLLOWUP 2020-07-30 09:47:48 -06:00
Chris Conlon
1168bdd05b Merge pull request #3165 from ethanlooney/17th_branch
Added unit tests for wc_port.c
2020-07-30 09:08:28 -06:00
Sean Parkinson
4c0105ed9d Merge pull request #3175 from ejohnstown/dtls-speed-redux
DTLS Test Speed Fix Redux
2020-07-30 22:17:40 +10:00
David Garske
a38f7a4fca Added STM32F1 Cube HAL support (we had StdPeriLib, not Cube). 2020-07-29 17:22:41 -07:00
John Safranek
397d1ab19c DTLS Test Speed Fix Redux
1. Fix the check for XSLEEP_US in the client.
2. Added XSLEEP_MS to mirror XSLEEP_US, in terms of XSELECT().
2020-07-29 16:51:08 -07:00
toddouska
64f6dc08f7 Merge pull request #3164 from SparkiDev/tls13_ocsp2
TLS 1.3 server MUST NOT use OCSP Status V2
2020-07-29 16:23:24 -07:00
David Garske
46ef82e2fd For for STM32 with TLS v1.3 and AES-GCM. The IV was not being reset after using hardware causing the aes->reg to be incorrect. 2020-07-29 15:39:49 -07:00
David Garske
e4650a9151 Fixes for STM32 Crypto hardware acceleration locking to work with multiple threads. Fix for api.c missing devId in new RNG test. Added STM32F207 to configuration template. 2020-07-29 14:55:35 -07:00
Ethan Looney
b4cd0886bb Changed test returns for 'get_digit' to remove implicit conversion errors 2020-07-29 14:23:03 -07:00
Chris Conlon
7861a22d28 add marvell-linux-selftest target to fips-check.sh 2020-07-29 15:10:47 -06:00
Chris Conlon
c6b4fa3be3 add selftest version for newer 4.1.0 validation 2020-07-29 15:10:47 -06:00
David Garske
dafc2bf8d4 Added redirect note for OpenSTM32 to STM32Cube example. PR #3031. Updates to README.md from ST. 2020-07-29 12:04:14 -07:00
Ethan Looney
7c59c74e07 Added unit tests for wolfmath.c 2020-07-29 10:34:15 -07:00
Ethan Looney
b524926837 Deleted unneeded xfopen and xfclose 2020-07-29 09:31:37 -07:00
Kaleb Himes
80678d96b6 Change to inline comment 2020-07-29 10:10:33 -06:00
Chris Conlon
af92c531bf Merge pull request #3168 from ethanlooney/16th_branch
Added semicolons to two functions to fix doxygen issues and deleted ssl param and replaced it with ctx param
2020-07-29 09:31:14 -06:00
Sean Parkinson
f59a1fa295 TLS 1.3: Client requires cert_vfy before finished when not PSK 2020-07-29 10:21:34 +10:00
toddouska
e618257f21 Merge pull request #3167 from dgarske/test_fixups
Fixes for `mutex_test` and API unit test `derSz`
2020-07-28 16:45:58 -07:00
David Garske
4cbf3c3dcd Fixes for the STM Cube TLS in-memory example for CMSIS RTOS v2. 2020-07-28 15:52:02 -07:00
Chris Conlon
70aa11f0a9 Merge pull request #3153 from ethanlooney/15th_branch
Added unit tests for Logging.c
2020-07-28 16:35:31 -06:00
Kaleb Himes
567f1b8be4 Add to settings.h w a warning directive 2020-07-28 15:52:36 -06:00
David Garske
1ed66f11a9 Fixes for STM32L5 benchmarks. 2020-07-28 13:56:23 -07:00
kaleb-himes
ffdc2eddf6 Remove fixed len constraint in FIPS mode 2020-07-28 13:34:52 -06:00
David Garske
223f848dae Expanded documentation for using the wolfSSL Cube pack. Added STM32 benchmarks for several boards. 2020-07-28 12:08:12 -07:00
David Garske
9160a126e4 Fixes for running wolfCrypt test/benchmark with SECP256R1 disabled. Improved detection of ECC key generation size. 2020-07-28 11:43:48 -07:00
toddouska
ff12da30df Merge pull request #2713 from akmcomau/16bit
Updates for 16bit processors / Disable ATECC transport key
2020-07-28 09:27:27 -07:00
Ethan Looney
5af4872bab Changed lock type to 0 2020-07-28 09:16:43 -07:00
Ethan Looney
0448004535 Added semicolons to two functions to fix doxygen issues and deleted ssl param and replaced it with ctx param 2020-07-28 08:39:23 -07:00
David Garske
25fcd082d7 Improve the mutex_test test with pthreads. Fixes #3109 2020-07-28 08:19:32 -07:00
David Garske
8440973d99 Fix for derSz calculation on non-const value keySz. ZD 10654 2020-07-28 08:18:42 -07:00
toddouska
c67aeba806 Merge pull request #3156 from dgarske/armasm
Fixes for building with `WOLFSSL_ARMASM` when `user_settings.h` is used
2020-07-27 16:45:25 -07:00
toddouska
f46e08e9ea Merge pull request #3158 from kaleb-himes/ZD10580_R2
Address buffer underflow, thanks to J.S. for the report on ZD10580
2020-07-27 16:42:42 -07:00
toddouska
5ef7ff6054 Merge pull request #3149 from SparkiDev/tls13_no_cli_cert_err
TLS 1.3: Client with no certificate an error with define
2020-07-27 16:40:07 -07:00
David Garske
13eab0aeab Also check for NRF52_SERIES, since NRF52 is only for NRF52832_XXAA. 2020-07-27 15:26:55 -07:00
David Garske
99f72faedb Fix for nRF5x AES GCM so key is set. Fixes GMAC test. Don't force enable wolf memory and no ASN time for WOLFSSL_NRF5x. 2020-07-27 14:30:41 -07:00
David Garske
8b25b48621 Improvements to CMake support based on feedback from users. 2020-07-27 12:13:08 -07:00
David Garske
b273ba771e Add new file to automake. 2020-07-27 11:04:37 -07:00
David Garske
9a281e5e3a Adds CMake support to wolfSSL:
* Build wolfSSL as a library and builds all examples / tests.
* Added instructions in the INSTALL file.
* Fix for evp.c when being included directly due to improperly placed `WOLFSSL_EVP_INCLUDED`.
2020-07-27 11:04:37 -07:00
Ethan Looney
e7429c8504 Added unit tests for wc_port.c 2020-07-27 09:32:25 -07:00
Chris Conlon
6b3b37604f Merge pull request #3159 from ethanlooney/16th_branch
Added doxygen comments and changed footer date to 2020
2020-07-27 09:24:59 -06:00
Chris Conlon
b0ed250f09 Merge pull request #3162 from ethanlooney/18th_branch
Changed ifndef(NO_SHA224) to ifdef(WOLFSSL_SHA224)
2020-07-27 09:21:28 -06:00
Sean Parkinson
76a35f2a77 TLS 1.3: Client with no certificate an error with define
WOLFSSL_NO_CLIENT_CERT_ERROR
2020-07-27 09:54:51 +10:00
Sean Parkinson
b775058f49 TLS 1.3 server MUST NOT use OCSP Status V2
Parses the extension but does not use the information.
TLSX code change to ensure that the OCSP Status V2 extension is not
written out in EncryptedExtension, CertificateRequest nor Certificate
messages.
2020-07-27 09:32:14 +10:00
Sean Parkinson
7883156f49 Merge pull request #3160 from dgarske/ecc_nb_noctx
Fix for ECC non-blocking only to allow calling without context set
2020-07-27 08:53:42 +10:00
David Garske
8417e0b725 Fixes for building against latest nRF52 SDK. Allow nRF5x AES GCM to be enabled (uses software, but ECB is accelerated). Fix in wolfCrypt test for building AES GSM only with NO_AES_DECRYPT. 2020-07-24 15:46:17 -07:00
Ethan Looney
b734b13120 Changed ifndef(NO_SHA224) to ifdef(WOLFSSL_SHA224) due to 'NO_SHA224' not existing 2020-07-24 14:24:50 -07:00
Ethan Looney
7b357cff39 Changed param's, examples and brief's 2020-07-24 12:54:29 -07:00
toddouska
e84defb268 Merge pull request #3044 from dgarske/sniffer_tls13
TLS v1.3 sniffer support
2020-07-24 11:46:38 -07:00
Ethan Looney
6088a7bd79 Added if defined debug check to only print to file if debug is enabled 2020-07-24 10:03:49 -07:00
David Garske
6324aec179 Fix for ./configure --enable-sp=yes,nonblock --enable-sp-math CFLAGS="-DWC_ECC_NONBLOCK_ONLY". 2020-07-24 09:30:45 -07:00
David Garske
38cef2b3c9 Merge pull request #3151 from ejohnstown/dtls-size
DTLS Size Fix
2020-07-24 08:19:50 -07:00
toddouska
8789ebb02e Merge pull request #3152 from ejohnstown/dtls-test-speedup
DTLS Test Speedup
2020-07-23 16:53:39 -07:00
David Garske
1559d66261 Fix for WC_ECC_NONBLOCK_ONLY case to also check WC_ECC_NONBLOCK. 2020-07-23 15:41:09 -07:00
John Safranek
fd1a1bd0f7 Add some missing frees to the example client when using in the return-not-exit mode for tests. 2020-07-23 14:32:48 -07:00
David Garske
20ef2daa9f Fix for ECC non-blocking to allow calling without context set and block when WC_ECC_NONBLOCK_ONLY is defined. In FIPS mode we need "blocking". 2020-07-23 14:31:41 -07:00
Ethan Looney
6bc4bfd7f2 Added doxygen comments to include all missing ABI functions and changed footer date from 2017 to 2020 2020-07-23 13:25:18 -07:00
JacobBarthelmeh
81475fac96 Merge pull request #3154 from embhorn/zd10651
Fix build error with X509_SMALL config
2020-07-23 13:34:29 -06:00
John Safranek
839044d9e1 1. Remove dead assignment from client test.
2. Fix memory leak in example server test.
3. Use verify callback on certificates to allow callback to fail
   them.
4. Restore the forced failure test cases.
5. Make the verify action thread local.
2020-07-23 12:26:49 -07:00
JacobBarthelmeh
303d0dfedb Merge pull request #3157 from embhorn/zd10631
Fix build issue with OPENSSL_EXTRA_X509_SMALL
2020-07-23 13:18:28 -06:00
kaleb-himes
3c5c0f88d4 Address buffer underflow, thanks to J.S. for the report on ZD10580 2020-07-23 12:20:41 -06:00
Ethan Looney
563806c497 Changed the log dump txt file's directory to include /tests and added it to make clean 2020-07-23 10:12:40 -07:00
Martin Akman
1f8d4149a5 Merge in master 2020-07-23 21:39:18 +10:00
Martin Akman
d02e52e07b More updates from code review 2020-07-23 21:28:51 +10:00
Sean Parkinson
568fc8f5bd Fixes for compiling for ARM64 iOS
Fix bug in ChaCha20 assembly code (was writing one byte too many).
Fix the assembly code to have APPLE format.
Change Poly1305 inline assembly as requested by compiler.
Initialize variables that will be set anyway - compiler complaint.
Change to use the assembly code files for Curve25519 and SHA-512.
Ed25519 not suported with ARM assembly.
2020-07-23 18:08:37 +10:00
toddouska
e198f6e73b Merge pull request #3141 from SparkiDev/tls_cert_alert
Send more detail alerts for bad certificates
2020-07-22 16:46:14 -07:00
toddouska
ab7535c3f6 Merge pull request #3135 from SparkiDev/fp_set_bit
fp_set_bit: return error when bit offset is too large
2020-07-22 16:40:17 -07:00
toddouska
d75e6d4f55 Merge pull request #3131 from JacobBarthelmeh/Testing
add sanity check on padSz
2020-07-22 16:39:27 -07:00
toddouska
ea21d56463 Merge pull request #3127 from SparkiDev/mp_sub_d
mp_sub_d (integer.c): return error when digit is too big
2020-07-22 16:38:37 -07:00
Ethan Looney
f7e4c1c8ad Added SetLoggingCb check 2020-07-22 15:44:13 -07:00
Eric Blankenhorn
9b421ce497 Fix for config failure 2020-07-22 17:22:46 -05:00
Chris Conlon
5f2de9e176 Merge pull request #3130 from TakayukiMatsuo/master
Add support for "X72N Envision Kit" evaluation board
2020-07-22 16:22:14 -06:00
John Safranek
98ae3a2352 Added a suite test use case to cover the new error check. Also fixed and issue with passing a couple flags to the test case runner, and some other changes to support the new test. 2020-07-22 13:20:23 -07:00
David Garske
fe08f23a50 Improved test sleep. Cleanup sleep calls. 2020-07-22 13:08:57 -07:00
David Garske
3a2be13043 Remove execute bit on file. 2020-07-22 12:52:53 -07:00
David Garske
c5371a2dbd Fix for kResumeMsg unused if NO_SESSION_CACHE defined. 2020-07-22 12:15:14 -07:00
Eric Blankenhorn
39271e9234 Fix build issue with OPENSSL_EXTRA_X509_SMALL 2020-07-22 14:08:57 -05:00
David Garske
1af38c5c55 Fixes for building with WOLFSSL_ARMASM when user_settings.h is used. 2020-07-22 10:47:35 -07:00
Ethan Looney
5e515c12fb Removed unneeded comment 2020-07-22 08:28:43 -07:00
John Safranek
c8e9d058f0 DTLS Test Speedup
Change the example client to use select instead of sleep.
If building for the standalone client, it will wait 1 second.
If built for no main driver, it'll wait 10ms rather than 1 second.
2020-07-21 18:40:18 -07:00
David Garske
11b0d963d3 Fix for example client to send HTTP GET on resume with "-g". Fixes issue with ./scripts/openssl.test. 2020-07-21 15:42:33 -07:00
Sean Parkinson
056ee0987c Merge pull request #3146 from dgarske/sp_nonblock
ECC non-blocking support
2020-07-22 08:36:21 +10:00
Ethan Looney
953e7cf181 Changed sz type from int to long 2020-07-21 15:28:17 -07:00
Eric Blankenhorn
89913076f1 Fix build error with X509_SMALL config 2020-07-21 16:36:30 -05:00
David Garske
639f73fe1f Fix for client writes to not include the null term. 2020-07-21 13:42:01 -07:00
David Garske
4e637ddf10 Cleanup on example client/server messages and sizes. Original PR #3023 caused sending extra null characters in normal (non HTTP) example cases. 2020-07-21 13:34:25 -07:00
David Garske
8ead28f2f4 Merge pull request #3150 from ejohnstown/sctp-test
SCTP Test
2020-07-21 12:46:13 -07:00
Ethan Looney
b500a54fc5 Added new file to read in and dump error message and added cleanup within cleanup script 2020-07-21 12:30:43 -07:00
Ethan Looney
e8034619ba Add more if defined to ERR_print_errors_fp 2020-07-21 12:30:43 -07:00
David Garske
9268ae1397 Fix line length issues. Add debug msg in test to show number of non-blocking iterations.
```
$ ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS="-DWOLFSSL_PUBLIC_MP" --enable-debug && make
$ ./wolfcrypt/test/testwolfcrypt
...
ECC non-block sign: 18063 times
ECC non-block verify: 35759 times
ECC      test passed!
```
2020-07-21 10:41:25 -07:00
Sean Parkinson
c45e192581 Send more detail alerts for bad certificates 2020-07-22 00:07:23 +10:00
TakayukiMatsuo
c204eb0fb1 commented out NO_ASM_TIME macro to enable certificate validation 2020-07-21 16:09:16 +09:00
John Safranek
5d5aa129ca When attempting to send a message with DTLS, if it is too large, return an error rather than splitting it across records. (ZD 10602) 2020-07-20 16:14:53 -07:00
John Safranek
10c293a76c SCTP Test
1. Removed test cases for DTLSv1.0 that used AEAD ciphers.
2. Cleaned up some typos in the test configs.
3. Fixed typo in a WOLFSSL_SCTP ifdef check.
2020-07-20 15:03:48 -07:00
toddouska
61d81dd878 Merge pull request #3123 from SparkiDev/mp_rshb
rshb check range of n
2020-07-20 13:08:45 -07:00
David Garske
29abd72c39 Merge pull request #3024 from kaleb-himes/ZD10411
Update arduino script to reflect includes of inline files
2020-07-20 11:29:49 -07:00
David Garske
e6017de19d Fix in snifftest to try loading private key into static ephemeral and private key. Updated pcap files (were missing TCP packets). 2020-07-20 11:10:46 -07:00
Chris Conlon
ddb2923c19 Merge pull request #3133 from ethanlooney/13th_branch
Added unit tests for Hash.c - Fixed hash formatting errors
2020-07-20 10:03:28 -06:00
Chris Conlon
86745dd7fc Merge pull request #3134 from ethanlooney/14th_branch
Added unit tests for Random.c
2020-07-20 10:02:22 -06:00
Sean Parkinson
52d363390a rshb check range of n 2020-07-20 11:12:35 +10:00
Sean Parkinson
a8f121b5f8 Merge pull request #3144 from JacobBarthelmeh/examples
increase example client key share group array size
2020-07-20 08:38:20 +10:00
David Garske
23a3ead758 Framework for new TLS v1.3 sniffer tests. 2020-07-17 15:56:56 -07:00
David Garske
9409d8682f Fix for building without session-ticket. 2020-07-17 15:22:35 -07:00
David Garske
e15e0828bf Cleanup of the SHOW_SECRET debugging. Use only latest wolf API's (not older Cyassl names). 2020-07-17 15:22:35 -07:00
David Garske
3be390d50d Added TLS v1.3 session resumption support. TLS v1.3 uses session tickets and a resumption secret is derived after the "finished" message. This uses the internal static wolf session cache to retain the resumption secret between sniffer sessions. 2020-07-17 15:22:35 -07:00
David Garske
1b051d9c5b TLS v1.3 sniffer support:
* Added TLS v1.3 sniffer support using static ephemeral key.
* Add support for using a static ephemeral DH and ECC keys with TLS v1.3 using `WOLFSSL_STATIC_EPHEMERAL`.
* Adds new API's `wolfSSL_CTX_set_ephemeral_key` and `wolfSSL_set_ephemeral_key`.
* Expanded TLS extension support in sniffer.
* Refactor of the handshake hashing code.
* Added parameter checking to the TLS v1.3 key derivations (protects use of "DoTls13Finished" if handshake resources have been free'd).
* Added support for loading DH keys via `wc_DhImportKeyPair` and `wc_DhExportKeyPair`, enabled with `WOLFSSL_DH_EXTRA`.
* Added sniffer documentation `sslSniffer/README.md`.
2020-07-17 15:22:35 -07:00
David Garske
80f5fe1494 Added documentation for wc_ecc_set_nonblock. 2020-07-17 15:20:23 -07:00
David Garske
90ee12f51a Added test case for ECC non-blocking. ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS="-DWOLFSSL_PUBLIC_MP" && make. 2020-07-17 15:13:50 -07:00
David Garske
547144bc9c Adds ECC non-blocking sign/verify support when used with SP math. New --enable-sp=nonblock and --enable-ecc=nonblock options. Example ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock. 2020-07-17 15:13:50 -07:00
David Garske
080ccd9820 Merge pull request #3145 from JacobBarthelmeh/Compatibility-Layer
sanity check on return value for wolfSSL_X509_NAME_ENTRY_get_object
2020-07-17 15:05:25 -07:00
Ethan Looney
ef71099225 Removed duplicate semicolon and deleted unneeded initrng 2020-07-17 10:34:38 -07:00
JacobBarthelmeh
01a01c373f sanity check on return value for wolfSSL_X509_NAME_ENTRY_get_object 2020-07-17 11:03:12 -06:00
Jacob Barthelmeh
e55ca1a8cf increase example client key share group array size 2020-07-17 10:26:34 -06:00
Ethan Looney
93c6e99aef Added a ret check 2020-07-17 08:45:39 -07:00
David Garske
4ff6b6a908 Merge pull request #3142 from SparkiDev/sp_int_small
Fix SP math for small builds. Fixes #3139
2020-07-17 08:33:05 -07:00
Sean Parkinson
0336fdb98d Fix SP math for small builds 2020-07-17 12:00:14 +10:00
TakayukiMatsuo
cd025d4e03 Added RX72NEnvisionkit/include.am 2020-07-17 09:30:40 +09:00
Ethan Looney
96e59118fc Changed the if defined order and to include fips and selftest 2020-07-16 15:50:03 -07:00
Ethan Looney
2275b89654 Removed unnecessary comments and added HashInit's and checked that they returned errors when they should 2020-07-16 12:38:55 -07:00
toddouska
50f228af0a Merge pull request #3125 from SparkiDev/mp_leading_bit
Change mp_leading_bit (integer.c) to not to require a copy
2020-07-16 11:05:09 -07:00
toddouska
859a1eebe4 Merge pull request #3124 from SparkiDev/sp_add_d
Fix sp_add_d
2020-07-16 10:56:28 -07:00
toddouska
9137794cb4 Merge pull request #3105 from embhorn/zd10457_a
Adding wolfSSL_X509_check_ip_asc
2020-07-16 10:53:27 -07:00
Sean Parkinson
eb7a01342f fp_set_bit: return error when bit offset is too large
If the bit to set is beyond the predefined maximum size then return an
error.
Same for fp_is_bit_set().
2020-07-16 12:34:31 +10:00
Eric Blankenhorn
f2b279e834 Update from review 2020-07-15 20:57:04 -05:00
toddouska
fbe0c8cba7 Merge pull request #3122 from JacobBarthelmeh/Compatibility-Layer
fix X509 multiple OU's and refactor
2020-07-15 15:06:22 -07:00
toddouska
925e9d9213 Merge pull request #3075 from julek-wolfssl/dtls-no-cookie
DTLS session resumption fixes
2020-07-15 14:07:34 -07:00
toddouska
edf88c3da1 Merge pull request #3073 from SparkiDev/tls13_dox
Update TLS 1.3 function Doxygen documentation
2020-07-15 13:58:07 -07:00
Ethan Looney
d54a51cd20 Added if not defined wc_no_rng 2020-07-15 13:56:12 -07:00
Ethan Looney
7a642e2b78 Added unit tests for Random.c 2020-07-15 12:55:19 -07:00
Ethan Looney
6be76e84ec Fixed formatting for Shake256Hash 2020-07-15 12:52:17 -07:00
Ethan Looney
9a07df9631 Changed hash size to 144 for Shake256Hash 2020-07-15 12:52:17 -07:00
Ethan Looney
379212acec Initialized variable data 2020-07-15 12:52:17 -07:00
Ethan Looney
aaa6e892da Added unit tests for hash.c 2020-07-15 12:52:17 -07:00
Eric Blankenhorn
525a3cb9c3 Move API out of OPENSSL_EXTRA 2020-07-15 10:48:11 -05:00
Eric Blankenhorn
d1a82589f9 Adding wolfSSL_X509_check_ip_asc 2020-07-15 10:48:11 -05:00
David Garske
12478a4534 Merge pull request #3128 from tmael/fips_ossl
Correct string truncation of XSTRNCAT
2020-07-14 17:17:27 -07:00
Sean Parkinson
e754076c37 Change mp_leading_bit (integer.c) to not to require a copy 2020-07-15 09:20:15 +10:00
Sean Parkinson
ddad95d52c mp_sub_d (integer.c): return error when digit is too big
Code can't handle subtracting a number (an mp_digit) larger than
DIGIT_BIT. Now returns an error rather than giving wrong result.
2020-07-15 09:18:35 +10:00
Sean Parkinson
51e49dbfac Fix sp_add_d 2020-07-15 09:15:04 +10:00
Jacob Barthelmeh
a8736dd89d set heap hint for name malloc 2020-07-14 14:23:49 -06:00
toddouska
1caa6f860b Merge pull request #3088 from kaleb-himes/ZD10539
Change Hash union to wc_Hmac_Hash
2020-07-14 11:23:30 -07:00
toddouska
2dcf4c1696 Merge pull request #3087 from SparkiDev/sp_math_mod
Fix div implementation in SP int
2020-07-14 11:19:15 -07:00
Jacob Barthelmeh
173b9833fc fixes for edge build cases and static memory 2020-07-14 09:07:23 -06:00
TakayukiMatsuo
20682ef0aa Add support for RX72N Envision Kit 2020-07-14 11:33:19 +09:00
Tesfa Mael
aee208f1b1 Correct build 2020-07-13 17:29:12 -07:00
Chris Conlon
4938baa892 Merge pull request #3121 from ethanlooney/12th_branch
Added unit tests for Sha3.c
2020-07-13 17:29:45 -06:00
Jacob Barthelmeh
85437e4097 add sanity check on padSz 2020-07-13 17:17:57 -06:00
Jacob Barthelmeh
63c8f7d1b1 x509 small build and memory free 2020-07-13 15:51:27 -06:00
Chris Conlon
a77085960e Merge pull request #3103 from TakayukiMatsuo/master
Supprted TSIP v1.09 for target board GR-ROSE
2020-07-13 14:35:07 -06:00
Ethan Looney
c5b8181005 Added a free call for shake256_copy 2020-07-13 09:58:00 -07:00
Chris Conlon
cbfda8e596 Merge pull request #3111 from ethanlooney/tenth_branch
Changed EXTRACT_ALL from NO to YES in order to document every function using Doxygen
2020-07-13 10:05:54 -06:00
Jacob Barthelmeh
d880d59974 fix for init of renegotiation and fix for compiler warnings 2020-07-13 00:31:40 -06:00
Jacob Barthelmeh
eec5f4a109 set initial NID value and account for null character on string 2020-07-12 19:54:50 -06:00
TakayukiMatsuo
af1b532758 Applied review comments to the code 2020-07-11 17:17:33 +09:00
Chris Conlon
ed9648770d Merge pull request #3120 from ethanlooney/11th_branch
Added unit tests for Sha512.c
2020-07-10 17:12:23 -06:00
Jacob Barthelmeh
2aaeb2a2df fix X509 multiple OU's and refactor 2020-07-10 17:12:20 -06:00
Ethan Looney
84aa7d746a Added unit tests for Sha3 2020-07-10 15:43:08 -07:00
toddouska
a90d6b2a5e Merge pull request #3039 from tmael/cov-fix2
Coverity fix in wolfSSL 4.4.0 - part 2
2020-07-10 13:06:22 -07:00
toddouska
b8078ab789 Merge pull request #3092 from dgarske/sniffer_loadbuf
Added sniffer API's to load buffer directly
2020-07-10 12:58:45 -07:00
Ethan Looney
7e23273d1c Changed directory for Doxygen's search to only the necessary header files 2020-07-10 12:51:21 -07:00
toddouska
b931dc0d6e Merge pull request #3110 from JacobBarthelmeh/SGX
add SP build for SGX
2020-07-10 10:29:50 -07:00
Ethan Looney
295aa4ac55 Added tests for Sha512.c 2020-07-10 10:15:32 -07:00
kaleb-himes
64c0d53a2d Use portable friendly XVALIDATE_DATE in ssl.c and add wc_ to default 2020-07-10 09:43:24 -06:00
Ethan Looney
03839ea641 Changed EXTRACT_ALL from NO to YES in order to document every function 2020-07-10 08:16:15 -07:00
David Garske
ed0f2bb8f5 Added sniffer API's to load buffer directly, not file. ZD 10547 2020-07-09 08:54:26 -07:00
TakayukiMatsuo
942226dc5a Merge branch 'master' of https://github.com/wolfSSL/wolfssl to get updated ocsp tests 2020-07-09 07:47:54 +09:00
Sean Parkinson
b952f18eb4 Merge pull request #3104 from JacobBarthelmeh/nginx
Nginx 1.15.7
2020-07-09 08:46:30 +10:00
Sean Parkinson
3e0d0677ee Merge pull request #3116 from embhorn/zd10570
Sanity check in DoTls13HandShakeMsgType
2020-07-09 08:42:37 +10:00
Sean Parkinson
e37bd2ade6 Merge pull request #3113 from guidovranken/scrypt-return-memory-e
Return MEMORY_E from wc_scrypt if allocation fails
2020-07-09 08:28:51 +10:00
Tesfa Mael
890500c1b1 Fix Coverity 2020-07-08 08:20:43 -07:00
TakayukiMatsuo
1e94f0478c Added resetting size info output-buffer before calling export APIs
Added resetting size into output-buffer before calling export APIs
2020-07-08 08:20:43 -07:00
Eric Blankenhorn
b9855b51bf Sanity check in DoTls13HandShakeMsgType 2020-07-08 07:55:05 -05:00
Eric Blankenhorn
5f5040686e Merge pull request #3112 from kaleb-himes/INTERNAL_OCSP_STAPLING_FIX
Put both potential roots for login.live.com into collection for stapl…
2020-07-07 20:46:09 -05:00
Guido Vranken
7f66671449 In wc_PKCS12_PBKDF_ex, break out of outer loop on error 2020-07-08 01:38:02 +02:00
Guido Vranken
43e1eee55d Return MEMORY_E from wc_scrypt if allocation fails 2020-07-08 01:04:37 +02:00
kaleb-himes
aa704420fd Fix typo in include.am 2020-07-07 16:39:39 -06:00
toddouska
c8dcd59565 Merge pull request #3082 from JacobBarthelmeh/Testing
restrict the cert version allowed
2020-07-07 15:37:01 -07:00
kaleb-himes
42f3a6d7a4 Put both potential roots for login.live.com into collection for stapling test 2020-07-07 16:02:48 -06:00
Chris Conlon
6196698d8b Merge pull request #3099 from ethanlooney/eighth_branch
Added unit tests to sha256.c for sha224 and sha256.
2020-07-07 15:37:38 -05:00
Jacob Barthelmeh
333f4ccced add SP build for SGX 2020-07-07 10:43:44 -06:00
TakayukiMatsuo
a95b31041c Added NO_ASN_TIME macro to avoid cert expiration validation 2020-07-07 18:40:41 +09:00
Sean Parkinson
80246dfbc3 Merge pull request #3102 from guidovranken/free-tlsx
In TLSX_SupportedFFDHE_Set, free TLSX list if TLSX_PopulateSupportedG…
2020-07-07 08:25:13 +10:00
Ethan Looney
296b562113 Fixed formatting and forgotten curly bracket 2020-07-06 12:33:06 -07:00
Ethan Looney
1b7a96627c Changed formatting 2020-07-06 12:05:55 -07:00
toddouska
301e5c03b9 Merge pull request #3097 from SparkiDev/sp_int_mul_of
Fix SP int size of result checks
2020-07-06 11:17:01 -07:00
toddouska
b8314a70f9 Merge pull request #3089 from kaleb-himes/ZD10539_LICENSING
Add or later verbage to LICENSING and sync header license versions
2020-07-06 11:11:11 -07:00
toddouska
514254e294 Merge pull request #3069 from SparkiDev/gnu-stack
Add section to asm files to avoid exe stack
2020-07-06 11:08:24 -07:00
JacobBarthelmeh
e194a11cb8 add wolfSSL_SESSION_new and change to peek error 2020-07-06 10:47:46 -06:00
Ethan Looney
dfde73620c Added if defined cases for tests using hashes 2020-07-06 08:07:03 -07:00
TakayukiMatsuo
9554e54e8f Resolved conflict 2020-07-06 10:58:58 +09:00
Sean Parkinson
1af2e5cf02 Fix div implementation in SP int 2020-07-06 08:52:44 +10:00
Guido Vranken
04d063f2ba In TLSX_SupportedFFDHE_Set, free TLSX list if TLSX_PopulateSupportedGroups fails 2020-07-05 23:41:50 +02:00
TakayukiMatsuo
464cd49e45 Supprted TSIP v1.09 for target board GR-ROSE 2020-07-04 23:40:10 +09:00
Sean Parkinson
0e79943a5c Fix SP int size of result checks
sp_lshb: Only put values in extra word id necessary
2020-07-03 09:12:27 +10:00
Ethan Looney
5f3a287a6a Added tests to sha256.c for sha224 and sha256. 2020-07-02 14:30:30 -07:00
Takashi Kojo
fd257ee8b9 fix guard 2020-07-03 05:42:44 +09:00
Chris Conlon
655022cfc5 Merge pull request #3095 from ethanlooney/sixth_branch
Added additional tests for curve25519 and fixed a print format error from previous tests.
2020-07-02 10:07:55 -05:00
Juliusz Sosinowicz
3efd8a8576 Jenkins fixes 2020-07-02 14:59:07 +02:00
Ethan Looney
3242fa3669 Fixed formatting, redundant if's and added a comment explaining why a value was chosen. 2020-07-01 16:01:50 -07:00
JacobBarthelmeh
df9a1a2a0e revert error peek function 2020-07-01 16:26:38 -06:00
Juliusz Sosinowicz
fd79ebfe8d TLS 1.3 requires chacha and poly1305 for myTicketEncCb 2020-07-01 20:24:50 +02:00
Ethan Looney
f526a11126 Added additional tests for curve25519 and fixed a print format error from previous tests 2020-07-01 10:19:40 -07:00
Ethan Looney
a59560a1d5 Added tests to curve25519.c and fixed a print error from previous curve25519 tests 2020-07-01 09:32:03 -07:00
tmael
f89686a1ec Merge pull request #3086 from SparkiDev/sp_c_mod_fix
Fix normalization in all SP C divs
2020-07-01 09:02:29 -07:00
Chris Conlon
eb4b575b3a Merge pull request #3085 from ethanlooney/fourth_branch
API tests for Curve448
2020-06-30 17:24:07 -05:00
Ethan Looney
4ad904909c Added a return check 2020-06-30 12:40:20 -07:00
Ethan Looney
78efb48acf Added two more tests to hit xmemset lines 2020-06-30 12:40:20 -07:00
Ethan Looney
b7e682e677 Added more tests to api.c for curve448 2020-06-30 12:40:20 -07:00
Chris Conlon
94654c7a46 Merge pull request #3062 from TakayukiMatsuo/branch-2
Added testcases for wc_curve25519_export_key_xx
2020-06-30 14:27:24 -05:00
Juliusz Sosinowicz
e63a80f1af Use NO_SESSION_CACHE as well in preproc checks 2020-06-30 21:21:43 +02:00
JacobBarthelmeh
e6746639af add SSL_SESSION_up_ref and fix for get lib 2020-06-30 13:16:28 -06:00
kaleb-himes
8d37f57990 Change variable name from Hash to hashAlg 2020-06-30 12:50:26 -06:00
Juliusz Sosinowicz
b57cf802eb Expose session serialization outside of OPENSSL_EXTRA
Use `./configure CFLAGS='-DHAVE_EXT_CACHE'` to enable session serialization without `OPENSSL_EXTRA`.
2020-06-30 20:17:21 +02:00
kaleb-himes
970391319b Add or later verbage to LICENSING and sync header license versions 2020-06-30 12:13:13 -06:00
kaleb-himes
55985ad1b4 Change Hash union to wc_Hmac_Hash 2020-06-30 12:01:57 -06:00
Ethan Looney
c39bd55aca Removed comment, deleted redundent WC_RNG initialization and fixed indentation 2020-06-30 09:32:10 -07:00
toddouska
2c11f96c9d Merge pull request #3048 from embhorn/zd10216
Override CRL error for NO_VERIFY
2020-06-29 15:35:53 -07:00
Sean Parkinson
4e584595f0 Fix normalization in all SP C divs 2020-06-30 08:32:42 +10:00
Ethan Looney
e32e206d7c Added a return check 2020-06-29 12:55:42 -07:00
Ethan Looney
7fb4a98009 Added two more tests to hit xmemset lines 2020-06-29 09:48:22 -07:00
Ethan Looney
6745733e2e Added more tests to api.c for curve448 2020-06-29 09:30:17 -07:00
Chris Conlon
b6aaedd3b4 Merge pull request #3080 from ethanlooney/second_branch
Added additional tests to curve448.c through api.c
2020-06-29 11:21:15 -05:00
David Garske
7a2384deaf Merge pull request #3071 from kojo1/user-mutex
User defined mutex
2020-06-28 21:45:30 -07:00
Jacob Barthelmeh
14d0b4e7d6 adjust test case 2020-06-26 10:25:50 -06:00
Chris Conlon
7bd5da70a6 Merge pull request #3066 from kaleb-himes/DOX_UPDATES
Update v23 methods to reflect TLSv1.3
2020-06-26 10:59:04 -05:00
Ethan Looney
1c1ddaa6c2 Added checks to initial returns and free rng 2020-06-25 16:40:38 -07:00
Sean Parkinson
a10500e5a7 Merge pull request #3079 from tmael/sp_mod
Correct SP mod calculation
2020-06-26 08:38:07 +10:00
Sean Parkinson
f6d26b4e81 Merge pull request #3072 from kaleb-himes/SANITY_CHECKS
ed25519 and ed448 check sigLen against expected
2020-06-26 08:31:55 +10:00
Jacob Barthelmeh
0c7b851bd3 restrict the cert version allowed 2020-06-25 15:45:18 -06:00
David Garske
e2afbae6aa Merge pull request #3054 from JacobBarthelmeh/CRL
fix for x509 store add crl
2020-06-25 09:52:12 -07:00
JacobBarthelmeh
26f0a74d29 Merge pull request #3023 from kaleb-himes/GH2998-REWORK
cleanup GET messages
2020-06-25 10:22:09 -06:00
John Safranek
73c26c5188 Merge pull request #3078 from dgarske/dup_defines
Remove duplicate macros in VS user_settings.h files.
2020-06-25 09:09:30 -07:00
kaleb-himes
17466727b2 Implement peer review feedback 2020-06-25 09:43:22 -06:00
John Safranek
4dbdfdea08 Merge pull request #3077 from kaleb-himes/ZD10235_CONFIG
configure.ac change == to = when not C code
2020-06-25 08:21:01 -07:00
Tesfa Mael
60d6f616c2 Fix typo 2020-06-25 08:06:14 -07:00
Tesfa Mael
a8f5602e10 Correct mod calculation 2020-06-25 08:01:05 -07:00
Ethan Looney
fe7d9ea7c1 changed RNG to WC_RNG 2020-06-24 15:40:58 -07:00
Ethan Looney
79981e3cf7 Added additonal tests to curve448.c 2020-06-24 15:40:38 -07:00
Ethan Looney
86b7f18502 Added additional tests to curve448.c through api.c 2020-06-24 15:40:22 -07:00
David Garske
a10ee78980 Remove duplicate macros in VS user_settings.h files. 2020-06-24 15:08:49 -07:00
toddouska
07c5f36d6d Merge pull request #3068 from SparkiDev/modexp-cr
Use temp with mont mul in constant time exptmod
2020-06-24 13:19:06 -07:00
kaleb-himes
308562e853 configure.ac change == to = when not C code 2020-06-24 13:41:03 -06:00
JacobBarthelmeh
483b970772 Merge pull request #3061 from embhorn/zd10457
Remove multiple defines of GEN_IPADD
2020-06-24 11:33:16 -06:00
kaleb-himes
fdce5152c5 Address peer feedback 2020-06-24 11:25:12 -06:00
toddouska
9cd6f92d19 Merge pull request #3058 from JacobBarthelmeh/Certs
Fix and test case for malformed name constraint
2020-06-24 10:15:08 -07:00
Jacob Barthelmeh
b8b2f7ef7d vs build warning fixes 2020-06-24 10:57:31 -06:00
Sean Parkinson
be5648986c Update TLS 1.3 function Doxygen documentation
Give parameters a name in function prototypes.
2020-06-24 12:35:47 +10:00
Kaleb Himes
23ddc1c4c2 Merge pull request #3067 from SparkiDev/tls13-test-fix
Cleanup after TLS 1.3 tests
2020-06-23 17:35:48 -06:00
kaleb-himes
722961f55c ed25519 and ed448 check sigLen against expected 2020-06-23 17:32:00 -06:00
Eric Blankenhorn
ec755f8dd9 Override CRL error for NO_VERIFY 2020-06-23 18:09:03 -05:00
Sean Parkinson
582240a84d Merge pull request #3051 from embhorn/zd10451
Sanity check wc_ecc_import_raw x, y, and key
2020-06-24 08:52:10 +10:00
Takashi Kojo
55bb95823c coding template 2020-06-24 07:31:20 +09:00
Jacob Barthelmeh
8511d07698 store chain is free'd when store is free'd 2020-06-23 15:42:32 -06:00
Jacob Barthelmeh
ae90119af4 remove double free in test case 2020-06-23 14:45:31 -06:00
Eric Blankenhorn
7cc64377d0 Sanity check wc_ecc_import_raw x, y, and key 2020-06-23 08:54:47 -05:00
Takashi Kojo
1253be0142 Remove user_setting.h and user-mutex.c example files 2020-06-23 17:30:03 +09:00
Sean Parkinson
e8e455bf39 Add section to asm files to avoid exe stack
For Linux ELF need a note section for GNU to indicate stack is not
executable.
2020-06-23 11:58:46 +10:00
Sean Parkinson
7c615967a9 Use temp with mont mul in constant time exptmod
For cache attack resistance.
2020-06-23 10:45:31 +10:00
Sean Parkinson
392e09c474 Cleanup after TLS 1.3 tests
Make sure the server is dead after each test.
Client may not connect to server if cipher suite not supported and
return error as expected.
2020-06-23 09:14:51 +10:00
Sean Parkinson
5b07905818 Merge pull request #3065 from dgarske/sp_revert
Fix SP cache resistant build (reverts part of PR 2970)
2020-06-23 08:42:00 +10:00
toddouska
877b9975eb Merge pull request #3064 from dgarske/dox_sni
Fixes for dox SNI documentation / examples.
2020-06-22 13:38:41 -07:00
toddouska
180439ca34 Merge pull request #3060 from dgarske/git3059_cryptocell
Fixes for CryptoCell
2020-06-22 13:37:37 -07:00
toddouska
93bd0dbfe1 Merge pull request #2980 from dgarske/psoc6
Fix for `WOLFSSL_ALT_CERT_CHAINS` with long chain
2020-06-22 13:36:35 -07:00
kaleb-himes
646ecb54c2 Update v23 methods to reflect TLSv1.3 2020-06-22 12:04:16 -06:00
David Garske
a29250e87d Revert SP changes in https://github.com/wolfSSL/wolfssl/pull/2970 that broke --enable-sp CFLAGS="-DWOLFSSL_SP_CACHE_RESISTANT". This was generated with latest scripts. 2020-06-22 07:56:54 -07:00
David Garske
6ecb88da47 Fixes for dox SNI documentation / examples. 2020-06-22 07:37:04 -07:00
JacobBarthelmeh
b88342eeaf memory handling fixes 2020-06-19 10:08:42 -07:00
JacobBarthelmeh
22d6774966 Merge pull request #2909 from SKlimaRA/SKlimaRA/crl-and-pkcb
ParseCrl fix, GetPrivateKeySigSize moved from client only section and Coverity fixes.
2020-06-19 10:51:50 -06:00
TakayukiMatsuo
771d60c085 Replaced some hard-tabs with spaces in wc_curve25519_export_key_raw_ex() 2020-06-19 13:40:16 +09:00
David Garske
6b1a6309ce Fixes for CryptoCell. Fix for signature wrapper signing to allow larger signing input buffer. Cleanup of some duplicate code. Fix for bad cryptocell ECC make key result check (-9628). Fixes #3059. Thanks Sylwester. 2020-06-18 13:40:30 -07:00
Eric Blankenhorn
a5664b5ba9 Remove multiple defines of GEN_IPADD 2020-06-18 15:40:22 -05:00
toddouska
f8c6c783db Merge pull request #3047 from SparkiDev/curve448_dox
Add Doxygen documentation for Curve448/Ed448
2020-06-18 13:05:59 -07:00
David Garske
352328348a For example client "-H verifyFail", which was not setting the verify callback. 2020-06-18 12:54:47 -07:00
David Garske
823b3d90d8 Add braces around new debug message to avoid compiler warning. 2020-06-18 12:12:28 -07:00
toddouska
248b8c9b62 Merge pull request #3057 from kaleb-himes/FIPSv2_plus_OPENSSLALL
Resolve issues with FIPSv2 when opensslall set
2020-06-18 10:12:06 -07:00
toddouska
48cd6f36ff Merge pull request #2967 from dgarske/ecc_null
Fixes for ECC key import
2020-06-18 10:10:49 -07:00
Jacob Barthelmeh
1e431e1ade add test case and fixes from review 2020-06-18 10:57:25 -06:00
David Garske
667d9ca896 Fix to catch the issue in this PR with alt cert chains, which only happens if the verify callback is used and the chain is long enough. Cleanup of the myVerify callback to allow specific actions. Fix the suites.c to not crash if no newline at end of file. Added helpful debug message to show that a CA was found. 2020-06-18 09:26:50 -07:00
David Garske
efa169e595 Fix for invalid files in include.am. Improvement to new alt-chain tests to catch case this PR fixes. 2020-06-18 08:33:59 -07:00
David Garske
d70f6b7ede Fix for tests/test-chains.conf with new intermediate CA. 2020-06-18 08:33:59 -07:00
David Garske
9be61c61f5 Add alternate chain test case where peer presents chain (INT -> INT2 -> PEER) and only INT2 is loaded as trusted. Update existing alternate chain partial test cases to use INT2. Fix for test suite to allow extra newlines in .test files. 2020-06-18 08:33:59 -07:00
David Garske
5a5bc34aa5 Added second intermediate CA to testing certs. This creates a chain that looks like: ROOT (www.wolfssl.com) -> INT (wolfSSL Intermediate CA) -> INT2 (wolfSSL Intermediate2 CA) -> PEER (wolfSSL Client Chain / wolfSSL Server Chain). 2020-06-18 08:33:59 -07:00
David Garske
0ef5a3d00e Fix for WOLFSSL_ALT_CERT_CHAINS incorrectly failing on success case. 2020-06-18 08:33:59 -07:00
David Garske
21e0f863b9 Fix for NO_WOLFSSL_SERVER typo. 2020-06-18 08:33:58 -07:00
Juliusz Sosinowicz
03c5359fcd Add session resumption testing for DTLS 2020-06-18 14:18:02 +02:00
Juliusz Sosinowicz
b590e06f42 DTLS fixes
- `SendFinished` resetting`dtls_expected_peer_handshake_number` should depend on side and if we are resuming a connection
- No need to do a cookie exchange on session resumption
2020-06-18 12:13:52 +02:00
TakayukiMatsuo
28819bd45e Made two lines wrap around in test_wc_curve25519_export_key_raw_ex() 2020-06-18 12:25:21 +09:00
TakayukiMatsuo
a855d6355e Added cleanup to test_wc_curve25519_export_key_raw_ex 2020-06-18 12:25:21 +09:00
TakayukiMatsuo
1d98c960cf Added resetting size info output-buffer before calling export APIs
Added resetting size into output-buffer before calling export APIs
2020-06-18 12:24:03 +09:00
David Garske
13753d56bb Cleanup in wc_ecc_sign_hash_ex for blinding value to not call free twice (mp_clear already does mp_free). 2020-06-17 17:11:54 -07:00
David Garske
0fd5eda5af Fix for test_wolfSSL_DTLS_either_side, which was not properly free'ing in error case. Improves the test shared context logic to make it explicit. 2020-06-17 17:08:09 -07:00
toddouska
220e2634af Merge pull request #3056 from dgarske/nullcipher_noaes
Fixes for a few build edge cases (async w/o DTLS, null cipher w/o AES)
2020-06-17 16:48:48 -07:00
toddouska
f20a2de284 Merge pull request #3055 from dgarske/ocsp_resp
Fix for possible use of NULL in the OCSP response nonce
2020-06-17 16:45:53 -07:00
toddouska
3acc31400c Merge pull request #3053 from SparkiDev/ed448_fixes
Fix ED448 calls to use context and correct variable name
2020-06-17 16:41:40 -07:00
Jacob Barthelmeh
dafd35e4c1 remove unused variable 2020-06-17 15:55:08 -06:00
Jacob Barthelmeh
f75659641a test on malformed name constraint 2020-06-17 14:33:10 -06:00
kaleb-himes
e2fb4c55b8 Resolve issues with FIPSv2 when opensslall set 2020-06-17 14:03:02 -06:00
David Garske
3fb432cef8 Fix for building async without DTLS. 2020-06-17 11:20:08 -07:00
David Garske
81892f4594 Fix for use of WC_MAX_SYM_KEY_SIZE in macro. Fixes build case with --enable-nullcipher --disable-aes. 2020-06-17 11:16:33 -07:00
David Garske
0a38ab8ac2 Fix for possible use of NULL is the OCSP response nonce. This is optional and may not be provided in the OCSP response and should be skipped if not set in the response. ZD 10475. 2020-06-17 11:00:05 -07:00
Jacob Barthelmeh
82921f8650 fix for x509 store add crl 2020-06-17 11:30:18 -06:00
Kaleb Himes
b1aa903c1b Merge pull request #3052 from julek-wolfssl/infinite-loop-fuzzer
Alert level must be cleared or ProcessReply will loop indefinitely
2020-06-16 18:55:15 -06:00
Sean Parkinson
6bb73fb25d Fix ED448 calls to use context and correct variable name
Added basic test of OpenSSL compatability APIs:
  - wolfSSL_ED25519_generate_key
  - wolfSSL_ED25519_sign
  - wolfSSL_ED25519_verify
  - wolfSSL_ED2448_generate_key
  - wolfSSL_ED448_sign
  - wolfSSL_ED448_verify
2020-06-17 10:05:50 +10:00
Juliusz Sosinowicz
90caeaf925 Alert level must be cleared or ProcessReply will loop indefinitely 2020-06-16 23:21:54 +02:00
JacobBarthelmeh
7c6dccd4a0 Merge pull request #3038 from embhorn/zd10457
Unused var error
2020-06-16 14:10:54 -06:00
Sean Parkinson
7a15639927 Add Doxygen documentation for Curve448/Ed448
Update Curve25519/Ed25519 Doxygen documentation too.
Make public key is a public API - check pubKey pointer is not NULL.
2020-06-16 22:16:13 +10:00
Chris Conlon
b9f13dba61 Merge pull request #3030 from TakayukiMatsuo/usertime
ASN1_TIME_new in correct macro condition
2020-06-15 17:49:44 -05:00
toddouska
aa7168df0b Merge pull request #3045 from SparkiDev/aes_small_fix
AES small table fix
2020-06-15 14:19:09 -07:00
toddouska
096d0073ef Merge pull request #3043 from dgarske/renesas_ra6m3
Renesas requested name change to "RA6M3"
2020-06-15 14:18:19 -07:00
toddouska
9d932d09bf Merge pull request #3042 from dgarske/xcode_updates
Updates to Xcode projects to add new files / features
2020-06-15 14:16:14 -07:00
toddouska
74098340ff Merge pull request #3031 from dgarske/stm32cubeide
Adding STM32CubeIDE support
2020-06-15 14:14:43 -07:00
Jacob Barthelmeh
f020b0f24a add check on decode subtree return value 2020-06-15 14:41:05 -06:00
Sean Parkinson
3f344b7d89 AES small table fix
Symbol not needed when only compiling AES algorithms (AES-GCM, AES-CCM,
AES-CTR) not using AES decrypt.
Allow AES-CCM to be compiled without AES-GCM.
2020-06-15 14:46:39 +10:00
Takashi Kojo
8ff1b474bc Tentative: User defined mutex 2020-06-14 07:12:13 +09:00
David Garske
baaf741c79 Merge pull request #3037 from JacobBarthelmeh/CSharp
add peer certificate print to callback with C#
2020-06-12 13:32:50 -07:00
toddouska
1e07563411 Merge pull request #2984 from julek-wolfssl/dtls-scr
Add secure renegotiation to DTLS 1.2
2020-06-12 11:22:55 -07:00
toddouska
6166902f66 Merge pull request #2990 from julek-wolfssl/fix-leak
Fix leak in SetIndividualInternal
2020-06-12 11:17:40 -07:00
toddouska
4c2dee77d8 Merge pull request #3028 from julek-wolfssl/CRYPTO_memcmp
Implement CRYPTO_memcmp
2020-06-12 11:16:18 -07:00
David Garske
eea22eb65d Renesas requested name change to "RA6M3". 2020-06-12 10:58:20 -07:00
David Garske
d43d75bf81 Updates to xcode projects to add new files.
Ran updated iPhone X benchmarks:

```
RNG                330 MB took 1.010 seconds,  326.879 MB/s
AES-128-CBC-enc    920 MB took 1.005 seconds,  915.507 MB/s
AES-128-CBC-dec   6095 MB took 1.000 seconds, 6092.130 MB/s
AES-192-CBC-enc    820 MB took 1.000 seconds,  819.644 MB/s
AES-192-CBC-dec   4860 MB took 1.001 seconds, 4855.794 MB/s
AES-256-CBC-enc    710 MB took 1.005 seconds,  706.419 MB/s
AES-256-CBC-dec   3935 MB took 1.001 seconds, 3930.830 MB/s
AES-128-GCM-enc   1245 MB took 1.003 seconds, 1241.589 MB/s
AES-128-GCM-dec    575 MB took 1.001 seconds,  574.547 MB/s
AES-192-GCM-enc   1235 MB took 1.001 seconds, 1234.343 MB/s
AES-192-GCM-dec    570 MB took 1.003 seconds,  568.521 MB/s
AES-256-GCM-enc   1230 MB took 1.003 seconds, 1226.034 MB/s
AES-256-GCM-dec    570 MB took 1.001 seconds,  569.199 MB/s
3DES                10 MB took 1.386 seconds,    7.213 MB/s
MD5                 95 MB took 1.037 seconds,   91.629 MB/s
SHA                 80 MB took 1.013 seconds,   78.943 MB/s
SHA-256           1625 MB took 1.000 seconds, 1624.565 MB/s
SHA3-224            60 MB took 1.010 seconds,   59.399 MB/s
SHA3-256            60 MB took 1.073 seconds,   55.921 MB/s
SHA3-384            45 MB took 1.042 seconds,   43.195 MB/s
SHA3-512            35 MB took 1.164 seconds,   30.063 MB/s
HMAC-MD5            95 MB took 1.044 seconds,   91.014 MB/s
HMAC-SHA            80 MB took 1.007 seconds,   79.480 MB/s
HMAC-SHA256       1705 MB took 1.001 seconds, 1703.126 MB/s
RSA     2048 public      32800 ops took 1.003 sec, avg 0.031 ms, 32716.405 ops/sec
RSA     2048 private      1200 ops took 1.041 sec, avg 0.868 ms, /33 ops/sec
DH      2048 key gen      2354 ops took 1.000 sec, avg 0.425 ms, 2353.254 ops/sec
DH      2048 agree        2500 ops took 1.013 sec, avg 0.405 ms, 2467.525 ops/sec
ECC      256 key gen     46503 ops took 1.000 sec, avg 0.022 ms, 46502.069 ops/sec
ECDHE    256 agree       14100 ops took 1.005 sec, avg 0.071 ms, 14034.697 ops/sec
ECDSA    256 sign        29600 ops took 1.003 sec, avg 0.034 ms, 29500.554 ops/sec
ECDSA    256 verify      11000 ops took 1.007 sec, avg 0.092 ms, 10921.516 ops/sec
```
2020-06-12 10:39:26 -07:00
toddouska
f30eb0197b Merge pull request #3032 from JacobBarthelmeh/PKCS12
fix error checking when parsing a PKCS12 DER into an internal structure
2020-06-12 09:57:40 -07:00
JacobBarthelmeh
2b5ed1564c add error function and print out 2020-06-12 09:45:23 -07:00
Eric Blankenhorn
0f36cdf066 Unused var error 2020-06-12 10:43:01 -05:00
Unknown
cab8dd3731 Ignore duplicate or out of order CCS message
Init variables since compiler complains they might be used without initialization.
2020-06-12 12:27:48 +02:00
Juliusz Sosinowicz
ac028e551d Code Review 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
69802ed1a9 Missing ssl->heap in FreeBuildMsgArgs 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
3980d6117d Fix Jenkins 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
01b446f469 Fix SessionTicket length in unencrypted case 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
f2d2dadc89 ASYNC: Fix issues with TLS and DTLS 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
eb7a49a1d7 ASYNC: Working TLS SCR 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
a7c4d88876 ASYNC: Working AES128-SHA 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
7b604ad714 WIP 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
73105305cf WIP 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
a107688891 Fix asynchronous DTLS issue 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
d88f6f1156 DTLS test cases 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
4e60e4b3b7 DTLS Message Grouping
Flush output buffer when we suspect that the grouped messages may exceed MTU.
2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
d2542dcf38 Restore StoreKeys functionality for TLS case 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
c2ca9f614e Jenkins tests fixes 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
eb910a64d0 Comments and formatting 2020-06-12 11:36:43 +02:00
Juliusz Sosinowicz
651a7a97b9 Add secure renegotiation to DTLS 1.2
- Hash of fragmented certificate was not calculated as a single message and instead we were hashing individual fragments which produced the wrong digest, shared secret, etc...
- Reset handshake number after server Finished packet is sent or received (depending on side)
- Reserve space in buffer for cipher stuff
- Take `DTLS_RECORD_EXTRA` and  `DTLS_HANDSHAKE_EXTRA` into size and offset calculations for DTLS path
- Fix renegotiation in DTLS with AES128-SHA
- Fix renegotiation in DTLS with AES-GCM
- Support HelloVerify request during secure renegotiation
- Save renegotiation handshake messages for retransmission in timeout
- Handle cipher parameters from different epochs. DTLS may need to resend and receive messages from previous epochs so handling different sets of encryption and decryption parameters is crucial.
2020-06-12 11:36:43 +02:00
David Garske
255cc016b3 Merge pull request #3034 from kaleb-himes/FORUM_DSA_ISSUE
Seperate QT and DSA dependencies
2020-06-11 15:40:12 -07:00
David Garske
ad7e636e34 Adds STM32H7 support. Tested on NUCLEO-H753ZI board.
STM32H753ZI at 480MHz

```
Running wolfCrypt Benchmarks...
------------------------------------------------------------------------------
 wolfSSL version 4.4.1
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG                250 KB took 1.047 seconds,  238.777 KB/s
AES-128-CBC-enc      4 MB took 1.004 seconds,    3.623 MB/s
AES-128-CBC-dec      4 MB took 1.004 seconds,    3.623 MB/s
AES-192-CBC-enc      4 MB took 1.000 seconds,    3.613 MB/s
AES-192-CBC-dec      4 MB took 1.000 seconds,    3.613 MB/s
AES-256-CBC-enc      4 MB took 1.000 seconds,    3.613 MB/s
AES-256-CBC-dec      4 MB took 1.000 seconds,    3.613 MB/s
AES-128-GCM-enc      3 MB took 1.004 seconds,    3.380 MB/s
AES-128-GCM-dec      3 MB took 1.004 seconds,    3.356 MB/s
AES-192-GCM-enc      3 MB took 1.004 seconds,    3.380 MB/s
AES-192-GCM-dec      3 MB took 1.003 seconds,    3.359 MB/s
AES-256-GCM-enc      3 MB took 1.000 seconds,    3.369 MB/s
AES-256-GCM-dec      3 MB took 1.004 seconds,    3.356 MB/s
CHACHA             850 KB took 1.020 seconds,  833.333 KB/s
CHA-POLY           650 KB took 1.015 seconds,  640.394 KB/s
POLY1305             4 MB took 1.004 seconds,    4.037 MB/s
SHA-256              3 MB took 1.004 seconds,    3.088 MB/s
HMAC-SHA256          3 MB took 1.004 seconds,    3.015 MB/s
RSA     2048 public         78 ops took 1.023 sec, avg 13.115 ms, 76.246 ops/sec
RSA     2048 private         4 ops took 1.682 sec, avg 420.500 ms, 2.378 ops/sec
DH      2048 key gen         6 ops took 1.165 sec, avg 194.167 ms, 5.150 ops/sec
DH      2048 agree           6 ops took 1.165 sec, avg 194.167 ms, 5.150 ops/sec
ECC      256 key gen        96 ops took 1.004 sec, avg 10.458 ms, 95.618 ops/sec
ECDHE    256 agree          50 ops took 1.027 sec, avg 20.540 ms, 48.685 ops/sec
ECDSA    256 sign           64 ops took 1.000 sec, avg 15.625 ms, 64.000 ops/sec
ECDSA    256 verify         32 ops took 1.039 sec, avg 32.469 ms, 30.799 ops/sec
Benchmark complete
Benchmark Test: Return code 0
```
2020-06-11 15:17:29 -07:00
David Garske
3b86a4db20 Adding STM32CubeIDE support (and deprecation of OpenSTM32).
* Updated example to add support for CMSIS v2 and static memory.
* Improved example to support more build options.
* Added support for detecting Cube HAL and including `wolfSSL.wolfSSL_conf.h`.
2020-06-11 14:45:17 -07:00
JacobBarthelmeh
d97c23edd8 set dynamic flag 2020-06-11 12:46:21 -07:00
JacobBarthelmeh
6af052faae add peer certificate print to callback 2020-06-11 10:57:26 -07:00
Chris Conlon
cc13c9f062 Merge pull request #3035 from ejohnstown/changelog
Fix changelog error
2020-06-11 10:19:10 -05:00
toddouska
29bdc7d8b5 Merge pull request #3015 from tmael/cov-fix
Coverity fix in wolfSSL 4.4.0
2020-06-10 17:07:47 -07:00
John Safranek
f7c233af9c Fix error in the changelog. AES-CTR with AES-NI wasn't actually added. 2020-06-10 15:15:11 -07:00
Juliusz Sosinowicz
d5577c9404 Explicit convert 2020-06-10 18:43:27 +02:00
Kaleb Himes
2fe08e1951 Update comment
Thanks @dgarske, great catch!
2020-06-09 17:10:57 -06:00
kaleb-himes
80e888c1c8 Seperate QT and DSA dependencies 2020-06-09 16:47:35 -06:00
Chris Conlon
fb51a2298e Merge pull request #3019 from kaleb-himes/ZD10380
init components as best practice
2020-06-09 17:23:55 -05:00
toddouska
e993cb6cc0 Merge pull request #2942 from dgarske/tls13_on
Enable TLS v1.3 by default
2020-06-09 13:30:02 -07:00
toddouska
48783c1982 Merge pull request #2996 from dgarske/stm32hal
Fixes and improvements for STM32 crypto hardware
2020-06-09 13:24:27 -07:00
toddouska
c023efb2aa Merge pull request #3025 from JacobBarthelmeh/Compatibility-Layer
fix macro to match *_FLAGS_*
2020-06-09 13:19:29 -07:00
toddouska
7a7bfce565 Merge pull request #3026 from cconlon/selftestfixes
Fix warnings with NetBSD gcc compiler
2020-06-09 13:18:44 -07:00
toddouska
ef742c4a42 Merge pull request #3027 from danielinux/psoc6_crypto
Cypress PSoC6 wolfcrypt driver
2020-06-09 13:17:37 -07:00
toddouska
8fc908989a Merge pull request #3029 from SparkiDev/aes-ccm-fix
Fix optimized AES-CCM - counter
2020-06-09 13:13:42 -07:00
Jacob Barthelmeh
3a430522da fix error checking when parsing a PKCS12 DER into an internal structure 2020-06-08 14:23:40 -06:00
Kaleb Himes
72360dee38 Also bring over openSSL headers 2020-06-08 11:39:06 -06:00
David Garske
8b6b54603f Add STM32WB55 crypto hardware support for AES. 2020-06-08 08:48:59 -07:00
Tesfa Mael
28913a276f Include GCM in latest FIPS and Windows build 2020-06-08 08:38:59 -07:00
David Garske
5837c70e99 Support for STM32L5 PKA ECC sign/verify acceleration. 2020-06-08 08:37:55 -07:00
David Garske
16c0160e63 Added support for STM32L5. 2020-06-08 08:37:55 -07:00
David Garske
21a34bde8c Fix whitespace. 2020-06-08 08:37:55 -07:00
David Garske
6f82f15d1b Performance improvements for STM32 AES CBC and GCM crypto hardware.
* AES CBC:
  - Do all blocks, not just one at a time.
* AES GCM:
  - Use local stack for authentication header if < block size.
  - Use hardware GHASH for all authentication header sizes.

Tested with STM32F437II (old/new Cube HAL/StdPeriLib), STM32F777ZI (CubeMX) and STM32L4A6ZG (CubeMX).
2020-06-08 08:37:55 -07:00
David Garske
efe9da0994 Fix for STM32 crypto hash with WOLFSSL_SMALL_STACK_CACHE possible free of invalid pointer. 2020-06-08 08:37:55 -07:00
David Garske
dff7c0fcfa Fix for hardware mutex protection in case where STM32 hardware acceleration is used for RNG or HASH only. 2020-06-08 08:37:55 -07:00
David Garske
42ee313286 Fix for using WOLFSSL_SMALL_STACK_CACHE with STM32 SHA256 hardware acceleration. 2020-06-08 08:37:55 -07:00
David Garske
8791573dfe Fix for building with NO_PUBLIC_GCM_SET_IV when ChaCha20/Poly1305 is enabled. Cleanup use of not used STD_PERI_LIB. 2020-06-08 08:37:54 -07:00
Tak
b883617c0d Moved wolfSSL_ASN1_TIME_new() to under #ifndef NO_ASN_TIME condition 2020-06-08 14:10:20 +09:00
Sean Parkinson
d543e305f1 Fix optimized AES-CCM - counter
AES-NI optimized 4 block at a time was not incrementing counter
poprerly.
2020-06-08 10:48:19 +10:00
David Garske
3af4316cfd Fix for session test with TLS v1.3 and session tickets not enabled. Cleanups in AddSession. 2020-06-05 13:33:03 -07:00
David Garske
fb5c9e5268 Adjust static memory case with TLS v1.3 enabled. 2020-06-05 11:11:23 -07:00
David Garske
3b8455fcd0 Fix for building without ECC and DH (TLS v1.3 cannot be enabled). 2020-06-05 10:26:32 -07:00
Juliusz Sosinowicz
a75f83c9f2 Implement CRYPTO_memcmp 2020-06-05 16:44:12 +02:00
Daniele Lacamera
254dd9f823 Added new files to include.am 2020-06-05 15:28:49 +02:00
Daniele Lacamera
76ab8bfb6b Added psoc6 ECDSA verification support 2020-06-05 11:30:29 +02:00
Daniele Lacamera
b1947478bb Added support for SHA512 via psoc6 crypto 2020-06-05 11:30:29 +02:00
Daniele Lacamera
82520572b0 Initial support for psoc6_crypto (sha256 only) 2020-06-05 11:30:29 +02:00
David Garske
dffc677561 Fix for TLS v1.3 with --enable-sniffer. 2020-06-04 16:42:40 -07:00
David Garske
7879e83ae0 Fixes for building with ./configure --enable-tls13 --disable-rsa --disable-ecc --enable-psk. Fix to properly detect if missing a asymmetric key algorithm (required by TLS v1.3). 2020-06-04 16:31:19 -07:00
David Garske
1d01b87741 Fix to detect if NO_CERTS / --disable-asn is used in scripts/tls13.test. 2020-06-04 16:08:08 -07:00
David Garske
66fdc2c536 Disable TLS v1.3 if none of these are available "ECC, CURVE25519, CURVE448 or DH". 2020-06-04 15:31:19 -07:00
David Garske
93be04f380 Can't send empty list for the client when sniffer is enabled or it will use AES128-SHA. 2020-06-04 15:31:18 -07:00
David Garske
ad93813d75 Fix for expected failure case on client write. Resolves test-fails.con server TLSv1.3 fail on no client certificate test. 2020-06-04 15:31:18 -07:00
David Garske
d4fdd1e590 Fix for TLS v1.3 test PSK callback to support cipher list. Add support for GetCipherSuiteFromName to accept a name ending with colon. 2020-06-04 15:31:18 -07:00
David Garske
3b63e55a68 Fix for TLS v1.3 PSK tests work with additional cipher suites (not just TLS13-AES128-GCM-SHA256) and the echo server/client. 2020-06-04 15:31:18 -07:00
David Garske
8823a581d0 Add PSK user context support (Fixes #2952.). 2020-06-04 15:31:18 -07:00
David Garske
0228d1eeea Cleanups for the TLS v1.3 build requirements. Add check for TLS v1.3 call to EncodeSigAlg. 2020-06-04 15:31:18 -07:00
David Garske
ab2afbd37b Allow the TLS 13 draft 18 build option and just use the final version. This allows the automated test scripts to pass. 2020-06-04 15:31:18 -07:00
David Garske
4d8cf5b571 Fixes for building TLSv1.3 with FIPS v1 (no RSA PSS or HKDF). 2020-06-04 15:31:18 -07:00
David Garske
8300754ecd Fix for "testsuite" with TLSv1.3 and --enable-sniffer. 2020-06-04 15:31:18 -07:00
David Garske
ba8227bcf7 Fix for building TLS v1.3 with NO_WOLFSSL_CLIENT. 2020-06-04 15:31:18 -07:00
David Garske
b417a76613 Fixes for build TLS v1.3 with NO_CERTS. 2020-06-04 15:31:18 -07:00
David Garske
093d9981fb Disable fast-rsa if RSA PSS is enabled (not supported). 2020-06-04 15:31:18 -07:00
David Garske
cd1c2d5fae Enable TLS v1.3 by default. Remove old TLS v1.3 draft build support. 2020-06-04 15:31:18 -07:00
David Garske
ca9dc7d509 Fix for wc_ecc_import_unsigned failing if first private key byte is zero (Fixes #2950). Fix wc_ecc_is_point to return better code IS_POINT_E on failure (was returning -1). Improved ECC import API unit tests. Added WOLFSSL_VALIDATE_ECC_IMPORT and WOLFSSL_VALIDATE_ECC_KEYGEN to --enable-all. 2020-06-04 15:25:56 -07:00
toddouska
3529d9a40d Merge pull request #3016 from kaleb-himes/FIPSv2-MAINTENANCE
New OpenSSL features relying on changes in module files must account for locked FIPS versions of those files
2020-06-04 15:08:17 -07:00
JacobBarthelmeh
976db2545d Merge pull request #3007 from embhorn/zd10318
Fix OOB access in ParseCRL
2020-06-04 13:11:59 -06:00
toddouska
23d1550439 Merge pull request #2989 from julek-wolfssl/openvpn
Additional OpenSSL compat layer stuff
2020-06-04 11:57:55 -07:00
toddouska
b48699c1f0 Merge pull request #3022 from cconlon/jnisni
enable SNI by default for JNI/JSSE build
2020-06-04 11:07:56 -07:00
toddouska
79465d70f7 Merge pull request #3020 from SparkiDev/tls13_psk_cr
TLS 1.3: Never send CertiifcateRequest when PSK
2020-06-04 11:07:22 -07:00
Jacob Barthelmeh
c8b87eab5f fix macro to match *_FLAGS_* 2020-06-04 11:53:46 -06:00
kaleb-himes
27f37df0e0 Update arduino script to reflect includes of inline files 2020-06-04 09:50:47 -06:00
kaleb-himes
2285071fbc Use old convention, consolidate assignments 2020-06-04 09:34:49 -06:00
kaleb-himes
923fc30043 Change to memcpy 2020-06-03 17:36:40 -06:00
kaleb-himes
8c3f7a77ca cleanup GET messages 2020-06-03 16:53:36 -06:00
kaleb-himes
5a4d84ecad Consolidate to one-line where possible 2020-06-03 16:19:34 -06:00
toddouska
c3407e2052 Merge pull request #3004 from SparkiDev/asn1_int_lead_0_any
Define to allow badly formed ASN integers
2020-06-03 14:55:04 -07:00
toddouska
4ddbe546a3 Merge pull request #2993 from dgarske/math_fixes
Improvements around the ECC max bits calculation
2020-06-03 14:53:51 -07:00
Eric Blankenhorn
4b10f6aa03 Update from review 2020-06-03 15:56:46 -05:00
Chris Conlon
0b9d06e529 return value from FailTestCallBack to prevent NetBSD noreturn warning 2020-06-03 14:45:31 -06:00
Tesfa Mael
d000ceb495 Resolve Warnings 2020-06-03 13:42:37 -07:00
Chris Conlon
cafcaa4181 enable SNI by default for JNI/JSSE build 2020-06-03 14:24:10 -06:00
Chris Conlon
504b887851 fix NetBSD warnings in ASN1_INTEGER_set() tests around int max/min 2020-06-03 14:14:43 -06:00
Chris Conlon
1c1a01fffe rename dup to resolve NetBSD global shadow warnings 2020-06-03 14:11:12 -06:00
Chris Conlon
d220168384 Merge pull request #3017 from kojo1/supplicant-error
alertWhy: unknown_ca for ASN_NO_SIGNER_E
2020-06-03 10:44:31 -05:00
Tesfa Mael
6176f8537f Typecast to fix conversion loses 2020-06-02 22:06:14 -07:00
Sean Parkinson
0d1ed9efc7 TLS 1.3: Never send CertiifcateRequest when PSK
Server must not send a CertificateRequest when authenticating with a
PSK.
Increase the max size of the signature algorithms as ED448 has been
added.
2020-06-03 12:48:31 +10:00
Tesfa Mael
d5241bbcc6 Coverity fix 2020-06-02 15:35:27 -07:00
kaleb-himes
8cd92f68f2 init components as best practice 2020-06-02 14:28:50 -06:00
toddouska
dc1472692a Merge pull request #3011 from dgarske/nomalloc
Fixes for using static memory with no malloc
2020-06-02 11:46:29 -07:00
toddouska
c7331fa699 Merge pull request #3008 from embhorn/zd10320
Fix possible NULL dereference error in TLSX_SecureRenegotiation_Parse
2020-06-02 11:13:17 -07:00
kaleb-himes
6ab5f2d9d7 remove unused variables 2020-06-01 17:56:03 -06:00
kaleb-himes
0604e7d208 no priv or pub in dhKey struct in FIPS 2020-06-01 17:36:27 -06:00
kaleb-himes
bc02f2c74e Revert GCM_NONCE_MID_SZ changes 2020-06-01 17:13:23 -06:00
kaleb-himes
6217118ee4 Account for unmodifiable FIPS module files when adding new OpenSSL functionality 2020-06-01 16:28:32 -06:00
Takashi Kojo
5bcd121ab5 alertWhy: unknown_ca for ASN_NO_SIGNER_E 2020-06-02 05:54:16 +09:00
David Garske
b947f69f60 Fix to correct SP 4096-bit enable. Correct nonexistent WOLFSSL_SP_NO_4096, which should be WOLFSSL_SP_4096. 2020-06-01 10:49:08 -07:00
David Garske
bfe1760c17 Improvements to the ECC max bits calculation used with fast math (USE_FAST_MATH and ALT_ECC_SIZE). Updated example code comments to reflect accurate calculation. 2020-06-01 10:48:52 -07:00
toddouska
9c73a4bdbc Merge pull request #3009 from embhorn/zd10358
Fix OOB access in RsaUnPad
2020-06-01 09:29:10 -07:00
Chris Conlon
aeefc09579 Merge pull request #3013 from miyazakh/fix_espidf_buildfail
fix build failrue on esp-idf
2020-06-01 09:56:29 -06:00
Hideki Miyazaki
5f783f0198 fix build failrue on esp-idf 2020-05-30 15:19:37 +09:00
toddouska
63a1ccda9b Merge pull request #3012 from SparkiDev/ecc_mulmod_fix
Fix ecc mulmod to only do one more bit than modulus len
2020-05-29 13:07:18 -07:00
toddouska
2ee8f335b7 Merge pull request #2992 from SparkiDev/tls13_enc_alert_2
Actually make TLS 1.3 alerts encrypted when possible
2020-05-29 13:04:49 -07:00
Sean Parkinson
2eb9e05518 Fix ecc mulmod to only do one more bit than modulus len 2020-05-29 11:21:37 +10:00
David Garske
e498e07390 Merge pull request #3005 from cconlon/608a
ATECC608A improvements for use with Harmony 3 and PIC32MZ
2020-05-28 16:10:39 -07:00
David Garske
10a1cad2dc Fix for TFM _fp_exptmod_nct with WOLFSSL_NO_MALLOC. 2020-05-28 15:15:52 -07:00
David Garske
fd51eecb4f Fix for using signature wrapper with WOLFSSL_NO_MALLOC. Improve wc_SignatureVerifyHash to use RSA verify inline. 2020-05-28 15:12:01 -07:00
David Garske
7ce7d244f8 Fix for using static memory AES GCM test. 2020-05-28 15:12:01 -07:00
toddouska
5962931b21 Merge pull request #2947 from SparkiDev/tls13_integ_fix
Fix TLS 1.3 integrity only for interop
2020-05-28 13:48:43 -07:00
toddouska
5360783d7e Merge pull request #3003 from JacobBarthelmeh/Testing
fix for gcc 10+ error on snprintf
2020-05-28 13:28:30 -07:00
Eric Blankenhorn
233a5ca6b8 Fix OOB access 2020-05-28 14:14:19 -05:00
Eric Blankenhorn
4e8f5fce66 Fix NULL dereference error 2020-05-28 12:17:29 -05:00
Eric Blankenhorn
91fb6216a9 Fix OOB access 2020-05-28 09:39:44 -05:00
David Garske
99d8be4f4d Merge pull request #3002 from ejohnstown/bump-minor-ver
Bump Patch Version
2020-05-27 21:09:38 -07:00
Sean Parkinson
3fec01c0aa Actually make TLS 1.3 alerts encrypted when possible
Pervious fix didn't work.
This time, if TLS 1.3 and encryption is on then it will encrypt the
alert.
2020-05-28 10:57:33 +10:00
Sean Parkinson
8dee048b04 Define to allow badly formed ASN integers
Define: WOLFSSL_ASN_INT_LEAD_0_ANY
Allows positive integers to have a leading 0 byte.
DER/BER encoding specifies that leding 0 only on negative numbers
(highest bit of first octet set).
2020-05-28 08:50:21 +10:00
Chris Conlon
896fcd9aec add WOLFSSL_ATECC6088A, Trust&GO support, PIC32 HAL compatibility, 608A expansions 2020-05-27 16:49:29 -06:00
Chris Conlon
8ebd121cac add extern prototype for PIC32 pic32_time() 2020-05-27 16:46:40 -06:00
Chris Conlon
d8a6d16f72 add MICROCHIP_TCPIP_BSD_API for using Microchip TCP/IP with BSD API 2020-05-27 16:46:40 -06:00
Chris Conlon
b8e1fe666b include errno.h with MICROCHIP_PIC32 for GetLastError use 2020-05-27 16:46:40 -06:00
Sean Parkinson
1cc9a8ffbf Merge pull request #3001 from DKubasekRA/DKubasekRA-fix-ctMask16LT
Reverted comparison in ctMask16LT
2020-05-28 08:24:48 +10:00
JacobBarthelmeh
8e9f518caa fix for gcc 10+ error on snprintf 2020-05-27 16:20:39 -06:00
John Safranek
19fba3648c Bump Patch Version
1. Increase the patch level of the version number in configure.ac.
2. Added a template for the next version in ChangeLog.md.
3. Bumped version.h.
2020-05-27 10:11:58 -07:00
DKubasekRA
5ef738855c Reverted comparison in ctMask16LT 2020-05-27 10:43:36 +02:00
toddouska
e388885407 Merge pull request #2997 from kaleb-himes/ZD10356
Fix a seg fault when cert not loaded prior to key check
2020-05-26 16:19:43 -07:00
toddouska
c5ebf23c25 Merge pull request #2994 from JacobBarthelmeh/Xilinx
add additional sanity check on pointer before free
2020-05-26 16:18:58 -07:00
Kaleb Himes
5179503e8f Merge pull request #2995 from julek-wolfssl/va-copy-check
Enable wolfSSL_BIO_vprintf on Windows
2020-05-26 08:58:05 -07:00
Sean Parkinson
eed5943b6f Fix TLS 1.3 integrity only for interop
Make key size the size of the digest.
2020-05-25 16:02:53 +10:00
Chris Conlon
165fce7c57 Merge pull request #2988 from miyazakh/peakmem
added WOLFSSL_LEAVE for measuring peak memory script
2020-05-22 15:37:30 -06:00
kaleb-himes
53d2a17b43 Fix a seg fault when cert not loaded prior to key check 2020-05-22 15:03:11 -06:00
Juliusz Sosinowicz
de61a8e5d3 Enable wolfSSL_BIO_vprintf on Windows
Enable wolfSSL_BIO_vprintf use with WOLFSSL_BIO_MEMORY and WOLFSSL_BIO_SSL on Windows with the HAVE_VA_COPY flag
2020-05-21 19:41:40 +02:00
toddouska
d27c023dd9 Merge pull request #2983 from dgarske/stm_stdperilib
Fixes for building with STM32 StdPeriLib and CubeMX
2020-05-21 10:39:36 -07:00
Jacob Barthelmeh
cd1a50bfb6 add additional sanity check on pointer before free 2020-05-21 11:19:17 -06:00
Juliusz Sosinowicz
a67e1fc2ad Fix implicit conversions 2020-05-21 13:20:42 +02:00
Juliusz Sosinowicz
70c55ce30a Set offset in cipher struct 2020-05-21 12:51:23 +02:00
Juliusz Sosinowicz
986c8f351c Fix leak in SetIndividualInternal
SetIndividualInternal should not do mp_init on mpi since it should have been zero'ed during allocation and if it isn't zero'ed then it must mean that memory has already been allocated to it
2020-05-20 20:34:45 +02:00
David Garske
363b9528af Fix for STM32 AES only (L4) AES Decrypt Direct (ECB). 2020-05-20 11:23:14 -07:00
David Garske
de4d2e6436 Fix for CubeMX HAL headerSize (older CubeMX HAL uses actual bytes, not multiple of 32-bit). Fix for GMAC case in STM32_CRYPTO_AES_ONLY. 2020-05-20 10:49:26 -07:00
toddouska
a6f5bc84e6 Merge pull request #2987 from JacobBarthelmeh/Xilinx
Update for RSA calls to Xilsecure
2020-05-20 09:03:52 -07:00
toddouska
516f329f23 Merge pull request #2975 from JacobBarthelmeh/Testing
init FP mutex on wolfCrypt init
2020-05-20 09:01:46 -07:00
David Garske
19848076ec Merge pull request #2986 from kaleb-himes/ZD9610_REPORT2
Fix building with openssl extra x509 small writes to heap without alloc
2020-05-20 08:10:43 -07:00
Juliusz Sosinowicz
5f7832909b BIO_new_mem_buf with negative len should take strlen of buf as len 2020-05-20 16:55:16 +02:00
Juliusz Sosinowicz
4a85bf8108 Additional OpenSSL compat layer stuff
- Add X509_get0_notBefore and X509_get0_notAfter
- Implement EVP_PKEY_get0_DSA and DSA_bits
- OpenSSL_version now prints "wolfSSL $VERSION"
- Remove define guards in `wolfSSL_internal_get_version` as all protocols are defined regardless in `wolfssl/internal.h`and this function just returns the string description of the protocol
2020-05-20 16:55:16 +02:00
JacobBarthelmeh
d09b947478 update for test case and sha3 2020-05-19 19:27:38 -06:00
JacobBarthelmeh
03ed495f84 free temporary buffer 2020-05-19 19:27:29 -06:00
JacobBarthelmeh
6a7a8fa5b7 updated RSA calls to Xilsecure 2020-05-19 19:27:21 -06:00
David Garske
2033be9aed Fixes for building against older STM32 CubeMX HAL. 2020-05-19 17:42:36 -07:00
David Garske
13e6462ea7 Fixes for build with STM32 Standard Periperal Library (StdPeriLib). 2020-05-19 17:42:36 -07:00
David Garske
99ebae9f7c Merge pull request #2985 from cconlon/iarwarn
fix minor IAR warnings in test.c
2020-05-19 16:42:47 -07:00
kaleb-himes
08c02b037c Fix building with openssl extra x509 small writes to heap without alloc 2020-05-19 17:12:36 -06:00
toddouska
0af4e76c40 Merge pull request #2978 from SparkiDev/curve448_cast
Curve448 - cast down
2020-05-19 15:55:32 -07:00
toddouska
7901f74d0b Merge pull request #2977 from SparkiDev/tlsx_ks_ecc_fix
KeyShare ECC shift index range check
2020-05-19 15:49:41 -07:00
toddouska
754c96965a Merge pull request #2974 from SparkiDev/tls13_enc_alert
If encryption setup, TLS 1.3 alerts encrypted
2020-05-19 15:48:54 -07:00
Chris Conlon
9efd9afdfb fix minor IAR warnings in test.c 2020-05-19 14:12:13 -06:00
toddouska
45def39c18 Merge pull request #2972 from ejohnstown/portability
Script Portability
2020-05-18 14:53:27 -07:00
John Safranek
ba9fd89314 Script Portability
1. The openssl interop test script should check that it should run before
doing anything else.
2. The process to create a random port number was using a non-portable
option to the head command. Changed to use the od tool reading from
/dev/random.
3. Ran into a sed that doesn't use the -i option, so changed it to cp its
own bak file and sed from that.
2020-05-18 09:04:41 -07:00
Sean Parkinson
adb3bdd26e Curve448 - cast down 2020-05-18 09:07:20 +10:00
Sean Parkinson
5b918f7ace KeyShare ECC shift index range check 2020-05-18 08:49:38 +10:00
toddouska
c4fee4ce38 Merge pull request #2969 from julek-wolfssl/fix-lut-cache
Fix LUT cache implementation
2020-05-15 15:15:18 -07:00
Jacob Barthelmeh
b615dbe9d5 add additional FP_ECC lock sanity check for case where wolfCrypt_Init is not called 2020-05-15 11:50:05 -06:00
toddouska
684654cd25 Merge pull request #2962 from tmael/fips_solaris
FIPS on Solaris
2020-05-15 10:15:09 -07:00
toddouska
bdddb00ebc Merge pull request #2973 from kaleb-himes/FIPS-OE6
for OE6 sp_arm32.c asm code is inlined in rsa.c and ecc.c
2020-05-14 10:55:54 -07:00
toddouska
91bfa31f70 Merge pull request #2968 from dgarske/stm32_hal_v2
Fixes for STM32 CubeMX HAL with AES GCM
2020-05-14 10:55:04 -07:00
toddouska
fbfb28d5ee Merge pull request #2926 from SparkiDev/tls13_failnocert
Fail when WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT set in TLS1.3
2020-05-14 10:53:18 -07:00
Tesfa Mael
f894d4c0d2 FIPS on Solaris 2020-05-14 10:11:54 -07:00
Juliusz Sosinowicz
24634a02c9 Fix comment 2020-05-14 10:54:45 +02:00
toddouska
88b8ea04f6 Merge pull request #2971 from SparkiDev/sp_cortexm_comment
Fix SP Cortex-M ASM comments
2020-05-13 16:30:14 -07:00
toddouska
902e3a2d97 Merge pull request #2970 from SparkiDev/sp_arm32_divw
Fix div word in SP ARM32
2020-05-13 16:29:31 -07:00
toddouska
6f750c07b5 Merge pull request #2964 from SparkiDev/tls13down_tls12
Only check downgrade when TLS 1.2 and no flag set
2020-05-13 16:25:02 -07:00
JacobBarthelmeh
1876fe1c22 init FP mutex on wolfCrypt init 2020-05-13 13:59:35 -07:00
Sean Parkinson
0295b5ae3b If encryption setup, TLS 1.3 alerts encrypted 2020-05-13 16:14:47 +10:00
Sean Parkinson
57756bfa8d Remove unused 4096-bit functions 2020-05-13 10:23:05 +10:00
kaleb-himes
9a8fc94181 for OE6 sp_arm32.c asm code is inlined in rsa.c and ecc.c 2020-05-12 16:28:39 -06:00
David Garske
778b5dd9d5 Fixes for STM32 CubeMX HAL with AES GCM. Fix AES GCM authentication header size, which expects size as number of 32-bit values. Fix the authentication size round up logic. Fix to use software for authentication tag if authentication data size is not multiple of 4. Fix to ensure 32-bit aligned buffers are used. 2020-05-12 08:27:43 -07:00
Sean Parkinson
786e21b107 Fix SP Cortex-M ASM comments 2020-05-12 23:28:39 +10:00
Sean Parkinson
479b54e78e Fix div word in SP ARM32 2020-05-12 23:14:57 +10:00
Juliusz Sosinowicz
3d2cbdd3e8 Fix LUT cache implementation
- Make sure that the cache is actually set (and not just depend on the LRU_count)
- test_wolfSSL_EC should also be run without ECC_SHAMIR
2020-05-12 13:48:59 +02:00
toddouska
6c9a0e440e Merge pull request #2959 from dgarske/wpas_tiny
Added wpa_supplicant support with reduced code size option
2020-05-11 08:55:22 -07:00
Sean Parkinson
ed4899dd91 Only check downgrade when TLS 1.2 and no flag set
The flag, SSL_OP_NO_TLSv1_2, indicates not to negotiate TLS v1.2.
2020-05-11 13:18:50 +10:00
Sean Parkinson
7c98451f24 Merge pull request #2961 from kaleb-himes/WOLFSSL_EXAMPLES
Fix failing build for rsa_verify_only example
2020-05-11 09:31:31 +10:00
Hideki Miyazaki
5dfc36d32a added WOLFSSL_LEAVE for measuring peak memory script 2020-05-09 17:03:17 +09:00
JacobBarthelmeh
81dc0ac56f Merge pull request #2956 from tmael/hkdf
Check HKDF-Expand length of output <= 255*HashLen
2020-05-08 16:36:40 -06:00
kaleb-himes
82c86447e7 Fix failing build for rsa_verify_only example 2020-05-08 16:18:30 -06:00
David Garske
51b5f84d00 Merge pull request #2938 from JacobBarthelmeh/Xilinx
add Xilinx Vitis 2019.2 example and update README
2020-05-08 15:05:19 -07:00
David Garske
10aa8a4ffc Added support --enable-wpas=small for reduced code size when building against the WPA supplicant with EAP-TLS. This does not use OPENSSL_EXTRA, which helps reduce code size. 2020-05-08 13:38:26 -07:00
toddouska
6b930d996c Merge pull request #2958 from julek-wolfssl/ASN_IP_TYPE-without-openssl
Support IP alternative subject name without OpenSSL
2020-05-08 13:27:27 -07:00
toddouska
4a44b7b781 Merge pull request #2954 from SparkiDev/sp_rsa_pq_len
Only use SP for RSA private operations if P and Q half bits
2020-05-08 08:30:30 -07:00
Juliusz Sosinowicz
b5886e0e37 Add option --enable-ip-alt-name
This commit adds the configure option `--enable-ip-alt-name` that enables support for the IP alternative subject name parsing in `wolfcrypt/src/asn.c:DecodeAltNames`.
2020-05-08 13:20:24 +02:00
Tesfa Mael
b39e384cfd Review comment 2020-05-07 13:39:53 -07:00
toddouska
cb0fb88e44 Merge pull request #2955 from JacobBarthelmeh/Testing
fix for scep build without aes
2020-05-07 08:44:39 -07:00
toddouska
3ef7e588d2 Merge pull request #2932 from kaleb-himes/ZD10223
Fix building with one-side only tls13/dtls
2020-05-07 08:43:36 -07:00
David Garske
943f6c4447 Merge pull request #2957 from SparkiDev/sp_c_cr_fix
SP C: Fix array size for cache resistant modexp
2020-05-07 06:26:39 -07:00
Juliusz Sosinowicz
9e68de0fb7 Add test certs for ASN_IP_TYPE 2020-05-07 11:52:49 +02:00
Sean Parkinson
b331804c27 SP C: Fix array size for cache resistant modexp 2020-05-07 10:00:14 +10:00
Jacob Barthelmeh
6619db580d fix for scep build without aes 2020-05-06 16:58:54 -06:00
Tesfa Mael
2ab478f8fd Check length of output <= 255*HashLen 2020-05-06 15:47:39 -07:00
Sean Parkinson
c4af5db4b9 Only use SP for RSA private operations if P and Q half bits 2020-05-07 08:46:48 +10:00
JacobBarthelmeh
c962aa4181 add sprj file 2020-05-06 12:13:22 -07:00
toddouska
be3c39ed1c Merge pull request #2948 from JacobBarthelmeh/SanityChecks
update armv8 aes gcm sanity checks
2020-05-06 10:31:09 -07:00
Jacob Barthelmeh
3b6b59cea0 add 2019.2 Xilinx example and update README
fix to remove xml extension

add missing project file

update project

update dist include

rm prj files
2020-05-06 09:54:06 -06:00
toddouska
5e45767cc3 Merge pull request #2943 from JacobBarthelmeh/Testing
check on length of unwrap before memmove
2020-05-05 11:09:06 -07:00
Jacob Barthelmeh
0f6fef8384 update armv8 aes gcm sanity checks 2020-05-05 09:47:05 -06:00
Sean Parkinson
74040c62af Merge pull request #2944 from dgarske/sp_cacheres
Fixes for C32/C64 SP math with `WOLFSSL_SP_CACHE_RESISTANT`
2020-05-05 10:43:00 +10:00
Sean Parkinson
09bc460c2e Merge pull request #2946 from dgarske/gcc9
Fix for GCC9 warning
2020-05-05 10:29:56 +10:00
David Garske
8161dfe3aa Fix for GCC9 warning.
```
src/tls.c:201:13: note: in expansion of macro 'XSTRNCMP'
  201 |         if (XSTRNCMP((const char*)sender, (const char*)client, SIZEOF_SENDER) == 0)
      |             ^~~~~~~~
In file included from src/tls.c:33:
./wolfssl/internal.h:4312:19: note: referenced argument declared here
 4312 | static const byte client[SIZEOF_SENDER] = { 0x43, 0x4C, 0x4E, 0x54 };
      |                   ^~~~~~
```
2020-05-04 15:07:28 -07:00
David Garske
174b4d5159 Cleanup of SP with small stack. Expand support for WOLFSSL_SP_NO_MALLOC. Fix for evp.c when included directly. 2020-05-04 14:23:32 -07:00
Chris Conlon
df067b6781 Merge pull request #2919 from kaleb-himes/ZD10194
Fix for Freescale common examples that predated hardening warning
2020-05-04 13:43:07 -06:00
kaleb-himes
62d67c3da1 Don't need if not using TLS 1.2 2020-05-04 12:54:36 -06:00
toddouska
da01961254 Merge pull request #2939 from JacobBarthelmeh/SanityChecks
sanity check on PemToDer type
2020-05-04 11:26:33 -07:00
toddouska
d848495a66 Merge pull request #2937 from dgarske/wolfio_tcpcon_fd
Fix issue with failed TCP connect using invalid socket file descriptor
2020-05-04 11:22:54 -07:00
David Garske
8e0f5ef8ce Fixes for WOLFSSL_SP_CACHE_RESISTANT with small stack. 2020-05-04 11:22:12 -07:00
David Garske
c28ad38b16 Fix for cast issue caused by PR #2900. Applies to WOLFSSL_SP_CACHE_RESISTANT and c32/c64 versions only. 2020-05-04 10:49:59 -07:00
Jacob Barthelmeh
082e51d778 check on length of unwrap before memmove 2020-05-04 10:32:05 -06:00
Jacob Barthelmeh
9f735b4d6e sanity check on PemToDer type 2020-05-01 16:41:18 -06:00
toddouska
3944c8eb73 Merge pull request #2935 from ejohnstown/hush-tfm
Hush TFM Warnings
2020-05-01 08:26:42 -07:00
David Garske
31502ec3f9 Fix issue with failed TCP connect using invalid socket file descriptor on close. Fixes #2936 2020-05-01 07:32:00 -07:00
John Safranek
b6bd86d2b1 TFM Warnings
When building in VS, the MSC will complain about some constants getting
implicitly promoted to 64-bit. Added some type-casts to hush the warnings.
2020-04-30 19:43:18 -07:00
toddouska
f772bc8d9a Merge pull request #2923 from dgarske/pic32mz
Fixes for PIC32MZ crypto hardware cache and large hash
2020-04-30 16:22:13 -07:00
toddouska
df9dd3012f Merge pull request #2934 from SparkiDev/tls13_cookie_ks
TLS13: Prepend the SupportedVersions extension to list
2020-04-30 14:58:11 -07:00
toddouska
a1489d981c Merge pull request #2930 from JacobBarthelmeh/SanityChecks
check on tag length for AES-CCM
2020-04-30 14:51:20 -07:00
Sean Parkinson
7879d3762a TLS13: Prepend the SupportedVersions extension to list
Must have SupportedVersions at start of list for Cookie to be
constructed correctly.
Application can set the key share extension before handshake and
SupportedVersions will be added after. Extensions written in order of
adding to list.
Prepend SupportedVersions so that it will always appear in the correct
place so when reconstructing HelloRetryRequest, the extensions will
always be in the same order.
2020-04-30 08:46:23 +10:00
Jacob Barthelmeh
505fbed4df fix AES-CCM tag size check on decryption 2020-04-29 15:15:54 -06:00
toddouska
7e267546cb Merge pull request #2933 from SparkiDev/tls13_rsa8192
Allow TLS 1.3 CertificateVerify to handle 8192-bit RSA
2020-04-29 11:24:44 -07:00
Sean Parkinson
390f066028 Allow TLS 1.3 CertificateVerify to handle 8192-bit RSA 2020-04-29 12:37:41 +10:00
Sean Parkinson
e9b433a998 Merge pull request #2928 from julek-wolfssl/evp-aes-gcm-fix
Fix AES-GCM in EVP layer to have compatiblity with OpenSSL
2020-04-29 09:00:04 +10:00
Jacob Barthelmeh
b73e52f33f move AES-CCM tag check into a local function 2020-04-28 14:46:06 -06:00
kaleb-himes
951cb4aaf4 Fix building with one-side only tls13/dtls 2020-04-28 14:33:00 -06:00
toddouska
f770d28ff0 Merge pull request #2916 from dgarske/testfixes
Improvements to ECC key decode and tests
2020-04-28 09:57:44 -07:00
toddouska
a585e4115e Merge pull request #2927 from SparkiDev/tls13_ccs
In TLS 1.3, don't allow multiple ChangeCipherSpecs in a row
2020-04-28 09:52:46 -07:00
toddouska
cb6fc56f3b Merge pull request #2921 from dgarske/fixes_g++
Fixes for G++ and enable-all
2020-04-28 09:51:34 -07:00
Juliusz Sosinowicz
c02c408409 Only 80 characters a line 2020-04-28 12:38:02 +02:00
Sean Parkinson
a104caef13 Merge pull request #2929 from dgarske/sp_rsalowmem
Fix for SP math with `RSA_LOW_MEM` (ARM only)
2020-04-28 08:43:31 +10:00
Jacob Barthelmeh
c85a53c631 add macro guard for fips and selftest builds 2020-04-27 15:36:53 -06:00
David Garske
6185e0f477 Remove execute bit on files. 2020-04-27 11:16:02 -07:00
David Garske
327cdefc24 Fix for SP math with RSA_LOW_MEM, which was broken in PR #2892. 2020-04-27 08:59:54 -07:00
Juliusz Sosinowicz
01a6dded72 Fix AES-GCM in EVP layer to have compatiblity with OpenSSL
- Tag checking in AES-GCM is done in Final call
- Reset `WOLFSSL_EVP_CIPHER_CTX` structure after Final call
- Don't zero `ctx->authTag` struct in Init call so that user can get the AES-GCM tag using `EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, AES_BLOCK_SIZE, tag)`
- `ctx->authTag` is only zeroed before authenticated, non-confidential data Update call since this means we are entering a new Udate-Final cycle. This doesn't need to be done in the decrypt case since the tag should be supplied by the user before the final call using `EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, AES_BLOCK_SIZE, tag)`
2020-04-27 15:52:01 +02:00
David Garske
1e726e19a4 Fix for XMALLOC cast. 2020-04-27 06:48:41 -07:00
Sean Parkinson
c153873337 Fail when WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT set in TLS1.3 2020-04-27 16:17:03 +10:00
Sean Parkinson
df1b7f34f1 In TLS 1.3, don't allow multiple ChangeCipherSpecs in a row 2020-04-27 15:27:02 +10:00
David Garske
3c93a7b757 Fix Value stored to 'ret' is never read. 2020-04-24 11:31:12 -07:00
David Garske
a4caa42793 Improve the Base64 line size for NO_ASN case. Fix report of unread ret. 2020-04-24 11:26:55 -07:00
David Garske
589712f870 PIC32MZ Fix for cache coherency to enable write-through (no write allocation) to resolve descriptor corruption. ZD 10212. 2020-04-24 09:13:28 -07:00
David Garske
0f11369680 PIC32MZ Fix for WOLFSSL_PIC32MZ_LARGE_HASH: Only submit to hardware if update data provided matches expected. ZD 10211. 2020-04-24 09:01:51 -07:00
David Garske
cfc0aeb857 Fix for RSA and KeyGen only in test.c. 2020-04-24 08:56:31 -07:00
David Garske
41fc208195 Fixes for isHMAC checks. 2020-04-24 08:51:56 -07:00
David Garske
5fa7bb5b9f Fix possible unused args. 2020-04-24 07:48:41 -07:00
David Garske
6d025f8c0f Refactor of the EVP macType to use enum wc_HashType to resolve issues with invalid casting. 2020-04-24 07:43:44 -07:00
TakayukiMatsuo
922ab1e944 Merge remote-tracking branch 'upstream/master' into branch-1 2020-04-24 18:00:29 +09:00
TakayukiMatsuo
bcc408442b Added test cases for wc_curve25519_key_export_xx 2020-04-24 17:50:17 +09:00
David Garske
28b686a8ca * Exposed useful sizes MAX_X509_HEADER_SZ and PEM_LINE_SZ
* Refactor the PEM saving code in `test.c`, so its not using large 4K buffer and calculates based on DER.
* Enable ECC key generation test even without `WOLFSSL_KEY_GEN`.
* Added `ECC_KEYGEN_SIZE` macro for ECC key generation testing.
* Refactor ECC DER key generation to use `ECC_BUFSIZE`.
2020-04-23 16:11:54 -07:00
David Garske
81f959336b Added support for important private key DER using wc_EccPublicKeyDecode. Added ECC key generation and decode test case. 2020-04-23 16:07:43 -07:00
David Garske
b07dfa425d Fixes for ./configure CC="g++" --enable-all && make. Resolves issues with implicit casts and use of reserved template keyword. 2020-04-23 15:26:04 -07:00
David Garske
5376763638 Merge pull request #2913 from SparkiDev/sp_cortexm4_ecc
Improve performance of SP Cortex M asm
2020-04-23 09:47:05 -07:00
toddouska
7318121d3a Merge pull request #2915 from dgarske/async_v4.4.0
Fixes for async release v4.4.0
2020-04-23 09:26:08 -07:00
toddouska
54aa50e628 Merge pull request #2912 from SparkiDev/sp_movbe
Only use Intel instruction movbe when available
2020-04-23 09:25:02 -07:00
David Garske
6132176715 Merge pull request #2917 from ejohnstown/postrelease
Minor wolfCrypt Test Fixes
2020-04-23 07:16:07 -07:00
Sean Parkinson
7a0cbe084e Improve performance of SP Cortex M asm 2020-04-23 11:05:42 +10:00
John Safranek
a064cb3943 Fix a couple of wolfCrypt test issues found during the long release build test. 2020-04-22 11:30:57 -07:00
toddouska
e116c89a58 Merge pull request #2906 from ejohnstown/release-rollup
Release Rollup
2020-04-22 10:43:44 -07:00
David Garske
4592e0ec95 Fix for use of incorrect devId for wolfSSL_SHA3_256_Init. 2020-04-22 10:16:20 -07:00
David Garske
88d04e5eeb Fix for NULL == NULL test case in test_wolfSSL_EC_get_builtin_curves. 2020-04-22 10:15:52 -07:00
David Garske
36a556f927 Resolve issues with the openssl compatibility CRYPTO_malloc and CRYPTO_free. 2020-04-22 10:15:16 -07:00
kaleb-himes
12e4718c67 Fix for Freescale common examples that predated hardening warning 2020-04-22 11:06:36 -06:00
John Safranek
83152c767f touch dates 2020-04-21 10:50:59 -07:00
John Safranek
bf680b4a92 Fix for QAT with Shake256. Fix for XFREE missing semicolon. 2020-04-21 10:38:27 -07:00
John Safranek
7b6cc2056b Update release date in readme and changelog. 2020-04-21 10:21:59 -07:00
John Safranek
ccd096e1bb Memory Leak Fix
1. In `wolfSSL_d2i_DHparams()`, when setting the internal key on a
   WOLFSSL_KEY, set the flag inSet.
2. Not a leak, but in `wolfSSL_EVP_PKEY_set1_DH()`, only allocate one
   buffer to store the flat key. Saves an alloc, memcpy, and free.
2020-04-21 10:21:59 -07:00
John Safranek
61f3783111 Fixes to test.c for the following build configurations:
1. ./configure --disable-rsa --enable-certgen --enable-certreq
2. ./configure --disable-ecc --enable-pkcs7
2020-04-21 10:21:59 -07:00
John Safranek
c134626946 Update credit names on vuln notice in README. 2020-04-21 10:21:59 -07:00
John Safranek
087675e31e Update the RPM build spec. 2020-04-21 10:21:59 -07:00
John Safranek
4331b7df18 Update the VS library build resource. 2020-04-21 10:21:58 -07:00
John Safranek
bf4f50ab93 Add Azure Sphere file missing from release. 2020-04-21 10:21:58 -07:00
John Safranek
a29eac035b Update credit for vulnerability report. 2020-04-21 10:21:58 -07:00
John Safranek
836e77508d Remove notes for reverted DTLS commits. 2020-04-21 10:21:58 -07:00
John Safranek
7cbf496329 Encrypt key requirements check
The file wc_encrypt.c offers a function named wc_CryptKey(), which
requires PWDBASED and ASN. Added the check for ASN.
2020-04-21 10:21:58 -07:00
John Safranek
e84cd1a887 Updated the README file and ChangeLog for some spelling and omissions. 2020-04-21 10:21:58 -07:00
John Safranek
27011ff7ff Release Rollup
1. Update configure with the new version.
2. Update the ChangeLog.
3. Update the readme.
2020-04-21 10:21:53 -07:00
Jacob Barthelmeh
231c488ddf check on tag length for AES-CCM 2020-04-20 13:44:41 -06:00
JacobBarthelmeh
0cfde0794b Merge pull request #2848 from julek-wolfssl/wpa-supplicant-openssl-compat
Added partial support for wpa_supplicant, hostapd, and cjose:
2020-04-20 12:17:55 -06:00
Sean Parkinson
75c14e4c8e Only use Intel instruction movbe when available 2020-04-20 09:09:45 +10:00
John Safranek
f87f09fcd7 Merge pull request #2910 from embhorn/zd10169
Fix forbidden iv length 0 with AES-GCM
2020-04-16 16:01:03 -07:00
Stanislav Klima
8112c81fc5 Added missing NO_CERTS check. 2020-04-16 23:30:11 +02:00
Eric Blankenhorn
6b3642db36 Fix forbidden iv length 0 with AES-GCM 2020-04-16 13:48:56 -05:00
toddouska
75deec250c Merge pull request #2908 from ejohnstown/dtls-revert
DTLS Revert
2020-04-16 09:58:48 -07:00
toddouska
9918ee8b68 Merge pull request #2907 from SparkiDev/sp_arm64_reg
SP ARM64 - use fewer registers in mont_reduces
2020-04-16 09:58:07 -07:00
Juliusz Sosinowicz
dd68074104 Fix merge issues 2020-04-16 10:09:15 +02:00
Stanislav Klima
eab451339c Fixed dereference after null check. 2020-04-16 09:52:02 +02:00
Stanislav Klima
83044d7560 Fixed dereference after null check. 2020-04-16 09:46:15 +02:00
John Safranek
40ea386509 Revert "DTLS Fix"
This reverts commit 04dcb8f774.
2020-04-15 21:33:33 -07:00
John Safranek
78a9185d0b Revert "DTLS Fuzz Fix"
This reverts commit 70d03f3ba0.
2020-04-15 21:33:27 -07:00
Sean Parkinson
da5d9a923b SP ARM64 - use fewer registers in mont_reduces 2020-04-16 09:20:04 +10:00
Juliusz Sosinowicz
36403c1dad Merge remote-tracking branch 'wolfSSL/master' into wpa-supplicant-openssl-compat 2020-04-15 16:55:03 +02:00
Stanislav Klima
314ff1137b Fixed resource leak. 2020-04-15 16:29:11 +02:00
Stanislav Klima
68a2e03bd4 Fixed resource leak. 2020-04-15 16:27:34 +02:00
Stanislav Klima
1a80975d9e Fixed resource leaks. 2020-04-15 15:47:32 +02:00
Stanislav Klima
e19334266e This function is required by HAVE_PK_CALLBACKS option and it's used by server as well. 2020-04-15 14:43:12 +02:00
Stanislav Klima
74893edaf0 Fix of size constraint for parsing. 2020-04-15 14:36:36 +02:00
Juliusz Sosinowicz
1d3fd5cd07 Code review
- make `wc_ecc_export_point_der_compressed` a local function
- use `int` for `shortKeySize` in `wc_ecc_import_point_der_ex`
- check for null return value from `wolfSSL_OBJ_nid2obj` and `wolfSSL_d2i_PUBKEY`
- add comments to `ssl.c`
- check `lnlen` in `wolfSSL_OBJ_ln2nid`
2020-04-15 12:53:38 +02:00
toddouska
ebb490204a Merge pull request #2898 from embhorn/zd9856
Fix EVP API to return NID types / SHA3 for RSA sign
2020-04-14 16:09:00 -07:00
toddouska
f97a56b9ce Merge pull request #2905 from ejohnstown/dtls-fuzz
DTLS Fuzz Fix
2020-04-14 14:19:09 -07:00
Eric Blankenhorn
d9472b895f Fix conflicts after rebase 2020-04-14 15:24:52 -05:00
Eric Blankenhorn
19ca00bcd4 Adding support for SHA3 in wolfSSL_RSA_sign_ex 2020-04-14 14:31:00 -05:00
Eric Blankenhorn
1487917214 Fix EVP_MD_CTX_type to return NID 2020-04-14 14:27:21 -05:00
Eric Blankenhorn
be437c0bd2 Fix EVP API to use NID instead of WC_ types 2020-04-14 12:47:10 -05:00
John Safranek
70d03f3ba0 DTLS Fuzz Fix
Only save a next epoch message if it is in the next epoch, not any future epoch.
2020-04-14 10:13:37 -07:00
toddouska
9c1b90170a Merge pull request #2903 from SparkiDev/test_4096
Fix testing using 4096 bits keys and parameters
2020-04-14 09:25:00 -07:00
toddouska
06c6e583c8 Merge pull request #2891 from julek-wolfssl/refactor-evp-functions
Move EVP functions to evp.c
2020-04-14 09:22:51 -07:00
toddouska
a2892f66c0 Merge pull request #2889 from JacobBarthelmeh/SanityChecks
sanity check on input length before secure renegotiation compare
2020-04-14 09:21:29 -07:00
David Garske
b6d6b1db77 Added new DH 4096-bit key to gencertbuf.pl. 2020-04-14 07:11:07 -07:00
Juliusz Sosinowicz
dad0bc0159 Keep compatibility with old OPENSSL_EXTRA_X509_SMALL functions 2020-04-14 12:52:23 +02:00
Juliusz Sosinowicz
0b3a331265 Revert wc_OBJ_sn2nid 2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
0ded4d4ccb wolfSSL_RSA_*_PKCS1_PSS rewrite 2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
89f7a51838 Add option to enable DPP support in wpa_supplicant (note DPP not yet supported as of this commit) 2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
20e669a65a New API
Add `wc_ecc_import_point_der_ex` for correct importing DER ECC point and keep `wc_ecc_import_point_der` old functionality
2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
dbe4e778d3 Test fixes
- Add `parameter` to `WOLFSSL_X509_ALGOR`
- Implement `wolfSSL_ASN1_TYPE_new`, `wolfSSL_ASN1_TYPE_free`, and `wolfSSL_ASN1_TYPE_set`
- Fix leak where `pval` in `wolfSSL_X509_ALGOR_set0` was lost if `aobj` was provided
2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
18093a6b0b Code review changes
- Don't include `ENABLED_OPENSSLALL` with `ENABLED_WPAS`
- Return length in `wolfSSL_i2d_DHparams`
- Implement `wolfSSL_EC_POINT_mul` with independent multiplication and addition if `ECC_SHAMIR` not defined
- Implment `ASN1_SIMPLE` without `offsetof` by using a dummy struct
- Style fixes
2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
9722082372 Fix nid2* and *2nid functions 2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
eb549f7095 Test fixes 2020-04-14 11:45:32 +02:00
Juliusz Sosinowicz
ef5eefac91 Test fixes 2020-04-14 11:45:32 +02:00
Juliusz Sosinowicz
b4d9007a48 Test fixes
Config fixes
Fix windows FIPS
2020-04-14 11:45:32 +02:00
Juliusz Sosinowicz
680a481e61 Test fixes
Remove redundant macros
2020-04-14 11:45:32 +02:00
Juliusz Sosinowicz
9ced70edc1 Test fixes
Free `x509->key.pkey` in `FreeX509
Fix type conversions
Fix memory leaks and use of uninitialized memory
2020-04-14 11:45:32 +02:00
Juliusz Sosinowicz
73b4d78d5b Added partial support for wpa_supplicant, hostapd, and cjose:
- Moved `SetECKeyInternal` and `SetECKeyExternal` to `internal.h` to allow usage outside of `ssl.c`
- Added `asn1t.h`
- Implemented the `IMPLEMENT_ASN1_FUNCTIONS` macro for a small subset of ASN1 tags
-- So far only `X509_ALGOR` and `ASN1_BIT_STRING` are supported
- Implemented `BN_mod_add` function
- Allow for setting of `EC_KEY` export form through EC_KEY_set_conv_form
- Implemented `i2o_ECPublicKey`
- Implemented `EC_POINT_copy`
- Implemented deriving DH and ECDH keys in `EVP_PKEY_CTX`. Functions added:
-- `EVP_PKEY_derive_init`
-- `EVP_PKEY_derive_set_peer`
-- `EVP_PKEY_derive`
- Implemented `EVP_PKEY_get0_DH`
- Implemented `X509_ALGOR_new`
- Implemented `X509_ALGOR_free`
- Implemented `X509_ALGOR_set0`
- Implemented `X509_PUBKEY_new`
- Implemented `X509_PUBKEY_free`
- Implemented `X509_PUBKEY_set`
- Implemented `RSA_padding_add_PKCS1_PSS`
- Implemented `RSA_verify_PKCS1_PSS`
- Changed second parameter of `wolfSSL_d2i_PUBKEY` to be constant
- Corrected long names in `asn.h`
- Added `wc_ecc_get_generator` as a way to get the generator point of a curve
- Added `wc_ecc_export_point_der_ex` to export an ECC point in compressed or uncompressed format with one API
- Added `wc_ecc_export_point_der_compressed` to export a point in an `ecc_point` structure in compressed DER format
- Added 'wc_RsaSSL_Verify_ex` which adds the option to choose a padding type
- Added `wc_RsaPad_ex` and `wc_RsaUnPad_ex` to `rsa.h` as `WOLFSSL_LOCAL` functions
- `CopyDecodedToX509` now fills `x509->key` and `x509->algor` when populating x509
- `wolfSSL_EVP_CipherInit` now uses `wc_AesGcmSetExtIV` to set the IV so that it is copied to `ctx->iv` by `wolfSSL_StoreExternalIV`
- Added error checking to `wolfSSL_EVP_PKEY_get_der`
- `wolfSSL_X509_ALGOR_get0` now attempts to return something in all parameters
- Refactored `wolfSSL_EC_KEY_new` to use `*_new` functions when available
- Added `setupPoint` to set the internal point if not yet set
- Always set external point in `wolfSSL_ECPoint_d2i`
- Added compressed point support to `wolfSSL_EC_POINT_point2oct`
- Fix `wolfSSL_EC_POINT_mul` so that it will calculate the full `generator * n + q * m` then OpenSSL does
- Added `WOLFSSL_RSA_GetRNG` helper function to get a `WC_RNG` from `WOLFSSL_RSA`
- Correct short names in `wolfssl_object_info`
- Added all currently supported curves to `wolfssl_object_info`
- Added `oidCurveType` to `oid2nid`
- Add more padding types to `wolfSSL_RSA_public_decrypt`
- Fix `keysize` in `wc_ecc_import_point_der`
- Added tests for new additions
2020-04-14 11:45:32 +02:00
Sean Parkinson
ba401c9bde Fix testing using 4096 bits keys and parameters
RSA PKCS #1.5 padding for signing is not reliant on a random.
2020-04-14 12:03:51 +10:00
Sean Parkinson
416f0775d3 Merge pull request #2900 from dgarske/sp_no_malloc
Added option to build SP small without malloc
2020-04-14 09:40:11 +10:00
toddouska
3cb0c600ba Merge pull request #2894 from SparkiDev/ecc_cr_fix
Change constant time and cache resistant ECC mulmod
2020-04-13 16:36:22 -07:00
JacobBarthelmeh
f309173518 Merge pull request #2899 from embhorn/zd9564
Adding check for invalid SAN ext with no entries
2020-04-13 15:31:06 -06:00
toddouska
ee0289bea6 Merge pull request #2825 from julek-wolfssl/self-include-options
OpenVPN changes
2020-04-13 13:11:18 -07:00
toddouska
aadec345ab Merge pull request #2871 from vaintroub/master
Fix clang warnings (issue #2870)
2020-04-13 09:02:51 -07:00
David Garske
1f5a7bffaa Build fixes for WOLFSSL_NO_MALLOC in wolfCrypt test. 2020-04-13 07:39:06 -07:00
David Garske
b01ce168ea Fixes for SP small with no malloc in sp_256_ecc_mulmod_10 and sp_384_ecc_mulmod_15. 2020-04-13 07:19:06 -07:00
toddouska
4748254b60 Merge pull request #2896 from embhorn/zd9916
Fix wc_KeyPemToDer with PKCS1 and empty key
2020-04-10 15:38:07 -07:00
David Garske
d412ccb6f8 Added new option WOLFSSL_SP_NO_MALLOC for building small SP without malloc. Added SP documentation. Added ./configure --enable-sp=yes,nomalloc supprt. https://github.com/wolfSSL/scripts/pull/79 2020-04-10 11:13:55 -07:00
Eric Blankenhorn
8644fdca7d Update from review 2020-04-10 08:29:31 -05:00
Sean Parkinson
ffd06e359f Change constant time and cache resistant ECC mulmod
Ensure points being operated on change to make constant time.
2020-04-10 09:28:20 +10:00
toddouska
0a40bbe2a9 Merge pull request #2897 from ejohnstown/omit-omit
Omit -fomit-frame-pointer from CFLAGS
2020-04-09 16:01:34 -07:00
toddouska
cf8459e518 Merge pull request #2892 from SparkiDev/cppcheck_fixes_4
Fixes from cppcheck
2020-04-09 16:01:11 -07:00
Eric Blankenhorn
7d82c4e3f2 Adding check for invalid SAN ext with no entries 2020-04-09 16:49:52 -05:00
Eric Blankenhorn
c3e0575914 Fix from review 2020-04-09 12:52:32 -05:00
Juliusz Sosinowicz
f6b9b2e0eb Remove redundant guards 2020-04-09 18:26:23 +02:00
toddouska
2bf9dc4037 Merge pull request #2895 from dgarske/qat_tls13
Fix for asynchronous TLS v1.3 issue
2020-04-09 09:25:36 -07:00
Juliusz Sosinowicz
9cbbd164e0 Fix test errors 2020-04-09 14:54:09 +02:00
Sean Parkinson
6621465433 Merge pull request #2890 from JacobBarthelmeh/Testing
set ChaCha counter state for TLS 1.3 AEAD
2020-04-09 10:28:50 +10:00
John Safranek
7a6de91296 Omit -fomit-frame-pointer from CFLAGS. 2020-04-08 14:06:11 -07:00
Eric Blankenhorn
4d6e33b1dd Fix wc_KeyPemToDer with PKCS1 and empty key 2020-04-08 11:34:24 -05:00
toddouska
97d798743a Merge pull request #2893 from SparkiDev/tls13_capable_fix
Another place where TLS 1.3 capable check is required
2020-04-08 09:09:19 -07:00
David Garske
5e5af8e93a Fix for asynchronous TLS v1.3 issue where connect or accept state is incorrectly advanced when there is data to queued to send. 2020-04-08 07:26:21 -07:00
Sean Parkinson
7001599782 Another place where TLS 1.3 capable check is required 2020-04-08 11:36:47 +10:00
Sean Parkinson
411aee6e05 Fixes from cppcheck
Added PRIVATE_D version of rsa private key operation for SP
implementation for specific platforms.
WC_NO_RNG results in warnings when RNG calls don't do anything.
Added ifdef checks for variables not used otherwise.
Remove superfluous if statements like when checking ret == 0.
Change names of globals that are generic and are used locally before
global definition.
Remove definition of variable len that isn't used except as a
replacement for sz which is parameter.
Don't subtract two variables when one has just been assigned the value
of the other.
Fix shifting of signed value.
Fix parameter checking in aes.c and des3.c for platform specific code.
2020-04-08 09:46:22 +10:00
toddouska
9e08efe8e0 Merge pull request #2885 from SparkiDev/sp_x64_ecc_tweak
Tweak the SP x86_64 ECC assembly
2020-04-07 14:27:12 -07:00
toddouska
6e8d3f224d Merge pull request #2888 from SparkiDev/tls13_down_rand
Fix downgrade fixed random to match spec
2020-04-07 14:22:07 -07:00
toddouska
690b546260 Merge pull request #2887 from dgarske/nodir
Fix for building with `NO_WOLFSSL_DIR`
2020-04-07 14:14:34 -07:00
toddouska
b6f98a3cde Merge pull request #2886 from kaleb-himes/ZD10106
Avoid leak when HAVE_AESGCM and NO_AES_DECRYPT. Thanks to G.G. on ZD …
2020-04-07 14:13:43 -07:00
Juliusz Sosinowicz
4c0ea10e45 Move EVP functions to evp.c 2020-04-07 22:36:50 +02:00
toddouska
ebcf86070d Merge pull request #2883 from miyazakh/esp_aescounter
add aes counter on esp32
2020-04-07 13:24:53 -07:00
toddouska
77b75ef3a2 Merge pull request #2881 from dgarske/ecc_asn
Fixes for building ECC without ASN
2020-04-07 13:09:37 -07:00
toddouska
dec111722f Merge pull request #2880 from SparkiDev/tls_csr_ext_empty
GNU TLS server sends empty CSR extension
2020-04-07 13:08:21 -07:00
toddouska
c002df4cce Merge pull request #2879 from ejohnstown/dtls-fix
DTLS Fix
2020-04-07 13:07:30 -07:00
toddouska
154dd552e9 Merge pull request #2877 from SparkiDev/tls_hmac_trunc
Allow use of truncated HMAC with TLS_hmac checking
2020-04-07 13:06:36 -07:00
toddouska
65cf5a0d46 Merge pull request #2802 from embhorn/zd9764
Fix for bidirectional shutdown
2020-04-07 13:03:54 -07:00
toddouska
f742693062 Merge pull request #2867 from SparkiDev/aes-ccm-aesni
For CCM using AES-NI, do 4 blocks at a time if possible
2020-04-07 13:03:23 -07:00
toddouska
4a4f383485 Merge pull request #2842 from julek-wolfssl/set_curve_groups_list
Check length to avoid XSTRNCMP accessing  memory after `list`
2020-04-07 13:02:18 -07:00
Jacob Barthelmeh
bf332b459b set ChaCha counter state for TLS 1.3 AEAD 2020-04-07 10:36:23 -06:00
Jacob Barthelmeh
1ce0268477 sanity check on input length before secure renegotiation compare 2020-04-07 10:10:03 -06:00
Sean Parkinson
e6affa386f Fix downgrade fixed random to match spec 2020-04-07 09:42:08 +10:00
David Garske
31ea4b388c Fix for building with NO_WOLFSSL_DIR when compatibility layer is enabled. ZD 10117. 2020-04-06 10:33:16 -07:00
kaleb-himes
4ec0591e45 Avoid leak when HAVE_AESGCM and NO_AES_DECRYPT. Thanks to G.G. on ZD #10106 for the report 2020-04-06 09:43:24 -06:00
Juliusz Sosinowicz
06f23223e4 Allow wolfSSL to include options.h with EXTERNAL_OPTS_OPENVPN header 2020-04-06 15:06:15 +02:00
Sean Parkinson
9c67bc2864 For CCM using AES-NI, do 4 blocks at a time if possible 2020-04-06 11:11:28 +10:00
Sean Parkinson
7dad0d3965 Tweak the SP x86_64 ECC assembly
Put back fixes undone in previous commits:
 - Fix casting warning in SP when mp_digit < sp_digit
 - SP fix check for NULL in EC point_new
2020-04-06 11:02:30 +10:00
Hideki Miyazaki
302e1d6818 add aes counter on esp32 2020-04-04 14:04:44 +09:00
David Garske
1831193c20 * Fixes for building ECC without ASN.
* Fix to expose `wc_ecc_import_private_key_ex` and its ability to import a private key even when `NO_ASN` is defined.
* Remove execute bit on CSharp files.
2020-04-03 10:55:31 -07:00
Sean Parkinson
c0dc3091e1 GNU TLS server sends empty CSR extension 2020-04-03 16:03:41 +10:00
toddouska
9a1687d00e Merge pull request #2836 from dgarske/fips_ld
Example for FIPS Linker Descriptor (.ld)
2020-04-02 14:28:30 -07:00
toddouska
8128a269f3 Merge pull request #2876 from SparkiDev/sp_arm64
Improve speed of AArch64 assembly
2020-04-02 14:26:48 -07:00
Juliusz Sosinowicz
48e40fac2b OpenVPN changes
Include <wolfssl/options.h> in settings.h for OpenVPN
Additional API fixes
2020-04-02 20:23:13 +02:00
toddouska
6126aca387 Merge pull request #2874 from SparkiDev/tls13_cert_hash
When picking hash alg for ECC certs use key size
2020-04-02 09:52:10 -07:00
toddouska
86adb7f9c5 Merge pull request #2873 from SparkiDev/aes_small
Smaller table version of the AES encrypt/decrypt
2020-04-02 09:50:58 -07:00
toddouska
5df5ab5931 Merge pull request #2862 from dgarske/iar_ropi
Support for IAR with position independent code (ROPI)
2020-04-02 09:49:00 -07:00
toddouska
06442c410d Merge pull request #2861 from dgarske/zynqmp
Fixes for Xilinx SDK and Zynq UltraScale+ MPSoC
2020-04-02 09:46:48 -07:00
Juliusz Sosinowicz
b1a80973dd size_t -> int 2020-04-02 18:45:53 +02:00
Sean Parkinson
c48ea3f567 When picking hash alg for ECC certs use key size 2020-04-02 11:53:35 +10:00
John Safranek
04dcb8f774 DTLS Fix
If the finished message (well, next epoch handshake message) is received,
store it. Process it after a change cipher spec message.
2020-04-01 17:17:51 -07:00
Sean Parkinson
e23a6b46b0 Allow use of truncated HMAC with TLS_hmac checking 2020-04-02 08:52:40 +10:00
Eric Blankenhorn
b1ec15de3e Only try shutdown once in example 2020-04-01 17:48:17 -05:00
Eric Blankenhorn
3f7ce61dbd Updates from review 2020-04-01 11:14:25 -05:00
Sean Parkinson
df1819b79f Improve speed of AArch64 assembly
Improve point_dbl and point_dbl_n for all platforms.
2020-04-01 15:06:50 +10:00
David Garske
47d1cb8415 Changes to support IAR with position independent code (ROPI). Updated example wolfSSL IAR project to use "ropi" (Position indipendance for code and read-only data). 2020-03-31 08:17:09 -07:00
Martin Akman
568ce62b81 Updates from code review 2020-03-31 18:29:06 +10:00
David Garske
3bd52b166b Merge pull request #2863 from miyazakh/dtls_benchmark
added dtls benchmark
2020-03-27 12:06:06 -07:00
Sean Parkinson
9339808ea1 Smaller table version of the AES encrypt/decrypt
Use WOLFSSL_AES_SMALL_TABLES.
Much slower. Decrypt much slower then encrypt.
2020-03-27 15:53:01 +10:00
Hideki Miyazaki
99b9f46e58 fixed not working on mac
fixed case of -s or -c
2020-03-27 12:33:51 +09:00
toddouska
ddb4b5eb89 Merge pull request #2872 from SparkiDev/rsa_pub_fix
Fix performance of RSA public key ops with TFM
2020-03-26 11:56:23 -07:00
toddouska
16fa1a4747 Merge pull request #2855 from JacobBarthelmeh/PKCS12
maintenance to PKCS12 create for outputting encrypted bundles
2020-03-26 10:41:04 -07:00
JacobBarthelmeh
1bc2ecff6a Merge pull request #2849 from dgarske/csharp_wrapper
CSharp wrapper improvements
2020-03-26 09:10:24 -06:00
Sean Parkinson
c82531a41a Fix performance of RSA public key ops with TFM
Have a constant and non-constant time modular exponentation available in
tfm.c.
Call the non-constant time version explicitly when performing RSA public
key mod exp.
2020-03-26 17:33:07 +10:00
David Garske
a6034a38c7 Fix for building with WOLFSSL_SMALL_STACK_CACHE only (no WOLFSSL_SMALL_STACK). 2020-03-25 16:04:45 -07:00
Vladislav Vaintroub
d57d194de3 Fix clang warnings (issue #2870)
The warning was "comparison of array 'ecc_sets[i].name' not equal to a null
pointer is always true [-Wtautological-pointer-compare]"

Compiler is correct, ecc_sets[i].name  is an array of size 16, thus
can't be NULL

Also, fix build error on Windows by changing uint8_t to "unsigned char"
(alternative fix could be including stdint.h)
2020-03-25 23:07:12 +01:00
David Garske
3717982d47 Fix to build wolfssl/testsuite in Any CPU case. 2020-03-25 14:53:58 -07:00
David Garske
70773f3b3e Added "WOLFSSL_ARMASM" ifdef checks on ARMv8 port files. 2020-03-25 12:54:40 -07:00
toddouska
93fd1b1eeb Merge pull request #2869 from JacobBarthelmeh/Testing
add single quotes around -? in test scripts
2020-03-25 11:03:19 -07:00
toddouska
083b8f680f Merge pull request #2868 from JacobBarthelmeh/Certs
refactor decrypt content with PKCS12 and fix for AES-256 + HMAC SHA25…
2020-03-25 11:02:34 -07:00
Jacob Barthelmeh
2116c20f5d add test case for PKCS12 to DER and back 2020-03-25 10:38:18 -06:00
David Garske
469de9a580 Fix for CSharp solution to eliminate Debug/Release. Only DLL Debug and DLL Release should be available. 2020-03-25 08:57:58 -07:00
Jacob Barthelmeh
0a6b93fda2 add single quotes around -? in test scripts 2020-03-24 22:40:48 -06:00
Jacob Barthelmeh
59ab600d76 refactor decrypt content with PKCS12 and fix for AES-256 + HMAC SHA256 case 2020-03-24 22:23:44 -06:00
Hideki Miyazaki
9fac21f463 replace the size at bench_embedded 2020-03-25 08:09:42 +09:00
toddouska
26f539400a Merge pull request #2866 from SparkiDev/curve448_gcc_bug
Curve448 - 128-bit impl workaround for compiler
2020-03-24 09:55:43 -07:00
toddouska
e66334e56b Merge pull request #2865 from SparkiDev/sp_cast_fix
Fix casting warning in SP when mp_digit < sp_digit
2020-03-24 09:52:26 -07:00
toddouska
b92e5d83c5 Merge pull request #2864 from JacobBarthelmeh/ARMv8
Fix for clang warning with ARM assembly build
2020-03-24 09:51:11 -07:00
Hideki Miyazaki
75eca61b3e address review comments 2020-03-24 20:35:21 +09:00
Sean Parkinson
c95e7f88aa Curve448 - 128-bit impl workaround for compiler
Old gcc compilers can keep track of the 128-bit multiplication and left
shift results' size.
Split all multiplication and left shift results into separate variables.
Add/subtract into the correct variable at end.
Don't want variable declarations after statements so reduce doesn't use
'tr' anymore.
2020-03-24 16:28:14 +10:00
Sean Parkinson
a7d265bf46 Fix casting warning in SP when mp_digit < sp_digit 2020-03-24 12:41:25 +10:00
David Garske
7fabd74a90 Merge pull request #2859 from SparkiDev/tfm_ec_invmod_ct
Constant time EC map to affine for private operations
2020-03-23 19:16:45 -07:00
Jacob Barthelmeh
dde1c3bc08 Fix for clang warning with ARM assembly build 2020-03-23 15:08:28 -06:00
David Garske
5c424769a0 Added DH and Curve/Ed25519. 2020-03-23 09:08:45 -07:00
Hideki Miyazaki
7d4b4e4994 added dtls benchmark 2020-03-22 17:56:28 +09:00
David Garske
a8f2c97e13 Added CSharp example for multi-threaded TLS server. Refactor to separate the ssl and ctx handles. 2020-03-20 16:10:19 -07:00
David Garske
97f08393e2 Added wolfCrypt Xilinx SDK project. Fix for stsafe.h inclusion of ssl.h with WOLFCRYPT_ONLY. 2020-03-20 14:40:17 -07:00
David Garske
2706d6d48a Improve the benchmark to use snprintf then printf. Resolve issue showing results with xil_printf. 2020-03-20 12:34:08 -07:00
David Garske
3127a7e9e5 Fixes for building with bare-metal on Xilinx SDK with zynqmp. Added Zynqmp benchmark timer support. 2020-03-20 12:22:47 -07:00
toddouska
9b8752e314 Merge pull request #2858 from SparkiDev/netscape_cert_ext
Recognise Netscape Certificate Type extension
2020-03-19 16:33:25 -07:00
toddouska
0c3667ba93 Merge pull request #2857 from SparkiDev/sp_null_check
SP fix check for NULL in EC point_new
2020-03-19 16:30:59 -07:00
toddouska
33b95b8ad7 Merge pull request #2854 from JacobBarthelmeh/Certs
add +1 for string null terminator
2020-03-19 16:24:42 -07:00
toddouska
49f01450de Merge pull request #2853 from SparkiDev/dtls_mtu
Allow setting of MTU in DTLS
2020-03-19 16:23:39 -07:00
toddouska
f4a8430115 Merge pull request #2851 from JacobBarthelmeh/SanityChecks
add space for null terminator and check on header pointer
2020-03-19 16:00:57 -07:00
Sean Parkinson
1de07da61f Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign.
2020-03-20 08:59:41 +10:00
Jacob Barthelmeh
ce6aeebdb4 fixes for static analysis checks 2020-03-19 16:34:02 -06:00
Sean Parkinson
62a593e72e Recognise Netscape Certificate Type extension
Checks the bit string is valid but doesn't store or use value.
(Some certificates have this extension as critical)
2020-03-19 12:43:03 +10:00
Sean Parkinson
c776a4219a SP fix check for NULL in EC point_new 2020-03-19 08:56:52 +10:00
David Garske
a28fc5e70b Peer review feedback. Handle socket.Connect() failures. 2020-03-18 13:33:15 -07:00
Jacob Barthelmeh
09dedfbe17 maintenance to PKCS12 create for outputting encrypted bundles 2020-03-18 12:00:57 -06:00
David Garske
00630baa53 Merge pull request #2826 from miyazakh/fix_csharp_dtlsexample
fix dtl server example of CSharp when freeing stuff
2020-03-18 09:26:14 -07:00
Jacob Barthelmeh
2bf39307f1 add +1 for string null terminator 2020-03-18 10:25:56 -06:00
Sean Parkinson
e17e064ce2 Allow setting of MTU in DTLS 2020-03-18 12:36:11 +10:00
toddouska
eb6f44e491 Merge pull request #2847 from tmael/memLeak
Fix memory leak
2020-03-17 13:31:10 -07:00
toddouska
d0767164c8 Merge pull request #2846 from SparkiDev/sp_rsa_priv_fix
Fix SP RSA private op
2020-03-17 13:28:11 -07:00
JacobBarthelmeh
aff80ab0d3 adjust test case for no ECC 2020-03-17 08:56:55 -07:00
JacobBarthelmeh
9fc8c8e0b6 add space for null terminator and check on header pointer 2020-03-16 15:14:29 -07:00
JacobBarthelmeh
74781a3d45 Merge pull request #2829 from cconlon/pkcs7multioctets
PKCS7/CMS EnvelopedData support for fragmented encrypted content
2020-03-16 13:12:23 -06:00
toddouska
321a43edee Merge pull request #2850 from JacobBarthelmeh/SanityChecks
sanity check on IV size
2020-03-16 09:36:17 -07:00
Jacob Barthelmeh
2d950f1ab4 sanity check on IV size 2020-03-15 18:46:11 -06:00
David Garske
00a49dffd0 Add new files to autoconf. 2020-03-13 20:40:18 -07:00
David Garske
6498cb48bc CSharp wrapper improvements. Added TLS client example. Added TLS v1.3 methods. Added set_verify and CTX_set_verify. Added example code for CTX_set_cipher_list. 2020-03-13 14:54:57 -07:00
Tesfa Mael
a6b01904d2 Release mem during failure 2020-03-13 14:22:06 -07:00
toddouska
bcc720ef68 Merge pull request #2773 from SKlimaRA/master
Coverity issues fixes.
2020-03-13 10:20:45 -07:00
toddouska
464631f920 Merge pull request #2841 from JacobBarthelmeh/Certs
add function wolfSSL_X509_NAME_ENTRY_create_by_txt
2020-03-13 10:17:52 -07:00
toddouska
fa4ccbe728 Merge pull request #2844 from JacobBarthelmeh/SanityChecks
set inital state of TLS 1.3 peerSuites structure
2020-03-13 10:16:53 -07:00
Tesfa Mael
452b4c03a6 Fix memory leak 2020-03-12 23:24:44 -07:00
Sean Parkinson
6321eabf86 Fix SP RSA private op
tmpa - tmpb can be less than -p.
Need to conditionally add p twice.
C and multiple platform fix.
2020-03-12 09:33:52 +10:00
Jacob Barthelmeh
0be0cf44e4 fix for returning NULL when text not found and add test case 2020-03-10 09:54:31 -06:00
Stanislav Klima
93326a7aeb Changed dst NULL check. 2020-03-10 09:55:27 +01:00
Jacob Barthelmeh
fb0ad6532f set inital state of TLS 1.3 peerSuites structure 2020-03-09 15:13:01 -06:00
Stanislav Klima
3fcbcbf42a Revert "Logically dead code."
This reverts commit 2db62f744a.
2020-03-09 17:45:15 +01:00
toddouska
87ff2fa47d Merge pull request #2839 from ejohnstown/hmac-init
HMAC Init
2020-03-06 11:05:30 -08:00
toddouska
ab8bfc241d Merge pull request #2833 from JacobBarthelmeh/Compatibility-Layer
compile for NO_WOLFSSL_STUB
2020-03-06 11:04:36 -08:00
Chris Conlon
4ad8a2bacb store wc_PKCS7_DecodeEnvelopedData encryptedContentTotalSz in existing variable instead of adding another 2020-03-06 10:50:00 -07:00
Juliusz Sosinowicz
fe9a876895 Check length to avoid XSTRNCMP accessing memory after list 2020-03-06 17:13:59 +01:00
Jacob Barthelmeh
1035d73a05 add function wolfSSL_X509_NAME_ENTRY_create_by_txt 2020-03-05 16:29:55 -07:00
John Safranek
9fe2ddacf4 HMAC Init
1. wc_HmacSetKey() has a check against the hmac's type that assumes one
has called wc_HmacInit() on the object first. In FIPS Ready builds we
do not have wc_HmacInit() in the boundary. This change removes that check
and action when making a FIPS build. The free called doesn't do anything
in the FIPS build case.
2. Initialize the Hmac's macType to WC_HASH_TYPE_NONE. Check the macType
against that rather than 0. There are some build configs where none isn't
0.
2020-03-05 13:38:02 -08:00
toddouska
a6385a2b48 Merge pull request #2840 from SparkiDev/tls_show_fddhe
Fix to show the FFDHE group when negotiated
2020-03-05 08:33:49 -08:00
toddouska
59b9483cde Merge pull request #2837 from SparkiDev/sp_x64_rsa_priv
Fix SP x64 RSA Private op
2020-03-05 08:33:11 -08:00
toddouska
f24622596f Merge pull request #2827 from kaleb-himes/ZD9976
Fix infinite loop with small sha1 inputs. Thanks to Peter W. on ZD997…
2020-03-05 08:32:14 -08:00
Sean Parkinson
6fcfde0651 Fix to show the FFDHE group when negotiated 2020-03-05 12:37:49 +10:00
toddouska
9f6cf8a154 Merge pull request #2834 from dgarske/various_tls
Fix for TLS server with TLSv1.2 or less `wolfSSL_get_curve_name`
2020-03-04 16:24:28 -08:00
toddouska
9b54af199c Merge pull request #2822 from dgarske/notime_openssl
Fixes for building NO_ASN_TIME with OPENSSL_EXTRA
2020-03-04 16:22:18 -08:00
toddouska
e1215e0e1b Merge pull request #2810 from SparkiDev/tls13_mut_auth
Allow mutual authentication to be required for TLS server side
2020-03-04 16:21:03 -08:00
Sean Parkinson
3707eea2f3 Fix SP x64 RSA Private op
tmpa - tmpb can be less than -p.
Need to conditionally add p twice.
2020-03-04 15:54:17 +10:00
David Garske
fca5895090 Example for FIPS Linker Descriptor to explicitly set wolfCrypt FIPS boundaries. 2020-03-03 15:47:30 -08:00
David Garske
c5b4fe1283 Fix for namedGroup missing. 2020-03-03 15:35:56 -08:00
Jacob Barthelmeh
bb76495233 compile for NO_WOLFSSL_STUB 2020-03-03 14:03:11 -07:00
Chris Conlon
44d2fc55e6 scan-build fixes for wc_PKCS7_DecodeEnvelopedData() 2020-03-03 10:27:22 -07:00
David Garske
730c95cf38 Fix for TLS server incorrectly showing "FFDHE_2048" for "SSL curve name is" when using ECDHE and TLS v1.2 or less. The PickHashSigAlgo should be resetting ssl->namedGroup to indicate a named group was not used. 2020-03-03 09:20:58 -08:00
David Garske
4895fd7b0b Added "either" side functions for SSLv3. These are only enabled with WOLFSSL_EITHER_SIDE and WOLFSSL_ALLOW_SSLV3. ZD 9984. 2020-03-03 09:18:11 -08:00
David Garske
41ff54f873 Fix for typo with wc_ecc_init in documentation. 2020-03-03 09:16:48 -08:00
Chris Conlon
d8eeefb4b7 initialize explicitOctet to 0 in pwc_PKCS7_DecodeEnvelopedData() 2020-03-02 09:13:11 -07:00
John Safranek
127e304901 DTLS Fix
An endpoint's retransmit pool was being reset when receiving its peer's
change cipher spec message. When the finished message was lost, and
retransmits need to happen, they weren't available, so nothing happened.
Moved the reset to the finished case rather than CCS.
2020-03-01 16:43:10 -08:00
Sean Parkinson
8cccb9008b Change to work for other TLS versions
Send alert when client doesn't send a certificate on request.
2020-03-02 08:50:57 +10:00
Sean Parkinson
6334dd9cb0 Allow mutual authentication to be required for TLS 1.3 2020-03-02 08:50:57 +10:00
Chris Conlon
debb792690 fix PKCS7 encrypted content decoding for streaming API usage 2020-02-28 17:55:19 -07:00
David Garske
92114fef75 Fixes for building NO_ASN_TIME with OPENSSL_EXTRA. Fixes #2820.
* `./configure --enable-opensslextra CFLAGS="-DNO_ASN_TIME"`
2020-02-28 09:35:17 -08:00
toddouska
805034bca3 Merge pull request #2830 from SparkiDev/sp_ff_x86_64
Improve performance of RSA/DH ops on x64
2020-02-28 09:03:22 -08:00
toddouska
5b58130210 Merge pull request #2806 from SparkiDev/curve448
Add Curve448, X448, Ed448 implementations
2020-02-28 08:59:08 -08:00
Sean Parkinson
441027a502 Improve performance of RSA/DH ops on x64
Focus on 3072-bit ops but others improved as well.
2020-02-28 10:42:37 +10:00
Sean Parkinson
2c6eb7cb39 Add Curve448, X448, Ed448 implementations 2020-02-28 09:30:45 +10:00
Chris Conlon
d21e370822 add support for PKCS7/CMS EnvelopedData with fragmented encrypted content 2020-02-27 14:42:57 -07:00
toddouska
c7a2510d97 Merge pull request #2823 from SparkiDev/sp_div_fix
Fix for SP x64 div
2020-02-27 12:57:35 -08:00
toddouska
a313b9d2cb Merge pull request #2821 from dgarske/crl_bitmask
Fix for CRL bit-mask enum value issue
2020-02-27 12:54:08 -08:00
toddouska
b7d0b81443 Merge pull request #2818 from dgarske/rsa_sha3only
RSA with SHA-3 only and RSA 4096-bit tests
2020-02-27 12:44:29 -08:00
toddouska
6dabe82c65 Merge pull request #2814 from SparkiDev/curve25519_x64_fix
Curve25519 x64 asm: Fix negate and add fe_sq_n
2020-02-27 12:21:53 -08:00
toddouska
60afebdb86 Merge pull request #2811 from miyazakh/fix_espidf_buildtest_failure
fixed build failure and warnings in ESP-IDF port
2020-02-27 12:21:14 -08:00
toddouska
1288c6b249 Merge pull request #2809 from dgarske/conf_usersettings
Fix to enable inclusion of all .c files when using `--enable-usersettings`
2020-02-27 12:10:07 -08:00
toddouska
ed7a5b17d8 Merge pull request #2808 from dgarske/mdk5
Fix for minor typos in the MDK5 examples
2020-02-27 12:06:50 -08:00
toddouska
3349dbc852 Merge pull request #2807 from dgarske/arg_checks
Added missing argument checks for public API's in `wolfio.c`
2020-02-27 12:03:32 -08:00
toddouska
eddf4abf8e Merge pull request #2775 from embhorn/api_port
openSSL compatibility API for EVP, BIO, and SSL_SESSION
2020-02-27 11:51:21 -08:00
kaleb-himes
d9e221806b Fix infinite loop with small sha1 inputs. Thanks to Peter W. on ZD9976 for the report 2020-02-27 09:39:22 -07:00
Hideki Miyazaki
2d530499e3 fix dtl server example when freeing stuff 2020-02-27 21:56:25 +09:00
Sean Parkinson
f568f394b1 Merge pull request #2824 from julek-wolfssl/EVP-aesgcm
Fix AES-GCM IV length in wolfSSL_EVP_CIPHER_iv_length
2020-02-27 14:06:56 +10:00
Juliusz Sosinowicz
3b822ad3d5 Fix AES-GCM IV length in wolfSSL_EVP_CIPHER_iv_length 2020-02-26 22:11:36 +01:00
Sean Parkinson
2a5d7a2ac3 Fix for SP x64 div
Check the top half of number being divided to see if it is greater than
or equal.
If it is then the first div_word may crash as the result is more than
64-bits. So subtract modulus from the top to keep value small.
2020-02-26 10:53:35 +10:00
Martin Akman
3bbd8be5c9 ATECC: Don't init transport key if not used 2020-02-25 22:03:55 +10:00
David Garske
4b83b88a29 Fix for CRL bit-mask enum value issue. ZD 9948. 2020-02-24 18:52:50 -08:00
Sean Parkinson
969e4dccc5 Merge pull request #2803 from julek-wolfssl/EVP-aesgcm
Evp aesgcm
2020-02-25 08:24:30 +10:00
David Garske
ef2c1ae738 Fix for examples/benchmark/tls_bench.c:114:20: error: unused variable 'kShutdown' with WOLFCRYPT_ONLY. 2020-02-23 19:01:46 -08:00
David Garske
7a3138f841 Merge pull request #2817 from miyazakh/rename_enum_tisp
Rename enumeration definition
2020-02-23 18:40:48 -08:00
David Garske
da882f3912 Added wolfCrypt RSA 4096-bit test support using USE_CERT_BUFFERS_4096 build option (./configure CFLAGS="-DUSE_CERT_BUFFERS_4096"). 2020-02-23 18:40:13 -08:00
David Garske
c8e618a817 Fix build for WOLFSSL_RSA_VERIFY_ONLY. 2020-02-23 15:58:28 -08:00
David Garske
e80c696d5f Fix for RSA with SHA3 only (resolves warning with unsed RsaMGF1. 2020-02-23 13:54:48 -08:00
Hideki Miyazaki
3187624d9e rename common naming enum 2020-02-22 11:35:02 +09:00
David Garske
0f188be892 Merge pull request #2805 from ejohnstown/update-config
configure
2020-02-21 09:35:52 -08:00
Sean Parkinson
c9ce065f8a Curve25519 x64 asm: Fix negate and add fe_sq_n 2020-02-21 11:37:45 +10:00
Sean Parkinson
5716862a8a Merge pull request #2813 from julek-wolfssl/openssh-8.1
Remove redundant wolfSSL_EVP_CIPHER_CTX_iv_length call
2020-02-21 09:52:44 +10:00
Eric Blankenhorn
403c263e0b Fix valgrind issue 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
b74dac6171 Fix WIN test 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
60dea0c53a Fix VS error 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
e4188d935b Fix WIN error 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
b4563e6af3 Fix CFB and OFB 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
61ebfd571c Fix new file error 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
a64e1540ba Adding EVP support for SHA3 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
6eda4e7b46 Fix in test 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
95f973a5be Adding test and dox for ERR_print_errors_cb 2020-02-20 17:28:34 -06:00
Eric Blankenhorn
936312f77e Adding ERR_print_errors_cb 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
a0ddb05a07 change evp with cfb1 expect input size in bytes 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
1a96558b6e Adding macro and XTS support functions 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
922b308029 Fix from review 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
3eee891cf5 fix redefinition warning on older clang compiler 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
51d55ed1c8 account for different peer certificate in test case, g++ build fix, static memory size increase 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
a9accb6c39 add more macro guards for builds 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
b67ade5164 account for cavp build 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
76eec8884b clean up memory after test and don't leak x509 with get session peer 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
258382048d Fix test failures 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
018f313cca Fix clang warning 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
5a87dbe094 Adding tests for EVP_CIPHER_CTX_reset 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
64dcf5740a Fix for AES_XTS 2020-02-20 17:28:33 -06:00
Eric Blankenhorn
e421d9f52c Fix in evp_aes_xts init 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
d7c1b9561f fix for cfb1 mode and add EVP tests 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
d6be24c4f7 add 192/256 key size tests of EVP cfb8 2020-02-20 17:28:33 -06:00
Jacob Barthelmeh
d4428ebc0c add EVP cfb1 test and update some EVP code 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
887eeb3c47 add EVP tests for cfb128 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
9d61ba6c62 initial cfb1/cfb8 support added 2020-02-20 17:28:32 -06:00
Eric Blankenhorn
9c4e0807e2 Adding EVP_aes_###_xts tests (not complete) 2020-02-20 17:28:32 -06:00
Eric Blankenhorn
16ce670897 Revert "Testing aes_*_xts"
This reverts commit 776eeb756c70b052849323d7645622a3f1d2b76a.
2020-02-20 17:28:32 -06:00
Eric Blankenhorn
3197d67e62 Testing aes_*_xts 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
49def96998 add test for get0 session peer certificate 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
653235cd57 add stub implementation for SSL_MODE_AUTO_RETRY 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
b83a5840d6 add stub function for wolfSSL_EVP_mdc2 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
c2c3e0d4aa add initial implementation for wolfSSL_SESSION_get0_peer 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
ab49120652 add aesofb benchmark 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
df0d5f3b08 add EVP_aes_*_ofb implementation and tests, add support for inline with OFB 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
e837894578 add AES-OFB mode 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
65732c2269 add bio retry and set close tests 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
3137312911 update to implementation of BIO_MD type 2020-02-20 17:28:32 -06:00
Eric Blankenhorn
62f20db48e Adding more EVP and SSL API 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh
8f7af875a4 add BIO_f_md and BIO_get_md_ctx tests 2020-02-20 17:28:32 -06:00
Eric Blankenhorn
0abc814792 EVP_MD_CTX_reset and EVP_aes fixes 2020-02-20 17:28:31 -06:00
Eric Blankenhorn
ba25161f6c Adding BIO and EVP api 2020-02-20 17:28:31 -06:00
David Garske
49a9239cf2 Merge pull request #2804 from SparkiDev/sp_cache_resist_fix
Fix cache resist compile to work with SP C code
2020-02-20 15:05:18 -08:00
David Garske
da2980172b Merge pull request #2812 from kaleb-himes/FAILING_FIPS_IN_MASTER
Fix failing FIPS tests in master stemming from PR #2733
2020-02-20 14:29:16 -08:00
Juliusz Sosinowicz
70ef925a48 Remove redundant wolfSSL_EVP_CIPHER_CTX_iv_length call 2020-02-20 18:32:56 +01:00
kaleb-himes
1f003967df Fix failing FIPS tests in master stemming from PR #2733 2020-02-20 09:20:59 -07:00
Stanislav Klima
d4a9279a6c Revert "Resource leak." to resolve the conflict (this fix is unapplicable, because the leaking code was removed).
This reverts commit 451d0a470a.
2020-02-20 15:12:02 +01:00
Hideki Miyazaki
f7018c4765 fixed build failure and warnings
fixed unit test app failure
2020-02-20 18:40:16 +09:00
Sean Parkinson
c62f31cd27 Fix cache resist compile to work with SP C code 2020-02-20 10:10:05 +10:00
David Garske
418c508eba Fixes for SCTP example to check build options. 2020-02-19 12:28:49 -08:00
David Garske
6036f604a6 Added missing argument checks for public API's in wolfio.c. 2020-02-19 12:18:00 -08:00
David Garske
75183262ad Minor typos and fixes to the MDK5 examples. 2020-02-19 12:03:14 -08:00
David Garske
baace2c0e3 Fix to enable inclusion of all .c files when using the --enable-usersettings option. 2020-02-19 11:58:33 -08:00
JacobBarthelmeh
e72b87f372 Merge pull request #2733 from julek-wolfssl/openssh-8.1
Openssh 8.1
2020-02-19 10:14:35 -07:00
Juliusz Sosinowicz
cc597add48 Don't always include wolfssl/openssl/bn.h 2020-02-19 11:17:31 +01:00
John Safranek
9953f2d01d 1. Remove duplicate AM_CONDITIONAL statments from configure.ac.
2. Update copyright year in configure.ac.
2020-02-18 16:16:59 -08:00
JacobBarthelmeh
17c3bb00d8 Merge pull request #2798 from ejohnstown/vxworks-strings
VxWorks Strings
2020-02-18 17:10:31 -07:00
Juliusz Sosinowicz
26e2d6eacf Adressing Todd's comments
Check for HAVE_GETADDRINFO beside WOLF_C99
Move STR_SIZEOF to wolfssl/wolfcrypt/types.h and rename to XSTR_SIZEOF to prevent collision in client projects
Remove wolfssl/openssl/ssl.h and wolfssl/internal.h from crypto layer
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
b736a65fa8 Fix redefinition issue 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
2218f7b95d Fix merge issues 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
d6686f1320 Remove usage of res in wolfSSL_BN_clear_bit 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
5a766bd5bb Change STR_SIZEOF declaration file 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
1512485926 Fix user-rsa tests 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
5c4d3df4f3 Fix broken Windows FIPS build 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
f55cfd7ba7 Fix missing wolfSSL_i2d_RSAPrivateKey references 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
3fcec191a4 Refactor wolfSSL_RSA_To_Der 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
5ed1c233b7 Sean comments 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
dac23dfe15 Add DSA and DH free to wolfSSL_EVP_PKEY_set1_EC_KEY 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
7aaa89aedc Cleanup bn_one in wolfSSL_Cleanup 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
43ce272cb3 Variable declaration at start of scope 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
eedbce7c0a Null-check keyFormat
Zero all of WOLFSSL_DH struct
Fix macros for self-test
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
97a4889bb3 Undo some stuff 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
1df9963b80 sha3.h 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
7ce7017521 Fix memory leaks when compiling with SMALL_STACK 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
f765b711bf More macro preproc stuff 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
48b39a34c7 Properly Init mp_int number 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
b592b241c7 Fix Segfault in wolfSSL_EC_KEY_dup
Fix more header stuff
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
b58f26945d Different configuration fixes 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
480227704d Fix missing stuff in headers 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
59b001c484 Fix header definitions when running CAVP self test 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
50f8fb1475 Enable wc_RsaKeyToDer even when key generation is turned off 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
e6547c75cd Reimplement external data as it was before: a fixed size vector. This makes external data implementation easier as it doesn't require allocation or cleanup. Only zeroing the entire structure that it is in (which happens in all structures anyway) and then calling the appropriate getter and setter functions to manipulate external data. 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
9a0d3ba369 Check boundaries in B64 decode
ERR_get_error will always return a positive error code
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
58c239a49f Fix stuff after rebase 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
d6a160c637 Fix error codes for OpenSSL compatiblity 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
6e72a299d7 Don't undef HAVE_GETADDRINFO as it disables defines in projects using wolfSSL
Change test_wolfssl_EVP_aes_gcm so that changing the tag will fail the authentication check
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
ab56d078a4 keygen-moduli passed
Handle trailing newlines in wolfSSL_BN_hex2bn
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
ae948e2a07 Pass try-ciphers
define EVP_CIPHER_CTX_set_iv as wolfSSL_EVP_CIPHER_CTX_set_iv
add wolfSSL_GetLoggingCb functionality when compiling without enable-debug
fix initialization vector handling of all cipher modes when using our EVP layer. The IV was incorrectly handled in initialization as well as not being updated after processing
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
fbedabe601 OpenSSH changes
- increase FP_MAX_BITS for OpenSSH
- Add helpful loggin API (names are self-explanatory)
-- wolfSSL_GetLoggingCb
-- WOLFSSL_IS_DEBUG_ON
- Define WOLFSSL_EC_METHOD as an alias of WOLFSSL_EC_GROUP
- Add wolfSSL_EC_GROUP_method_of which really just returns the group itself
- Add wolfSSL_EC_METHOD_get_field_type which gets the curve type of the WOLFSSL_EC_GROUP(remember that WOLFSSL_EC_METHOD is an alias of WOLFSSL_EC_GROUP for now)
- Modify Base64_Decode so that it accepts arbitrary PEM line length
- Modify PemToDer so that it accepts private keys with a custom -----BEGIN * PRIVATE KEY----- header
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
84a2ca7a4e Map the Jacobian point back to affine space in wolfSSL_EC_POINT_get_affine_coordinates_GFp 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
aea95232d1 WIP
Add EC_POINT conversion to BIGNUM (EC_POINT_point2bn)
Add setting affine coordinates for EC_POINT (EC_POINT_set_affine_coordinates_GFp)
Add bit clearing for BIGNUM (BN_clear_bit)
Add supporting unit tests in api.c
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
89e35e2547 openssh 8.1 compiles 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
b5c52d7c70 openssh WIP and some light refactoring 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz
41de1bb156 WIP 2020-02-18 21:36:26 +01:00
Juliusz Sosinowicz
b05cfaa601 Add aes-gcm to wolfSSL_EVP_get_cipherbyname and wolfSSL_EVP_get_cipherbynid 2020-02-18 21:34:23 +01:00
Stanislav Klima
6f3623f220 Moved infinite loop check to the other bad func arg check. 2020-02-18 09:59:59 +01:00
Eric Blankenhorn
41d3ba0efa Tests and examples for bidirectional shutdown 2020-02-17 16:47:47 -06:00
Eric Blankenhorn
59fb81c950 Add fix 2020-02-17 16:47:47 -06:00
toddouska
2566986d41 Merge pull request #2632 from SparkiDev/sp_p384
Add support for P384 curve into SP
2020-02-17 11:46:09 -08:00
toddouska
bf1ec3004a Merge pull request #2787 from dgarske/size_reduc
Adds options to disable the hash wrappers and base64 decode
2020-02-17 11:44:37 -08:00
toddouska
651ffe2c12 Merge pull request #2789 from JacobBarthelmeh/SanityChecks
fix return with error on process peer cert
2020-02-17 11:44:02 -08:00
toddouska
f2e1266f2d Merge pull request #2791 from dgarske/async_fixes
Fixes for asynchronous crypto issues
2020-02-17 11:43:13 -08:00
toddouska
14b7355411 Merge pull request #2792 from SparkiDev/rsa_kg_blind_fix
Fix for rsa key gen blinding - don't call lcm
2020-02-17 11:42:25 -08:00
toddouska
44c327ee14 Merge pull request #2795 from SparkiDev/tls13_secret_cb
Call secret callback when TLS 1.3 secrets generated
2020-02-17 11:41:16 -08:00
toddouska
fda322829f Merge pull request #2796 from JacobBarthelmeh/Compatibility-Layer
free existing cert store when setting a new one
2020-02-17 11:37:56 -08:00
Sean Parkinson
8972bf6278 Add support for P384 curve into SP 2020-02-17 15:46:34 +10:00
John Safranek
defa54f40d Merge pull request #2800 from tmael/trim-padding
Trim trailing padding bytes from a key
2020-02-14 16:05:44 -08:00
JacobBarthelmeh
30936e7ad4 Merge pull request #2793 from kaleb-himes/ZD9865
Fix issue in wolfSSL_EVP_PKEY_assign_RSA when RSA key not zeroized
2020-02-14 16:40:52 -07:00
Tesfa Mael
aaaa191937 Trim trailing padding byte 2020-02-14 12:54:35 -08:00
David Garske
8f6a614d17 Merge pull request #2797 from kaleb-himes/JENKINS_STUFF
--disable-supportedcurves --enable-opensslextra - NIGHTLY DISABLE OPT…
2020-02-14 09:01:03 -08:00
Sean Parkinson
614e675a00 Call secret callback when TLS 1.3 secrets generated 2020-02-14 08:42:47 +10:00
Chris Conlon
b62064f6a8 Merge pull request #2737 from JacobBarthelmeh/dks7g2
changes for build with s7g2
2020-02-13 14:07:44 -07:00
toddouska
cabe30828c Merge pull request #2786 from cconlon/android-debug
add Android debug for logcat
2020-02-13 10:12:40 -08:00
toddouska
fba40d14d4 Merge pull request #2785 from ottok/bugfix/menu-js-width
Wrap JavaScript source on multiple lines to make it readable
2020-02-13 10:07:13 -08:00
toddouska
b038e2e8f0 Merge pull request #2771 from JacobBarthelmeh/Windows
change public Timeval to WOLFSSL_TIMEVAL
2020-02-13 09:38:42 -08:00
John Safranek
63a005d71b VxWorks Strings
When building for VxWorks, set HAVE_STRINGS_H as it uses strings.h, not string.h.
2020-02-13 09:08:54 -08:00
kaleb-himes
bb7508f570 --disable-supportedcurves --enable-opensslextra - NIGHTLY DISABLE OPTIONS TEST 2020-02-12 15:57:00 -07:00
Jacob Barthelmeh
8e1adb125c free existing cert store when setting a new one 2020-02-12 15:45:44 -07:00
Jacob Barthelmeh
0814f61b11 fix code formating and turn on HW acc. by default 2020-02-12 10:31:34 -07:00
Stanislav Klima
1b13178182 Fixes possible compile error if NO_PKCS7_STREAM is defined. 2020-02-12 13:46:12 +01:00
Stanislav Klima
1a38c26097 Prevent infinite loop. 2020-02-12 13:29:33 +01:00
Stanislav Klima
109173d756 Fix two resource leaks. 2020-02-12 12:57:40 +01:00
kaleb-himes
5b7fc7b133 Address failure when blinding disabled and key not initialized to zero 2020-02-11 14:39:30 -07:00
David Garske
d1397656ef Merge pull request #2790 from ejohnstown/abi-tweak
ABI Additions
2020-02-10 15:07:35 -08:00
Chris Conlon
61221742b7 Merge pull request #2734 from aaronjense/renesas-ra-port
Renesas RA e2studio projects for Client, Server, Test and Benchmark
2020-02-10 14:49:03 -07:00
Sean Parkinson
669d9b1ae4 Fix for rsa key gen blinding - don't call lcm 2020-02-10 08:51:43 +10:00
David Garske
f322b71526 wolfCrypt fixes for asynchronous (--enable-asynccrypt):
* Fix for ECC and using NULL curve->order (wasn't loaded).
* Fix for typo on heap.
* Fix for QT case where GetInt failure retry did not "init" the mp_int.
2020-02-07 13:34:43 -08:00
Jacob Barthelmeh
3c077a3cef add NO_OLD_TIMEVAL_NAME macro for backwards compatibility 2020-02-07 11:56:30 -07:00
John Safranek
7648997e37 ABI Additions
Added the functions wolfSSL_GetRNG(), wolfSSL_CTX_GetDevId(),
      wc_ecc_import_x963(), and wc_RNG_GenerateBlock() to the ABI
      testing.
2020-02-06 13:33:38 -08:00
Jacob Barthelmeh
17bedbac67 fix return with error on process peer cert 2020-02-06 11:53:42 -07:00
JacobBarthelmeh
61a5fe3108 add macro for trng and gce driver names 2020-02-06 09:20:07 -08:00
JacobBarthelmeh
17cfe2589b Merge pull request #2748 from tmael/fix_cppcheck
Fix cppcheck
2020-02-05 16:02:22 -07:00
Stanislav Klima
da3df4f9c6 Changing logic to remove dead code section. 2020-02-05 19:36:37 +01:00
Stanislav Klima
0964272dc6 Resource leak fix. 2020-02-05 18:28:50 +01:00
David Garske
ba9dc11e62 Adds options to disable the hash wrappers (NO_HASH_WRAPPER) and base64 decode (NO_WOLFSSL_BASE64_DECODE). 2020-02-05 11:58:44 -05:00
Stanislav Klima
bbfefd3cde Sanity check NULL dereference. 2020-02-05 16:59:20 +01:00
JacobBarthelmeh
e75b1b5cb9 add suport for AES acceleration 2020-02-04 16:10:20 -08:00
JacobBarthelmeh
b7d772700a update sha256 support for endian 2020-02-04 16:03:45 -08:00
Chris Conlon
b8b0b7da03 add Android debug for logcat 2020-02-04 10:07:26 -07:00
Tesfa Mael
e664a4f206 Review comments 2020-02-04 08:55:37 -08:00
Tesfa Mael
b67fd249e2 Fix for cppcheck 2020-02-04 08:55:37 -08:00
Chris Conlon
b29fe41a35 Merge pull request #2738 from SparkiDev/cppcheck_fixes_3
Changes to clear issues raised by cppcheck
2020-02-03 17:02:40 -07:00
toddouska
63a73be3f0 Merge pull request #2777 from dgarske/constchar
Fixes for char strings not marked as const.
2020-02-03 11:12:55 -08:00
toddouska
4ee022f788 Merge pull request #2776 from julek-wolfssl/set_curve_groups_list
Add SSL_CTX_set1_groups_list and SSL_set1_groups_list APIs
2020-02-03 11:11:59 -08:00
toddouska
6f2230e459 Merge pull request #2774 from SparkiDev/sp_x86_64_asm
Improve performance of SP Intel 64-bit asm
2020-02-03 11:08:17 -08:00
toddouska
61e78880a5 Merge pull request #2769 from dgarske/zd9791
Fix for `wc_EccPublicKeyDecode` to use the length from ASN sequence
2020-02-03 11:05:17 -08:00
toddouska
c98876d440 Merge pull request #2768 from julek-wolfssl/openvpn-config
Add --enable-openvpn build option
2020-02-03 11:01:06 -08:00
toddouska
0551b1f2de Merge pull request #2765 from SparkiDev/client_read_write
Client using common read and write func
2020-02-03 11:00:15 -08:00
Otto Kekäläinen
967235c1f3 Wrap JavaScript source on multiple lines to make it readable
Closes: wolfSSL/wolfssl#2783
2020-02-03 20:15:18 +02:00
Sean Parkinson
cc2bf03e73 Client using common read and write func 2020-02-03 09:17:27 +10:00
Juliusz Sosinowicz
420e597c16 Move functions to ssl.c 2020-02-01 10:06:53 +01:00
JacobBarthelmeh
6ec136208c add sha256 hardware acceleration 2020-01-31 14:26:04 -08:00
David Garske
d63bdf257d Merge pull request #2337 from MKinclRA/fix-visual-studio-2019-build
Added stdio.h include to types.h.
2020-01-31 12:59:58 -08:00
David Garske
26794e7b5e Merge pull request #2778 from ejohnstown/fix-abi
Fix ABI
2020-01-31 06:49:16 -08:00
Martin Akman
20c0beb9e5 'WOLFSSL_USE_FLASHMEM' to store constant tables in flash memory 2020-01-31 23:43:17 +10:00
Martin Akman
6c1e0ff049 ATECC: Option to disable I2C transport key 2020-01-31 23:32:48 +10:00
Martin Akman
809472febc Added VERY_SMALL_SESSION_CACHE 2020-01-31 23:32:48 +10:00
Martin Akman
14dc5fe2e3 Fixes for 16bit processors 2020-01-31 23:32:48 +10:00
Juliusz Sosinowicz
e13d9f7f1b Add SSL_CTX_set1_groups_list and SSL_set1_groups_list APIs 2020-01-31 06:38:38 +01:00
David Garske
3d233d624c Merge pull request #2770 from JacobBarthelmeh/Testing
fix typo in wolfSSL_sk_X509_EXTENSION_pop_free
2020-01-30 18:55:54 -08:00
JacobBarthelmeh
aa498a7956 Merge pull request #2767 from dgarske/freertos
Fix for evp.c included and FREERTOS realloc
2020-01-30 15:53:05 -07:00
John Safranek
4bc0f79dd9 Fix ABI
Someone removed some of the WOLFSSL_ABI tags from the ssl.h header file. It looks like it was a bad manual merge.
2020-01-30 14:07:27 -08:00
David Garske
928f641064 Fixes for char strings not marked as const. The const is an optimization to allow use from flash, which saves RAM space on embedded devices. 2020-01-30 13:53:06 -08:00
Chris Conlon
0fda8cc3b3 Merge pull request #2756 from dgarske/changelog
Template for ChangeLog.md for next release
2020-01-30 10:47:12 -07:00
David Garske
ba49427cc4 Cleanup include.am whitespace. 2020-01-30 08:44:52 -08:00
David Garske
32f478d335 Better fix for using the ASN.1 provided length, not provided inSz. Confirmed CheckBitString will check case where inSz < ASN.1 length. 2020-01-30 08:38:22 -08:00
toddouska
75e30a33f1 Merge pull request #2764 from SparkiDev/rsa_q_modinv_p
Constant time q modinv p in RSA key gen
2020-01-30 08:08:07 -08:00
David Garske
3df9ca3fae Fix to use TBD version for next release. 2020-01-30 06:26:45 -08:00
David Garske
6cf63b1738 Template for ChangeLog.md for next release. New PR's should update this document if its worth mention in the change log. 2020-01-30 06:26:45 -08:00
David Garske
e5426f85c9 Fix for evp.c when being included directly due to improperly placed WOLFSSL_EVP_INCLUDED. Fix for FREERTOS to expose XREALLOC for normal math. 2020-01-30 06:22:08 -08:00
David Garske
9bfbdfe695 Fix for wc_EccPublicKeyDecode to use the length from ASN sequence, not the provided inSz. Also checked the case where the sequence number is larger than supplied inSz and it will properly return ASN_PARSE_E. ZD 9791 2020-01-30 06:20:29 -08:00
Kaleb Himes
a90cc51a5f Merge pull request #2772 from dgarske/cert_tests
Fixes for build with opensslextra and 3072-bit cert buffers
2020-01-30 06:47:51 -07:00
Sean Parkinson
55ea2facdd Changes to clear issues raised by cppcheck 2020-01-30 14:24:32 +10:00
Sean Parkinson
81bebd8e5c Improve performance of SP Intel 64-bit asm
RSA: Only constant time copy out when doing private key op
Improve performance of sp_count_bits
2020-01-30 12:23:38 +10:00
Stanislav Klima
c938cb35ca Logically dead code. 2020-01-29 17:35:15 +01:00
Stanislav Klima
ed88e8d1c5 Logically dead code. 2020-01-29 17:34:58 +01:00
Stanislav Klima
2db62f744a Logically dead code. 2020-01-29 17:34:40 +01:00
Stanislav Klima
37386f5fb5 NULL dereference. 2020-01-29 17:34:19 +01:00
Stanislav Klima
670ba75ea4 Missing varargs cleanup. 2020-01-29 17:33:59 +01:00
Stanislav Klima
2d36624d84 NULL dereference. 2020-01-29 17:33:38 +01:00
Stanislav Klima
c3fabb1da6 NULL dereference. 2020-01-29 17:33:21 +01:00
Stanislav Klima
df0b0a6e91 NULL dereference. 2020-01-29 17:31:14 +01:00
Stanislav Klima
70cb97c116 NULL dereference. 2020-01-29 17:30:57 +01:00
Stanislav Klima
972790fb86 Resource leak. 2020-01-29 17:30:35 +01:00
Stanislav Klima
451d0a470a Resource leak. 2020-01-29 17:30:14 +01:00
Stanislav Klima
96d1593735 Possible use after free. 2020-01-29 17:29:52 +01:00
Stanislav Klima
77b69ebf56 Logically dead code. 2020-01-29 17:29:23 +01:00
David Garske
e183d95c86 Fix for moved file. 2020-01-29 07:22:07 -08:00
David Garske
5677a96c80 Fixes to resolve openssl_pkey1_test with updated test buffer sizes. 2020-01-29 06:51:47 -08:00
David Garske
5aabebddd8 Fix more 3072-bit cert buffer edge case builds (certext/certgen). 2020-01-29 06:43:35 -08:00
David Garske
3f1c3392e5 Fixes for build with opensslextra and 3072-bit cert buffers. Adds 3072-bit RSA public key der. Eliminates duplicate 3072-bit client cert/key. 2020-01-29 06:37:06 -08:00
Jacob Barthelmeh
a9e9120fa0 change public Timeval to WOLFSSL_TIMEVAL 2020-01-28 17:11:46 -07:00
Jacob Barthelmeh
59af7a8e35 fix typo in wolfSSL_sk_X509_EXTENSION_pop_free 2020-01-28 16:50:54 -07:00
John Safranek
3bdb7d8188 Merge pull request #2761 from JacobBarthelmeh/Testing
add close on pre to echoserver example
2020-01-28 09:29:29 -08:00
Juliusz Sosinowicz
044ad957e5 Add --enable-openvpn build option 2020-01-28 15:29:24 +01:00
David Garske
1ea7755232 Merge pull request #2742 from tmael/dsa_mem_leak
Fix mem leak in DSA
2020-01-28 06:25:58 -08:00
Tesfa Mael
43b7258d3b Review comments 2020-01-27 12:44:16 -08:00
Aaron Jense
91a9117e1b Renesas RA e2studio projects for Client, Server, Test and Benchmark 2020-01-27 13:22:32 -07:00
JacobBarthelmeh
695b126a1c Merge pull request #2739 from dgarske/pkcs8_ed25519
Added PKCS8 support for ED25519
2020-01-24 10:56:40 -08:00
David Garske
b9f39b7c06 Merge pull request #2759 from ejohnstown/config-maint
Deprecate some configure flags
2020-01-24 10:40:19 -08:00
David Garske
126dceee1f Merge pull request #2763 from SparkiDev/sp_int_div_word
Add support to sp_int.c for platforms that do not divide an sp_int_wo…
2020-01-23 18:37:04 -08:00
Sean Parkinson
b4cadae4e2 Constant time q modinv p in RSA key gen 2020-01-23 14:52:29 -08:00
Sean Parkinson
ec877aa91e Add support to sp_int.c for platforms that do not divide an sp_int_word by an sp_int_digit 2020-01-23 14:39:19 -08:00
toddouska
945d34533c Merge pull request #2727 from JacobBarthelmeh/Windows
update to ECC key parsing custom curves for Windows
2020-01-23 13:57:06 -08:00
Chris Conlon
d1e39668aa Merge pull request #2740 from aaronjense/compatibility-fixes
Compatibility Layer Fixes
2020-01-23 08:25:40 -08:00
Chris Conlon
c7340fd90b Merge pull request #2750 from ejohnstown/mingw
mingw update
2020-01-23 08:00:15 -08:00
Chris Conlon
1c56d62753 Merge pull request #2754 from dgarske/crypttest_3072
wolfCrypt Test 3072-bit Support
2020-01-23 07:55:19 -08:00
Jacob Barthelmeh
d9253afc04 add close on pre to echoserver example 2020-01-22 16:23:46 -08:00
John Safranek
f2db85c07c Deprecate some configure flags
1. Add C_EXTRA_FLAGS and C_FLAGS to CFLAGS.
2. Remove the cached copied of C_EXTRA_FLAGS and C_FLAGS.
3. The option.h is set only on CFLAGS, CPPFLAGS, and the AM_ versions.
2020-01-22 14:26:16 -08:00
David Garske
06e3c90073 Merge pull request #2732 from kaleb-himes/ZD9730-spellchecker
Fixing some typos. Thanks to Fossies for the report
2020-01-22 13:52:56 -08:00
David Garske
e3efdc4b5d Merge pull request #2755 from SparkiDev/rsa_enc_3072
Fix masking of 16 bits
2020-01-22 13:40:21 -08:00
Sean Parkinson
55d485cc45 Fix masking of 16 bits 2020-01-22 10:39:36 -08:00
David Garske
b022b651b3 wolfCrypt test fixes for hard coded "256" byte buffers to support 3072-bit RSA. Requires PR #2755 2020-01-22 10:04:53 -08:00
David Garske
84a878bda2 Fix for include .am issue. 2020-01-22 09:11:00 -08:00
David Garske
2a5c623c97 Fix for RSA without SHA512 build error. Fix or renew cert PEM to DER. 2020-01-22 08:15:34 -08:00
David Garske
e3e862c8b6 Test case fixes for sig wrapper test and DH. 2020-01-21 22:25:11 -08:00
David Garske
4d9dbc9ec3 Adds 3072-bit RSA tests using USE_CERT_BUFFERS_3072. 2020-01-21 22:16:54 -08:00
Takashi Kojo
37cad6e9ba %zu, pragma: not supported, 2020-01-22 08:12:51 +09:00
John Safranek
aabdec214e MinGW uses the Win32 setsockopt() function which uses a char for
SO_REUSEADDR's option. Everything else uses an int.
2020-01-21 10:53:19 -08:00
David Garske
2cd3474e9d Improve "keyFormat" to always set based on "algId" and let the later key parsing code produce failure. 2020-01-20 20:49:55 -08:00
David Garske
0489cc97a8 Fix for ProcessBuffer with PEM private keys, where PemToDer call was only setting eccKey. Cleanup to use "keyFormat" OID sum. 2020-01-20 20:49:55 -08:00
David Garske
de8e5ffd6e Cleanup asn.c use of WOLFSSL_LOCAL (only required in the header). 2020-01-20 20:49:55 -08:00
David Garske
77426e78e1 Added test case for PKCS8 ED25519 encrypted private key. 2020-01-20 20:47:47 -08:00
David Garske
40c8562dc2 Added PKCS8 support for ED25519. 2020-01-20 20:47:47 -08:00
David Garske
7707234901 Merge pull request #2743 from JacobBarthelmeh/Compatibility-Layer
adjust set1 curves list function for TLS extension sent
2020-01-20 16:19:55 -08:00
David Garske
98f14eff9f Refactor to combine duplicate ECC param parsing code. 2020-01-20 16:17:12 -08:00
John Safranek
23427085af 1. Add an indent to a new line in user settings.
2. Remove the execute bit from the changed files.
2020-01-20 12:30:32 -08:00
Takashi Kojo
a08ab1fc7a fix mnGW error 2020-01-20 12:19:18 -08:00
Jacob Barthelmeh
c581c56999 update return value of local GetCurveByOID 2020-01-20 10:40:56 -07:00
Jacob Barthelmeh
3508579f4c add check on NETX duo build and return value of opening driver 2020-01-20 09:33:14 -07:00
John Safranek
a624ae14df Merge pull request #2725 from kaleb-himes/ZD9735
Remove redundant packing flag
2020-01-18 21:21:32 -08:00
toddouska
66daac4c94 Merge pull request #2709 from JacobBarthelmeh/Testing
set chacha20 similar to aes-ctr when handling leftover stream and add…
2020-01-17 15:05:24 -08:00
Jacob Barthelmeh
356636e88d fix typo 2020-01-17 15:13:52 -07:00
JacobBarthelmeh
87859f9e81 Merge pull request #2747 from dgarske/sizeof_long
Improvements for detection of 64-bit support
2020-01-17 15:10:44 -07:00
toddouska
204ef9543a Merge pull request #2728 from ejohnstown/maint-x509
Maintenance: X509
2020-01-17 13:51:02 -08:00
toddouska
92877a1214 Merge pull request #2730 from SparkiDev/sp_div_word_fix
Fix for div_word builds of SP C code
2020-01-17 13:15:44 -08:00
toddouska
60afa72330 Merge pull request #2731 from SparkiDev/auth_key_id_set
Fix when extAuthKeyIdSet is set.
2020-01-17 13:14:22 -08:00
toddouska
cca545f76c Merge pull request #2735 from dgarske/ecc_sign
Fixes for ECC sign with `WOLFSSL_ECDSA_SET_K`
2020-01-17 13:13:38 -08:00
toddouska
dadcce3eb8 Merge pull request #2741 from SparkiDev/ecc_no_cache
Fix for ecc and no cache resistance - set M[2]
2020-01-17 13:09:53 -08:00
Jacob Barthelmeh
c5932a9874 account for leantls and selftest builds 2020-01-17 13:32:59 -07:00
kaleb-himes
9760ed07a9 Based on peer feedback, remove WOLFSSL_PACK from sniffer.h 2020-01-17 12:27:46 -07:00
Jacob Barthelmeh
bd4a9c69dd convert name to oidsum to curve type for setting supported curves 2020-01-17 11:56:46 -07:00
Jacob Barthelmeh
d8c5353466 adjust set1 curves list function for TLS extension sent 2020-01-16 13:21:14 -07:00
David Garske
c38d5e9a29 Further improved to use HAVE_LIMITS_H and ULL instead of ui64 2020-01-16 09:06:44 -08:00
David Garske
541bf3e639 Improvements for detection of 64-bit support. Adds support for IBM s390x. Improves detection on Windows. Adds new WC_USE_LIMITS_FOR_SIZEOF option to use limits.h to detect sizeof long. Fixes #2600 and Fixes #2745. 2020-01-16 07:15:18 -08:00
Tesfa Mael
fbf91f7397 Fix mem leak in DSA 2020-01-15 16:03:42 -08:00
Sean Parkinson
584d8498f8 Fix for ecc and no cache resistance - set M[2]
Need to have a value in order to maintain timing resistance.
Small maths fails also.
2020-01-16 09:35:34 +10:00
Aaron Jense
3db7b44be4 Compatibility Layer Fixes 2020-01-15 13:49:47 -07:00
Jacob Barthelmeh
bd44091111 refactor solution 2020-01-15 09:29:10 -07:00
JacobBarthelmeh
c01cd808da changes for build with s7g2
add project info

add project info

adjust wolfssl library template

change TRNG collection

fix include.am

fix argument for TRNG

rename example templates

comment out DEBUG_WOLFSSL

change include.am

update license
2020-01-14 17:48:41 -07:00
David Garske
989f3d3684 Fix for FREE_VAR call on sharedA. 2020-01-14 14:35:20 -08:00
David Garske
e429dd8f0b Peer review feedback minor cleanup. 2020-01-14 14:33:23 -08:00
David Garske
e9bbf89287 Fix for WOLFSSL_ECDSA_SET_K with normal math. The sign_k mp_int was not initialized. 2020-01-14 14:13:12 -08:00
David Garske
95b6076fe1 Fixes for ECC sign with WOLFSSL_ECDSA_SET_K, which was not loading all curve params for the wc_ecc_make_pub_ex call and not correctly setting ALLOC_CURVE_SPECS for WOLFSSL_SMALL_STACK. Cleanup around the loading of curve specs. 2020-01-13 16:25:37 -08:00
David Garske
22f49d8597 Fixes for building with ECC sign/verify only. 2020-01-13 15:35:08 -08:00
David Garske
8974827fbe Added WOLFSSL_ECC_CURVE_STATIC build option to allow using fixed arrays for ECC parameters. This is enabled by default on Windows. Fixed several compiler warnings. Fixed build macro for key->deallocSet. 2020-01-13 07:15:17 -08:00
John Safranek
c69bd5169f Switch strncpy to memcpy in the altname store function. 2020-01-10 20:34:14 -08:00
John Safranek
8d1b20706c Maintenance: X509
1. Add a test for the new alt name handling.
2. Added an API to set altnames in a WOLFSSL_X509 struct. Just adds
DNS_entries.
3. Removed the "static" from a bunch of constant byte arrays used inside
some of the ASN.1 code.
2020-01-10 20:26:35 -08:00
John Safranek
5dcffa6b40 Maintenance: X509
1. Fix for issue #2724. When making a certificate out of an X.509
structure, the subject alt names weren't getting correctly copied.
2. Added a function to flatten the DNS_entries into a sequence of
GeneralNames.
3. Put the proper certificate extension wrapping around the flattened
general names.
2020-01-10 20:26:35 -08:00
John Safranek
7571fbdbfb Maintenance: X509
1. Fix for issue #2718. Added a flag to the X509 structure when someone
sets the issuer name.
2. When making a certificate out of the X509, if the issuer name is set
clear the self-signed flag in the cert.
3. Propigate the flat X509_NAMEs to the string the cert building code
uses.
2020-01-10 20:25:43 -08:00
JacobBarthelmeh
6b4551c012 Merge pull request #2654 from cariepointer/qt-512-513
Add Qt 5.12 and 5.13 support
2020-01-10 17:34:23 -07:00
John Safranek
71f8f3031d Merge pull request #2729 from dgarske/telit_time
Fixes for the Telit time functions
2020-01-10 14:51:39 -08:00
David Garske
1f104e52a3 Merge pull request #2715 from ejohnstown/maint-dtls
Maintentance: DTLS
2020-01-10 14:43:15 -08:00
kaleb-himes
9b8d4e91c2 Fixing some typos. Thanks to Fossies for the report 2020-01-10 11:45:51 -07:00
Carie Pointer
544ff3f9ac Fix length in wolfSSL_sk_CIPHER_description 2020-01-10 11:26:57 -07:00
Jacob Barthelmeh
99d657af4f adjust test cases 2020-01-10 10:31:56 -07:00
Chris Conlon
26a075cfec Merge pull request #2716 from cariepointer/apache-fixes
Fixes for Apache nightly Jenkins tests
2020-01-10 10:20:43 -07:00
Carie Pointer
ef99086aee Fix valgrind errors 2020-01-10 10:08:39 -07:00
Carie Pointer
de3536a067 More fixes from review 2020-01-09 17:28:20 -07:00
Jacob Barthelmeh
0c25588ad1 adjust TEST_SMALL_CHACHA_CHUNKS size and add more tests 2020-01-09 17:13:57 -07:00
Jacob Barthelmeh
1538e631a8 revert size of ChaCha structure and delay counter increment 2020-01-09 16:39:48 -07:00
Jacob Barthelmeh
a1944c477a set chacha20 counter in TLS AEAD use 2020-01-09 16:39:48 -07:00
Jacob Barthelmeh
8e24bf6c2c add macro guard for optimized versions 2020-01-09 16:39:48 -07:00
JacobBarthelmeh
0ec7b311d8 set chacha20 similar to aes-ctr when handling leftover stream and add test case 2020-01-09 16:39:48 -07:00
cariepointer
a9cf16cc2b Merge branch 'master' into apache-fixes 2020-01-09 16:33:35 -07:00
Sean Parkinson
6e8f3faedd Fix when extAuthKeyIdSet is set.
Was set when extension is seen - extension may not have hash.
But is used to indicate that the hash is set - ie look up by hash.
2020-01-10 09:28:45 +10:00
Sean Parkinson
03c42423eb Fix for div_word builds of SP C code 2020-01-10 09:02:26 +10:00
toddouska
f3b2815e1f Merge pull request #2708 from julek-wolfssl/nginx-fix
Nginx fix
2020-01-09 15:00:59 -08:00
toddouska
3c9f7809f1 Merge pull request #2714 from JacobBarthelmeh/Docs
update linux sgx readme for wolfssl/options.h creation
2020-01-09 14:58:22 -08:00
toddouska
51f44cb09b Merge pull request #2719 from dgarske/nxp_k64_mmcau
Fixes for NXP K64
2020-01-09 14:57:11 -08:00
toddouska
21f82a5662 Merge pull request #2721 from SparkiDev/sp_small_stack_fixes
Fix in SP C impl for small stack
2020-01-09 14:55:44 -08:00
toddouska
99045a2fea Merge pull request #2723 from SparkiDev/rsa_vfy_only_fix
Rsa vfy only fix
2020-01-09 14:55:10 -08:00
toddouska
3ea69676eb Merge pull request #2726 from ejohnstown/maint-ren
Maintenance: Secure Renegotiation
2020-01-09 14:54:13 -08:00
toddouska
11a0b117f8 Merge pull request #2706 from dgarske/chapoly_aead_iuf
New API's for ChaCha20/Poly1305 AEAD init/update/final
2020-01-09 14:49:26 -08:00
Carie Pointer
0938cdde52 Remove dup->dynamicName = 1 call 2020-01-09 14:09:38 -08:00
Carie Pointer
47040f1dae EC_KEY_dup fixes 2020-01-09 14:35:57 -07:00
David Garske
8fb586f3ee Fixes for the Telit time functions. ZD 9733 2020-01-09 11:17:19 -08:00
Jacob Barthelmeh
41f134ae31 update to ECC key parsing custom curves for Windows 2020-01-08 14:45:59 -07:00
John Safranek
1f0f3eb97d Maintenance: Secure Renegotiation
Allow sending application data during the secure renegotiation.
2020-01-08 11:50:18 -08:00
Carie Pointer
b9c99709f7 Fixes from review 2020-01-08 12:48:01 -07:00
kaleb-himes
187702efb9 bring sniffer.h inline with types.h 2020-01-08 09:45:59 -07:00
David Garske
bc1cb4ead8 Fix to keep existing behavior where AAD is optional for wc_ChaCha20Poly1305_Encrypt and wc_ChaCha20Poly1305_Decrypt. 2020-01-07 18:58:26 -08:00
Carie Pointer
f13cee2689 Add comments above functions 2020-01-07 17:30:25 -07:00
Sean Parkinson
b27ec58d20 Fix RSA verify only build 2020-01-08 10:18:37 +10:00
Carie Pointer
28cf563c76 Fixes from PR review: styling and formatting, remove duplicate code 2020-01-07 17:01:53 -07:00
Sean Parkinson
89d8a90781 Get code compiling with SP math and RSA key gen again. 2020-01-08 09:51:26 +10:00
Sean Parkinson
1f1a173d56 Fix in SP C impl for small stack
Memset correct size and only when pointer is not NULL.
2020-01-08 08:57:20 +10:00
toddouska
d257003341 Merge pull request #2711 from cconlon/copyright2020
update copyright to 2020
2020-01-07 08:40:15 -08:00
toddouska
190623cbb2 Merge pull request #2705 from dgarske/atecc_leak
Fix for possible ECC memory leak when using ATECC and TLS
2020-01-07 08:39:39 -08:00
toddouska
709d17904a Merge pull request #2693 from SparkiDev/mp_rand
Improve speed of mp_rand
2020-01-07 08:39:11 -08:00
Carie Pointer
9e4836a863 Fix for jenkins test failure 2020-01-07 08:11:05 -08:00
toddouska
b7ac709617 Merge pull request #2692 from SparkiDev/rsa_gen_modinv
Add blinding of mod inverse to RSA key gen
2020-01-07 07:56:38 -08:00
David Garske
56e57f3216 Refactor Poly1305 AEAD / MAC to reduce duplicate code. Tested with TLS v1.3 interop and AEAD test vectors. 2020-01-07 07:04:01 -08:00
David Garske
0f0d307b76 Fix to avoid duplicate symbol for CheckRunTimeSettings when SP and TFM are built. Specifically with these build options: USE_FAST_MATH, WOLFSSL_SP and WOLFSSL_SP_MATH. 2020-01-07 05:43:59 -08:00
David Garske
acfe9717f8 Fix for K64 MMCAU with WOLFSSL_SMALL_STACK_CACHE. Moved random test prior to cipher tests (was getting called first time in GMAC test). 2020-01-07 05:39:17 -08:00
David Garske
914cd00e40 Merge pull request #2717 from SparkiDev/sp_cortexm_r7
Don't use r7 with Cortex-M SP assembly
2020-01-07 05:28:43 -08:00
Juliusz Sosinowicz
e0ab92058b Check CRL extension errors but don't require them 2020-01-07 11:55:07 +01:00
Sean Parkinson
34a462b342 Don't use r7 with Cortex-M SP assembly
r7 not available when compiling Cortex-M4 in debug.
2020-01-07 12:53:34 +10:00
David Garske
d68d5229e1 Refactor wc_ChaCha20Poly1305_Encrypt and wc_ChaCha20Poly1305_Decrypt to use the new ChaChaPoly_Aead context and init/update/final functions. 2020-01-06 17:07:09 -08:00
Carie Pointer
681ecf0e58 Fixes for wolfSSL_CTX_load_verify_locations_ex 2020-01-06 14:32:32 -08:00
Carie Pointer
991ee662c0 Return 0 in ParseCRL_Extensions if there are no CRL extensions to parse 2020-01-06 08:42:37 -08:00
Jacob Barthelmeh
f593ff8776 update linux sgx readme for wolfssl/options.h creation 2020-01-06 09:27:17 -07:00
JacobBarthelmeh
ce0475a8e0 Merge pull request #2689 from tmael/pkey_freeMutex
Free EVP ctx pkey
2020-01-06 23:15:00 +07:00
Sean Parkinson
75637445ee Improve speed of mp_rand 2020-01-06 09:39:29 +10:00
Carie Pointer
26eea36d7f Fix X509_NAME issues for Apache 2020-01-03 15:40:52 -08:00
Chris Conlon
45c5a2d39c update copyright to 2020 2020-01-03 15:06:03 -08:00
Juliusz Sosinowicz
443b7ed0c4 Accept newline and null teminator at end of X509 certificate 2020-01-02 10:52:02 +01:00
David Garske
01c7cc6502 Fixes to avoid declaring any variables mid-function and always initializing. 2019-12-31 11:43:13 -08:00
David Garske
784d95afbe Improved state handling. 2019-12-31 10:34:06 -08:00
David Garske
7d2adb2fc0 Merge pull request #2707 from tmael/rsa_cc310
Cryptocell RSA improvements to sign/verify more digest types
2019-12-31 09:19:25 -08:00
David Garske
bff6dcec24 Added support for AAD calc only. Allows Init, UpdateAad and Final sequence. Verfied again with customer test cases. 2019-12-31 08:25:23 -08:00
David Garske
f01999b322 Peer review feedback. 2019-12-31 08:08:33 -08:00
David Garske
b901a2cd35 Use byte for bit-field. Line length cleanup. 2019-12-30 18:05:25 -08:00
toddouska
4f71bcfa7c Merge pull request #2704 from ejohnstown/renegotiation
Maintenance: Renegotiation
2019-12-30 16:45:31 -08:00
Tesfa Mael
f58a9e81e9 Cryptocell rsa improvements to sign/verify more digest types 2019-12-30 16:31:30 -08:00
David Garske
1ee9d182cf New API's for ChaCha20/Poly1305 AEAD init/update/final:
* Provides a context for AEAD to allow "chunked" updates of data then a final calculation for the authentication tag.
* New API's are on by default and can be disabled using NO_CHACHAPOLY_AEAD_IUF.
2019-12-30 15:20:55 -08:00
toddouska
abc96f20fb Merge pull request #2696 from embhorn/cert_vfy_CB
CertManager verify callback
2019-12-30 11:57:44 -08:00
Juliusz Sosinowicz
1bf6eb466f CRL extensions are optional so ext errors should be skipped 2019-12-30 19:08:59 +01:00
Tesfa Mael
4004963c6a test pkey references count 2019-12-30 09:31:23 -08:00
David Garske
f51d940e34 Fix for ECC memory leak when using ATECC and non SECP256R1 curves for sign, verify or shared secret. Fixes #2701. 2019-12-30 08:35:30 -08:00
toddouska
3b7b71c9e0 Merge pull request #2700 from JacobBarthelmeh/HardwareAcc
Hardware calls for DSP use
2019-12-27 13:58:43 -08:00
toddouska
deac82c8ed Merge pull request #2683 from dgarske/various_items
Various cleanups and fixes
2019-12-27 13:53:39 -08:00
toddouska
95daec5326 Merge pull request #2633 from tmael/cc_310
Update Cryptocell readme
2019-12-27 12:58:19 -08:00
toddouska
78fa84be00 Merge pull request #2649 from SparkiDev/rsa_pubonly
Fix RSA public key only builds
2019-12-27 12:55:34 -08:00
toddouska
dd28f26c44 Merge pull request #2699 from JacobBarthelmeh/Testing
big endian changes
2019-12-27 12:52:30 -08:00
Juliusz Sosinowicz
38f466bdfe Keep untrustedDepth = 0 for self signed certs 2019-12-27 17:48:34 +01:00
John Safranek
add7cdd4e2 Maintenance: Renegotiation
1. Found a corner case where secure renegotiation would fail trying to
inappropriately use a session ticket.
2. Explicitly split renegotiation into Rehandshake and SecureResume.
2019-12-26 16:39:44 -08:00
David Garske
e8afcbf031 Merge pull request #2702 from embhorn/spelling
Correct misspellings and typos from codespell tool
2019-12-26 08:19:20 -08:00
Eric Blankenhorn
8580bd9937 CertManager verify callback
Execute verify callback from wolfSSL_CertManagerLoadCA
2019-12-26 09:29:03 -06:00
JacobBarthelmeh
ac0acb3c37 fix for test case with big endian 2019-12-26 05:57:26 -07:00
Eric Blankenhorn
b83804cb9d Correct misspellings and typos from codespell tool 2019-12-24 12:29:33 -06:00
JacobBarthelmeh
ad9011a863 initial DSP build and success with Debug mode
build dps with ARM neon 64

fix for release mode build

add in threading protection and seperate out rng

added callback function and updates to README

update default handle to lock, and add finished handle call

cleanup after veiwing diff of changes
2019-12-23 14:17:58 -07:00
JacobBarthelmeh
5348ecb1f2 initial makefile and build with hexagon 2019-12-23 13:49:06 -07:00
JacobBarthelmeh
ca59bc2d16 big endian changes 2019-12-23 12:33:59 -07:00
Tesfa Mael
99a7aff31e Increment pkey references count 2019-12-20 22:38:54 -08:00
Tesfa Mael
48e59eaeb1 Free EVP ctx pkey 2019-12-20 22:38:54 -08:00
toddouska
3f13b49fa3 Merge pull request #2695 from JacobBarthelmeh/Release
prepare for release v4.3.0
2019-12-20 11:10:34 -08:00
Jacob Barthelmeh
e1433867ce fix for expected nightly config test report 2019-12-20 09:46:12 -07:00
Jacob Barthelmeh
5675a2b3c5 prepare for release v4.3.0 2019-12-20 08:43:34 -07:00
Sean Parkinson
9d94b48056 Add blinding of mod inverse to RSA key gen 2019-12-20 12:17:42 +10:00
toddouska
45d55c8f38 Merge pull request #2676 from SparkiDev/sp_cortexm_perf
Improve Cortex-M RSA/DH assembly code performance
2019-12-19 15:03:59 -08:00
John Safranek
6c7e86f366 Maintentance: DTLS
1. Client wasn't skipping a handshake state when the server sends a
hello without a hello verify. It ended up resetting the handshake hash
and resending Hello with its next messages.
2019-12-19 11:48:05 -08:00
toddouska
51f956490f Merge pull request #2661 from SparkiDev/parse_cert_rel_fixes
Cleanup ParseCertRelative code
2019-12-19 11:03:56 -08:00
toddouska
3342a19e29 Merge pull request #2578 from cariepointer/ZD-9478-and-9479
Add sanity checks for parameters in wc_scrypt and wc_Arc4SetKey
2019-12-19 10:59:05 -08:00
David Garske
2aa8fa2de6 Merge pull request #2688 from kaleb-himes/GH2552
use const to declare array rather than variable sz - VS doesn't like …
2019-12-19 08:52:30 -08:00
JacobBarthelmeh
e10ace21df Merge pull request #2690 from SparkiDev/sp_int_fixes_1
Fix SP to build for different configurations
2019-12-19 08:52:52 -07:00
Sean Parkinson
36f697c93d Fix SP to build for different configurations
Was failing:
  --enable-sp --enable-sp-math
  --enable-sp --enable-sp-math --enable-smallstack
2019-12-19 15:15:19 +10:00
kaleb-himes
95c0c1f2a5 use const to declare array rather than variable sz - VS doesn't like this 2019-12-18 16:08:26 -08:00
Sean Parkinson
64a1045dc3 Cleanup ParseCertRelative code
Fix for case:
- can't find a signer for a certificate with the AKID
- find it by name
Has to error as the signer's SKID is always set for signer and would
have matched the AKID.
Simplify the path length code - don't look up CA twice.
Don't require the tsip_encRsaKeyIdx field in DecodedCert when
!WOLFSSL_RENESAS_TSIP - use local variable.
2019-12-19 08:53:24 +10:00
toddouska
6922d7031c Merge pull request #2685 from embhorn/coverity_fixes
Coverity fixes
2019-12-18 14:06:48 -08:00
toddouska
531fedfbb4 Merge pull request #2687 from ejohnstown/dtls-cap
DTLS Handshake Message Cap
2019-12-18 13:50:52 -08:00
David Garske
031e78e103 Merge pull request #2606 from kaleb-himes/DOCS_UPDATE_19_NOV_2019
Add dox documentation for wc_ecc_make_key_ex
2019-12-18 13:49:57 -08:00
toddouska
0057eb16f8 Merge pull request #2686 from ejohnstown/crl-skid
Check name hash after matching AKID for CRL
2019-12-18 13:48:59 -08:00
toddouska
573d045437 Merge pull request #2682 from SparkiDev/akid_name_check
Check name hash after matching AKID
2019-12-18 13:08:19 -08:00
David Garske
c054293926 Merge pull request #2684 from JacobBarthelmeh/build-tests
fix for g++ build warning
2019-12-18 12:09:29 -08:00
Eric Blankenhorn
52893877d7 Fixes from review 2019-12-18 13:25:25 -06:00
John Safranek
6c6d72e4d6 Find CRL Signer By AuthKeyId
When looking up the signer of the CRL by SKID/AKID, also verify that the
CRL issuer name matches the CA's subject name, per RFC 5280 section 4.1.2.6.
2019-12-18 10:17:51 -08:00
kaleb-himes
2607cf3429 Fix up based on peer feedback 2019-12-18 10:55:20 -07:00
toddouska
5a04ee0d8b Merge pull request #2640 from dgarske/alt_chain
Fixes for Alternate chain processing
2019-12-18 09:38:45 -08:00
toddouska
b89121236f Merge pull request #2635 from dgarske/async_date
Fix for async date check issue
2019-12-18 09:34:08 -08:00
toddouska
74a8fbcff4 Merge pull request #2666 from SparkiDev/b64_dec_fix
Bade64_Decode - check out length (malformed input)
2019-12-18 09:30:41 -08:00
toddouska
c2e5991b50 Merge pull request #2681 from ejohnstown/crl-skid
Find CRL Signer By AuthKeyId
2019-12-18 09:29:17 -08:00
Jacob Barthelmeh
b5f645ea00 fix for g++ build warning 2019-12-18 10:01:52 -07:00
David Garske
22f0b145d3 Various cleanups and fixes:
* Fix for key gen macro name in benchmark.c
* Fix for possible RSA fall-through warning.
* Fix for building `WOLFSSL_STM32_PKA` without `HAVE_ECC`.
* Added option to build RSA keygen without the DER to PEM using `WOLFSSL_NO_DER_TO_PEM`.
* Added options.h includes for test.c and benchmark.c.
* Added printf warning on the math size mismatch in test.c.
* Added support for benchmarking larger sizes.
* TLS benchmarks for HiFive unleashed.
2019-12-18 07:09:26 -08:00
David Garske
b126802c36 Clarify logic for skipping call to AddCA. 2019-12-18 06:04:26 -08:00
Sean Parkinson
c1218a541b Check name hash after matching AKID
RFC 5280, Section 4.1.2.6:
If the subject is a CA (e.g., the basic constraints extension, as
discussed in Section 4.2.1.9, is present and the value of cA is TRUE),
then the subject field MUST be populated with a non-empty distinguished
name matching the contents of the issuer field (Section 4.1.2.4) in all
certificates issued by the subject CA.

The subject name must match - even when the AKID matches.
2019-12-18 17:57:48 +10:00
Sean Parkinson
6ccd146b49 Bade64_Decode - check out length (malformed input) 2019-12-18 17:06:58 +10:00
Tesfa Mael
69a0c1155f Review comment 2019-12-17 17:36:38 -08:00
John Safranek
ef6938d2bc DTLS Handshake Message CAP
Cap the incoming DTLS handshake messages size the same way we do for
TLS. If handshake messages claim to be larger than the largest allowed
certificate message, we error out.
2019-12-17 16:55:58 -08:00
toddouska
7e74d02da5 Merge pull request #2677 from SparkiDev/p12_pbkdf_tmp_fix
PKCS#12 PBKDF - maximum tmp buffer size
2019-12-17 16:48:08 -08:00
toddouska
ff026efe49 Merge pull request #2670 from SparkiDev/dec_pol_oid_fix
DecodePolicyOID - check out index
2019-12-17 16:47:36 -08:00
toddouska
892e951c8a Merge pull request #2669 from SparkiDev/name_joi_fix
Decode X.509 name - check input length for jurisdiction
2019-12-17 16:46:30 -08:00
toddouska
435d4bf427 Merge pull request #2658 from SparkiDev/asn_date_check
Check ASN date characters are valid
2019-12-17 16:39:35 -08:00
toddouska
f81ce71c25 Merge pull request #2660 from JacobBarthelmeh/Compatibility-Layer
add --disable-errorqueue option
2019-12-17 16:37:02 -08:00
toddouska
06563ed3fa Merge pull request #2642 from SparkiDev/sp_exptmod
sp_int: support for more values in sp_exptmod
2019-12-17 16:36:12 -08:00
John Safranek
037c319bab Find CRL Signer By AuthKeyId
1. Add parsing of CRL extensions, specifically the Auth Key ID extension.
2. To verify CRL, search for CA signer by AuthKeyId first, then by name.  If NO_SKID is set, just use name.
3. Update the ctaocrypt settings.h for the NO_SKID option with CRL so FIPS builds work.
2019-12-17 15:33:39 -08:00
toddouska
feeb18600f Merge pull request #2636 from SparkiDev/mp_exptmod_fixes
Handle more values in fp_exptmod
2019-12-17 15:22:24 -08:00
toddouska
138377f30e Merge pull request #2641 from SparkiDev/sp_c32_lshift
Fix lshift in SP 32-bit C code - FFDHE
2019-12-17 15:17:17 -08:00
toddouska
5ee9f9c7a2 Merge pull request #2637 from SparkiDev/ecc_cache_resist
Improve wc_ecc_mulmod_ex cache attack resistance
2019-12-17 15:16:16 -08:00
toddouska
028d9e5443 Merge pull request #2634 from SparkiDev/pkcs7_libz_fix
Fix missing variable declaration
2019-12-17 15:13:13 -08:00
David Garske
a176789f13 Fix for async issue with "badDate" and "criticalExt" check getting skipped on call to ConfirmSignature with WC_PENDING_E response. Added log message when date failure is skipped. 2019-12-17 15:03:00 -08:00
toddouska
06e5e81b1b Merge pull request #2663 from embhorn/zd5050
Clarify wolfSSL_shutdown error on subsequent calls
2019-12-17 14:59:35 -08:00
Carie Pointer
5711d12364 Remove SSL_library_init() calls in unit tests to fix valgrind issues 2019-12-17 15:54:10 -07:00
Eric Blankenhorn
774a758f59 Fixes in test and example code 2019-12-17 15:56:40 -06:00
toddouska
ab14a26be0 Merge pull request #2650 from dgarske/boot_tpm
Fix API visibility for ED25519 check key
2019-12-17 13:45:39 -08:00
Carie Pointer
cfd91fb0b8 Add check for length == 0 in wc_Arc4SetKey 2019-12-17 13:28:50 -07:00
David Garske
e8594daab6 Merge pull request #2678 from tmael/night_valgrind
Fix memory leak detected with Valgrind
2019-12-17 09:11:30 -08:00
Tesfa Mael
88188b79e2 Fix mem leak 2019-12-16 18:03:11 -08:00
Sean Parkinson
8d7d2c74ee PKCS#12 PBKDF - maximum tmp buffer size
Use WC_MAX_BLOCK_SIZE - only an issue if PBKDF is using SHA-3
algorithms.
2019-12-17 09:56:08 +10:00
Sean Parkinson
a71eb11b38 Improve Cortex-M RSA/DH assembly code performance
Performance of modular exponentiation improved by about 30%.
2019-12-17 09:03:34 +10:00
David Garske
8d8ab655fa Merge pull request #2671 from ejohnstown/maint-conf
Maintenance: Configure
2019-12-16 13:38:02 -08:00
Chris Conlon
c0716b9e3f Merge pull request #2673 from Naruto/feature/fix_readme_miss
fix spell miss of zephyr README.md
2019-12-16 12:31:55 -07:00
Eric Blankenhorn
af5c98a6a8 Fixes in wolfCrypt test 2019-12-16 10:22:42 -06:00
Naruto TAKAHASHI
7fbadeaa17 fix spell miss of zephyr README.md 2019-12-16 21:36:43 +09:00
Eric Blankenhorn
0bb8ae8564 Fixes for new defects in wolfCryot and wolfSSL (excluding test code) 2019-12-13 17:17:13 -06:00
David Garske
f2115b2c2b Merge pull request #2652 from ejohnstown/maintenance-error
Maintenance: Error Strings
2019-12-13 15:03:32 -08:00
John Safranek
0348123261 Maintenance: Configure
1. Remove some redundant AM_CONDITIONAL macros checking for OCSP and CRL.
2. Moved the AM_CONDITIONAL macro setting BUILD_PKCS12 to the other AM_CONDITIONALS.
2019-12-13 15:02:03 -08:00
Chris Conlon
1a594d92ba Merge pull request #2668 from ejohnstown/maintenance-scanbuild
Fixed a couple initialization issues scan-build indicated
2019-12-13 14:13:48 -07:00
Sean Parkinson
6a2975c742 DecodePolicyOID - check out index 2019-12-13 12:13:38 +10:00
Sean Parkinson
b3cbab4bf3 Decode X.509 name - check input length for jurisdiction 2019-12-13 11:55:15 +10:00
John Safranek
e7af2d2ba9 Fixed a couple initialization issues scan-build indicated. 2019-12-12 16:50:37 -08:00
John Safranek
a3cc2aa6ff Merge pull request #2665 from kaleb-himes/ZD-9590-CCM-Benchmarking
Add CCM Decryption to benchmarking
2019-12-12 16:48:12 -08:00
Sean Parkinson
e063fb1631 sp_int.c: Strip leading zeros in sp_read_radix 2019-12-13 09:08:55 +10:00
kaleb-himes
0a38d7c178 Add CCM Decryption to benchmarking 2019-12-12 13:53:30 -07:00
Eric Blankenhorn
51d5abd63f Clarify wolfSSL_shutdown error on subsequent calls 2019-12-12 13:16:52 -06:00
Sean Parkinson
adc14f7552 sp_int: Check size of numbers for overflow 2019-12-12 18:36:23 +10:00
Jacob Barthelmeh
2e5258fe15 add --disable-errorqueue option 2019-12-11 11:19:58 -07:00
Sean Parkinson
dffb59ea52 sp_int: support for more values in sp_exptmod and fix
SP C - fix mont reduce with fast mul_add
2019-12-11 11:10:18 +10:00
toddouska
093a31ed49 Merge pull request #2655 from kaleb-himes/ZD-9592
Remove forcing NO_SKID on unsuspecting CRL users
2019-12-10 16:33:16 -08:00
Carie Pointer
c66ca1b774 Remove unused dNSName malloc from wolfSSL_X509_get_ext_d2i 2019-12-10 17:00:16 -07:00
Sean Parkinson
05dafd0adb Check ASN date characters are valid 2019-12-11 09:22:26 +10:00
John Safranek
74e54393ab Remove a bitfield indicator from a structure member that didn't require it. 2019-12-10 13:17:30 -08:00
Carie Pointer
b08d180bc9 WOLFSSL_DH redefined error fix 2019-12-09 16:13:18 -07:00
Carie Pointer
4511557f01 More jenkins test fixes 2019-12-09 15:57:53 -07:00
kaleb-himes
2b66a9f1ec Address reviewed items 2019-12-09 14:44:59 -07:00
Carie Pointer
9ad970d8a4 Fixes for jenkins test failures 2019-12-09 14:04:52 -07:00
kaleb-himes
e8c7d6f818 Account for ASN disabled 2019-12-07 05:06:41 -07:00
kaleb-himes
bbdf0d101f Improve Decoded CRL initialization 2019-12-07 04:23:02 -07:00
kaleb-himes
072fe8fd6d More complete fix for removing NO_SKID condition as default with CRL enabled 2019-12-07 03:39:57 -07:00
tmael
8450c4ae39 Merge pull request #2643 from ejohnstown/maintenance-prime
Maintentance: Prime
2019-12-06 18:50:51 -08:00
JacobBarthelmeh
05e672428d Merge pull request #2645 from cconlon/cmsrsacb
CMS SignedData RSA sign callback for raw digest
2019-12-06 17:13:32 -07:00
Carie Pointer
ee13dfd878 Add Qt 5.12 and 5.13 support
Co-Authored-By: aaronjense <aaron@wolfssl.com>
Co-Authored-By: MJSPollard <mpollard@wolfssl.com>
Co-Authored-By: Quinn Miller <quinnmiller1997@users.noreply.github.com>
Co-Authored-By: Tim Parrish <timparrish@users.noreply.github.com>
2019-12-06 14:27:01 -07:00
Chris Conlon
6081bdaad6 free PKCS7 before creating new in API test 2019-12-06 12:00:33 -07:00
John Safranek
19a4371d48 Maintenance: Error Strings
1. One of the error string was >80 bytes long. Shortened it.
2. The function that copies an error string to an output array needs to
ensure the string is still null terminated.
3. Added a check to the wolfCrypt test to see that error strings aren't
>= 80 bytes long.
2019-12-06 09:53:39 -08:00
Chris Conlon
b4f67dabcf Merge pull request #2647 from kojo1/SN-size
EXTERNAL_SERIAL_SIZE to build option
2019-12-06 09:13:07 -07:00
David Garske
b28f6aeb34 Work to support wolfBoot with wolfTPM. Fix missing visibility marker for wc_ed25519_check_key. 2019-12-06 06:53:23 -08:00
Sean Parkinson
2528121925 Fix RSA public key only builds
Client side only and no client auth
2019-12-06 20:42:27 +10:00
Takashi Kojo
87ec950221 Rollback the define in internal.h 2019-12-06 10:31:28 +09:00
toddouska
9fd5628148 Merge pull request #2631 from SparkiDev/mp_invmod_fix
mp_invmod handles more inputs
2019-12-05 16:21:33 -08:00
toddouska
7e391f0fd5 Merge pull request #2629 from SparkiDev/dsa_blinding
Blinding for DSA sign
2019-12-05 16:20:21 -08:00
toddouska
4b31a180c8 Merge pull request #2626 from SparkiDev/sp_invmod_fixes
Fix sp_invmod to handle more input values
2019-12-05 16:18:55 -08:00
toddouska
8cc4c62c14 Merge pull request #2625 from SparkiDev/set_ser_num_2
Support 20-byte serial numbers and disallow 0.
2019-12-05 16:17:54 -08:00
toddouska
bd8a612d6c Merge pull request #2624 from ejohnstown/maintenance-ASN1
Maintenance: ASN.1
2019-12-05 16:16:42 -08:00
toddouska
7ec448ac0c Merge pull request #2617 from embhorn/zd9553
Fix for vasprintf with AIX
2019-12-05 16:15:24 -08:00
toddouska
7631fdafa1 Merge pull request #2612 from SparkiDev/sp_div_small_a
sp_div improved to handle when a has less digits than d
2019-12-05 16:14:05 -08:00
toddouska
6d40c20f2c Merge pull request #2609 from JacobBarthelmeh/Compatibility-Layer
Fix for EVP CipherUpdate decrypt and add test case
2019-12-05 16:12:26 -08:00
toddouska
312d5c98b3 Merge pull request #2535 from julek-wolfssl/nginx-1.15
Nginx 1.15.0 & 1.16.1
2019-12-05 14:40:45 -08:00
toddouska
a13ebf5258 Merge pull request #2543 from embhorn/zd5706
Update DoVerifyCallback to check verify param hostName and ipasc
2019-12-05 14:38:47 -08:00
Takashi Kojo
d74a1888bb move it to build option 2019-12-06 06:28:25 +09:00
John Safranek
2c0fda4168 Maintentance: Prime
1. Revisited the option enables around the wolfCrypt prime test. Added a
check for key generation to the check for public MP.
2019-12-05 12:23:42 -08:00
Tesfa Mael
4f8a37ef7b Remove wc_RsaSSL_VerifyInline from Cryptocell 2019-12-05 10:40:21 -08:00
Chris Conlon
be97444d24 add api test for wc_PKCS7_SetRsaSignRawDigestCb() 2019-12-05 10:33:49 -07:00
Chris Conlon
2063fa502f add CMS RSA sign callback for raw digest 2019-12-05 10:33:49 -07:00
Sean Parkinson
0552fbc5de Fix lshift in SP 32-bit C code - FFDHE 2019-12-05 09:08:30 +10:00
David Garske
9b437384de Allow AddCA for root CA's over the wire that do not have the extended key usage cert_sign set. 2019-12-04 14:14:37 -08:00
David Garske
b01c558adb Fix to not send alert until after the verify cert callback and alternate chain logic has been evaluated. 2019-12-04 12:41:23 -08:00
David Garske
acd4bc3305 Added logging for SendAlert call. 2019-12-04 11:02:22 -08:00
John Safranek
44fc3e14b1 Maintenance: ASN.1
1. Fix some preprocessor flag checking for function EncodePolicyOID. It
also needs to be available for OpenSSL Compatibility.
2. Fix for a name string for a test that can get left in or out
incorrectly.
2019-12-04 10:26:37 -08:00
David Garske
3646051434 Fix for alternate chain logic where presented peer's CA could be marked as trusted.
When building with `WOLFSSL_ALT_CERT_CHAINS` a peer's presented CA could be incorrectly added to the certificate manager, marking it as trusted.

Began in PR #1934
ZD 9626
2019-12-04 06:56:36 -08:00
Sean Parkinson
2a0c037f98 Improve wc_ecc_mulmod_ex cache attack resistance 2019-12-04 11:08:28 +10:00
Sean Parkinson
c5f9a601e8 Handle more values in mp_exptmod
Handle prime (modulus) of 0 and 1.
Handle exponent of 0.
Fix for base of 0 in fp_exptmod and hadnle base of 0 in mp_exptmod.
fp_exptmod - Don't modify X's sign during operation when passed in as negative.
2019-12-04 09:32:08 +10:00
Sean Parkinson
fd4fb28a2e Fix missing variable declaration
--enable-scep --with-libz
PKCS#7 decompress code
2019-12-03 11:07:29 +10:00
Sean Parkinson
b9a82204e2 Blinding for DSA sign 2019-12-03 09:36:33 +10:00
Tesfa Mael
889f111454 Update CC readme 2019-12-02 14:55:21 -08:00
David Garske
7e45ae2ec6 Merge pull request #2621 from JacobBarthelmeh/SanityChecks
sanity check on "a" input to invmod
2019-12-02 10:57:01 -08:00
Jacob Barthelmeh
2efa91632e revert adding import check in configure.ac 2019-12-02 08:56:00 -07:00
David Garske
bfaa970d84 Merge pull request #2628 from tmael/nightly_valgrind
Fix Valgrind Known Configs Test
2019-11-29 08:59:58 -08:00
Sean Parkinson
204045223f Fix sp_invmod to handle more input values 2019-11-29 11:54:36 +10:00
Sean Parkinson
bd7a572a8f mp_invmod handles more inputs
Value to invert: a
Modulus: b
integer.c - normal math
  - a is one, or a mod b is one
tfm.c - fast math
  - b is -ve (error), or b is zero
  - a is zero or a mod b is zero
2019-11-29 09:08:44 +10:00
David Garske
f0c070b2cf Merge pull request #2630 from SparkiDev/poly1305_avx2_fix
Poly1305 AVX2 asm fix
2019-11-28 09:28:22 -08:00
Sean Parkinson
06ca07c79f Poly1305 AVX2 asm fix
Missed carry when converting from 26 in 64 bits to 64 in 64 bits.
2019-11-28 16:01:29 +10:00
Sean Parkinson
16ac0d8eb6 Support 20-byte serial numbers and disallow 0. 2019-11-28 10:21:48 +10:00
Sean Parkinson
245a2b7012 sp_int: clamp more results 2019-11-28 10:01:54 +10:00
Sean Parkinson
dadbeff433 sp_int: When setting digit of 0, set used to 0 2019-11-28 10:01:54 +10:00
Sean Parkinson
2ac0ac8776 Fix for sp_div when a > d but same bit length 2019-11-28 10:01:54 +10:00
Sean Parkinson
8315ae892f sp_div improved to handle when a has less digits than d 2019-11-28 10:01:54 +10:00
toddouska
b396ed0984 Merge pull request #2627 from SparkiDev/rsa_sign_vfy
Change signature generation to verify by default
2019-11-27 14:08:07 -08:00
toddouska
e1ebb39296 Merge pull request #2618 from ejohnstown/maintenance-prime
Maintenance: Prime
2019-11-27 14:06:23 -08:00
toddouska
ff85cc7740 Merge pull request #2622 from SparkiDev/ber_to_der_rework
Rework BER to DER to not be recursive
2019-11-27 14:05:36 -08:00
Eric Blankenhorn
1026c4359d Cast XMALLOC 2019-11-27 14:47:48 -06:00
Tesfa Mael
acdfc514b3 Use memset initialize 2019-11-27 11:09:57 -08:00
John Safranek
cc722468be Maintenance: ASN.1
1. Add an additional check in GetCertHeader() to see that sigIndex is
bounded by maxIdx.
2019-11-27 10:43:51 -08:00
Eric Blankenhorn
806db8096c Replace use of vasprintf 2019-11-27 11:00:28 -06:00
Juliusz Sosinowicz
b06cee333c Add error on EOF 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
29a8262ea4 Only test X509_NAME_print_ex when defines enabled 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
0f4a002f4f Formatting 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
9be1b4cfd8 Remove tabs 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
944d5e1045 Don't count null char in better way 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
7c1a1dfd1f Variable declaration at start of scope 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
308c5f3370 Fix implicit cast 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
5f39e12b21 Fix leak in SSL_CTX_set0_chain 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
8dde06bbca Fix compile errors 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
dd07344499 SSL_SESSION_dup 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
3c9d191a5b Don't propogate ASN_NO_PEM_HEADER from wolfSSL_load_client_CA_file 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
1962159d89 more NGINX defines 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
b71758895e Add support for SSL_CTX_set0_chain 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
b7913116c0 Remove redeclaration 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
9fbc167d0c Declare at start of scope 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
d9ab0c4bcb Check bounds 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
ea5ac675ed WIP 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz
f0abd4ea82 WIP 2019-11-27 17:45:49 +01:00
Juliusz Sosinowicz
9064de1e75 Set proper WOLFSSL_ASN1_TIME in thisupd and nextupd in wolfSSL_OCSP_resp_find_status 2019-11-27 17:45:49 +01:00
Juliusz Sosinowicz
31c0abd610 wolfSSL_X509_NAME_print_ex should not put the null terminator in the BIO 2019-11-27 17:45:49 +01:00
Juliusz Sosinowicz
de3c11d55c opensslall required 2019-11-27 17:45:49 +01:00
Juliusz Sosinowicz
a892f2a95a Changes for nginx 1.15
- ssl.c: add to check to overwrite existing session ID if found
- evp.c: wolfSSL_EVP_DecryptFinal* was checking for wrong value
2019-11-27 17:45:49 +01:00
Tesfa Mael
2e487a2463 Init uninitialised values 2019-11-27 07:46:33 -08:00
Sean Parkinson
23878512c6 Change signature generation to verify by default 2019-11-27 10:47:03 +10:00
Sean Parkinson
776f4af7f6 Rework BER to DER to not be recursive 2019-11-27 10:20:32 +10:00
toddouska
1b63ab0e73 Merge pull request #2623 from SparkiDev/set_ser_rand
Generating serial number - clear top bit
2019-11-26 16:14:54 -08:00
John Safranek
2de52c7666 Maintenance: Prime
When returning a result from mp_prime_is_prime for normal math, the
result should be MP_YES or MP_NO, not a bare number (1 or 0).
2019-11-26 15:44:30 -08:00
toddouska
7cb5fe5e2a Merge pull request #2620 from tmael/ALPN_input
Fix alpn buffer overrun
2019-11-26 15:31:56 -08:00
toddouska
57df5c10c9 Merge pull request #2619 from dgarske/async_mem
Fix for Intel QuickAssist asynchronous build
2019-11-26 15:29:04 -08:00
toddouska
0d69950d07 Merge pull request #2615 from SparkiDev/mp_exptmod_neg_p
Handle negative modulus with negative exponent in exptmod
2019-11-26 15:20:54 -08:00
toddouska
95c9dc9fe8 Merge pull request #2614 from ejohnstown/maintenance-OCSP
Maintenance: OCSP
2019-11-26 15:19:27 -08:00
toddouska
9b7cd6bdfd Merge pull request #2613 from tmael/evp_aes_gcm
Set default IV length for EVP aes gcm
2019-11-26 15:18:27 -08:00
toddouska
5d41ef171c Merge pull request #2610 from ejohnstown/maintenance-DTLS
Maintenance: DTLS
2019-11-26 15:17:22 -08:00
toddouska
9ecafa7afe Merge pull request #2557 from tmael/cert_store_ls_x509
Retrieve a stack of X509 certs
2019-11-26 15:16:09 -08:00
John Safranek
55540c6bd3 Replace a compile option check around some filenames for certificate testing. 2019-11-25 16:13:01 -08:00
John Safranek
1ac0b1fc0b Maintenance: ASN.1
1. Undo an earlier change with respect to parsing a long length with
length zero. If BerToDer is disabled, this will be treated as a zero
length. With BerToDer enabled, the conversion will do the right thing.
2019-11-25 16:08:32 -08:00
John Safranek
5e0ca866df Maintenance: ASN.1
1. For certificates, when copying a member of a container, one shouldn't read
beyond the enclosing context.
2019-11-25 16:08:32 -08:00
John Safranek
d389133f33 Maintenance: ASN.1
1. Update the ParseCRL function to always obey the length value of a tag.
2019-11-25 16:08:31 -08:00
John Safranek
9753bf627b Maintenance: ASN.1
1. Remove the function Word32ToString and replace with calls to
XSNPRINTF().
2. Simplify DecodePolicyOID(), which converts an ASN.1 OID to a text
string in the form a.b.ccccc.d... Return an error if it gets too long.
2019-11-25 16:08:26 -08:00
Jacob Barthelmeh
7c3a4a1975 update comment to reflect new sanity check 2019-11-25 10:57:09 -07:00
Jacob Barthelmeh
316b8b0b4d add early return to normal math and WOLFSSL_VALIDATE_ECC_IMPORT to enable-all and enable-fpecc builds 2019-11-25 10:47:08 -07:00
Sean Parkinson
6325269236 Generating serial number - clear top bit
If the top bit is set then the encoding routine will drop a byte of the
serial number.
Better to ensure number is positive, top bit clear, and use as much of
the serial number data as possible.
2019-11-25 15:36:11 +10:00
Jacob Barthelmeh
9a0a48e093 sanity check on "a" input to invmod 2019-11-22 15:47:05 -07:00
Tesfa Mael
8bc3b7df35 Free x509 2019-11-22 14:31:59 -08:00
Eric Blankenhorn
dc25b79db6 Fix from review 2019-11-22 15:10:13 -06:00
John Safranek
3432a8a1fc Maintenance: Prime
1. Prime test should return NO for 1. (ex function, normal math and fast
math)
2. Call mp_init() on the k value for the primality test case in the
wolfCrypt test.
2019-11-22 13:02:59 -08:00
John Safranek
481da3dcc1 Maintenance: Prime
1. Added a test case for checking "1" as a prime number to the wolfCrypt
test.
2. Allow the wolfCrypt prime test for SP builds.
3. Modify the prime test to use mp_mul rather than mp_mul_d, as the SP
math library doesn't export sp_mul_d.
2019-11-22 11:39:19 -08:00
Tesfa Mael
cf127ec05f Fix buffer overrun 2019-11-22 10:33:17 -08:00
David Garske
be88bce36d Fix for issues with wolfSSL_OBJ_nid2sn and wc_OBJ_sn2nid and logic finding max item when WOLFSSL_CUSTOM_CURVES and ECC_CACHE_CURVE are defined. Improvements to wolfSSL_EC_get_builtin_curves to avoid using "min" as variable name and eliminate using a local static. 2019-11-22 10:09:10 -08:00
John Safranek
0a924af894 Maintenance: Prime
1. Prime test should return NO for 1. (sp math)
2019-11-22 10:01:21 -08:00
David Garske
ffb3dfd6ec Fixes for minor test.c build configuration issues. 2019-11-22 07:01:10 -08:00
David Garske
cdc50d7753 Revert header change in #2504 for asynchronous crypto quickassist_mem.h. 2019-11-22 05:59:57 -08:00
Sean Parkinson
50c4347748 More corner cases in tfm
Handle zero base in fp_exptmod better().
Handle negatives in fp_gcd().
Return FP_OKAY when writing out 0 with mp_toradix().
2019-11-22 09:56:02 +10:00
John Safranek
71943844d6 Maintenance: OCSP
1. Add a couple more bounds checks to wolfIO_HttpProcessResponseBuf().
2019-11-21 14:51:35 -08:00
John Safranek
452ba5b502 Maintenance: Prime
1. Prime test should return NO for 1. (normal math and fast math)
2019-11-21 13:49:26 -08:00
Eric Blankenhorn
b57294eff7 Fix for vasprintf with AIX 2019-11-21 12:23:15 -06:00
John Safranek
edb07cf68e Merge pull request #2587 from guidovranken/ocsp-resp-decoder-bounds-fix
Properly limit array access in OCSP response decoder
2019-11-21 10:13:49 -08:00
Tesfa Mael
428d51e664 IV is set in the evp ctx level 2019-11-21 09:58:03 -08:00
toddouska
e883a2f696 Merge pull request #2611 from SparkiDev/sp_int_add_fix
Fix sp_add to handle carries properly
2019-11-21 08:59:09 -08:00
Sean Parkinson
f56a74b6b7 Handle negative modulus with negative exponent in exptmod 2019-11-21 14:55:13 +10:00
John Safranek
6720bc3890 Maintenance: OCSP
1. Add some minimum bounds checking on the HTTP responses as some can
end up being too short.
2019-11-20 17:25:03 -08:00
Tesfa Mael
f95d5eebff Add FreeX509() to clean up when sk stack is empty 2019-11-20 17:02:13 -08:00
Tesfa Mael
6c732725b0 Test evp aes gcm with default IV length 2019-11-20 16:37:15 -08:00
toddouska
b33ce2207d Merge pull request #2608 from SparkiDev/use_heap
When disabled memory, ensure all heap and types are used
2019-11-20 16:18:07 -08:00
toddouska
a2d036dcba Merge pull request #2601 from SparkiDev/certs_exts_fix
ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly
2019-11-20 16:17:28 -08:00
Sean Parkinson
a20db0b8ad Fix sp_add to handle carries properly 2019-11-21 09:47:17 +10:00
John Safranek
ce0136e968 Maintenance: Integers
In TFM and Integer, rshb() shouldn't try to shift a value that is 0.
This leads to using a negative offset to a pointer, but isn't used.
2019-11-20 13:55:57 -08:00
Jacob Barthelmeh
6f98d5d348 remove extra parentheses that clang complained about 2019-11-20 14:49:47 -07:00
John Safranek
71690fc73a Maintenance: DTLS
1. Updated the window scrolling. There was a couple off-by-one errors in
the DTLS window handling. They canceled each other out, but there was a
rare case where they would shift too much.
2019-11-20 13:46:23 -08:00
John Safranek
188eb45433 Maintenance: DTLS
Removed redundant sequence increment when sending the Server Hello message.
2019-11-20 13:08:01 -08:00
Jacob Barthelmeh
1eb1755f07 add another evp decrypt test case 2019-11-20 12:29:22 -07:00
Jacob Barthelmeh
9880ad6926 updates to EVP_CipherUpdate for handling storage of last block 2019-11-20 11:57:06 -07:00
John Safranek
19d8ef405c Maintenance: DTLS
When encrypting with AES-GCM, AES-CCM, or PolyChacha, do not increment
the DTLS sequence number. The sequence number should only be incremented
in BuildMessage. This was done because the sequence number used to be
incremented after calculating the HMAC or after the encrypt for AEAD
ciphers. The HMAC has been separated from the sequence increment.
2019-11-20 10:56:56 -08:00
Takashi Kojo
4896a48955 fix EVP_CipherUpdate padding 2019-11-20 11:49:30 -07:00
toddouska
88fb7efb8c Merge pull request #2602 from SparkiDev/certs_exts_free
ProcessPeerCerts jump to error handling instead of returning
2019-11-20 09:25:48 -08:00
toddouska
2a7fb69523 Merge pull request #2604 from SparkiDev/disabled_curve_fix
TLS supported curve extension - validate support fix
2019-11-20 09:17:50 -08:00
toddouska
ccc8a49fcb Merge pull request #2607 from SparkiDev/tls13_serverhello_cs
TLS 1.3 client detects non-TLS 1.3 cipher suite in ServerHello
2019-11-20 09:16:16 -08:00
toddouska
d5a1adab5d Merge pull request #2605 from SparkiDev/set_ser_num
Added output size to SetSerialNumber
2019-11-20 09:15:36 -08:00
toddouska
1ba366920c Merge pull request #2581 from SparkiDev/ecc_fixes_add
Add deterministic ECDSA sig gen. Fix corner cases for add point.
2019-11-20 09:12:28 -08:00
Tesfa Mael
f1fbabbb60 Use default 96-bits IV length when unset 2019-11-20 09:09:12 -08:00
Sean Parkinson
d441cee6fb When disabled memory, ensure all heap and types are used 2019-11-20 17:06:42 +10:00
Sean Parkinson
917e5b0405 TLS 1.3 client detects non-TLS 1.3 cipher suite in ServerHello 2019-11-20 12:22:00 +10:00
Sean Parkinson
13c6346158 Check error returns from mp calls 2019-11-20 11:09:50 +10:00
Sean Parkinson
79b35860e0 Added output size to SetSerialNumber
Some internal calls were passing in output size as max number size.
2019-11-20 10:52:48 +10:00
kaleb-himes
ad3e105303 Add dox documentation for wc_ecc_make_key_ex 2019-11-19 17:06:52 -07:00
Sean Parkinson
c7f7d1b193 TLS supported curve extension - validate support fix
Check curve name is in range before checking for disabled
2019-11-20 09:38:06 +10:00
Tesfa Mael
62eaa27b41 Review comment, avoid double-free 2019-11-19 15:29:48 -08:00
toddouska
1a3455110e Merge pull request #2599 from dgarske/cleanup_script
Useful script to cleanup test files created
2019-11-19 11:59:50 -08:00
toddouska
5c4da3e6fa Merge pull request #2598 from dgarske/max_file_sz
Improvements to file size checks
2019-11-19 11:59:21 -08:00
toddouska
5de27443d0 Merge pull request #2596 from dgarske/mqx_fio_cleanup
Support for MQX 5.0 and cleanup of the MQX includes
2019-11-19 11:49:03 -08:00
David Garske
7b160a8cf3 Make MAX_WOLFSSL_FILE_SIZE overridable. 2019-11-19 07:46:50 -08:00
David Garske
9a4614f6e1 Fix for possible uninitialized memSz in bio.c 2019-11-19 05:35:22 -08:00
David Garske
e7bff37421 Add settings.h build macro note. 2019-11-19 05:33:59 -08:00
Sean Parkinson
1b8f136d29 ProcessPeerCerts jump to error handling instead of returning 2019-11-19 13:17:29 +10:00
Sean Parkinson
f08dfb4afc ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly 2019-11-19 13:03:20 +10:00
toddouska
e6292eca9c Merge pull request #2597 from ejohnstown/octeon-global
Sync OCTEON Sniffer
2019-11-18 17:06:30 -08:00
toddouska
c6dac64438 Merge pull request #2594 from ejohnstown/maintenance-BLAKE2
Maintenance BLAKE2
2019-11-18 17:05:01 -08:00
John Safranek
fea1f1d6e5 Maintenance: ASN.1
1. Reject as an error any ASN.1 length value that is multibyte of length 0.
2019-11-18 17:02:19 -08:00
toddouska
7a5c8f4e07 Merge pull request #2584 from SparkiDev/sp_rsa4096
SP now has support for RSA/DH 4096-bit operations
2019-11-18 15:38:47 -08:00
toddouska
b646b7258b Merge pull request #2585 from dgarske/webrtc_m79
Support for Google WebRTC (ref m79)
2019-11-18 15:33:49 -08:00
toddouska
20c82f3c4b Merge pull request #2586 from dgarske/STM32_HW
STM32 Crypto hardware fixes and improvements
2019-11-18 15:22:19 -08:00
toddouska
90f7a96721 Merge pull request #2593 from ejohnstown/maintenance-DH
Maintenance: DH
2019-11-18 15:18:16 -08:00
toddouska
12dfe027ed Merge pull request #2595 from dgarske/hmac_devid
Adds PBKDF2 and Hash wrapper heap ctx and crypto callback support
2019-11-18 15:16:19 -08:00
Tesfa Mael
74dd142a51 Review comment 2019-11-18 15:13:59 -08:00
David Garske
abee442c1e Useful script to cleanup test files created. 2019-11-18 15:08:54 -08:00
toddouska
6ffd931db1 Merge pull request #2564 from SparkiDev/tlsext_list_fix
Modify linked list traversal - fix for compiler bug
2019-11-18 15:04:26 -08:00
John Safranek
a1e33e7ec9 Maintenance: OCSP
1. Check array index bounds before using them in arrays.
2. When processing an HTTP buffer, check that the new buffer size is
valid before allocating a new one.
2019-11-18 14:15:55 -08:00
David Garske
48d0b53074 Fix for wolfSSL_cmp_peer_cert_to_file compiler warning with size_t vs long. 2019-11-18 14:01:16 -08:00
David Garske
ca5549ae91 Improvements for XFTELL return code and MAX_WOLFSSL_FILE_SIZE checking.
Fixes #2527
2019-11-18 13:49:06 -08:00
John Safranek
8347d00bf2 Maintenance BLAKE2
1. Remove the BLAKE2 HMAC from wolfSSL and its testing.
2019-11-18 13:31:15 -08:00
David Garske
1542482cd5 Cleanup of the MQX file headers for STDIO. Cleanup of fio.h and nio.h includes to use wc_port.h. ZD 9453. 2019-11-18 12:14:34 -08:00
David Garske
b780982aa4 Adds "devId" crypto device and "heap" context for Hash wrappers and PBKDF
* Adds new hash wrapper init `wc_HashInit_ex`.
* Adds new PBKDF2 API `wc_PBKDF2_ex`.
ZD 9494 (using PBKDF2)
2019-11-18 11:26:56 -08:00
John Safranek
14c986360d Maintenance BLAKE2
1. Remove BLAKE2 support from HMAC.
2. Update doxy header for HMAC with removal of BLAKE2 and addition of SHA-3.
2019-11-18 10:45:30 -08:00
David Garske
cb9f16d3cb Fix for proper sizing of in-memory buffer for TLS benchmarking (32 is not always the max digest size). 2019-11-18 10:34:15 -08:00
David Garske
12d2d17d18 Minor cleanups to TLS bench tool configuration. 2019-11-18 10:29:50 -08:00
David Garske
95b83272dd Implementation for SSL_CTX_add1_chain_cert. 2019-11-18 10:19:48 -08:00
JacobBarthelmeh
c9f7741dfb Merge pull request #2567 from aaronjense/scan-build-fix
Scan-Build Fixes for PKCS7 and PKCS12
2019-11-18 10:21:14 -07:00
toddouska
ea04dbede1 Merge pull request #2583 from ejohnstown/rng-ebsnet
RNG-EBSNET
2019-11-18 09:15:30 -08:00
David Garske
7e17904c54 Fix for AES GCM Decrypt auth tag. ZD 9507 2019-11-18 06:46:50 -08:00
David Garske
b676c69561 Fix for DES mutex return code. Fix TLS bench thread shutdown. README.md updates. 2019-11-18 06:46:20 -08:00
Tesfa Mael
520a032b71 Add show x509 test 2019-11-15 13:23:08 -08:00
Tesfa Mael
6ca12787ae retrieve a stack of X509 certs in a cert manager and a store ctx 2019-11-15 13:23:08 -08:00
David Garske
7819fedca7 Update for OpenSTM32 project. Adds TLS benchmarking tool, which test client/server for each cipher suite. 2019-11-15 12:10:09 -08:00
David Garske
0c2c4fd91b Improvements to tls_bench tool in wolfSSL lib for embedded use. 2019-11-15 12:09:19 -08:00
David Garske
961f9c4ecc Cleanup for invalid use of NO_SHA512 in api.c unit test. 2019-11-15 12:08:50 -08:00
David Garske
a7e415d077 Fix for AEC CTR mode with STM32 and CubeMX. 2019-11-15 12:08:25 -08:00
David Garske
27d95d1dfd Add mutex protection on STM32 RNG, AES/DES and Hashing crypto hardware calls for thread safety. Fixes #2580 2019-11-15 12:08:11 -08:00
David Garske
2a9449182c * Make the wc_Stm32_Aes_Init API always available for STM32. ZD 9503
* Fix for SHA256 hash context to only be included for `STM32_HASH_SHA2`. ZD 9503
2019-11-15 12:07:08 -08:00
Chris Conlon
4282346eef Merge pull request #2551 from kaleb-himes/ZD5815-EBSNET
Implement porting efforts from ZD5241 and ZD5815
2019-11-15 09:24:10 -07:00
John Safranek
3cd5a97473 Maintenance
1. When getting the DH public key, initialize the P, G, and Pub pointers
to NULL, then set that we own the DH parameters flag. This allows
FreeSSL to correctly clean up the DH key.
2019-11-14 14:42:58 -08:00
John Safranek
604219f2fc Sync OCTEON fix
1. For OCTEON builds, leave out the "-DCVMX_BUILD_FOR_LINUX_HOST" option
from CFLAGS by default so it makes standalone host builds.
2. Add a check of the variable OCTEON_HOST for linux to add back in the
"-DCVMX_BUILD_FOR_LINUX_HOST" to CFLAGS.
2019-11-14 14:21:44 -08:00
John Safranek
2ace532e45 Sync OCTEON fix
1. The sniffer's global device ID wasn't tagged as global.
2. Make sure the sniffer's global device ID is used.
2019-11-14 14:21:44 -08:00
John Safranek
7c78130f70 Sync OCTEON fix
The preprocessor selection for the WOLFSSL_GLOBAL macro for OCTEON wasn't getting selected.
2019-11-14 14:21:44 -08:00
Kaleb Himes
4a2f8482b5 Remove static RSA setting
Customer confirmed their tests are passing without static rsa enabled.
2019-11-14 15:16:32 -07:00
Eric Blankenhorn
8c6c4e2432 Add unique error codes to verify failures 2019-11-14 16:02:02 -06:00
Chris Conlon
22042830d6 Merge pull request #2588 from kojo1/BasicConst2
BasicConstraint, compatibility
2019-11-14 13:16:30 -07:00
Takashi Kojo
dccb2e165e if integer it is valid format with CA = False, 2019-11-14 14:51:58 +09:00
Sean Parkinson
cc880e39ae Add deterministic ECDSA sig gen. Fix corner cases for add point.
In verify, two points are added and they may either be the same point
(different z) or result in infinity.
If they are the same point then a double needs to be performed instead.
Detection of infinity added.
Calculation of wc_ecc_sig_size fixed to handle wehn there are more bits
in the order than in the modulus.
2019-11-14 12:49:45 +10:00
Guido Vranken
a3fca34471 Properly limit array access in OCSP response decoder 2019-11-14 03:19:07 +01:00
Sean Parkinson
411b130369 Add new 4096-bit cert and key to distribution 2019-11-14 09:13:24 +10:00
John Safranek
8f08f001d2 Update the EBSNET GenerateSeed function with a better seed. It was
reseeding itself every few bytes and failing the simple entropy check.
2019-11-13 14:50:58 -08:00
David Garske
af142b307b Support for WebRTC (ref m79):
* Fixed `set1_curves_list` API's to use `const char*` for names.
* Fixed `ossl_typ.h` to include `ssl.h` compatibility.
* Added `SSL_CTX_up_ref`.
* Added `wolfSSL_set1_curves_list`
* Added `TLS_method` and `DTLS_method`
* Added `SSL_CIPHER_standard_name`.
* Added `X509_STORE_CTX_get0_cert`
* Added `SSL_CTX_set_cert_verify_callback`.
* Enabled "either" side support when `--enable-opensslall` is used.
* Changed `SSL_CIPHER_get_rfc_name` to use `wolfSSL_CIPHER_get_name` instead of stub.
2019-11-13 12:34:33 -08:00
toddouska
99292158e4 Merge pull request #2573 from JacobBarthelmeh/staticmemory
handle case to avoid memcpy when staticmemory IO pool gives same buffer
2019-11-13 11:29:13 -08:00
toddouska
76e7e7349b Merge pull request #2575 from tmael/valgrind_dhtest
Fix memory leak in dh_test
2019-11-13 11:28:04 -08:00
toddouska
46bc8e092a Merge pull request #2582 from ejohnstown/abi-current
ABI
2019-11-13 11:24:45 -08:00
Aaron Jense
dab7d09570 Fix the possibility that memory is not free'd when GetLength returns 0 2019-11-13 11:55:45 -07:00
Aaron Jense
0beeb2356b Fix scan-build not recognizing FlatAttrib array being initialized 2019-11-13 11:50:26 -07:00
JacobBarthelmeh
e3fb746f1d Merge pull request #2503 from dgarske/openvpn
wolfSSL Compatibility support for OpenVPN
2019-11-13 11:04:08 -07:00
David Garske
546442c130 Fix for CAVP test issue trying to use AES_128_KEY_SIZE and AES_IV_SIZE. 2019-11-12 09:43:09 -08:00
Sean Parkinson
5221c082f1 SP now has support for RSA/DH 4096-bit operations 2019-11-12 12:04:06 +10:00
David Garske
d8e40dea3f Fixes from peer review:
* Reduced codesize when building with `OPENSSL_EXTRA_X509_SMALL`.
* Additional argument checks in `wolfSSL_ASN1_BIT_STRING_set_bit`, `wolfSSL_ASN1_STRING_to_UTF8`, `wolfSSL_RSA_meth_new`, `wolfSSL_RSA_meth_set`.
* Fix for compiler warnings in asn.c using strncmp to duplicate string. "specified bound depends on the length of the source argument"
2019-11-11 15:39:23 -08:00
John Safranek
682cf6deac wolfSSL ABI
Hide the RNG and ecc_key allocators from FIPS mode builds.
2019-11-11 15:16:39 -08:00
David Garske
d17748b1ad Fix for EC_GROUP_order_bits and added unit test. 2019-11-11 14:58:23 -08:00
David Garske
2bae1d27a1 wolfSSL Compatibility support for OpenVPN
* Adds compatibility API's for:
	* `sk_ASN1_OBJECT_free`
	* `sk_ASN1_OBJECT_num`
	* `sk_ASN1_OBJECT_value`
	* `sk_X509_OBJECT_num`
	* `sk_X509_OBJECT_value`
	* `sk_X509_OBJECT_delete`
	* `sk_X509_NAME_find`
	* `sk_X509_INFO_free`
	* `BIO_get_len`
	* `BIO_set_ssl`
	* `BIO_should_retry` (stub)
	* `X509_OBJECT_free`
	* `X509_NAME_get_index_by_OBJ`
	* `X509_INFO_free`
	* `X509_STORE_get0_objects`
	* `X509_check_purpose` (stub)
	* `PEM_read_bio_X509_CRL`
	* `PEM_X509_INFO_read_bio`
	* `ASN1_BIT_STRING_new`
	* `ASN1_BIT_STRING_free`
	* `ASN1_BIT_STRING_get_bit`
	* `ASN1_BIT_STRING_set_bit`
	* `DES_check_key_parity`
	* `EC_GROUP_order_bits`
	* `EC_get_builtin_curves`
	* `EVP_CIPHER_CTX_cipher`
	* `EVP_PKEY_get0_EC_KEY`
	* `EVP_PKEY_get0_RSA`
	* `EVP_PKEY_get0_DSA` (stub)
	* `HMAC_CTX_new`
	* `HMAC_CTX_free`
	* `HMAC_CTX_reset`
	* `HMAC_size`
	* `OBJ_txt2obj`
	* `RSA_meth_new`
	* `RSA_meth_free`
	* `RSA_meth_set_pub_enc`
	* `RSA_meth_set_pub_dec`
	* `RSA_meth_set_priv_enc`
	* `RSA_meth_set_priv_dec`
	* `RSA_meth_set_init`
	* `RSA_meth_set_finish`
	* `RSA_meth_set0_app_data`
	* `RSA_get_method_data`
	* `RSA_set_method`
	* `RSA_get0_key`
	* `RSA_set0_key`
	* `RSA_flags`
	* `RSA_set_flags`
	* `RSA_bits`
	* `SSL_CTX_set_ciphersuites`
	* `SSL_CTX_set_security_level` (stub)
	* `SSL_export_keying_material` (stub)
	* `DSA_bits` (stub)
* Changes to support password callback trial and NO_PASSWORD. Replaces PR #2505.
* Renamed `wolfSSL_SSL_CTX_get_client_CA_list` to `wolfSSL_CTX_get_client_CA_list`.
* Cleanup of "sk" compatibility.
2019-11-11 14:58:23 -08:00
John Safranek
5a21cec030 wolfSSL ABI
Add ABI tags to the functions wolfSSL_Cleanup() to match wolfSSL_Init(),
wolfSSL_X509_free to match wolfSSL_load_certificate_file() which
allocates memory.
2019-11-11 10:16:58 -08:00
Tesfa Mael
68e4014c3f memset DhKeys 2019-11-11 09:43:10 -08:00
toddouska
8246e02756 Merge pull request #2502 from cariepointer/gcm-tls10-fix
Return error with AES-GCM and negotiated versions < TLSv1.2
2019-11-08 15:06:54 -08:00
John Safranek
c6fa49d4b4 wolfSSL ABI
Add the ABI tag to the prescribed list of functions in the header and source files.
2019-11-08 15:06:18 -08:00
toddouska
44552fe707 Merge pull request #2536 from dgarske/nxp_mmcau_align
Fix NXP MMCAU when data pointer is not aligned
2019-11-08 15:02:43 -08:00
toddouska
801ffd4712 Merge pull request #2571 from SparkiDev/asn1_cert_parse_fix
Ensure space for name string. Reset policy count.
2019-11-08 15:02:02 -08:00
Carie Pointer
a2cdb87067 Add check for if length is <= 0 in wc_Arc4SetKey 2019-11-08 14:54:39 -07:00
Tesfa Mael
99ee4a407d Fix mem leak for valgrind 2019-11-08 12:09:46 -08:00
Carie Pointer
39eaaddeae Add tests for AEAD cipher suites with TLSv1.1 and TLSv1.0 2019-11-08 10:04:58 -08:00
JacobBarthelmeh
e329431bc1 Merge pull request #2572 from kaleb-himes/GH2559
Address logical fallacies and syntax issues in example server, addres…
2019-11-08 10:18:12 -07:00
Carie Pointer
1d02943658 Sanity check in wc_scrypt for invalid params <= 0 2019-11-08 09:40:07 -07:00
John Safranek
c69b6fb6d1 wolfSSL ABI
1. Add a blank #define WOLFSSL_ABI to tag functions as part of the ABI
to remind developers there are rules about those functions specifically.
2. Added allocators and deallocators for WC_RNG objects and ecc_key
objects so they don't have to be used on the stack.
3. Add tests for the new allocators.
2019-11-07 13:03:12 -08:00
kaleb-himes
f0d3d5d71c 80-character per-line coding standard format fix 2019-11-07 13:33:38 -07:00
Kaleb Himes
95796c80b7 Add prototype for ebsnet_fseek
Customer confirmed prototype was not present in vfile.h, added prototype to wolfSSL header.
2019-11-07 13:31:02 -07:00
kaleb-himes
5ce88b5086 seperate sanity checks on size and rnd allocation 2019-11-07 13:12:17 -07:00
Jacob Barthelmeh
fd3e4abb46 handle case to avoid memcpy when staticmemory IO pool gives same buffer 2019-11-07 11:36:20 -07:00
kaleb-himes
ad192786b1 Remove double assignment to pt caught by scan-build test 2019-11-07 11:35:36 -07:00
kaleb-himes
e24059691c Address logical fallacies and syntax issues in example server, addresses GH issue #2559 2019-11-07 10:30:12 -07:00
Sean Parkinson
c06efb6c1f Ensure space for name string. Reset policy count.
Only set the name string in one place, keeping a length of the name type
to copy. Also only move cert data index once.
Reset certificate extension policy number/count in case of malicious
cert with multiple policy extensions.
2019-11-07 13:51:50 +10:00
David Garske
0fe5d40507 Merge pull request #2568 from aaronjense/iar-build-fix
Fix changed sign warning for IAR build
2019-11-06 15:47:15 -08:00
Eric Blankenhorn
caaab11f60 Update from review 2019-11-06 15:58:50 -06:00
toddouska
b2270a068f Merge pull request #2566 from SparkiDev/malloc_unused_fix
Fix unused parameter when XMALLOC doesn't use params
2019-11-06 13:08:48 -08:00
toddouska
c137c5a3e0 Merge pull request #2565 from SparkiDev/rsa_kg_sp_math
SP Math and RSA Key Gen working again
2019-11-06 13:08:19 -08:00
toddouska
1becdb9f3b Merge pull request #2563 from SparkiDev/x509_dname_index
Check domain name location index hasn't exceed maximum before setting
2019-11-06 13:07:42 -08:00
toddouska
c995417d54 Merge pull request #2554 from SparkiDev/sp_misrac
MISRA-C changes to SP plus cppcheck fixes
2019-11-06 13:06:28 -08:00
toddouska
15d4da1e14 Merge pull request #2562 from JacobBarthelmeh/staticmemory
fix for memory management on edge case with staticmemory
2019-11-06 13:04:33 -08:00
toddouska
ba34b0d09f Merge pull request #2547 from SparkiDev/rsa_pss_salt_len
Compile options for larger salt lengths in RSA-PSS
2019-11-06 13:03:15 -08:00
tmael
969488434a Merge pull request #2544 from JacobBarthelmeh/SanityChecks
add null checks (QSH and CRYPTOCELL)
2019-11-06 12:18:00 -08:00
Aaron Jense
ea77cd743e Fix changed sign warning for IAR build 2019-11-06 09:59:31 -08:00
JacobBarthelmeh
cd7001904a Merge pull request #2561 from ejohnstown/x509-loss
X.509 and Secure Renegotiation
2019-11-06 10:53:18 -07:00
Sean Parkinson
d4ca48a513 Fix unused parameter when XMALLOC doesn't use params 2019-11-06 15:46:19 +10:00
Sean Parkinson
65cd8a930e SP Math and RSA Key Gen working again 2019-11-06 15:24:12 +10:00
Tesfa Mael
a6e4926d2f Init variables 2019-11-05 15:14:47 -08:00
Sean Parkinson
d2c4798459 Modify linked list traversal - fix for compiler bug
KeyShare and PreSharedKey traverse linked list using a handle.
Customer reported their compiler couldn't handle the assignment, so,
using a temporary.
2019-11-06 08:57:33 +10:00
Chris Conlon
77c36b5ea9 Merge pull request #2542 from kojo1/BasicConst
x.509 basic constratint
2019-11-05 15:38:07 -07:00
Sean Parkinson
52f28bd514 Check domain name location index hasn't exceed maximum before setting 2019-11-06 08:31:04 +10:00
Jacob Barthelmeh
890eb415b1 fix for memory management on edge case with staticmemory 2019-11-05 15:13:26 -07:00
David Garske
165105af95 Merge pull request #2558 from danielinux/pwbased-no-asn
Allow pwdbased module to compile without ASN
2019-11-05 13:26:45 -08:00
David Garske
e48cf88a70 Merge pull request #2556 from embhorn/arm-test-fix
Fix for ARM platforms
2019-11-05 12:25:56 -08:00
David Garske
c337ce2703 Merge pull request #2560 from cconlon/cavppss
use wc_RsaPSS_CheckPadding() for selftest build instead of extended
2019-11-05 12:09:25 -08:00
John Safranek
72e1afbe99 X.509 and Secure Renegotiation
1. When retaining the handshake resources for a session using resumption, do not delete the peer's certificate. If keeping peer certificates is enabled, the certificate needs to exist so it may be examined.
2. Free the saved peer certificate when receiving a peer certificate during a renegotiation.
2019-11-05 11:03:34 -08:00
Chris Conlon
e429558166 use wc_RsaPSS_CheckPadding() for selftest build instead of extended 2019-11-05 10:48:36 -07:00
Daniele Lacamera
51ea806d8b Allow pwdbased module to compile without ASN 2019-11-05 10:16:46 +01:00
Jacob Barthelmeh
1361e4dbef remove extra setting of ecc key size with CRYPTOCELL build 2019-11-04 23:25:47 -07:00
toddouska
e2b7bee9c8 Merge pull request #2533 from cariepointer/apache_bio_want_read
Apache: Return WANT_READ in wolfSSLReceive if BIO retry and read flags are set
2019-11-04 16:52:28 -08:00
Sean Parkinson
32f93be0b6 Replace magic PSS salt length numbers with enums 2019-11-05 09:03:30 +10:00
toddouska
5141623f48 Merge pull request #2548 from SparkiDev/rsa_check
Add more checks of RSA key
2019-11-04 13:05:35 -08:00
toddouska
28da0075d1 Merge pull request #2545 from SparkiDev/scrypt_iters
Add scrypt API that takes iterations rather than cost
2019-11-04 13:01:32 -08:00
toddouska
b723acf0f6 Merge pull request #2534 from SparkiDev/pss_1024_sha512_tls12
Pass the length of the RSA key in bits to PSS padding check in TLS
2019-11-04 11:42:55 -08:00
toddouska
f4afa4bc87 Merge pull request #2540 from SparkiDev/etm_rehand
Fix Encrypt-Then-MAC when rehandshaking
2019-11-04 11:41:44 -08:00
Eric Blankenhorn
16899b55b2 Fix for ARM platforms 2019-11-04 11:54:36 -06:00
David Garske
e2fb359538 Merge pull request #2549 from JacobBarthelmeh/Testing
fix for macro typo's
2019-11-04 08:05:09 -08:00
David Garske
683658de20 Merge pull request #2553 from miyazakh/fix_esp_buildfail
fix esp build failure
2019-11-04 07:44:01 -08:00
Sean Parkinson
f590f6522d MISRA-C changes to SP plus cppcheck fixes 2019-11-04 16:13:48 +10:00
Sean Parkinson
35ec2bc6d4 Compile options for larger salt lengths in RSA-PSS
Salt length larger than the hash size allowed in RSA-PSS.
Passing -2 to PSS pad function uses maximum salt length.
Passing -2 to PSS un-pad function makes it discover salt length.
2019-11-04 14:27:02 +10:00
Hideki Miyazaki
0c8ab5b0e4 fix esp build failure 2019-11-03 12:19:59 +09:00
Takashi Kojo
76404c937e #ifdef guard 2019-11-02 13:01:40 +09:00
David Garske
2084006b61 Merge pull request #2550 from cconlon/mmcau
fix mmCAU classic XFREE on aligned ptr
2019-11-01 15:59:57 -07:00
kaleb-himes
ffb80126ff Implement porting efforts from ZD5241 and ZD5815 2019-11-01 16:00:06 -06:00
Jacob Barthelmeh
6ba3aa88ca fix for build after CI tests 2019-11-01 14:47:50 -06:00
Chris Conlon
98a2322dd9 Merge pull request #2525 from tmael/open_coexist
Raise an error when opensslcoexist option is used with openssl[all][extra]
2019-11-01 11:32:46 -06:00
Chris Conlon
e07e07f831 Merge pull request #2537 from JacobBarthelmeh/PKCS7
fix for pkcs7 verify streaming
2019-11-01 10:15:44 -06:00
Chris Conlon
be2cb302ea fix mmCAU classic XFREE on aligned ptr 2019-11-01 09:56:28 -06:00
Eric Blankenhorn
54f023ac2c Clarify ipasc parameter usage 2019-11-01 10:33:49 -05:00
Jacob Barthelmeh
efca350cba fix for macro typo's 2019-11-01 09:21:21 -06:00
Sean Parkinson
54c7619f81 Add more checks of RSA key
Check d is in valid range, p*q == n, and dP, dQ and u are valid.
2019-11-01 16:25:57 +10:00
Sean Parkinson
7623777857 Add scrypt API that takes iterations rather than cost
iterations = 1 << cost but matches APIs in other products and standard
2019-11-01 10:15:42 +10:00
Eric Blankenhorn
6839110507 Update from review 2019-10-31 17:45:33 -05:00
toddouska
9e852b3867 Merge pull request #2539 from dgarske/mutex_ref
Fixes for cases where mutex was not being free'd
2019-10-31 13:10:04 -07:00
toddouska
b27c1df348 Merge pull request #2538 from SparkiDev/cppcheck_fixes_2
Fixes for errors using cppcheck
2019-10-31 13:08:19 -07:00
toddouska
ac76b4b692 Merge pull request #2541 from SparkiDev/x25519_gcc_avx2
Fix loading and setting using RIP register with GCC
2019-10-31 13:07:27 -07:00
toddouska
626e0efd99 Merge pull request #2530 from SparkiDev/pkcs11_tls_client
Use the public key type as private key type with PKCS #11
2019-10-31 13:06:32 -07:00
toddouska
fca0705a0b Merge pull request #2526 from aaronjense/libwebsockets-build-fix
libwebsockets build fixes
2019-10-31 13:05:46 -07:00
Jacob Barthelmeh
550fbcfff7 add null checks (QSH and CRYPTOCELL) 2019-10-31 10:07:47 -06:00
Eric Blankenhorn
58d800fbb7 Adding support for IP address verification 2019-10-31 09:15:22 -05:00
Eric Blankenhorn
9fc33e461c Check names in verify callback. 2019-10-31 09:15:22 -05:00
Takashi Kojo
2ef4d1a16e Keep else to GetBoolean 2019-10-31 17:29:46 +09:00
Takashi Kojo
4f602e02ba accept ASN_INTEGER for compatibility 2019-10-31 12:06:59 +09:00
Sean Parkinson
adff4e719a Fix loading and setting using RIP register with GCC 2019-10-31 12:14:05 +10:00
Sean Parkinson
4be36ef2bd Fix Encrypt-Then-MAC when rehandshaking
New, encrypted handshakes change over to ETM correctly now.
2019-10-31 09:14:42 +10:00
David Garske
28d466cb10 Fix to ensure 4-byte alignment is default for MMCAU with SHA1, SHA256 and MD5. 2019-10-30 13:34:57 -07:00
David Garske
760a90ef5d Fixes for cases where mutex is not being free'd. 2019-10-30 10:11:06 -07:00
Sean Parkinson
c354b240f2 Fixes for errors using cppcheck 2019-10-30 14:48:21 +10:00
Jacob Barthelmeh
a0955f8221 fix for pkcs7 verify streaming 2019-10-29 16:47:30 -06:00
David Garske
7f42b71571 Fix NXP MMCAU when data pointer is not aligned. 2019-10-29 13:45:25 -07:00
David Garske
6bc16a4acb Merge pull request #2532 from aaronjense/mp-public-defines
Fix for configure used in wolfssl-examples/signature/rsa_vfy_only.…
2019-10-29 08:46:03 -07:00
Sean Parkinson
eb03e5de1e Pass the length of the RSA key in bits to PSS padding check in TLS 2019-10-29 11:56:35 +10:00
Carie Pointer
e8db4cc2a0 Apache: Return WANT_READ in wolfSSLReceive if BIO retry and read flags are set 2019-10-28 15:08:00 -07:00
toddouska
140796d2aa Merge pull request #2504 from ejohnstown/sync-octeon
Synchronous OCTEON Sniffer Support
2019-10-28 12:25:57 -07:00
David Garske
0aeb87f284 Merge pull request #2529 from SparkiDev/etm_max
Fix check for plaintext length when using Encrypt-Then-MAC
2019-10-28 11:59:32 -07:00
toddouska
51e8abf126 Merge pull request #2531 from SparkiDev/nginx_unittest
Fix unittest to pass when compiling for NGINX
2019-10-28 11:27:22 -07:00
Aaron Jense
34c37c58f4 Fixes for configure used in wolfssl-examples/signature/rsa_vfy_only and fix for wrong WOLFSSL_MP_PUBLIC defines.
./configure CFLAGS=-DWOLFSSL_PUBLIC_MP --disable-asn --disable-filesystem --enable-static --enable-shared --enable-cryptonly --enable-sp=smallrsa2048 --enable-sp-math --disable-dh --disable-ecc --disable-sha224 --enable-rsavfy
2019-10-28 09:50:59 -06:00
Sean Parkinson
8a92e1eae6 Fix check for plaintext length when using Encrypt-Then-MAC 2019-10-28 16:28:52 +10:00
Carie Pointer
ad9522c765 Add WOLFSSL_OLDTLS_AEAD_CIPHERSUITES to allow AEAD cipher suites in TLSv1.0 and TLSv1.1 2019-10-25 09:51:11 -07:00
David Garske
b80b10b980 Merge pull request #2498 from danielinux/stm32wb55
Support for STM32_PKA accelerator
2019-10-24 15:41:08 -07:00
Daniele Lacamera
9f34826173 stm32_pka: fixed remarks from code review 2019-10-24 21:48:35 +02:00
Daniele Lacamera
390b936331 stm32_pka: using XMEMCPY 2019-10-24 20:49:43 +02:00
Daniele Lacamera
f97452c859 STM32_PKA: using XMEMSET 2019-10-24 20:46:03 +02:00
Daniele Lacamera
025754e774 Fixed alignment/padding for hash. ECC tests passing on target. 2019-10-24 20:32:47 +02:00
John Safranek
17f44d4d29 OCTEON Sync
1. Add attributes to the OCTEON functions so they aren't optimized.
2. Disable the same test cases for OCTEON as we do QAT in sync.
2019-10-24 10:00:20 -07:00
David Garske
3ac4aa5a9b Merge pull request #2524 from cconlon/cau_iar
mmCAU Classic AES key alignment, IAR warnings fixes
2019-10-24 09:23:20 -07:00
Daniele Lacamera
3677e4d735 [stm32hal-pka] Fixed after reviews, fix result allocation for sign/mulmod 2019-10-24 16:06:38 +02:00
Tesfa Mael
0b93109b3a throw error when opensslcoexist configured with opensslall or opensslextra 2019-10-23 15:51:19 -07:00
toddouska
400dcfebba Merge pull request #2516 from danielinux/freescale-ltc-spmath
Fixed Freescale LTC crypto module to compile with SP math
2019-10-23 15:11:43 -07:00
toddouska
28cc7daa68 Merge pull request #2511 from tmael/BN_bn2hex
Fix for hex digits with fastmath and normal integer
2019-10-23 15:10:40 -07:00
John Safranek
954d1ad13e Sniffer Update
1. Add ssl_SetWatchKeyCallback_ex() which was missing.
2. Fix linking issue with OCTEON libraries.
2019-10-23 15:03:50 -07:00
Chris Conlon
cb7b4af986 Merge pull request #2523 from JacobBarthelmeh/SanityChecks
fix for selftest build
2019-10-23 15:24:16 -06:00
JacobBarthelmeh
4135850a32 Merge pull request #2522 from dgarske/rel_async_4.2.0
Fixes for building with async (rel v4.2.0 prep)
2019-10-23 14:33:00 -06:00
Jacob Barthelmeh
5b9e005802 fix for selftest build 2019-10-23 12:09:20 -06:00
John Safranek
b8f4b1a712 QAT Header Hiding
For the sync QAT, the QAT headers are included into the library after it
has been built and is being used. The actual headers should only be used
when building wolfSSL and should be hidden from the user.
1. Most of the functions in the sync QAT and OCTEON headers don't need
to be exported. Move all of that into the source files. Only export the
init and deinit functions.
2. Remove inline from the OCTEON support functions.
3. Remove the AES-ECB files for sync OCTEON as unused.
4. Configure defaults to OCTEON2 build, can be overridden with variable.
2019-10-23 09:58:11 -07:00
John Safranek
1ad23334bf Sync Sniffer API Cleanup
1. Switched the IntelQa sync API back to local.
2. Added two functions to setup and cleanup the IntelQA device.
3. Changed the Octeon functions to match the IntelQa functions.
4. Updated sniffer, wolfcryptest, and benchmark.
2019-10-23 09:58:11 -07:00
John Safranek
b0dafbcd1b Sync Octeon Sniffer
Added back some changes from a dropped commit.
1. The Octeon README should be a stub.
2. Changed the license notice in the octeon sync files back to GPLv2.
3. Added a flag to Aes that needed a build guard around it.
4. Replaced the disable for sniffer session stats.
2019-10-23 09:58:11 -07:00
John Safranek
54f0b1a44a Sync QAT Fixes
1. The QAT callback's worker functions need to copy the IV into the AES IV register. QAT doesn't update it automatically.
2. Update the GMAC test to set its device to INVALID_DEVID.
3. Always allocate NUMA buffers before running crypto operation and store the results.
4. The QAT does not like non-multiple of 4 iv lenths, and aad lengths. Or 0. Remove a few test cases for those.
5. QAT wasn't getting a pointer to store the auth tag for GCM. Then store it.
2019-10-23 09:58:11 -07:00
John Safranek
825f311959 add OCTEON and QAT to wolfCrypt test, update SHA-1 to reset ret when it will do the software sha 2019-10-23 09:58:10 -07:00
John Safranek
41e0712eb0 Synchronous Cavium OCTEON Support for Sniffer
1. Fixes for AES-GCM.
2019-10-23 09:58:10 -07:00
John Safranek
67b11b8ece Fixing some play-nice between sync QAT and sync Octeon. 2019-10-23 09:58:10 -07:00
John Safranek
989c964a95 Synchronous Cavium OCTEON Support for Sniffer
1. Add configure option for sync IntelQA that uses the crypto callback API.
2. Make a synchonous copy of the quickassist files.
3. Tie in the crypto device to the sniffer.
4. When making a sniffer build, define static DH enabled.
5. The readme files in the Cavium were being added to the distro optionally, changed to always add the readme files.
6. Added an include of the cavium_octeon header in the wc_ports.c.
7. Updated the Cavium OCTEON callback for AES-GCM.
8. Add the global tag to the list of crypto callback function pointers.
9. Add an accessor to the OCTEON crypto callback module to return the device ID of the OCTEON device.
10. Add a new version of ssl_SetWatchKeyCallback which takes an additional parameter of a device ID. This ID is used to set up the wolfSSL_CTXs in the sniffer session trackers.
11. Update the benchmark to use sync OCTEON and QAT.
2019-10-23 09:58:10 -07:00
David Garske
7386bd4df1 Fixes for building with ./configure --enable-asynccrypt --enable-all CFLAGS="-DWC_ASYNC_NO_CRYPT" 2019-10-22 13:37:16 -07:00
Sean Parkinson
8ce3b3a5e6 Use the public key type as private key type with PKCS #11 2019-10-22 10:34:44 +10:00
Sean Parkinson
a3c09f6794 Fix unittest to pass when compiling for NGINX 2019-10-22 08:47:49 +10:00
Aaron Jense
eaa8f2a957 libwebsockets build fixes
1. Add --enable-libwebsockets option
2. Add OPENSSL_NO_EC (used in libwebsockets)
3. Add SSL_MODE_RELEASE_BUFFERS and debug message for when wolfSSL_CTX_set_mode doesn't recognize a mode.
2019-10-21 12:03:18 -06:00
Chris Conlon
42ddd63952 exclude packed __attribute__ on IAR ICC < 9 2019-10-18 16:33:01 -06:00
Chris Conlon
c18ff36959 fix uninitialized variable warning in IAR-EWARM 7.50.2 2019-10-18 14:08:23 -06:00
Chris Conlon
c4afbb3685 align AES key if needed when using MMCAU classic 2019-10-18 14:02:43 -06:00
Daniele Lacamera
f41f67d231 Fixed Freescale LTC crypto module to compile with SP math 2019-10-16 15:44:58 +02:00
Tesfa Mael
1267987c31 Review comment 2019-10-15 12:24:57 -07:00
Tesfa Mael
1a18e3bba8 Add leading zero padding for odd hex ASCII digits 2019-10-15 11:54:58 -07:00
Tesfa Mael
441f3a7f1f Add leading zero for odd number of hex digits 2019-10-14 16:43:45 -07:00
Carie Pointer
af8968ee5e Add REQUIRES_AEAD and move functionallity for checking AEAD ciphers to CipherRequires() 2019-10-09 14:37:39 -07:00
Carie Pointer
5adcee9f2c Update testsuite to expect ADH-AES256-GCM-SHA384 to fail with TLSv1.0 and TLSv1.1 2019-10-09 08:36:47 -07:00
Daniele Lacamera
99209d78a3 STM32 PKA: added include statement 2019-10-09 13:19:57 +02:00
Daniele Lacamera
0dfc64678c STM32 PKA: added function prototype 2019-10-09 13:15:56 +02:00
Daniele Lacamera
3465a487d3 STM32 PKA fix: remove reverse array operations 2019-10-09 10:22:04 +02:00
Carie Pointer
df22115920 Return error with AES-GCM and negotiated versions < TLSv1.2 2019-10-07 08:28:00 -07:00
Daniele Lacamera
c26a7ccb68 Fix copy-paste from LTE module 2019-10-04 20:37:38 +02:00
Daniele Lacamera
52bf19eefd Added initial support for STM32_PKA ECC accelerator 2019-10-04 20:15:33 +02:00
Martin Kinčl
996cef6db2 Added stdio.h include to types.h. 2019-07-10 18:26:43 +02:00
1190 changed files with 353706 additions and 100714 deletions

26
.gitignore vendored
View File

@@ -5,18 +5,21 @@ ctaocrypt/src/src/
*.o
*.patch
*.deps
*.d
*.libs
*.cache
.dirstamp
*.user
configure
config.*
!cmake/config.in
*Debug/
*Release/
*.ncb
*.suo
*.sdf
*.opensdf
*.cmd
ipch/
build-aux/
rpm/spec
@@ -78,6 +81,7 @@ tests/unit
testsuite/testsuite.test
tests/unit.test
tests/bio_write_test.txt
tests/test-log-dump-to-file.txt
test-write-dhparams.pem
testsuite/*.der
testsuite/*.pem
@@ -226,6 +230,17 @@ IDE/MDK-ARM/LPC43xx/LPC43xx/
*.gcno
*.gcda
*.gcov
!linuxkm/Makefile
/Kbuild
linuxkm/*.ko
linuxkm/Module.symvers
linuxkm/built-in.a
linuxkm/modules.order
linuxkm/wolfcrypt
linuxkm/libwolfssl.mod
linuxkm/libwolfssl.mod.c
linuxkm/module_exports.c
linuxkm/linuxkm/get_thread_size
# MPLAB Generated Files (OS X)
mcapi/wolfcrypt_mcapi.X/nbproject/Makefile-*
@@ -324,13 +339,22 @@ doc/pdf
# XCODE Index
IDE/XCODE/Index
# ARM DS-5
# ARM DS-5 && Eclipse
\.settings/
\.cproject
\.project
\.autotools
# Renesas e2studio
/IDE/Renesas/e2studio/Projects/test/src/smc_gen
/IDE/Renesas/e2studio/Projects/test/trash
/IDE/Renesas/e2studio/Projects/test/*.launch
/IDE/Renesas/e2studio/Projects/test/*.scfg
# Emacs
*~
# CMake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake

1508
CMakeLists.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,538 @@
# wolfSSL Release 4.6.0 (December 22, 2020)
Release 4.6.0 of wolfSSL embedded TLS has bug fixes and new features including:
### New Feature Additions
###### New Build Options
* wolfSSL now enables linux kernel module support. Big news for Linux kernel module developers with crypto requirements! wolfCrypt and wolfSSL are now loadable as modules in the Linux kernel, providing the entire libwolfssl API natively to other kernel modules. For the first time on Linux, the entire TLS protocol stack can be loaded as a module, allowing fully kernel-resident TLS/DTLS endpoints with in-kernel handshaking. (--enable-linuxkm, --enable-linuxkm-defaults, --with-linux-source) (https://www.wolfssl.com/loading-wolfssl-into-the-linux-kernel/)
* Build tests and updated instructions for use with Apples A12Z chipset (https://www.wolfssl.com/preliminary-cryptographic-benchmarks-on-new-apple-a12z-bionic-platform/)
* Expansion of wolfSSL SP math implementation and addition of --enable-sp-math-all build option
* Apache httpd w/TLS 1.3 support added
* Sniffer support for TLS 1.3 and AES CCM
* Support small memory footprint build with only TLS 1.3 and PSK without code for (EC)DHE and certificates
###### New Hardware Acceleration
* Added support for NXP DCP (i.MX RT1060/1062) crypto co-processor
* Add Silicon Labs hardware acceleration using [SL SE Manager](https://docs.silabs.com/gecko-platform/latest/service/api/group-sl-se-manager)
###### New Algorithms
* RC2 ECB/CBC added for use with PKCS#12 bundles
* XChaCha and the XChaCha20-Poly1305 AEAD algorithm support added
###### Misc
* Added support for 802.11Q VLAN frames to sniffer
* Added OCSP function wolfSSL_get_ocsp_producedDate
* Added API to set CPU ID flags cpuid_select_flags, cpuid_set_flag, cpuid_clear_flag
* New DTLS/TLS non-blocking Secure Renegotiation example added to server.c and client.c
### Fixes
###### Math Library
* Fix mp_to_unsigned_bin_len out of bounds read with buffers longer than maximum MP
* Fix for fp_read_radix_16 out of bounds read
* Fix to add wrapper for new timing resistant wc_ecc_mulmod_ex2 function version in HW ECC acceleration
* Handle an edge case with RSA-PSS encoding message to hash
###### Compatibility Layer Fixes
* Fix for setting serial number wolfSSL_X509_set_serialNumber
* Fix for setting ASN1 time not before / not after with WOLFSSL_X509
* Fix for order of components in issuer name when using X509_sign
* Fix for compatibility layer API DH_compute_key
* EVP fix incorrect block size for GCM and buffer up AAD for encryption/decryption
* EVP fix for AES-XTS key length return value and fix for string compare calls
* Fix for mutex freeing during RNG failure case with EVP_KEY creation
* Non blocking use with compatibility layer BIOs in TLS connections
###### Build Configuration
* Fix for custom build with WOLFSSL_USER_MALLOC defined
* ED448 compiler warning on Intel 32bit systems
* CURVE448_SMALL build fix for 32bit systems with Curve448
* Fix to build SP math with IAR
* CMake fix to only set ranlib arguments for Mac, and for stray typo of , -> ;
* Build with --enable-wpas=small fix
* Fix for building fips ready using openssl extra
* Fixes for building with Microchip (min/max and undef SHA_BLOCK_SIZE)
* FIx for NO_FILESYSTEM build on Windows
* Fixed SHA256 support for IMX-RT1060
* Fix for ECC key gen with NO_TFM_64BIT
###### Sniffer
* Fixes for sniffer when using static ECC keys. Adds back TLS v1.2 static ECC key fallback detection and fixes new ECC RNG requirement for timing resistance
* Fix for sniffer with SNI enabled to properly handle WOLFSSL_SUCCESS error code in ProcessClientHello
* Fix for sniffer using HAVE_MAX_FRAGMENT in "certificate" type message
* Fix build error with unused "ret" when building with WOLFSSL_SNIFFER_WATCH.
* Fix to not treat cert/key not found as error in myWatchCb and WOLFSSL_SNIFFER_WATCH.
* Sniffer fixes for handling TCP `out-of-range sequence number`
* Fixes SSLv3 use of ECDH in sniffer
###### PKCS
* PKCS#11 fix to generate ECC key for decrypt/sign or derive
* Fix for resetting internal variables when parsing a malformed PKCS#7 bundle with PKCS7_VerifySignedData()
* Verify the extracted public key in wc_PKCS7_InitWithCert
* Fix for internal buffer size when using decompression with PKCS#7
###### Misc
* Pin the C# verify callback function to keep from garbage collection
* DH fixes for when public key is owned and freed after a handshake
* Fix for TLS 1.3 early data packets
* Fix for STM32 issue with some Cube HAL versions and STM32 example timeout
* Fix mmCAU and LTC hardware mutex locking to prevent double lock
* Fix potential race condition with CRL monitor
* Fix for possible malformed encrypted key with 3DES causing negative length
* AES-CTR performance fixed with AES-NI
### Improvements/Optimizations
##### SP and Math
* mp_radix_size adjustment for leading 0
* Resolve implicit cast warnings with SP build
* Change mp_sqr to return an error if the result won't fit into the fixed length dp
* ARM64 assembly with clang improvements, clang doesn't always handle use of x29 (FP or Frame Pointer) in inline assembly code correctly - reworked sp_2048_sqr_8 to not use x29
* SP mod exp changed to support exponents of different lengths
* TFM div: fix initial value of size in q so clamping doesn't OOB read
* Numerous stack depth improvements with --enable-smallstack
* Improve cache resistance with Base64 operations
###### TLS 1.3
* TLS 1.3 wolfSSL_peek want read return addition
* TLS 1.3: Fix P-521 algorithm matching
###### PKCS
* Improvements and refactoring to PKCS#11 key look up
* PKCS #11 changes for signing and loading RSA public key from private
* check PKCS#7 SignedData private key is valid before using it
* check PKCS#7 VerifySignedData content length against total bundle size to avoid large malloc
###### Compatibility Layer
* EVP add block size for more ciphers in wolfSSL_EVP_CIPHER_block_size()
* Return long names instead of short names in wolfSSL_OBJ_obj2txt()
* Add additional OpenSSL compatibility functions to update the version of Apache httpd supported
* add "CCM8" variants to cipher_names "CCM-8" ciphers, for OpenSSL compat
###### Builds
* Cortex-M SP ASM support for IAR 6.70
* STM Cube pack support (IDE/STM32Cube)
* Build option --enable-aesgcm=4bit added for AES-GCM GMULT using 4 bit table
* Xilinx IDE updates to allow XTIME override for Xilinx, spelling fixes in Xilinx README.md, and add Xilinx SDK printf support
* Added ED448 to the "all" options and ED448 check key null argument sanity check
* Added ARC4, 3DES, nullcipher, BLAKE2, BLAKE2s, XChaCha, MD2, and MD4 to the “all” options
* Added an --enable-all-crypto option, to enable only the wolfCrypt features of --enable-all, combinable with --enable-cryptonly
* Added the ability to selectively remove features from --enable-all and --enable-all-crypto using specific --disable-<feature> options
* Use Intel intrinsics with Windows for RDSEED and RDRAND (thanks to dr-m from MariaDB)
* Add option to build with WOLFSSL_NO_CLIENT_AUTH
* Updated build requirements for wolfSSH use to be less restrictive
* lighttpd support update for v1.4.56
* Added batch file to copy files to ESP-IDF folders and resolved warnings when using v4.0 ESP-IDF
* Added --enable-stacksize=verbose, showing at a glance the stack high water mark for each subtest in testwolfcrypt
###### ECC
* Performance increase for ECC verify only, using non constant time SP modinv
* During ECC verify add validation of r and s before any use
* Always use safe add and dbl with ECC
* Timing resistant scalar multiplication updated with use of Joye double-add ladder
* Update mp_jacobi function to reduce stack and increase performance for base ECC build
* Reduce heap memory use with wc_EccPrivateKeyDecode, Improvement to ECC wc_ecc_sig_to_rs and wc_ecc_rs_raw_to_sig to reduce memory use (avoid the mp_int)
* Improve StoreECC_DSA_Sig bounds checking
###### OCSP
* OCSP improvement to handle extensions in singleResponse
* support for OCSP request/response for multiple certificates
* OCSP Must Staple option added to require OCSP stapling response
* Add support for id-pkix-ocsp-nocheck extension
###### Misc
* Additional code coverage added for ECC and RSA, PKCS#7, 3DES, EVP and Blake2b operations
* DTLS MTU: check MTU on write
* Refactor hash sig selection and add the macros WOLFSSL_STRONGEST_HASH_SIG (picks the strongest hash) and WOLFSSL_ECDSA_MATCH_HASH (will pick the hash to match the ECC curve)
* Strict certificate version allowed from client, TLS 1.2 / 1.3 can not accept client certificates lower than version 3
* wolfSSL_get_ciphers_compat(), skip the fake indicator ciphers like the renegotiation indication and the quantum-safe hybrid
* When parsing session ticket, check TLS version to see whether they are version compatible
* Additional sanity check for invalid ASN1 padding on integer type
* Adding in ChaCha20 streaming feature with Mac and Intel assembly build
* Sniffer build with --enable-oldtls option on
# wolfSSL Release 4.5.0 (August 19, 2020)
If you have questions about this release, feel free to contact us on our
info@ address.
Release 4.5.0 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* Added Xilinx Vitis 2019.2 example and README updates
* TLS v1.3 is now enabled by default
* Building FIPS 140-2 code and test on Solaris
* Secure renegotiation with DTLS 1.2
* Update RSA calls for hardware acceleration with Xilsecure
* Additional OpenSSL compatibility layer functions added
* Cypress PSoC6 wolfCrypt driver added
* Added STM32CubeIDE support
* Added certificate parsing and inspection to C# wrapper layer
* TLS v1.3 sniffer support added
* TSIP v1.09 for target board GR-ROSE support added
* Added support for the "X72N Envision Kit" evaluation board
* Support for ECC nonblocking using the configure options
"--enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS=-DWOLFSSL_PUBLIC_MP"
* Added wc_curve25519_make_pub function to generate a public key given the
private one
## Fixes
* PIC32MZ hardware cache and large hashes fix
* AES-GCM use with EVP layer in compatibility layer code
* Fix for RSA_LOW_MEM with ARM build of SP code
* Sanity check on tag length with AES-CCM to conform with RFC 3610
* Fixes for 32 and 64 bit software implementations of SP code when
WOLFSSL_SP_CACHE_RESISTANT is defined
* GCC warning fixes for GCC 9 and later
* Sanity check on HKDF expand length to conform with RFC 5869
* Fixes for STM32 CubeMX HAL with AES-GCM
* Fixed point cache look up table (LUT) implementation fixes
* Fix for ARM 32bit SP code when calling div word
* Fix for potential out of bounds read when parsing CRLs
* Fix for potential out of bounds read with RSA unpadding
* AES-CCM optimized counter fix
* Updates to Xcode projects for new files and features
* Fix for adding CRLs to a WOLFSSL_X509_STORE structure
* FIPSv2 build with opensslall build fixes
* Fixes for CryptoCell use with ECC and signature wrappers
* Fix for mod calculation with SP code dealing with 3072 bit keys
* Fix for handling certificates with multiple OUs in name
* Fix for SP math implementation of sp_add_d and add a sanity check on
rshb range
* Fix for sanity check on padding with DES3 conversion of PEM to DER
* Sanity check for potential out of bounds read with fp_read_radix_16
* Additional checking of ECC scalars.
* Fixing the FIPS Ready build w.r.t. ecc.c.
* When processing certificate names with OpenSSL compatibility layer
enabled, unknown name item types were getting handled as having NID 0,
and failing. Added a couple more items to what is handled correctly,
and ignoring anything that is an unknown type.
## Improvements/Optimizations
* TLS 1.3 certificate verify update to handle 8192 bit RSA keys
* wpa_supplicant support with reduced code size option
* TLS 1.3 alerts encrypted when possible
* Many minor coverity fixes added
* Error checking when parsing PKCS12 DER
* IAR warning in test.c resolved
* ATECC608A improvements for use with Harmony 3 and PIC32 MZ
* Support for AES-GCM and wc_SignatureVerifyHash with static memory and no
mallocs
* Enable SNI by default with JNI/JSSE builds
* NetBSD GCC compiler warnings resolved
* Additional test cases and code coverage added including curve25519 and
curve448 tests
* Option for user defined mutexes with WOLFSSL_USER_MUTEX
* Sniffer APIs for loading buffer directly
* Fixes and improvements from going through the DO-178 process were added
* Doxygen updates and fixes for auto documentation generation
* Changed the configure option for FIPS Ready builds to be
`--enable-fips=ready`.
## This release of wolfSSL includes fixes for 6 security vulnerabilities.
wolfSSL version 4.5.0 contains 6 vulnerability fixes: 2 fixes for TLS 1.3,
2 side channel attack mitigations, 1 fix for a potential private key leak
in a specific use case, 1 fix for DTLS.
* In earlier versions of wolfSSL there exists a potential man in the middle
attack on TLS 1.3 clients. Malicious attackers with a privileged network
position can impersonate TLS 1.3 servers and bypass authentication. Users
that have applications with client side code and have TLS 1.3 turned on,
should update to the latest version of wolfSSL. Users that do not have
TLS 1.3 turned on, or that are server side only, are NOT affected by this
report. Thanks to Gerald Doussot from NCC group for the report.
* Denial of service attack on TLS 1.3 servers from repetitively sending
ChangeCipherSpecs messages. This denial of service results from the
relatively low effort of sending a ChangeCipherSpecs message versus the
effort of the server to process that message. Users with TLS 1.3 servers are
recommended to update to the most recent version of wolfSSL which limits the
number of TLS 1.3 ChangeCipherSpecs that can be received in order to avoid
this DoS attack. CVE-2020-12457 was reserved for the report. Thanks to
Lenny Wang of Tencent Security Xuanwu LAB.
* Potential cache timing attacks on public key operations in builds that are
not using SP (single precision). Users that have a system where malicious
agents could execute code on the system, are not using the SP build with
wolfSSL, and are doing private key operations on the system (such as signing
with a private key) are recommended to regenerate private keys and update to
the most recent version of wolfSSL. CVE-2020-15309 is reserved for this
issue. Thanks to Ida Bruhns from Universität zu Lübeck and Samira Briongos
from NEC Laboratories Europe for the report.
* When using SGX with EC scalar multiplication the possibility of side-channel
attacks are present. To mitigate the risk of side channel attacks wolfSSLs
single precision EC operations should be used instead. Release 4.5.0 turns
this on be default now with SGX builds and in previous versions of wolfSSL
this can be turned on by using the WOLFSSL_SP macros. Thank you to
Alejandro Cabrera Aldaya, Cesar Pereida García and Billy Bob Brumley from
the Network and Information Security Group (NISEC) at Tampere University for
the report.
* Leak of private key in the case that PEM format private keys are bundled in
with PEM certificates into a single file. This is due to the
misclassification of certificate type versus private key type when parsing
through the PEM file. To be affected, wolfSSL would need to have been built
with OPENSSL_EXTRA (--enable-opensslextra). Some build variants such as
--enable-all and --enable-opensslall also turn on this code path, checking
wolfssl/options.h for OPENSSL_EXTRA will show if the macro was used with the
build. If having built with the opensslextra enable option and having placed
PEM certificates with PEM private keys in the same file when loading up the
certificate file, then we recommend updating wolfSSL for this use case and
also recommend regenerating any private keys in the file.
* During the handshake, clear application_data messages in epoch 0 are
processed and returned to the application. Fixed by dropping received
application_data messages in epoch 0. Thank you to Paul Fiterau of Uppsala
University and Robert Merget of Ruhr-University Bochum for the report.
For additional vulnerability information visit the vulnerability page at
https://www.wolfssl.com/docs/security-vulnerabilities/
See INSTALL file for build instructions.
More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
# wolfSSL Release 4.4.0 (04/22/2020)
If you have questions about this release, then feel free to contact us on our
info@ address.
Release 4.4.0 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* Hexagon support.
* DSP builds to offload ECC verify operations.
* Certificate Manager callback support.
* New APIs for running updates to ChaCha20/Poly1305 AEAD.
* Support for use with Apache.
* Add support for IBM s390x.
* PKCS8 support for ED25519.
* OpenVPN support.
* Add P384 curve support to SP.
* Add BIO and EVP API.
* Add AES-OFB mode.
* Add AES-CFB mode.
* Add Curve448, X448, and Ed448.
* Add Renesas Synergy S7G2 build and hardware acceleration.
## Fixes
* Fix for RSA public encrypt / private sign with RSA key sizes over 2048-bit.
* Correct misspellings.
* Secure renegotiation fix.
* Fix memory leak when using ATECC and non-SECP256R1 curves for sign, verify,
or shared secret.
* Fix for K64 MMCAU with `WOLFSSL_SMALL_STACK_CACHE`.
* Fix the RSA verify only build.
* Fix in SP C implementation for small stack.
* Fix using the auth key id extension is set, hash might not be present.
* Fix when flattening certificate structure to include the subject alt names.
* Fixes for building with ECC sign/verify only.
* Fix for ECC and no cache resistance.
* Fix memory leak in DSA.
* Fix build on minGW.
* Fix `PemToDer()` call in `ProcessBuffer()` to set more than ECC.
* Fix for using RSA without SHA-512.
* Add some close tags to the echoserver HTTP example output.
* Miscellaneous fixes and updates for static analysis reports.
* Fixes for time structure support.
* Fixes for VxWorks support.
* Fixes for Async crypto support.
* Fix cache resist compile to work with SP C code.
* Fixes for Curve25519 x64 asm.
* Fix for SP x64 div.
* Fix for DTLS edge case where CCS and Finished come out of order and the
retransmit pool gets flushed.
* Fix for infinite loop in SHA-1 with small inputs. Thanks to Peter W.
* Fix for FIPS Hmac where `wc_HmacInit()` isn't used. `wc_HmacSetKey()` needs
to initialize the Hmac structure. Type is set to NONE, and checked against
NONE, not 0.
* Fixes for SP RSA private operations.
* Fixes for Xilinx SDK and Zynq UltraScale+ MPSoC
* Fix leak when building with HAVE_AESGCM and NO_AES_DECRYPT. Thanks G.G.
* Fixes for building ECC without ASN.
* Fix for async TLSv1.3 issues.
* Fix `wc_KeyPemToDer()` with PKCS1 and empty key.
* Omit `-fomit-frame-pointer` from CFLAGS in configure.ac.
## Improvements/Optimizations
* Qt 5.12 and 5.13 support.
* Added more digest types to Cryptocell RSA sign/verify.
* Some memory usage improvements.
* Speed improvements for mp_rand.
* Improvements to CRL and OCSP support.
* Refactor Poly1305 AEAD/MAC to reduce duplicate code.
* Add blinding to RSA key gen.
* Improvements to blinding.
* Improvement and expansion of OpenSSL Compatibility Layer.
* Improvements to ChaCha20.
* Improvements to X.509 processing.
* Improvements to ECC support.
* Improvement in detecting 64-bit support.
* Refactor to combine duplicate ECC parameter parsing code.
* Improve keyFormat to be set by algId and let later key parsing produce fail.
* Add test cases for 3072-bit and 4096-bit RSA keys.
* Improve signature wrapper and DH test cases.
* Improvements to the configure.ac script.
* Added constant time RSA q modinv p.
* Improve performance of SP Intel 64-bit asm.
* Added a few more functions to the ABI list.
* Improve TLS bidirectional shutdown behavior.
* OpenSSH 8.1 support.
* Improve performance of RSA/DH operations on x64.
* Add support for PKCS7/CMS Enveloped data with fragmented encrypted content.
* Example linker description for FIPS builds to enforce object ordering.
* C# wrapper improvements. Added TLS client example and TLSv1.3 methods.
* Allow setting MTU in DTLS.
* Improve PKCS12 create for outputting encrypted bundles.
* Constant time EC map to affine for private operations.
* Improve performance of RSA public key ops with TFM.
* Smaller table version of AES encrypt/decrypt.
* Support IAR with position independent code (ROPI).
* Improve speed of AArch64 assembly.
* Support AES-CTR on esp32.
* Add a no malloc option for small SP math.
## This release of wolfSSL includes fixes for 2 security vulnerabilities.
* For fast math, use a constant time modular inverse when mapping to affine
when operation involves a private key - keygen, calc shared secret, sign.
Thank you to Alejandro Cabrera Aldaya, Cesar Pereida García and
Billy Bob Brumley from the Network and Information Security Group (NISEC)
at Tampere University for the report.
* Change constant time and cache resistant ECC mulmod. Ensure points being
operated on change to make constant time. Thank you to Pietro Borrello at
Sapienza University of Rome.
For additional vulnerability information visit the vulnerability page at
https://www.wolfssl.com/docs/security-vulnerabilities/
See INSTALL file for build instructions.
More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
# wolfSSL Release 4.3.0 (12/20/2019)
If you have questions about this release, then feel free to contact us on our info@ address.
Release 4.3.0 of wolfSSL embedded TLS has bug fixes and new features including:
##### New Feature Additions
* Add --enable-libwebsockets option for support of libwebsockets build
* Updated support for NGINX 1.15.0 and added support for 1.16.1
* Add wc_scrypt_ex API which can take in iterations rather than cost
* Updates to RSA-PSS salt lengths. Macro WOLFSSL_PSS_SALT_LEN_DISCOVER allows for discovering the salt length. Passing RSA_PSS_SALT_LEN_DISCOVER value into wc_RsaPSS_Verify_ex attempts to discover salt length and can use larger salt lengths
* Additional OpenSSL compatibility API wolfSSL_CertManagerGetCerts and wolfSSL_X509_STORE_GetCerts for retrieving certificates
* Add support for 4096-bit RSA/DH operations to SP (single precision) build
* Update support for Google WebRTC to branch m79
* Adds new FREESCALE_MQX_5_0 macro for MQX 5.0 support
* Adds a CMS/PKCS#7 callback for signing SignedData raw digests enabled with macro HAVE_PKCS7_RSA_RAW_SIGN_CALLBACK and call to function wc_PKCS7_SetRsaSignRawDigestCb
* Add --disable-errorqueue feature to disable adding debug nodes to queue with --enable-opensslextra build
* After defining WOLFSSL_SHUTDOWNONCE macro the function wolfSSL_shutdown will return a specific error code of SSL_SHUTDOWN_ALREADY_DONE_E, to indicate to the application that the shutdown has already occurred
* Add AES-CCM decryption to benchmarking app bundled with wolfSSL
##### Fixes
* Fixes IAR warnings with IAR-EWARM 7.50.2
* Alignment fixes for mmCAU with AES and hashing algorithms
* Fix check for plaintext length when using Encrypt-Then-MAC
* Fix for unit tests with NGINX and debug mode
* Fix for macro names in test cases (WOLFSSL_PUBLIC_MP) and pkcs7.c (HAVE_AESCCM)
* Fix for Apache want read case with BIO retry flag
* Fix for PKCS7 streaming mode that would error rather than verify bundle
* Fix for freeing mutex for X509 and wolfSSL_EVP_PKEY_free, applies to OPENSSL_EXTRA / --enable-opensslextra builds
* Fix for encrypt then MAC when re-handshaking, encrypted handshakes change over to ETM now
* Fix for curve25519 assembly optimizations with GCC + AVX2
* Fix to hang onto certificate for retrieval if using secure renegotiation and session resumption
* Fixes case where the heap hint is created before WOLFSSL_CTX, when calling wc_LoadStaticMemory instead of wolfSSL_CTX_load_static_memory
* Fix for setting correct return value in PKCS12 parse error case
* Reset certificate extension policy count
* Fix for memcpy with TLS I/O buffers when using staticmemory pools and loading memory as WOLFMEM_IO_POOL_FIXED
* Fixes and updates for STM32 port, including additional mutex protection, AES-GCM decrypt auth tag, AES-CTR mode with CubeMX, update to OpenSTM32 project
* Fix for EVP CipherUpdate decrypt and add a test case
* DTLS fixes including; some DTLS sequence number issues in general where the sequence was incremented twice for each record and some offset values in the DTLS window checking
* Fix sp_add to handle carries properly (--enable-sp-math build)
* Additional sanity check on OCSP response decoder
* Fix for vasprintf with Solaris and AIX builds
* Fix for missing variable declaration with --enable-scep --with-libz build
* Fix for certificate date check with async build
* Sanity check on “out” length with Base64_Decode added
* Decode X.509 name - check input length for jurisdiction
* Additional sanity check on variable out index with DecodePolicyOID
* Fix for PKCS#12 PBKDF buffer size for buffer overflow
* TLS supported curve extension check curve name is in range before checking for disabled
* Sanity check for non TLS 1.3 cipher suite with TLS 1.3 connection
* Poly1305 AVX2 assembly optimization fix for carry with large input values
* Fixes for coverity report including null termination of test case strings and initialization of PKCS7 variables
* Fix for API visibility of wc_ed25519_check_key which resolves a wolfcrypt-py install issue
* Sanity check on max ALPN length accepted
* Additional sanity check when parsing CRLs for copying the structure, fix for bounds checking
* Additional checks on error string length for debug mode and check for null termination
* ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly
* Clear the top bit when generating a serial number
* Sanity check that ASN date characters are valid ASCII characters
* Fix to add deterministic ECDSA and fix corner cases for add point.
* When getting the DH public key, initialize the P, G, and Pub pointers to NULL, then set that we own the DH parameters flag. This allows FreeSSL to correctly clean up the DH key.
##### Improvements/Optimizations
* Added configure error report with using invalid build of --enable-opensslextra and --enable-opensslcoexist together
* Update PKCS11 for determining key type given the private key type
* Update DoVerifyCallback to check verify param hostName and ipasc (--enable-opensslextra builds)
* additional null sanity checks on input arguments with QSH and Cryptocell builds
* Additional checks on RSA key added to the function wc_CheckRsaKey
* Updates for EBSNET support, including fseek, revised macros in settings.h, and realloc support
* MISRA-C updates for SP math code
* Update to allow compiling for pwdbased/PBKDF2 with having NO_ASN defined
* Modify KeyShare and PreSharedKey TLS 1.3 extension linked list advancement to be easier for compilers to handle
* Optimization to parsing certificate extension name strings
* Adjustment to example server -x runtime behavior when encountering an unrecoverable error case
* Remove Blake2b support from HMAC
* Adds new hash wrapper init wc_HashInit_ex and Adds new PBKDF2 API wc_PBKDF2_ex for using heap hints for custom memory pools
* Adding script to cleanup generated test files, scripts/cleanup_testfiles.sh
* Support 20-byte serial numbers and disallow 0
* sp_div improved to handle when a has less digits than d (--enable-sp-math build)
* When decoding a policy OID and turning it into a human readable string use snprintf()
* set the IV length of EVP AES GCM to 96-bits by default
* Allow adding CAs for root CA's over the wire that do not have the extended key usage cert_sign set
* Added logging messages for SendAlert call and update to send alert after verify certificate callback
* updates for synchronous OCTEON support in the Sniffer
* Rework BER to DER functions to not be recursive
* Updates to find CRL by AuthKeyId
* Add a check for subject name hash after matching AKID
* Enhancement to mp_invmod/fp_exptmod/sp_exptmod to handle more inputs
* Remove requirement for macro NO_SKID when CRL use is enabled
* Improvements on XFTELL return code and MAX_WOLFSSL_FILE_SIZE checking
* When checking if value is prime return NO in the case of the value 1
* Improve Cortex-M RSA/DH assembly code performance
* Additional sanity checks on arrays and buffers with OCSP
##### This release of wolfSSL includes a fix for 6 security vulnerabilities.
A fix for having an additional sanity check when parsing certificate domain names was added. This fix checks that the domain name location index is not past the maximum value before setting it. The reported issue affects users that are parsing certificates and have --enable-opensslextra (macro OPENSSL_EXTRA), or build options that turn this on such as --enable-all, when building wolfSSL. The CVE associated with the fix is CVE-2019-18840.
Fix to set a limit on the maximum size of DTLS handshake messages. By default the RFC allows for handshake message sizes of up to 2^24-1 bytes long but in typical field use cases the handshake messages are not this large. Setting a maximum size limit on the handshake message helps avoid a potential DoS attack due to memory being mallocd. The new default max size is set to handle a certificate chain length of approximately 9, 2048 bit RSA certificates. This only effects builds that have DTLS turned on and have applications that are using DTLS.
Fix for a potential hang when ECC caching is enabled (off by default) and --enable-fastmath is used. ECC caching is off by default and is turned on in builds that are using --enable-all or --enable-fpecc. This issue does not affect builds that are using the macro WOLFSSL_VALIDATE_ECC_IMPORT which turns on validating all ECC keys that are imported. To fix this potential hang case a sanity check on the input values to the internal invmod function was added.
To fix a potential fault injection attack on a wrapper function for wolfCrypt RSA signature generations an additional sanity check verifying the signature after its creation was added. This check is already done automatically in current versions of wolfSSL with TLS connections (internal function call of VerifyRsaSign during TLS state machine). The report only affects users making calls to the wolfCrypt function wc_SignatureGenerateHash and does not affect current TLS use cases. Thanks to Daniel Moghimi (@danielmgmi) from Worcester Polytechnic Institute for the report.
Blinding was added for DSA signing operations. The DSA signing uses the BEEA algorithm during modular inversion of the nonce which can potentially leak the nonce through side channels such as cache and power fluctuations. The fix of adding in blinding makes the DSA signing operation more resistant to side channel attacks. Users who have turned on DSA (disabled by default) and are performing signing operations should update. Note that DSA is not used in any TLS connections. Thanks to Daniel Moghimi (@danielmgmi) from Worcester Polytechnic Institute for the report.
Fix to add additional side channel cache attack resistance to the internal ECC function wc_ecc_mulmod_ex. This function by default is used with ECDSA signing operations. Users should update if performing ECDSA singing operations (server side ECC TLS connections, mutual authentication on client side) or calling wolfCrypt ECC sign functions and have the potential for outside users to perform sophisticated monitoring of the cache.Thanks to Daniel Moghimi (@danielmgmi) from Worcester Polytechnic Institute for the report.
For additional vulnerability information visit the vulnerability page at https://www.wolfssl.com/docs/security-vulnerabilities/
See INSTALL file for build instructions.
More info can be found on-line at http://wolfssl.com/wolfSSL/Docs.html
# wolfSSL Release 4.2.0 (10/22/2019)
If you have questions about this release, then feel free to contact us on our info@ address.
@@ -21,13 +556,13 @@ Release 4.2.0 of wolfSSL embedded TLS has bug fixes and new features including:
* Addition to configure.ac for FIPS wolfRand builds
* Adding the flag WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY for ignoring certificate date checks with the functions wolfSSL_CTX_load_verify_buffer_ex and wolfSSL_CTX_load_verify_locations_ex
* Support for PKCS8 keys added to the function wolfSSL_CTX_use_PrivateKey_buffer
* Support for KECCAK hashing. Build with macro WOLFSSL_HASH_FLAGS and call wc_Sha3_SetFlags(&sha, WC_HASH_SHA3_KECCAK256) before the first SHA3 update
* Support for KECCAK hashing. Build with macro WOLFSSL_HASH_FLAGS and call wc_Sha3_SetFlags(&sha, WC_HASH_SHA3_KECCAK256) before the first SHA3 update
* Addition of setting secure renegotiation at CTX level
* Addition of KDS (NXP Kinetis Design Studio) example project to directory IDE/KDS/
* Support for Encrypt-Then-MAC to TLS 1.2 and below
* Added a new build option for a TITAN session cache that can hold just over 2 million session entries (--enable-titancache)
* Added a new build option for a TITAN session cache that can hold just over 2 million session entries (--enable-titancache)
* Synchronous Quick Assist Support for Sniffer
* Added Support for SiFive HiFive Unleashed board
* Added Support for SiFive HiFive Unleashed board
* Support for Google WebRTC added in to compatibility layer build
* Additional Sniffer features; IPv6 sniffer support, Fragment chain input, Data store callback, Various statistics tweaks and other Sniffer fixes
@@ -62,7 +597,7 @@ Release 4.2.0 of wolfSSL embedded TLS has bug fixes and new features including:
* Optimization to SP math, changing variables to const where possible. Thanks to Yair Poleg (yair.poleg@ayyeka.com) of Ayyeka for proposing static declaration of global constant variables in SP code
* Additional fuzz testing and fixes for TLS 1.3 use, including additional TLS 1.3 alert messages (PR#2440 for more information)
* Additional sanity check that ciphersuite from client hello is used in server hello response (check can be removed with the macro WOLFSSL_NO_STRICT_CIPHER_SUITE)
* Improved MMCAU performance: SHA-1 by 35%, SHA-256 by 20% and MD5 by 78%
* Improved MMCAU performance: SHA-1 by 35%, SHA-256 by 20% and MD5 by 78%
* By default, disallow SHA-2 cipher suites from being used in TLS 1.0 and 1.1 handshakes (can be ignored with macro WOLFSSL_OLDTLS_SHA2_CIPHERSUITES)
* Optimization of export session buffer size with enable option --enable-sessionexport=nopeer
* Spelling fixes in comments and some cast warnings resolved
@@ -602,7 +1137,7 @@ This release includes many performance improvements with Intel ASM (AVX/AVX2) an
* Fixes to allow custom serial number during certificate generation
* Add method to get WOLFSSL_CTX certificate manager
* Improvement to `wolfSSL_SetOCSP_Cb` to allow context per WOLFSSL object
* Alternate certificate chain support `WOLFSSL_ALT_CERT_CHAINS`. Enables checking cert against multiple CA's.
* Alternate certificate chain support `WOLFSSL_ALT_CERT_CHAINS`. Enables checking cert against multiple CA's.
* Added new `--disable-oldnames` option to allow for using openssl along-side wolfssl headers (without OPENSSL_EXTRA).
* Refactor SSL_ and hashing types to use wolf specific prefix (WOLFSSL and WC_) to allow openssl coexistence.
* Fixes for HAVE_INTEL_MULX
@@ -722,7 +1257,7 @@ More info can be found on-line at http://wolfssl.com/wolfSSL/Docs.html
- Added support for HAproxy load balancer
- Added option to allow SHA1 with TLS 1.2 for IIS compatibility (WOLFSSL_ALLOW_TLS_SHA1)
- Added Curve25519 51-bit Implementation, increasing performance on systems that have 128 bit types
- Fix to not send session ID on server side if session cache is off unless we're echoing
- Fix to not send session ID on server side if session cache is off unless we're echoing
session ID as part of session tickets
- Fixes for ensuring all default ciphers are setup correctly (see PR #830)
- Added NXP Hexiwear example in `IDE/HEXIWEAR`.
@@ -730,7 +1265,7 @@ session ID as part of session tickets
- Fixes for TLS elliptic curve selection on private key import.
- Fixes for RNG with Intel rdrand and rdseed speedups.
- Improved performance with Intel rdrand to use full 64-bit output
- Added new --enable-intelrand option to indicate use of RDRAND preference for RNG source
- Added new --enable-intelrand option to indicate use of RDRAND preference for RNG source
- Removed RNG ARC4 support
- Added ECC helpers to get size and id from curve name.
- Added ECC Cofactor DH (ECC-CDH) support
@@ -899,7 +1434,7 @@ More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
- Add helper functions for static memory option to allow getting optimum buffer
sizes.
- Update DTLS behavior on bad MAC. DTLS silently drops packets with bad MACs now.
- Update fp_isprime function from libtom enchancement/cleanup repository.
- Update fp_isprime function from libtom enhancement/cleanup repository.
- Update sanity checks on inputs and return values for AES-CMAC.
- Update wolfSSL for use with MYSQL v5.6.30.
- Update LPCXpresso eclipse project to not include misc.c when not needed.
@@ -1226,7 +1761,7 @@ More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html
the Prosecco team at INRIA Paris-Rocquencourt for the report.
- FIPS version submitted
- Removes SSLv2 Client Hello processing, can be enabled with OLD_HELLO_ALLOWED
- User can set mimimum downgrade version with CyaSSL_SetMinVersion()
- User can set minimum downgrade version with CyaSSL_SetMinVersion()
- Small stack improvements at TLS/SSL layer
- TLS Master Secret generation and Key Expansion are now exposed
- Adds client side Secure Renegotiation, * not recommended *
@@ -1353,7 +1888,7 @@ and comments about the new features please check the manual.
handling and reduce memory fragmentation on I/O large sizes
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1364,7 +1899,7 @@ and comments about the new features please check the manual.
- Freescale Kinetis mmCAU support
- TLS Hello extensions
- ECC
- Secure Renegotiation (null)
- Secure Renegotiation (null)
- Truncated HMAC
- SCEP support
- PKCS #7 Enveloped data and signed data
@@ -1411,7 +1946,7 @@ http://cache.freescale.com/files/32bit/doc/user_guide/CAUAPIUG.pdf
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1437,7 +1972,7 @@ and comments about the new features please check the manual.
When compiling with Mingw, libtool may give the following warning due to
path conversion errors:
```
libtool: link: Could not determine host file name corresponding to **
libtool: link: Continuing, but uninstalled executables may not work.
@@ -1447,7 +1982,7 @@ If so, examples and testsuite will have problems when run, showing an
error while loading shared libraries. To resolve, please run "make install".
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1469,7 +2004,7 @@ and comments about the new features please check the manual.
13 bytes DTLS headers, but every effort is now made to align with the
CYASSL_GENERAL_ALIGNMENT flag which sets desired alignment requirement
- NO_64BIT flag to turn off 64bit data type accumulators in public key code
* Note, some systems are faster with 32bit accumulators
* Note, some systems are faster with 32bit accumulators
- --enable-stacksize for example client/server stack use
* Note, modern desktop Operating Systems may add bytes to each stack frame
- Updated compression/decompression with direct crypto access
@@ -1490,19 +2025,19 @@ and comments about the new features please check the manual.
* dh
* dsa
* md5
* sha
* sha
* arc4
* null (allow NULL ciphers)
* oldtls (only use TLS 1.2)
* asn (no certs or public keys allowed)
- ./configure generates cyassl/options.h which allows a header the user can
- ./configure generates cyassl/options.h which allows a header the user can
include in their app to make sure the same options are set at the app and
CyaSSL level.
- autoconf no longer needs serial-tests which lowers version requirements of
automake to 1.11 and autoconf to 2.63
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1520,7 +2055,7 @@ and comments about the new features please check the manual.
- Camellia crypto and cipher suites
- Bumped minimum autoconf version to 2.65, automake version to 1.12
- Addition of OCSP callbacks
- STM32F2 support with hardware crypto and RNG
- STM32F2 support with hardware crypto and RNG
- Cavium NITROX support
CTaoCrypt now has support for the Microchip PIC32 and has been tested with
@@ -1533,7 +2068,7 @@ To add Cavium NITROX support do:
./configure --with-cavium=/home/user/cavium/software
pointing to your licensed cavium/software directory. Since Cavium doesn't
build a library we pull in the cavium_common.o file which gives a libtool
build a library we pull in the cavium_common.o file which gives a libtool
warning about the portability of this. Also, if you're using the github source
tree you'll need to remove the -Wredundant-decls warning from the generated
Makefile because the cavium headers don't conform to this warning. Currently
@@ -1546,11 +2081,11 @@ test and benchmark. Please see the HAVE_CAVIUM define.
CyaSSL is able to use the STM32F2 hardware-based cryptography and random number
generator through the STM32F2 Standard Peripheral Library. For necessary
defines, see the CYASSL_STM32F2 define in settings.h. Documentation for the
STM32F2 Standard Peripheral Library can be found in the following document:
STM32F2 Standard Peripheral Library can be found in the following document:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/USER_MANUAL/DM00023896.pdf
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1578,7 +2113,7 @@ K70 Sub-Family Reference Manual:
http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K70P256M150SF3RM.pdf
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1590,7 +2125,7 @@ and comments about the new features please check the manual.
- Updated build process
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1609,7 +2144,7 @@ and comments about the new features please check the manual.
- DTLS Cookie support, reliability coming soon
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1622,13 +2157,13 @@ and comments about the new features please check the manual.
- Add static ECDH suites
- SHA-384 support
- ECC client certificate support
- Add medium session cache size (1055 sessions)
- Add medium session cache size (1055 sessions)
- Updated unit tests
- Protection against mutex reinitialization
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1645,7 +2180,7 @@ and comments about the new features please check the manual.
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1664,7 +2199,7 @@ and comments about the new features please check the manual.
- Export Base64_Encode for general use
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1681,7 +2216,7 @@ and comments about the new features please check the manual.
- Microchip pic32 support
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
@@ -1705,7 +2240,7 @@ changes are required.
Special Thanks to Brian Aker for his autoconf, install, and header patches.
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
# CyaSSL Release 2.0.0rc2 (6/6/2011)
@@ -1724,21 +2259,21 @@ This is the 2nd and perhaps final release candidate for version 2.
Please send any comments or questions to support@yassl.com.
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
# CyaSSL Release 2.0.0rc1 (5/2/2011)
#### Release 2.0.0rc1 for CyaSSL has many new features including:
- bug fixes
- SHA-256 cipher suites
- Root Certificate Verification (instead of needing all certs in the chain)
- PKCS #8 private key encryption (supports PKCS #5 v1-v2 and PKCS #12)
- Serial number retrieval for x509
- PBKDF2 and PKCS #12 PBKDF
- UID parsing for x509
- SHA-256 certificate signatures
- Client and server can send chains (SSL_CTX_use_certificate_chain_file)
- SHA-256 cipher suites
- Root Certificate Verification (instead of needing all certs in the chain)
- PKCS #8 private key encryption (supports PKCS #5 v1-v2 and PKCS #12)
- Serial number retrieval for x509
- PBKDF2 and PKCS #12 PBKDF
- UID parsing for x509
- SHA-256 certificate signatures
- Client and server can send chains (SSL_CTX_use_certificate_chain_file)
- CA loading can now parse multiple certificates per file
- Dynamic memory runtime hooks
- Runtime hooks for logging
@@ -1757,7 +2292,7 @@ options that CyaSSL allows, there may be some configuration fixes needed.
Please send any comments or questions to support@yassl.com.
The CyaSSL manual is available at:
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
http://www.yassl.com/documentation/CyaSSL-Manual.pdf. For build instructions
and comments about the new features please check the manual.
# CyaSSL Release 1.9.0 (3/2/2011)
@@ -1785,13 +2320,13 @@ build instructions and comments about the new features please check the manual.
Please send any comments or questions to support@yassl.com.
Happy Holidays.
# CyaSSL Release 1.6.5 (9/9/2010)
Release 1.6.5 for CyaSSL adds bug fixes and x509 v3 self signed certificate
generation.
For general build instructions see doc/Building_CyaSSL.pdf.
To enable certificate generation support add this option to ./configure
@@ -1804,7 +2339,7 @@ in doc/CyaSSL_Extensions_Reference.pdf item 11.
Release 1.6.0 for CyaSSL adds bug fixes, RIPEMD-160, SHA-512, and RSA key
generation.
For general build instructions see doc/Building_CyaSSL.pdf.
To add RIPEMD-160 support add this option to ./configure
@@ -1827,7 +2362,7 @@ CyaSSL.
Release 1.5.6 for CyaSSL adds bug fixes, compatibility for our JSSE provider,
and a fix for GCC builds on some systems.
For general build instructions see doc/Building_CyaSSL.pdf.
To add AES-NI support add this option to ./configure
@@ -1837,9 +2372,9 @@ You'll need GCC 4.4.3 or later to make use of the assembly.
# CyaSSL Release 1.5.4 (7/7/2010)
Release 1.5.4 for CyaSSL adds bug fixes, support for AES-NI, SHA1 speed
Release 1.5.4 for CyaSSL adds bug fixes, support for AES-NI, SHA1 speed
improvements from loop unrolling, and support for the Mongoose Web Server.
For general build instructions see doc/Building_CyaSSL.pdf.
To add AES-NI support add this option to ./configure
@@ -1871,7 +2406,7 @@ please send questions or comments to support@yassl.com.
When doing load testing with CyaSSL, on the echoserver example say, the client
machine may run out of tcp ephemeral ports, they will end up in the TIME_WAIT
queue, and can't be reused by default. There are generally two ways to fix
this.
this.
1. Reduce the length sockets remain on the TIME_WAIT queue OR
2. Allow items on the TIME_WAIT queue to be reused.
@@ -1893,7 +2428,7 @@ works but seems to remove sockets from TIME_WAIT entirely?
`sudo sysctl -w net.ipv4.tcp_fin_timeout=1`
doen't control TIME_WAIT, it controls FIN_WAIT(2) contrary to some posts
doesn't control TIME_WAIT, it controls FIN_WAIT(2) contrary to some posts
# CyaSSL Release 1.4.0 (2/18/2010)
@@ -1929,7 +2464,7 @@ SSL_METHOD *TLSv1_2_server_method(void);
SSL_METHOD *TLSv1_2_client_method(void);
```
CyaSSL was tested against lighttpd 1.4.23. To build CyaSSL for use with
CyaSSL was tested against lighttpd 1.4.23. To build CyaSSL for use with
lighttpd use the following commands from the CyaSSL install dir <CyaSSLDir>:
```
@@ -2114,7 +2649,7 @@ This gives warnings for some symbols but seems to work.
./configure
make
from the ./testsuite/ directory run ./testsuite
from the ./testsuite/ directory run ./testsuite
#### To make a debug build:
@@ -2133,7 +2668,7 @@ Run the testsuite program
# CyaSSL version 0.9.9 (7/25/2008)
# CyaSSL version 0.9.9 (7/25/2008)
This release of CyaSSL adds bug fixes, Pre-Shared Keys, over-rideable memory
handling, and optionally TomsFastMath. Thanks to Moisés Guimarães for the
@@ -2153,7 +2688,7 @@ yet use -m64 because of GCCs inability to do 128bit division.
See notes below (0.2.0) for complete build instructions.
# CyaSSL version 0.9.8 (5/7/2008)
# CyaSSL version 0.9.8 (5/7/2008)
This release of CyaSSL adds bug fixes, client side Diffie-Hellman, and better
socket handling.
@@ -2161,7 +2696,7 @@ socket handling.
See notes below (0.2.0) for complete build instructions.
# CyaSSL version 0.9.6 (1/31/2008)
# CyaSSL version 0.9.6 (1/31/2008)
This release of CyaSSL adds bug fixes, increased session management, and a fix
for gnutls.
@@ -2169,15 +2704,15 @@ for gnutls.
See notes below (0.2.0) for complete build instructions.
# CyaSSL version 0.9.0 (10/15/2007)
# CyaSSL version 0.9.0 (10/15/2007)
This release of CyaSSL adds bug fixes, MSVC 2005 support, GCC 4.2 support,
This release of CyaSSL adds bug fixes, MSVC 2005 support, GCC 4.2 support,
IPV6 support and test, and new test certificates.
See notes below (0.2.0) for complete build instructions.
# CyaSSL version 0.8.0 (1/10/2007)
# CyaSSL version 0.8.0 (1/10/2007)
This release of CyaSSL adds increased socket support, for non-blocking writes,
connects, and interrupted system calls.
@@ -2185,7 +2720,7 @@ connects, and interrupted system calls.
See notes below (0.2.0) for complete build instructions.
# CyaSSL version 0.6.3 (10/30/2006)
# CyaSSL version 0.6.3 (10/30/2006)
This release of CyaSSL adds debug logging to stderr to aid in the debugging of
CyaSSL on systems that may not provide the best support.
@@ -2203,19 +2738,19 @@ To turn logging back off call CyaSSL_Debugging_OFF()
See notes below (0.2.0) for complete build instructions.
# CyaSSL version 0.6.2 (10/29/2006)
# CyaSSL version 0.6.2 (10/29/2006)
This release of CyaSSL adds TLS 1.1.
Note that CyaSSL has certificate verification on by default, unlike OpenSSL.
To emulate OpenSSL behavior, you must call SSL_CTX_set_verify() with
SSL_VERIFY_NONE. In order to have full security you should never do this,
SSL_VERIFY_NONE. In order to have full security you should never do this,
provide CyaSSL with the proper certificates to eliminate impostors and call
CyaSSL_check_domain_name() to prevent man in the middle attacks.
See notes below (0.2.0) for build instructions.
# CyaSSL version 0.6.0 (10/25/2006)
# CyaSSL version 0.6.0 (10/25/2006)
This release of CyaSSL adds more SSL functions, better autoconf, nonblocking
I/O for accept, connect, and read. There is now an --enable-small configure
@@ -2225,7 +2760,7 @@ for the defines. Note that TLS requires HMAC and AES requires TLS.
See notes below (0.2.0) for build instructions.
# CyaSSL version 0.5.5 (09/27/2006)
# CyaSSL version 0.5.5 (09/27/2006)
This mini release of CyaSSL adds better input processing through buffered input
and big message support. Added SSL_pending() and some sanity checks on user
@@ -2234,23 +2769,23 @@ settings.
See notes below (0.2.0) for build instructions.
# CyaSSL version 0.5.0 (03/27/2006)
# CyaSSL version 0.5.0 (03/27/2006)
This release of CyaSSL adds AES support and minor bug fixes.
This release of CyaSSL adds AES support and minor bug fixes.
See notes below (0.2.0) for build instructions.
# CyaSSL version 0.4.0 (03/15/2006)
This release of CyaSSL adds TLSv1 client/server support and libtool.
This release of CyaSSL adds TLSv1 client/server support and libtool.
See notes below for build instructions.
# CyaSSL version 0.3.0 (02/26/2006)
This release of CyaSSL adds SSLv3 server support and session resumption.
This release of CyaSSL adds SSLv3 server support and session resumption.
See notes below for build instructions.
@@ -2276,7 +2811,7 @@ with support for SHA-1 and MD5 digests. Ciphers include 3DES and RC4.
./configure
make
from the ./testsuite/ directory run ./testsuite
from the ./testsuite/ directory run ./testsuite
#### to make a debug build:

View File

@@ -1,6 +1,6 @@
/* wolfssl_client.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* wolfssl_server.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -32,6 +32,14 @@ if [ "$DIR" = "ARDUINO" ]; then
mv ./wolfSSL/bio.c ./wolfSSL/wolfssl
mv ./wolfSSL/evp.c ./wolfSSL/wolfssl
# make a copy of evp.c and bio.c for ssl.c to include inline
cp ./wolfSSL/wolfssl/evp.c ./wolfSSL/wolfcrypt/src/evp.c
cp ./wolfSSL/wolfssl/bio.c ./wolfSSL/wolfcrypt/src/bio.c
# copy openssl compatibility headers to their appropriate location
mkdir ./wolfSSL/wolfssl/openssl
cp ../../wolfssl/openssl/* ./wolfSSL/wolfssl/openssl
echo "/* Generated wolfSSL header file for Arduino */" > ./wolfSSL/wolfssl.h
echo "#include <wolfssl/wolfcrypt/settings.h>" >> ./wolfSSL/wolfssl.h
echo "#include <wolfssl/ssl.h>" >> ./wolfSSL/wolfssl.h

View File

@@ -22,13 +22,15 @@ The `IDE/CRYPTOCELL/main.c` example application provides a function to run the s
- SHA-256
- AES CBC
- CryptoCell 310 RNG
- RSA sign/verify and RSA key gen
- RSA sign/verify and RSA key gen (2048 bit in PKCSv1.5 padding mode)
- RSA encrypt/decrypt
- ECC sign/verify/shared secret
- ECC key import/export and key gen pairs
- Hardware RNG
- RTC for benchmark timing source
Note: All Cryptocell features are not supported. The wolfcrypt RSA API allows import and export of Private/Public keys in DER format. However, this is not possible with key pairs generated with Cryptocell because the importing/exporting Cryptocell keys has not been implemented yet.
## Setup
### Setting up Nordic SDK with wolfSSL
1. Download the wolfSSL source code or a zip file from GitHub and place it under your SDK `InstallFolder/external/` directory. You can also copy or simlink to the source.

View File

@@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2019 wolfSSL Inc.
* Copyright (C) 2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2019 wolfSSL Inc.
* Copyright (C) 2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* deos_malloc.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* tls_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -380,10 +380,7 @@ void wolfssl_server_test(uintData_t statusPtr)
int socketAddrLen=sizeof(sockaddr);
char rx_buf[RX_BUF_SIZE];
char tx_buf[TX_BUF_SIZE];
unsigned char attempt_conn;
clientConnectionHandleType TCPserverHandle;
void * sendBuffer;
DWORD bufferSizeInBytes;
WOLFSSL * ssl;
WOLFSSL_CTX * ctx;
@@ -572,7 +569,6 @@ int wolfsslRunTests (void)
{
thread_handle_t TCPhandle;
threadStatus ts;
int ret;
#if !defined(NO_CRYPT_TEST)
wolfcrypt_test(NULL);

View File

@@ -1,6 +1,6 @@
/* tls_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,7 +1,7 @@
# Micrium μC/OS-III Port
## Overview
You can enable the wolfSSL support for Micrium μC/OS-III RTOS available [here](http://www.micriums.com/) using the define `MICRIUM`.
You can enable the wolfSSL support for Micrium μC/OS-III RTOS available [here](http://www.micrium.com/) using the define `MICRIUM`.
## Usage
@@ -72,7 +72,7 @@ The test results below were collected from the NXP Kinetis K70 (Freescale TWR-K7
- IAR Embedded Workbench IDE - ARM 8.32.1 (IAR ELF Linker V8.32.1.169/W32 for ARM)
- The starting project is based on an IAR EWARM project from Micrium download center at [micrium_twr-k70f120m-os3/](https://www.micrium.com/download/micrium_twr-k70f120m-os3/) but the K70X_FLASH.icf linker script file was slightly modified to configure the stack and heap sizes to 16KB and 20KB. The test was run on a 1 MBytes of program flash and 128 KBytes of static RAM.
- The starting project is based on an IAR EWARM project from Micrium download center at [micrium_twr-k70f120m-os3/](https://www.micrium.com/download/micrium_twr-k70f120m-os3/) but the K70X_FLASH.icf linker script file was slightly modified to configure the stack and heap sizes to 16KB and 20KB. The test was run on a 1 MBytes of program flash and 128 KBytes of static RAM. ([Similar TCP version](https://www.micrium.com/download/twr-k70f120m_os3-tcpip-wifi-lib/))
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)

View File

@@ -1,6 +1,6 @@
/* client_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* client_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* server_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* server_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* wolfsslRunTests.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -0,0 +1,175 @@
# RT-Thread Port
## Overview
You can enable the wolfSSL support for RT-Thread available [here](https://www.rt-thread.io) using the define `RTTHREAD`.
## Usage
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/RTTHREAD/user_settings.h` file.
The `wolfssl_test.c` example application provides a simple function to run the test and benchmark.
1. Open your IDE-based example project for RT-Thread.
2. Create the following folder and sub-folders structures in your project.
```
wolfssl
|src
|wolfcrypt
|benchmark
|src
|test
|wolfssl
|openssl
|wolfcrypt
|example
```
The folder hierarchy is the same as the wolfSSL folders with an exception of the example folder.
3. Add or link all of the header and source files in `IDE/ECLIPSE/RTTHREAD/` folder into the example folder.
4. Add or link all the source code in the corresponding folder in wolfSSL.
5. Remove non-C platform dependent files from your build.
6. In your C/C++ compiler preprocessor settings, add the wolfSSL directories to your include paths.
Here's an example of the paths that must be added.
```
$PROJ_DIR$\...
$PROJ_DIR$\...\wolfcrypt
$PROJ_DIR$\...\wolfssl
$PROJ_DIR$\...\IDE\ECLIPSE\RTTHREAD
```
7. In your C/C++ compiler preprocessor settings, define the WOLFSSL_USER_SETTINGS symbol to add user_settings.h file in your project.
8. Add a call to `wolfssl_test()` from your startup task. Here's an example:
```c
static void test_task (void *p_arg)
{
...
while (1) {
wolfssl_test();
rt_thread_mdelay(500);
}
}
```
9. Rebuild all your project.
10. Now you are ready to download and debug your image on the board.
The test results below were collected from the RT-Thread ART-Pi with the following software and tool chains:
- STM32H750XBH6
- RT-Thread Studio (Version: 2.0.0)
- GNU ARM Cross C Compiler (Optimization level: -O0)
- The starting project is based on [RT-Thread ART-Pi SDK](https://github.com/RT-Thread-Studio/sdk-bsp-stm32h750-realthread-artpi) (./projects/art_pi_wifi)
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
### `WOLFSSL_WOLFCRYPT_TEST` output of wolfcrypt_test()
```
error test passed!
MEMORY test passed!
base64 test passed!
asn test passed!
RANDOM test passed!
MD5 test passed!
MD4 test passed!
SHA test passed!
SHA-256 test passed!
SHA-512 test passed!
Hash test passed!
HMAC-MD5 test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
HMAC-SHA512 test passed!
X963-KDF test passed!
GMAC test passed!
ARC4 test passed!
HC-128 test passed!
Rabbit test passed!
DES test passed!
DES3 test passed!
AES test passed!
AES192 test passed!
AES256 test passed!
AES-GCM test passed!
AES Key Wrap test passed!
RSA test passed!
DH test passed!
DSA test passed!
PWDBASED test passed!
ECC test passed!
ECC buffer test passed!
CURVE25519 test passed!
ED25519 test passed!
PKCS7encrypted test passed!
PKCS7signed test passed!
PKCS7enveloped test passed!
PKCS7authenveloped test passed!
logging test passed!
mutex test passed!
memcb test passed!
```
### `WOLFSSL_BENCHMARK_TEST` output of benchmark_test()
```
------------------------------------------------------------------------------
wolfSSL version 4.5.0
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 50 KB took 1.000 seconds, 50.000 KB/s
AES-128-CBC-enc 2 MB took 1.000 seconds, 2.075 MB/s
AES-128-CBC-dec 2 MB took 1.000 seconds, 1.611 MB/s
AES-192-CBC-enc 2 MB took 1.000 seconds, 2.002 MB/s
AES-192-CBC-dec 2 MB took 1.000 seconds, 1.514 MB/s
AES-256-CBC-enc 2 MB took 1.000 seconds, 1.855 MB/s
AES-256-CBC-dec 1 MB took 1.000 seconds, 1.465 MB/s
AES-128-GCM-enc 700 KB took 1.000 seconds, 700.000 KB/s
AES-128-GCM-dec 675 KB took 1.000 seconds, 675.000 KB/s
AES-192-GCM-enc 675 KB took 1.000 seconds, 675.000 KB/s
AES-192-GCM-dec 675 KB took 1.000 seconds, 675.000 KB/s
AES-256-GCM-enc 650 KB took 1.000 seconds, 650.000 KB/s
AES-256-GCM-dec 650 KB took 1.000 seconds, 650.000 KB/s
AES-128-ECB-enc 2 MB took 1.000 seconds, 1.902 MB/s
AES-128-ECB-dec 2 MB took 1.000 seconds, 1.521 MB/s
AES-192-ECB-enc 2 MB took 1.000 seconds, 1.780 MB/s
AES-192-ECB-dec 1 MB took 1.000 seconds, 1.433 MB/s
AES-256-ECB-enc 2 MB took 1.000 seconds, 1.638 MB/s
AES-256-ECB-dec 1 MB took 1.000 seconds, 1.405 MB/s
ARC4 5 MB took 1.000 seconds, 4.956 MB/s
RABBIT 6 MB took 1.000 seconds, 6.470 MB/s
3DES 750 KB took 1.000 seconds, 750.000 KB/s
MD5 12 MB took 1.000 seconds, 12.061 MB/s
SHA 4 MB took 1.000 seconds, 3.979 MB/s
SHA-256 2 MB took 1.000 seconds, 1.782 MB/s
SHA-512 1 MB took 1.000 seconds, 1.001 MB/s
HMAC-MD5 12 MB took 1.000 seconds, 12.329 MB/s
HMAC-SHA 4 MB took 1.000 seconds, 3.662 MB/s
HMAC-SHA256 2 MB took 1.000 seconds, 1.758 MB/s
HMAC-SHA512 1 MB took 1.000 seconds, 1.001 MB/s
PBKDF2 224 bytes took 1.000 seconds, 224.000 bytes/s
RSA 2048 public 20 ops took 1.000 sec, avg 50.000 ms, 20.000 ops/sec
RSA 2048 private 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
DH 2048 key gen 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
DH 2048 agree 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
ECC 256 key gen 6 ops took 1.000 sec, avg 166.667 ms, 6.000 ops/sec
ECDHE 256 agree 6 ops took 1.000 sec, avg 166.667 ms, 6.000 ops/sec
ECDSA 256 sign 6 ops took 1.000 sec, avg 166.667 ms, 6.000 ops/sec
ECDSA 256 verify 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
CURVE 25519 key gen 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
CURVE 25519 agree 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
ED 25519 key gen 4 ops took 1.000 sec, avg 250.000 ms, 4.000 ops/sec
ED 25519 sign 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
ED 25519 verify 2 ops took 1.000 sec, avg 500.000 ms, 2.000 ops/sec
```
## References
For more information please contact info@wolfssl.com.

View File

@@ -0,0 +1,8 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST += \
IDE/ECLIPSE/RTTHREAD/README.md \
IDE/ECLIPSE/RTTHREAD/user_settings.h \
IDE/ECLIPSE/RTTHREAD/wolfssl_test.c

View File

@@ -0,0 +1,81 @@
/* user_setting.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef WOLFSSL_USER_SETTINGS_H_
#define WOLFSSL_USER_SETTINGS_H_
#ifdef __cplusplus
extern "C" {
#endif
#define RTTHREAD
/* You can select one or all of the following tests */
#define WOLFSSL_WOLFCRYPT_TEST
#define WOLFSSL_BENCHMARK_TEST
#define WOLFSSL_CLIENT_TEST
#define WOLFSSL_SERVER_TEST
#define USE_TEST_GENSEED
#define NO_DEV_RANDOM
#define HAVE_PKCS7
#define HAVE_AES_KEYWRAP
#define HAVE_X963_KDF
#define WOLFSSL_AES_DIRECT
/* adjust CURRENT_UNIX_TS to seconds since Jan 01 1970. (UTC)
You can get the current time from https://www.unixtimestamp.com/
*/
#define CURRENT_UNIX_TS 1542605837UL
/* When using Windows simulator, you must define USE_WINDOWS_API for test.h to build */
#ifdef _WIN32
#define USE_WINDOWS_API
#endif
#define NO_FILESYSTEM
#define SIZEOF_LONG_LONG 8
/* prevents from including multiple definition of main() */
#define NO_MAIN_DRIVER
#define NO_TESTSUITE_MAIN_DRIVER
/* includes certificate test buffers via header files */
#define USE_CERT_BUFFERS_2048
/*use kB instead of mB for embedded benchmarking*/
#define BENCH_EMBEDDED
#define NO_WRITE_TEMP_FILES
#define XSNPRINTF snprintf
#define NO_WRITEV
#define HAVE_AESGCM
#define WOLFSSL_SHA512
#define HAVE_ECC
#define HAVE_CURVE25519
#define CURVE25519_SMALL
#define HAVE_ED25519
#define ED25519_SMALL
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif

View File

@@ -0,0 +1,33 @@
/* wolfsslRunTests.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <stdint.h>
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>
int wolfssl_test(void) {
#if !defined(NO_CRYPT_TEST)
wolfcrypt_test(NULL);
#endif
#if !defined(NO_CRYPT_BENCHMARK)
benchmark_test(NULL);
#endif
return 0;
}

View File

@@ -16,8 +16,9 @@ Including the following examples:
Note: This expects to use Linux version.
## Setup
1. Run *setup.sh* to deploy files into ESP-IDF tree
## Setup for Linux
1. Run *setup.sh* at /path/to/wolfssl/IDE/Espressif/ESP-IDF/ to deploy files into ESP-IDF tree
For Windows : Run *setup_win.bat* at \IDE\Espressif\ESP-IDF\
2. Find Wolfssl files at /path/to/esp-idf/components/wolfssl/
3. Find Example programs under /path/to/esp-idf/examples/protocols/wolfssl_xxx
4. Uncomment out #define WOLFSSL_ESPIDF in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
@@ -32,4 +33,8 @@ Including the following examples:
## Support
For question please email [support@wolfssl.com]
Note: This is tested with "Ubuntu 18.04.1 LTS" and ESP32-WROOM-32.
Note: This is tested with :
- OS: Ubuntu 18.04.1 LTS and Microsoft Windows 10 Pro 10.0.19041
- ESP-IDF: v4.1 and v4.0.1
- Module : ESP32-WROOM-32

View File

@@ -1,6 +1,6 @@
/* config.h - dummy
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* helper.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,5 +1,5 @@
CONFIG_BENCH_ARGV="-lng 0"
CONFIG_MAIN_TASK_STACK_SIZE=7000
CONFIG_MAIN_TASK_STACK_SIZE=7500
CONFIG_FREERTOS_HZ=1000
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y

View File

@@ -1,6 +1,6 @@
/* client-tls-callback.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -24,7 +24,7 @@
#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_wifi.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#if ESP_IDF_VERSION_MAJOR >= 4
#include "esp_event.h"
#else
#include "esp_event_loop.h"

View File

@@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -27,7 +27,7 @@
#include "lwip/netdb.h"
#include "lwip/apps/sntp.h"
#include "nvs_flash.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#if ESP_IDF_VERSION_MAJOR >= 4
#include "protocol_examples_common.h"
#endif
@@ -53,7 +53,8 @@ static void set_time()
char strftime_buf[64];
/* please update the time if seeing unknown failure. */
/* this could cause TLS communication failure due to time expiration */
utctime.tv_sec = 1567125910; /* dummy time: Fri Aug 30 09:45:00 2019 */
/* incleasing 31536000 seconds is close to spend 356 days. */
utctime.tv_sec = 1598661910; /* dummy time: Fri Aug 29 09:45:00 2020 */
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;
@@ -92,7 +93,7 @@ static void tls_smp_client_init(void)
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_CLIENT_TASK_NAME);
}
}
/* event hander for wifi events */
/* event handler for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
switch (event->event_id)
@@ -122,11 +123,14 @@ void app_main(void)
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
esp_netif_init();
#else
tcpip_adapter_init();
#endif
/* */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#if ESP_IDF_VERSION_MAJOR >= 4
(void) wifi_event_handler;
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.

View File

@@ -1,6 +1,6 @@
/* wifi_connect.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -24,7 +24,7 @@
#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_wifi.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#if ESP_IDF_VERSION_MAJOR >= 4
#include "esp_event.h"
#else
#include "esp_event_loop.h"

View File

@@ -1,6 +1,6 @@
/* server-tls-callback.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -64,7 +64,7 @@ static void ShowCiphers(void)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you want to use a custom slot allocation */
/* enable the difinition CUSTOM_SLOT_ALLOCATION. */
/* enable the definition CUSTOM_SLOT_ALLOCATION. */
#if defined(CUSTOM_SLOT_ALLOCATION)

View File

@@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -27,7 +27,7 @@
#include "lwip/netdb.h"
#include "lwip/apps/sntp.h"
#include "nvs_flash.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#if ESP_IDF_VERSION_MAJOR >= 4
#include "protocol_examples_common.h"
#endif
@@ -35,7 +35,7 @@ const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
/* prefix for logging */
const static char *TAG = "tls_server";
/* proto-type difinition */
/* proto-type definition */
extern void tls_smp_server_task();
static void tls_smp_server_init();
@@ -50,7 +50,8 @@ static void set_time()
char strftime_buf[64];
/* please update the time if seeing unknown failure. */
/* this could cause TLS communication failure due to time expiration */
utctime.tv_sec = 1567125910; /* dummy time: Fri Aug 30 09:45:00 2019 */
/* incleasing 31536000 seconds is close to spend 356 days. */
utctime.tv_sec = 1598661910; /* dummy time: Fri Aug 29 09:45:00 2020 */
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;
@@ -89,7 +90,7 @@ static void tls_smp_server_init(void)
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_SERVER_TASK_NAME);
}
}
/* event hander for wifi events */
/* event handler for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
switch (event->event_id)
@@ -98,8 +99,13 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
esp_wifi_connect();
break;
case SYSTEM_EVENT_STA_GOT_IP:
#if ESP_IDF_VERSION_MAJOR >= 4
ESP_LOGI(TAG, "got ip:" IPSTR "\n",
IP2STR(&event->event_info.got_ip.ip_info.ip));
#else
ESP_LOGI(TAG, "got ip:%s",
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
#endif
/* http://esp32.info/docs/esp_idf/html/dd/d08/group__xEventGroupSetBits.html */
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
break;
@@ -120,10 +126,13 @@ void app_main(void)
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
tcpip_adapter_init();
/* */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
esp_netif_init();
#else
tcpip_adapter_init();
#endif
/* */
#if ESP_IDF_VERSION_MAJOR >= 4
(void) wifi_event_handler;
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.

View File

@@ -1,2 +1,2 @@
CONFIG_MAIN_TASK_STACK_SIZE=9000
CONFIG_MAIN_TASK_STACK_SIZE=11000
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=

View File

@@ -0,0 +1,73 @@
@echo off
REM Expect the script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
if NOT EXIST "setup.sh" (
echo "Please run this script at /path/to/wolfssl/IDE/Espressif/ESP-IDF/
goto exit
)
if "%IDF_PATH%" == "" (
echo "Please launch the script from ESP-IDF command prompt."
goto exit
)
set SCRIPTDIR=%CD%
set BASEDIR=%SCRIPTDIR%\..\..\..\
set WOLFSSL_ESPIDFDIR=%BASEDIR%\IDE\Espressif\ESP-IDF
set WOLFSSLLIB_TRG_DIR=%IDF_PATH%\components\wolfssl
set WOLFSSLEXP_TRG_DIR=%IDF_PATH%\examples\protocols
echo Copy files into $IDF_PATH%
rem Remove/Create directories
rmdir /S/Q %WOLFSSLLIB_TRG_DIR%
mkdir %WOLFSSLLIB_TRG_DIR%
mkdir %WOLFSSLLIB_TRG_DIR%\src
mkdir %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
mkdir %WOLFSSLLIB_TRG_DIR%\wolfssl
mkdir %WOLFSSLLIB_TRG_DIR%\test
mkdir %WOLFSSLLIB_TRG_DIR%\include
rem copying ... files in src/ into $WOLFSSLLIB_TRG_DIR%/src
xcopy /Y/Q %BASEDIR%\src\*.c %WOLFSSLLIB_TRG_DIR%\src\
xcopy /Y/Q %BASEDIR%\wolfcrypt\src\*.c %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
xcopy /Y/Q %BASEDIR%\wolfcrypt\src\*.i %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src
xcopy /E/Y/Q %BASEDIR%\wolfcrypt\src\port %WOLFSSLLIB_TRG_DIR%\wolfcrypt\src\port\
xcopy /E/Y/Q %BASEDIR%\wolfcrypt\test\ %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\
xcopy /E/Y/Q %BASEDIR%\wolfcrypt\benchmark\ %WOLFSSLLIB_TRG_DIR%\wolfcrypt\benchmark\
xcopy /Y/Q %BASEDIR%\wolfssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\
xcopy /E/Y/Q %BASEDIR%\wolfssl\wolfcrypt\ %WOLFSSLLIB_TRG_DIR%\wolfssl\wolfcrypt\
rem user_settings.h
xcopy /F/Q %WOLFSSL_ESPIDFDIR%\user_settings.h %WOLFSSLLIB_TRG_DIR%\include\
echo F |xcopy /F/Q %WOLFSSL_ESPIDFDIR%\dummy_config_h %WOLFSSLLIB_TRG_DIR%\include\config.h
rem unit test app
xcopy /E/Y/Q %WOLFSSL_ESPIDFDIR%\test %WOLFSSLLIB_TRG_DIR%\test\
xcopy /F/Q %WOLFSSL_ESPIDFDIR%\libs\CMakeLists.txt %WOLFSSLLIB_TRG_DIR%\
xcopy /F/Q %WOLFSSL_ESPIDFDIR%\libs\component.mk %WOLFSSLLIB_TRG_DIR%\
rem Benchmark program
rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\
xcopy /F/Q %BASEDIR%\wolfcrypt\benchmark\benchmark.c %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\main\
xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_benchmark %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\
rem Crypt Test program
rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_test\
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_test\main\
xcopy /F/Q %BASEDIR%\wolfcrypt\test\test.c %WOLFSSLEXP_TRG_DIR%\wolfssl_test\main\
xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_test %WOLFSSLEXP_TRG_DIR%\wolfssl_test\
rem TLS Client program
rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_client\
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_client\main\
xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_client %WOLFSSLEXP_TRG_DIR%\wolfssl_client\
rem TLS Server program
rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_server\
mkdir %WOLFSSLEXP_TRG_DIR%\wolfssl_server\main\
xcopy /E/F/Q %WOLFSSL_ESPIDFDIR%\examples\wolfssl_server %WOLFSSLEXP_TRG_DIR%\wolfssl_server\
:exit
echo completed

View File

@@ -1,3 +1,5 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_MAIN_DRIVER -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCDIRS ".")
set(COMPONENT_ADD_INCLUDEDIRS ".")

View File

@@ -5,7 +5,7 @@ The test contains of wolfSSL unit-test app on Unity.
When you want to run the app
1. Copy *test.c* file at /path/to/esp-idf/components/wolfssl/wolfcrypt/test/ folder to the wolfssl/test folder
2. Go to /esp-idf/tools/unit-test-app/ folder
3. "make menuconfig" to configure unit test app.
4. "make TEST_COMPONENTS=wolfssl" to build wolfssl unit test app.
3. "idf.py menuconfig" to configure unit test app.
4. "idf.py -T wolfssl build" to build wolfssl unit test app.
See [https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/unit-tests.html] for more information about unit test app.

View File

@@ -171,7 +171,7 @@ static void tskAes256_Test(void *pvParam)
}
#endif
#if !defined(NO_RSA) || defined(HAVE_ECC)
#if (!defined(NO_RSA) || defined(HAVE_ECC)) && !defined(WC_NO_RNG)
int mp_performance_check(int mul, int mulmod, int exptmod)
{
@@ -280,13 +280,13 @@ int mp_performance_check(int mul, int mulmod, int exptmod)
printf("(%d,%d) Xbits = %d, Ybits = %d Pbits = %d",
i , j, Xbits, Ybits, Pbits);
if(mul) {
printf(" mul = %llu (us)", elapsedTime1);
printf(" mul = %llu (us)", (unsigned long long)elapsedTime1);
}
if(mulmod) {
printf(" mulmod = %llu (us)\n", elapsedTime2);
printf(" mulmod = %llu (us)\n", (unsigned long long)elapsedTime2);
}
if(exptmod) {
printf(" exptmod = %llu (ms)\n", elapsedTime3);
printf(" exptmod = %llu (ms)\n", (unsigned long long)elapsedTime3);
}
}
}
@@ -308,8 +308,8 @@ int mp_performance_check(int mul, int mulmod, int exptmod)
int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int verbose)
{
int ret = 0;
char* buf;
char* bufZ;
char* buf = NULL;
char* bufZ = NULL;
int radixX_size;
int radixZ_size;
int radixY_size;
@@ -335,10 +335,10 @@ int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int ver
}
mp_radix_size(&z, 16, &radixZ_size);
bufZ = (char*)XMALLOC(radixZ_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
bufZ = (char*)XMALLOC(radixZ_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if(bufZ != NULL) {
mp_toradix(&z, bufZ, 16);
bufZ[radixZ_size] ='\0';
bufZ[radixZ_size-1] ='\0';
}
if(verbose) {
@@ -350,14 +350,14 @@ int mp_unitest_mul(const char* strZ, const char* strX, const char* strY, int ver
mp_radix_size(&y, 16, &radixY_size);
radixX_size = max(radixX_size, radixY_size);
buf = (char*)XMALLOC(radixX_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
buf = (char*)XMALLOC(radixX_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if(buf != NULL) {
mp_toradix(&x, buf, 16);
buf[radixX_size] ='\0';
buf[radixX_size-1] ='\0';
printf("X : %s ", buf);
mp_toradix(&y, buf, 16);
buf[radixY_size] ='\0';
buf[radixY_size-1] ='\0';
printf("Y : %s ", buf);
}
if(bufZ != NULL) {
@@ -410,10 +410,10 @@ int mp_unitest_mulmod(const char* strZ, const char* strX, const char* strY,
}
mp_radix_size(&z, 16, &radixZ_size);
bufZ = (char*)XMALLOC(radixZ_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
bufZ = (char*)XMALLOC(radixZ_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if(bufZ != NULL) {
mp_toradix(&z, bufZ, 16);
bufZ[radixZ_size] ='\0';
bufZ[radixZ_size-1] ='\0';
}
if(verbose) {
@@ -427,18 +427,18 @@ int mp_unitest_mulmod(const char* strZ, const char* strX, const char* strY,
mp_radix_size(&m, 16, &radixM_size);
radixX_size = max(radixX_size, max(radixY_size, radixM_size));
buf = (char*)XMALLOC(radixX_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
buf = (char*)XMALLOC(radixX_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if(buf != NULL) {
mp_toradix(&x, buf, 16);
buf[radixX_size] ='\0';
buf[radixX_size-1] ='\0';
printf("X : %s ", buf);
mp_toradix(&y, buf, 16);
buf[radixY_size] ='\0';
buf[radixY_size-1] ='\0';
printf("Y : %s ", buf);
mp_toradix(&m, buf, 16);
buf[radixM_size] ='\0';
buf[radixM_size-1] ='\0';
printf("M : %s ", buf);
}
if(bufZ != NULL) {
@@ -459,8 +459,8 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
const char* strM, int verbose)
{
int ret = 0;
char* buf;
char* bufZ;
char* buf = NULL;
char* bufZ = NULL;
int radixX_size;
int radixZ_size;
int radixY_size;
@@ -491,10 +491,10 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
}
mp_radix_size(&z, 16, &radixZ_size);
bufZ = (char*)XMALLOC(radixZ_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
bufZ = (char*)XMALLOC(radixZ_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if(bufZ != NULL) {
mp_toradix(&z, bufZ, 16);
bufZ[radixZ_size] ='\0';
bufZ[radixZ_size-1] ='\0';
}
if(verbose) {
@@ -508,18 +508,18 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
mp_radix_size(&m, 16, &radixM_size);
radixX_size = max(radixX_size, max(radixY_size, radixM_size));
buf = (char*)XMALLOC(radixX_size + 1, NULL, DYNAMIC_TYPE_TMP_BUFFER);
buf = (char*)XMALLOC(radixX_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if(buf != NULL) {
mp_toradix(&x, buf, 16);
buf[radixX_size] ='\0';
buf[radixX_size-1] ='\0';
printf("X : %s ", buf);
mp_toradix(&y, buf, 16);
buf[radixY_size] ='\0';
buf[radixY_size-1] ='\0';
printf("Y : %s ", buf);
mp_toradix(&m, buf, 16);
buf[radixM_size] ='\0';
buf[radixM_size-1] ='\0';
printf("M : %s ", buf);
}
if(bufZ != NULL) {
@@ -539,20 +539,20 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
TEST_CASE("wolfssl mp exptmod test" , "[wolfssl]")
{
ESP_LOGI(TAG, "mp test");
int verbose = 0;
int verbose = 1;
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("CE331E6D30A77A57", "1234", "A",
"FFFFFFFFFFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1000000", "1000", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1000000", "2", "128",
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01000000", "1000", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01000000", "2", "128",
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("14B5A90", "1234", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1234321", "1111", "2", "FFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("014B5A90", "1234", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01234321", "1111", "2", "FFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("22", "55", "1", "33", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("222", "555", "1", "333", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("0222", "555", "1", "333", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2222", "5555", "1", "3333", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("11", "5555", "1", "33", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("55", "1111", "1", "77", verbose));
@@ -562,16 +562,16 @@ TEST_CASE("wolfssl mp exptmod test" , "[wolfssl]")
TEST_CASE("wolfssl mp mulmod test" , "[wolfssl]")
{
ESP_LOGI(TAG, "mp test");
int verbose = 0;
int verbose = 1;
/* Z X Y M */
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("2", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("1", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("2", "-64", "A", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("01", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("02", "-64", "A", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("74C3AC", "123456", "55555", "AAAAA1", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("73A068", "123456", "55555", "AAAAA3", verbose));
mp_unitest_mulmod(
"10C530243ADE5EA7C557E9A2FF5B4573195665A89CB921F573267B15CD2BCB6467E925235AA752CC2D08B07D31497B497744CA3685A46E76247439826628589DD814AC9EEE9EF8B4B44BEE2DB6065BE3C51B788E4ECFF39FB28C3D8EBE10FC9989D97CDC6624E32EBD222E222A2E93085FC2D05E4EB73375F7FC7B11E9B3024",
"010C530243ADE5EA7C557E9A2FF5B4573195665A89CB921F573267B15CD2BCB6467E925235AA752CC2D08B07D31497B497744CA3685A46E76247439826628589DD814AC9EEE9EF8B4B44BEE2DB6065BE3C51B788E4ECFF39FB28C3D8EBE10FC9989D97CDC6624E32EBD222E222A2E93085FC2D05E4EB73375F7FC7B11E9B3024",
"A4F780E83C3FAC34878787D4876BA7582E48C7637A26C6E720974FC7416150A3865D44F6D08E3DA38EB4296928C564D9A0008D8A0D63E0B8EF54D14D54FBEAB540E43D2ED6BE54806D9150C1944437CC3D8B2486A1FB932A6691B529E0E2A46524CB0825BA4F4E1B9C24554DB1913169E5373173A3B7CBBF77C3403C8C7AE86A",
"6520379E44C1A2C359342010E1038F8C3644D9A47A9346A80C92B48A6986872D74C3BDDB49B2D93C554B588D4A4448614FADBC066CC10F3EB20A2422EA857B7DD0BF60C9CB7D733B12761BD785BCD122D97ECA0A8F1D0F705BC094B66EE5C96712AE3B14B5AA6AD9E50C6A3020BA01DA4FB94E3934527ADCDB3DE51C368B37C2",
"BE7070B80418E528FE66D89088E0F1B7C3D0D23EE64B9474B0FFB0F763A5AB7EAFB62BB738161A50BFF1CA873AD5B0DAF8437A15B97EEA2A80D251B035AF07F3F25D243A4B8756481B3C249ADA7080BD3C8B034A0C8371DEE30370A2B760091B5EC73DA06460E3A9068DD3FF42BB0A94272D57420DB02DE0BA182560921192F3",
@@ -602,13 +602,13 @@ TEST_CASE("wolfssl mp mulmod test" , "[wolfssl]")
TEST_CASE("wolfssl mp mul test" , "[wolfssl]")
{
ESP_LOGI(TAG, "mp test");
int verbose = 0;
int verbose = 1;
TEST_ASSERT_EQUAL(0, mp_unitest_mul("A", "5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-A", "-5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("A", "-5", "-2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("6260060", "1234", "5678", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("38E83", "123", "321", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("0A", "5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-0A", "-5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("0A", "-5", "-2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("06260060", "1234", "5678", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("038E83", "123", "321", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("75CD7FCBBC", "123456", "6789A", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul(
@@ -618,7 +618,7 @@ TEST_CASE("wolfssl mp mul test" , "[wolfssl]")
verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul(
"33676FE7B625BF0759F7E8932B6B50D5F45E16E1C670AD20F1CDA5DFFA433685937CA8422A9CB916CC8",
"033676FE7B625BF0759F7E8932B6B50D5F45E16E1C670AD20F1CDA5DFFA433685937CA8422A9CB916CC8",
"165196BA298CD54975DC483C4D21A51EA0A146783CFB41522E76E50C",
"24D9D5CA7D9CCC06F5E70F1963E6",
verbose));
@@ -636,7 +636,7 @@ TEST_CASE("wolfssl mp mul performance test" , "[wolfssl]")
TEST_ASSERT_EQUAL(0, mp_performance_check(mul, mulmod, exptmod));
}
#endif/* !NO_RSA || HAVE_ECC */
#endif/* (!NO_RSA || HAVE_ECC) && !WC_NO_RNG */
TEST_CASE("wolfssl aes test" , "[wolfssl]")
{

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -43,6 +43,19 @@
#define CURVE25519_SMALL
#define HAVE_ED25519
/* when you want to use pkcs7 */
/* #define HAVE_PKCS7 */
#if defined(HAVE_PKCS7)
#define HAVE_AES_KEYWRAP
#define HAVE_X963_KDF
#define WOLFSSL_AES_DIRECT
#endif
/* when you want to use aes counter mode */
/* #define WOLFSSL_AES_DIRECT */
/* #define WOLFSSL_AES_COUNTER */
/* esp32-wroom-32se specific definition */
#if defined(WOLFSSL_ESPWROOM32SE)
#define WOLFSSL_ATECC508A

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -70,13 +70,15 @@ extern "C" {
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_CACHE_RESISTANT
//#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
//#define WOLFSSL_SP_CACHE_RESISTANT
#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
/* 64 or 32 bit version */
//#define WOLFSSL_SP_ASM /* required if using the ASM versions */
/* SP Assembly Speedups */
#define WOLFSSL_SP_ASM /* required if using the ASM versions */
//#define WOLFSSL_SP_ARM32_ASM
//#define WOLFSSL_SP_ARM64_ASM
//#define WOLFSSL_SP_ARM_THUMB_ASM
#define WOLFSSL_SP_ARM_CORTEX_M_ASM
#endif
/* ------------------------------------------------------------------------- */
@@ -171,16 +173,15 @@ extern "C" {
#undef ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
/* Enable cofactor support */
#ifdef HAVE_FIPS
#undef HAVE_ECC_CDH
#define HAVE_ECC_CDH
#endif
#define HAVE_ECC_CDH /* Enable cofactor support */
#undef NO_STRICT_ECDSA_LEN
#define NO_STRICT_ECDSA_LEN /* Do not force fixed len w/ FIPS */
/* Validate import */
#ifdef HAVE_FIPS
#undef WOLFSSL_VALIDATE_ECC_IMPORT
#define WOLFSSL_VALIDATE_ECC_IMPORT
#define WOLFSSL_VALIDATE_ECC_IMPORT /* Validate import */
#endif
/* Compressed Key Support */
@@ -189,14 +190,17 @@ extern "C" {
/* Use alternate ECC size for ECC math */
#ifdef USE_FAST_MATH
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
#ifdef NO_RSA
/* Custom fastmath size if not using RSA */
/* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
#undef FP_MAX_BITS
#define FP_MAX_BITS (256 + 32)
#define FP_MAX_BITS (256 * 2)
#else
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
//#undef FP_MAX_BITS_ECC
//#define FP_MAX_BITS_ECC (256 * 2)
#endif
/* Speedups specific to curve */

View File

@@ -27,7 +27,8 @@ INC = -I./Header \
DEF = -DWOLFSSL_USER_SETTINGS
# Architecture
ARCHFLAGS = -mcpu=cortex-m0 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
ARCHFLAGS = -mcpu=cortex-m4 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
#ARCHFLAGS = -mcpu=cortex-m0 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
#ARCHFLAGS = -mcpu=cortex-r5 -mthumb -mabi=aapcs
#ARCHFLAGS = -mcpu=cortex-a53 -mthumb -mabi=aapcs
@@ -132,7 +133,10 @@ SRC_C += ../../wolfcrypt/src/signature.c
SRC_C += ../../wolfcrypt/src/srp.c
SRC_C += ../../wolfcrypt/src/sp_arm32.c
SRC_C += ../../wolfcrypt/src/sp_arm64.c
SRC_C += ../../wolfcrypt/src/sp_armthumb.c
SRC_C += ../../wolfcrypt/src/sp_c32.c
SRC_C += ../../wolfcrypt/src/sp_c64.c
SRC_C += ../../wolfcrypt/src/sp_cortexm.c
SRC_C += ../../wolfcrypt/src/sp_int.c
SRC_C += ../../wolfcrypt/src/tfm.c
SRC_C += ../../wolfcrypt/src/wc_encrypt.c

View File

@@ -1,6 +1,6 @@
/* armtarget.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -142,20 +142,20 @@ void HardFault_HandlerC( uint32_t *hardfault_args )
_BFAR = (*((volatile uint32_t *)(0xE000ED38)));
printf ("\n\nHard fault handler (all numbers in hex):\n");
printf ("R0 = %lx\n", stacked_r0);
printf ("R1 = %lx\n", stacked_r1);
printf ("R2 = %lx\n", stacked_r2);
printf ("R3 = %lx\n", stacked_r3);
printf ("R12 = %lx\n", stacked_r12);
printf ("LR [R14] = %lx subroutine call return address\n", stacked_lr);
printf ("PC [R15] = %lx program counter\n", stacked_pc);
printf ("PSR = %lx\n", stacked_psr);
printf ("CFSR = %lx\n", _CFSR);
printf ("HFSR = %lx\n", _HFSR);
printf ("DFSR = %lx\n", _DFSR);
printf ("AFSR = %lx\n", _AFSR);
printf ("MMAR = %lx\n", _MMAR);
printf ("BFAR = %lx\n", _BFAR);
printf ("R0 = %ux\n", stacked_r0);
printf ("R1 = %ux\n", stacked_r1);
printf ("R2 = %ux\n", stacked_r2);
printf ("R3 = %ux\n", stacked_r3);
printf ("R12 = %ux\n", stacked_r12);
printf ("LR [R14] = %ux subroutine call return address\n", stacked_lr);
printf ("PC [R15] = %ux program counter\n", stacked_pc);
printf ("PSR = %ux\n", stacked_psr);
printf ("CFSR = %ux\n", _CFSR);
printf ("HFSR = %ux\n", _HFSR);
printf ("DFSR = %ux\n", _DFSR);
printf ("AFSR = %ux\n", _AFSR);
printf ("MMAR = %ux\n", _MMAR);
printf ("BFAR = %ux\n", _BFAR);
// Break into the debugger
__asm("BKPT #0\n");

View File

@@ -1,6 +1,6 @@
/* benchmark_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* test_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* tls_client.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* wolf_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -59,12 +59,12 @@ unsigned int LowResTimer(void)
/* This is used by wolfCrypt benchmark tool only */
double current_time(int reset)
{
double time;
int timeMs = gTimeMs;
double timeNow;
int timeMs = gTimeMs;
(void)reset;
time = (timeMs / 1000); // sec
time += (double)(timeMs % 1000) / 1000; // ms
return time;
timeNow = (timeMs / 1000); // sec
timeNow += (double)(timeMs % 1000) / 1000; // ms
return timeNow;
}
#endif

View File

@@ -9,6 +9,7 @@ EXTRA_DIST+= IDE/GCC-ARM/Source/benchmark_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/test_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/tls_client.c
EXTRA_DIST+= IDE/GCC-ARM/linker.ld
EXTRA_DIST+= IDE/GCC-ARM/linker_fips.ld
EXTRA_DIST+= IDE/GCC-ARM/Makefile
EXTRA_DIST+= IDE/GCC-ARM/Makefile.bench
EXTRA_DIST+= IDE/GCC-ARM/Makefile.client

View File

@@ -0,0 +1,92 @@
MEMORY
{
FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 256K
RAM (wx) : ORIGIN = 0x20000000, LENGTH = 64K
}
SECTIONS
{
__vectors_start__ = .;
.vectors : { *(.vectors) } > FLASH
__vectors_end__ = __vectors_start__ + 0x400;
/* Custom section for wolfCrypt FIPS module */
.wolfCryptFIPSModule_text :
{
. = ALIGN(4);
KEEP(wolfcrypt_first.o (.text .text* ))
KEEP(aes.o(.text .text* ))
KEEP(cmac.o (.text .text* ))
KEEP(des3.o (.text .text* ))
KEEP(dh.o (.text .text* ))
KEEP(ecc.o (.text .text* ))
KEEP(fips.o (.text .text* ))
KEEP(fips_test.o (.text .text* ))
KEEP(hmac.o (.text .text* ))
KEEP(random.o(.text .text* ))
KEEP(rsa.o (.text .text* ))
KEEP(sha.o (.text .text* ))
KEEP(sha256.o (.text .text* ))
KEEP(sha3.o (.text .text* ))
KEEP(sha512.o (.text .text* ))
KEEP(wolfcrypt_last.o(.text .text*))
. = ALIGN(4);
} > FLASH
.wolfCryptFIPSModule_rodata :
{
. = ALIGN(4);
KEEP(wolfcrypt_first.o (.rodata .rodata*))
KEEP(aes.o(.rodata .rodata*))
KEEP(cmac.o(.rodata .rodata*))
KEEP(des3.o(.rodata .rodata*))
KEEP(dh.o(.rodata .rodata*))
KEEP(ecc.o(.rodata .rodata*))
KEEP(fips.o(.rodata .rodata*))
KEEP(fips_test.o(.rodata .rodata*))
KEEP(hmac.o(.rodata .rodata*))
KEEP(random.o(.rodata .rodata*))
KEEP(rsa.o(.rodata .rodata*))
KEEP(sha.o(.rodata .rodata*))
KEEP(sha256.o(.rodata .rodata*))
KEEP(sha3.o(.rodata .rodata*))
KEEP(sha512.o(.rodata .rodata*))
KEEP(wolfcrypt_last.o(.rodata .rodata*))
. = ALIGN(4);
} > FLASH
/* Custom section for wolfCrypt and LibC to prevent FIPS hash from changing
when application code changes are made */
.wolfCryptNonFIPS_text :
{
. = ALIGN(4);
KEEP(*wolf*src*.o(.text .text*))
lib_a* ( .text .text*)
. = ALIGN(4);
} > FLASH
.wolfCryptNonFIPS_rodata :
{
. = ALIGN(4);
KEEP(*wolf*src*.o(.rodata .rodata*))
lib_a* (.rodata .rodata*)
. = ALIGN(4);
} > FLASH
.sys : { *(.sys*) } > FLASH
.text : { *(.text*) } > FLASH
.rodata : { *(.text*) } > FLASH
__data_load_start__ = .;
__data_start__ = .;
.data : { *(.data*) } > RAM
__data_end__ = __data_start__ + SIZEOF(.data);
__bss_start__ = .;
.bss : { *(.bss*) } > RAM
__bss_end__ = __bss_start__ + SIZEOF(.bss);
__heap_start__ = .;
.heap : { *(.heap*) } > RAM
__heap_end__ = __heap_start__ + SIZEOF(.heap);
end = .;
}

110
IDE/HEXAGON/DSP/Makefile Normal file
View File

@@ -0,0 +1,110 @@
# Makefile
#
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
ENVI=hexagon
# default to hexagon v65 Release build
ifndef V
V=hexagon_Release_dynamic_toolv83_v65
endif
SUPPORTED_VS = $(default_VS)
DEPENDENCIES = \
ATOMIC \
RPCMEM \
TEST_MAIN \
TEST_UTIL
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/common/atomic
RPCMEM_DIR = $(HEXAGON_SDK_ROOT)/libs/common/rpcmem
TEST_MAIN_DIR = $(HEXAGON_SDK_ROOT)/test/common/test_main
TEST_UTIL_DIR = $(HEXAGON_SDK_ROOT)/test/common/test_util
include $(HEXAGON_SDK_ROOT)/build/make.d/$(ENVI)_vs.min
include $(HEXAGON_SDK_ROOT)/build/defines.min
QURT = $(HEXAGON_SDK_ROOT)/libs/common/qurt
QAIC_FLAGS += -I../../../
CC_FLAGS += -I../../../
CC_FLAGS += -I $(QURT)/computev65/include/posix/
CC_FLAGS += -I $(QURT)/computev65/include/qurt/
CC_FLAGS += -I../
CC_FLAGS += -DWOLFSSL_USER_SETTINGS
CC_FLAGS += -DWOLFSSL_DSP_BUILD
CC_FLAGS += -DWC_NO_RNG
#CC_FLAGS += -O3
C_FLAGS += $(MHVX_DOUBLE_FLAG) -mllvm -hexagon-eif=0
CC_FLAGS += $(MHVX_DOUBLE_FLAG) -mllvm -hexagon-eif=0
# stub library
BUILD_LIBS += libwolfssl_dsp_skel
ifeq (1,$(V_dynamic))
BUILD_DLLS += libwolfssl_dsp_skel
endif
libwolfssl_dsp_skel_QAICIDLS += wolfssl_dsp
libwolfssl_dsp_skel_C_SRCS += $V/wolfSSL_skel
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/sp_dsp32.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/sp_int.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wc_port.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/logging.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/memory.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
#libsp_dsp_skel_DLLS += libdspCV_skel
# quality test
#BUILD_QEXES += eccverify_q
#eccverify_q_QAICIDLS = wolfssl_dsp
#eccverify_q_C_SRCS = ../ecc-verify
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_dsp.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_dsp32.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_int.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_port.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_encrypt.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/pwdbased.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hash.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/arc4.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hmac.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/md5.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/coding.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/aes.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/des3.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/random.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/logging.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/ecc.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/memory.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sha256.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sha.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/asn.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_c32.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_c64.c
#eccverify_q_LIBS = rtld rpcmem test_util atomic test_main
BUILD_COPIES = \
$(DLLS) \
$(EXES) \
$(LIBS) \
$(SHIP_DIR)/ ;
include $(RULES_MIN)

View File

@@ -0,0 +1,13 @@
#ifndef WOLFSSL_DSP_INC
#define WOLFSSL_DSP_INC
#include "AEEStdDef.idl"
#include "remote.idl"
interface wolfSSL: remote_handle64{
/* ecc operations */
long DSP_ECC_Verify_256(inrout sequence<int32> hash, inrout sequence<int32> pX, inrout sequence<int32> pY,
inrout sequence<int32> pZ, inrout sequence<int32> r, inrout sequence<int32> sm, inrout long res);
};
#endif

189
IDE/HEXAGON/Makefile Normal file
View File

@@ -0,0 +1,189 @@
# Makefile
#
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# wolfSSL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
ENVI=UbuntuARM
# default to Ubuntu Release build
ifndef V
V=UbuntuARM_Release_aarch64
endif
SUPPORTED_VS = $(default_VS)
include $(HEXAGON_SDK_ROOT)/build/make.d/$(ENVI)_vs.min
include $(HEXAGON_SDK_ROOT)/build/defines.min
ifeq ($(CDSP_FLAG), 1)
LIB_DSPRPC = libcdsprpc
else ifeq ($(MDSP_FLAG), 1)
LIB_DSPRPC = libmdsprpc
else ifeq ($(SLPI_FLAG), 1)
LIB_DSPRPC = libsdsprpc
else
LIB_DSPRPC = libadsprpc
endif
$(info ************ LIB=$(LIB_DSPRPC) ************)
# include files
CC_FLAGS += -I../../
CC_FLAGS += -I./
CC_FLAGS += -DWOLFSSL_USER_SETTINGS
CC_FLAGS += -mcpu=generic+crypto
#CC_FLAGS += -O3
DEPENDENCIES = \
ATOMIC \
RPCMEM
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/common/atomic
RPCMEM_DIR = $(HEXAGON_SDK_ROOT)/libs/common/rpcmem
# stub library
BUILD_DLLS += libwolfssl
libwolfssl_QAICIDLS += DSP/wolfssl_dsp
libwolfssl_C_SRCS += $V/wolfSSL_stub
libwolfssl_DLLS += $(LIB_DSPRPC)
libwolfssl_C_SRCS += ../../wolfcrypt/src/wc_dsp
libwolfssl_LIBS += rpcmem
libwolfssl_LD_FLAGS += -ldl
# wolfSSL crypto source files
libwolfssl_C_SRCS += \
../../wolfcrypt/src/aes \
../../wolfcrypt/src/md2 \
../../wolfcrypt/src/arc4 \
../../wolfcrypt/src/md4 \
../../wolfcrypt/src/asm \
../../wolfcrypt/src/md5 \
../../wolfcrypt/src/asn \
../../wolfcrypt/src/memory \
../../wolfcrypt/src/async \
../../wolfcrypt/src/blake2b \
../../wolfcrypt/src/pkcs12 \
../../wolfcrypt/src/blake2s \
../../wolfcrypt/src/pkcs7 \
../../wolfcrypt/src/camellia \
../../wolfcrypt/src/poly1305 \
../../wolfcrypt/src/chacha20_poly1305 \
../../wolfcrypt/src/pwdbased \
../../wolfcrypt/src/chacha \
../../wolfcrypt/src/rabbit \
../../wolfcrypt/src/cmac \
../../wolfcrypt/src/random \
../../wolfcrypt/src/coding \
../../wolfcrypt/src/ripemd \
../../wolfcrypt/src/compress \
../../wolfcrypt/src/rsa \
../../wolfcrypt/src/cpuid \
../../wolfcrypt/src/selftest \
../../wolfcrypt/src/cryptocb \
../../wolfcrypt/src/sha256 \
../../wolfcrypt/src/curve25519 \
../../wolfcrypt/src/sha3 \
../../wolfcrypt/src/des3 \
../../wolfcrypt/src/sha512 \
../../wolfcrypt/src/dh \
../../wolfcrypt/src/sha \
../../wolfcrypt/src/signature \
../../wolfcrypt/src/ecc \
../../wolfcrypt/src/ecc_fp \
../../wolfcrypt/src/ed25519 \
../../wolfcrypt/src/sp_armthumb \
../../wolfcrypt/src/error \
../../wolfcrypt/src/sp_int \
../../wolfcrypt/src/fe_low_mem \
../../wolfcrypt/src/sp_cortexm \
../../wolfcrypt/src/fe_operations \
../../wolfcrypt/src/fips \
../../wolfcrypt/src/sp_x86_64 \
../../wolfcrypt/src/fips_test \
../../wolfcrypt/src/srp \
../../wolfcrypt/src/ge_low_mem \
../../wolfcrypt/src/ge_operations \
../../wolfcrypt/src/wc_encrypt \
../../wolfcrypt/src/hash \
../../wolfcrypt/src/wc_pkcs11 \
../../wolfcrypt/src/hc128 \
../../wolfcrypt/src/wc_port \
../../wolfcrypt/src/hmac \
../../wolfcrypt/src/wolfcrypt_first \
../../wolfcrypt/src/idea \
../../wolfcrypt/src/wolfcrypt_last \
../../wolfcrypt/src/wolfevent \
../../wolfcrypt/src/logging \
../../wolfcrypt/src/sp_c32 \
../../wolfcrypt/src/sp_c64 \
../../wolfcrypt/src/sp_arm32 \
../../wolfcrypt/src/sp_arm64 \
../../wolfcrypt/src/wolfmath
# wolfSSL TLS source files
libwolfssl_C_SRCS += \
../../src/ocsp \
../../src/tls \
../../src/crl \
../../src/sniffer \
../../src/wolfio \
../../src/internal \
../../src/ssl \
../../src/keys \
../../src/tls13
# build benchmark app
BUILD_EXES += benchmark
benchmark_C_SRCS += ../../wolfcrypt/benchmark/benchmark
benchmark_LD_FLAGS += -ldl
benchmark_LD_FLAGS += -lpthread
benchmark_DLLS += libwolfssl
benchmark_LIBS += rpcmem
benchmark_DLLS += $(LIB_DSPRPC)
# build test app
BUILD_EXES += testwolfcrypt
testwolfcrypt_C_SRCS += ../../wolfcrypt/test/test
testwolfcrypt_DLLS += libwolfssl
testwolfcrypt_LD_FLAGS += -ldl
testwolfcrypt_LIBS += rpcmem
testwolfcrypt_DLLS += $(LIB_DSPRPC)
# build ecc verify test app
BUILD_EXES += eccverify
eccverify_C_SRCS += ecc-verify
eccverify_DLLS += libwolfssl
eccverify_LD_FLAGS += -ldl
eccverify_LIBS += rpcmem
eccverify_DLLS += $(LIB_DSPRPC)
# build ecc verify test app
BUILD_EXES += eccbenchmark
eccbenchmark_C_SRCS += ecc-verify-benchmark
eccbenchmark_DLLS += libwolfssl
eccbenchmark_LD_FLAGS += -lpthread
eccbenchmark_LD_FLAGS += -ldl
eccbenchmark_LIBS += rpcmem
eccbenchmark_DLLS += $(LIB_DSPRPC)
BUILD_COPIES = \
$(DLLS) \
$(EXES) \
$(LIBS) \
$(SHIP_DIR)/ ;
include $(RULES_MIN)

75
IDE/HEXAGON/README.md Normal file
View File

@@ -0,0 +1,75 @@
# Building wolfSSL with DSP Use
## Intro
This directory is to help with building wolfSSL for use with DSP. It assumes that the Hexagon SDK has been setup on the machine and that the environment variables have been set by calling (source ~/Qualcomm/Hexagon_SDK/3.4.3/setup_sdk_env.source). Currently offloading ECC 256 verify operations to the DSP is supported. When WOLFSSL_DSP is defined ECC verify operations are offloaded to the aDSP by default. When not in SINGLE_THREADED mode a call back function must be set for getting the handle or a handle must be set in the ecc_key structure for the operation to make use of multiple threads when offloading to the DSP. This is because creating new handles for new threads must be done.
## Building
The directory is divided up into a build for the CPU portion in IDE/HEXAGON and a build for use on the DSP located in IDE/HEXAGON/DSP. Each section has their own Makefile. The Makefile default to an Ubuntu + hexagon v65 release build but can be changed by using V=<build type>. An example of building both would be:
```
cd IDE/HEXAGON
make V=UbuntuARM_Release_aarch64
cd DSP
make V=hexagon_Release_dynamic_toolv83_v65
```
The results from each build will be placed into the ship directories of each, for example ./UbuntuARM_Release_aarch64/ship/* and ./DSP/hexagon_Release_dynamic_toolv83_v65/ship/*.
The Makefile creates a DSP library libwolfssl_dsp_skel.so, library libwolfssl.so, executable benchmark, example ecc-verify, example ecc-verify-benchmark and executable testwolfcrypt.
These then need pushed to the device in order to run. An example of pushing the results to the device would be:
```
cd IDE/HEXAGON
adb push DSP/hexagon_Release_dynamic_toolv83_v65/ship/libwolfssl_dsp_skel.so /data/rfsa/adsp/
adb push UbuntuARM_Release_aarch64/ship/libwolfssl.so /data/
adb push UbuntuARM_Release_aarch64/ship/benchmark /data/
adb push UbuntuARM_Release_aarch64/ship/eccverify /data/
adb push UbuntuARM_Release_aarch64/ship/eccbenchmark /data/
```
To change the settings wolfSSL is built with macros can be set in IDE/HEXAGON/user_settings.h. It contains a default setting at this point that was used for collecting benchmark values. The macro necessary to turn on use of the DSP is WOLFSSL_DSP.
The script IDE/HEXAGON/build.sh was added to help speed up building and testing. An example of using the script would be:
```
cd IDE/HEXAGON
./build.sh Release
```
This will delete the previous build and rebuild for Release mode. Then it will try to push the resulting library and some of the executables to the device.
For increased performance uncomment the -O3 flag in IDE/HEXAGON/Makefile and IDE/HEXAGON/DSP/Makefile.
## Use
A default handle is created with the call to wolfCrypt_Init() and is set to use the aDSP. A default mutex is locked for each use of the handle to make the library stable when multiple threads are calling to DSP supported operations.
To use wolfSSL with a user created handle it can be done by calling wc_ecc_set_handle or by setting a callback function using wolfSSL_SetHandleCb(). This should be set in the case of multithreaded applications to account for having a handle for each thread being used.
#### wolfSSL_SetHandleCb
The API wolfSSL_SetHandleCb takes a function pointer of type "int (*wolfSSL_DSP_Handle_cb)(remote_handle64 *handle, int finished void *ctx);". This callback is executed right before the operation is handed off to the DSP (finished set to 0) and right after done with the handle (finished set to 1). With ECC this would be after the ECC verify function has been called but before the information is passed on to the DSP and once again with the finished flag set after the result is returned.
The callback set should return 0 on successfully setting the input handle. The ctx argument is for future custom context to be passed in and is currently not used.
#### Expected Performance
This is the expected results from running ./eccbenchmark using the -O3 flag
benchmarking using default (locks on handle for aDSP)
5000 verifies on 1 threads took 17.481616 seconds
10000 verifies on 2 threads took 35.324308 seconds
benchmarking using software (+NEON if built in)
5000 verifies on 1 threads took 1.398336 seconds
10000 verifies on 2 threads took 1.383992 seconds
benchmarking using threads on aDSP
5000 verifies on 1 threads took 17.616811 seconds
10000 verifies on 2 threads took 19.215413 seconds
15000 verifies on 3 threads took 20.410200 seconds
20000 verifies on 4 threads took 23.261446 seconds
benchmarking 1 thread on cDSP
5000 verifies on 1 threads took 18.560995 seconds

38
IDE/HEXAGON/build.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
if [ -z $1 ]; then
echo "./build <Debug | Release>"
exit -1
fi
printf "Erasing previous hexagon_$1_dynamic_toolv83_v65 and UbuntuARM_$1_aarch64\n"
rm -rf hexagon_$1_dynamic_toolv83_v65 &> /dev/null
rm -rf UbuntuARM_$1_aarch64 &> /dev/null
cd ./DSP &> /dev/null
rm -rf hexagon_$1_dynamic_toolv83_v65 &> /dev/null
printf "Building hexagon_$1_dynamic_toolv83_v65 ..."
make V=hexagon_$1_dynamic_toolv83_v65 &> /dev/null
if [ $? != 0 ]; then
printf "failed\n"
else
printf "done\n"
fi
cd ../ &> /dev/null
printf "Building UbuntuARM_$1_aarch64 ..."
make V=UbuntuARM_$1_aarch64 &> /dev/null
if [ $? != 0 ]; then
printf "failed\n"
else
printf "done\n"
fi
printf "Trying to push libwolfssl_Dsp_skel.so, libwolfssl.so, benchmark, eccverify, eccbenchmark\n"
adb push DSP/hexagon_$1_dynamic_toolv83_v65/ship/libwolfssl_dsp_skel.so /data/rfsa/adsp/
adb push UbuntuARM_$1_aarch64/ship/libwolfssl.so /data/
adb push UbuntuARM_$1_aarch64/ship/benchmark /data/
adb push UbuntuARM_$1_aarch64/ship/eccverify /data/
adb push UbuntuARM_$1_aarch64/ship/eccbenchmark /data/
#adb push UbuntuARM_$1_aarch64/ship/testwolfcrypt /data/wolfcrypt/test/
printf "done\n"
exit 0

View File

@@ -0,0 +1,185 @@
/* ecc-verify-benchmark.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/sha256.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/ecc.h>
#include <wolfssl/wolfcrypt/asn_public.h>
#include <pthread.h>
#define USE_CERT_BUFFERS_256
#include <wolfssl/certs_test.h>
#define MAX_TIMES 5000
#define MAX_BLOCK_SIZE 1024
#include <sys/time.h>
static double get_time()
{
struct timeval tv;
gettimeofday(&tv, 0);
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
}
/* software version */
void* hash_firmware_verify(void* key)
{
int ret, i;
int verify;
const byte hash[] = {
0XFB, 0XBA, 0XB2, 0X89, 0XF7, 0XF9, 0X4B, 0X25, 0X73, 0X6C, 0X58, 0XBE, 0X46, 0XA9, 0X94, 0XC4, 0X41, 0XFD, 0X02, 0X55, 0X2C, 0XC6, 0X02, 0X23, 0X52, 0XE3, 0XD8, 0X6D, 0X2F, 0XAB, 0X7C, 0X83
};
const byte sigBuf[] = {
0X30, 0X44, 0X02, 0X20, 0X05, 0X38, 0XBC, 0X16, 0XC7, 0X67, 0X18, 0XEC, 0XE6, 0X1E, 0X43, 0X7B, 0X29, 0X8F, 0X85, 0X01, 0X33, 0XA8, 0X9B, 0XDD, 0X91, 0X32, 0X1F, 0XEC, 0XF7, 0X91, 0X18, 0X72, 0X9C, 0XE2, 0X6F, 0X31, 0X02, 0X20, 0X3E, 0X31, 0XD6, 0X40, 0XF7, 0X38, 0X3C, 0X1B, 0X6D, 0XAD, 0XE3, 0X93, 0X20, 0XE8, 0XB1, 0XBD, 0X3C, 0X59, 0XF2, 0XD2, 0X7C, 0X46, 0X1B, 0XE5, 0XE1, 0XE3, 0XAB, 0X5E, 0X76, 0X73, 0X6F, 0XFB
};
word32 sigLen = (word32)sizeof(sigBuf);
word32 hashLen = (word32)sizeof(hash);
for (i = 0; i < MAX_TIMES; i++) {
ret = wc_ecc_verify_hash((byte*)sigBuf, sigLen, hash, hashLen, &verify, (ecc_key*)key);
if (ret < 0 || verify != 1) {
printf("failed on try %d\n", i);
break;
}
}
if (ret < 0 || verify != 1) {
printf("unable to verify, ret = %d verify = %d\n", ret, verify);
}
return NULL;
}
/* when flag is set then try to use software only if DSP is built in */
static int hash_firmware_verify_default(int numThreads)
{
int ret, i;
word32 idx;
double t;
pthread_t threads[numThreads];
ecc_key eccKey[numThreads];
for (i = 0; i < numThreads; i++) {
wc_ecc_init(&(eccKey[i]));
idx = 0;
ret = wc_EccPrivateKeyDecode(ecc_clikey_der_256, &idx, &(eccKey[i]), sizeof_ecc_clikey_der_256);
if (ret < 0)
return ret;
}
t = get_time();
for (i = 0; i < numThreads; i++) {
pthread_create(&threads[i], NULL, hash_firmware_verify, (void*)&(eccKey[i]));
}
for (i = 0; i < numThreads; i++) {
pthread_join(threads[i], NULL);
}
t = get_time() - t;
printf("%d verifies on %d threads took %f seconds\n", MAX_TIMES * numThreads, numThreads, t);
return 0;
}
#ifdef WOLFSSL_DSP
/* domain 0 = cDSP 1 = aDSP */
static int hash_firmware_verify_dsp(int numThreads, int domain)
{
int ret, i;
word32 idx;
double t;
remote_handle64 handle[numThreads];
char *sp_URI_value;
pthread_t threads[numThreads];
ecc_key eccKey[numThreads];
if (domain == 0) {
sp_URI_value = wolfSSL_URI "&_dom=cdsp";
}
else {
sp_URI_value = wolfSSL_URI "&_dom=adsp";
}
for (i = 0; i < numThreads; i++) {
wc_ecc_init(&(eccKey[i]));
idx = 0;
ret = wc_EccPrivateKeyDecode(ecc_clikey_der_256, &idx, &(eccKey[i]), sizeof_ecc_clikey_der_256);
if (ret < 0)
return ret;
ret = wolfSSL_open(sp_URI_value, &(handle[i]));
if (ret != 0) {
printf("unable to open CDSP? retVal = %d\n", ret);
return -1;
}
wc_ecc_set_handle(&(eccKey[i]), handle[i]);
}
t = get_time();
for (i = 0; i < numThreads; i++) {
pthread_create(&threads[i], NULL, hash_firmware_verify, (void*)&(eccKey[i]));
}
for (i = 0; i < numThreads; i++) {
pthread_join(threads[i], NULL);
wolfSSL_close(handle[i]);
}
t = get_time() - t;
printf("%d verifies on %d threads took %f seconds\n", MAX_TIMES * numThreads, numThreads, t);
return 0;
}
#endif /* WOLFSSL_DSP */
int main(int argc, char* argv[])
{
wolfCrypt_Init();
printf("benchmarking using default (locks on handle for aDSP)\n");
hash_firmware_verify_default(1);
hash_firmware_verify_default(2);
printf("\nbenchmarking using software (+NEON if built in)\n");
#ifdef WOLFSSL_DSP
wolfSSL_SetHandleCb(NULL); /* remove calls to DSP by default */
#endif
hash_firmware_verify_default(1);
hash_firmware_verify_default(2);
#ifdef WOLFSSL_DSP
printf("\nbenchmarking using threads on aDSP\n");
hash_firmware_verify_dsp(1, 1);
hash_firmware_verify_dsp(2, 1);
hash_firmware_verify_dsp(3, 1);
hash_firmware_verify_dsp(4, 1);
printf("\nbenchmarking 1 thread on cDSP\n");
hash_firmware_verify_dsp(1, 0);
#endif /* WOLFSSL_DSP */
wolfCrypt_Cleanup();
return 0;
}

91
IDE/HEXAGON/ecc-verify.c Normal file
View File

@@ -0,0 +1,91 @@
/* ecc-verify.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/sha256.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/ecc.h>
#include <wolfssl/wolfcrypt/asn_public.h>
#define USE_CERT_BUFFERS_256
#include <wolfssl/certs_test.h>
#define MAX_BLOCK_SIZE 1024
#ifdef WOLFSSL_DSP
static char *sp_URI_value = wolfSSL_URI "&_dom=cdsp";
int hash_firmware_verify(const byte* hash, word32 hashLen, const byte* sigBuf, word32 sigLen)
{
int ret;
ecc_key eccKey;
word32 idx;
int verify;
remote_handle64 handle = -1;
idx = 0;
ret = wc_EccPrivateKeyDecode(ecc_clikey_der_256, &idx, &eccKey, sizeof_ecc_clikey_der_256);
if (ret < 0)
goto exit;
int retVal = wolfSSL_open(sp_URI_value, &handle);
if (retVal != 0) {
printf("unable to open CDSP? retVal = %d\n", retVal);
ret = -1;
goto exit;
}
wc_ecc_set_handle(&eccKey, handle);
ret = wc_ecc_verify_hash((byte*)sigBuf, sigLen, hash, hashLen, &verify, &eccKey);
printf("verify = %d\n", verify);
if (ret < 0)
goto exit;
wolfSSL_close(handle);
exit:
return ret;
}
int main(void)
{
int ret;
const byte hash[] = {
0XFB, 0XBA, 0XB2, 0X89, 0XF7, 0XF9, 0X4B, 0X25, 0X73, 0X6C, 0X58, 0XBE, 0X46, 0XA9, 0X94, 0XC4, 0X41, 0XFD, 0X02, 0X55, 0X2C, 0XC6, 0X02, 0X23, 0X52, 0XE3, 0XD8, 0X6D, 0X2F, 0XAB, 0X7C, 0X83
};
const byte sigBuf[] = {
0X30, 0X44, 0X02, 0X20, 0X05, 0X38, 0XBC, 0X16, 0XC7, 0X67, 0X18, 0XEC, 0XE6, 0X1E, 0X43, 0X7B, 0X29, 0X8F, 0X85, 0X01, 0X33, 0XA8, 0X9B, 0XDD, 0X91, 0X32, 0X1F, 0XEC, 0XF7, 0X91, 0X18, 0X72, 0X9C, 0XE2, 0X6F, 0X31, 0X02, 0X20, 0X3E, 0X31, 0XD6, 0X40, 0XF7, 0X38, 0X3C, 0X1B, 0X6D, 0XAD, 0XE3, 0X93, 0X20, 0XE8, 0XB1, 0XBD, 0X3C, 0X59, 0XF2, 0XD2, 0X7C, 0X46, 0X1B, 0XE5, 0XE1, 0XE3, 0XAB, 0X5E, 0X76, 0X73, 0X6F, 0XFB
};
word32 sigLen = (word32)sizeof(sigBuf);
wolfCrypt_Init();
ret = hash_firmware_verify(hash, sizeof(hash), sigBuf, sigLen);
printf("hash_firmware_verify: %d\n", ret);
wolfCrypt_Cleanup();
return 0;
}
#else
int main()
{
printf("WOLFSSL_DSP expected to be defined when building\n");
return 0;
}
#endif /* WOLFSSL_DSP */

14
IDE/HEXAGON/include.am Normal file
View File

@@ -0,0 +1,14 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/HEXAGON/Makefile
EXTRA_DIST+= IDE/HEXAGON/user_settings.h
EXTRA_DIST+= IDE/HEXAGON/README.md
EXTRA_DIST+= IDE/HEXAGON/build.sh
EXTRA_DIST+= IDE/HEXAGON/ecc-verify.c
EXTRA_DIST+= IDE/HEXAGON/ecc-verify-benchmark.c
EXTRA_DIST+= IDE/HEXAGON/DSP/Makefile
EXTRA_DIST+= IDE/HEXAGON/DSP/wolfssl_dsp.idl

View File

@@ -0,0 +1,37 @@
#ifndef USER_SETTINGS_H
#define USER_SETTINGS_H
#define WOLFCRYPT_ONLY
#define HAVE_ECC
#define FP_ECC
//#define FP_ENTRIES 1
#define NO_DSA
#define NO_DH
#define NO_RSA
//#define DEBUG_WOLFSSL
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#ifdef HAVE_ECC
#define ECC_TIMING_RESISTANT
#endif
#ifndef NO_RSA
#define WC_RSA_BLINDING
#endif
#if 1
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_MATH
#if 1
/* ARM NEON instructions */
#define WOLFSSL_SP_ARM64_ASM
#endif
#if 1
/* Use DSP */
#define WOLFSSL_DSP
#endif
#endif
#endif

View File

@@ -1,6 +1,6 @@
/* benchmark-main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* current-time.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -44,7 +44,7 @@ void InitTimer(void) {
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
printf("Clock=%dMHz\n", ui32SysClock/1000000) ;
printf("Clock=%dMHz\n", (int)(ui32SysClock/1000000));
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, -1);
@@ -64,10 +64,10 @@ double current_time(int reset)
/* dummy */
double current_time(int reset) {
static double t;
t += 1.0; /* for avoid infinit loop of waiting time */
static double t;
t += 1.0; /* for avoid infinite loop of waiting time */
if(reset)t = 0.0;
return t ;
}
return t ;
}
#endif
#endif

View File

@@ -1,6 +1,6 @@
/* minimum-startup.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -343,7 +343,7 @@
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>CCPosIndRwpi</name>

View File

@@ -1,6 +1,6 @@
/* test-main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -34,11 +34,11 @@
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
#undef ECC_ALT_SIZE
#define ECC_ALT_SIZE
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#undef FP_MAX_BITS_ECC
#define FP_MAX_BITS_ECC 528
#define FP_MAX_BITS_ECC (256 * 2)
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

View File

@@ -84,11 +84,13 @@
#define ECC_TIMING_RESISTANT
#ifdef USE_FAST_MATH
/* Max ECC bits (curve size * 8). ECC521 is (66*8) = 528. */
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#undef FP_MAX_BITS_ECC
#define FP_MAX_BITS_ECC 528
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
//#undef FP_MAX_BITS_ECC
//#define FP_MAX_BITS_ECC (528 * 2)
/* Enable TFM optimizations for ECC */
#define TFM_ECC192

View File

@@ -6,7 +6,7 @@ embOS v4.16 (for Cortex-M and IAR compiler)
wolfssl (latest version)
Required items (Hardware) for this guide:
Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board)
Atmel SAM V71 Xplained Ultra (Or equivalent Cortex-M Evaluation Board)
Note: Must have J-Trace adapter (SWD or SWD + ETM)
j-Trace for ARM Cortex-M Processors
Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html

View File

@@ -6,7 +6,7 @@ embOS v4.16 (for Cortex-M and IAR compiler)
wolfssl (latest version)
Required items (Hardware) for this guide:
Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board)
Atmel SAM V71 Xplained Ultra (Or equivalent Cortex-M Evaluation Board)
Note: Must have J-Trace adapter (SWD or SWD + ETM)
j-Trace for ARM Cortex-M Processors
Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html

View File

@@ -6,7 +6,7 @@ embOS v4.16 (for Cortex-M and IAR compiler)
wolfssl (latest version)
Required items (Hardware) for this guide:
Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board)
Atmel SAM V71 Xplained Ultra (Or equivalent Cortex-M Evaluation Board)
Note: Must have J-Trace adapter (SWD or SWD + ETM)
j-Trace for ARM Cortex-M Processors
Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html

View File

@@ -109,7 +109,7 @@ We are now set to link to this library in the evaluation project
#---------------------------------------------
5. Go to Project -> Options -> Linker -> Library (Tab)
Add to the field "Additonal libraries:"
Add to the field "Additional libraries:"
$PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Exe\wolfcrypt_lib.a
$PROJ_DIR$\..\..\extract_trial_here\Start\Lib\os7m_tlv_dp.a

View File

@@ -31,11 +31,11 @@
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
#undef ECC_ALT_SIZE
#define ECC_ALT_SIZE
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#undef FP_MAX_BITS_ECC
#define FP_MAX_BITS_ECC 528
#define FP_MAX_BITS_ECC (256 * 2)
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

View File

@@ -55,7 +55,7 @@ int wolfExample_TLSClient(const char* ip, int port)
int ret = 0;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL; /* create WOLFSSL object */
int sockFd = -1; /* socket file descriptor */
int sockFd; /* socket file descriptor */
struct sockaddr_in servAddr; /* struct for server address */
char sendBuff[TLS_MAXDATASIZE], rcvBuff[TLS_MAXDATASIZE];
@@ -144,13 +144,13 @@ int wolfExample_TLSServer(int port)
int ret = 0;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL;
int sockFd = -1, clientFd = -1;
int sockFd, clientFd = -1;
struct sockaddr_in serverAddr = {0}, clientAddr = {0};
const char reply[] = "I hear ya fa shizzle!\n";
int addrSize = sizeof(clientAddr);
char buff[256];
sockFd = socket(AF_INET, SOCK_STREAM, 0);
sockFd = socket(AF_INET, SOCK_STREAM, 0);
if (sockFd < 0) {
printf("Failed to create socket. Error: %d\n", errno);
return errno;

View File

@@ -1,10 +1,14 @@
# Static Library: Building libwolfssl.sgx.static.lib.a for use with SGX Enclaves
### Requirements:
This code was created to use Intel's SGX hardware. It is expected that the user has gone through the steps of both turning on the hardware in bios if needed and has installed the necesary software from Intel to make use of the hardware. (https://software.intel.com/en-us/sgx) If these steps have not been done then it is expected that the user is familure with simulation software being used in place of hardware.
This code was created to use Intel's SGX hardware. It is expected that the user has gone through the steps of both turning on the hardware in bios if needed and has installed the necessary software from Intel to make use of the hardware. (https://software.intel.com/en-us/sgx) If these steps have not been done then it is expected that the user is familiar with simulation software being used in place of hardware.
### Security:
If not already in use, it is recommended that SP (single precision) RSA and ECC code is used. This will help mitigate potential side channel attacks. To use SP code check that wolfcrypt/src/sp_c32.c and wolfcrypt/src/sp_c64.c are compiled and add HAVE_WOLFSSL_SP=1 to the build command to define the necessary macros.
### Overview and Build:
This project creates a static library to then link with Enclaves. A simple example of an Enclave linking to the created wolfSSL library can be found in wolfssl-examples on github. This project has been tested with gcc 5.4.0 on Ubuntu 16.04.
When building with tests the file wolfssl/options.h is expected, in downloaded bundles from wolfssl.com this file exists but when building from a cloned version of wolfSSL from GitHub then the file needs created. This is done either through cd wolfssl && ./autogen.sh && ./configure && ./config.status or by cd wolfssl && touch wolfssl/options.h.
To create the static library, simply call make:
@@ -20,9 +24,10 @@ This will create a local static library, libwolfssl.sgx.static.lib.a, that can b
To enable wolfssl debug, add CFLAGS=-DDEBUG_WOLFSSL.
To enable wolfssl benchmark tests with enclave, specify: HAVE_WOLFSSL_BENCHMARK at build
To enable wolfcrypt testsuite with enclave, specify: HAVE_WOLFSSL_TEST at build
To enable SP code, specify: HAVE_WOLFSSL_SP at build
For example, to enable all three:
`make -f sgx_t_static.mk CFLAGS=-DDEBUG_WOLFSSL HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1`
For example:
`make -f sgx_t_static.mk CFLAGS=-DDEBUG_WOLFSSL HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1 HAVE_WOLFSSL_SP=1`
NOTE: This more customized step has been provided for easier execution in the
script `build.sh`

View File

@@ -5,5 +5,5 @@ CFLAGS_NEW="-DDEBUG_WOLFSSL"
export CFLAGS="${CFLAGS} ${CFLAGS_NEW}"
echo ${CFLAGS}
make -f sgx_t_static.mk HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1
make -f sgx_t_static.mk HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1 HAVE_WOLFSSL_SP=1

View File

@@ -45,6 +45,7 @@ endif
Crypto_Library_Name := sgx_tcrypto
Wolfssl_C_Extra_Flags := -DWOLFSSL_SGX
Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/arc4.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/asn.c\
@@ -86,6 +87,8 @@ Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sha256.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sha512.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/signature.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_c32.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_c64.c\
$(WOLFSSL_ROOT)/src/ssl.c\
$(WOLFSSL_ROOT)/src/tls.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/wc_encrypt.c\
@@ -105,6 +108,11 @@ ifeq ($(HAVE_WOLFSSL_BENCHMARK), 1)
Wolfssl_Include_Paths += -I$(WOLFSSL_ROOT)/wolfcrypt/benchmark/
endif
ifeq ($(HAVE_WOLFSSL_SP), 1)
Wolfssl_C_Extra_Flags += -DWOLFSSL_HAVE_SP_RSA \
-DWOLFSSL_HAVE_SP_DH \
-DWOLFSSL_HAVE_SP_ECC
endif
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11

View File

@@ -1,6 +1,6 @@
/* lpc_18xx_port.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -22,7 +22,8 @@
#define FP_LUT 4
#define FP_MAX_BITS 2048 /* 4096 */
#define FP_MAX_BITS_ECC 512
#define ECC_USER_CURVES /* Disables P-112, P-128, P-160, P-192, P-224, P-384, P-521 but leaves P-256 enabled */
#define FP_MAX_BITS_ECC (256 * 2)
#define ALT_ECC_SIZE
#define USE_FAST_MATH
#define SMALL_SESSION_CACHE
@@ -52,7 +53,6 @@
#define NO_64BIT
#define NO_WOLFSSL_SERVER
#define NO_OLD_TLS
#define ECC_USER_CURVES /* Disables P-112, P-128, P-160, P-192, P-224, P-384, P-521 but leaves P-256 enabled */
#define NO_DES3
#define NO_MD5
#define NO_RC4

View File

@@ -1,6 +1,6 @@
/* lpc_18xx_startup.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -3,7 +3,7 @@ toolchain and example benchmark/testwolfcrypt application linking to it. The
examples and default builds where made to support a MCF5441X board.
Macros to define for use:
WOLFSSL_MCF5441X /* arch settings i.e. sizeof long and endianess */
WOLFSSL_MCF5441X /* arch settings i.e. sizeof long and endianness */
WOLFSSL_NETBURNER /* for use of NetBurner headers and RNG seed */
@@ -17,7 +17,7 @@ wolfssl-root/wolfssl/wolfcrypt/settings.h sets the sizeof long and long long
along with big endian macro.
The configuration for the build is located in wolfssl-root/IDE/M68K/user_settings.h
Along with the defualt build there is 2 others BUILD_B (smaller resource use),
Along with the default build there is 2 others BUILD_B (smaller resource use),
and BUILD_C (faster runtime with more resource use).
RSA speeds of the builds

View File

@@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* time.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* certs_test.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* config-BEREFOOT.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* config-FS.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* config-RTX-TCP-FS.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* config.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/*shell.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -214,7 +214,7 @@ static struct {
"stack", stack_comm, /* On/Off check stack size */
"for", for_command, /* iterate next command X times */
"debug", dbg_comm, /* On/Off debug message */
"help", help_comm, /* Breif description about the commands */
"help", help_comm, /* Brief description about the commands */
/** short name **/
"ec", echoclient_test,
@@ -436,7 +436,7 @@ static void for_command(void *args)
{
if( args == NULL || ((func_args *)args)->argc == 1) {
printf("For %d times\n", for_iteration) ;
} else if( args == NULL || ((func_args *)args)->argc == 2) {
} else if(((func_args *)args)->argc == 2) {
for_iteration = atoi(((func_args *)args)->argv[1]) ;
} else printf("Invalid argument\n") ;
}
@@ -483,7 +483,7 @@ static char command_stack[COMMAND_STACK_SIZE] ;
static wolfSSL_Mutex command_mutex ;
#endif
/*********** Invoke Forground Command *********************/
/*********** Invoke Foreground Command *********************/
static void command_invoke(void *args)
{
void (*func)(void * ) ;

View File

@@ -1,6 +1,6 @@
/* time-STM32F2.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* time-dummy.c.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* wolfssl_KEIL_RL.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -69,7 +69,7 @@ char *inet_ntoa(struct in_addr in)
unsigned long inet_addr(const char *cp)
{
unsigned int a[4] ; unsigned long ret ;
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
sscanf(cp, "%u.%u.%u.%u", &a[0], &a[1], &a[2], &a[3]) ;
ret = ((a[3]<<24) + (a[2]<<16) + (a[1]<<8) + a[0]) ;
return(ret) ;
}

View File

@@ -1,6 +1,6 @@
/* wolfssl_KEIL_RL.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* time-STM32F2xx.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@@ -516,4 +516,3 @@
// </e>
//</h>

View File

@@ -1,6 +1,6 @@
/* wolfssl_KEIL_ARM.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -55,10 +55,10 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS<4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
@@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@@ -516,4 +516,3 @@
// </e>
//</h>

View File

@@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@@ -516,4 +516,3 @@
// </e>
//</h>

View File

@@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 14
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@@ -245,7 +245,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@@ -514,4 +514,3 @@
// </e>
//</h>

Some files were not shown because too many files have changed in this diff Show More