Compare commits

...

1113 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
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
Eric Blankenhorn
7744f0d543 Check for non-blocking return code in BioSend 2020-08-13 15:33:20 -05: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
Takashi Kojo
fd257ee8b9 fix guard 2020-07-03 05:42:44 +09:00
347 changed files with 70318 additions and 19613 deletions

22
.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
@@ -227,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-*
@@ -336,3 +350,11 @@ IDE/XCODE/Index
/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

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,153 @@
# 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
@@ -106,7 +256,8 @@ in a specific use case, 1 fix for DTLS.
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 for the report.
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
@@ -335,13 +486,13 @@ Release 4.3.0 of wolfSSL embedded TLS has bug fixes and new features including:
* 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
* 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()
* 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
@@ -405,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
@@ -446,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
@@ -986,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
@@ -1106,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`.
@@ -1114,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
@@ -1737,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.
@@ -1748,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
@@ -1795,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.
@@ -1821,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.
@@ -1831,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.
@@ -1853,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
@@ -1874,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.
@@ -1904,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
@@ -1917,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
@@ -1930,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.
@@ -1962,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.
@@ -1974,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.
@@ -1993,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.
@@ -2006,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.
@@ -2029,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.
@@ -2048,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.
@@ -2065,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.
@@ -2089,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)
@@ -2108,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
@@ -2141,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)
@@ -2169,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
@@ -2188,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
@@ -2211,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
@@ -2221,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
@@ -2255,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.
@@ -2313,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>:
```
@@ -2498,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:
@@ -2517,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
@@ -2537,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.
@@ -2545,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.
@@ -2553,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.
@@ -2569,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.
@@ -2587,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
@@ -2609,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
@@ -2618,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.
@@ -2660,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,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

@@ -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,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

@@ -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

@@ -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;
@@ -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

@@ -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

@@ -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
@@ -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;
@@ -98,7 +99,7 @@ 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_IDF_VERSION_MINOR >= 1
#if ESP_IDF_VERSION_MAJOR >= 4
ESP_LOGI(TAG, "got ip:" IPSTR "\n",
IP2STR(&event->event_info.got_ip.ip_info.ip));
#else
@@ -131,7 +132,7 @@ void app_main(void)
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,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

@@ -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) {
@@ -562,7 +562,7 @@ 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("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("01", "-5", "1", "3", verbose));
@@ -602,7 +602,7 @@ 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("0A", "5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-0A", "-5", "2", verbose));

View File

@@ -43,6 +43,15 @@
#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 */

View File

@@ -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
/* ------------------------------------------------------------------------- */

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

@@ -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

@@ -24,6 +24,7 @@ extern "C" {
#undef WOLFSSL_SMALL_STACK_CACHE
//#define WOLFSSL_SMALL_STACK_CACHE
#define WOLFSSL_IGNORE_FILE_WARN
/* ------------------------------------------------------------------------- */
/* Math Configuration */
@@ -44,6 +45,25 @@ extern "C" {
#undef WOLFSSL_DEBUG_MATH
//#define WOLFSSL_DEBUG_MATH
/* Wolf Single Precision Math */
#undef WOLFSSL_SP
#if 0
#define WOLFSSL_SP
#define WOLFSSL_SP_SMALL /* use smaller version of code */
#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 */
/* 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
/* ------------------------------------------------------------------------- */
/* Crypto */

View File

@@ -104,6 +104,9 @@
<file file_name="../../wolfcrypt/src/wc_port.c" />
<file file_name="../../wolfcrypt/src/wolfmath.c" />
<file file_name="../../wolfcrypt/src/wolfevent.c" />
<file file_name="../../wolfcrypt/src/sp_c32.c" />
<file file_name="../../wolfcrypt/src/sp_cortexm.c" />
<file file_name="../../wolfcrypt/src/sp_int.c" />
</folder>
<folder Name="test">
<file file_name="../../wolfcrypt/test/include.am" />

View File

@@ -4,7 +4,7 @@ wolfSSL for Renesas RA Evaluation Kit (EK-RA6M3G)
## Description
This directory contains e2studio projects targeted at the Renesas RA 32-bit MCUs.\
The example projects include a wolfSSL TLS 1.2 client and server.\
The example projects include a wolfSSL TLS client and server.\
They also include benchmark and cryptography tests for the wolfCrypt library.
The wolfssl project contains both the wolfSSL and wolfCrypt libraries.\
@@ -15,28 +15,31 @@ The other projects (benchmark, client, server and test) are built as a\
`Renesas RA C Project Using RA Library`, where the RA library is the wolfssl project.\
The wolfssl Project Summary is listed below and is relevant for every project.
#### Project Summary
### Project Summary
|Item|Name/Version|
|:--|:--|
|Board|EK-RA6M3G|
|Device|R7FA6M3AH3CFC|
|Toolchain|GCC ARM Embedded|
|FSP Version|0.8.0|
`Board: EK-RA6M3G`\
`Device: R7FA6M3AH3CFC`\
`Toolchain: GCC ARM Embedded`\
`FSP Version: 0.8.0`
#### Selected software components
##### Selected software components
`Board Support Package Common Files v0.8.0`\
`Arm CMSIS Version 5 - Core (M) v5.5.1`\
`Amazon FreeRTOS v0.8.0`\
`RA6M3G-EK Board Support Files v0.8.0`\
`Board support package for R7FA6M3AH3CFC v0.8.0`\
`Board support package for RA6M3 v0.8.0`\
`Board support package for RA6M3 v0.8.0`\
`Amazon FreeRTOS - Memory Management - Heap 4 v0.8.0`\
`r_ether to FreeRTOS+TCP Wrapper v0.8.0`\
`Ethernet v0.8.0`\
`Ethernet PHY v0.8.0`\
`FreeRTOS+TCP v0.8.0`\
`Amazon FreeRTOS - Buffer Allocation 2 v0.8.0`
|Components|Version|
|:--|:--|
|Board Support Package Common Files|v0.8.0`|
|Arm CMSIS Version 5 - Core (M)|v5.5.1|
|Amazon FreeRTOS|v0.8.0|
|RA6M3G-EK Board Support Files|v0.8.0|
|Board support package for R7FA6M3AH3CFC|v0.8.0|
|Board support package for RA6M3|v0.8.0|
|Board support package for RA6M3|v0.8.0|
|Amazon FreeRTOS - Memory Management - Heap 4|v0.8.0|
|r_ether to FreeRTOS+TCP Wrapper|v0.8.0|
|Ethernet|v0.8.0|
|Ethernet PHY|v0.8.0|
|FreeRTOS+TCP|v0.8.0|
|Amazon FreeRTOS - Buffer Allocation 2|v0.8.0|
## Setup Steps
@@ -46,55 +49,64 @@ These files can be generated when creating a new Renesas RA Project.\
The following steps explain how to generate the missing files and where to place them.
1.) Create a 'dummy' Renesas RA C Library Project.
+ Click File->New->`RA C/C++ Project`
+ Click `Renesas RA C Library Project`. Click Next
+ Enter `dummy_library` as the project name. Click Next.
+ Under `Board: Custom User Board`, select `EK-RA6M3G`.
+ Under `RTOS: No RTOS`, select `Amazon FreeRTOS`.
+ Click Next. Select `Amazon FreeRTOS - Minimal - Static Allocation`
+ Click Finish.
+ Click File->New->`RA C/C++ Project`
+ Click `Renesas RA C Library Project`. Click Next
+ Enter `dummy_library` as the project name. Click Next.
+ Under `Board: Custom User Board`, select `EK-RA6M3G`.
+ Under `RTOS: No RTOS`, select `Amazon FreeRTOS`.
+ Click Next. Select `Amazon FreeRTOS - Minimal - Static Allocation`
+ Click Finish.
2.) Create a 'dummy' Renesas RA C Project Using RA Library.
+ Click File->New->`RA C/C++ Project`
+ Click `Renesas RA C Project Using RA Library`. Click Next
+ Enter `dummy_app` as the project name. Click Next.
+ Under `RA library project`, select `dummy_library`.
+ Click Finish.
+ Click File->New->`RA C/C++ Project`
+ Click `Renesas RA C Project Using RA Library`. Click Next
+ Enter `dummy_app` as the project name. Click Next.
+ Under `RA library project`, select `dummy_library`.
+ Click Finish.
3.) Import all the wolfSSL Projects into e2studio workspace.
+ Click File->`Open Projects from File System`
+ Click `Directory...` to the right of Import source
+ Select the RA6M3G folder location that contains the projects\
example path: wolfssl/IDE/Renesas/e2studio/RA6M3
+ Deselect the Non-Eclipse project, RA6M3G, by clicking the checkbox\
Only the folders with 'Eclipse project' under 'Import as' need to be selected.
+ Click Finish.
+ Click File->`Open Projects from File System`
+ Click `Directory...` to the right of Import source
+ Select the RA6M3G folder location that contains the projects\
example path: wolfssl/IDE/Renesas/e2studio/RA6M3
+ Deselect the Non-Eclipse project, RA6M3G, by clicking the checkbox\
Only the folders with 'Eclipse project' under 'Import as' need to be selected.
+ Click Finish.
4.) Copy files from `dummy_library` into `wolfSSL_RA6M3G`
+ Expand the dummy_library and wolfSSL_RA6M3G projects\
(Click the drop-down arrow to the left of the project name.)
+ Select and Copy the following folders/files inside dummy_library\
` ra/`\
` ra_gen/`\
` ra_cfg/`\
` script/`\
` R7FA6M3AH3CFC.pincfg`\
` RA6M3G-EK.pingcfg`
+ Paste the copied folders/files into wolfSSL_RA6M3G
+ The `dummy_library` project can now be deleted.
+ Generate Project Content.
+ Click `Open RA Configuration` in the top bar (Grey Settings Cog)
+ Click `Generate Project Content` at top right (Green Icon)
+ Build wolfSSL_RA6M3G.
+ Expand the dummy_library and wolfSSL_RA6M3G projects\
(Click the drop-down arrow to the left of the project name.)
+ Select and Copy the following folders/files inside dummy_library\
`ra/`\
`ra_gen/`\
`ra_cfg/`\
`script/`\
`R7FA6M3AH3CFC.pincfg`\
`RA6M3G-EK.pingcfg`
+ Paste the copied folders/files into wolfSSL_RA6M3G
+ The `dummy_library` project can now be deleted.
+ Generate Project Content.
+ Click `Open RA Configuration` in the top bar (Grey Settings Cog)
+ Click `Generate Project Content` at top right (Green Icon)
+ Build wolfSSL_RA6M3G.
5.) Copy files from `dummy_app` into `./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`\
**NOTE:** This may need to be done outside of the e2studio environment (e.g. File Explorer).
+ Select and Copy the followng folder inside dummy_app\
` src/`\
` script/`
+ Paste the copied folders into `./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`\
` (The test, benchmark, client and server projects link to this folder.)`
+ The `dummy_app` project can now be deleted.
+ Select and Copy the followng folder inside dummy_app\
`src/`\
`script/`
+ Paste the copied folders into `./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`\
`(The test, benchmark, client and server projects link to this folder.)`
+ The `dummy_app` project can now be deleted.
6.) Setup Network Environment
@@ -112,12 +124,14 @@ The following steps explain how to generate the missing files and where to place
Right-Click each Project and select Build.
### Run wolfCrypt Test and Benchmark
1.) Right-Click the Project name.\
2.) Select `Debug As` -> `Renesas GDB Hardware Debugging`\
3.) Select J-Link ARM. Click OK.\
4.) Select R7Fa6M3AH. Click OK.
### Run the wolfSSL TLS Server Example.
1.) Right-Click the Project name.\
2.) Select `Debug As` -> `Renesas GDB Hardware Debugging`\
3.) Select J-Link ARM. Click OK.\
@@ -125,34 +139,35 @@ Right-Click each Project and select Build.
5.) Run the following wolfSSL example client command inside the base of the wolfssl directory.
```
./examples/client/client -h "ucIPAddress" -p 11111 -A ./certs/1024/ca-cert.pem
./examples/client/client -v 4 -h "ucIPAddress" -p 11111 -A ./certs/1024/ca-cert.pem
```
**NOTE:** "ucIPAddress" is "192.168.1.241" by default. (See wolfssl_thread_entry.h)
### Run the wolfSSL TLS Client Example.
1.) Run the following wolfSSL example server command inside the base of the wolfssl directory.
```
./examples/server/server -b -d -p 11111 -c ./certs/1024/server-cert.pem -k ./certs/1024/server-key.pem
./examples/server/server -v 4 -b -d -p 11111 -c ./certs/1024/server-cert.pem -k ./certs/1024/server-key.pem
```
**NOTE:** The port 11111 is the DEFAULT_PORT inside wolfssl_thread_entry.h.\
If DEFAULT_PORT was changed then the above command will need to match it.
**NOTE:** The port 11111 is the DEFAULT_PORT inside wolfssl_thread_entry.h.\
2.) Right-Click the Project name.\
3.) Select `Debug As` -> `Renesas GDB Hardware Debugging`\
4.) Select J-Link ARM. Click OK.\
5.) Select R7Fa6M3AH. Click OK.
## Troubleshooting
* The commands for the example client/server assumes it is being run from the
+ The commands for the example client/server assumes it is being run from the
base directory of wolfssl.
* Enter "#define DEBUG_WOLFSSL" inside user_settings.h or wolfssl_thread_entry.c\
+ Enter "#define DEBUG_WOLFSSL" inside user_settings.h or wolfssl_thread_entry.c\
to enable wolfssl debug messages to the Renesas Virtual Debug Console.
* Some linking errors can be caused by the e2studio project files needing to be rebuilt and freshened.
+ Some linking errors can be caused by the e2studio project files needing to be rebuilt and freshened.
Right-Click a project, select Index, click Rebuild and then click Freshen Files. Repeat for each project.
[Support Forum](https://www.wolfssl.com/forums/)

View File

@@ -0,0 +1,198 @@
wolfSSL for Alpha Project AP-RA6M-0A Setup Guide
=================================================
## Description
This directory contains e2studio projects targeted at the Alpha Project AP-RA6M-0A board including the Renesas RA 32-bit MCUs.
The example projects include a wolfSSL TLS client and server. They also include benchmark and cryptography tests for the wolfCrypt library.
The wolfssl project contains both the wolfSSL and wolfCrypt libraries. It is built as a `Renesas RA C Library Project` and contains the Renesas RA configuration.
The other projects (benchmark, client, server and test) are built as a `Renesas RA C Project Using RA Library`, where the RA library is the wolfssl project.
The wolfssl Project Summary is listed below and is relevant for every project.
### Project Summary
|Item|Name/Version|
|:--|:----|
|e2studio|2020-07|
|Board |AP-RA6M-0A |
|Device |R7FA6M3AH3CFC|
|Toolchain|GCC ARM Embedded
|FSP Version|1.3.0|
### Selected software components
|Component|Version|
|:--|:---|
|Board Support Package Common Files|v1.3.0|
|Arm CMSIS Version 5 - Core (M) |v5.7.0|
|Board support package for R7FA6M3AH3CFC |v1.3.0|
|Board support package for RA6M3|v1.3.0 |
|Board support package for RA6M3 - FSP Data|v1.3.0|
|FreeRTOS|v1.3.0|
|FreeRTOS - Buffer Allocation 2 |v1.3.0|
|FreeRTOS+TCP|v1.3.0|
|r_ether to FreeRTOS+TCP Wrapper|v1.3.0|
|Ethernet |v1.3.0 |
|Ethernet PHY|v1.3.0|
|I/O Port|v1.3.0 |
|BSP-Board|v1.2.0 |
## Setup Steps
The project directories are missing files necessary to build the project.\
These files can be generated when creating a new Renesas RA Project.\
The following steps explain how to generate the missing files and where to place them.
1.) Download Alpha project example program from [Alpha Project Home Page](https://www.apnet.co.jp/product/ra/ap-ra6m-0a.html)
+ Unzip the downloaded example project
2.) Create a 'dummy' Renesas RA C Library Project on e2studio
+ Click File->New->`RA C/C++ Project`
+ Enter `dummy_library` as the project name. Click Next.
+ Select `Board: Custom User Board`.
+ Select `R7FA6M3AH3CFC
+ Under `RTOS: No RTOS`, select `FreeRTOS`.
+ Click Next. Select `FreeRTOS - Minimal - Static Allocation`
+ Click `Renesas RA C Library Project`. Click Next
+ Click Finish.
3.) Create a 'dummy' Renesas RA C Project Using RA Library on e2studio
+ Click File->New->`RA C/C++ Project`
+ Enter `dummy_app` as the project name. Click Next.
+ Under `RA library project`, select `dummy_library`.
+ Click `Executable Using an RA Static Library`. Click Next
+ Click Finish.
+ Enter `dummy_app` as Project name
+ Select RA library project `dummy_library`
4.) Import all the wolfSSL Projects into e2studio workspace.
+ Click File->`Open Projects from File System`
+ Click `Directory...` to the right of Import source
+ Select the RA6M3G folder location that contains the projects
example path: wolfssl/IDE/Renesas/e2studio/RA6M3
+ Deselect the Non-Eclipse project, RA6M3G, by clicking the checkbox
Only the folders with 'Eclipse project' under 'Import as' need to be selected.
+ Click Finish.
5.) Copy files from `dummy_library` into `wolfSSL_RA6M3G`
+ Expand the dummy_library and wolfSSL_RA6M3G projects
(Click the drop-down arrow to the left of the project name.)
+ Select and Copy the following folders/files inside dummy_library
`ra/`
`ra_gen/`
`ra_cfg/`
`script/`
+ Paste the copied folders/files into wolfSSL_RA6M3G
+ The `dummy_library` project can now be deleted.
+ Copy `APRA6M0A.pincfg` from ap_ra6m_0a_sample\sample\ap_ra6m_0a_ether_sample to wolfSSL_RA6M3G
+ Delete `R7FA6M3AH3CFC.pincfg` from wolfSSL_RA6M3G
+ Generate Project Content.
+ Click `Open RA Configuration` in the top bar (Grey Settings Cog)
+ Go to `BSP` tab and import CMSIS pack file, AP.APRA6M0A.x.x.x.pack, from ap_ra6m_0a_sample\sample folder
+ Select APRA6M0A as Board
+ Go to `Pins` tab and select APRA6M0A.pincfg
+ Go to `Stacks` tab and add Heap 4 stack from New Stack(+ Icon)
+ Click `Generate Project Content` at top right (Green Icon)
+ Build wolfSSL_RA6M3G.
6.) Copy files from `dummy_app` into `./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`
**NOTE:** This may need to be done outside of the e2studio environment (e.g. File Explorer).
+ Select and Copy the followng folder inside dummy_app
`src/`
`script/`
+ Paste the copied folders into `./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`
`(The test, benchmark, client and server projects link to this folder.)`
+ The `dummy_app` project can now be deleted.
7.) Setup Network Environment
The client and server projects have defines inside their wolfssl_thread_entry.h.
These defines (ucIPAddress ... ucDNSServerAddress) may need to be changed
based on your internal network environment. The g_ether0_mac_address is the default
mac address found inside the RA configuration inside the wolfssl project.
The client wolfssl_thread_entry.h has defines (SERVER_IP and DEFAULT_PORT) that
will need to be changed based on the server you're trying to connect to over
the ethernet connection.
## Build and Run
### Build Each Project
Right-Click each Project and select Build.
### Run wolfCrypt Test and Benchmark
1.) Right-Click the Project name.
2.) Select `Debug As` -> `Renesas GDB Hardware Debugging`
3.) Select J-Link ARM. Click OK.
4.) Select R7Fa6M3AH. Click OK.
### Run the wolfSSL TLS Server Example.
1.) Right-Click the Project name.
2.) Select `Debug As` -> `Renesas GDB Hardware Debugging`
3.) Select J-Link ARM. Click OK.
4.) Select R7Fa6M3AH. Click OK.
5.) Run the following wolfSSL example client command inside the base of the wolfssl directory.
```
./examples/client/client -v 4 -h "ucIPAddress" -p 11111 -A ./certs/1024/ca-cert.pem
```
**NOTE:** "ucIPAddress" is "192.168.1.241" by default. (See wolfssl_thread_entry.h)
### Run the wolfSSL TLS Client Example.
1.) Run the following wolfSSL example server command inside the base of the wolfssl directory.
```
./examples/server/server -v 4 -b -d -p 11111 -c ./certs/1024/server-cert.pem -k ./certs/1024/server-key.pem
```
**NOTE:** The port 11111 is the DEFAULT_PORT inside wolfssl_thread_entry.h.
If DEFAULT_PORT was changed then the above command will need to match it.
2.) Right-Click the Project name.\
3.) Select `Debug As` -> `Renesas GDB Hardware Debugging`\
4.) Select J-Link ARM. Click OK.\
5.) Select R7Fa6M3AH. Click OK.
## Troubleshooting
+ The commands for the example client/server assumes it is being run from the
base directory of wolfssl.
+ Enter "#define DEBUG_WOLFSSL" inside user_settings.h or wolfssl_thread_entry.c
to enable wolfssl debug messages to the Renesas Virtual Debug Console.
+ Some linking errors can be caused by the e2studio project files needing to be rebuilt and freshened.
Right-Click a project, select Index, click Rebuild and then click Freshen Files. Repeat for each project.
[Support Forum](https://www.wolfssl.com/forums/)
Support Email: support@wolfssl.com
## Resources
[wolfSSL Website](https://www.wolfssl.com/)
[wolfSSL Wiki](https://github.com/wolfSSL/wolfssl/wiki)
[wolfSSL Manual](https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-toc.html)
[wolfSSL API Reference](https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-wolfssl-api-reference.html)
[wolfCrypt API Reference](https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-18-wolfcrypt-api-reference.html)
[TLS 1.3](https://www.wolfssl.com/docs/tls13/)

View File

@@ -0,0 +1,197 @@
wolfSSL/AlphaProject AP-RA6M-0A ボードデモ セットアップガイド
=================================================
## はじめに
このフォルダにはルネサス社製 RA 32-bit MCU を搭載するアルファプロジェクト製 AP-RA6M-0A で wolfSSL を動作させるための手順です。
サンプルプログラムには、暗号テスト、ベンチマーク、及びクライアント・サーバーを含んでいます。
wolfSSL のプロジェクトファイルは、wolfSSL と wolfCrypt の両方で構成され、Renesas RA のコンフィグレーションを含む`Renesas RA C/C++ Library Project`としてビルドされます。
その他、ベンチマーク、暗号テスト、及びクライアント・サーバーのサンプルプログラムは、`Renesas RA C Project Using RA Library`としてビルドされます。
プロジェクトの概要と全ての関連するソフトウェアコンポーネントに関する情報を下記になります。
### プロジェクトの概要
|要素|名前/バージョン|
|:--|:--|
|e2studio|2020-07|
|Board|AP-RA6M-0A|
|Device|R7FA6M3AH3CFC|
|Toolchain|GCC ARM Embedded|
|FSP Version|1.3.0|
#### 必要なソフトウェアコンポーネント
|コンポーネント|バージョン|
|:--|:--|
|Board Support Package Common Files|v1.3.0|
|Arm CMSIS Version 5 - Core (M) |v5.7.0|
|Board support package for R7FA6M3AH3CFC |v1.3.0|
|Board support package for RA6M3|v1.3.0 |
|Board support package for RA6M3 - FSP Data|v1.3.0|
|FreeRTOS|v1.3.0|
|FreeRTOS - Buffer Allocation 2 |v1.3.0|
|FreeRTOS+TCP|v1.3.0|
|r_ether to FreeRTOS+TCP Wrapper|v1.3.0|
|Ethernet |v1.3.0 |
|Ethernet PHY|v1.3.0|
|I/O Port|v1.3.0 |
|BSP-Board|v1.2.0 |
## セットアップ手順
プロジェクトのフォルダーには、ビルドに必要なファイルが不足しています。そららのファイルをダミーのプロジェクトを作成し補います。
次に続くステップは、不足しているファイルを作成し、それらを必要としているプロジェクトにコピーする手順です。
1.) [アルファプロジェクト社のホームページ](https://www.apnet.co.jp/product/ra/ap-ra6m-0a.html)からサンプルプログラムをダウンロード
+ ダウンロードしたサンプルプログラムを適当なフォルダーへ解凍
2.) e2Studio で'ダミー' Renesas RA C Library プロジェクトを作成
+ ファイル→新規→`RA C/C++ Project`をクリック
+ `Renesas RA C/C++ Library Project`を選択し、次へをクリック
+ 'dummy_library` とプロジェクト名を入力します。
+ `Board:` ドロップダウンから `EK-RA6M3T`を選択します
+ `RTOS: No TROS` を `FreeRTOS` を選択します。
+ `Build Artifact Selection` の `Static Library`を選択し、次へをクリック
+ `FreeRTOS - Minimal - Static Allocation` を選択し、終了をクリック
3.) e2Studio で 'ダミー'の Renesas RA C/C++ Project Using RA Library を作成
+ ファイル→新規→`RA C/C++ Project`をクリック
+ `Renesas RA C/C++ Library Project`を選択し、次へをクリック
+ 'dummy_app` とプロジェクト名を入力します。
+ `Board:` ドロップダウンから `EK-RA6M3T`を選択します
+ `RTOS: No TROS``FreeRTOS` を選択しまし、次へをクリック
+ `Build Artifact Selection``Executable Using an RA Static Library`を選択し、終了をクリック
+ 'dummy_app` とプロジェクト名を入力し、次へクリック
+ `RA library project`の `Select RA Library`から, `dummy_library`を選択し、終了をクリック
4.) 全ての wolfSSL e2studio プロジェクトをインポート
+ メニューの「ファイル」→「ファイル・システムからプロジェクトを開く」をクリック
+ インポート元の `ディレクトリー...` をクリック
+ RA6M3 フォルダーを選択。wolfssl/IDE/Renesas/e2studio/RA6M3
+ Eclipseのプロジェクトではない、RA6M3を除外します。
その他、ベンチマーク、暗号テスト、クライアント・サーバーの各プロジェクトは選択しておく。
+ 終了をクリック
5.) `dummy_library`からwolfSSL_RA6M3Gへ必要なファイルをコピー
+ `dummy_library` と `wolfSSL_RA6M3G` プロジェクトを開く
プロジェクト名横にある矢印マークをクリック
+ `dummy_library` の以下のフォルダーとファイルを選択
`ra/`
`ra_gen/`
`ra_cfg/`
`script/`
+ 選択したフォルダーとファイルを `wolfSSL_RA6M3G`プロジェクトに貼り付け
+ `dummy_library`プロジェクトは削除しても構いません
+ `APRA6M0A.pincfg` を解凍した ap_ra6m_0a_sample\sample\ap_ra6m_0a_ether_sample から `wolfSSL_RA6M3G`プロジェクトへコピー
+ `wolfSSL_RA6M3G`フォルダー内の `R7FA6M3AH3CFC.pincfg` は削除します。
+ プロジェクトに必要なファイルを生成します。
+ `Open RA Configuration`(上部のアイコンバーにある灰色歯車ボタン)をクリック
+ `BSP` タブに移動し、CMSIS Pack のインポートボタンをクリック
+ インポート画面で、CMSIS pack ファイルを指定
ステップ 1で解凍したap_ra6m_0a_sample\sampleフォルダー中の AP.APRA6M0A.x.x.x.pack を指定します。
+ `APRA6M0A` を Board として指定
+ `Pins`タブに移動し、`APRA6M0A.pincfg`を選択
+ `Stacks`タブに移動し、Heap 4 stack を New Stack から追加
+ `Generate Project Content`(右上部にある緑色アイコン)をクリックし、ファイルを生成
+ `wolfSSL_RA6M3G`をビルド
6.) `dummy_app` から必要なファイルを`./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`へコピー
**NOTE:** この作業は、e2studio ではなく、Explorer などを使用します。
+ `dummy_app`の以下のフォルダーをコピー
`src/`
`script/`
+ 選択したフォルダーを`./IDE/Renesas/e2studio/RA6M3/common/ra6m3g/`へコピー
`(暗号テスト、ベンチマーク、クライアント・サーバーの各プロジェクトはこのフォルダーを参照)`
+ `dummy_app`プロジェクトは削除しても構いません
7.) ネットワーク環境について
クライアント・サーバーのプロジェクト内のwolfssl_thread_entry.hにネットワーク設定があります。
それらの設定ucIPAddress ... ucDNSServerAddress)は、ご使用のネットワーク環境に合わせて変更して
してください。g_ether0_mac_address は、`wolfSSL_RA6M3G`プロジェクト内の RA configuration
で定義されているデフォルトのMACアドレスです。クライアントのwolfssl_thread_entry.h は
ターゲットのサーバーのSERVER_IP と DEFAULT_PORTの定義を持ちます。それらはご使用のサーバーの
の設定に応じて変更してください。
## ビルドと実行
### 各プロジェクトをビルド
各プロジェクトで右クリックし、ビルドを選択
### 暗号テストとベンチマークを実行
1.) プロジェクト名を選択し、右クリック\
2.) `デバック` → `Renesas GDB Hardware Debugging`\
3.) `J-Link ARM`を選択し、OK をクリック\
4.) `R7FA6M3AH`を選択し、OK をクリック
### wolfSSL TLS サンプルサーバーを実行
1.) プロジェクト名を選択し、右クリック\
2.) `デバック` → `Renesas GDB Hardware Debugging`\
3.) `J-Link ARM`を選択し、OK をクリック\
4.) `R7FA6M3AH`を選択し、OK をクリック\
5.)以下のサンプルのクライアントプログラムを実行
```
./examples/client/client -v 4 -h "ucIPAddress" -p 11111 -A ./certs/1024/ca-cert.pem
```
**NOTE:** "ucIPAddress" はデフォルトでは "192.168.1.241" (参照: wolfssl_thread_entry.h)
### wolfSSL TLS サンプルクライアントを実行
1.)以下のサンプルのサーバープログラムを実行
```
./examples/server/server -b -d -p 11111 -c ./certs/1024/server-cert.pem -k ./certs/1024/server-key.pem
```
TLS 1.3 で接続する際には、引数に "-v 4" を追加します。
```
./examples/server/server -v 4 -b -d -p 11111 -c ./certs/1024/server-cert.pem -k ./certs/1024/server-key.pem
```
**NOTE:** wolfssl_thread_entry.h中にデフォルトのポート番号 11111 定義(DEFAULT_PORT)
もし、DEFAULT_PORTを変更している場合、、上記のコマンドの "-p" の値は対応するポート番号に要変更
2.) プロジェクト名を選択し、右クリック\
3.) `デバック` → `Renesas GDB Hardware Debugging`\
4.) `J-Link ARM`を選択し、OK をクリック\
5.) `R7FA6M3AH`を選択し、OK をクリック
## トラブルシューティング
+ サンプルのクライアント・サーバープログラムは、wolfSSL のルートディレクトリから実行する必要があります。
+ user_settings.h の #define DEBUG_WOLFSSL を有効にすることで、デバックメッセージを\
`Renesas Virtual Debug Console`へ出力します。
+ プロジェクトのビルドでリンクエラーが出た場合、リビルドしリフレッシュすることで解決することがあります。
[Support Forum](https://www.wolfssl.com/forums/)
Support Email: support@wolfssl.com
## 参考リンク
[wolfSSL Website](https://www.wolfssl.com/)
[wolfSSL Wiki](https://github.com/wolfSSL/wolfssl/wiki)
[wolfSSL Manual](https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-toc.html)
[wolfSSL API Reference](https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-wolfssl-api-reference.html)
[wolfCrypt API Reference](https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-18-wolfcrypt-api-reference.html)
[TLS 1.3](https://www.wolfssl.com/docs/tls13/)

View File

@@ -95,7 +95,7 @@ void wolfssl_thread_entry(void *pvParameters) {
wolfSSL_Init();
/* Create and initialize WOLFSSL_CTX */
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
ctx = wolfSSL_CTX_new(wolfSSLv23_client_method_ex((void *)NULL));
if (ctx == NULL) {
printf("Error: wolfSSL_CTX_new.\n");
util_inf_loop(xClientSocket, ctx, ssl);

View File

@@ -24,11 +24,12 @@
#include <errno.h>
#include <wolfssl/certs_test.h>
extern uint8_t g_ether0_mac_address[6];
static const byte ucIPAddress[4] = { 192, 168, 1, 241 };
static const byte ucNetMask[4] = { 255, 255, 255, 0 };
static const byte ucGatewayAddress[4] = { 192, 168, 1, 1 };
static const byte ucDNSServerAddress[4] = { 192, 168, 1, 1 };
static const byte g_ether0_mac_address[6] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
/* Client connects to the server with these details. */
#define SERVER_IP "192.168.1.240"

View File

@@ -21,10 +21,16 @@
#ifndef USER_SETTINGS_H_
#define USER_SETTINGS_H_
/* Temporary defines. Not suitable for production. */
#define WOLFSSL_GENSEED_FORTEST /* Warning: define your own seed gen */
/* End temporary defines */
/* TLS 1.3 */
#define WOLFSSL_TLS13
#define HAVE_HKDF
#define WC_RSA_PSS
/* Operating Environment and Threading */
#define FREERTOS
#define FREERTOS_TCP
@@ -73,5 +79,6 @@
void wolfssl_thread_entry(void *pvParameters);
extern void initialise_monitor_handles(void);
int strncasecmp(const char *s1, const char * s2, unsigned int sz);
#endif /* USER_SETTINGS_H_ */

View File

@@ -31,3 +31,6 @@ EXTRA_DIST+= IDE/Renesas/e2studio/RA6M3/wolfssl/configuration.xml
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M3/README.md
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M3G/README.md
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M3/README_APRA6M_en.md
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M3/README_APRA6M_jp.md

View File

@@ -96,7 +96,7 @@ void wolfssl_thread_entry(void *pvParameters) {
configASSERT(xConnectedSocket != FREERTOS_INVALID_SOCKET);
/* Create WOLFSSL_CTX object */
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
ctx = wolfSSL_CTX_new(wolfSSLv23_server_method_ex((void *)NULL));
/* Load server certificates into WOLFSSL_CTX */
if (ctx == NULL) {
@@ -142,7 +142,6 @@ void wolfssl_thread_entry(void *pvParameters) {
}
memset(buff, 0, sizeof(buff));
ret = wolfSSL_read(ssl, buff, sizeof(buff) - 1);
if (ret < 0)
break;
@@ -156,6 +155,8 @@ void wolfssl_thread_entry(void *pvParameters) {
/* Reply back to the client */
ret = wolfSSL_write(ssl, buff, (int) strlen(buff));
if (ret < 0)
break;
/* Cleanup after this connection */
util_Cleanup(xConnectedSocket, ctx, ssl);

View File

@@ -23,11 +23,12 @@
#include <wolfssl/certs_test.h>
extern uint8_t g_ether0_mac_address[6];
static const byte ucIPAddress[4] = { 192, 168, 1, 241 };
static const byte ucNetMask[4] = { 255, 255, 255, 0 };
static const byte ucGatewayAddress[4] = { 192, 168, 1, 1 };
static const byte ucDNSServerAddress[4] = { 192, 168, 1, 1 };
static const byte g_ether0_mac_address[6] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
/* Server Cert and Key */
#define CERT_BUF server_cert_der_1024

View File

@@ -30,11 +30,6 @@
<nature>com.renesas.cdt.ra.contentgen.raNature</nature>
</natures>
<linkedResources>
<link>
<name>src/bio.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/src/bio.c</locationURI>
</link>
<link>
<name>src/crl.c</name>
<type>1</type>
@@ -195,11 +190,6 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/error.c</locationURI>
</link>
<link>
<name>wolfcrypt/evp.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/evp.c</locationURI>
</link>
<link>
<name>wolfcrypt/fe_low_mem.c</name>
<type>1</type>
@@ -275,11 +265,6 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/memory.c</locationURI>
</link>
<link>
<name>wolfcrypt/misc.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/misc.c</locationURI>
</link>
<link>
<name>wolfcrypt/pkcs12.c</name>
<type>1</type>

View File

@@ -14,8 +14,13 @@ These examples use the Cube HAL for STM32.
## Configuration
The settings for the wolfSTM32 project are located in `<wolfssl-root>/IDE/STM32Cube/wolfSSL.wolfSSL_conf.h`. The section for "Hardware platform" may need to be adjusted depending on your processor and board:
The settings for the wolfSSL CubeMX pack are in the generated `wolfSSL.wolfSSL_conf.h` file. An example of this is located in `IDE/STM32Cube/wolfSSL_conf.h` (renamed to avoid possible conflicts with generated file).
The template used for generation is `IDE/STM32Cube/default_conf.ftl` which can be updated at `STM32Cube/Repository/Packs/wolfSSL/wolfSSL/[Version]/CubeMX/templates/default_conf.ftl`.
The section for "Hardware platform" may need to be adjusted depending on your processor and board:
* To enable STM32F1 support define `WOLFSSL_STM32F1`.
* To enable STM32F2 support define `WOLFSSL_STM32F2`.
* To enable STM32F4 support define `WOLFSSL_STM32F4`.
* To enable STM32F7 support define `WOLFSSL_STM32F7`.
@@ -39,16 +44,17 @@ If you'd like to use the older Standard Peripheral library undefine `WOLFSSL_STM
If you are using FreeRTOS make sure your `FreeRTOSConfig.h` has its `configTOTAL_HEAP_SIZE` increased.
The TLS client/server benchmark example requires about 76 KB for allocated tasks (with stack) and peak heap.
The TLS client/server benchmark example requires about 76 KB for allocated tasks (with stack) and peak heap. This uses both a TLS client and server to test a TLS connection locally for each enabled TLS cipher suite.
## STM32 Cube Pack
### STM32 Cube Pack Installation
1. Download [wolfSSL Cube Pack](https://www.wolfssl.com/files/ide/I-CUBE-WOLFSSL-WOLFSSL.pack)
1. Download [wolfSSL Cube Pack](https://www.wolfssl.com/files/ide/I-CUBE-wolfSSL.pack)
2. Run the “STM32CubeMX” tool.
3. Under “Manage software installations” click “INSTALL/REMOVE” button.
4. From Local and choose “I-CUBE-WOLFSSL-WOLFSSL.pack”.
4. From Local and choose “I-CUBE-wolfSSL.pack”.
5. Accept the GPLv2 license. Contact wolfSSL at sales@wolfssl.com for a commercial license and support/maintenance.
### STM32 Cube Pack Usage
@@ -56,13 +62,14 @@ The TLS client/server benchmark example requires about 76 KB for allocated tasks
2. Under “Software Packs” choose “Select Components”.
3. Find and check all components for the wolfSSL.wolfSSL packs (wolfSSL / Core, wolfCrypt / Core and wolfCrypt / Test). Close
4. Under the “Software Packs” section click on “wolfSSL.wolfSSL” and configure the parameters.
5. For Cortex-M recommend “Math Configuration” -> “Single Precision Cortex-M Math”
5. For Cortex-M recommend “Math Configuration” -> “Single Precision Cortex-M Math” for the fastest option.
6. Generate Code
7. The Benchmark example uses float. To enable go to "Project Properties" -> "C/C++ Build" -> "Settings" -> "Tool Settings" -> "MCU Settings" -> Check "Use float with printf".
8. To enable printf make the `main.c` changes below in the [STM32 Printf](#stm32-printf) section.
### STM32 Cube Pack Examples
In the `I-CUBE-WOLFSSL-WOLFSSL.pack` pack there are pre-assembled example projects available.
In the `I-CUBE-wolfSSL.pack` pack there are pre-assembled example projects available.
After installing the pack you can find these example projects in `STM32Cube/Repository/Packs/wolfSSL/wolfSSL/[Version]/Projects`.
To use an example:
@@ -87,6 +94,49 @@ Please select one of the above options:
See [STM32_Benchmarks.md](STM32_Benchmarks.md).
Note: The Benchmark example uses float. To enable go to "Project Properties" -> "C/C++ Build" -> "Settings" -> "Tool Settings" -> "MCU Settings" -> Check "Use float with printf".
## STM32 Printf
In main.c make the following changes:
```
/* Retargets the C library printf function to the USART. */
#include <stdio.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef __GNUC__
int __io_putchar(int ch)
#else
int fputc(int ch, FILE *f)
#endif
{
HAL_UART_Transmit(&HAL_CONSOLE_UART, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
#ifdef __GNUC__
int _write(int file,char *ptr, int len)
{
int DataIdx;
for (DataIdx= 0; DataIdx< len; DataIdx++) {
__io_putchar(*ptr++);
}
return len;
}
#endif
int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Turn off buffers, so I/O occurs immediately */
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
```
## Support
For questions please email [support@wolfssl.com](mailto:support@wolfssl.com)

View File

@@ -0,0 +1,535 @@
[#ftl]
/**
******************************************************************************
* File Name : ${name}
* Description : This file provides code for the configuration
* of the ${name} instances.
******************************************************************************
[@common.optinclude name=mxTmpFolder+"/license.tmp"/][#--include License text --]
******************************************************************************
*/
[#assign s = name]
[#assign toto = s?replace(".","_")]
[#assign toto = toto?replace("/","")]
[#assign inclusion_protection = toto?upper_case]
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __${inclusion_protection}__
#define __${inclusion_protection}__
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
[#if includes??]
[#list includes as include]
#include "${include}"
[/#list]
[/#if]
[#-- SWIPdatas is a list of SWIPconfigModel --]
[#list SWIPdatas as SWIP]
[#-- Global variables --]
[#if SWIP.variables??]
[#list SWIP.variables as variable]
extern ${variable.value} ${variable.name};
[/#list]
[/#if]
[#-- Global variables --]
[#assign instName = SWIP.ipName]
[#assign fileName = SWIP.fileName]
[#assign version = SWIP.version]
/**
MiddleWare name : ${instName}
MiddleWare fileName : ${fileName}
MiddleWare version : ${version}
*/
[#if SWIP.defines??]
[#list SWIP.defines as definition]
/*---------- [#if definition.comments??]${definition.comments}[/#if] -----------*/
#define ${definition.name} #t#t ${definition.value}
[#if definition.description??]${definition.description} [/#if]
[/#list]
[/#if]
[/#list]
/* ------------------------------------------------------------------------- */
/* Hardware platform */
/* ------------------------------------------------------------------------- */
#define NO_STM32_HASH
#define NO_STM32_CRYPTO
#if defined(STM32WB55xx)
#define WOLFSSL_STM32WB
#define WOLFSSL_STM32_PKA
#undef NO_STM32_CRYPTO
#define HAL_CONSOLE_UART huart1
#elif defined(STM32F407xx)
#define WOLFSSL_STM32F4
#define HAL_CONSOLE_UART huart2
#elif defined(STM32F437xx)
#define WOLFSSL_STM32F4
#undef NO_STM32_HASH
#undef NO_STM32_CRYPTO
#define STM32_HAL_V2
#define HAL_CONSOLE_UART huart4
#elif defined(STM32F777xx)
#define WOLFSSL_STM32F7
#undef NO_STM32_HASH
#undef NO_STM32_CRYPTO
#define STM32_HAL_V2
#define HAL_CONSOLE_UART huart2
#elif defined(STM32H753xx)
#define WOLFSSL_STM32H7
#undef NO_STM32_HASH
#undef NO_STM32_CRYPTO
#define HAL_CONSOLE_UART huart3
#elif defined(STM32L4A6xx)
#define WOLFSSL_STM32L4
#undef NO_STM32_HASH
#undef NO_STM32_CRYPTO
#define HAL_CONSOLE_UART hlpuart1
#elif defined(STM32L475xx)
#define WOLFSSL_STM32L4
#define HAL_CONSOLE_UART huart1
#elif defined(STM32L562xx)
#define WOLFSSL_STM32L5
#define WOLFSSL_STM32_PKA
#undef NO_STM32_HASH
#undef NO_STM32_CRYPTO
#define HAL_CONSOLE_UART huart1
#elif defined(STM32L552xx)
#define WOLFSSL_STM32L5
#undef NO_STM32_HASH
#define HAL_CONSOLE_UART hlpuart1
#elif defined(STM32F207xx)
#define WOLFSSL_STM32F2
#define HAL_CONSOLE_UART huart3
#elif defined(STM32F107xC)
#define WOLFSSL_STM32F1
#define HAL_CONSOLE_UART huart4
#define NO_STM32_RNG
#elif defined(STM32F401xE)
#define WOLFSSL_STM32F4
#define HAL_CONSOLE_UART huart2
#define NO_STM32_RNG
#define WOLFSSL_GENSEED_FORTEST
#else
#warning Please define a hardware platform!
/* This means there is not a pre-defined platform for your board/CPU */
/* You need to define a CPU type, HW crypto and debug UART */
/* CPU Type: WOLFSSL_STM32F1, WOLFSSL_STM32F2, WOLFSSL_STM32F4,
WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4 and WOLFSSL_STM32L5 */
#define WOLFSSL_STM32F4
/* Debug UART */
#define HAL_CONSOLE_UART huart4
/* Hardware Crypto - uncomment as available on hardware */
//#define WOLFSSL_STM32_PKA
//#define NO_STM32_RNG
//#undef NO_STM32_HASH
//#undef NO_STM32_CRYPTO
//#define WOLFSSL_GENSEED_FORTEST
//#define STM32_HAL_V2
#endif
/* ------------------------------------------------------------------------- */
/* Platform */
/* ------------------------------------------------------------------------- */
#define SIZEOF_LONG_LONG 8
#define WOLFSSL_GENERAL_ALIGNMENT 4
#define WOLFSSL_STM32_CUBEMX
#define WOLFSSL_SMALL_STACK
#define WOLFSSL_USER_IO
#define WOLFSSL_NO_SOCK
#define WOLFSSL_IGNORE_FILE_WARN
/* ------------------------------------------------------------------------- */
/* Operating System */
/* ------------------------------------------------------------------------- */
#if defined(WOLF_CONF_RTOS) && WOLF_CONF_RTOS == 2
#define FREERTOS
#else
#define SINGLE_THREADED
#endif
/* ------------------------------------------------------------------------- */
/* Math Configuration */
/* ------------------------------------------------------------------------- */
/* 1=Fast, 2=Normal, 3=SP C, 4=SP Cortex-M */
#if defined(WOLF_CONF_MATH) && WOLF_CONF_MATH != 2
/* fast (stack) math */
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
/* Optimizations (TFM_ARM, TFM_ASM or none) */
//#define TFM_NO_ASM
//#define TFM_ASM
#endif
#if defined(WOLF_CONF_MATH) && (WOLF_CONF_MATH == 3 || WOLF_CONF_MATH == 4)
/* single precision only */
#define WOLFSSL_SP
#define WOLFSSL_SP_SMALL /* use smaller version of code */
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_MATH
#define SP_WORD_SIZE 32
//#define WOLFSSL_SP_NO_MALLOC
//#define WOLFSSL_SP_CACHE_RESISTANT
/* single precision Cortex-M only */
#if WOLF_CONF_MATH == 4
#define WOLFSSL_SP_ASM /* required if using the ASM versions */
#define WOLFSSL_SP_ARM_CORTEX_M_ASM
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Enable Features */
/* ------------------------------------------------------------------------- */
/* Required for TLS */
#define HAVE_TLS_EXTENSIONS
#define HAVE_SUPPORTED_CURVES
#define HAVE_ENCRYPT_THEN_MAC
#define HAVE_EXTENDED_MASTER
#if defined(WOLF_CONF_TLS13) && WOLF_CONF_TLS13 == 1
#define WOLFSSL_TLS13
#define HAVE_HKDF
#endif
#if defined(WOLF_CONF_DTLS) && WOLF_CONF_DTLS == 1
#define WOLFSSL_DTLS
#endif
#if defined(WOLF_CONF_PSK) && WOLF_CONF_PSK == 0
#define NO_PSK
#endif
#if defined(WOLF_CONF_PWDBASED) && WOLF_CONF_PWDBASED == 0
#define NO_PWDBASED
#endif
#if defined(WOLF_CONF_KEEP_PEER_CERT) && WOLF_CONF_KEEP_PEER_CERT == 1
#define KEEP_PEER_CERT
#endif
#if defined(WOLF_CONF_BASE64_ENCODE) && WOLF_CONF_BASE64_ENCODE == 1
#define WOLFSSL_BASE64_ENCODE
#endif
#if defined(WOLF_CONF_OPENSSL_EXTRA) && WOLF_CONF_OPENSSL_EXTRA == 1
#define OPENSSL_EXTRA
#endif
/* TLS Session Cache */
#if 0
#define SMALL_SESSION_CACHE
#else
#define NO_SESSION_CACHE
#endif
/* ------------------------------------------------------------------------- */
/* Crypto */
/* ------------------------------------------------------------------------- */
/* RSA */
#undef NO_RSA
#if defined(WOLF_CONF_RSA) && WOLF_CONF_RSA == 1
#ifdef USE_FAST_MATH
/* Maximum math bits (Max RSA key bits * 2) */
#undef FP_MAX_BITS
#define FP_MAX_BITS 4096
#endif
/* half as much memory but twice as slow */
#undef RSA_LOW_MEM
//#define RSA_LOW_MEM
/* Enables blinding mode, to prevent timing attacks */
#undef WC_RSA_BLINDING
#define WC_RSA_BLINDING
/* RSA PSS Support (required for TLS v1.3) */
#ifdef WOLFSSL_TLS13
#define WC_RSA_PSS
#endif
#else
#define NO_RSA
#endif
/* ECC */
#undef HAVE_ECC
#if defined(WOLF_CONF_ECC) && WOLF_CONF_ECC == 1
#define HAVE_ECC
/* Manually define enabled curves */
#define ECC_USER_CURVES
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
//#define HAVE_ECC384
//#define HAVE_ECC521
/* Fixed point cache (speeds repeated operations against same private key) */
#undef FP_ECC
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#undef FP_ENTRIES
#define FP_ENTRIES 2
#undef FP_LUT
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#undef ECC_SHAMIR
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#define ECC_TIMING_RESISTANT
/* Compressed ECC key support */
//#define HAVE_COMP_KEY
#ifdef USE_FAST_MATH
#ifdef NO_RSA
/* Custom fastmath size if not using RSA */
/* MAX = ROUND32(ECC BITS) * 2 */
#define FP_MAX_BITS (256 * 2)
#else
#define ALT_ECC_SIZE
#endif
/* Enable TFM optimizations for ECC */
//#define TFM_ECC192
//#define TFM_ECC224
//#define TFM_ECC256
//#define TFM_ECC384
//#define TFM_ECC521
#endif
#endif
/* DH */
#undef NO_DH
#if defined(WOLF_CONF_DH) && WOLF_CONF_DH == 1
#define HAVE_DH /* freeRTOS settings.h requires this */
#define HAVE_FFDHE_2048
#define HAVE_DH_DEFAULT_PARAMS
#else
#define NO_DH
#endif
/* AES */
#if defined(WOLF_CONF_AESGCM) && WOLF_CONF_AESGCM == 1
#define HAVE_AESGCM
/* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
/* GCM_TABLE is about 4K larger and 3x faster */
#define GCM_SMALL
#define HAVE_AES_DECRYPT
#endif
#if defined(WOLF_CONF_AESCBC) && WOLF_CONF_AESCBC == 1
#define HAVE_AES_CBC
#define HAVE_AES_DECRYPT
#endif
/* Other possible AES modes */
//#define WOLFSSL_AES_COUNTER
//#define HAVE_AESCCM
//#define WOLFSSL_AES_XTS
//#define WOLFSSL_AES_DIRECT
//#define HAVE_AES_ECB
//#define HAVE_AES_KEYWRAP
//#define AES_MAX_KEY_SIZE 256
/* ChaCha20 / Poly1305 */
#undef HAVE_CHACHA
#undef HAVE_POLY1305
#if defined(WOLF_CONF_CHAPOLY) && WOLF_CONF_CHAPOLY == 1
#define HAVE_CHACHA
#define HAVE_POLY1305
/* Needed for Poly1305 */
#undef HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH
#endif
/* Ed25519 / Curve25519 */
#undef HAVE_CURVE25519
#undef HAVE_ED25519
#if defined(WOLF_CONF_EDCURVE25519) && WOLF_CONF_EDCURVE25519 == 1
#define HAVE_CURVE25519
#define HAVE_ED25519
/* Optionally use small math (less flash usage, but much slower) */
#define CURVED25519_SMALL
#endif
/* ------------------------------------------------------------------------- */
/* Hashing */
/* ------------------------------------------------------------------------- */
/* Sha1 */
#undef NO_SHA
#if defined(WOLF_CONF_SHA1) && WOLF_CONF_SHA1 == 1
/* 1k smaller, but 25% slower */
//#define USE_SLOW_SHA
#else
#define NO_SHA
#endif
/* Sha2-256 */
#undef NO_SHA256
#if defined(WOLF_CONF_SHA2_256) && WOLF_CONF_SHA2_256 == 1
/* not unrolled - ~2k smaller and ~25% slower */
//#define USE_SLOW_SHA256
//#define WOLFSSL_SHAKE256
/* Sha2-224 */
#if defined(WOLF_CONF_SHA2_224) && WOLF_CONF_SHA2_224 == 1
#define WOLFSSL_SHA224
#endif
#else
#define NO_SHA256
#endif
/* Sha2-512 */
#undef WOLFSSL_SHA512
#if defined(WOLF_CONF_SHA2_512) && WOLF_CONF_SHA2_512 == 1
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA512
#define WOLFSSL_SHA512
#define HAVE_SHA512 /* freeRTOS settings.h requires this */
#endif
/* Sha2-384 */
#undef WOLFSSL_SHA384
#if defined(WOLF_CONF_SHA2_384) && WOLF_CONF_SHA2_384 == 1
#define WOLFSSL_SHA384
#endif
/* Sha3 */
#undef WOLFSSL_SHA3
#if defined(WOLF_CONF_SHA3) && WOLF_CONF_SHA3 == 1
#define WOLFSSL_SHA3
#endif
/* MD5 */
#if defined(WOLF_CONF_MD5) && WOLF_CONF_MD5 == 1
/* enabled */
#else
#define NO_MD5
#endif
/* ------------------------------------------------------------------------- */
/* Benchmark / Test */
/* ------------------------------------------------------------------------- */
/* Use reduced benchmark / test sizes */
#define BENCH_EMBEDDED
#define USE_CERT_BUFFERS_2048
#define USE_CERT_BUFFERS_256
/* ------------------------------------------------------------------------- */
/* Debugging */
/* ------------------------------------------------------------------------- */
#if defined(WOLF_CONF_DEBUG) && WOLF_CONF_DEBUG == 1
#define DEBUG_WOLFSSL
/* Use this to measure / print heap usage */
#if 0
#define USE_WOLFSSL_MEMORY
#define WOLFSSL_TRACK_MEMORY
#define WOLFSSL_DEBUG_MEMORY
#define WOLFSSL_DEBUG_MEMORY_PRINT
#endif
#else
//#define NO_WOLFSSL_MEMORY
//#define NO_ERROR_STRINGS
#endif
/* ------------------------------------------------------------------------- */
/* Port */
/* ------------------------------------------------------------------------- */
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
/* ------------------------------------------------------------------------- */
/* RNG */
/* ------------------------------------------------------------------------- */
#define NO_OLD_RNGNAME /* conflicts with STM RNG macro */
#define HAVE_HASHDRBG
/* ------------------------------------------------------------------------- */
/* Disable Features */
/* ------------------------------------------------------------------------- */
#if defined(WOLF_CONF_TLS12) && WOLF_CONF_TLS12 == 0
#define WOLFSSL_NO_TLS12
#endif
#if defined(WOLF_CONF_WOLFCRYPT_ONLY) && WOLF_CONF_WOLFCRYPT_ONLY == 1
#define WOLFCRYPT_ONLY
#endif
//#define NO_WOLFSSL_SERVER
//#define NO_WOLFSSL_CLIENT
#if defined(WOLF_CONF_TEST) && WOLF_CONF_TEST == 0
#define NO_CRYPT_TEST
#define NO_CRYPT_BENCHMARK
#endif
#define NO_FILESYSTEM
#define NO_WRITEV
#define NO_MAIN_DRIVER
#define NO_DEV_RANDOM
#define NO_OLD_TLS
#define WOLFSSL_NO_CLIENT_AUTH /* disable client auth for Ed25519/Ed448 */
#define NO_DSA
#define NO_RC4
#define NO_HC128
#define NO_RABBIT
#define NO_MD4
#define NO_DES3
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */
//#define NO_INLINE
/* Base16 / Base64 encoding */
//#define NO_CODING
/* bypass certificate date checking, due to lack of properly configured RTC source */
#ifndef HAL_RTC_MODULE_ENABLED
#define NO_ASN_TIME
#endif
#ifdef __cplusplus
}
#endif
#endif /*__ ${inclusion_protection}_H */
/**
* @}
*/
/*****END OF FILE****/

View File

@@ -5,6 +5,7 @@
EXTRA_DIST+= IDE/STM32Cube/README.md
EXTRA_DIST+= IDE/STM32Cube/main.c
EXTRA_DIST+= IDE/STM32Cube/wolfssl_example.c
EXTRA_DIST+= IDE/STM32Cube/wolfSSL.wolfSSL_conf.h
EXTRA_DIST+= IDE/STM32Cube/wolfSSL_conf.h
EXTRA_DIST+= IDE/STM32Cube/wolfssl_example.h
EXTRA_DIST+= IDE/STM32Cube/STM32_Benchmarks.md
EXTRA_DIST+= IDE/STM32Cube/default_conf.ftl

View File

@@ -25,6 +25,7 @@
/* Includes ------------------------------------------------------------------*/
#include "wolfssl_example.h"
#include "wolfssl/wolfcrypt/settings.h"
/* Private variables ---------------------------------------------------------*/
CRYP_HandleTypeDef hcryp;
@@ -66,7 +67,7 @@ int __io_putchar(int ch)
int fputc(int ch, FILE *f)
#endif
{
HAL_UART_Transmit(&huart4, (uint8_t *)&ch, 1, 0xFFFF);
HAL_UART_Transmit(&HAL_CONSOLE_UART, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}

View File

@@ -1,4 +1,4 @@
/* wolfSSL.wolfSSL_conf.h
/* wolfSSL_conf.h (example of generated wolfSSL.wolfSSL_conf.h)
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
@@ -19,7 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* STM32 Cube Configuration File
/* STM32 Cube Sample Configuration File
* Generated automatically using `default_conf.ftl` template
*
* Included automatically when USE_HAL_DRIVER is defined
* (and not WOLFSSL_USER_SETTINGS or HAVE_CONF_H).
*/
@@ -169,6 +171,11 @@ extern "C" {
#define WOLFSSL_STM32F1
#define HAL_CONSOLE_UART huart4
#define NO_STM32_RNG
#elif defined(STM32F401xE)
#define WOLFSSL_STM32F4
#define HAL_CONSOLE_UART huart2
#define NO_STM32_RNG
#define WOLFSSL_GENSEED_FORTEST
#else
#warning Please define a hardware platform!
#define WOLFSSL_STM32F4 /* default */

View File

@@ -64,7 +64,7 @@
#undef MEM_BUFFER_SZ
#define MEM_BUFFER_SZ 2048
#endif
#define SHOW_VERBOSE 0 /* Default output is tab delimited format */
#define SHOW_VERBOSE 0 /* 0=tab del (minimal), 1=info, 2=debug, 3=debug w/wolf logs */
#ifndef WOLFSSL_CIPHER_LIST_MAX_SIZE
#define WOLFSSL_CIPHER_LIST_MAX_SIZE 2048
#endif
@@ -77,7 +77,7 @@
#define BENCH_USE_NONBLOCK
#endif
#ifndef RECV_WAIT_TIMEOUT
#define RECV_WAIT_TIMEOUT 4000
#define RECV_WAIT_TIMEOUT 10000
#endif
/*****************************************************************************
@@ -510,6 +510,8 @@ static int ServerMemSend(info_t* info, char* buf, int sz)
sz = MEM_BUFFER_SZ - info->to_client.write_idx;
#endif
if (info->showVerbose >= 2)
printf("Server Send: %d\n", sz);
XMEMCPY(&info->to_client.buf[info->to_client.write_idx], buf, sz);
info->to_client.write_idx += sz;
info->to_client.write_bytes += sz;
@@ -543,11 +545,13 @@ static int ServerMemRecv(info_t* info, char* buf, int sz)
osSemaphoreRelease(info->server.mutex);
#ifdef CMSIS_OS2_H_
if (osThreadFlagsWait(1, osFlagsWaitAny, RECV_WAIT_TIMEOUT) == osFlagsErrorTimeout) {
printf("Server Recv: Timeout!\n");
return WOLFSSL_CBIO_ERR_TIMEOUT;
}
osSemaphoreAcquire(info->server.mutex, osWaitForever);
#else
if (osSignalWait(1, RECV_WAIT_TIMEOUT) == osEventTimeout) {
printf("Server Recv: Timeout!\n");
return WOLFSSL_CBIO_ERR_TIMEOUT;
}
osSemaphoreWait(info->server.mutex, osWaitForever);
@@ -567,9 +571,12 @@ static int ServerMemRecv(info_t* info, char* buf, int sz)
info->to_server.read_bytes = info->to_server.read_idx = 0;
info->to_server.write_bytes = info->to_server.write_idx = 0;
}
if (info->showVerbose >= 2)
printf("Server Recv: %d\n", sz);
osSemaphoreRelease(info->server.mutex);
#ifdef BENCH_USE_NONBLOCK
if (sz == 0)
return WOLFSSL_CBIO_ERR_WANT_READ;
@@ -599,6 +606,8 @@ static int ClientMemSend(info_t* info, char* buf, int sz)
sz = MEM_BUFFER_SZ - info->to_server.write_idx;
#endif
if (info->showVerbose >= 2)
printf("Client Send: %d\n", sz);
XMEMCPY(&info->to_server.buf[info->to_server.write_idx], buf, sz);
info->to_server.write_idx += sz;
info->to_server.write_bytes += sz;
@@ -632,11 +641,13 @@ static int ClientMemRecv(info_t* info, char* buf, int sz)
osSemaphoreRelease(info->client.mutex);
#ifdef CMSIS_OS2_H_
if (osThreadFlagsWait(1, osFlagsWaitAny, RECV_WAIT_TIMEOUT) == osFlagsErrorTimeout) {
printf("Client Recv: Timeout!\n");
return WOLFSSL_CBIO_ERR_TIMEOUT;
}
osSemaphoreAcquire(info->client.mutex, osWaitForever);
#else
if (osSignalWait(1, RECV_WAIT_TIMEOUT) == osEventTimeout) {
printf("Client Recv: Timeout!\n");
return WOLFSSL_CBIO_ERR_TIMEOUT;
}
osSemaphoreWait(info->client.mutex, osWaitForever);
@@ -656,6 +667,8 @@ static int ClientMemRecv(info_t* info, char* buf, int sz)
info->to_client.read_bytes = info->to_client.read_idx = 0;
info->to_client.write_bytes = info->to_client.write_idx = 0;
}
if (info->showVerbose >= 2)
printf("Client Recv: %d\n", sz);
osSemaphoreRelease(info->client.mutex);
@@ -1277,7 +1290,7 @@ int bench_tls(void* args)
int argShowPeerInfo = BENCH_SHOW_PEER_INFO;
#ifdef DEBUG_WOLFSSL
if (argShowVerbose) {
if (argShowVerbose >= 3) {
wolfSSL_Debugging_ON();
}
else {

View File

@@ -3,6 +3,8 @@
First, if you did not get the FIPS files with your archive, you must contact
wolfSSL to obtain them.
The IDE/WIN/wolfssl-fips.sln solution is for the original FIPS #2425 certificate.
See IDE/WIN10/wolfssl-fips.sln for the FIPS v2 #3389 or later Visual Studio solution.
# Building the wolfssl-fips project

View File

@@ -3,6 +3,7 @@
First, if you did not get the FIPS files with your archive, you must contact
wolfSSL to obtain them.
The IDE/WIN10/wolfssl-fips.sln solution is for the FIPS v2 #3389 certificate or later.
# Building the wolfssl-fips project
@@ -47,6 +48,7 @@ check value when changing your application.
The default build options should be the proper default set of options:
* HAVE_FIPS
* HAVE_FIPS_VERSION=2 (or 3 with WOLFSSL_FIPS_READY)
* HAVE_THREAD_LS
* HAVE_AESGCM
* HAVE_HASHDRBG
@@ -67,4 +69,4 @@ Additionally one may enable:
* OPENSSL_EXTRA
* WOLFSSL_KEY_GEN
These settings are defined in IDE/WIN/user_settings.h.
These settings are defined in IDE/WIN10/user_settings.h.

View File

@@ -1,6 +1,14 @@
#ifndef _WIN_USER_SETTINGS_H_
#define _WIN_USER_SETTINGS_H_
/* For FIPS Ready, uncomment the following: */
/* #define WOLFSSL_FIPS_READY */
#ifdef WOLFSSL_FIPS_READY
#undef HAVE_FIPS_VERSION
#define HAVE_FIPS_VERSION 3
#endif
/* Verify this is Windows */
#ifndef _WIN32
#error This user_settings.h header is only designed for Windows

0
IDE/XilinxSDK/2018_2/.cproject Executable file → Normal file
View File

0
IDE/XilinxSDK/2018_2/.project Executable file → Normal file
View File

0
IDE/XilinxSDK/2018_2/lscript.ld Executable file → Normal file
View File

View File

@@ -1,6 +1,6 @@
# Common Gotcha's
- If compiling all code togther (ie no sperate wolfssl library) than the -fPIC compiler flag should be used. Without using -fPIC in this build setup there could be unexpected failures.
- If compiling all code together (ie no separate wolfssl library) than the -fPIC compiler flag should be used. Without using -fPIC in this build setup there could be unexpected failures.
- If building with ARMv8 crypto extensions then the compiler flags "-mstrict-align -mcpu=generic+crypto" must be used.
- Check that enough stack and heap memory is set for the operations if a crash or stall happens.
@@ -20,14 +20,14 @@ To use this example project:
- File->New->Platform Project
- Setting "Project name" to standalone_bsp_0, then click "Next"
- Select the "Create from hardware specification" radius and click "Next"
- "Browse..." to the desired XSA file for the hardare
- "Browse..." to the desired XSA file for the hardware
- (optional) change Processor to R5 now
- click "Finish"
3. (optional) If building for TLS support than expand the standalone_bsp_0 project, double click on platform_spr, Expand the cpu (i.e psu_cortexa53_0), click on Board Support Package, select the "Modify BSP Settings..." box and click on lwip211. Note that the api_mode should be changed from RAW API to SOCKET API.
4. Right click on the standalone_bsp_0 project and click on "Build Project"
5. Import the wolfcrypt example project "File->Import->Eclipse workspace or zip file"
6. Uncheck "Copy projects into workspace"
7. Select the root directory of wolfssl/IDE/XilinxSDK/2019_2, and select wolfCrypt_example and wolfCrypt_example_system. Then click "Finish"
7. Select the root directory of `wolfssl/IDE/XilinxSDK/2019_2`, and select `wolfCrypt_example` and `wolfCrypt_example_system`. Then click "Finish"
# Steps For Creating Project From Scratch
@@ -37,7 +37,7 @@ To use this example project:
- File->New->Platform Project
- Setting "Project name" to standalone_bsp_0, then click "Next"
- Select the "Create from hardware specification" radius and click "Next"
- "Browse..." to the desired XSA file for the hardare
- "Browse..." to the desired XSA file for the hardware
- (optional) change Processor to R5 now
- click "Finish"
3. (optional) If building for TLS support than expand the standalone_bsp_0 project, double click on platform_spr, Expand the cpu (i.e psu_cortexa53_0), click on Board Support Package, select the "Modify BSP Settings..." box and click on lwip211. Note that the api_mode should be changed from RAW API to SOCKET API.
@@ -49,10 +49,10 @@ To use this example project:
9. Expand the wolfCrypt_example project and right click on the folder "src".
10. Select "Import Sources" and set the "From directory" to be the wolfssl root directory.
11. Select the folders to import as ./src, ./IDE/XilinxSDK, ./wolfcrypt/benchmark, ./wolfcrypt/test, ./wolfcrypt/src
12. (optional) Expand the Advanced tabe and select "Create links in workspace"
12. (optional) Expand the Advanced table and select "Create links in workspace"
13. Click on "Finish"
14. Expand the wolfcrypt/src directory and exlude all .S files from the build
15. Right click on the wolfCrypt_example project and got to Properties. Set the macro WOLFSSL_USER_SETTINGS in C/C++ Build->Settings->ARM v8 gcc compiler->Symbols
14. Expand the wolfcrypt/src directory and exclude all .S files from the build
15. Right click on the wolfCrypt_example project and got to Properties. Set the macro `WOLFSSL_USER_SETTINGS` in C/C++ Build->Settings->ARM v8 gcc compiler->Symbols
16. Set the include path for finding user_settings.h by going to the Properties and setting it in C/C++ Build->Settings->ARM v8 gcc compiler->Directories. This is to the directory wolfssl/IDE/XilinxSDK
17. Set the include path for finding wolfSSL headers. To the root directory wolfssl
18. Add compiler flags "-fPIC -mstrict-align -mcpu=generic+crypto" to the project properties. C/C++ Build->Settings->ARM v8 gcc compiler->Miscellaneous

0
IDE/XilinxSDK/user_settings.h Executable file → Normal file
View File

View File

@@ -20,6 +20,7 @@ include IDE/CSBENCH/include.am
include IDE/ECLIPSE/DEOS/include.am
include IDE/ECLIPSE/MICRIUM/include.am
include IDE/ECLIPSE/SIFIVE/include.am
include IDE/ECLIPSE/RTTHREAD/include.am
include IDE/mynewt/include.am
include IDE/Renesas/e2studio/DK-S7G2/include.am
include IDE/Renesas/cs+/Projects/include.am
@@ -36,3 +37,4 @@ include IDE/XilinxSDK/include.am
EXTRA_DIST+= IDE/IAR-EWARM IDE/MDK-ARM IDE/MDK5-ARM IDE/MYSQL IDE/LPCXPRESSO IDE/HEXIWEAR IDE/Espressif IDE/zephyr
EXTRA_DIST+= IDE/OPENSTM32/README.md
EXTRA_DIST+= IDE/Espressif/ESP-IDF/setup_win.bat

100
INSTALL
View File

@@ -17,44 +17,48 @@
Use on the xcode project in IDE/iOS/wolfssl.xcodeproj
There is a README in IDE/iOS with more information
3. Building on Windows
3. Building for Apple ARM64
When building for an Apple ARM64 platform, ensure the host CPU type is detected as "aarch64" during configure, if not, pass --host=aarch64-apple-darwin to configure.
4. Building on Windows
Use the 32bit Visual Studio Solution wolfssl.sln
For a 64bit solution please use wolfssl64.sln
4. Building with IAR
5. Building with IAR
Please see the README in IDE/IAR-EWARM for detailed instructions
5. Building with Keil
6. Building with Keil
Please see the Keil Projects in IDE/MDK5-ARM/Projects
6. Building with Microchip tools
7. Building with Microchip tools
Please see the README in mplabx
7. Building with Freescale MQX
8. Building with Freescale MQX
Please see the README in mqx
8. Building with Rowley CrossWorks for ARM
9. Building with Rowley CrossWorks for ARM
Use the CrossWorks project in IDE/ROWLEY-CROSSWORKS-ARM/wolfssl.hzp
There is a README.md in IDE/ROWLEY-CROSSWORKS-ARM with more information
9. Building with Arduino
10. Building with Arduino
Use the script IDE/ARDUINO/wolfssl-arduino.sh to reformat the wolfSSL
library for compatibility with the Arduino IDE. There is a README.md in
IDE/ARDUINO for detailed instructions.
10. Building for Android with Visual Studio 2017
11. Building for Android with Visual Studio 2017
Please see the README in IDE/VS-ARM.
Use the Visual Studio solution IDE/VS-ARM/wolfssl.sln.
11. Building for Yocto Project or OpenEmbedded
12. Building for Yocto Project or OpenEmbedded
Please see the README in the "meta-wolfssl" repository. This repository
holds wolfSSL's Yocto and OpenEmbedded layer, which contains recipes
@@ -68,35 +72,67 @@
https://github.com/openembedded/meta-openembedded
12. Porting to a new platform
13. Porting to a new platform
Please see section 2.4 in the manual:
http://www.wolfssl.com/yaSSL/Docs-cyassl-manual-2-building-cyassl.html
13. Building with CMake
Note: Primary development uses automake (./configure). The support for CMake is minimal.
14. Building with CMake
Note: Primary development uses automake (./configure). The support for CMake
is still under development.
Internally cmake is setup to do the following:
1. Uses the ./configure generated wolfssl/options.h as the build options by coping it to the build directory as user_settings.h.
2. Builds wolfSSL as library.
3. Builds the examples.
For configuring wolfssl using CMake, we recommend downloading the CMake
GUI (https://cmake.org/download/). This tool allows you to see all of
wolfssl's configuration variables, set them, and view their descriptions.
Looking at the GUI or CMakeCache.txt (generated after running cmake once) is
the best way to find out what configuration options are available and what
they do. You can also invoke CMake from the GUI, which is described in the
Windows instructions below. For Unix-based systems, we describe the command
line work flow. Regardless of your chosen workflow, cmake will generate
a header options.h in the wolfssl directory that contains the options used
to configure the build.
Build Steps:
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ cmake --install .
Unix-based Platforms
---
1) Navigate to the wolfssl root directory containing "CMakeLists.txt".
2) Create a directory called "build" and change into it. This is where
CMake will store build files.
3) Run `cmake ..` to generate the target build files (e.g. UNIX Makefiles).
To enable or disable features, set them using -D<option>=[yes/no]. For
example, to disable TLS 1.3 support, run cmake .. -DWOLFSSL_TLS13=no
(autoconf equivalent: ./configure --disable-tls13) To enable DSA, run
cmake .. -DWOLFSSL_DSA=yes (autoconf equivalent: ./configure
--enable-dsa). Again, you can find a list of these options and their
descriptions either using the CMake GUI or by looking at CMakeCache.txt.
5) The build directory should now contain the generated build files. Build
with `cmake --build .`. Under the hood, this runs the target build tool
(by default, make). You can also invoke the target build tool directly
(e.g. make).
To build library only and not build examples and test apps use:
$ cmake .. -DBUILD_TESTS=NO
To build with debugging use: `cmake .. -DCMAKE_BUILD_TYPE=Debug`.
To build with debugging use:
$ cmake .. -DCMAKE_BUILD_TYPE=Debug
Windows (Visual Studio)
---
1) Go to this page, download the appropriate Windows installer, and install
to get the CMake GUI: https://cmake.org/download/ Native CMake support in
Visual Studio 16 2019 (and possibly older versions) has proven buggy. We
recommend using the CMake GUI in concert with Visual Studio, as described
in these steps.
2) Open CMake.
3) Where is the soure code: <root directory of wolfssl containing
CMakeLists.txt>
4) Where to build the binaries: <build directory, e.g. wolfssl/build>
5) Hit Configure. CMake runs the code in CMakeLists.txt and builds up an
internal representation of the project.
6) Hit Generate. CMake generates the build files. For Windows, this will
be Visual Studio project (.vcxproj) and solution (.sln) files.
7) Open Visual Studio and select "Open a project or solution".
8) Navigate to the build directory and select wolfssl.sln to load the
project.
Make sure and run the built examples and test from the wolfssl-root to properly find the ./certs directory.
CMake on Windows with Visual Studio
1. Open Command Prompt
2. Run the Visual Studio batch to setup command line variables: Example: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
3. Then use steps above
Windows (command line)
---
1) Open Command Prompt
2) Run the Visual Studio batch to setup command line variables, e.g. C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
3) Follow steps in "Unix-based Platforms" above.

View File

@@ -19,6 +19,9 @@ dist_doc_DATA=
dist_noinst_SCRIPTS =
noinst_SCRIPTS =
check_SCRIPTS =
noinst_DATA =
SUBDIRS_OPT =
DIST_SUBDIRS_OPT =
#includes additional rules from aminclude.am
@INC_AMINCLUDE@
@@ -149,6 +152,7 @@ EXTRA_DIST+= LPCExpresso.project
EXTRA_DIST+= resource.h wolfssl.rc
EXTRA_DIST+= CMakeLists.txt
include cmake/include.am
include wrapper/include.am
include cyassl/include.am
include wolfssl/include.am
@@ -167,6 +171,7 @@ include testsuite/include.am
include tests/include.am
include sslSniffer/sslSnifferTest/include.am
include rpm/include.am
include linuxkm/include.am
# Exclude references to non-DFSG sources from build files
if !BUILD_DISTRO
@@ -189,6 +194,31 @@ include IDE/include.am
endif
include scripts/include.am
if BUILD_LINUXKM
# rather than setting $SUBDIRS here directly, we set an auxiliary variable.
# autotools see the SUBDIRS assignment here even if BUILD_LINUXKM is false,
# at least for purposes of recursing for "make distdir", which we don't want to happen.
SUBDIRS_OPT += linuxkm
DIST_SUBDIRS_OPT += linuxkm
export KERNEL_ROOT KERNEL_ARCH KERNEL_EXTRA_CFLAGS AM_CFLAGS CFLAGS AM_CCASFLAGS CCASFLAGS \
src_libwolfssl_la_OBJECTS ENABLED_CRYPT_TESTS ENABLED_ASM CFLAGS_FPU_DISABLE \
CFLAGS_FPU_ENABLE CFLAGS_SIMD_DISABLE CFLAGS_SIMD_ENABLE \
CFLAGS_AUTO_VECTORIZE_DISABLE CFLAGS_AUTO_VECTORIZE_ENABLE \
ASFLAGS_FPU_DISABLE_SIMD_ENABLE ASFLAGS_FPU_ENABLE_SIMD_DISABLE \
ASFLAGS_FPUSIMD_DISABLE ASFLAGS_FPUSIMD_ENABLE
module:
+make -C linuxkm libwolfssl.ko
clean_module:
+make -C linuxkm clean
install_module modules_install:
+make -C linuxkm modules_install
endif
if USE_VALGRIND
TESTS_ENVIRONMENT=./valgrind-error.sh
endif
@@ -201,10 +231,14 @@ TESTS += $(check_SCRIPTS)
test: check
tests/unit.log: testsuite/testsuite.log
scripts/unit.log: testsuite/testsuite.log
DISTCLEANFILES+= cyassl-config
DISTCLEANFILES+= wolfssl-config
SUBDIRS=$(SUBDIRS_OPT)
DIST_SUBDIRS=$(DIST_SUBDIRS_OPT)
maintainer-clean-local:
-rm Makefile.in
-rm aclocal.m4

259
README
View File

@@ -73,138 +73,155 @@ should be used for the enum name.
*** end Notes ***
# wolfSSL Release 4.5.0 (August 19, 2020)
# wolfSSL Release 4.6.0 (December 22, 2020)
Release 4.6.0 of wolfSSL embedded TLS has bug fixes and new features including:
If you have questions about this release, feel free to contact us on our
info@ address.
### 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
Release 4.5.0 of wolfSSL embedded TLS has bug fixes and new features including:
###### 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 Feature Additions
###### New Algorithms
* RC2 ECB/CBC added for use with PKCS#12 bundles
* XChaCha and the XChaCha20-Poly1305 AEAD algorithm support added
* 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
###### 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
### 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
* 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.
###### 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
## Improvements/Optimizations
###### 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
* 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`.
###### 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
## This release of wolfSSL includes fixes for 6 security vulnerabilities.
###### 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
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.
###### 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
* 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 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.
### 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
For additional vulnerability information visit the vulnerability page at
https://www.wolfssl.com/docs/security-vulnerabilities/

260
README.md
View File

@@ -73,138 +73,156 @@ should be used for the enum name.
*** end Notes ***
# wolfSSL Release 4.5.0 (August 19, 2020)
# wolfSSL Release 4.6.0 (December 22, 2020)
Release 4.6.0 of wolfSSL embedded TLS has bug fixes and new features including:
If you have questions about this release, feel free to contact us on our
info@ address.
### 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
Release 4.5.0 of wolfSSL embedded TLS has bug fixes and new features including:
###### 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 Feature Additions
###### New Algorithms
* RC2 ECB/CBC added for use with PKCS#12 bundles
* XChaCha and the XChaCha20-Poly1305 AEAD algorithm support added
* 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
###### 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
### 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
* 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.
###### 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
## Improvements/Optimizations
###### 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
* 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`.
###### 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
## This release of wolfSSL includes fixes for 6 security vulnerabilities.
###### 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
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.
###### 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
* 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 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/

143
certs/check_dates.sh Executable file
View File

@@ -0,0 +1,143 @@
#!/bin/sh
# Whether a certificate or CRLs needs updating
expired=0
# Default to checking expiry within 6 months
offset="+6 months"
# First command line argument is the new expiry time
if [ "$1" != "" ]
then
offset=$1
fi
# Certificates that are expired and are intentionally or irrelevantly so.
exp_expired="\
/test/crit-cert.pem \
/test/expired/expired-cert.pem \
/test/expired/expired-ca.pem \
/test/expired/expired-cert.der \
/test/expired/expired-ca.der \
/certeccrsa.pem \
/certeccrsa.der
"
# Files that are not certificates or CRLs put get matched anyway
ignore="\
/test/cert-ext-ns.der \
/rsa3072.der \
/rsa2048.der \
/1024/rsa1024.der \
"
# Get the date offset from now - earliest expiry - in seconds
earliest=`date -d "$offset" +%s`
# Compare the date with earliest allowed expiry.
#
# $1 Name of file being checked.
# $2 Expiry date in file (notAfter or nextUpdate).
check_expiry() {
# Convert date to a number of seconds
expiry=`date -d "$2" +%s`
# Check expiry is not too soon
if [ $expiry -lt $earliest ]
then
# Reset result
result=expired
# Ignore files that are expected to be expired
for exp in $exp_expired
do
case $1 in
*$exp)
result=ignore
break
;;
esac
done
# Report any unexpected expiries
if [ "$result" = "expired" ]
then
echo "$1 expires at:"
echo " '$2' (< $offset)"
expired=1
fi
fi
}
# Check file expiry.
#
# The file is of any format.
# Try to guess from name what it is.
#
# $1 Name of file to check
# $inform Command line argument to use with openssl for input file format
check_file() {
# Check file is not in list of files to ignore
for i in $ignore
do
case $1 in
*$i)
return
;;
esac
done
# Use pattern matching to guess format
case $1 in
*key*) ;;
*dh*) ;;
*params*) ;;
*priv*) ;;
*pub*) ;;
*dsa*) ;;
*crl*)
# Get the nextUpdate field from the CRL
next_update=`openssl crl -in $file $inform -noout -nextupdate 2>&1`
if [ "$?" != "0" ]
then
# Didn't work so report failure
echo "$file not a crl"
else
# Get the date after the equal sign and check file
next_update="${next_update#*=}"
check_expiry $file "$next_update"
fi
;;
*)
# Get the notAfter field from the certificate
not_after=`openssl x509 -in $file $inform -noout -enddate 2>&1`
if [ "$?" != "0" ]
then
# Didn't work, maybe wasn't a certificate, so report failure
echo "$file not a certificate"
else
# Get the date after the equal sign and check file
not_after="${not_after#*=}"
check_expiry $file "$not_after"
fi
;;
esac
}
# Check all PEM files
inform="-inform PEM"
pem_files=`find . -name '*.pem'`
for file in $pem_files
do
check_file $file
done
# Check all DER files
inform="-inform DER"
der_files=`find . -name '*.der'`
for file in $der_files
do
check_file $file
done
# Return result of check
# 0 on success
# 1 on failure
return $expired

BIN
certs/csr.attr.der Normal file

Binary file not shown.

15
certs/csr.dsa.pem Normal file
View File

@@ -0,0 +1,15 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICSjCCAgcCAQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCAbcwggEsBgcqhkjO
OAQBMIIBHwKBgQDN3iVogFMN5XfW0pA5P5CiPzOUbuhPK2OrMKsVuhHqil2NzLjU
odXBR51ac2piSdEGB2f2L6M5vU4NtNMiI4TskyZaSe58iUhmTejo2FD7pXGfIhjl
5gtGh2buUo9GT7UDzu3jvuW1gdJZ6cCtTdBNJve6UOjJj/4kGT0up1I8bQIVAPtH
++yBIMgc6Uq6BG8Zm5TugmfTAoGBAJuVu4XFWEoynKpEhdZo3D4U9M5to0k46tZh
SJJaQJVJOKrhOSloWEeKSwHhLo5sY29AylA/jAuZ5HJCuLHCJkjxnIPGNy5arhEJ
2fOtH2+trVDjeDLm3o6qv9EAn7MCEhmiFewUGFwOJs75rsx7tdEm/IX+FJO2nX12
4zWXHt7EA4GEAAKBgHFJ1dk2HPSn5Nh8tybEFs1iP/NE9Pa+2Qmea/Z/uRToZ2Uv
dM1qRagMyJfEco8fLcL1mkFH+U+HYt5Y7/rK5bD1zCYklqvMgckgHv4tRO9FKhpo
3EDe9oMz3325wzakq69O5ZfvCD4PDA3crrZaGc0ahXF7nYnNErdyhYrNkPgJoAAw
CwYJYIZIAWUDBAMCAzAAMC0CFQCLSYH6QBDBF2c0ii0bvXXzM5qJIwIUUlCx5kp7
/DnfWP/hdw9xNrbD4jc=
-----END CERTIFICATE REQUEST-----

BIN
certs/csr.ext.der Normal file

Binary file not shown.

BIN
certs/csr.signed.der Normal file

Binary file not shown.

BIN
certs/ecc/bp256r1-key.der Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHgCAQEEIALRjSn7gQicLnRopI92xvo14rrdLVl0IEzDB40t3Pa7oAsGCSskAwMC
CAEBB6FEA0IABC7vJ8tXOtxiJba1QlzuKVbjqM6GbkRSIxXIQ8BiEBYeSsuI0HXg
OGuAhGSfcKrYuzOQwduBRq7pgckDabXOres=
-----END EC PRIVATE KEY-----

Binary file not shown.

View File

@@ -0,0 +1,57 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
23:c2:32:32:87:c0:20:35:77:e6:56:4b:ba:d3:ba:19:de:0e:ed:9e
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256BPR1-CLI, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Oct 15 20:13:58 2020 GMT
Not After : Oct 13 20:13:58 2030 GMT
Subject: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256BPR1-CLI, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:2e:ef:27:cb:57:3a:dc:62:25:b6:b5:42:5c:ee:
29:56:e3:a8:ce:86:6e:44:52:23:15:c8:43:c0:62:
10:16:1e:4a:cb:88:d0:75:e0:38:6b:80:84:64:9f:
70:aa:d8:bb:33:90:c1:db:81:46:ae:e9:81:c9:03:
69:b5:ce:ad:eb
ASN1 OID: brainpoolP256r1
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Cert Type:
SSL Client, S/MIME
X509v3 Subject Key Identifier:
B4:1B:3B:4F:65:F2:BF:9E:8A:8F:E3:33:96:44:1F:67:EA:B3:34:D5
X509v3 Authority Key Identifier:
keyid:B4:1B:3B:4F:65:F2:BF:9E:8A:8F:E3:33:96:44:1F:67:EA:B3:34:D5
X509v3 Key Usage: critical
Digital Signature, Non Repudiation, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Client Authentication, E-mail Protection
Signature Algorithm: ecdsa-with-SHA256
30:44:02:20:28:b6:b4:eb:ae:c1:9b:71:0a:15:92:93:d6:2d:
12:a6:ff:2d:2a:f5:23:a8:e2:df:6c:d9:33:d4:7f:e9:2e:08:
02:20:33:eb:45:aa:c1:7c:36:c1:60:52:09:0e:2d:e4:2a:49:
1d:d8:b2:c5:79:3e:be:d4:61:c5:14:d0:b6:f2:42:d4
-----BEGIN CERTIFICATE-----
MIICyTCCAnCgAwIBAgIUI8IyMofAIDV35lZLutO6Gd4O7Z4wCgYIKoZIzj0EAwIw
gZoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdT
ZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMRcwFQYDVQQLDA5FQ0MyNTZCUFIxLUNM
STEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZv
QHdvbGZzc2wuY29tMB4XDTIwMTAxNTIwMTM1OFoXDTMwMTAxMzIwMTM1OFowgZox
CzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0
dGxlMRAwDgYDVQQKDAdFbGlwdGljMRcwFQYDVQQLDA5FQ0MyNTZCUFIxLUNMSTEY
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdv
bGZzc2wuY29tMFowFAYHKoZIzj0CAQYJKyQDAwIIAQEHA0IABC7vJ8tXOtxiJba1
QlzuKVbjqM6GbkRSIxXIQ8BiEBYeSsuI0HXgOGuAhGSfcKrYuzOQwduBRq7pgckD
abXOreujgZAwgY0wCQYDVR0TBAIwADARBglghkgBhvhCAQEEBAMCBaAwHQYDVR0O
BBYEFLQbO09l8r+eio/jM5ZEH2fqszTVMB8GA1UdIwQYMBaAFLQbO09l8r+eio/j
M5ZEH2fqszTVMA4GA1UdDwEB/wQEAwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYI
KwYBBQUHAwQwCgYIKoZIzj0EAwIDRwAwRAIgKLa0667Bm3EKFZKT1i0Spv8tKvUj
qOLfbNkz1H/pLggCIDPrRarBfDbBYFIJDi3kKkkd2LLFeT6+1GHFFNC28kLU
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,57 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
3d:12:fd:a2:a8:15:63:d8:4e:3f:48:81:46:92:ae:65:f3:27:7f:f2
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256K1-CLI, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Oct 15 20:13:49 2020 GMT
Not After : Oct 13 20:13:49 2030 GMT
Subject: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256K1-CLI, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:d7:0d:0b:f1:0e:22:88:fe:fb:d5:e5:e1:09:a4:
3e:90:76:b3:29:cb:d9:13:60:b7:ea:88:82:d7:8c:
b6:db:21:dc:93:0f:e9:58:bb:c5:f2:a2:c2:f5:23:
36:c5:d5:eb:24:a6:24:db:ee:02:b0:05:31:a6:33:
1f:cd:79:82:10
ASN1 OID: secp256k1
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Cert Type:
SSL Client, S/MIME
X509v3 Subject Key Identifier:
44:6A:D8:71:6D:AB:62:18:21:02:27:23:90:BF:1D:77:B6:79:4B:77
X509v3 Authority Key Identifier:
keyid:44:6A:D8:71:6D:AB:62:18:21:02:27:23:90:BF:1D:77:B6:79:4B:77
X509v3 Key Usage: critical
Digital Signature, Non Repudiation, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Client Authentication, E-mail Protection
Signature Algorithm: ecdsa-with-SHA256
30:45:02:20:73:08:4a:18:d1:ad:81:f6:5c:59:27:da:36:9a:
cd:fb:4e:97:5a:58:b3:61:fe:b0:ec:7e:76:ca:0c:5a:d3:c1:
02:21:00:a5:05:b4:f5:2f:d3:bf:71:d4:0c:fb:bf:a0:64:0b:
cd:bb:18:ef:df:92:bc:5c:cc:6c:74:82:c8:52:5a:f6:46
-----BEGIN CERTIFICATE-----
MIICwjCCAmigAwIBAgIUPRL9oqgVY9hOP0iBRpKuZfMnf/IwCgYIKoZIzj0EAwIw
gZgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdT
ZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMRUwEwYDVQQLDAxFQ0MyNTZLMS1DTEkx
GDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3
b2xmc3NsLmNvbTAeFw0yMDEwMTUyMDEzNDlaFw0zMDEwMTMyMDEzNDlaMIGYMQsw
CQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRs
ZTEQMA4GA1UECgwHRWxpcHRpYzEVMBMGA1UECwwMRUNDMjU2SzEtQ0xJMRgwFgYD
VQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNz
bC5jb20wVjAQBgcqhkjOPQIBBgUrgQQACgNCAATXDQvxDiKI/vvV5eEJpD6QdrMp
y9kTYLfqiILXjLbbIdyTD+lYu8XyosL1IzbF1eskpiTb7gKwBTGmMx/NeYIQo4GQ
MIGNMAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgWgMB0GA1UdDgQWBBREathx
batiGCECJyOQvx13tnlLdzAfBgNVHSMEGDAWgBREathxbatiGCECJyOQvx13tnlL
dzAOBgNVHQ8BAf8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwME
MAoGCCqGSM49BAMCA0gAMEUCIHMIShjRrYH2XFkn2jaazftOl1pYs2H+sOx+dsoM
WtPBAiEApQW09S/Tv3HUDPu/oGQLzbsY79+SvFzMbHSCyFJa9kY=
-----END CERTIFICATE-----

View File

@@ -88,6 +88,39 @@ rm ./certs/client-ecc384-req.pem
rm ./certs/client-ecc384-key.par
# Generate ECC Kerberos Keys
if [ -f ./certs/ecc/secp256k1-key.pem ]; then
openssl ecparam -name secp256k1 -genkey -noout -out ./certs/ecc/secp256k1-key.pem
openssl ec -in ./certs/ecc/secp256k1-key.pem -inform PEM -out ./certs/ecc/secp256k1-key.der -outform DER
fi
# Create self-signed ECC Kerberos certificates
openssl req -config ./certs/ecc/wolfssl.cnf -sha256 -new -key ./certs/ecc/secp256k1-key.pem -out ./certs/ecc/server-secp256k1-req.pem -subj "/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC256K1-SRV/CN=www.wolfssl.com/emailAddress=info@wolfssl.com/"
openssl x509 -req -in ./certs/ecc/server-secp256k1-req.pem -days 3650 -extfile ./certs/ecc/wolfssl.cnf -extensions server_cert -signkey ./certs/ecc/secp256k1-key.pem -text -out ./certs/ecc/server-secp256k1-cert.pem
openssl x509 -inform pem -in ./certs/ecc/server-secp256k1-cert.pem -outform der -out ./certs/ecc/server-secp256k1-cert.der
rm ./certs/ecc/server-secp256k1-req.pem
openssl req -config ./certs/ecc/wolfssl.cnf -sha256 -new -key ./certs/ecc/secp256k1-key.pem -out ./certs/ecc/client-secp256k1-req.pem -subj "/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC256K1-CLI/CN=www.wolfssl.com/emailAddress=info@wolfssl.com/"
openssl x509 -req -in ./certs/ecc/client-secp256k1-req.pem -days 3650 -extfile ./certs/ecc/wolfssl.cnf -extensions usr_cert -signkey ./certs/ecc/secp256k1-key.pem -text -out ./certs/ecc/client-secp256k1-cert.pem
openssl x509 -inform pem -in ./certs/ecc/client-secp256k1-cert.pem -outform der -out ./certs/ecc/client-secp256k1-cert.der
rm ./certs/ecc/client-secp256k1-req.pem
# Generate ECC Brainpool Keys
if [ -f ./certs/ecc/bp256r1-key.pem ]; then
openssl ecparam -name brainpoolP256r1 -genkey -noout -out ./certs/ecc/bp256r1-key.pem
openssl ec -in ./certs/ecc/bp256r1-key.pem -inform PEM -out ./certs/ecc/bp256r1-key.der -outform DER
fi
# Create self-signed ECC Brainpool certificates
openssl req -config ./certs/ecc/wolfssl.cnf -sha256 -new -key ./certs/ecc/bp256r1-key.pem -out ./certs/ecc/server-bp256r1-req.pem -subj "/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC256BPR1-SRV/CN=www.wolfssl.com/emailAddress=info@wolfssl.com/"
openssl x509 -req -in ./certs/ecc/server-bp256r1-req.pem -days 3650 -extfile ./certs/ecc/wolfssl.cnf -extensions server_cert -signkey ./certs/ecc/bp256r1-key.pem -text -out ./certs/ecc/server-bp256r1-cert.pem
openssl x509 -inform pem -in ./certs/ecc/server-bp256r1-cert.pem -outform der -out ./certs/ecc/server-bp256r1-cert.der
rm ./certs/ecc/server-bp256r1-req.pem
openssl req -config ./certs/ecc/wolfssl.cnf -sha256 -new -key ./certs/ecc/bp256r1-key.pem -out ./certs/ecc/client-bp256r1-req.pem -subj "/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC256BPR1-CLI/CN=www.wolfssl.com/emailAddress=info@wolfssl.com/"
openssl x509 -req -in ./certs/ecc/client-bp256r1-req.pem -days 3650 -extfile ./certs/ecc/wolfssl.cnf -extensions usr_cert -signkey ./certs/ecc/bp256r1-key.pem -text -out ./certs/ecc/client-bp256r1-cert.pem
openssl x509 -inform pem -in ./certs/ecc/client-bp256r1-cert.pem -outform der -out ./certs/ecc/client-bp256r1-cert.der
rm ./certs/ecc/client-bp256r1-req.pem
# Also manually need to:
# 1. Copy ./certs/server-ecc.der into ./certs/test/server-cert-ecc-badsig.der `cp ./certs/server-ecc.der ./certs/test/server-cert-ecc-badsig.der`
# 2. Modify last byte so its invalidates signature in ./certs/test/server-cert-ecc-badsig.der

View File

@@ -6,3 +6,21 @@ EXTRA_DIST += \
certs/ecc/genecc.sh \
certs/ecc/wolfssl.cnf \
certs/ecc/wolfssl_384.cnf
# Koblitz Curves
EXTRA_DIST += \
certs/ecc/secp256k1-key.der \
certs/ecc/secp256k1-key.pem \
certs/ecc/client-secp256k1-cert.der \
certs/ecc/client-secp256k1-cert.pem \
certs/ecc/server-secp256k1-cert.der \
certs/ecc/server-secp256k1-cert.pem
# Brainpool Curves
EXTRA_DIST += \
certs/ecc/bp256r1-key.der \
certs/ecc/bp256r1-key.pem \
certs/ecc/client-bp256r1-cert.der \
certs/ecc/client-bp256r1-cert.pem \
certs/ecc/server-bp256r1-cert.der \
certs/ecc/server-bp256r1-cert.pem

BIN
certs/ecc/secp256k1-key.der Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEILlFjaVww/Q8MLWZOcmS3ZCx3VCJWWoNXxRYRA3e4IApoAcGBSuBBAAK
oUQDQgAE1w0L8Q4iiP771eXhCaQ+kHazKcvZE2C36oiC14y22yHckw/pWLvF8qLC
9SM2xdXrJKYk2+4CsAUxpjMfzXmCEA==
-----END EC PRIVATE KEY-----

Binary file not shown.

View File

@@ -0,0 +1,63 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
2f:f8:fa:8b:cf:ec:8f:2c:bc:40:fb:95:a0:3e:04:db:dd:c5:7f:08
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256BPR1-SRV, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Oct 15 20:13:55 2020 GMT
Not After : Oct 13 20:13:55 2030 GMT
Subject: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256BPR1-SRV, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:2e:ef:27:cb:57:3a:dc:62:25:b6:b5:42:5c:ee:
29:56:e3:a8:ce:86:6e:44:52:23:15:c8:43:c0:62:
10:16:1e:4a:cb:88:d0:75:e0:38:6b:80:84:64:9f:
70:aa:d8:bb:33:90:c1:db:81:46:ae:e9:81:c9:03:
69:b5:ce:ad:eb
ASN1 OID: brainpoolP256r1
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Cert Type:
SSL Server
X509v3 Subject Key Identifier:
B4:1B:3B:4F:65:F2:BF:9E:8A:8F:E3:33:96:44:1F:67:EA:B3:34:D5
X509v3 Authority Key Identifier:
keyid:B4:1B:3B:4F:65:F2:BF:9E:8A:8F:E3:33:96:44:1F:67:EA:B3:34:D5
DirName:/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC256BPR1-SRV/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
serial:2F:F8:FA:8B:CF:EC:8F:2C:BC:40:FB:95:A0:3E:04:DB:DD:C5:7F:08
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage:
TLS Web Server Authentication
Signature Algorithm: ecdsa-with-SHA256
30:45:02:21:00:81:37:b3:f7:a7:e7:9d:1b:62:3f:25:20:02:
45:93:45:5c:91:23:1b:8b:bc:09:0c:f7:ef:51:29:a4:90:ec:
91:02:20:74:dd:26:c3:eb:24:e1:33:ce:b4:c6:f8:5f:9f:99:
6d:2b:9a:ee:ac:33:d8:08:29:19:3c:00:f1:83:de:a6:af
-----BEGIN CERTIFICATE-----
MIIDfjCCAySgAwIBAgIUL/j6i8/sjyy8QPuVoD4E293FfwgwCgYIKoZIzj0EAwIw
gZoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdT
ZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMRcwFQYDVQQLDA5FQ0MyNTZCUFIxLVNS
VjEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZv
QHdvbGZzc2wuY29tMB4XDTIwMTAxNTIwMTM1NVoXDTMwMTAxMzIwMTM1NVowgZox
CzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0
dGxlMRAwDgYDVQQKDAdFbGlwdGljMRcwFQYDVQQLDA5FQ0MyNTZCUFIxLVNSVjEY
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdv
bGZzc2wuY29tMFowFAYHKoZIzj0CAQYJKyQDAwIIAQEHA0IABC7vJ8tXOtxiJba1
QlzuKVbjqM6GbkRSIxXIQ8BiEBYeSsuI0HXgOGuAhGSfcKrYuzOQwduBRq7pgckD
abXOreujggFDMIIBPzAJBgNVHRMEAjAAMBEGCWCGSAGG+EIBAQQEAwIGQDAdBgNV
HQ4EFgQUtBs7T2Xyv56Kj+MzlkQfZ+qzNNUwgdoGA1UdIwSB0jCBz4AUtBs7T2Xy
v56Kj+MzlkQfZ+qzNNWhgaCkgZ0wgZoxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApX
YXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMRcw
FQYDVQQLDA5FQ0MyNTZCUFIxLVNSVjEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29t
MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tghQv+PqLz+yPLLxA+5Wg
PgTb3cV/CDAOBgNVHQ8BAf8EBAMCA6gwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYI
KoZIzj0EAwIDSAAwRQIhAIE3s/en550bYj8lIAJFk0VckSMbi7wJDPfvUSmkkOyR
AiB03SbD6yThM860xvhfn5ltK5rurDPYCCkZPADxg96mrw==
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,63 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
60:d5:b7:78:ff:06:14:3b:1e:c5:ba:8b:dd:5e:67:b2:16:aa:b2:c7
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256K1-SRV, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Oct 15 20:13:46 2020 GMT
Not After : Oct 13 20:13:46 2030 GMT
Subject: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC256K1-SRV, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:d7:0d:0b:f1:0e:22:88:fe:fb:d5:e5:e1:09:a4:
3e:90:76:b3:29:cb:d9:13:60:b7:ea:88:82:d7:8c:
b6:db:21:dc:93:0f:e9:58:bb:c5:f2:a2:c2:f5:23:
36:c5:d5:eb:24:a6:24:db:ee:02:b0:05:31:a6:33:
1f:cd:79:82:10
ASN1 OID: secp256k1
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Cert Type:
SSL Server
X509v3 Subject Key Identifier:
44:6A:D8:71:6D:AB:62:18:21:02:27:23:90:BF:1D:77:B6:79:4B:77
X509v3 Authority Key Identifier:
keyid:44:6A:D8:71:6D:AB:62:18:21:02:27:23:90:BF:1D:77:B6:79:4B:77
DirName:/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC256K1-SRV/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
serial:60:D5:B7:78:FF:06:14:3B:1E:C5:BA:8B:DD:5E:67:B2:16:AA:B2:C7
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage:
TLS Web Server Authentication
Signature Algorithm: ecdsa-with-SHA256
30:44:02:20:01:71:b5:5f:e4:5b:b7:95:b4:59:9a:b0:dc:ef:
64:01:76:ef:04:07:d8:b4:44:e5:db:86:e4:05:8c:c1:22:19:
02:20:3e:93:fb:30:f9:4c:89:39:35:df:b3:79:d5:29:bb:2b:
08:84:8a:f8:55:7c:f9:68:d6:2c:11:28:af:a9:33:0f
-----BEGIN CERTIFICATE-----
MIIDczCCAxqgAwIBAgIUYNW3eP8GFDsexbqL3V5nshaqsscwCgYIKoZIzj0EAwIw
gZgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdT
ZWF0dGxlMRAwDgYDVQQKDAdFbGlwdGljMRUwEwYDVQQLDAxFQ0MyNTZLMS1TUlYx
GDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3
b2xmc3NsLmNvbTAeFw0yMDEwMTUyMDEzNDZaFw0zMDEwMTMyMDEzNDZaMIGYMQsw
CQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRs
ZTEQMA4GA1UECgwHRWxpcHRpYzEVMBMGA1UECwwMRUNDMjU2SzEtU1JWMRgwFgYD
VQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNz
bC5jb20wVjAQBgcqhkjOPQIBBgUrgQQACgNCAATXDQvxDiKI/vvV5eEJpD6QdrMp
y9kTYLfqiILXjLbbIdyTD+lYu8XyosL1IzbF1eskpiTb7gKwBTGmMx/NeYIQo4IB
QTCCAT0wCQYDVR0TBAIwADARBglghkgBhvhCAQEEBAMCBkAwHQYDVR0OBBYEFERq
2HFtq2IYIQInI5C/HXe2eUt3MIHYBgNVHSMEgdAwgc2AFERq2HFtq2IYIQInI5C/
HXe2eUt3oYGepIGbMIGYMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv
bjEQMA4GA1UEBwwHU2VhdHRsZTEQMA4GA1UECgwHRWxpcHRpYzEVMBMGA1UECwwM
RUNDMjU2SzEtU1JWMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG
9w0BCQEWEGluZm9Ad29sZnNzbC5jb22CFGDVt3j/BhQ7HsW6i91eZ7IWqrLHMA4G
A1UdDwEB/wQEAwIDqDATBgNVHSUEDDAKBggrBgEFBQcDATAKBggqhkjOPQQDAgNH
ADBEAiABcbVf5Fu3lbRZmrDc72QBdu8EB9i0ROXbhuQFjMEiGQIgPpP7MPlMiTk1
37N51Sm7KwiEivhVfPlo1iwRKK+pMw8=
-----END CERTIFICATE-----

View File

@@ -45,13 +45,18 @@ EXTRA_DIST += \
certs/test-degenerate.p7b \
certs/test-ber-exp02-05-2022.p7b \
certs/test-servercert.p12 \
certs/test-servercert-rc2.p12 \
certs/ecc-rsa-server.p12 \
certs/dsaparams.pem \
certs/ecc-privOnlyKey.pem \
certs/ecc-privOnlyCert.pem \
certs/dh3072.pem \
certs/dh4096.pem \
certs/client-cert-ext.pem
certs/client-cert-ext.pem \
certs/csr.attr.der \
certs/csr.dsa.pem \
certs/csr.signed.der \
certs/csr.ext.der
EXTRA_DIST += \
certs/ca-key.der \
@@ -106,9 +111,11 @@ include certs/crl/include.am
include certs/ecc/include.am
include certs/ed25519/include.am
include certs/ed448/include.am
include certs/p521/include.am
include certs/external/include.am
include certs/ocsp/include.am
include certs/statickeys/include.am
include certs/test/include.am
include certs/test-pathlen/include.am
include certs/intermediate/include.am

BIN
certs/p521/ca-p521-key.der Normal file

Binary file not shown.

View File

@@ -0,0 +1,6 @@
-----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQALRgkLeTbbMNpm9sYZzPxYGiUFM2R
Sldl7zb6JIKI7Mfwy0hFbpZff+t2vkRAwxnAM2jEBgSOwiWxloMiDnvHsvwBhpHt
Q1044AwljbPbsdzetyGAz4feZPQhPi2veb320ABLgXn69xCqGc1A1x51NFMpA+1I
VCHlj5W1m0GNX91y0lo=
-----END PUBLIC KEY-----

BIN
certs/p521/ca-p521-priv.der Normal file

Binary file not shown.

View File

@@ -0,0 +1,7 @@
-----BEGIN EC PRIVATE KEY-----
MIHcAgEBBEIB29qI0BYpdJXJ61gEQtz5rWlWL8B+ZKslEzyZlA5Z2iAKjwKUxd6Q
js0MrD6yn1lne9FGISDUo+sjDDOiQvxx8F2gBwYFK4EEACOhgYkDgYYABAAtGCQt
5Ntsw2mb2xhnM/FgaJQUzZFKV2XvNvokgojsx/DLSEVull9/63a+REDDGcAzaMQG
BI7CJbGWgyIOe8ey/AGGke1DXTjgDCWNs9ux3N63IYDPh95k9CE+La95vfbQAEuB
efr3EKoZzUDXHnU0UykD7UhUIeWPlbWbQY1f3XLSWg==
-----END EC PRIVATE KEY-----

BIN
certs/p521/ca-p521.der Normal file

Binary file not shown.

63
certs/p521/ca-p521.pem Normal file
View File

@@ -0,0 +1,63 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Montana, L = Bozeman, O = wolfSSL_P521, OU = Root-P521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Sep 14 23:57:18 2020 GMT
Not After : Jun 11 23:57:18 2023 GMT
Subject: C = US, ST = Montana, L = Bozeman, O = wolfSSL_p521, OU = CA-p521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (521 bit)
pub:
04:00:2d:18:24:2d:e4:db:6c:c3:69:9b:db:18:67:
33:f1:60:68:94:14:cd:91:4a:57:65:ef:36:fa:24:
82:88:ec:c7:f0:cb:48:45:6e:96:5f:7f:eb:76:be:
44:40:c3:19:c0:33:68:c4:06:04:8e:c2:25:b1:96:
83:22:0e:7b:c7:b2:fc:01:86:91:ed:43:5d:38:e0:
0c:25:8d:b3:db:b1:dc:de:b7:21:80:cf:87:de:64:
f4:21:3e:2d:af:79:bd:f6:d0:00:4b:81:79:fa:f7:
10:aa:19:cd:40:d7:1e:75:34:53:29:03:ed:48:54:
21:e5:8f:95:b5:9b:41:8d:5f:dd:72:d2:5a
ASN1 OID: secp521r1
NIST CURVE: P-521
X509v3 extensions:
X509v3 Subject Key Identifier:
40:89:1D:30:5E:0C:6E:D5:3D:C6:D5:25:90:DA:B6:42:67:ED:E9:82
X509v3 Authority Key Identifier:
keyid:64:A7:68:95:53:33:18:A2:20:92:BC:64:55:A6:AB:CA:76:68:9B:C8
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
Signature Algorithm: ecdsa-with-SHA256
30:81:87:02:41:60:cd:fa:94:0d:23:c3:4e:3c:b1:6e:d9:b6:
5b:0e:97:1e:a4:df:0a:7c:05:2e:61:0c:d7:c0:e5:86:16:0c:
7b:01:a5:33:9a:e6:31:a0:62:91:da:dc:22:d1:ba:4f:75:43:
94:43:67:91:20:08:66:96:27:53:b2:61:0e:59:0a:50:02:42:
01:ec:87:8d:ca:6d:e0:bf:30:ba:ef:37:13:ad:f6:d1:c4:fc:
b5:e5:4b:96:c2:83:a0:d8:ed:04:73:85:8d:54:d7:e9:9a:67:
8a:cf:11:36:4a:f2:2f:85:5a:24:5e:3c:79:e1:a7:c4:ec:78:
82:7a:52:25:c4:55:57:95:0e:6f:c9:d5
-----BEGIN CERTIFICATE-----
MIIDBzCCAmmgAwIBAgIBATAKBggqhkjOPQQDAjCBlzELMAkGA1UEBhMCVVMxEDAO
BgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTATBgNVBAoMDHdvbGZT
U0xfUDUyMTESMBAGA1UECwwJUm9vdC1QNTIxMRgwFgYDVQQDDA93d3cud29sZnNz
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMjAwOTE0
MjM1NzE4WhcNMjMwNjExMjM1NzE4WjCBlTELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTATBgNVBAoMDHdvbGZTU0xfcDUy
MTEQMA4GA1UECwwHQ0EtcDUyMTEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8w
HQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMIGbMBAGByqGSM49AgEGBSuB
BAAjA4GGAAQALRgkLeTbbMNpm9sYZzPxYGiUFM2RSldl7zb6JIKI7Mfwy0hFbpZf
f+t2vkRAwxnAM2jEBgSOwiWxloMiDnvHsvwBhpHtQ1044AwljbPbsdzetyGAz4fe
ZPQhPi2veb320ABLgXn69xCqGc1A1x51NFMpA+1IVCHlj5W1m0GNX91y0lqjYzBh
MB0GA1UdDgQWBBRAiR0wXgxu1T3G1SWQ2rZCZ+3pgjAfBgNVHSMEGDAWgBRkp2iV
UzMYoiCSvGRVpqvKdmibyDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
hjAKBggqhkjOPQQDAgOBiwAwgYcCQWDN+pQNI8NOPLFu2bZbDpcepN8KfAUuYQzX
wOWGFgx7AaUzmuYxoGKR2twi0bpPdUOUQ2eRIAhmlidTsmEOWQpQAkIB7IeNym3g
vzC67zcTrfbRxPy15UuWwoOg2O0Ec4WNVNfpmmeKzxE2SvIvhVokXjx54afE7HiC
elIlxFVXlQ5vydU=
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,6 @@
-----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBYm7xAOzYmVibgGv+LPGy8MhI36zS
O3Epq/BmY9iOtcjC/JlE4kWxWnu5cwHaeeycJic0RSbViUtE/mlOchTji7wADwmi
A8Na3JWC9vn2nP+1a3WVS6QoXZ6QBNHAHtX9Q54eg8ARKysHbal6ENdn51E3JNi/
Aw2LtUBcT9YTc0K8kdk=
-----END PUBLIC KEY-----

Binary file not shown.

View File

@@ -0,0 +1,7 @@
-----BEGIN EC PRIVATE KEY-----
MIHcAgEBBEIBaJEzU+KQaBGPqqh2DPcqBxuSKqeCPfqDznDIwmCC/hiIaNpqg0Z4
5OnpzFF/7YECMu4mh8ztYz85J/DXF3ehpDagBwYFK4EEACOhgYkDgYYABAFibvEA
7NiZWJuAa/4s8bLwyEjfrNI7cSmr8GZj2I61yML8mUTiRbFae7lzAdp57JwmJzRF
JtWJS0T+aU5yFOOLvAAPCaIDw1rclYL2+fac/7VrdZVLpChdnpAE0cAe1f1Dnh6D
wBErKwdtqXoQ12fnUTck2L8DDYu1QFxP1hNzQryR2Q==
-----END EC PRIVATE KEY-----

BIN
certs/p521/client-p521.der Normal file

Binary file not shown.

View File

@@ -0,0 +1,73 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
24:9d:c6:98:df:09:87:30:42:bd:e6:4f:86:05:af:dc:82:89:d7:0e
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Montana, L = Bozeman, O = wolfSSL_p521, OU = Client-p521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Sep 14 23:57:18 2020 GMT
Not After : Jun 11 23:57:18 2023 GMT
Subject: C = US, ST = Montana, L = Bozeman, O = wolfSSL_p521, OU = Client-p521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (521 bit)
pub:
04:01:62:6e:f1:00:ec:d8:99:58:9b:80:6b:fe:2c:
f1:b2:f0:c8:48:df:ac:d2:3b:71:29:ab:f0:66:63:
d8:8e:b5:c8:c2:fc:99:44:e2:45:b1:5a:7b:b9:73:
01:da:79:ec:9c:26:27:34:45:26:d5:89:4b:44:fe:
69:4e:72:14:e3:8b:bc:00:0f:09:a2:03:c3:5a:dc:
95:82:f6:f9:f6:9c:ff:b5:6b:75:95:4b:a4:28:5d:
9e:90:04:d1:c0:1e:d5:fd:43:9e:1e:83:c0:11:2b:
2b:07:6d:a9:7a:10:d7:67:e7:51:37:24:d8:bf:03:
0d:8b:b5:40:5c:4f:d6:13:73:42:bc:91:d9
ASN1 OID: secp521r1
NIST CURVE: P-521
X509v3 extensions:
X509v3 Subject Key Identifier:
20:E1:BF:57:E5:F3:C3:0C:72:84:6A:C6:DF:BC:22:D0:B7:25:E5:A4
X509v3 Authority Key Identifier:
keyid:20:E1:BF:57:E5:F3:C3:0C:72:84:6A:C6:DF:BC:22:D0:B7:25:E5:A4
DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL_p521/OU=Client-p521/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
serial:24:9D:C6:98:DF:09:87:30:42:BD:E6:4F:86:05:AF:DC:82:89:D7:0E
X509v3 Basic Constraints:
CA:TRUE
X509v3 Subject Alternative Name:
DNS:example.com, IP Address:127.0.0.1
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
Signature Algorithm: ecdsa-with-SHA256
30:81:87:02:42:01:e1:85:a5:0e:81:ff:b0:2a:d3:b8:73:8c:
1d:8e:1f:42:4c:de:cb:d1:63:69:ce:53:d0:2a:52:14:e4:7a:
2f:1e:c4:0b:1b:db:1e:36:97:72:ed:9b:2f:d4:93:79:06:ec:
41:6c:6c:18:28:99:56:b6:0b:58:c4:bc:47:db:64:a8:7e:02:
41:2b:d0:32:2e:03:81:32:f3:9a:65:58:a4:51:7e:9a:ad:c2:
99:bf:21:f1:a1:70:61:4b:ee:8e:df:3b:9c:79:e3:12:b4:3b:
9e:64:da:d0:ef:5b:50:7b:a1:b0:30:8f:af:66:71:9d:41:20:
cf:e8:9c:bd:f5:3b:c4:fe:00:43:35:24
-----BEGIN CERTIFICATE-----
MIIECTCCA2ugAwIBAgIUJJ3GmN8JhzBCveZPhgWv3IKJ1w4wCgYIKoZIzj0EAwIw
gZkxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3pl
bWFuMRUwEwYDVQQKDAx3b2xmU1NMX3A1MjExFDASBgNVBAsMC0NsaWVudC1wNTIx
MRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9A
d29sZnNzbC5jb20wHhcNMjAwOTE0MjM1NzE4WhcNMjMwNjExMjM1NzE4WjCBmTEL
MAkGA1UEBhMCVVMxEDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4x
FTATBgNVBAoMDHdvbGZTU0xfcDUyMTEUMBIGA1UECwwLQ2xpZW50LXA1MjExGDAW
BgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5mb0B3b2xm
c3NsLmNvbTCBmzAQBgcqhkjOPQIBBgUrgQQAIwOBhgAEAWJu8QDs2JlYm4Br/izx
svDISN+s0jtxKavwZmPYjrXIwvyZROJFsVp7uXMB2nnsnCYnNEUm1YlLRP5pTnIU
44u8AA8JogPDWtyVgvb59pz/tWt1lUukKF2ekATRwB7V/UOeHoPAESsrB22pehDX
Z+dRNyTYvwMNi7VAXE/WE3NCvJHZo4IBSjCCAUYwHQYDVR0OBBYEFCDhv1fl88MM
coRqxt+8ItC3JeWkMIHZBgNVHSMEgdEwgc6AFCDhv1fl88MMcoRqxt+8ItC3JeWk
oYGfpIGcMIGZMQswCQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UE
BwwHQm96ZW1hbjEVMBMGA1UECgwMd29sZlNTTF9wNTIxMRQwEgYDVQQLDAtDbGll
bnQtcDUyMTEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkB
FhBpbmZvQHdvbGZzc2wuY29tghQkncaY3wmHMEK95k+GBa/cgonXDjAMBgNVHRME
BTADAQH/MBwGA1UdEQQVMBOCC2V4YW1wbGUuY29thwR/AAABMB0GA1UdJQQWMBQG
CCsGAQUFBwMBBggrBgEFBQcDAjAKBggqhkjOPQQDAgOBiwAwgYcCQgHhhaUOgf+w
KtO4c4wdjh9CTN7L0WNpzlPQKlIU5HovHsQLG9seNpdy7Zsv1JN5BuxBbGwYKJlW
tgtYxLxH22SofgJBK9AyLgOBMvOaZVikUX6arcKZvyHxoXBhS+6O3zuceeMStDue
ZNrQ71tQe6GwMI+vZnGdQSDP6Jy99TvE/gBDNSQ=
-----END CERTIFICATE-----

105
certs/p521/gen-p521-certs.sh Executable file
View File

@@ -0,0 +1,105 @@
#!/bin/bash
check_result(){
if [ $1 -ne 0 ]; then
echo "Failed at \"$2\", Abort"
exit 1
else
echo "Step Succeeded!"
fi
}
openssl pkey -in root-p521-priv.pem -noout >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "OpenSSL does not support P521"
echo "Skipping P521 certificate renewal"
exit 0
fi
############################################################
###### update the self-signed root-p521.pem ###############
############################################################
echo "Updating root-p521.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\\nMontana\\nBozeman\\nwolfSSL_P521\\nRoot-P521\\nwww.wolfssl.com\\ninfo@wolfssl.com\\n.\\n.\\n" | \
openssl req -new -key root-p521-priv.pem -config ../renewcerts/wolfssl.cnf -nodes -out root-p521.csr
check_result $? "Generate request"
openssl x509 -req -in root-p521.csr -days 1000 -extfile ../renewcerts/wolfssl.cnf -extensions ca_ecc_cert -signkey root-p521-priv.pem -out root-p521.pem
check_result $? "Generate certificate"
rm root-p521.csr
openssl x509 -in root-p521.pem -outform DER > root-p521.der
check_result $? "Convert to DER"
openssl x509 -in root-p521.pem -text > tmp.pem
check_result $? "Add text"
mv tmp.pem root-p521.pem
echo "End of section"
echo "---------------------------------------------------------------------"
############################################################
###### update ca-p521.pem signed by root ##################
############################################################
echo "Updating ca-p521.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\\nMontana\\nBozeman\\nwolfSSL_p521\\nCA-p521\\nwww.wolfssl.com\\ninfo@wolfssl.com\\n\\n\\n\\n" | openssl req -new -key ca-p521-priv.pem -config ../renewcerts/wolfssl.cnf -nodes -out ca-p521.csr
check_result $? "Generate request"
openssl x509 -req -in ca-p521.csr -days 1000 -extfile ../renewcerts/wolfssl.cnf -extensions ca_ecc_cert -CA root-p521.pem -CAkey root-p521-priv.pem -set_serial 01 -out ca-p521.pem
check_result $? "Generate certificate"
rm ca-p521.csr
openssl x509 -in ca-p521.pem -outform DER > ca-p521.der
check_result $? "Convert to DER"
openssl x509 -in ca-p521.pem -text > tmp.pem
check_result $? "Add text"
mv tmp.pem ca-p521.pem
echo "End of section"
echo "---------------------------------------------------------------------"
############################################################
###### update server-p521.pem signed by ca ################
############################################################
echo "Updating server-p521.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\\nMontana\\nBozeman\\nwolfSSL_p521\\nServer-p521\\nwww.wolfssl.com\\ninfo@wolfssl.com\\n\\n\\n\\n" | openssl req -new -key server-p521-priv.pem -config ../renewcerts/wolfssl.cnf -nodes -out server-p521.csr
check_result $? "Generate request"
openssl x509 -req -in server-p521.csr -days 1000 -extfile ../renewcerts/wolfssl.cnf -extensions server_ecc -CA ca-p521.pem -CAkey ca-p521-priv.pem -set_serial 01 -out server-p521-cert.pem
check_result $? "Generate certificate"
rm server-p521.csr
openssl x509 -in server-p521-cert.pem -outform DER > server-p521.der
check_result $? "Convert to DER"
openssl x509 -in server-p521-cert.pem -text > tmp.pem
check_result $? "Add text"
mv tmp.pem server-p521-cert.pem
cat server-p521-cert.pem ca-p521.pem > server-p521.pem
check_result $? "Add CA into server cert"
echo "End of section"
echo "---------------------------------------------------------------------"
############################################################
###### update the self-signed client-p521.pem #############
############################################################
echo "Updating client-p521.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\\nMontana\\nBozeman\\nwolfSSL_p521\\nClient-p521\\nwww.wolfssl.com\\ninfo@wolfssl.com\\n\\n\\n\\n" | openssl req -new -key client-p521-priv.pem -config ../renewcerts/wolfssl.cnf -nodes -out client-p521.csr
check_result $? "Generate request"
openssl x509 -req -in client-p521.csr -days 1000 -extfile ../renewcerts/wolfssl.cnf -extensions wolfssl_opts -signkey client-p521-priv.pem -out client-p521.pem
check_result $? "Generate certificate"
rm client-p521.csr
openssl x509 -in client-p521.pem -outform DER > client-p521.der
check_result $? "Convert to DER"
openssl x509 -in client-p521.pem -text > tmp.pem
check_result $? "Add text"
mv tmp.pem client-p521.pem
echo "End of section"
echo "---------------------------------------------------------------------"

16
certs/p521/gen-p521-keys.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
for key in root ca server client
do
openssl ecparam -name secp521r1 -genkey -noout > ${key}-p521-priv.pem
openssl pkey -in ${key}-p521-priv.pem -outform DER -out ${key}-p521-priv.der
openssl pkey -in ${key}-p521-priv.pem -outform PEM -pubout -out ${key}-p521-key.pem
openssl pkey -in ${key}-p521-priv.pem -outform DER -pubout -out ${key}-p521-key.der
done

31
certs/p521/include.am Normal file
View File

@@ -0,0 +1,31 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
certs/p521/ca-p521.der \
certs/p521/ca-p521.pem \
certs/p521/ca-p521-key.der \
certs/p521/ca-p521-key.pem \
certs/p521/ca-p521-priv.der \
certs/p521/ca-p521-priv.pem \
certs/p521/client-p521.der \
certs/p521/client-p521.pem \
certs/p521/client-p521-key.der \
certs/p521/client-p521-key.pem \
certs/p521/client-p521-priv.der \
certs/p521/client-p521-priv.pem \
certs/p521/root-p521.der \
certs/p521/root-p521.pem \
certs/p521/root-p521-key.der \
certs/p521/root-p521-key.pem \
certs/p521/root-p521-priv.der \
certs/p521/root-p521-priv.pem \
certs/p521/server-p521.der \
certs/p521/server-p521.pem \
certs/p521/server-p521-cert.pem \
certs/p521/server-p521-key.der \
certs/p521/server-p521-key.pem \
certs/p521/server-p521-priv.der \
certs/p521/server-p521-priv.pem

Binary file not shown.

View File

@@ -0,0 +1,6 @@
-----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBQWDU5cw32/RMEsz2ejLM8hy3UxW9
X1Pvy3OpyBRsb33FfLS7jlbCQ0X7WBzGRT1/5U6AzETBBnp14WnJiqgBet8ARElz
nC9QP4OgHovRqvsIDJAFDQwXMVE+1oU7CRKC0aYIzchPalrIjI5dv9rMW5Wh6Fop
eCKyukmhhcZIinFTjYk=
-----END PUBLIC KEY-----

Binary file not shown.

View File

@@ -0,0 +1,7 @@
-----BEGIN EC PRIVATE KEY-----
MIHcAgEBBEIB+0L/Wo+9bKC8iEmkLdgQkDyeJkbDp0bmhUqOevrpeBqs/Q/0dtg9
WFwp7ceTJkuLr/osgWrNpTxgVscecuiYRGSgBwYFK4EEACOhgYkDgYYABAFBYNTl
zDfb9EwSzPZ6MszyHLdTFb1fU+/Lc6nIFGxvfcV8tLuOVsJDRftYHMZFPX/lToDM
RMEGenXhacmKqAF63wBESXOcL1A/g6Aei9Gq+wgMkAUNDBcxUT7WhTsJEoLRpgjN
yE9qWsiMjl2/2sxblaHoWil4IrK6SaGFxkiKcVONiQ==
-----END EC PRIVATE KEY-----

BIN
certs/p521/root-p521.der Normal file

Binary file not shown.

64
certs/p521/root-p521.pem Normal file
View File

@@ -0,0 +1,64 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
23:0c:f9:b8:9a:a1:1d:4f:ec:23:8f:4b:f2:20:5d:7d:ac:43:4e:98
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Montana, L = Bozeman, O = wolfSSL_P521, OU = Root-P521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Sep 14 23:57:18 2020 GMT
Not After : Jun 11 23:57:18 2023 GMT
Subject: C = US, ST = Montana, L = Bozeman, O = wolfSSL_P521, OU = Root-P521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (521 bit)
pub:
04:01:41:60:d4:e5:cc:37:db:f4:4c:12:cc:f6:7a:
32:cc:f2:1c:b7:53:15:bd:5f:53:ef:cb:73:a9:c8:
14:6c:6f:7d:c5:7c:b4:bb:8e:56:c2:43:45:fb:58:
1c:c6:45:3d:7f:e5:4e:80:cc:44:c1:06:7a:75:e1:
69:c9:8a:a8:01:7a:df:00:44:49:73:9c:2f:50:3f:
83:a0:1e:8b:d1:aa:fb:08:0c:90:05:0d:0c:17:31:
51:3e:d6:85:3b:09:12:82:d1:a6:08:cd:c8:4f:6a:
5a:c8:8c:8e:5d:bf:da:cc:5b:95:a1:e8:5a:29:78:
22:b2:ba:49:a1:85:c6:48:8a:71:53:8d:89
ASN1 OID: secp521r1
NIST CURVE: P-521
X509v3 extensions:
X509v3 Subject Key Identifier:
64:A7:68:95:53:33:18:A2:20:92:BC:64:55:A6:AB:CA:76:68:9B:C8
X509v3 Authority Key Identifier:
keyid:64:A7:68:95:53:33:18:A2:20:92:BC:64:55:A6:AB:CA:76:68:9B:C8
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
Signature Algorithm: ecdsa-with-SHA256
30:81:87:02:41:55:16:68:aa:bc:e1:5e:b6:d3:4c:3e:aa:e6:
64:e6:ca:94:ec:7d:0f:a8:ea:70:00:33:26:95:27:bd:23:ae:
69:5b:29:60:28:1e:0d:fa:69:3d:21:36:f9:9d:80:74:b1:ae:
d0:2c:bd:12:13:ce:98:0c:69:39:ab:99:88:90:17:02:02:42:
01:f7:b2:95:d0:bf:64:4d:f9:2e:0e:98:40:00:1c:a7:0a:b3:
2e:09:f8:c2:27:56:3e:b4:2a:c0:fc:1a:3a:87:c6:6f:ac:20:
d4:df:90:f0:00:88:a0:a6:63:79:74:9c:91:c0:ce:7c:21:6b:
65:64:a8:fb:83:48:78:eb:78:e0:51:95
-----BEGIN CERTIFICATE-----
MIIDHDCCAn6gAwIBAgIUIwz5uJqhHU/sI49L8iBdfaxDTpgwCgYIKoZIzj0EAwIw
gZcxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3pl
bWFuMRUwEwYDVQQKDAx3b2xmU1NMX1A1MjExEjAQBgNVBAsMCVJvb3QtUDUyMTEY
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdv
bGZzc2wuY29tMB4XDTIwMDkxNDIzNTcxOFoXDTIzMDYxMTIzNTcxOFowgZcxCzAJ
BgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMRUw
EwYDVQQKDAx3b2xmU1NMX1A1MjExEjAQBgNVBAsMCVJvb3QtUDUyMTEYMBYGA1UE
AwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wu
Y29tMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBQWDU5cw32/RMEsz2ejLM8hy3
UxW9X1Pvy3OpyBRsb33FfLS7jlbCQ0X7WBzGRT1/5U6AzETBBnp14WnJiqgBet8A
RElznC9QP4OgHovRqvsIDJAFDQwXMVE+1oU7CRKC0aYIzchPalrIjI5dv9rMW5Wh
6FopeCKyukmhhcZIinFTjYmjYzBhMB0GA1UdDgQWBBRkp2iVUzMYoiCSvGRVpqvK
dmibyDAfBgNVHSMEGDAWgBRkp2iVUzMYoiCSvGRVpqvKdmibyDAPBgNVHRMBAf8E
BTADAQH/MA4GA1UdDwEB/wQEAwIBhjAKBggqhkjOPQQDAgOBiwAwgYcCQVUWaKq8
4V6200w+quZk5sqU7H0PqOpwADMmlSe9I65pWylgKB4N+mk9ITb5nYB0sa7QLL0S
E86YDGk5q5mIkBcCAkIB97KV0L9kTfkuDphAABynCrMuCfjCJ1Y+tCrA/Bo6h8Zv
rCDU35DwAIigpmN5dJyRwM58IWtlZKj7g0h463jgUZU=
-----END CERTIFICATE-----

View File

@@ -0,0 +1,68 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: ecdsa-with-SHA256
Issuer: C = US, ST = Montana, L = Bozeman, O = wolfSSL_p521, OU = CA-p521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Validity
Not Before: Sep 14 23:57:18 2020 GMT
Not After : Jun 11 23:57:18 2023 GMT
Subject: C = US, ST = Montana, L = Bozeman, O = wolfSSL_p521, OU = Server-p521, CN = www.wolfssl.com, emailAddress = info@wolfssl.com
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (521 bit)
pub:
04:00:de:70:69:f6:d1:9e:c4:fe:5f:82:52:98:ce:
52:c1:6a:4c:12:22:0f:76:88:22:11:a5:0d:a6:02:
47:91:ab:79:8d:f6:08:70:2d:20:14:15:df:1b:57:
58:b3:51:ab:20:a8:2b:bd:6a:3f:a9:ee:c2:6d:ae:
99:44:b4:a1:12:10:70:00:ca:1f:14:1d:b0:e7:0c:
41:18:52:37:04:a7:84:53:a1:02:46:93:1f:d5:60:
63:a6:2e:7d:8d:ea:3f:e0:5b:e5:c8:6e:1f:a7:d9:
a3:59:e5:96:27:22:f4:02:2b:af:5b:78:1f:13:a8:
22:8b:ec:ae:01:7d:c0:61:13:a4:35:0a:21
ASN1 OID: secp521r1
NIST CURVE: P-521
X509v3 extensions:
X509v3 Subject Key Identifier:
85:86:9F:AE:73:5F:94:77:27:3B:15:15:C6:79:07:A8:42:4B:1E:F3
X509v3 Authority Key Identifier:
keyid:40:89:1D:30:5E:0C:6E:D5:3D:C6:D5:25:90:DA:B6:42:67:ED:E9:82
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Key Usage: critical
Digital Signature, Key Encipherment, Key Agreement
X509v3 Extended Key Usage:
TLS Web Server Authentication
Netscape Cert Type:
SSL Server
Signature Algorithm: ecdsa-with-SHA256
30:81:88:02:42:01:95:31:ef:ac:8f:c7:79:c8:b1:27:21:70:
24:d1:78:d6:d4:da:d0:1d:44:52:6f:3f:0a:f1:33:ac:70:14:
cf:62:e6:23:a8:a5:30:04:e1:40:7b:05:c5:45:c9:be:b0:32:
d5:00:77:c7:6b:1d:37:7a:2c:83:02:9d:ef:5d:9e:9c:91:02:
42:01:f8:7c:5b:fc:b3:1a:26:2c:b4:41:c8:bf:0d:ae:74:5a:
0d:25:10:7d:9d:33:ec:5c:29:c0:7c:6a:96:f3:28:b6:06:de:
13:1f:b1:a1:76:38:ea:a1:db:81:21:b6:81:0c:8f:67:b7:3d:
7b:6b:e0:72:67:e3:d1:71:11:92:8b:d0:f1
-----BEGIN CERTIFICATE-----
MIIDMTCCApKgAwIBAgIBATAKBggqhkjOPQQDAjCBlTELMAkGA1UEBhMCVVMxEDAO
BgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFTATBgNVBAoMDHdvbGZT
U0xfcDUyMTEQMA4GA1UECwwHQ0EtcDUyMTEYMBYGA1UEAwwPd3d3LndvbGZzc2wu
Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTIwMDkxNDIz
NTcxOFoXDTIzMDYxMTIzNTcxOFowgZkxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdN
b250YW5hMRAwDgYDVQQHDAdCb3plbWFuMRUwEwYDVQQKDAx3b2xmU1NMX3A1MjEx
FDASBgNVBAsMC1NlcnZlci1wNTIxMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20x
HzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wgZswEAYHKoZIzj0CAQYF
K4EEACMDgYYABADecGn20Z7E/l+CUpjOUsFqTBIiD3aIIhGlDaYCR5GreY32CHAt
IBQV3xtXWLNRqyCoK71qP6nuwm2umUS0oRIQcADKHxQdsOcMQRhSNwSnhFOhAkaT
H9VgY6YufY3qP+Bb5chuH6fZo1nllici9AIrr1t4HxOoIovsrgF9wGETpDUKIaOB
iTCBhjAdBgNVHQ4EFgQUhYafrnNflHcnOxUVxnkHqEJLHvMwHwYDVR0jBBgwFoAU
QIkdMF4MbtU9xtUlkNq2Qmft6YIwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMC
A6gwEwYDVR0lBAwwCgYIKwYBBQUHAwEwEQYJYIZIAYb4QgEBBAQDAgZAMAoGCCqG
SM49BAMCA4GMADCBiAJCAZUx76yPx3nIsSchcCTReNbU2tAdRFJvPwrxM6xwFM9i
5iOopTAE4UB7BcVFyb6wMtUAd8drHTd6LIMCne9dnpyRAkIB+Hxb/LMaJiy0Qci/
Da50Wg0lEH2dM+xcKcB8apbzKLYG3hMfsaF2OOqh24EhtoEMj2e3PXtr4HJn49Fx
EZKL0PE=
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,6 @@
-----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQA3nBp9tGexP5fglKYzlLBakwSIg92
iCIRpQ2mAkeRq3mN9ghwLSAUFd8bV1izUasgqCu9aj+p7sJtrplEtKESEHAAyh8U
HbDnDEEYUjcEp4RToQJGkx/VYGOmLn2N6j/gW+XIbh+n2aNZ5ZYnIvQCK69beB8T
qCKL7K4BfcBhE6Q1CiE=
-----END PUBLIC KEY-----

Binary file not shown.

View File

@@ -0,0 +1,7 @@
-----BEGIN EC PRIVATE KEY-----
MIHcAgEBBEIBA/UQ99abMXYOwp9KaXiqAj86ltsFQghlThjy9iBcnWkX1HwOvRd7
cQFcIMmwK3LwktTPTcFOo0hgfvdwPKVlVJSgBwYFK4EEACOhgYkDgYYABADecGn2
0Z7E/l+CUpjOUsFqTBIiD3aIIhGlDaYCR5GreY32CHAtIBQV3xtXWLNRqyCoK71q
P6nuwm2umUS0oRIQcADKHxQdsOcMQRhSNwSnhFOhAkaTH9VgY6YufY3qP+Bb5chu
H6fZo1nllici9AIrr1t4HxOoIovsrgF9wGETpDUKIQ==
-----END EC PRIVATE KEY-----

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