Compare commits

...

2912 Commits

Author SHA1 Message Date
c3513bf257 update README for release v5.1.1 2022-01-03 10:16:17 -07:00
1715862fd8 Update configure and fips-check.sh for FIPS RC12. 2022-01-03 10:15:41 -07:00
8af742a93c Fix to resolve possible memory leak with DSA wc_DsaPublicKeyDecode in API unit test when used with HAVE_WOLF_BIGINT. 2022-01-03 10:15:21 -07:00
f3038b7aa5 fix for location of xmemset 2022-01-03 10:15:03 -07:00
e515274d15 increase version for rpm build 2022-01-03 10:14:53 -07:00
7525e5e68a bump version by .1 for dev 2022-01-03 10:14:44 -07:00
2b670c026d Merge pull request #4705 from JacobBarthelmeh/DTLS
account for DTLS extra header size when reading msg from pool
2021-12-27 19:16:26 -08:00
a07673ad07 Merge pull request #4706 from douzzer/20211227-fix-null-pointer-wolfSSL_EVP_CIPHER_CTX_ctrl
wolfcrypt/src/evp.c: fix wolfSSL_EVP_CIPHER_CTX_ctrl() null pointer…
2021-12-27 20:08:43 -07:00
aa05eb2879 wolfcrypt/src/evp.c: fix wolfSSL_EVP_CIPHER_CTX_ctrl() null pointer passed to XMEMCPY(), found by sanitizers under gcc-11.2.1. 2021-12-27 17:59:28 -06:00
05a19c852b account for DTLS extra header size when reading msg from pool 2021-12-27 16:52:09 -07:00
930cc053d5 Merge pull request #4704 from JacobBarthelmeh/release
prepare for release 5.1.0
2021-12-27 12:35:49 -08:00
d1b03eb8b9 add missing header files for rpm build 2021-12-27 09:49:47 -08:00
816718ecd3 prepare for release 5.1.0 2021-12-27 10:34:09 -07:00
cbab5bb6cb add kdf.c to MYSQL cmake build 2021-12-27 10:10:35 -07:00
5a4e59c09d fix warning about NULL compare 2021-12-27 10:02:16 -07:00
4e1c39b4c6 Merge pull request #4701 from SparkiDev/asn_templ_fix_1
ASN template: get compiling
2021-12-24 07:42:56 -08:00
fd31c017e1 Merge pull request #4703 from douzzer/20211224-fixits
20211224 ssl.c fixes
2021-12-24 07:42:00 -08:00
54e9076c45 src/ssl.c: fix whitespace and heap reference in FreeSession() (re 569c066fab). 2021-12-24 01:16:32 -06:00
9d49884274 Merge pull request #4690 from dgarske/resume
Fixes for session resumption edge cases
2021-12-24 15:28:06 +10:00
02186dbd23 Fix for TLS v1.3 client session ticket resumption where the server opts to do a new handshake. Fix to make sure preMasterSz is valid. 2021-12-23 18:45:52 -08:00
a92fb0eb42 Fix for session resumption to ensure use of the right cipher suite. ZD13297 2021-12-23 18:42:41 -08:00
f1f15f411f Merge pull request #4688 from embhorn/gh4684
Fix missing include ws2tcpip.h for VS build
2021-12-24 11:58:12 +10:00
929174be6b Merge pull request #4667 from dgarske/zd13363
Improve TLS client side session cache references
2021-12-24 11:23:06 +10:00
4c6af465c4 ASN template: get compiling 2021-12-24 11:21:18 +10:00
a75e152b93 Merge pull request #4698 from JacobBarthelmeh/Jenkins
fix for user_settings_all.h build on 'VS' and build with libz + pkcs7 test
2021-12-23 16:54:40 -08:00
37925e0b6a Merge pull request #4699 from douzzer/ssl-wolfCrypt_SetPrivateKeyReadEnable_fips 2021-12-23 16:42:06 -08:00
1e4b13dfac Only include ws2tcpip.h if not user IO. 2021-12-23 15:25:25 -08:00
569c066fab Improve TLS client side session cache references to provide option for not returning an internal session cache pointer. Now use wolfSSL_get1_sesson for reference logic, that requires calling wolfSSL_SESSION_free. To disable this feature use NO_SESSION_CACHE_REF. 2021-12-23 14:25:45 -08:00
7b5b1f5a4d src/ssl.c: refine integration of wolfCrypt_SetPrivateKeyReadEnable_fips(), started by 52754123d9: depend on fips 5.1+, and call as matched pair in wolfSSL_Init() and wolfSSL_Cleanup(). 2021-12-23 16:05:25 -06:00
f950f24b1a Merge pull request #4691 from JacobBarthelmeh/sessionExport
retain same size for exported session
2021-12-23 14:03:11 -08:00
21c8b19fc2 Merge pull request #4696 from JacobBarthelmeh/build_tests
fix for a couple reports from build_tests
2021-12-23 13:42:06 -08:00
801c0c7efd Merge pull request #4549 from elms/cmake/ac_catchup
cmake/configure consistency
2021-12-23 13:49:44 -07:00
57d2555ac8 Merge pull request #4695 from douzzer/20211222-fips-config-update-and-fix-test_RsaDecryptBoundsCheck
fips config update and test-driven cleanup
2021-12-23 10:38:36 -08:00
f9c9f4c840 refactor IP macro defines 2021-12-23 09:59:05 -08:00
c4e50ef086 fix for libz test with pkcs7 2021-12-23 09:37:09 -08:00
a8605309c6 Merge pull request #4692 from haydenroche5/wolfssl_init_fipsv5
Call wc_SetSeed_Cb and wolfCrypt_SetPrivateKeyReadEnable_fips in wolfSSL_Init.
2021-12-23 09:28:36 -08:00
9892f1f2d5 Merge pull request #4679 from dgarske/fips_ecc_pct 2021-12-23 10:27:51 -07:00
dc073f9c1d cmake: add back de-duplication and fix formatting 2021-12-23 09:22:47 -08:00
37eec1ed19 cmake: reduce port includes
TESTING:

```
./autogen.sh && ./configure --enable-reproducible-build --prefix=$PWD/ac_repro && make install
cmake -B b2 -DWOLFSSL_REPRODUCIBLE_BUILD=yes -DCMAKE_INSTALL_PREFIX:PATH=$PWD/cmake_repro && cmake --build b2 && cmake --install b2
diff -rq ac_repro cmake_repro
```
2021-12-23 09:22:47 -08:00
6ff1e0b037 cmake: correct libtool version, default to shared library, generate pkgconfig 2021-12-23 09:22:47 -08:00
c89b7d5f79 configure and cmake: Closing gap on options and output
cmake:
 * 32-bit and 16-bit mode flags
 * Add 4bit to AESGCM
 * Add align data
 * Encrypted Keys option
 * PKC12 option
 * Header installation cleanup

configure:
 * Add comment for `v5-RC9`
 * update CFLAGS to always be appended instead of mix of prepend and append
 * removed duplicate `ARC4` logic
2021-12-23 09:22:47 -08:00
63df8f0836 add fe_low_mem.c to wolfssl vs project and fix a couple warnings 2021-12-23 16:55:51 +00:00
40d5bd052f Merge pull request #4693 from embhorn/zd13433
Fix to init ctx in wc_Des3_SetKey
2021-12-23 07:41:13 -08:00
86e51b97e9 Merge pull request #4689 from haydenroche5/wolfengine_compression_fix
Fix usage of SSL_OP_NO_COMPRESSION that was breaking wolfEngine.
2021-12-23 10:47:30 +10:00
a5b3daf216 fix whitespace. 2021-12-22 17:34:06 -06:00
951eb72ecb fips-check.sh: update+streamline flavors -- add linuxv5-dev (checks out fips master same as old linuxv5-ready) , drop linuxv5-RC8, linuxv5-RC9, linuxv5-RC10, and the desupported/unbuildable fips-v3-ready; update linuxv5 and linuxv5-ready to use WCv5.0-RC11; use the term "flavor" consistently for the fips key (versus "version" or "platform"); cleanup to satisfy shellcheck. 2021-12-22 17:32:36 -06:00
a6ed5dc92d configure.ac: update fips with RC11. 2021-12-22 17:32:36 -06:00
b0a5b16068 api.c: fix logic in test_RsaDecryptBoundsCheck(). 2021-12-22 17:32:36 -06:00
29c18a110b Fix to init ctx in wc_Des3_SetKey 2021-12-22 17:05:58 -06:00
11e8d729c2 Merge pull request #4685 from SparkiDev/sp_gen_fix_1
SP gen: Regenerate
2021-12-22 15:02:03 -08:00
52754123d9 Call wc_SetSeed_Cb and wolfCrypt_SetPrivateKeyReadEnable_fips in wolfSSL_Init.
Additionally, remove wc_SetSeed_Cb calls applications (e.g. example client and
server), since they are now redundant.
2021-12-22 14:21:06 -08:00
8670e33baf Merge pull request #4651 from TakayukiMatsuo/tsip_sce 2021-12-22 15:00:32 -07:00
fd39197e4b retain same size for exported session 2021-12-22 14:28:42 -07:00
646ceb259a Fix usage of SSL_OP_NO_COMPRESSION that was breaking wolfEngine.
Replace instances of SSL_OP_NO_COMPRESSION with WOLFSSL_OP_NO_COMPRESSION in
ssl.c. Only define SSL_OP_NO_COMPRESSION when using the compatibility layer.
Before these changes, wolfEngine builds were failing due to
SSL_OP_NO_COMPRESSION being defined in both wolfSSL and OpenSSL headers.
2021-12-22 10:23:51 -08:00
38214bd083 Disable the FIPS consistency checks in ECC and DH for key generation by default. 2021-12-22 10:06:19 -08:00
8d4c22abda Merge pull request #4687 from julek-wolfssl/asn-template-var-init
`items` needs to be initialized as the compiler complains
2021-12-22 08:58:54 -08:00
9d137668c7 Merge pull request #4675 from julek-wolfssl/openssh-8.8
Fix macro name conflicts with openssh
2021-12-22 08:31:36 -08:00
713c4afcb4 Fix missing include ws2tcpip.h for VS build 2021-12-22 09:26:22 -06:00
8435eb4644 Add WC_ namespace to variable handling defines 2021-12-22 12:16:02 +01:00
618599656f items needs to be initialized as the compiler complains 2021-12-22 10:42:48 +01:00
ea432f45cd Merge pull request #4686 from SparkiDev/fe448_cast
Curve448: add casts for Windows
2021-12-21 22:21:25 -08:00
cd96330f2a Integrate Renesas TSIP specific code into Renesas common logics 2021-12-22 13:18:32 +09:00
80e291fcd1 Curve448: add casts for Windows 2021-12-22 12:57:15 +10:00
dd9b1afb72 Remove magic numbers from WOLFSSL_ASN_TEMPLATE code (#4582)
* pkcs8KeyASN and other misc asn fixes

- Test fixes for testing with `USE_CERT_BUFFERS_1024`

* intASN

* bitStringASN

* objectIdASN

* algoIdASN

* rsaKeyASN

* pbes2ParamsASN

* pbes1ParamsASN

* pkcs8DecASN

* p8EncPbes1ASN

* rsaPublicKeyASN

* dhParamASN

* dhKeyPkcs8ASN

* dsaKeyASN

* dsaPubKeyASN

- Add `wc_SetDsaPublicKey` without header testing

* dsaKeyOctASN

* rsaCertKeyASN

* eccCertKeyASN

* rdnASN

* certNameASN

* digestInfoASN

* otherNameASN

* altNameASN

* basicConsASN

* crlDistASN

* accessDescASN

* authKeyIdASN

* keyUsageASN

* keyPurposeIdASN

* subTreeASN

* nameConstraintsASN

* policyInfoASN

* certExtHdrASN

* certExtASN

* x509CertASN

* reqAttrASN

* strAttrASN

* certReqASN

* eccPublicKeyASN

* edPubKeyASN

* ekuASN

* nameASN

* certExtsASN

* sigASN

* certReqBodyASN_IDX_EXT_BODY

* dsaSigASN

* eccSpecifiedASN

* eccKeyASN

* edKeyASN

* singleResponseASN

* respExtHdrASN

* ocspRespDataASN

* ocspBasicRespASN

* ocspResponseASN

* ocspNonceExtASN

* ocspRequestASN

* revokedASN

* crlASN

* pivASN

* pivCertASN

* dateASN

* `wc_SetDsaPublicKey` was not including `y` in the sequence length

* All index names changed to uppercase

* Shorten names in comments

* Make sure extensions have sequence header when in cert gen

* Fix/refactor size calc in `SetNameEx`

* Pad blocks for encryption

* Add casting for increased enum portability

* Use stack for small ASN types
2021-12-22 11:28:01 +10:00
af0bcef0ef Merge pull request #4648 from embhorn/zd13365
Fix - wolfSSL_init should cleanup on failure of a component
2021-12-21 17:17:16 -08:00
bf612c075b Merge pull request #4668 from ejohnstown/kcapi-ecdsa
KCAPI ECDSA Memory
2021-12-21 15:32:33 -08:00
bf37845e2d Merge pull request #4680 from JacobBarthelmeh/certs
update certificate expiration dates and fix autorenew
2021-12-22 08:48:35 +10:00
395c5815bd SP gen: Regenerate
Put back in fix for SAKKE.
2021-12-22 08:24:33 +10:00
a6a071771b Merge pull request #4681 from SparkiDev/sp_arm64_p384_mr
SP ARM64: P-384 prime specific Montogmery Reduction
2021-12-21 13:50:33 -08:00
bbfcd0cac8 fix build warning with af_alg 2021-12-21 10:20:34 -08:00
d29cdd3537 fix for --enable-ip-alt-name build 2021-12-21 09:53:58 -08:00
d28cb70735 fix for ed25519 client cert generation 2021-12-21 09:03:54 -08:00
9f2419246e SP ARM64: P-384 prime specific Montogmery Reduction
Improves performance
2021-12-21 10:18:12 +10:00
c0f8fd5f5d update certificate dates and fix autorenew 2021-12-20 16:04:05 -08:00
6b47954d58 Merge pull request #4670 from julek-wolfssl/krb5-missing-api
Missing config for krb5 1.16.1
2021-12-20 15:54:41 -08:00
3644d97dd8 Merge pull request #4613 from SparkiDev/sp_div_max
SP math all: div handling of length of dividend
2021-12-20 15:10:35 -08:00
360a513696 Merge pull request #4553 from SparkiDev/sp_mont_inv_order_fix
SP: fix when mont_mul_order is defined
2021-12-20 15:09:08 -08:00
463d050d3d Merge pull request #4678 from dgarske/nightly
Nightly fixes: PK with no AES and OCSP test with DTLS
2021-12-21 09:00:22 +10:00
0ce9703768 Merge pull request #4666 from SparkiDev/ecc_enc_mem
ECC: better protection when using encrypted memory
2021-12-20 14:48:13 -08:00
bb306d14b7 Merge pull request #4643 from kareem-wolfssl/zd13328
Fix building with OPENSSL_EXTRA defined and NO_WOLFSSL_STUB not defined.
2021-12-21 08:02:17 +10:00
d588437504 Merge pull request #4677 from anhu/oqs_to_pqc
--with-liboqs now defines HAVE_LIBOQS and HAVE_PQC
2021-12-20 13:00:30 -08:00
d8b58b8b05 Put both DigiCert Global Root CA and GlobalSign Root CA into the Google CA list. Fixes --enable-dtls --enable-ocsp ./scripts/ocsp.test`. 2021-12-20 11:47:34 -08:00
ebc64db7d0 Fix for --enable-pkcallbacks --disable-aes --disable-aesgcm. 2021-12-20 10:17:50 -08:00
b290e8089c Merge pull request #4672 from SparkiDev/sp_c_mont_red
SP C: specific Montgomery reduction code for P256 and P384
2021-12-20 09:50:54 -08:00
79f6301521 Add error for case of user defining HAVE_PQC without HAVE_LIBOQS. 2021-12-20 12:42:09 -05:00
7d4c13b9a4 --with-liboqs now defines HAVE_LIBOQS and HAVE_PQC
AKA: The Great Rename of December 2021
2021-12-20 11:48:03 -05:00
6d2da74c21 Merge pull request #4625 from dgarske/zd13208
Fix for PKCS7 verify to handle content type OID with indef BER encoding
2021-12-20 14:49:59 +10:00
ce4f436d0f Merge pull request #4587 from SparkiDev/dis_algs_fix_1
Disable algorithms: fixes
2021-12-19 20:12:30 -08:00
2477574a69 Fix for PKCS7 verify to handle pkcs7-data content type OID with indef BER encoding. ZD13208 2021-12-17 14:24:35 -08:00
ab9eda636a Merge pull request #4671 from lealem47/remove-n
Removing extra \n from WOLFSSL_LEAVE and WOLFSSL_ENTER
2021-12-17 14:04:42 -08:00
b45f1ed761 KCAPI ECDSA Memory
Use page aligned memory when using ECDSA signing and verify.
2021-12-17 11:11:16 -08:00
97830b81d6 Merge pull request #4674 from anhu/uninitialized
Fix unitialized usage
2021-12-17 10:51:43 -08:00
771647615a Merge pull request #4669 from douzzer/rehab-configure-fips
FIPS configure cleanup
2021-12-17 08:58:44 -08:00
9cc1624023 Fix unitialized usage 2021-12-17 11:55:08 -05:00
2f0b451545 Merge pull request #4673 from julek-wolfssl/should-retry-fix
Fix `test_wolfSSL_BIO_should_retry` test
2021-12-17 08:16:16 -07:00
21a5a571e8 Fix test_wolfSSL_BIO_should_retry test
When `OPENSSL_COMPATIBLE_DEFAULTS` is defined then `SSL_MODE_AUTO_RETRY` is set on context creation. For this test we need to clear this mode so that the `WOLFSSL_CBIO_ERR_WANT_READ` can propagate up to the user.
2021-12-17 12:32:25 +01:00
bd515cd3a6 Merge pull request #4637 from SparkiDev/sp_c32_rsa
SP C RSA: normalize tmpa after conditionally adding p
2021-12-16 18:54:28 -08:00
6cac0ea5a9 SP C: specific Montgomery reduction code for P256 and P384
Improves performance of 32-bit and 64-bit SP C code.
2021-12-17 12:00:16 +10:00
5c6bd8c2c9 configure.ac: in fips v5 setup, consider HAVE_AES{CCM,CTR,GCM,OFB}_PORT when auto-setting -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB; refactor KCAPI options for readability and correctness. 2021-12-16 17:03:01 -06:00
0b2b218de7 ECC: better protection when using encrypted memory
Added new ECC scalar multiplication implementation.
2021-12-17 08:30:45 +10:00
a79440b95a Removing extra \n from WOLFSSL_LEAVE and WOLFSSL_ENTER 2021-12-16 13:30:43 -07:00
f889916fae ssl.c: fix C++ invalid conversion in wolfSSL_sk_X509_INFO_value(). 2021-12-16 13:29:17 -06:00
e35c3c0d71 wolfcrypt/src/wc_port.c: fix whitespace. 2021-12-16 13:01:01 -06:00
cf16480c85 configure.ac: fix hard tabs, and fix fips "v5-ready" that should have been "v5-dev". 2021-12-16 13:00:10 -06:00
b7307e0ca5 ecc.c: small stack refactor for mp_int on the stack in wc_ecc_gen_deterministic_k(). 2021-12-16 13:00:10 -06:00
fed5eb1d94 ecc.c: fix a deadcode.DeadStores warning in wc_ecc_gen_deterministic_k(). 2021-12-16 13:00:10 -06:00
b6b12fe946 configure.ac: fips cleanup: drop flavor keys "v5-REL" (confusing); drop "v3" aka "v3-ready" (no longer buildable); add flavor "v5-dev" aka "dev"; refactor the "v5*" case of the FIPS setup switch to impose feature locks for v5 and v5-ready, but allow feature overrides with the new v5-dev; fix a debugging echo in the v2 case added in 1c27654300. 2021-12-16 13:00:10 -06:00
dec78169bf Merge pull request #4658 from julek-wolfssl/apache-2.4.51
Add Apache 2.4.51 support
2021-12-16 08:52:10 -08:00
ea2245c4d1 Merge pull request #4656 from JacobBarthelmeh/SanityChecks
sanity check before reading policy constraint
2021-12-16 08:42:19 -08:00
424bd2d73d Merge pull request #4599 from julek-wolfssl/issue-4593
Add WOLFSSL_FORCE_AUTO_RETRY option: force retrying of network reads
2021-12-16 08:42:07 -08:00
3bd737b9ef Merge pull request #4665 from miyazakh/sce_fsp_update_v3p5 2021-12-16 09:39:13 -07:00
7699d92935 Merge pull request #4664 from anhu/Fix_ENCRYPT_LEN
Do not let anything override HAVE_LIBOQS when setting ENCRYPT_LEN
2021-12-16 07:51:32 -08:00
44cc9e4824 Fix - wolfSSL_init should cleanup on failure of a component 2021-12-16 09:50:50 -06:00
afa6237f56 Add WOLFSSL_FORCE_AUTO_RETRY option: force retrying of network reads 2021-12-16 15:33:30 +01:00
d5783d1eaa Missing config for krb5 1.16.1 2021-12-16 14:35:39 +01:00
017d6cf464 Simplify error queue macros 2021-12-16 12:39:58 +01:00
e78f7f734e Add Apache 2.4.51 support
- Define `OPENSSL_COMPATIBLE_DEFAULTS` and `WOLFSSL_NO_OCSP_ISSUER_CHECK` for Apache config
- Fix `SSL_set_timeout` to match OpenSSL signature
- Implement `pkey` in `X509_INFO`
- Detect attempt to connect with plain HTTP
- Implement `wolfSSL_OCSP_request_add1_nonce`
- Set `ssl->cipher.bits` when calling `wolfSSL_get_current_cipher`
- Use custom flush method in `wolfSSL_BIO_flush` when set in BIO method
- Set the TLS version options in the `ssl->options` at the end of ClientHello parsing
- Don't modify the `ssl->version` when in a handshake (`ssl->msgsReceived.got_client_hello` is set)
- `wolfSSL_get_shutdown` returns a full bidirectional return when the SSL object is cleared. `wolfSSL_get_shutdown` calls `wolfSSL_clear` on a successful shutdown so if we detect a cleared SSL object, assume full shutdown was performed.
2021-12-16 12:39:38 +01:00
fa913f797a Merge pull request #4657 from SparkiDev/sakke_cond_add
SAKKE: fixup cond add to use all words
2021-12-16 07:40:13 +01:00
63ade421c1 fix redundat #ifdef 2021-12-16 09:30:21 +09:00
bd7e19b8fe Merge pull request #4639 from JacobBarthelmeh/ECC
deterministic ECC sign edge case fix and add variant
2021-12-16 08:48:37 +10:00
abe8696852 Merge pull request #4642 from cconlon/pubKeyDerFromX509
Add wc_GetPubKeyDerFromCert()
2021-12-15 14:30:58 -08:00
7975ead1af Do not let anything override HAVE_LIBOQS when setting ENCRYPT_LEN because oqs wants biggest value. 2021-12-15 14:48:50 -05:00
e1cee463b6 Merge pull request #4662 from douzzer/20211214-fixits
20211214 fixits
2021-12-15 10:47:50 -08:00
463118005f Merge pull request #4663 from ejohnstown/revert-pr
Revert configure.ac PR
2021-12-15 12:33:19 -06:00
8688bd43f1 Revert "Swap v5-ready (exception) and v5, add the wildcard back in for all non-ready cases"
This reverts commit 23fbf2e786.
2021-12-15 10:24:05 -08:00
1b6e0c45d0 Merge pull request #4660 from kaleb-himes/FIPS_READY_KCAPI_FOLLOWUP
Swap v5-ready (exception) and v5, add the wildcard back in for all non-ready cases
2021-12-15 10:16:33 -08:00
5172130287 add wc_GetPubKeyDerFromCert(), get pub key DER from DecodedCert 2021-12-15 11:04:52 -07:00
9af9d96cc7 Update README for FSP v3.5.0
fix tyo
2021-12-15 15:46:16 +09:00
a773cdfd5d pkcs12.c wc_d2i_PKCS12_fp(): mollify Visual Studio (false positives C4701 and C4703). 2021-12-14 18:33:24 -06:00
242eb2dcf1 wolfcrypt/src/pkcs12.c: fix scan-build deadcode.DeadStores gripe. 2021-12-14 18:08:54 -06:00
eb032e0266 configure.ac: refactor changes of 7cccaa98b7 around FIPS v5*. 2021-12-14 18:08:12 -06:00
23fbf2e786 Swap v5-ready (exception) and v5, add the wildcard back in for all non-ready cases 2021-12-14 13:28:35 -07:00
a6c7d56c32 Merge pull request #4655 from haydenroche5/wc_pkcs12_from_file
Add wc_d2i_PKCS12_fp to parse a PKCS #12 file directly in wolfCrypt.
2021-12-14 08:58:57 -08:00
994e370db3 SAKKE: fixup cond add to use all words 2021-12-14 12:02:59 +10:00
2359045b28 Merge pull request #4649 from kaleb-himes/KCAPI_FIPS_READY
The minimal changes needed to add KCAPI support with fips-ready
2021-12-13 17:33:03 -08:00
92d207a1cd Add wc_d2i_PKCS12_fp to parse a PKCS #12 file directly in wolfCrypt. 2021-12-13 15:28:34 -08:00
a2cf234100 sanity check before reading policy constraint 2021-12-13 14:32:46 -08:00
f5cd61e4f9 Merge pull request #4654 from embhorn/zd13375
Fix _sp_exptmod_base_2 to init vars.
2021-12-14 07:38:20 +10:00
7fd1b7aa51 Merge pull request #4650 from anhu/changelog
Mention falcon in the changelog
2021-12-13 10:37:07 -08:00
638d00f593 Merge pull request #4634 from danielinux/iotsafe-16bit-id
IoT-SAFE module: improvements and bug fixes
2021-12-13 11:33:19 -07:00
caf9024984 Merge pull request #4652 from douzzer/no-rsa-no-dh-no-dsa
WOLFSSL_ECC_NO_SMALL_STACK etc
2021-12-13 10:12:14 -08:00
9a85638ac3 Merge pull request #4647 from anhu/evp_pkey_dummy_falcon
In d2iGenericKey(), if a falcon key is encountered, make a dummy pkey.
2021-12-13 10:12:07 -08:00
53eb5d2e5a Fix _sp_exptmod_base_2 to init vars. 2021-12-13 10:16:55 -06:00
355b779a3e feature gating tweaks to better support --disable-rsa --disable-dh --disable-dsa. also a whitespace fix in ssl.c. 2021-12-11 14:08:04 -06:00
2193df1d62 add WOLFSSL_ECC_NO_SMALL_STACK. 2021-12-10 23:57:14 -06:00
41d4aafa3f Merge pull request #4645 from haydenroche5/parse_cert_public
Make wolfCrypt ASN cert parsing functionality public.
2021-12-10 18:27:18 -08:00
eec9649049 Mention falcon in the changelog 2021-12-10 16:54:13 -05:00
7cccaa98b7 The minimal changes needed to add KCAPI support with fips-ready 2021-12-10 14:44:20 -07:00
4c12f0be95 Only one call to wc_falcon_init() and comment on 300. 2021-12-10 16:40:41 -05:00
1d8ff70900 In d2iGenericKey(), if a falcon key is encountered, make a dummy pkey.
This allows apache-httpd to work without PQ-specific patch along with a previous
pull request.
2021-12-10 14:18:42 -05:00
6764e7c15f Make wolfCrypt ASN cert parsing functionality public.
Currently, the `ParseCert` function is only available if `WOLFSSL_ASN_API` is
defined to `WOLFSSL_API`. The only way to achieve this without enabling the
compatibility layer is to define `WOLFSSL_TEST_CERT`. There are users defining
this so that they can parse certs with wolfCrypt, even though this doesn't seem
to be the original intent of the define. This commit adds the function
`wc_ParseCert` to the public wolfCrypt API. It's simply a wrapper around
`ParseCert`. Similarly, this commit adds `wc_InitDecodedCert` and
`wc_FreeDecodedCert` to the public API, which are wrappers around
`InitDecodedCert` and `FreeDecodedCert`, respectively.
2021-12-10 10:43:28 -08:00
dde8cd9039 Merge pull request #4646 from julek-wolfssl/SSL_OP_NO_COMPRESSION-redef-error
Fix redefinition error of `WOLFSSL_OP_NO_COMPRESSION`
2021-12-10 08:46:43 -08:00
65a0b71994 Merge pull request #4641 from anhu/priv_key_check
Actually do a private/public key check for FALCON.
2021-12-10 06:53:35 -08:00
e40ba00ece Fix redefinition error of WOLFSSL_OP_NO_COMPRESSION 2021-12-10 15:11:11 +01:00
6b5fa9d0ae remove consistency check; let it fail elsewhere. 2021-12-09 17:12:42 -05:00
b921161309 Merge pull request #4633 from SparkiDev/tls13_expired
TLS13: Skip if expired rather than turning off resuming
2021-12-09 14:10:42 -08:00
dd0e3d6ebf Merge pull request #4644 from kareem-wolfssl/iotsafe_class
Fix compiling Iotsafe with C++ by avoiding reserved keyword 'class'.
2021-12-09 09:10:24 -08:00
494abde3eb Better casting. 2021-12-09 09:45:28 -05:00
f02763b088 Fixes after review comments 2021-12-09 11:23:44 +01:00
4764c4d6fa Merge pull request #4636 from JacobBarthelmeh/client
print out PEM of peer cert with example client
2021-12-08 20:04:57 -08:00
32014c69fd TLS 13 session ticket timeout: fixup checks
Check difference between now and ticket seen from encrypted ticket
against timeout.
2021-12-09 12:43:30 +10:00
6da0cc1ced Merge pull request #4600 from dgarske/cust_oid
Support for Custom OID in subject and CSR request extension
2021-12-09 11:24:30 +10:00
4200cf1b4d Fix compiling Iotsafe with C++ by avoiding reserved keyword 'class'. 2021-12-08 17:17:58 -07:00
376be0f66a Fix building with OPENSSL_EXTRA defined and NO_WOLFSSL_STUB not defined. 2021-12-08 16:51:51 -07:00
7022eb6f89 Actually do a private/public key check for FALCON. 2021-12-08 18:04:11 -05:00
dac0c21989 Merge pull request #4640 from anhu/prevent_stack_corruption
Pass in pointer to a local size_t var, not word32 var to prevent stack corruption
2021-12-08 14:44:07 -08:00
cf0d3263ac Merge pull request #4628 from julek-wolfssl/issue-4623
Handle an `EPIPE` error from the socket
2021-12-09 08:08:56 +10:00
74442605fa Pass in pointer to a local size_t var, not word32 var to prevent stack corruption. 2021-12-08 16:01:52 -05:00
ad078a7358 adjust macro guard in example client 2021-12-08 13:45:37 -07:00
0446d93285 add deterministic k variant for ECC to enable all 2021-12-08 10:49:17 -07:00
dfce101b5b deterministic ECC sign edge case fix and add variant 2021-12-08 09:54:47 -07:00
dd0e1226b7 Merge pull request #4638 from miyazakh/sce_protect_iar_compiler 2021-12-08 09:50:16 -07:00
081d28f556 better handling for global index
fix function proto type definition
2021-12-08 11:42:23 +09:00
3b65a4876f SP C RSA: normalize tmpa after conditionally adding p
Numbers in a word get too big for fast mul implementation when not
normalized.
Only affects RSA keys where p < q.
2021-12-08 11:25:20 +10:00
9a07b3af9b print out PEM of peer cert with example client 2021-12-07 14:07:47 -07:00
8609d98122 Merge pull request #4635 from julek-wolfssl/PrintPubKeyEC-wrong-free
Return early on failed `key` init
2021-12-07 13:28:53 -07:00
223f25149b Return early on failed key init 2021-12-07 18:11:19 +01:00
96daf2bede Merge pull request #4632 from julek-wolfssl/PrintPubKeyEC-leak
`a` and `key` were not being freed => leak in `PrintPubKeyEC`
2021-12-07 07:20:05 -07:00
1cb8b34fba IoT-SAFE: minor fixes + doxygen for new API calls 2021-12-07 14:11:14 +01:00
9e73c324a4 iot-safe: Fixed debug printf, updated slot number for 16-bit demo 2021-12-07 14:11:14 +01:00
23982e4fb3 Fixed wolfIoT_ecc_keygen when key is stored during generation 2021-12-07 14:11:14 +01:00
b23d51ab78 Avoid looping on uart read after applet initialization fails 2021-12-07 14:11:14 +01:00
5da89c6275 Clear meaning for the return value of iotsafe_gen_keypair 2021-12-07 14:11:14 +01:00
4d483b0a28 iotsafe: allow init to continue with empty response 2021-12-07 14:11:13 +01:00
29e20eeadc Fix to rebase branch on current master 2021-12-07 14:11:13 +01:00
e551f439f4 Reworked expect_tok to fix NULL dereferences 2021-12-07 14:11:13 +01:00
0c0f36d67d IoT-SAFE: Minor fixes
- reverted length change in put public operation
- Loading CA from IoT-SAFE file slot in 16bit demo
2021-12-07 14:11:13 +01:00
2646747f2a Fixed 8bit variable overflow/useless code 2021-12-07 14:11:13 +01:00
0621ba061b Multiple fixes for IoT-SAFE
- Tested with a different SIM:
  - 16bit IDs
  - Directly retrieving public key from keygen function
  - larger response buffers (up to 256 bytes in ReadFile)
  - Fixed hardcoded length in ID buffers
2021-12-07 14:11:13 +01:00
2f17a7e626 Support longer-than-8bit IDs for IoTSAFE key/file slots 2021-12-07 14:11:13 +01:00
574d171357 Fix leak when mp_int = 0 in integer.c 2021-12-07 12:46:24 +01:00
85ec6054c6 TLS13: Skip if expired rather than turning off resuming 2021-12-07 13:58:38 +10:00
9f6aa36866 Merge pull request #4629 from dgarske/zd13337
Additional checking for side on TLS messages
2021-12-07 10:13:44 +10:00
e1b7363647 Fixes from peer review. 2021-12-06 16:12:07 -08:00
261d305b32 Merge pull request #4627 from cconlon/fipsOsSeed 2021-12-06 16:06:46 -08:00
d5c27fca7d Merge pull request #4626 from JacobBarthelmeh/certs
add human readable string of IP
2021-12-07 08:23:31 +10:00
579056a2f3 Subject raw should be populated with WOLFSSL_CERT_EXT. 2021-12-06 14:19:32 -08:00
e45c33a771 Merge pull request #4624 from miyazakh/jenkins_qt_failure 2021-12-06 09:53:34 -07:00
5107f6b752 Merge pull request #4630 from douzzer/20211204-nits
20211204 nits
2021-12-06 08:24:17 -08:00
96b8b11fba a and key were not being freed => leak in PrintPubKeyEC 2021-12-06 12:03:02 +01:00
30b68060fb configure.ac: fix whitespace; client.c: make gcc 5.4.0 -Wmaybe-uninitialized happy. 2021-12-04 00:57:49 -06:00
54c3e0ac73 Additional checking for side on TLS messages. ZD13337 2021-12-03 11:49:08 -08:00
e4bd5d9046 Handle an EPIPE error from the socket
Issue reported in https://github.com/wolfSSL/wolfssl/issues/4623
2021-12-03 17:44:53 +01:00
9eabf16ed8 fix redefinition of OS_Seed error with FIPS Ready on some compilers 2021-12-02 17:01:11 -07:00
1ec86ee4cc add human readable string of IP 2021-12-02 16:04:58 -07:00
b4c6140b64 Merge pull request #4442 from julek-wolfssl/kerberos
Add Kerberos 5 support
2021-12-02 09:07:34 -08:00
baee7bace4 Merge pull request #4584 from ethanlooney/nxp_se050_curve25519
Added curve25519 support for NXP SE050
2021-12-02 02:47:36 -08:00
a5bd6cde8d fix nigtly jenkins Qt Job failure 2021-12-02 16:37:48 +09:00
48b15b0dfb Merge pull request #4616 from SparkiDev/sp_int_mips32
SP math all: MIPS asm fix
2021-12-01 16:16:14 -08:00
9f611e8b80 Merge pull request #4589 from JacobBarthelmeh/native-lwip
Native LwIP support update
2021-12-01 10:37:13 -08:00
5c172ca955 Merge pull request #4622 from douzzer/fix-wolfsentry-build
wolfsentry fixes re HAVE_EX_DATA and wolfsentry_sockaddr
2021-12-01 08:16:07 -08:00
d06ada2ccc Merge pull request #4610 from julek-wolfssl/nginx-1.21.4
Add support for Nginx 1.21.4
2021-12-01 22:27:12 +10:00
aac1b406df Add support for Nginx 1.21.4
- Add KEYGEN to Nginx config
- Check for name length in `wolfSSL_X509_get_subject_name`
- Refactor `wolfSSL_CONF_cmd`
- Implement `wolfSSL_CONF_cmd_value_type`
- Don't forecfully overwrite side
- `issuerName` should be `NULL` since the name is empty
2021-12-01 09:49:52 +01:00
32db20143c wolfssl/test.h: fix --enable-wolfsentry CFLAGS=-pedantic. 2021-11-30 23:40:30 -06:00
3f65916f3a HAVE_EX_DATA: fix wolfssl/ssl.h and tests/api.c to build -DHAVE_EX_DATA but -UOPENSSL_EXTRA. 2021-11-30 23:39:16 -06:00
7b5b4015f6 Merge pull request #4621 from dgarske/zd13303 2021-11-30 21:04:41 -06:00
43ac0d3684 adjust test file for pritnf and test_pass 2021-11-30 16:41:02 -07:00
b69a1c860c Merge pull request #3996 from cconlon/pkcs7_detachedhash
adjust PKCS7_VerifySignedData to correctly verify precomputed content hash with detached signature
2021-11-30 12:46:46 -08:00
a0300f7ab0 Fixes for ECDSA_Size. If group is unknown set to -1, otherwise defaults to first ECC index. Fix the signature size calculation to use our existing enum and calculation logic. ZD13303 2021-11-30 12:33:49 -08:00
1e74c6f38d Merge pull request #4620 from JacobBarthelmeh/Testing
do not load example CA if not verifying peer
2021-11-30 12:17:58 -08:00
29517fd617 Merge pull request #4609 from danielinux/tls13_hkdf_callback
TLS 1.3: Add HKDF extract callback
2021-11-30 10:59:44 -08:00
6d4c067b72 Merge pull request #4607 from anhu/wolfcrypt_pq_benchmarks
Use wolfCrypt's benchmarking app to run the PQ algorithms.
2021-11-30 10:09:48 -08:00
0340b49ff9 do not load example CA if not verifying peer 2021-11-30 10:44:05 -07:00
d32f26de64 Merge pull request #4619 from kojo1/early_data
OpneSSL compat for SSL_read/write_early_data
2021-11-30 08:36:14 -08:00
d3d73f7a4e Merge pull request #4614 from SparkiDev/sp_exp_nct
SP math all: fix exponent bit count
2021-11-30 08:26:41 -08:00
37df78b082 Merge pull request #4615 from SparkiDev/mp_mulx
TFM: fix Intel MULX multiply
2021-11-30 08:26:17 -08:00
5a55baddad Merge pull request #4617 from SparkiDev/ecc_point_on_curve
ECC wc_ecc_point_is_on_curve: validate oridinates against prime
2021-11-30 08:25:47 -08:00
7a41089b12 Merge pull request #4618 from douzzer/wc-port-h-linuxkm-XSNPRINTF-XATOI
linuxkm wc_port.h macro scoping fix
2021-11-30 08:25:06 -08:00
78f4c84ee0 Merge pull request #4586 from SparkiDev/sp_gen_ecc_order
SP: fix range of k to be 1..n-1
2021-11-30 08:23:46 -08:00
c3b1d9f9e7 Cosmetic and prototypes changes after reviewer's comments 2021-11-30 10:06:54 +01:00
6af38a9f5b OpneSSL compat for SSL_read/write_early_data 2021-11-30 17:38:01 +09:00
a33ae21801 whitespace cleanups and portability/pedantic fixes 2021-11-29 23:58:39 -06:00
5fbdd2a2c0 wc_port.h: for linuxkm, move definitions of XSNPRINTF and XATOI macros outside the defined(BUILDING_WOLFSSL) gate, to prevent inclusion of stdio.h and stdlib.h from types.h when building application code. 2021-11-29 23:23:23 -06:00
567cd155ea ECC wc_ecc_point_is_on_curve: validate oridinates against prime 2021-11-30 14:17:41 +10:00
a7d538a82f SP math all: MIPS asm fix
Names $lo and $hi in register list are not supported with old GCC
compiler. Newer compiler also supports %lo and %hi.
2021-11-30 12:56:08 +10:00
9f6fd6abf9 TFM: fix Intel MULX multiply
Carry wasn't being handled properly.
2021-11-30 12:07:44 +10:00
e5e280b175 SP math all: fix exponent bit count
Only when using non-constant time implementation and modulus even.
2021-11-30 10:28:42 +10:00
a3d46bee32 SP math all: div handling of length of dividend
Fail when dividend is maximum size as we may be shifting left and
overflow when divisor is not on a word boundary.
2021-11-30 09:46:11 +10:00
f7c34d22e6 add calls to user callback and adjust formating 2021-11-29 15:56:00 -07:00
7221e06ff7 Merge pull request #4588 from miyazakh/sce_protect_mode_e2studio 2021-11-29 15:32:48 -07:00
9e2e0c06dc Merge pull request #4608 from miyazakh/esp_idf
Fix compile error on the latest ESP-IDF
2021-11-29 14:13:13 -07:00
80c16745c4 Merge pull request #4602 from embhorn/zd13296
Initialize global in TSIP port
2021-11-29 13:01:03 -08:00
8a2945fe66 More braces. 2021-11-29 15:56:44 -05:00
5aa8bc2983 Drop a brace. 2021-11-29 15:47:53 -05:00
c104ab2206 Merge pull request #4572 from SparkiDev/ecc_pub_decode
mp_sqrt: TonelliShanks algorithm doesn't handle zero
2021-11-29 12:27:36 -08:00
c78256702d Merge pull request #4604 from tmael/fix_cc_ecc
Fix Cryptocell ecc build
2021-11-29 11:01:33 -08:00
57fb5453cb Support for HKDF Extract callback 2021-11-29 14:51:13 +01:00
f6893789b9 add dummy_test_paths.h to include.am 2021-11-27 14:34:23 +09:00
a25c338007 fix build failures
update README to follow the latest ESP-IDF
2021-11-27 13:14:36 +09:00
fea438d07f Use wolfCrypt's benchmarking app to run the PQ algorithms. 2021-11-26 15:15:23 -05:00
fb4e39f00a addressed review comments prt1 2021-11-26 16:03:42 +09:00
b2c0bacb06 Fix Cryptocell ecc 2021-11-24 19:22:40 -08:00
ae0cefc48d Merge pull request #4603 from anhu/stop_OPENSSLEXTRA
Stop needlessly enabling ENABLED_OPENSSLEXTRA when enabling liboqs.
2021-11-24 13:46:31 -07:00
ffe7a84e3d Stop needlessly enabling ENABLED_OPENSSLEXTRA when enabling liboqs. 2021-11-24 14:09:19 -05:00
6d7e50d2ae Initialize global in TSIP port 2021-11-24 09:22:14 -06:00
be870e742d Edge case build fixes (cert gen only). 2021-11-23 15:12:48 -08:00
7396a0cb3a Resolves all peer review comments. Fixes to get Curve25519 working on real hardware. Regression testing fixes for ECC. 2021-11-23 15:03:53 -08:00
7524ededd3 Support for Custom OID in subject and CSR request extension:
* Adds new build option `WOLFSSL_CUSTOM_OID` for supplying a custom OID in a CSR
* Fixes in ASN template CSR generation.
* Fix to allow calling `wc_Ed25519PublicKeyToDer` and `wc_Ed448PublicKeyToDer` with NULL output buffer to get length only.
* Refactor of the certificate subject name encoding.
* Refactor of the OID's to consolidate.
* Improvements to the Domain Component API unit test.
ZD 12943
2021-11-23 09:51:13 -08:00
dcc2a2852c Merge pull request #4590 from JacobBarthelmeh/fuzzing
sanity check on pem size
2021-11-22 16:09:13 -08:00
f5239cc57e Merge pull request #4597 from cconlon/removeSwig
Remove swig wrapper
2021-11-22 15:31:40 -08:00
23e722be27 Merge pull request #4595 from masap/fix-linuxkm
Fix failure of make distclean when linuxkm is enabled
2021-11-22 12:01:21 -08:00
84be329ffb remove swig wrapper, now that we have dedicated Java and Python wrappers 2021-11-22 11:32:37 -07:00
89ed811e23 fix compile error when disabled SCEPROTECT 2021-11-22 21:36:02 +09:00
0de4136ad6 Rebase fixes 2021-11-22 13:10:55 +01:00
5fc2dadde1 Fix issue in wolfSSL_BN_rand_range causing random errors 2021-11-22 11:48:31 +01:00
1d7b2de074 Code review changes 2021-11-22 11:48:31 +01:00
3da810cb1b Implement OpenSSL API's
- `OBJ_DUP`
- `i2d_PKCS7`
- `BN_rshift1
- `BN_rshift` testing
- Add `--enable-krb`
2021-11-22 11:47:58 +01:00
e7c5f137be Implement BN_rand_range 2021-11-22 11:45:27 +01:00
82a9f74476 Compat updates
- implement `wolfSSL_PEM_X509_INFO_read`
- `wolfSSL_EVP_CipherUpdate` no-ops on `NULL` input
- add md4 support to `wolfSSL_EVP_MD_block_size` and `wolfSSL_EVP_MD_size`
2021-11-22 11:45:27 +01:00
ccbe184434 Implement CTS
Ciphertext stealing on top of CBC is implemented with `wolfSSL_CRYPTO_cts128_encrypt` and `wolfSSL_CRYPTO_cts128_decrypt` APIs
2021-11-22 11:45:27 +01:00
fa662c2ab1 AES_cbc_encrypt enc parameter flipped. 1 = encrypt 0 = decrypt
This change makes the `enc` parameter of `AES_cbc_encrypt` consistent with OpenSSL. This commit flips the meaning of this parameter now.
2021-11-22 11:45:27 +01:00
ace5d444a4 Fix failure of make distclean when linuxkm is enabled
$ make distclean
Making distclean in linuxkm
make[1]: Entering directory '/home/honma/git/wolfssl/linuxkm'
make[1]: *** No rule to make target 'distclean'.  Stop.
make[1]: Leaving directory '/home/honma/git/wolfssl/linuxkm'
make: *** [Makefile:6431: distclean-recursive] Error 1

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-22 05:50:38 +09:00
30a01a0758 Fix failure of check at commiting when linuxkm is enabled
Making check in linuxkm
make[2]: Entering directory '/home/honma/git/wolfssl/linuxkm'
make[2]: warning: -j13 forced in submake: resetting jobserver mode.
make[2]: *** No rule to make target 'check'.  Stop.
make[2]: Leaving directory '/home/honma/git/wolfssl/linuxkm'
make[1]: *** [Makefile:6431: check-recursive] Error 1
make[1]: Leaving directory '/home/honma/git/wolfssl'
make: *** [Makefile:6901: check] Error 2

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-22 05:50:38 +09:00
82eb23b300 addressed jenkins failures 2021-11-20 10:15:57 +09:00
5182e2a8c8 Merge pull request #4580 from kareem-wolfssl/minor_fixes
Check ssl->arrays in SendClientHello to avoid null dereference.  Allow building with fallthrough defined.
2021-11-19 16:55:01 -08:00
d00c7641ae addressed jenkins failure 2021-11-20 09:14:21 +09:00
f6c48bf7dc Merge pull request #4560 from kaleb-himes/OE30-OE31-non-fips-changes
OE30 and OE31 changes external to FIPS module for NetBSD builds
2021-11-19 15:49:30 -08:00
34346bab4f Merge pull request #4579 from JacobBarthelmeh/PKCS7
BER size adjustment with PKCS7
2021-11-19 14:49:03 -08:00
8de281c1d4 Fix minimum clang version for FALL_THROUGH. Not working properly before clang 11. 2021-11-19 15:16:56 -07:00
617668b9aa Merge pull request #4585 from kareem-wolfssl/encryptMacFix
Fix building Import/ExportOptions with HAVE_ENCRYPT_THEN_MAC undefined.
2021-11-19 13:45:16 -08:00
fd6d479888 Rework ssl and ssl->arrays NULL checks, and add to SendTls13ClientHello as well. 2021-11-19 14:19:27 -07:00
72d4dcce0f Fix updated FALL_THROUGH macro. Fix a couple of case statements and remove a trailing whitespace. 2021-11-19 14:13:02 -07:00
0772635972 Rework FALL_THROUGH definition to use fallthrough if defined. 2021-11-19 14:06:54 -07:00
930e1ac473 Check ssl->arrays in SendClientHello to avoid null dereference. Allow building with fallthrough defined. 2021-11-19 14:06:54 -07:00
5d49847147 sanity check on pem size 2021-11-19 13:55:03 -07:00
c3500fa24e Merge pull request #4581 from miyazakh/max_earlydata
add get_max_eraly_data
2021-11-19 09:42:01 -07:00
5a72fee3df Disable algorithms: fixes
WOLFSSL_PUBLIC_MP and disable algorithms didn't work because of api.c.
 - mp_cond_copy not available unless ECC compiled in
 - wc_export_int not available unless ECC compiled in
Enabling only DH and using SP with SP Math didn't work as the DH
parameters were too small.
sp_cmp is needed when only DH.
mp_set_int is was not available in SP math when RSA is not defined.
mp_set is close enough for the use cases.
Configure with SP and SP math but not RSA, DH and ECC didn't configure -
now default to small maths.
2021-11-19 16:56:33 +10:00
9a331d7072 update Readme 2021-11-19 15:35:06 +09:00
7e2fab6f4a warning with keil build and native lwip want read case 2021-11-18 22:58:50 -07:00
c84194ffc8 include renesas_cmn.h to am file 2021-11-19 14:44:45 +09:00
f50fcd918e support Renesas RA SCE protect mode on RA6M4 evaluation board 2021-11-19 14:22:16 +09:00
7e81372131 Merge pull request #4583 from dgarske/zd13242
Improve `ret` handling in the `ProcessPeerCerts` verify step.
2021-11-19 10:22:08 +10:00
af097401f2 SP: fix range of k to be 1..n-1
Was checking less than order - 2 then adding one.
i.e. 0..order-3 => 1..order-2
2021-11-19 09:40:26 +10:00
757f3b8105 Fix building Import/ExportOptions with HAVE_ENCRYPT_THEN_MAC undefined. 2021-11-18 16:06:22 -07:00
3054f20c6a Improve ret handling in the ProcessPeerCerts verify step. 2021-11-18 14:51:09 -08:00
2841b5c93b Merge pull request #3010 from kaleb-himes/ZD10203
Consistency in PP checking on use of WOLFSSL_CRYPTO_EX_DATA
2021-11-18 14:47:25 -08:00
9bc159a5ec addressed review comment 2021-11-19 07:24:46 +09:00
4324cf8f0a Correct cast from uint to uchar 2021-11-18 10:18:25 -07:00
5a85d63543 Added curve25519 support for NXP SE050
Reverted commented out lines from se050_port.h
2021-11-18 09:23:59 -07:00
e33156d0dc Merge pull request #4578 from kaleb-himes/OE33_NON_FIPS_CHANGES
OE33: Fix issues found by XCODE and add user_settings.h
2021-11-18 06:59:43 -08:00
d02e819e4c Merge pull request #4575 from SparkiDev/dh_enc_fix_2
ASN: DH private key encoding
2021-11-18 06:57:40 -08:00
618b9619c5 Merge pull request #4571 from anhu/init_sig_algs
Uninitialized var.
2021-11-18 22:46:37 +10:00
db3c0f7829 Merge pull request #4574 from masap/fix-asn1-integer-get
Fix invalid return value of ASN1_INTEGER_get()
2021-11-18 17:20:15 +10:00
483be08b1f add definition for early_data_status compat 2021-11-18 14:21:47 +09:00
6ba00f66cd Merge pull request #4573 from ejohnstown/fips-check-fix
Fix FIPS Check Script
2021-11-17 21:30:45 -06:00
b42a0d9712 native lwip update 2021-11-17 17:36:44 -07:00
7da0d524ff add get_max_eraly_data
support set/get_max_eraly_data compatibility layer
2021-11-18 09:07:32 +09:00
370570d19b ASN: DH private key encoding
Proper fix for sequence length when small keys.
2021-11-18 08:28:49 +10:00
4800db1f9d Enable max/min int test even when non 64bit platform
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-18 06:58:21 +09:00
cb3fc0c7ce Fix invalid return value of ASN1_INTEGER_get()
When DIGIT_BIT is less than SIZEOF_LONG * CHAR_BIT, ASN1_INTEGER_get() can
return invalid value. For example, with trailing program, ASN1_INTEGER_get()
unexpectedly returns -268435449 (0xf0000007) on i386.

On the i386 platform (DIGIT_BIT=28), the input value 0x7fffffff is separated
into 0xfffffff and 0x7 and stored in the dp array of mp_int. Previously,
wolfSSL_BN_get_word_1() returned 0xfffffff shifted by 28 bits plus 0x7, so this
patch fixed it to return 0xfffffff plus 0x7 shifted by 28 bits.

int main(void)
{
    ASN1_INTEGER *a;
    long val;
    int ret;

    a = ASN1_INTEGER_new();
    val = 0x7fffffff;
    ret = ASN1_INTEGER_set(a, val);
    if (ret != 1) {
        printf("ret=%d\n", ret);
    }

    if (ASN1_INTEGER_get(a) != val) {
        printf("ASN1_INTEGER_get=%ld\n", ASN1_INTEGER_get(a));
    }

    ASN1_INTEGER_free(a);

    return 0;
}

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-18 06:58:21 +09:00
ab0654bb64 remove something that slipped in 2021-11-17 16:38:30 -05:00
39edf8d206 pulled up a line. 2021-11-17 16:38:30 -05:00
49c7abb875 Changes suggested by SparkiDev. 2021-11-17 16:38:30 -05:00
5c48e74c7f 0xFF 2021-11-17 16:38:30 -05:00
0ae0b31509 The following config:
./configure --with-liboqs --enable-all --disable-psk --enable-intelasm --enable-aesni --enable-sp-math-all --enable-sp-asm CFLAGS="-O3"

Yeilds the following erorr:

src/internal.c: In function ‘DoServerKeyExchange’:
src/internal.c:24487:28: error: ‘sigAlgo’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
24487 |                         if (sigAlgo == ed448_sa_algo &&
      |                            ^

This fixes it.
2021-11-17 16:38:30 -05:00
38ec0bb31f Merge branch 'master' of github.com:wolfssl/wolfssl into OE33_NON_FIPS_CHANGES 2021-11-17 14:02:56 -07:00
995ef60ff1 Merge pull request #4577 from kaleb-himes/WINDOWS_AES_OFB_ON
Turn on AES-OFB mode in windows for FIPS=v5
2021-11-17 12:20:19 -08:00
37db5a9ab3 Add include.am(s) for new file(s) 2021-11-17 12:05:05 -07:00
ddf06b8161 BER size adjustment with PKCS7 2021-11-17 12:03:32 -07:00
f638df3575 Fix issues found by XCODE and add user_settings.h
Disable internal test settings by default
2021-11-17 11:00:56 -07:00
ef62fab4ea Update
1. WIN10 FIPS build should use version 5,2 now.
2. Update the v5-ready build ot use version 5,2.
3. Remove eol-whitespace from the benchmark source.
2021-11-17 09:19:34 -08:00
c7c682ba2a Move up to avoid breaking the patch applied for windows 2021-11-17 09:37:26 -07:00
dc6ec2b849 Turn on AES-OFB mode in windows for FIPS=v5 2021-11-17 09:22:58 -07:00
158ebcaa0a Add v5-RC10 to the list of allowed versions 2021-11-16 16:36:38 -08:00
a5e581506e Merge pull request #4570 from dgarske/android_keystore
Fixes for building wolfSSL with Android WPA Supplicant and KeyStore
2021-11-17 08:30:01 +10:00
e8e0bc0d49 Merge pull request #4552 from SparkiDev/sp_mod_exp_zero
SP: mod_exp with exponent of 0 is invalid
2021-11-16 08:29:13 -08:00
2b3ab855dd Fixes for building wolfSSL with Android WPA Supplicant and KeyStore. 2021-11-16 08:27:30 -08:00
33a6b8c779 Merge pull request #4531 from dgarske/cryptocb_aesccm
Added crypto callback support for AES CCM
2021-11-16 22:45:11 +10:00
ceae7d56fa Merge pull request #4551 from ejohnstown/aes-ofb
Add AES-OFB to FIPS boundary
2021-11-15 22:56:43 -06:00
cae3fcb9ce Merge pull request #4569 from masap/i386-segfault
dsa.c: fix error-path mp_clear()s on uninitialized mp_ints in wc_DsaSign() and wc_DsaVerify().
2021-11-15 22:51:23 -06:00
8606788198 SP: mod_exp with exponent of 0 is invalid
Don't allow exponenetiation by 0 as it is cryptographically invalid and
not supported by the implementation.
Also check for even modulus in mod_exp.
2021-11-16 11:27:26 +10:00
6086728968 Fix possible segfault occurs when mp_clear() is executed for uninitialized mp_int
If NULL is passed as the digest argument of wc_DsaSign(), mp_clear() will be
called before mp_init() is called. This can cause segmentation fault.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-16 09:57:02 +09:00
f621defefe Fix the segfault occurs when mp_clear() is executed for uninitialized mp_int on i386
test_wc_DsaSignVerify() passes the tests but causes an error.

free(): invalid pointer

If NULL is passed as the digest argument of wc_DsaVerify(), mp_clear() will be
called before mp_init() is called. On qemu-i386, the dp field of the mp_int
structure is non-null by default, which causes a segmentation fault when calling
mp_clear(). However, if WOLFSSL_SMALL_STACK is enabled, this problem does not
occur.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-16 09:56:56 +09:00
1559e92dca Add crypto callback AES CCM test case. 2021-11-15 16:22:10 -08:00
d3fc8c229a mp_sqrt: TonelliShanks algorithm doesn't handle zero
(0 * 0) mod p = 0.
Modular reduce n and shortcut when 0.
2021-11-16 09:23:07 +10:00
64407bbd7d Merge pull request #4564 from rizlik/unused_ret_value_fix
woflcrypt/src/rsa.c: check memory allocation return value
2021-11-16 08:56:47 +10:00
c80e63a822 Merge pull request #4566 from ejohnstown/fips-check
fips-check script update
2021-11-15 13:23:54 -06:00
13871cf547 Set RC10 to be the default v5 FIPS build. 2021-11-15 10:03:50 -08:00
0d465cf42f Add AES-OFB to FIPSv5 build as v5-RC10 (5,2) 2021-11-15 10:03:49 -08:00
ab74bbcfee Merge pull request #4567 from SparkiDev/sp_scripts_sync_1
SP sync: Missing update
2021-11-15 07:04:08 -08:00
79f18c7585 SP sync: Missing update 2021-11-15 08:33:14 +10:00
d6219567c1 Merge pull request #4565 from dgarske/spelling
Fixes for spelling errors
2021-11-15 08:20:41 +10:00
3384159cb9 Add WCv5.0-RC10 to fips-check script. Remove some new whitespace from sniffer. 2021-11-12 14:10:58 -08:00
25054bd87f Merge pull request #4538 from julek-wolfssl/sk_free-refactor
Refactor sk_*_free functions and stack type
2021-11-12 10:30:14 -08:00
a626a4fb02 Fixes for spelling errors. 2021-11-12 10:27:49 -08:00
600d562168 Merge pull request #4558 from anhu/falcon_bench
Add Falcon benchmarking.
2021-11-12 09:14:08 -08:00
4112cd4b99 Make stack type an enum 2021-11-12 14:48:17 +01:00
361975abbc Refactor sk_*_free functions
Use a single `wolfSSL_sk_pop_free` and `wolfSSL_sk_free` function that free's the stack and optionally free's the node content as well.
2021-11-12 13:55:37 +01:00
6547bcb44c Consistency in PP checking on use of WOLFSSL_CRYPTO_EX_DATA 2021-11-11 17:47:17 -07:00
2501aef34e Merge pull request #4562 from SparkiDev/cert_suite_check 2021-11-11 15:36:12 -08:00
af67692e4a Merge pull request #4559 from dgarske/sniffer_ht 2021-11-11 14:44:01 -08:00
4e20b93e72 Merge pull request #4556 from douzzer/updateFipsHash 2021-11-11 14:23:01 -08:00
c702dab988 Merge pull request #4561 from haydenroche5/wc_prf_fix 2021-11-11 13:03:58 -08:00
3ea4e35737 woflcrypt/src/rsa.c: check memory allocation return value 2021-11-11 16:25:03 +01:00
b5fd899113 TLS 1.2: check signature algo in ServerKeyExchange 2021-11-11 18:54:30 +10:00
2f29ca1092 Make fixes/improvements to TLS PRF code.
Make `wc_PRF` return an error if it doesn't find a corresponding hash for the
passed in hash type. Currently, if `wc_PRF_TLS` is called with `NO_OLD_TLS`
defined, it will do nothing but still return success. Make it return an error
instead. These problems were uncovered when running the wolfEngine unit tests
with wolfSSL 5.0.0 FIPS Ready, which defines `NO_MD5` and `NO_OLD_TLS`.
2021-11-10 15:19:43 -08:00
607a3bfaa7 Merge pull request #4554 from SparkiDev/mp_test_32bit
mp_test: when SP_INT_DIGITS is even calc was wrong
2021-11-10 15:07:43 -08:00
3c1deff611 Fix falcon bench cleanup case (should not free if init fails). Fix RSA key gen keySz with ./wolfcrypt/benchmark/benchmark -asym. 2021-11-10 15:03:44 -08:00
f2465e5688 include.am 2021-11-10 18:01:40 -05:00
242847760a More appropriate file names. 2021-11-10 17:55:46 -05:00
453404a864 Get the falcon keys into wolfssl/certs_test.h 2021-11-10 17:33:24 -05:00
6bb86cf4da OE30 and OE31 changes external to FIPS module for NetBSD builds 2021-11-10 15:16:21 -07:00
5fe078d7db sig1, sig5 --> sig 2021-11-10 16:52:05 -05:00
246d470956 Refactor to do proper memory management. 2021-11-10 16:42:48 -05:00
1cadf88f26 Fixes for sniffer and handling of out-of-order situations that can occur with a saturated link. 2021-11-10 13:37:21 -08:00
6165323829 Satisfy a jenkins test. 2021-11-10 15:29:09 -05:00
237b098ba5 Add Falcon benchmarking. 2021-11-10 14:53:35 -05:00
b2ba6f94af Merge pull request #4557 from LinuxJedi/doxygen-fixes
Fix up some Doxygen issues for 1.9
2021-11-10 11:29:47 -08:00
231546dacc Fix more Doxygen typos 2021-11-10 17:26:33 +00:00
afe8d74333 Fix up some Doxygen issues for 1.9
Some of the Doxygen content was not processed correctly by Doxygen.
This patch fixes all the issues found.
2021-11-10 16:20:13 +00:00
6d55f8e42a ssl.c: fixes for C++ pointer type hygiene. 2021-11-09 22:41:06 -06:00
ed0418c2a8 fix whitespace. 2021-11-09 22:17:38 -06:00
313d29f752 linuxkm: in module_hooks.c, refactor WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED gates to WOLFSSL_LINUXKM_SIMD_X86, and add updateFipsHash(). 2021-11-09 22:02:17 -06:00
341bd7bbbc mp_test: when SP_INT_DIGITS is even calc was wrong 2021-11-10 09:33:14 +10:00
8e0fdc64be Merge pull request #4522 from dgarske/static_eph
Fixes and refactor for static ephemeral key support
2021-11-10 08:22:51 +10:00
9a83842c29 Merge pull request #4536 from luizluca/refactor_nameconstraints-permit
ASN: refactor name constraints checks
2021-11-09 10:44:17 -08:00
bd0f6736c5 Merge pull request #4513 from masap/wpa_sup_dpp
Fix X509_PUBKEY_set() to show correct algorithm and parameters
2021-11-09 10:26:59 -08:00
fe172ed9c1 Fix for generation of ephemeral key if static ephemeral is not set. 2021-11-09 10:14:23 -08:00
eebed0cc1c Fix for possible ret may be used uninitialized. 2021-11-09 08:27:44 -08:00
df82b01e68 Added x448 static ephemeral support. 2021-11-09 08:27:42 -08:00
e91439f2eb Fixes for static ephemeral key support with threading and possible use after free. 2021-11-09 08:25:47 -08:00
4a04e56ac8 Fix to allow calls to get TLS session random even if wolfSSL_KeepArrays has not been called. 2021-11-09 08:23:19 -08:00
5dac25f470 Eliminate EIGHTK_BUF use in asn. Cleanup uses of 0 in set_verify for callback. 2021-11-09 08:23:19 -08:00
ff3179012d SP: fix when mont_mul_order is defined
Customer configuration that failed:
./configure --enable-cryptonly --enable-ecc --enable-sp=yes,asm
--disable-rsa --disable-dh --disable-sha3 --disable-sha224 --disable-md5
--disable-sha --disable-pkcs12 --disable-memory --disable-chacha
--disable-poly1305 --disable-sha512 --disable-sha384 --disable-aesgcm
--disable-aescbc --disable-aes --disable-rng CFLAGS="-DNO_SIG_WRAPPER
-DWOLFSSL_PUBLIC_MP -DECC_USER_CURVES -DNO_ECC_SIGN -DNO_ECC_DHE
-DNO_ECC_KEY_EXPORT"
2021-11-09 17:50:21 +10:00
1d9832c0de Merge pull request #4545 from douzzer/misc-fixes-20211105
global typographic and file mode fixes
2021-11-08 20:54:20 -08:00
97557ed29b linuxkm: add --enable-benchmark switch (default yes) and BUILD_BENCHMARK conditional to configure.ac to allow build with testwolfcrypt but without benchmark; change gate in wolfcrypt/benchmark/include.am from if !BUILD_LINUXKM to if BUILD_BENCHMARK. 2021-11-08 18:25:15 -06:00
03d5c4e6d3 test.c: fix whitespace. 2021-11-08 18:24:42 -06:00
18e487069b src/internal.c: fix typo introduced in earlier "typographic cleanup". 2021-11-08 18:24:08 -06:00
95bed1cdfd test.c: smallstack refactors for idea_test(), ed448_test(), and verifyBundle() (fixes various error-dependent leaks too). 2021-11-08 17:35:10 -06:00
25f74d4967 ssl.c: wolfSSL_UseALPN(): allocate char **token (2kB) on the heap, not the stack. 2021-11-08 17:35:10 -06:00
f8565f26e2 fixes for --disable-harden. 2021-11-08 17:35:10 -06:00
27d4bb304c test.c add smallstack refactor of pkcs7enveloped_run_vectors(). 2021-11-08 17:35:10 -06:00
26cc534dd2 wolfcrypt/test/test.c: fix memory leaks in pkcs7signed_run_[SingleShot]Vectors() added in smallstack refactor. 2021-11-08 17:35:10 -06:00
11ffb037ba linuxkm/module_exports.c.template: remove accidentally added MSC clause. 2021-11-08 17:35:10 -06:00
beebd1411d linuxkm/module_hooks.c: fix whitespace, and update code around WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE and updateFipsHash(). 2021-11-08 17:35:10 -06:00
8b3048a0ea wolfcrypt/test/test.c: smallstack refactors for pkcs7authenveloped_run_vectors(), pkcs7signed_run_vectors(), and pkcs7signed_run_SingleShotVectors(); typographic&whitespace cleanup. 2021-11-08 17:35:10 -06:00
59ec9fc285 configure.ac: refactor setup for --enable-reproducible-build; remove mutex between --enable-sp-math and --enable-sp-math-all (they can now coexist); whitespace cleanup. 2021-11-08 17:35:10 -06:00
0b4f34d62a typographic cleanup: fix whitespace, remove unneeded UTF-8, convert C++ comment constructs to C. 2021-11-08 17:35:05 -06:00
01335e2e1c ASN: refactor name constraints checks
Use the same logic for any type of name constraint.

It could be even cleaner if there were a altNamesByType[],
permittedNamesByType[] and excludedNamesByType[] in cert.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-11-08 20:29:18 -03:00
8f121e7752 file modes: clear inappropriate executable bits. 2021-11-08 17:28:11 -06:00
dd833807d8 Merge pull request #4523 from dgarske/nxp_se050_fixes
Fixes for NXP SE050 ECC create and key store id
2021-11-09 08:56:03 +10:00
5a4577eb6c Merge pull request #4541 from SparkiDev/mp_hexchar_asm
SP, TFM: fixes
2021-11-08 14:49:02 -08:00
49024b131e Merge pull request #4534 from JacobBarthelmeh/fuzzing
check size of values with sp_gcd
2021-11-09 08:40:21 +10:00
ee39fd079f Fix X509_PUBKEY_set() to show correct algorithm and parameters
When build with OpenSSL, trailing program outputs these messages.

algorithm: id-ecPublicKey
parameters: prime256v1

But with wolfSSL, X509_PUBKEY_get0_param() fails.
This patch fixes wolfSSL to display the same values as OpenSSL.

This program was extracted from wpa_supplicant in order to reproduce the
issue.

----------------
int main(void)
{
    EVP_PKEY *pkey;
    X509_PUBKEY *pub = NULL;
    ASN1_OBJECT *ppkalg, *poid;
    const ASN1_OBJECT *pa_oid;
    const uint8_t *pk;
    int ppklen, ptype;
    X509_ALGOR *pa;
    void *pval;
    char buf[100];
    const uint8_t data[] = {
        0x30, 0x39, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
        0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x22, 0x00, 0x03, 0x33, 0x6d, 0xb4, 0xe9, 0xab,
        0xf1, 0x1c, 0x96, 0x87, 0x5e, 0x02, 0xcc, 0x92, 0xaf, 0xf6, 0xe1, 0xed, 0x2b, 0xb2, 0xb7, 0xcc,
        0x3f, 0xd2, 0xb5, 0x4e, 0x6f, 0x20, 0xc7, 0xea, 0x2f, 0x3f, 0x42
    };
    size_t data_len = sizeof(data);
    const uint8_t *p;
    int res;

    p = data;
    pkey = d2i_PUBKEY(NULL, &p, data_len);
    if (!pkey) {
        fprintf(stderr, "d2i_PUBKEY() failed\n");
        return -1;
    }

    if (EVP_PKEY_type(EVP_PKEY_id(pkey)) != EVP_PKEY_EC) {
        fprintf(stderr, "invalid type\n");
        EVP_PKEY_free(pkey);
        return -1;
    }

    res = X509_PUBKEY_set(&pub, pkey);
    if (res != 1) {
        fprintf(stderr, "X509_PUBKEY_set() failed\n");
        return -1;
    }

    res = X509_PUBKEY_get0_param(&ppkalg, &pk, &ppklen, &pa, pub);
    if (res != 1) {
        fprintf(stderr, "X509_PUBKEY_get0_param() failed\n");
        return -1;
    }
    res = OBJ_obj2txt(buf, sizeof(buf), ppkalg, 0);
    if (res < 0 || (size_t) res >= sizeof(buf)) {
        fprintf(stderr, "OBJ_obj2txt() failed\n");
        return -1;
    }
    fprintf(stdout, "algorithm: %s\n", buf);

    X509_ALGOR_get0(&pa_oid, &ptype, (void *) &pval, pa);
    if (ptype != V_ASN1_OBJECT) {
        fprintf(stderr, "X509_ALGOR_get0() failed\n");
        return -1;
    }
    poid = pval;
    res = OBJ_obj2txt(buf, sizeof(buf), poid, 0);
    if (res < 0 || (size_t) res >= sizeof(buf)) {
        fprintf(stderr, "OBJ_obj2txt() failed\n");
        return -1;
    }
    fprintf(stdout, "parameters: %s\n", buf);

    X509_PUBKEY_free(pub);
    EVP_PKEY_free(pkey);
    return 0;
}

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-09 07:30:58 +09:00
4453001fac Merge pull request #4550 from kareem-wolfssl/gh4547
Fix doAsync warning in bench_ecc.
2021-11-08 13:24:18 -08:00
478f57b347 Merge pull request #4535 from kareem-wolfssl/zd13165
Fix building with NO_ECC_KEY_EXPORT.
2021-11-08 11:11:53 -08:00
67a11df15b Merge pull request #4548 from anhu/TlS
Fix capitalization.
2021-11-08 11:07:00 -08:00
2f1a37769e Fix doAsync warning in bench_ecc. 2021-11-08 11:42:05 -07:00
a28e44730c Fix capitalization. 2021-11-08 11:45:49 -05:00
3a9be7373f Merge pull request #4532 from embhorn/zd13139
Fix mem leak in HandleTlsResumption
2021-11-08 08:39:45 -08:00
d46b140250 Merge pull request #4544 from dgarske/hmachash 2021-11-05 15:11:07 -07:00
3941eea626 Fixes for peer review feedback. Improve the ECC key bit calculation. Improve the signature RS unsigned bin creation. 2021-11-05 14:53:20 -07:00
ba291b519d Merge pull request #4543 from julek-wolfssl/server-echo-return
Check correct var for `server.c` echo return.
2021-11-05 11:26:15 -06:00
d6264059ac Fix mem leak in HandleTlsResumption 2021-11-05 11:40:40 -05:00
e9aa76b34e Merge pull request #4542 from SparkiDev/dh_enc_fix
DH encoding: use correct length for inner sequence
2021-11-05 08:50:43 -07:00
4fe17cc143 Merge pull request #4527 from julek-wolfssl/zd13097
Fix a heap buffer overflow with mismatched PEM structure ZD13097
2021-11-05 08:50:28 -07:00
7fca031346 Remove duplicate code in wc_HmacFree (looks like past merge error). 2021-11-05 08:20:39 -07:00
6d89de4f11 Check correct var for server.c echo return. 2021-11-05 16:10:17 +01:00
d01f0d7a4c DH encoding: use correct length for inner sequence
Only affect small DH keys (like 512 bits).
2021-11-05 15:02:14 +10:00
dc911b94e7 SP, TFM: fixes
HexCharToByte must be cast to a signed char as a char is unsigned on
some platforms.
Redefine the __asm__ and __volatile__ for ICC and KEIL in sp_int.c
mp_test: don't use large bit lengths if unsupported.
2021-11-05 11:49:24 +10:00
ae84a2a326 Merge pull request #4293 from TakayukiMatsuo/set_min_proto
Add support for value zero as version parameter for SSL_CTX_set_min/max_proto_version
2021-11-04 14:59:34 -06:00
74a32e92eb Rename the internal "Hash" structure used by Hmac as it is too generic. 2021-11-04 11:56:00 -07:00
d8faa22194 Fix for ecc_def_curve_test test changes. 2021-11-04 11:54:09 -07:00
16afe7ff87 Merge pull request #4540 from anhu/forLealem
Changes suggest by Lealem after he tried the instructions.
2021-11-04 11:44:18 -07:00
6f9e501f45 Changes suggest by Lealem after he tried the instructions. 2021-11-04 11:00:18 -04:00
1faa9e66b6 Check wolfSSL_BIO_read return 2021-11-04 15:34:33 +01:00
60a86157c7 Fix building with NO_ECC_KEY_EXPORT. 2021-11-03 16:03:26 -07:00
ca72beb688 check size of values with sp_gcd 2021-11-03 16:56:45 -06:00
8f7df68869 Merge pull request #4533 from JacobBarthelmeh/Testing
additional checks on fp montgomery return value
2021-11-04 08:36:27 +10:00
b84edb5c67 Fixes for NXP SE050 testing with hardware. 2021-11-03 12:47:07 -07:00
7ca95bfaca additional checks on fp montgomery return value 2021-11-03 11:40:14 -06:00
d24bfb6bf7 Merge pull request #4530 from anhu/falcon-pqsig
The NIST round 3 Falcon Signature Scheme integration.
2021-11-03 09:35:01 -07:00
e9fbd94150 Fix for _ecc_validate_public_key and unused parameters for partial and priv. 2021-11-03 08:10:37 -07:00
495cac8ad7 Fixes for NXP SE050 key sizes and key id use. Related to #4526 2021-11-02 16:34:19 -07:00
dbe3e550b0 Correct the directory to pq in reference to wolfssl-examples 2021-11-02 15:35:39 -04:00
2abb2eae7d Changed NXP SE050 to not use symmetric offloading by default. If desired use WOLFSSL_SE050_HASH and WOLFSSL_SE050_CRYPT. 2021-11-02 12:00:24 -07:00
04f27551aa Some more sensible constants. 2021-11-02 14:59:31 -04:00
82c106be80 Added crypto callback support for AES CCM. 2021-11-02 09:53:55 -07:00
945e4a0885 Merge pull request #4529 from anhu/disable_dh
Fix for being able to build with LIBOQS but without DH
2021-11-02 08:54:40 -07:00
b652d2e631 Merge pull request #4524 from JacobBarthelmeh/Release
bump to dev version and touch up readme
2021-11-02 08:54:14 -07:00
81def76b18 The NIST round 3 Falcon Signature Scheme integration. 2021-11-02 11:12:10 -04:00
e1cc1e831e Fix for being able to build with LIBOQS but without DH
The following configuration yielded a compile error:
./configure --with-liboqs --disable-dh

This fixes bug reported on ZD13028.
2021-11-02 10:16:38 -04:00
23487a4532 Fix a heap buffer overflow with mismatched PEM structure ZD13097 2021-11-02 11:31:22 +01:00
2745f394e5 Merge pull request #4525 from cconlon/sslopno
TLS 1.3: check SSL_OP_NO_TLSv1_2 in TLS 1.3 clients
2021-11-02 09:40:59 +10:00
ac5e9e5e7c bump to dev version and touch up readme 2021-11-01 15:50:03 -06:00
7e01af0121 Merge pull request #4521 from JacobBarthelmeh/Release
prepare for release v5.0.0
2021-11-01 12:45:22 -07:00
7c3d1c7fbc update rpm spec 2021-11-01 12:24:53 -06:00
44219906e0 add kdf.c to cs+ project 2021-11-01 12:02:53 -06:00
6f18ba15b0 linuxkm: accommodate printk()->_printk() renaming in kernel 5.15+. 2021-11-01 11:49:56 -06:00
742492cb5e linuxkm/Makefile: fix module sign-file error handling. 2021-11-01 11:49:48 -06:00
d869c60605 prepare for release v5.0.0 2021-11-01 11:43:25 -06:00
f63a799f18 Fix for ECC create key public export size and key size bits. Fix for key store ID vs key ID. 2021-11-01 09:52:12 -07:00
99f44149eb Merge pull request #4520 from JacobBarthelmeh/Testing
add kdf.c file to IDE projects and cmake, few edge case fuzz reports, remove exe bit and c files
2021-11-01 08:35:11 -07:00
fb7baf28ca fix for xcode build and revert cmake change 2021-10-29 16:55:05 -06:00
6ba55edd50 fix async warnings 2021-10-29 14:37:39 -06:00
1d91ccb41b remove exe bit on example.c and server.c 2021-10-29 13:12:43 -06:00
03bc45c5b1 check if private key exists before using with private key check function 2021-10-29 10:51:24 -06:00
5ad580b233 Merge pull request #4517 from elms/cmake/kdf
cmake: Add `kdf.c` and `FIPS_V5`
2021-10-29 09:29:23 -07:00
fc01723407 Merge pull request #4516 from dgarske/asn_templ_genname
Fix for ASN template general name parsing
2021-10-29 23:14:50 +07:00
a6415493eb Merge pull request #4518 from douzzer/nestable-save-vector-registers
linuxkm: fixes for {save,restore}_vector_registers_x86().
2021-10-29 09:14:32 -07:00
8a8a6cf17f Merge pull request #4515 from kareem-wolfssl/zd13006
wc_scrypt: Check for underflow in blocksSz calculation.
2021-10-29 08:23:37 -07:00
ddf927ae41 linuxkm: fixes for {save,restore}_vector_registers_x86(). 2021-10-29 01:26:48 -05:00
49389f3074 cmake: Add kdf.c and FIPS_V5 2021-10-28 16:50:15 -07:00
e60c2201b2 Fix for general name parsing with WOLFSSL_ASN_TEMPLATE to use right length for general names and properly NULL terminate. 2021-10-28 16:13:58 -07:00
8775823fa0 handling edge cases with ecc import and decrypt functions 2021-10-28 17:11:56 -06:00
afad1374a3 check SSL_OP_NO_TLSv1_2 in TLS 1.3 enabled client 2021-10-28 16:30:02 -06:00
e10e3a92b8 add kdf.c to cmake build 2021-10-28 16:27:45 -06:00
9ec9ace7ea adding kdf.c to IDE builds 2021-10-28 16:19:18 -06:00
39c9fa96bc wc_scrypt: Code review feedback. 2021-10-28 15:02:53 -07:00
6b3ff9bae2 Merge pull request #4459 from julek-wolfssl/missing-ext
Add x509 name attributes and extensions to DER parsing and generation
2021-10-28 14:30:37 -07:00
0ecb81e74a wc_scrypt: Check for underflow in blocksSz calculation. 2021-10-28 14:18:22 -07:00
0a26335243 Merge pull request #4446 from ejohnstown/dtls-sizing
DTLS Sizing
2021-10-28 14:15:36 -07:00
2c42770eea Merge pull request #4508 from elms/cmake/tlsx
cmake: add SNI and TLSx
2021-10-28 14:03:59 -07:00
9c8e4f558c Explicit cast to int 2021-10-28 21:05:19 +02:00
adee6a86d1 Return the close notify error when expecting an error. 2021-10-28 20:53:58 +02:00
6bb7e3900e Merge pull request #4511 from JacobBarthelmeh/Testing
build fixes and PKCS7 BER encoding fix
2021-10-28 10:52:58 -07:00
e4e6242fde Merge pull request #4514 from SparkiDev/zephyr_fix_2
Fixes for Zephyr OS
2021-10-28 07:52:32 -07:00
8cba5dda17 Need to free x509 in tests 2021-10-28 14:50:53 +02:00
a738c16b2f Can't have macros within macros 2021-10-28 14:50:53 +02:00
7d6f8ea255 Update wrong email in gen script 2021-10-28 14:50:53 +02:00
ef37eeaeaa Code review fixes 2021-10-28 14:50:53 +02:00
a6be157628 Gate new AKID functionality on WOLFSSL_AKID_NAME 2021-10-28 14:50:53 +02:00
cb79bc5c46 Use same code for DecodeNsCertType with templates 2021-10-28 14:50:53 +02:00
842dba7946 Put address and postal code in WOLFSSL_CERT_EXT 2021-10-28 14:50:53 +02:00
2531cd961f Code review fixes 2021-10-28 14:50:53 +02:00
d9af698aa4 Implement raw AKID with WOLFSSL_ASN_TEMPLATE 2021-10-28 14:50:53 +02:00
c162196b27 Add x509 name attributes and extensions to DER parsing and generation
- Postal Code
- Street Address
- External Key Usage
- Netscape Certificate Type
- CRL Distribution Points
- Storing full Authority Key Identifier information
- Add new certificates to `certs/test` for testing
- Update WOLFSSL_ASN_TEMPLATE to match new features
2021-10-28 14:50:53 +02:00
894303be59 Make the wolfSSL_GetMaxFragSize parameter meaning consistent
- Add testing for sending as much app data as possible in a single DTLS record
2021-10-28 14:46:15 +02:00
623a84ed7b Fixes for Zephyr OS
time is not available.
Must include clock module
kdf.c missing from file list
2021-10-28 15:57:46 +10:00
7baffd9cf1 Merge pull request #4512 from douzzer/fips-check-linuxv5-uses-tag-WCv5.0-RC9
fips-check.sh update for WCv5.0-RC9 tags
2021-10-28 14:15:55 +10:00
0e18e9c404 Merge pull request #4502 from dgarske/async_test
Fixes for async TLS v1.3
2021-10-28 14:13:32 +10:00
55ee5e41db Merge pull request #4510 from SparkiDev/sp_cmp_c64
SP: change to sp_c32.c now in scripts caused changes to sp_c64.c
2021-10-27 18:50:13 -07:00
46ecf752b4 fips-check.sh: update wolfSSL remote & tag for linuxv5 aka linuxv5-RC9. 2021-10-27 18:17:57 -05:00
7cbfb27fa0 When adding cipherExtraData(), also account for TLSv1.3. 2021-10-27 15:12:31 -07:00
9f3f9c53fd Remove debugging printfs. Added some guards around DTLS and AEAD only things. 2021-10-27 15:12:31 -07:00
be3b6b47ef DTLS MTU fixes 2021-10-27 15:12:31 -07:00
77ebd11781 Updating based on MTU. Debugging prints. 2021-10-27 15:12:31 -07:00
be2e7e25ac Change the calculation for the extra data size in a DTLS message when checking to see if it'll fit in an MTU. (ZD12983) 2021-10-27 15:12:31 -07:00
c16f0db1b5 Fixes for handling WC_PENDING_E async responses in API unit test and examples. Resolves all issues with --enable-all --enable-asynccrypt --with-intelqa=. 2021-10-27 15:08:39 -07:00
a2ad01604f Fix devId, which must be -2 or INVALID_DEVID (not 0). Fix RSA doc typo. 2021-10-27 15:08:38 -07:00
eb56b652ca Fix for async TLS v1.3 with multiple WC_PENDING_E on client_hello and server_hello processing. Fix for not aligned NUMA. 2021-10-27 15:08:38 -07:00
34095dfd38 Merge pull request #4509 from dgarske/fix_sesstick
Fix for session ticket handling with error cases
2021-10-28 08:07:10 +10:00
f14bd41733 Merge pull request #4359 from douzzer/fipsv3-rebased
fips 140-3 linuxkm edition
2021-10-27 15:06:48 -07:00
f585dcd5ab adjust inSz with BER PKCS7 parsing 2021-10-27 15:12:04 -06:00
f413ff8b3a tls.c: TLSX_SupportedFFDHE_Set(): add handling for malloc failures. 2021-10-27 15:11:04 -05:00
00249b70ae fix for build with WOLFSSL_SGX 2021-10-27 13:22:45 -06:00
3a80ba6744 configure.ac: fixes for --enable-fips logic. 2021-10-26 22:51:59 -05:00
d105256330 fips-check.sh: remap fips-ready target to be ready flavor of 140-3, temporarily with FIPS_VERSION="master"; add fips-v3-ready target with FIPS_VERSION="v4.1.1"; add linuxv5|linuxv5-RC9 target to be updated after merge with tags. 2021-10-26 20:24:29 -05:00
d527b25034 configure.ac: FIPS: remap "ready" to be ready flavor of 140-3 (i.e. v5-ready); add v3-ready for ready flavor of 140-2. 2021-10-26 20:24:29 -05:00
8ee49cd50c linuxkm: in module_hooks.c:wolfssl_init(), add support for WC_RNG_SEED_CB. 2021-10-26 20:24:29 -05:00
071be3171e linuxkm: in module_hooks.c, fix logic+gating around CONFIG_MODULE_SIG and WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE. 2021-10-26 20:24:29 -05:00
9b5f8c84b0 Change the WIN10 project files to build for FIPS v5. 2021-10-26 20:24:29 -05:00
073bef579b linuxkm: add missing #ifdef OPENSSL_EXTRA around openssl includes in module_exports.c.template, and add an assert to configure.ac disallowing linuxkm+opensslextra. 2021-10-26 20:24:29 -05:00
ac8fbe3fbd ssl.c: fix a couple trivial rebase errors. 2021-10-26 20:24:29 -05:00
6e9f9c8fe8 Update the Windows user_settings for recent updates. 2021-10-26 20:24:29 -05:00
7915f6acb0 linuxkm: add the remainder of known needed SAVE_VECTOR_REGISTERS() wrappers to PK algs, add DEBUG_VECTOR_REGISTERS_{EXIT,ABORT}_ON_FAIL options; add a slew of ASSERT_SAVED_VECTOR_REGISTERS() to sp_x86_64.c (autogenerated, separate scripts commit to follow). 2021-10-26 20:24:29 -05:00
75df6508e6 Add a read enable for private keys when in FIPS mode. 2021-10-26 20:24:29 -05:00
1d07034fb9 linuxkm: fix line length in types.h, and add #ifdef _MSC_VER #pragma warning(disable: 4127) to work around MSC bug re "conditional expression is constant"; fix flub in ecc.c. 2021-10-26 20:24:29 -05:00
62c1bcae8a linuxkm: {SAVE,RESTORE}_VECTOR_REGISTERS() wrappers around RSA, DH, and ECC routines that might use sp-asm. 2021-10-26 20:24:28 -05:00
0eb76bcfd8 linuxkm: add missing RESTORE_VECTOR_REGISTERS() in wolfcrypt/src/poly1305.c:wc_Poly1305Update(). 2021-10-26 20:24:28 -05:00
85a8c06062 linuxkm: add DEBUG_VECTOR_REGISTER_ACCESS (debug feature switch), ASSERT_SAVED_VECTOR_REGISTERS, and ASSERT_RESTORED_VECTOR_REGISTERS macros, and move the fallback no-op definitions of the SAVE_VECTOR_REGISTERS and RESTORE_VECTOR_REGISTERS to types.h. also fixed several ASCII TAB characters in types.h. 2021-10-26 20:24:28 -05:00
e0395c6441 linuxkm: in wolfcrypt/src/sha{256,512}.c, remove {SAVE,RESTORE}_VECTOR_REGISTERS() wrappers around AVX implementations, as this needs to be refactored for efficiency and the underlying assembly is not yet kernel-compatible. 2021-10-26 20:24:28 -05:00
ad4c200cd2 linuxkm: wolfcrypt/src/memory.c: in {save,restore}_vector_registers_x86(), allow for recursive calls (some crypto calls are recursive). 2021-10-26 20:24:28 -05:00
fc73c6dbea linuxkm: fix Makefile to properly pivot module signature on CONFIG_MODULE_SIG==y; remove not-yet-kernel-compatible asm files from the ASFLAGS_FPU_DISABLE_SIMD_ENABLE list, matching the OBJECT_FILES_NON_STANDARD list, for clarity. 2021-10-26 20:24:28 -05:00
40e3cac695 Use correct value for pSz when setting the dhKeySize in the session. 2021-10-26 20:24:28 -05:00
f2c4567164 Like the public key, zero pad the front of the private key. 2021-10-26 20:24:28 -05:00
bc91187063 tls.c:TLSX_KeyShare_GenDhKey(): fix typo. 2021-10-26 20:24:28 -05:00
aca43cfe52 linuxkm/Kbuild: include -fno-omit-frame-pointer in HOST_EXTRACFLAGS, in case the target kernel has profiling enabled; remove the "always := $(hostprogs)" rule, as it doesn't work and causes warnings on kernel 5.10. 2021-10-26 20:24:28 -05:00
8bdae98a93 fips-check.sh: temporarily arrange for "linuxv5" to be an alias of "linuxv5-ready", to arrange for Jenkins testing of wolfcrypt code in the PR in FIPS mode. 2021-10-26 20:24:28 -05:00
a3435ca062 fips-check.sh: exit (fatal error) if git fails. 2021-10-26 20:24:28 -05:00
f1d43f6891 Add error code for the private key read lockout. 2021-10-26 20:24:28 -05:00
31f13a7f41 wolfcrypt/test/test.c: when HAVE_FIPS, wrap wc_MakeRsaKey() calls in infinite iteration while ret == PRIME_GEN_E, to inhibit nondeterministic failure mode from FIPS-limited _CheckProbablePrime() iteration. 2021-10-26 20:24:28 -05:00
490a1238a8 configure.ac: refactor AC_CHECK_FILES brought in by rebase, to fix warning. 2021-10-26 20:24:28 -05:00
b577984574 rsa.c: fix whitespace. 2021-10-26 20:24:28 -05:00
3fcdcbc1f9 Fix for RSA _ifc_pairwise_consistency_test to make the async blocking. 2021-10-26 20:24:28 -05:00
e61d88657d WOLFSSL_ASYNC_CRYPT: in EccSharedSecret(), don't try to wolfSSL_AsyncInit() if there's no priv_key to supply an asyncDev; in RSA _ifc_pairwise_consistency_test(), disable async to force blocking crypto. 2021-10-26 20:24:28 -05:00
303aa312a8 Fix the TLS v1.3 async key share support. Added WOLFSSL_NO_PUBLIC_FFDHE option to test without public FFDHE API's. 2021-10-26 20:24:28 -05:00
75e4c0869e DH: move declaration of wc_DhPublicKeyDecode() from dh.h to asn.h (it is defined in asn.c). 2021-10-26 20:24:28 -05:00
10304c9143 linuxkm: portability fix in aes.c for SAVE_VECTOR_REGISTERS() call ("embedding a directive within macro arguments is not portable"). 2021-10-26 20:24:28 -05:00
c0778e5ad9 gate access to wc_Sha512.devId on !NO_SHA2_CRYPTO_CB. 2021-10-26 20:24:28 -05:00
5d796ba06c settings.h: add WOLFSSL_MAKE_FIPS_VERSION(), WOLFSSL_FIPS_VERSION_CODE, and FIPS_VERSION_{LT,LE,EQ,GE,GT} macros; define NO_SHA2_CRYPTO_CB macro if HAVE_FIPS && FIPS_VERSION_LT(5,1); refactor other FIPS version dependencies in settings.h to use new macros. 2021-10-26 20:24:28 -05:00
0f05a71bfb linuxkm: refactor SAVE_VECTOR_REGISTERS() macro to take a fail clause as an argument, to allow the preprocessor to completely eliminate it in non-kernel builds, and for backward compat with WCv5.0-RC8. 2021-10-26 20:24:28 -05:00
6160da243d linuxkm: use EXPORT_SYMBOL_NS_GPL() for exports. 2021-10-26 20:24:28 -05:00
c2c2e5b4f5 tests/api.c: post_auth_version_cb(): add missing gating on !NO_ERROR_QUEUE for wolfSSL_ERR_get_error() test. 2021-10-26 20:24:28 -05:00
e4d075de20 src/internal.c: FreeX509(): remove redundant free of x509->CRLInfo. 2021-10-26 20:24:28 -05:00
61df408d70 configure.ac: fix handling of ENABLED_FIPS->REPRODUCIBLE_BUILD_DEFAULT=yes; take JNI back out of from enable-all feature set because it adds -DNO_ERROR_QUEUE to flags; fix typo in FIPS test for --with-max-rsa-bits setup. 2021-10-26 20:24:28 -05:00
32349749a6 internal.c: SendServerKeyExchange(): check retval from wc_DhGetNamedKeyParamSize(). 2021-10-26 20:24:28 -05:00
361559ca30 settings.h: set HAVE_PUBLIC_FFDHE as in configure.ac (FIPS v2 and SELFTEST) if it isn't already set. 2021-10-26 20:24:28 -05:00
342e319870 dsa.c: fix up comment spelling/typography in wc_MakeDsaKey(). 2021-10-26 20:24:28 -05:00
a5c03f65e3 tests/api.c: fix test_CryptoCb_Func() to not attempt signing op on ephemeral ECC keys. 2021-10-26 20:24:28 -05:00
1f6eb4648e configure.ac: remove WOLFSSL_VALIDATE_ECC_IMPORT and WOLFSSL_VALIDATE_ECC_KEYGEN from enable-all and enable-all-crypto feature sets. 2021-10-26 20:24:28 -05:00
7a4ec22953 pkcs7.c: further smallstack refactor of PKCS7_EncodeSigned(). 2021-10-26 20:24:28 -05:00
fb49d814c5 configure.ac and autogen.sh: fix warnings in configure.ac, and enable WARNINGS=all,error in autogen.sh. also, remove --verbose to avoid obscuring warning output. 2021-10-26 20:24:28 -05:00
f60cb94b82 wolfcrypt/src/include.am and src/include.am: don't disrupt modtimes of fips/async source files if they already exist. 2021-10-26 20:24:28 -05:00
ab4c96292b autogen.sh: disable WARNINGS=all until autotools config is fixed. 2021-10-26 20:24:28 -05:00
e894340a64 tls13.c: mac2hash(): accommodate scenario where all hashes are gated out of the build (peer review). 2021-10-26 20:24:28 -05:00
972c6c032e ssl.c: clean up MD5->SHA refactor of wolfSSL_LH_strhash() (peer review). 2021-10-26 20:24:28 -05:00
e9332c1ce4 autogen.sh: refactor to not disrupt modtimes of fips/async source files if they already exist. also, assert success on any file ops, and properly export WARNINGS to autoreconf. 2021-10-26 20:24:28 -05:00
255d2d650f rsa.c: add missing WOLFSSL_ASYNC_CRYPT clauses to _ifc_pairwise_consistency_test(). 2021-10-26 20:24:27 -05:00
87b965c964 include.am: in FIPS clauses, include wolfcrypt/src/aes_gcm_asm.S in src_libwolfssl_la_SOURCES when BUILD_AESNI, regardless of BUILD_INTELASM, as in the corresponding non-FIPS clause. 2021-10-26 20:24:27 -05:00
0f407b4bfc test.c: fix indirection flubs in _ASYNC_CRYPT parts of ecc_test_sign_vectors(). 2021-10-26 20:24:27 -05:00
f264741aa0 benchmark.c: fix -Wstringop-truncation in _ASYNC_CRYPT bench_stats_add(). 2021-10-26 20:24:27 -05:00
0231446006 configure.ac: don't warn about loading real async files if async.c is present and non-empty. 2021-10-26 20:24:27 -05:00
3745b1c9db linuxkm: fix clean rules/definitions to not pick up top level Makefile, and to clean up empty object directories. 2021-10-26 20:24:27 -05:00
8e131620ae .gitignore: add linuxkm/libwolfssl.lds 2021-10-26 20:24:27 -05:00
14f39f07a2 fips-check.sh: add linuxv5-ready (--enable-fips=v5-ready). 2021-10-26 20:24:27 -05:00
f9627e4b14 configure.ac: for --enable-fips, make v5 an alias for v5-RC8 (alias to be updated after newer lab-approved snapshots are tagged), and add v5-ready and a placeholder v5-REL. 2021-10-26 20:24:27 -05:00
5ef97acbab types.h: add back missing WC_HASH_TYPE_MAX to enum wc_HashType when HAVE_FIPS_VERSION <= 2 (now WC_HASH_TYPE_BLAKE2S, since SHAKE is now excluded from the enum). 2021-10-26 20:24:27 -05:00
40c32081bb types.h: rename STRINGIFY() macro to WC_STRINGIFY(). 2021-10-26 20:24:27 -05:00
e3989edd39 wolfcrypt/benchmark/benchmark.c: fix typo. 2021-10-26 20:24:27 -05:00
4a451caf7b src/sniffer.c: fix rebase errors. 2021-10-26 20:24:27 -05:00
834efe4ff6 fips-check.sh: update to test 140-3 using --enable-fips=v5-RC8 and the WCv5.0-RC8 version tags. 2021-10-26 20:24:27 -05:00
db26e0a40a Makefile.am: .build_params belongs in DISTCLEANFILES, not CLEANFILES. 2021-10-26 20:24:27 -05:00
9f36df44a4 wolfssl/wolfcrypt/types.h: define WOLFSSL_NOSHA512_224, WOLFSSL_NOSHA512_256, and WOLFSSL_NO_SHAKE256 in SELFTEST/FIPS<=v2 version of enum wc_HashType definition, to assure synchrony. 2021-10-26 20:24:27 -05:00
1c27654300 configure.ac and wolfssl/wolfcrypt/types.h: don't change wc_HashType for FIPS <= v2 (reverts commit 56843fbefd as it affected that definition); add -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256 to FIPS v2 and v3. 2021-10-26 20:24:27 -05:00
aa6ca43e91 api.c: skip test_wolfSSL_EVP_PBE_scrypt() when FIPS 140-3 (test uses impermissibly short HMAC key). 2021-10-26 20:24:27 -05:00
22f947edd6 configure.ac and wolfssl/wolfcrypt/asn_public.h: add --enable-fips=v5-RC8 for use with WCv5.0-RC8 codebase; add HAVE_FIPS_VERSION_MINOR, and refactor main $ENABLED_FIPS switch to set HAVE_FIPS_VERSION and if applicable HAVE_FIPS_VERSION_MINOR for use in subsequent tests and the main FIPS setup code; in asn_public.h, use HAVE_FIPS_VERSION_MINOR to exclude declaration of wc_RsaKeyToPublicDer() when building FIPS WCv5.0-RC8. 2021-10-26 20:24:27 -05:00
8c3cbf84f9 add missing gating around WOLFSSL_NO_SHAKE256, WOLFSSL_NOSHA512_224, and WOLFSSL_NOSHA512_256. 2021-10-26 20:24:27 -05:00
7b40cd6cef configure.ac: fips tweaks: add --enable-fips=disabled to allow non-fips build in a fips tree, for convenient testing; add ENABLED_SHAKE256=no override to fipsv5 setup; don't add an RSA_MAX_SIZE setting to AM_CFLAGS when FIPS, to avoid a conflict with old rsa.h. 2021-10-26 20:24:27 -05:00
083b97c5a3 tls.c: fix rebase error in TLSX_KeyShare_FreeAll(). 2021-10-26 20:24:27 -05:00
19b33d5a76 configure.ac: don't include rc2 in enable-all or enable-all-crypto (memory leaks). 2021-10-26 20:24:27 -05:00
b77000bcfb add smallstack codepath to ecc_test_sign_vectors(), and add missing rc2.h include to linuxkm/module_exports.c.template. 2021-10-26 20:24:27 -05:00
9e3fb73567 configure.ac: improvement for enable-all and enable-all-crypto:
remove haproxy from enable-all set, to avoid SECURE_RENEGOTIATION;

add enable-aescbc-length-checks to enable-all-crypto set, inadvertently omitted;

add enable-base16 to all (where it was implicit) and to all-crypto (where it was missing);

add ssh, rc2 and srp to all-crypto;

reorder the portion of the enable-all set that's common with enable-all-crypto, to have matching order.
2021-10-26 20:24:27 -05:00
fae342940c .gitignore: add .build_params. 2021-10-26 20:24:27 -05:00
d39d389c6e aes.c: in CheckAesGcmIvSize(), don't disallow GCM_NONCE_MIN_SZ for FIPS 140-3, i.e. always allow it. 2021-10-26 20:24:27 -05:00
b93a18b34e src/internal.c: in SendServerKeyExchange() case diffie_hellman_kea, #ifdef HAVE_SECURE_RENEGOTIATION, enlarge buffers.serverDH_Pub.buffer to accomodate larger new key replacing smaller old key, whether or not ssl->namedGroup is set (copy-paste of existing in !ssl->namedGroup path). 2021-10-26 20:24:27 -05:00
67db7b7f32 fixes for issues identified by Jenkins run:
Makefile.am: clean .build_params file;

ecc.c: fix misplaced gat #endif in wc_ecc_shared_secret_gen_sync();

move AM_CFLAGS+=-include /.build_params to before AC_SUBST([]AM_CFLAGS);

fix new unused-label defect in wc_ecc_shared_secret_gen_sync();

fix integer.[ch] mp_exch() to return int not void (sp_exch() and TFM mp_exch() can both fail on allocations);

fix NO_INLINE ForceZero() prototype;

ecc.c: add missing if (err == MP_OKAY) in build_lut();

wolfcrypt/test/test.c: revert "rename hkdf_test to wc_hkdf_test to eliminate namespace collision", restoring unconditional static qualifier, to fix crash at return from main() on Xilinx Zynq ARM test;

ecc.c: refactor build_lut() flow control to fix uninited variable scenario found by scan-build;

WOLFCRYPT_ONLY and OPENSSL_EXTRA: fix gating to allow successful build with --enable-all-crypto, and add configure error if crypt-only and opensslall are combined.
2021-10-26 20:24:27 -05:00
87578262aa wolfcrypt smallstack refactors:
rsa.c: wc_CompareDiffPQ()

dh.c: wc_DhGenerateParams()

dsa.c: wc_MakeDsaKey() wc_MakeDsaParameters()

srp.c: wc_SrpGetVerifier() wc_SrpSetPrivate() wc_SrpGetPublic()

ecc.c: build_lut() wc_ecc_mulmod_ex() wc_ecc_mulmod_ex2() wc_ecc_shared_secret_gen_sync()

test.c: GenerateNextP() dh_generate_test() GenerateP()
2021-10-26 20:24:27 -05:00
0f201a7394 wolfcrypt/types.h: revert change to WOLFSSL_LINUXKM XFREE() macro added in commit "remove frivolous semicolons at end of several macro definitions." 2021-10-26 20:24:27 -05:00
947a0d6a2f autotools/Makefiles: enable reproducible build by default for FIPS, and add -DHAVE_REPRODUCIBLE_BUILD to AM_CFLAGS;
refactor the HAVE_WC_INTROSPECTION mechanism to pass build params via $output_objdir/.build_params rather than abusing autotools config.h to pass them;

add support for EXTRA_CFLAGS on the make command line;

in FIPS builds, exclude pkcallbacks from --enable-all;

linuxkm: move test.o out of PIE container (uses function pointers as operands).
2021-10-26 20:24:27 -05:00
f1c1f76851 ssl.c: refactor wolfSSL_LH_strhash() to use SHA1 instead of MD5, to eliminate dependency on deprecated alg. 2021-10-26 20:24:27 -05:00
ddda108de6 sp_int.c:sp_set(): use PRAGMA_GCC_* macros, not ad hoc gated __Pragmas, to mask spurious -Warray-bounds. 2021-10-26 20:24:26 -05:00
cdcb8fb9da configure.ac: revert change (AC_MSG_NOTICE reverted to AC_MSG_ERROR) for "FIPS source tree used for non-FIPS build"; in enable_all set, move enable_stunnel and enable_tcpdump to the !ENABLED_LINUXKM_DEFAULTS section. 2021-10-26 20:24:26 -05:00
220a255281 use WOLFSSL_BIO_ERROR, not SOCKET_INVALID (both macros have value -1), as the default/unset value of WOLFSSL_BIO.num, to avoid unnecessary dependency on HAVE_SOCKADDR. 2021-10-26 20:24:26 -05:00
1e3d47af57 remove frivolous semicolons at end of several macro definitions. 2021-10-26 20:24:26 -05:00
64bfe81ff5 configure.ac: test for cryptonly && opensslextra, if so error "mutually incompatible". 2021-10-26 20:24:26 -05:00
2bf711341b wolfcrypt/test/test.c: use HAVE_FIPS_VERSION, not FIPS_VERSION. 2021-10-26 20:24:26 -05:00
4cf1826c8f PRAGMA_GCC_*: refactor macros to properly push a context, and refactor their use in src/tls13.c:DeriveKey() to deal with gcc context quirks that otherwise disabled the warning mask when defined(HAVE_FIPS); add a missing #ifndef NO_MD5 in ssl.c:wolfSSL_LH_strhash(). 2021-10-26 20:24:26 -05:00
cff7c5b3c0 wolfcrypt/benchmark/benchmark.c: in bench_dh(), add a missing #ifdef HAVE_PUBLIC_FFDHE around a DhParams use. 2021-10-26 20:24:26 -05:00
8de8af8b43 wolfcrypt/test/test.c: disable hmac_md5_test() for FIPS 140-3, and rename hkdf_test to wc_hkdf_test to eliminate namespace collision. 2021-10-26 20:24:26 -05:00
89797db946 configure.ac: enable_stunnel for enable-all only if !FIPS; add enable_tcpdump if !FIPS; add -DWOLFSSL_ECDSA_SET_K to FIPS 140-3 CFLAGS; use DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS to set FP_MAX_BITS indirectly for FIPS 140-3; use AC_MSG_NOTICE() for informational notices previously echoed; gate informational output appropriately on $verbose and $silent. 2021-10-26 20:24:26 -05:00
5293180566 linuxkm/module_exports.c.template: tweaks for FIPS compatibility. 2021-10-26 20:24:26 -05:00
ed33315f25 wolfcrypt/src/sp_int.c: add pragma to sp_set() to suppress false positive -Warray-bounds on gcc-11. 2021-10-26 20:24:26 -05:00
54b3f1b252 src/tls.c:TLSX_KeyShare_GenDhKey(): don't generate a key if one is already set. 2021-10-26 20:24:26 -05:00
34e88b0605 linuxkm: properly pass {AM_,}CPPFLAGS to Kbuild, and include kdf.h in module_exports.c.template. 2021-10-26 20:24:26 -05:00
b673622322 FIPS 140-3 misc fixes including fixes for rebase errors. 2021-10-26 20:24:26 -05:00
b615309a7b update FFDHE4096 test with the updated usage 2021-10-26 20:24:26 -05:00
c31ed64eb5 Add guard around the public key check for DH to skip it when we have
the condition to perform the small key test. The small key is
mathematically valid, but does not necessarily pass the SP 800-56Ar3
test for DH keys. The most recent FIPS build will add the tested file.
This change is only used in the older FIPS releases and in some rare
configurations that include the small key test.
2021-10-26 20:24:26 -05:00
aeb8f5bb51 For the WIN10 user_settings, remove the forced set of FIPS version to 5. 2021-10-26 20:24:26 -05:00
b00b95ef6c Cofactor flag in wolfcrypt test needed a guard. 2021-10-26 20:24:26 -05:00
f53a4db4e7 Unwind a few changes adding guards so it'll build with old FIPS. 2021-10-26 20:24:26 -05:00
b54459ace3 When the ECC PCT verify result is 0, the PCT fails. 2021-10-26 20:24:26 -05:00
175bab9a6f Add missed step in DH key pair generation. 2021-10-26 20:24:26 -05:00
b815939c53 Add missing settings for the Windows 10 FIPS build. 2021-10-26 20:24:26 -05:00
f42106201a In the RSA PCT, initialize the plain output pointer. 2021-10-26 20:24:26 -05:00
aa3fb6f0d0 Update visibility on a SP math function for DH. 2021-10-26 20:24:26 -05:00
04ffd2ab45 Fixes:
1. When enabling FIPSv5 in configure, enable WOLFSSL_WOLFSSH.
2. Appropriate size selection of DH private keys.
2021-10-26 20:24:26 -05:00
3eaeaf3a57 Add sign/verify PCT to ECC. 2021-10-26 20:24:25 -05:00
9bf36f329a Add sign/verify PCT to RSA key gen. 2021-10-26 20:24:25 -05:00
5d7c6dda72 Restore the PCTs to ECC and DH. 2021-10-26 20:24:25 -05:00
1065d2accf Fix some Windows build warnings. 2021-10-26 20:24:25 -05:00
9022762e5a Check to see if a pointer is nonnull that is expected to be. 2021-10-26 20:24:25 -05:00
908ec9b14a Modify ffdhe to not return addresses. 2021-10-26 20:24:25 -05:00
ebdadefb9a Update WIN10 user_settings.h for new FIPS build. 2021-10-26 20:24:25 -05:00
f49a09749e When building for FIPS, the unit test will run all the CASTs up front. 2021-10-26 20:24:25 -05:00
52432382a2 Add kdf.c to the Windows builds. 2021-10-26 20:24:25 -05:00
82e63cee1e Remove the unused ECDSA PCT tests in the CAST list. 2021-10-26 20:24:25 -05:00
ae7a2e5a48 Remove the unused RSA PCT test in the CAST list. 2021-10-26 20:24:25 -05:00
7af87e5b32 Restore the HKDF code to hmac.c. For compatibility between FIPS builds. 2021-10-26 20:24:25 -05:00
54a1b4c881 Remove redundant pairwise test from DH and ECC. 2021-10-26 20:24:25 -05:00
c5d575c8ae Remove RDSEED from the intel asm build. 2021-10-26 20:24:25 -05:00
f69b6ac5eb Add missing verify curves into configure. Copy the kdf files when building for FIPSv5. 2021-10-26 20:24:25 -05:00
c0e6a55aaa Skip the small key DH test for SP and FFDHE builds. 2021-10-26 20:24:25 -05:00
3b5c8231c2 Move the PCT down to where it used to be located as CheckKeyPair. 2021-10-26 20:24:25 -05:00
6cf186696e Update the BUILD_FIPS_V4 flag to V5. Consolidate the Makefile include for the flavors of FIPS. 2021-10-26 20:24:25 -05:00
2de6b3b2bd Move the KDF functions into their own source file. 2021-10-26 20:24:25 -05:00
f78887d2ab Add 'static' to the test vector arrays for the SSH KDF test. 2021-10-26 20:24:25 -05:00
dee2a67720 Change visibility of wc_GenerateSeed() to API. 2021-10-26 20:24:25 -05:00
86c040a3ae Rename the PCT error codes to remove 'FIPS' since they can be enabled without FIPS. 2021-10-26 20:24:25 -05:00
9c5607a677 Add guard around ECC PCT for builds without validate keygen. 2021-10-26 20:24:25 -05:00
7a2b661c0c Add types for the RNG seed callback and the OS_Seed. 2021-10-26 20:24:25 -05:00
133faea89a Hushed compiler warnings about unused variables. 2021-10-26 20:24:25 -05:00
a967cbcb7b 56Ar3 Testing Updates
1. Add PCTs for ECC and FFC.
2. Update the public key checks for ECC and FFC.
2021-10-26 20:24:25 -05:00
976402e04b RNG Update
1. When the seed callback is enabled, allow wc_GenerateSeed() to be used
   as a default callback.
2. Modify all the tests and examples to use the default seed callback if
   the seed callback is enabled.
2021-10-26 20:24:25 -05:00
0c6d8cfc22 If the RNG seeding callback is missing or returns an error, the RNG instantiate fails. 2021-10-26 20:24:25 -05:00
c6486d7392 Removed an outdated comment. 2021-10-26 20:24:25 -05:00
a562db82ef 1. Rename and relabel the FIPS 140-3 option as wolfCrypt v5.
2. Make sure the correct SHA assembly files are copied over for the latest FIPS build.
2021-10-26 20:24:25 -05:00
c47e354eed Add callback option for RNG seeding. 2021-10-26 20:24:25 -05:00
bffe4f64dd Add option to fips-check script to checkout specific named files from the FIPS tag. 2021-10-26 20:24:25 -05:00
a2f802199d DH key gen should call DH check key. 2021-10-26 20:24:25 -05:00
e3b2be5ea3 ECC key gen should call ECC check key. 2021-10-26 20:24:25 -05:00
1f67e4519c Restrict AES-GCM IV minimum size to 96-bits for newer FIPS builds. 2021-10-26 20:24:25 -05:00
e03b29966c Remove MD5 and old TLS from the newest FIPS build. 2021-10-26 20:24:25 -05:00
17a4c891ce Add CASTs for TLSv1.2, TLSv1.3, and SSH KDFs. 2021-10-26 20:24:25 -05:00
1fcf33b898 Fix another configure error due to rebase. 2021-10-26 20:24:25 -05:00
e32c58d533 Add RSA PAT. 2021-10-26 20:24:25 -05:00
9656b83a03 Add ECDSA-KAT CAST. 2021-10-26 20:24:25 -05:00
3994a6b5e7 FIPSv3
1. Remove the CAST IDs for the redundant RSA tests.
2. Remove the flags in configure.ac that enable the keys for the redundant RSA tests.
2021-10-26 20:24:25 -05:00
90752e89fb Restore a configure check lost in a rebase. 2021-10-26 20:24:25 -05:00
6dfef1400d Use the new APIs for HKDF extract with label. 2021-10-26 20:24:25 -05:00
e67bbf7526 1. Add flag to DH keys when using safe parameters.
2. The LN check is skipped when using safe parameters.
3. Enable all FFDHE parameter sets when building for FIPS 140-3.
2021-10-26 20:24:25 -05:00
7f64fc4efb Move the TLSv1.3 KDF into wolfCrypt with the other KDFs. 2021-10-26 20:24:25 -05:00
38064bb396 Add HMAC-SHA2-512 to the TLSv1.2 PRF. 2021-10-26 20:24:25 -05:00
c7ea896759 Add prototype for the ssh-kdf test in the wolfCrypt test. 2021-10-26 20:24:24 -05:00
de4af35f89 KDF Update
1. Move wolfSSH's KDF into wolfCrypt.
2021-10-26 20:24:24 -05:00
a49125e613 FIPS KDF Update
1. Copied the TLSv1.2 PRF into hmac.c since it uses it and the TLSv1.3
   HKDF is in there as well.
2. Added guard around the old TLS PRF so that it switches in correctly
   for older FIPS builds only.
2021-10-26 20:24:24 -05:00
a935f2f86d FIPS CAST Update
1. In the unit test, when checking the build options, also check for
   FIPSv4 to make sure 2048-bit RSA is used.
2. In the standalone SHA-1 one step hash function, wc_InitSha() wasn't
   getting called, so the FIPS flags didn't get checked. (It was using
   wc_InitSha_ex() which bypasses the FIPS checks.)
2021-10-26 20:24:24 -05:00
11fb1abe74 Fix a bad assignment in the configure script. 2021-10-26 20:24:24 -05:00
e855654fff FIPS CAST Update
1. Added a public API to run a CAST.
2. Added the other test certs for the RSA tests.
3. Added IDs for the new RSA tests and the SHA3-pairwise test.
2021-10-26 20:24:24 -05:00
a5032e8087 Update the fips-check script to pull the sources from GitHub rather than
from a directory on a local machine.
2021-10-26 20:24:24 -05:00
df859d30f3 FIPS 140-3
1. Change the internal version number for the FIPS 140-3 changes as v4.
2. Insert v3 as an alias for FIPS Ready.
3. Use the correct directory for the FIPS old files sources. (For local
   testing of 140-3 builds.)
4. Change back the check for the FIPS version in internal.c for
   EccMakeKey().
2021-10-26 20:24:24 -05:00
1683644e77 FIPS 140-3
1. Fix issue with FIPS Ready and FIPS 140-3. FR acts at the latest
   version in the code, but that leaves DES3 out of the build. The code
   was still including the header. Force DES3 disabled in FIPS Ready
   builds.
2021-10-26 20:24:24 -05:00
9e92c118ed FIPS 140-3
1. Add the old known answer test prototype back into fips_test.h for FIPSv2 builds.
2021-10-26 20:24:24 -05:00
f1bd79ac50 FIPS 140-3
1. Added enable option for FIPS 140-3 in configure script.
2. Modify DES3 source to disallow DES3 for the new option.
3. Added the new constants to fips_test.h.
4. Added some new test functions.
5. Added API for doing the POST.
6. Added a processing state for the CASTs.
7. Delete some unused prototypes from FIPS test API.
2021-10-26 20:24:24 -05:00
d27a49b98c Merge pull request #4507 from cconlon/cavpselftest2
fix CAVP selftest v2 build error in test.c
2021-10-27 06:04:06 +07:00
4825534062 Merge pull request #4500 from cconlon/errorQueueFix
fix wc_ERR_print_errors_fp() unit test with NO_ERROR_QUEUE
2021-10-27 05:56:32 +07:00
4235602c1e SP: change to sp_c32.c now in scripts caused changes to sp_c64.c 2021-10-27 08:46:32 +10:00
3d5eea8f56 fix for disable memory build 2021-10-26 16:17:32 -06:00
fdf2b711f7 cmake: add SNI and TLSx 2021-10-26 15:03:29 -07:00
583a50a3f6 account for case where XTIME returns an unsigned type 2021-10-26 15:50:11 -06:00
a08b2db692 Fix for session ticket handling with error cases. Session ticket callback return code failures were still trying to do resumption. Behavior broken in PR #3827. 2021-10-26 11:37:01 -07:00
9c665d7282 Merge pull request #4501 from embhorn/zd13114
Fix wolfSSL_ASN1_TIME_diff use of gmtime and 32-bit overflow
2021-10-26 10:47:59 -07:00
87baf7818e Merge pull request #4505 from julek-wolfssl/fix-nids
Make NID's consistent v2
2021-10-26 10:29:42 -07:00
5810e45cb7 fix CAVP selftest v2 build error in test.c 2021-10-26 10:33:05 -06:00
529f1c63dd Merge pull request #4503 from SparkiDev/opensslcoexist_ed
ED25519 and ED448 api.c tests: doesn't compile with --opensslcoexist
2021-10-26 09:19:08 -07:00
19feab7850 Fix wolfSSL_ASN1_TIME_diff use of gmtime and 32-bit overflow 2021-10-26 07:14:53 -05:00
48b304be00 Fix issues with AIA_OCSP_OID and AIA_CA_ISSUER_OID 2021-10-26 11:47:27 +02:00
348fec3d29 wc_ClearErrorNodes is a local API that is not exported for linking 2021-10-26 09:14:48 +02:00
fa3cf590d5 Fix NID conflicts
- `NID_sha224` conflicted with `NID_sha1WithRSAEncryption`
- `NID_commonName` conflicted with `PBE-SHA1-3DES`
- `NID_X9_62_prime239v3` conflicted with `AES128CBCb`
- `NID_md5` conflicted with `NID_surname`
- `NID_md2WithRSAEncryption` conflicted with `NID_localityName`
- `NID_md5WithRSAEncryption` conflicted with `NID_stateOrProvinceName`

NID conflicts found by examining the runtime values in `wolfssl_object_info`
2021-10-26 09:14:34 +02:00
57b9170ac0 Make NID's consistent
- `CTC_SHAwDSA` -> `NID_dsaWithSHA1`
- `CTC_SHA256wDSA` -> `NID_dsa_with_SHA256`
- `CTC_MD2wRSA` -> `NID_md2WithRSAEncryption`
- `CTC_MD5wRSA` -> `NID_md5WithRSAEncryption`
- `CTC_SHAwRSA` -> `NID_sha1WithRSAEncryption`
- `CTC_SHA224wRSA` -> `NID_sha224WithRSAEncryption`
- `CTC_SHA256wRSA` -> `NID_sha256WithRSAEncryption`
- `CTC_SHA384wRSA` -> `NID_sha384WithRSAEncryption`
- `CTC_SHA512wRSA` -> `NID_sha512WithRSAEncryption`
- `CTC_SHA3_224wRSA` -> `NID_RSA_SHA3_224`
- `CTC_SHA3_256wRSA` -> `NID_RSA_SHA3_256`
- `CTC_SHA3_384wRSA` -> `NID_RSA_SHA3_384`
- `CTC_SHA3_512wRSA` -> `NID_RSA_SHA3_512`
- `CTC_SHAwECDSA` -> `NID_ecdsa_with_SHA1`
- `CTC_SHA224wECDSA` -> `NID_ecdsa_with_SHA224`
- `CTC_SHA256wECDSA` -> `NID_ecdsa_with_SHA256`
- `CTC_SHA384wECDSA` -> `NID_ecdsa_with_SHA384`
- `CTC_SHA512wECDSA` -> `NID_ecdsa_with_SHA512`
- `CTC_SHA3_224wECDSA` -> `NID_ecdsa_with_SHA3_224`
- `CTC_SHA3_256wECDSA` -> `NID_ecdsa_with_SHA3_256`
- `CTC_SHA3_384wECDSA` -> `NID_ecdsa_with_SHA3_384`
- `CTC_SHA3_512wECDSA` -> `NID_ecdsa_with_SHA3_512`
- `DSAk` -> `NID_dsa`
- `RSAk` -> `NID_rsaEncryption`
- `ECDSAk` -> `NID_X9_62_id_ecPublicKey`
2021-10-26 09:14:25 +02:00
08d9b145d9 ED25519 and ED448 api.c tests: doesn't compile with --opensslcoexist
Change SSL_FATAL_ERROR to  WOLFSSL_FATAL_ERROR
2021-10-26 15:50:52 +10:00
49e29eb811 Merge pull request #4504 from wolfSSL/revert-4429-fix-nids
Revert "Make NID's consistent"
2021-10-26 00:09:56 -05:00
a0c7c079b8 Revert "Make NID's consistent" 2021-10-25 21:57:28 -07:00
cdf72facbf Merge pull request #4429 from julek-wolfssl/fix-nids
Make NID's consistent
2021-10-26 09:59:26 +10:00
905683c98c Merge pull request #4496 from dgarske/sniffer_keywatch
Fix for sniffer key watch callback
2021-10-26 09:55:17 +10:00
6070981366 Merge pull request #4490 from dgarske/static_mem_unittest
Add CTX static memory API unit tests
2021-10-26 09:52:14 +10:00
aa72f0685d Merge pull request #4499 from SparkiDev/dec_ku_len
KeyUsage dcoding: Ensure data length is 1 or 2
2021-10-25 15:11:18 -07:00
a8b6304e19 add unit test for wc_PKCS7_VerifySignedData_ex() with detached signature and content digest only 2021-10-25 15:52:19 -06:00
322cb05852 adjust PKCS7_VerifySignedData to correctly verify precomputed content hash with detached signature 2021-10-25 14:46:10 -06:00
eb0b6ca122 fix unit test for wc_ERR_print_errors_fp() when NO_ERROR_QUEUE is defined 2021-10-25 13:50:39 -06:00
517225e135 Merge pull request #4497 from cconlon/authInfo
fix nid2oid/oid2nid for oidCertAuthInfoType
2021-10-25 09:29:09 -07:00
8e6c6e7757 KeyUsage dcoding: Ensure data length is 1 or 2 2021-10-25 09:22:31 +10:00
bf2b13939f Merge pull request #4329 from kaleb-himes/OE22-Porting-Changes
Oe22 porting changes
2021-10-22 16:16:26 -07:00
402ee29163 fix nid2oid/oid2nid for oidCertAuthInfoType 2021-10-22 16:53:18 -06:00
e4da9c6f48 Fix for sniffer key callback. Fix for building sniffer without RSA. Fix for wolfCrypt test cert ext without RSA. 2021-10-22 14:29:06 -07:00
5859779ddf Check-in non-FIPS specific porting changes for OE22
Fix no new line

Change comment style in testsuite.c

Add include for proper socket header in wolfio.h

Add dc_log_printf support to benchmark application

Pull in changes for examples

Refector NETOS check in test.c

Fix format and remove settings used only for validation testing

Implement peer review feedback

Address last items noted in peer review

Add new README to include.am

Adjust comment style on TODO

Gate changes in client and server properly

Add static on customer feedback

Fix settings include

Update latest peer feedback
2021-10-22 15:01:14 -06:00
d83d16af59 Merge pull request #4483 from julek-wolfssl/cov-reports 2021-10-22 13:07:57 -07:00
229f0d5fd1 Merge pull request #4485 from JacobBarthelmeh/certs
Improve permitted alternate name logic in certificate ASN handling
2021-10-22 11:59:16 -07:00
c027fffa92 Fix for CTX free heap hint issue. With openssl extra the param and x509_store.lookup.dirs are allocated at CTX init and if heap or static pool was used depends on ctx->onHeapHint. Added test case for this and inline code comment. 2021-10-22 11:58:02 -07:00
734a73dd35 Add missing null-check. Fix dead store. 2021-10-22 11:17:41 -07:00
f8178b4896 Merge pull request #4495 from utzig/fix-mmacu-sha256-warn
Fix MMCAU_SHA256 type warnings
2021-10-22 10:55:43 -07:00
587077856e Merge pull request #4494 from utzig/fix-forcezero-comment
Fix comment that applies to fp_forcezero
2021-10-22 10:55:30 -07:00
c54f906678 Merge pull request #4492 from haydenroche5/pem_password_cb
Rename pem_password_cb to wc_pem_password_cb.
2021-10-22 10:51:47 -07:00
aad230a7e3 Restore a test case. Add a missing null-check. 2021-10-22 10:36:17 -07:00
4c0527490d Fixes for API unit test with WOLFSSL_NO_ASN_STRICT. Fix spelling error. 2021-10-22 09:59:16 -07:00
29f4f09e6c Fix MMCAU_SHA256 type warnings
Fix warnings in the usage of MMCAU_SHA256 routines, where digest is
expected to be `uint32_t*`, but is defined as `word32*`, which results
in:

```
expected 'uint32_t *' {aka 'long unsigned int *'} but argument is of
type 'word32 *' {aka 'unsigned int *'}
```

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-10-22 09:51:14 -03:00
a00e3024ce Fix comment that applies to fp_forcezero
Fix comment mentioning the use of `ForceZero` besides `fp_clear`, which
uses `XMEMSET`, and puts it above `fp_forcezero` where it should belong.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-10-22 09:01:31 -03:00
6e7dee3283 Change to compare each name to each matching type in permittedNames list. 2021-10-22 10:57:11 +10:00
0b6523d933 Rename pem_password_cb to wc_pem_password_cb.
Recently, we had a wolfEngine customer report a compilation error because
wolfSSL and OpenSSL both define the typedef pem_password_cb. The solution is to
namespace our typedef with the wc_ prefix. In order to not break existing code
that relies on wolfSSL providing pem_password_cb, if OPENSSL_COEXIST is not
defined, we define pem_password_cb as a macro that maps to wc_pem_password_cb.
2021-10-21 16:47:29 -07:00
b5f4a0c005 Improve API unit test to use X509_NAME_get_sz and make it widely available. 2021-10-21 16:42:19 -07:00
f17187aad9 Fixes for static memory testing. Fix clang memory sanitizer warnings. 2021-10-21 16:33:57 -07:00
785e37790a Cleanup API test case debugging. 2021-10-21 12:35:06 -07:00
911d95e5e4 Add CTX static memory API unit tests. Expanded crypto callback TLS tests to older SSL/TLS and DTLS. 2021-10-21 11:47:00 -07:00
37a976b4bf Fix example server to support option 7 (which exists). Fix static mem size required with session cert (matches client now). 2021-10-21 11:41:30 -07:00
79b738b5a6 commit-test and jenkins fixes 2021-10-21 14:29:28 +02:00
44d8ab20e1 #456 2021-10-21 14:25:06 +02:00
f512514fd6 #450 2021-10-21 14:25:06 +02:00
a4a093ebed #449 2021-10-21 14:25:06 +02:00
9e3ff9c92c #427 2021-10-21 14:25:06 +02:00
9386a882b9 #424
Refactor d2i key API to use common code
2021-10-21 14:25:06 +02:00
4d5dceaa4e #421 2021-10-21 14:25:06 +02:00
9d989689c6 #420 2021-10-21 14:25:06 +02:00
86f93e5c1b #419 2021-10-21 14:25:06 +02:00
70901f0626 #257 2021-10-21 14:25:06 +02:00
3894021a53 #246 2021-10-21 14:25:06 +02:00
af64d4347d #244 2021-10-21 14:25:06 +02:00
f7f12da8ec #242 2021-10-21 14:25:06 +02:00
e70dfe7265 #239 2021-10-21 14:25:06 +02:00
3563585274 #240 2021-10-21 14:22:54 +02:00
df1d817f1f #129 2021-10-21 14:22:54 +02:00
1d5f4a6664 #118 2021-10-21 14:22:54 +02:00
81c3f4b925 #114 2021-10-21 14:22:54 +02:00
1239a7f57d #96 2021-10-21 14:22:54 +02:00
a1127be18e #95 2021-10-21 14:22:54 +02:00
2678a3b981 #67 2021-10-21 14:22:54 +02:00
e97e8bc7d0 #59 2021-10-21 14:22:54 +02:00
5bacc0c9ab In first |= op r always equals 0 2021-10-21 14:22:54 +02:00
8e6759384c #40 2021-10-21 14:22:54 +02:00
344a07051e #39 2021-10-21 14:22:54 +02:00
74cf332a8b #37 2021-10-21 14:22:54 +02:00
e82ae7b072 #17 2021-10-21 14:22:54 +02:00
79682fd30a #15 2021-10-21 14:22:54 +02:00
97c89dd072 #9 2021-10-21 14:22:54 +02:00
4268763adb wc_ClearErrorNodes is a local API that is not exported for linking 2021-10-21 13:47:55 +02:00
642d0e0fba Fix NID conflicts
- `NID_sha224` conflicted with `NID_sha1WithRSAEncryption`
- `NID_commonName` conflicted with `PBE-SHA1-3DES`
- `NID_X9_62_prime239v3` conflicted with `AES128CBCb`
- `NID_md5` conflicted with `NID_surname`
- `NID_md2WithRSAEncryption` conflicted with `NID_localityName`
- `NID_md5WithRSAEncryption` conflicted with `NID_stateOrProvinceName`

NID conflicts found by examining the runtime values in `wolfssl_object_info`
2021-10-21 13:01:57 +02:00
20473ba563 Make NID's consistent
- `CTC_SHAwDSA` -> `NID_dsaWithSHA1`
- `CTC_SHA256wDSA` -> `NID_dsa_with_SHA256`
- `CTC_MD2wRSA` -> `NID_md2WithRSAEncryption`
- `CTC_MD5wRSA` -> `NID_md5WithRSAEncryption`
- `CTC_SHAwRSA` -> `NID_sha1WithRSAEncryption`
- `CTC_SHA224wRSA` -> `NID_sha224WithRSAEncryption`
- `CTC_SHA256wRSA` -> `NID_sha256WithRSAEncryption`
- `CTC_SHA384wRSA` -> `NID_sha384WithRSAEncryption`
- `CTC_SHA512wRSA` -> `NID_sha512WithRSAEncryption`
- `CTC_SHA3_224wRSA` -> `NID_RSA_SHA3_224`
- `CTC_SHA3_256wRSA` -> `NID_RSA_SHA3_256`
- `CTC_SHA3_384wRSA` -> `NID_RSA_SHA3_384`
- `CTC_SHA3_512wRSA` -> `NID_RSA_SHA3_512`
- `CTC_SHAwECDSA` -> `NID_ecdsa_with_SHA1`
- `CTC_SHA224wECDSA` -> `NID_ecdsa_with_SHA224`
- `CTC_SHA256wECDSA` -> `NID_ecdsa_with_SHA256`
- `CTC_SHA384wECDSA` -> `NID_ecdsa_with_SHA384`
- `CTC_SHA512wECDSA` -> `NID_ecdsa_with_SHA512`
- `CTC_SHA3_224wECDSA` -> `NID_ecdsa_with_SHA3_224`
- `CTC_SHA3_256wECDSA` -> `NID_ecdsa_with_SHA3_256`
- `CTC_SHA3_384wECDSA` -> `NID_ecdsa_with_SHA3_384`
- `CTC_SHA3_512wECDSA` -> `NID_ecdsa_with_SHA3_512`
- `DSAk` -> `NID_dsa`
- `RSAk` -> `NID_rsaEncryption`
- `ECDSAk` -> `NID_X9_62_id_ecPublicKey`
2021-10-21 13:01:57 +02:00
12f86b020a clean up test case memory and common name size 2021-10-20 17:13:34 -06:00
817cd2f2a6 Merge pull request #4487 from haydenroche5/openssh
Make several changes to support OpenSSH 8.5p1.
2021-10-21 08:59:38 +10:00
ac3612bbef Merge pull request #4469 from dgarske/android_keystore
Support for Android KeyStore compatibility API's
2021-10-21 08:30:08 +10:00
a9f467a6b0 Merge pull request #4457 from dgarske/zd13036
Fix for sniffer to trap negative size calculation
2021-10-21 08:17:52 +10:00
ff8e7609f5 Merge pull request #4458 from kosmas-valianos/SkipCRLnoCDP 2021-10-20 13:45:58 -07:00
f57801c17b more name constraint test cases and adjust DNS base name matching to not require . 2021-10-20 14:25:02 -06:00
864f913454 Make several changes to support OpenSSH 8.5p1.
- Permit more wolfSSL_EC_POINT_* functions for FIPS builds. This requires one
workaround in wolfSSL_EC_POINT_mul where wc_ecc_get_generator isn't available.
- Permit more AES-GCM code in EVP code for FIPS v2 builds. It's unclear why this
code wasn't already available.
- Add EVP_CIPHER_CTX_get_iv to the compatibility layer.
- Clear any existing AAD in the EVP_CIPHER_CTX for AES-GCM when we receive the
EVP_CTRL_GCM_IV_GEN control command. OpenSSL does this, and OpenSSH is relying
on this behavior to use AES-GCM correctly.
- Modify ecc_point_test in testwolfcrypt so that it doesn't fail when doing a
FIPS build with HAVE_COMP_KEY defined.
2021-10-20 11:00:42 -07:00
e572c6b9d7 Merge pull request #4486 from dgarske/set_secret 2021-10-20 10:54:13 -07:00
1d6c7b542d Update the user_settings.h template for Android, based on final testing. 2021-10-20 10:10:15 -07:00
6d2a5fab9b Added test cases for EVP_PKCS82PKEY and EVP_PKEY2PKCS8. 2021-10-20 09:18:13 -07:00
ab6939d200 add new test cert to make dist 2021-10-19 23:34:03 -06:00
e0e43b6a16 clean up test case 2021-10-19 23:12:07 -06:00
3b73c6e3ae handle multiple permitted name constraints 2021-10-19 23:12:07 -06:00
afee92e0cf bail out when a bad alt name is found in the list of alt names 2021-10-19 23:12:07 -06:00
e5caf5124c Merge pull request #4477 from luizluca/zero-terminate-constraints
ASN: zero-terminate name constraints strings
2021-10-19 21:16:46 -07:00
892685ac59 Merge pull request #4472 from utzig/ksdk-port-koblitz
nxp: ksdk: add support for Koblitz curves
2021-10-19 21:14:38 -07:00
a145f3107d Merge pull request #4481 from SparkiDev/mod_exp_even
SP int: handle even modulus with exponentiation
2021-10-19 21:09:15 -07:00
4e7ce45a8c Allow loading public key with PK callbacks also. 2021-10-19 17:04:18 -07:00
de8798f4be Fix API unit tests where DH 3072-bit is not enabled. 2021-10-19 17:04:18 -07:00
a03ed32380 Support for Android KeyStore compatibility API's:
* Adds `EVP_PKCS82PKEY` and `d2i_PKCS8_PRIV_KEY_INFO`.
* Adds `EVP_PKEY2PKCS8` and `i2d_PKCS8_PRIV_KEY_INFO`.
* Adds `ECDSA_verify`.
* Fix to allow `SHA256()` and `MD5()` with FIPSv2.
* Decouple crypto callbacks and hash flags
* Fix for possible use of uninitialized when building TLS bench without TLS v1.3.
* Fix for building with `NO_CHECK_PRIVATE_KEY`. Test `./configure --disable-pkcs12 --enable-opensslextra CFLAGS="-DNO_CHECK_PRIVATE_KEY"`.
* Fix to support `RSA_public_decrypt` for PKCSv15 only with FIPS.
* Cleanup `RSA_public_encrypt`, `RSA_public_decrypt` and `RSA_private_decrypt`.
* Added instructions for building wolfSSL with Android kernel.
2021-10-19 17:04:18 -07:00
00bdc69284 Fix for wolfSSL_set_secret with DTLS where TLS v1.3 is not defined. Function assumed ssl->arrays->preMasterSecret was allocated. 2021-10-19 16:22:39 -07:00
f04380d624 Merge pull request #4475 from douzzer/fix-scan-build-UnreachableCode
scan-build LLVM-13 fixes and expanded coverage
2021-10-20 08:30:46 +10:00
d880403207 SP int: handle even modulus with exponentiation
Fix testing of mp_int to only call when implementation included.
2021-10-20 08:21:26 +10:00
7f5a3a4e74 Merge pull request #4484 from dgarske/memtest
Fix for openssl test with --enable-memtest (also DH test build edge case)
2021-10-20 08:19:30 +10:00
41eecd37e5 Merge pull request #4471 from embhorn/zd11886
Fix build errors with NO_BIO config
2021-10-20 08:06:42 +10:00
93f033823c Merge pull request #4482 from miyazakh/mindowngarde_staticrsa
TLS 1.3: ServerHello downgrade with no extensions fix
2021-10-20 07:58:34 +10:00
d297a06c25 Fix for wolfCrypt test with custom curves without Brainpool. Tested all changes on NXP K82 LTC. 2021-10-19 13:12:12 -07:00
498884eadb Fix for missing dhKeyFile and dhKeyPubFile with file system enabled, WOLFSSL_DH_EXTRA and USE_CERT_BUFFERS_2048 set. 2021-10-19 13:06:37 -07:00
dcb2ebba39 Fix for openssl.test extraction of version and cipher suites. Fix mem tracking to use stderr. Fix client version print to use single printf with newline. 2021-10-19 13:00:25 -07:00
c0b592ef82 Fix build error with WOLFSSL_USER_IO 2021-10-19 08:27:43 -05:00
91cd2b1731 TLS 1.3 ServerHello additional fix for PR4439 in Static RSA case 2021-10-19 17:51:00 +09:00
768496be4a scan-build LLVM-13 fixes: in examples/echoclient/echoclient.c, remove frivolous "break;", avoiding need to pragma-ignore clang -Wunreachable-code-break. 2021-10-18 21:46:10 -05:00
e341291d99 scan-build LLVM-13 fixes: tests/api.c: fix -Wunused-but-set-variable for drive_len in test_wolfSSL_EVP_Cipher_extra() by removing the unused drive_len code. 2021-10-18 21:46:10 -05:00
69bc801c13 scan-build LLVM-13 fixes: src/ssl.c: work around deadcode.DeadStores warning in wolfSSL_X509_REQ_sign() in a different way, avoiding WC_MAYBE_UNUSED. 2021-10-18 21:46:09 -05:00
76332069ea examples/client/client.c: remove frivolous break to avoid need for PRAGMA_CLANG("clang diagnostic ignored \"-Wunreachable-code-break\""). 2021-10-18 21:46:09 -05:00
a5006d580c scan-build LLVM-13 fixes: sp_int.c: drop "&& defined(SP_DEBUG_VERBOSE)" from preprocessor gates around debugging printfs. 2021-10-18 21:46:09 -05:00
007f01e7ec scan-build LLVM-13 fixes: in src/tls.c TLSX_PopulateExtensions(), avoid -Wunreachable-code-return by refactoring iteration to use an array terminator (a new "WOLFSSL_NAMED_GROUP_INVALID" with value 0) rather than a compile-time-calculated constant of iteration. 2021-10-18 21:46:09 -05:00
816527e826 scan-build fixes: back out all "#ifndef __clang_analyzer__" wrappers added to suppress false and frivolous positives from alpha.deadcode.UnreachableCode, and rename new macro WC_UNUSED to WC_MAYBE_UNUSED to make its meaning more precisely apparent. build is still clean with -Wunreachable-code-break -Wunreachable-code-return under scan-build-13. 2021-10-18 21:46:09 -05:00
f621a93081 more scan-build LLVM-13 fixes and expanded coverage: deadcode.DeadStores in client.c and server.c (no functional changes). 2021-10-18 21:46:09 -05:00
62822be6ce scan-build LLVM-13 fixes and expanded coverage: add WC_UNUSED and PRAGMA_CLANG_DIAG_{PUSH,POP} macros; deploy "#ifndef __clang_analyzer__" as needed; fix violations and suppress false positives of -Wunreachable-code-break, -Wunreachable-code-return, and -enable-checker alpha.deadcode.UnreachableCode; expand scan-build clean build scope to --enable-all --enable-sp-math-all. 2021-10-18 21:46:09 -05:00
7447a567e1 Merge pull request #4480 from JacobBarthelmeh/fuzzing
sanity check on q value with DSA sign
2021-10-19 11:10:51 +10:00
84b845c65b Merge pull request #4478 from maximevince/zephyr-user-settings-override
Zephyr: Rename leftover CONFIG_WOLFSSL_OPTIONS_FILE
2021-10-19 09:51:15 +10:00
a50d1f4870 Merge pull request #4301 from julek-wolfssl/issue-4298
`mem_buf` only used with memory BIO
2021-10-18 10:29:55 -07:00
c07a7deec2 sanity check on q value with DSA sign 2021-10-18 10:17:49 -06:00
77895ac964 Rename leftover CONFIG_WOLFSSL_OPTIONS_FILE to CONFIG_WOLFSSL_SETTINGS_FILE
Signed-off-by: Maxime Vincent <maxime@veemax.be>
2021-10-16 15:43:21 +02:00
0e3218dcd0 ASN: zero-terminate name constraints strings
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-10-15 20:19:05 -03:00
b2c003d7d4 Fix for sniffer to trap negative sslBytes. Revert logic from PR 3493 blocking out of range sequence numbers. Fix ack sequence rollover logic. ZD13036 2021-10-15 11:31:53 -07:00
60adf22ce1 Merge pull request #4468 from SparkiDev/sp_fixes_6
SP: regenerated SP code
2021-10-15 02:27:19 -05:00
b2b39f01b7 Merge pull request #4474 from cconlon/includekds
include IDE/KDS in make dist archive
2021-10-15 08:33:23 +10:00
7bd92e606b Merge pull request #4473 from JacobBarthelmeh/dks7g2
Update DK-S7G2 README.md
2021-10-14 16:29:08 -06:00
17e0249a26 Fixing NO_BIO and OPENSSL_ALL errrors 2021-10-14 16:03:52 -05:00
228f1e233a include IDE/KDS in make dist archive 2021-10-14 14:01:19 -06:00
82a1c4b9f1 Update DK-S7G2 README.md 2021-10-14 13:09:42 -06:00
2aa2ef84b2 Merge pull request #4470 from LinuxJedi/md-cleanups
Cleanup markdown documentation
2021-10-14 11:04:48 -07:00
ed243b3327 nxp: ksdk: add support for Koblitz curves
The Kinetis port implementation currently only supports SECP random
curves. This commit expands it to also support the accepted SECP
koblitz curves, based on user settings. The implementation also makes
it easy to add Brainpool curves.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-10-14 12:33:30 -03:00
61bab6f68b Fix test build errors with NO_BIO 2021-10-14 09:37:01 -05:00
1396c46281 Fix build errors with NO_BIO config 2021-10-14 09:06:54 -05:00
4c70ac73f1 Merge pull request #4467 from dgarske/smtp
Example client: fix for SMTP temp buffer size
2021-10-14 08:16:42 +10:00
b93b7b07a9 Merge pull request #4463 from JacobBarthelmeh/fuzzing
DSA: add check on bit length of q
2021-10-14 08:06:53 +10:00
11e3f867b0 Cleanup markdown documentation
* Add syntax highlighting where appropriate
* Fix some markdown compliance issues
* Add some links for things
* Add some inline code quoting
* Fix some headings
* Fix copyright date in doxygen html output
2021-10-13 16:39:46 +01:00
cc63668691 Merge pull request #4445 from TakayukiMatsuo/tsip113
Add support for TSIPv1.13
2021-10-13 09:26:58 -06:00
5748818427 SP: regenerated SP code 2021-10-13 08:37:38 +10:00
7f1dbd8709 Merge pull request #4420 from douzzer/smallstack-ge-sp
SP, Ed25519: smallstack
2021-10-13 08:33:36 +10:00
03d2e9ad8c Merge pull request #4466 from embhorn/zd13059
Fix for ecc_projective_*_safe visibility
2021-10-13 08:27:47 +10:00
bc97539756 Increase the size of the temp buffer for starttls. Some SMTP servers send larger messages. 2021-10-12 15:13:38 -07:00
b9b5661550 Merge pull request #4465 from LinuxJedi/stm32-fixes
Minor STM32F1 fixes
2021-10-12 11:57:18 -07:00
66c4b6d270 Improve STM32 documentation
Walk through how to create a new STM32CubeMX project for wolfSSL.
2021-10-12 17:13:41 +01:00
be6bf5687b Fix for ecc_projective_*_safe visibilty 2021-10-12 11:12:42 -05:00
97883d78ac Minor STM32F1 fixes
* Not all STM32 RTCs support subseconds in the time struct, so this is
  now ifdef'd using the only obvious define which exists when subseconds
  exist.
* Let wc_GenerateSeed detect STM32's without RNG correctly.
* wolfCrypt test was attempting to use variables that don't exist when
  both WOLFSSL_SMALL_STACK and WC_NO_RNG is defined.
2021-10-12 16:20:36 +01:00
f20f883e94 Merge pull request #4464 from SparkiDev/tls_hs_state_fix
TLS: don't set the handshake state to the record type
2021-10-12 08:18:17 -07:00
ec78b2e368 Merge pull request #4322 from dgarske/se050_branch
NXP SE050 Support
2021-10-12 07:37:58 -07:00
6fbc9be71a Merge pull request #4462 from guidovranken/zd13048
Check return value of mp_grow in mp_mod_2d
2021-10-12 11:36:59 +10:00
544e64f9e4 TLS: don't set the handshake state to the record type 2021-10-12 08:52:58 +10:00
69d5405e91 Merge pull request #4350 from cconlon/pythonCompatD
OpenSSL compatibility fixes: BIO_set_nbio(), SHA3 NID, WOLFSSL_PYTHON
2021-10-12 08:14:34 +10:00
70894383ce Fix for new SHA512 224/256 support with NXP SE050. 2021-10-11 13:01:38 -07:00
90a51490a9 Peer review feedback. Improvements with small stack. 2021-10-11 11:54:03 -07:00
0c1d12c224 Improve keyId logic. Fix minor compile warnings. Change wc_se050_set_config to match naming convention of other function in port. 2021-10-11 11:53:21 -07:00
09ce1e3c5f Improvements to the key id allocation 2021-10-11 11:53:21 -07:00
185d48938d Fixes for building NXP SE050. Add support for automatic initialization of the SE050 if WOLFSSL_SE050_INIT is defined. Optionally can override the portName using SE050_DEFAULT_PORT. 2021-10-11 11:53:21 -07:00
2028d8b63d Add missing se050_port.h. 2021-10-11 11:53:21 -07:00
29f051e585 Fixes and cleanups for NXP SE050 support. 2021-10-11 11:53:19 -07:00
3f76a76c46 SE050 port with support for RNG, SHA, AES, ECC (sign/verify/shared secret) and ED25519 2021-10-11 11:52:12 -07:00
63c9fa7a37 add check on bit length of q with DSA 2021-10-11 09:52:57 -06:00
b8c4e89ea0 Merge pull request #4460 from dgarske/test_init
Refactor API unit test named initializer code for `callback_functions`
2021-10-11 08:25:38 +10:00
511c74ea52 Merge pull request #4456 from dgarske/zd13032
Fix to not try OCSP or CRL checks if there is already an error
2021-10-11 08:20:58 +10:00
0522e19fc1 Check return value of mp_grow in mp_mod_2d
ZD13048
2021-10-10 21:02:03 +02:00
a395305cab Refactor API unit test named initializer code for callback_functions, to avoid older g++ build issues. 2021-10-08 14:04:21 -07:00
f757318eeb Merge pull request #4454 from dgarske/static_mem
Fix for `Bad memory_mutex lock` on static memory cleanup
2021-10-09 00:13:10 +07:00
8760f39476 Skip CRL verification in case no CDP in peer cert 2021-10-08 13:16:08 +02:00
854512105f Merge pull request #4314 from SparkiDev/libkcapi
KCAPI: add support for using libkcapi for crypto (Linux Kernel)
2021-10-07 21:23:05 -07:00
e0abcca040 KCAPI: add support for using libkcapi for crypto (Linux Kernel)
RSA, DH and ECC not testable as no Linux Kernel driver to use.
ECC implementation is customer specific.
2021-10-08 09:07:22 +10:00
dd6e4093b3 Merge pull request #4448 from JacobBarthelmeh/Compatibility-Layer
remove error queue from JNI build and set a default upper bound on it
2021-10-08 08:35:03 +10:00
668f8700a4 Fix to not try OCSP or CRL checks if there is already an error. This fix prevents an error code from being overwritten if there is already a failure. ZD13032 2021-10-07 15:30:16 -07:00
725e503c57 Merge pull request #4451 from SparkiDev/asn_templ_fix_1
ASN template: replicate AddAltName change in template code
2021-10-07 09:23:37 -07:00
8c178118a4 Configure: add option to enable alternate certificate chains (#4455) 2021-10-07 11:14:51 +10:00
9d2082f7e1 Fixes and improvements for crypto callbacks with TLS (mutual auth) (#4437)
* This PR resolves issues with using TLS client authentication (mutual auth) with crypto callbacks. The TLS client auth will not be sent without a private key being set. The solution is to allow setting a public key only if crypto callbacks is enabled and a devId is set.

* Fix to allow using crypto callbacks with TLS mutual authentication where a private key is not available.
* Fix for ED25519 sign when only a private key is loaded.
* Fix to enable crypto callbacks for ED25519 and Curve25519 in TLS by using the _ex init functions.
* Fix for wc_PemToDer return code where a PKCS8 header does not exist.
* Remove duplicate logs in DoCertificateVerify.
* Doxygen API updates: Added crypto callback help and updated use_PrivateKey with info about public key use.

* * Added crypto callback tests for TLS client and server with mutual auth for RSA, ECC and ED25519.
* Enhanced the API unit test TLS code to allow setting CA, cert and key.

* Revert ED25519 changes. Opt to calculate public key directly when required for signing in the TLS crypto callback test. Build configuration fixes.

* Fix to use proper devId in `ProcessBufferTryDecode`.

* Various build fixes due to changes in PR. G++ issue with `missing-field-initializers`. Unused api.c func with DTLS and session export. Duplicate `eccKeyPubFile` def.

* Added crypto callback TLS tests at WOLFSSL object level. Fix for ED25519/ED448 with client mutual auth where the private key is not set till WOLFSSL object. Fix issues with  `wolfSSL_CTX_GetDevId` where devId is set on WOLFSSL object. Enable the `_id` API's for crypto callbacks.

* Proper fix for `eccKeyPubFile` name conflict. Was causing RSA test to fail (expected DER, not PEM).
2021-10-07 11:12:06 +10:00
dfbdcf9400 ASN template: replicate AddAltName change in template code 2021-10-07 09:51:56 +10:00
34c9367cbe refactor location of error queue count and consolidate no error queue macro 2021-10-06 11:55:40 -06:00
928f4ad430 Merge pull request #4452 from LinuxJedi/stm32-readme-fix
Fixes to STM32 README
2021-10-06 10:07:41 -07:00
9f57345614 Fix for Bad memory_mutex lock on static memory cleanup (was free'ing mutex then trying to use it). 2021-10-05 13:46:42 -07:00
da15356c2a Merge pull request #4444 from anhu/pq_bench
Benchmarking the supported groups.
2021-10-05 09:52:51 -07:00
43ffe26133 Merge pull request #4430 from embhorn/zd12976
Add support for X9.42 header
2021-10-05 23:47:42 +07:00
fd54dc4838 Fixes to STM32 README
* Reordered things so that the installation of the Cube Pack comes
  before the Cube Pack usage.
* Added another way to find the pack installation menu (because I'm
  blind to the box on the screen apparently).
* Two extra steps in the Cube Pack Usage that were missing (6 & 8)
* Added syntax highlighting to the markdown.
2021-10-05 14:19:35 +01:00
310a75ff43 Merge pull request #4449 from SparkiDev/fix_1
X509 name: remove unused variable
2021-10-04 20:01:04 -07:00
024c59a04c Merge pull request #4439 from SparkiDev/tls13_min_down_no_ext
TLS 1.3: Check min downgrade when no extensions in ServerHello
2021-10-04 16:39:29 -07:00
152da35ca4 X509 name: remove unused variable 2021-10-05 09:06:10 +10:00
41b9b14cfb whitespace 2021-10-04 18:35:09 -04:00
f77a5e26b5 semi-colon --> colon and use wolfTLSv1_3_server_method when NO_WOLFSSL_CLIENT. 2021-10-04 18:31:28 -04:00
b582e152ea add test case max error queue size 2021-10-04 14:52:05 -06:00
310ab6692a Drop a function brace and WOLFSSL_TLS13. 2021-10-04 13:56:01 -04:00
40ac1c4dd2 remove error queue from JNI build and put a default max on error queue size 2021-10-04 11:45:18 -06:00
0bee624ee5 Merge pull request #4447 from lealem47/oqs-doc 2021-10-04 13:03:46 -04:00
1440b8966d Add test for X9.42 parsing 2021-10-04 11:05:58 -05:00
4084928d93 Slight changes to liboqs documentation in INSTALL and example client/server 2021-10-02 13:14:32 -06:00
72ea8dffe2 Add support for TSIPv1.13 2021-10-02 07:03:12 +09:00
0abbd9b1ec Merge pull request #4438 from ejohnstown/dtls-big
DTLS Related Fixes
2021-10-01 13:04:20 -07:00
2fa0114d54 Benchmarking the supported groups. 2021-10-01 15:38:07 -04:00
97d96c6cf8 Merge pull request #4422 from haydenroche5/cmake
Add a CMake option to build wolfcrypt test and bench code as libraries.
2021-10-01 12:32:50 -07:00
774bc36603 Merge pull request #4061 from JacobBarthelmeh/sessionExport 2021-10-01 10:21:42 -07:00
cd2bd0b7a3 Enable All Disable DTLS fixes
1. Remove mcast and jni from enable-all.
2. Add comment to DTLS section.

Testing `./configure --enable-all --disable-dtls` would leave DTLS still
enabled. enable-all was also enabling mcast, which it doesn't need to
do, that would force DTLS back on. JNI also forces DTLS on. The other
language wrappers are not included in enable-all, so leave JNI out.
2021-10-01 09:56:58 -07:00
faca24c00d Merge pull request #4434 from SparkiDev/armv8_nighlty_1 2021-10-01 09:06:33 -07:00
d48dc55611 Merge pull request #4440 from SparkiDev/jenkins_powerpc_fix_1
ASN: tidy up SetAsymKeyDerPublic()
2021-10-01 08:17:12 -07:00
a575595e5f Merge pull request #4256 from SparkiDev/arm_keil_fix
SP ARM Thumb support for Keil and performance improvements
2021-10-01 07:10:41 -07:00
4473e9335e TLS 1.3: Check min downgrade when no extensions in ServerHello
TLS 1.3 ServerHello must have extensions, so server attempting to
downgrade, but min downgrade was not checked in that case.
2021-10-01 12:51:10 +10:00
66a6153456 Merge pull request #4436 from elms/makefile/add_ed448
GCC makefile: Add sources files
2021-09-30 18:44:36 -07:00
ca002b5ee9 ASN: tidy up SetAsymKeyDerPublic()
Also, nighlty PowerPC Jenkins test complained of use of uninitialized in
function. Ensure vars initialized despite not needing it.
2021-10-01 10:44:07 +10:00
6300989937 SP: Thumb assembly for older Keil compilers and optimize
Improve the generated instructions for multiplying 32 bits by 32 bits
and squaring 32 bits with 64 bit results.
Minimize loads in montgomery reduction, mul and sqr.
Pull conditional subtract into montgomery reduction assembly code.
Added unrolled square and multiply
Define WOLFSSL_SP_LARGE_CODE to use the unrolled versions.
2021-10-01 09:52:29 +10:00
98b1e93429 Merge pull request #4402 from JacobBarthelmeh/Compatibility-Layer 2021-09-30 15:53:58 -07:00
f1a0d00f4e GCC Makefile: wrap async and selftest 2021-09-30 15:51:19 -07:00
ed8b87306d account for test case where psk and anon is off 2021-09-30 15:48:55 -06:00
b0de40d10a Forgive a DTLS session trying to send too much at once. (ZD12921) 2021-09-30 14:27:21 -07:00
2dfc3f308b GCC makefile: Add other missing source files 2021-09-30 14:25:15 -07:00
998c7a9cb9 Merge pull request #4435 from anhu/docfix 2021-09-30 09:50:38 -07:00
cb4b57c5c7 add tls 1.3 test case 2021-09-30 10:08:47 -06:00
833c9d3f71 Fix INSTALL file to specify levels. 2021-09-30 09:43:32 -04:00
38cfec89e8 ARMv8: fix configurations
Poly1305: poly1305_block() is void for ARMv8 ASM
SHA512: explicitly include cryptocb.h.
AES: set keylen for EVP API
AES: Implement streaming AES-GCM.
2021-09-30 10:33:08 +10:00
cf1ce3f073 Add get_default_cert_file/env() stubs, SSL_get/set_read_ahead(), SSL_SESSION_has_ticket/lifetime_hint() (#4349)
* add wolfSSL_X509_get_default_cert_file/file_env/dir/dir_env() stubs

* add SSL_get_read_ahead/SSL_set_read_ahead()

* add SSL_SESSION_has_ticket()

* add SSL_SESSION_get_ticket_lifetime_hint()

* address review feedback - comments, return values

* make SSL_get_read_ahead() arg const

* add unit tests for SESSION_has_ticket/get_ticket_lifetime_hint

* test for SESSION_TICKET_HINT_DEFAULT in api.c for wolfSSL_SESSION_get_ticket_lifetime_hint()

* fix variable shadow warning in api.c
2021-09-30 08:35:23 +10:00
bcd6930581 Various OpenSSL compatibility expansion items, for Python 3.8.5 (#4347)
* make ASN1_OBJECT arg const in OBJ_obj2txt

* add ERR_LIB values to openssl/ssl.h

* add missing alert type definitions in openssl/ssl.h

* add definition for X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS, no support

* define value for X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT

* use correct CRYPTO_THREADID arg type for wolfSSL_THREADID_set_callback callback

* add handshake type defines for compat layer message callback types

* define ASN1_R_HEADER_TOO_LONG for compatibility builds

* use correct return type for wolfSSL_THREADID_set_callback, remove Qt code no longer needed
2021-09-30 08:32:49 +10:00
95b9fae605 Add DIST_POINT compatibility functions (#4351)
* add DIST_POINT compatibility functions

* switch X509_LU_* from enum to define, prevent compiler type warnings

* refactoring, adding in comments, and formating

* refactoring and a memory leak fix

* cast return value for g++ warning

* refactor wolfSSL_sk_DIST_POINT_pop_free and remove NULL assign after free

* fix get next DIST_POINT node for free function

Co-authored-by: Jacob Barthelmeh <jacob@wolfssl.com>
2021-09-30 08:27:39 +10:00
707385724e adjust macro guard around test cases 2021-09-29 13:28:20 -06:00
5f9f6fd9fa add some test cases and use allocator 2021-09-29 12:02:26 -06:00
ecf7dea6a1 Merge pull request #4433 from anhu/unit_tests
Unit tests for post-quantum groups.
2021-09-29 10:31:00 -07:00
dd7b62d067 fix for use with idea enabled 2021-09-29 11:15:51 -06:00
f46f69c1dc GCC makefile: Add ed448 files 2021-09-29 08:17:44 -07:00
ae47cb3bcd update check on is TLS, update macro guard for test case 2021-09-28 16:57:30 -06:00
a55cedd357 Fixup in response to dgarske comments 2021-09-28 18:36:18 -04:00
0e80923fb3 Unit tests for post-quantum groups.
Also, fixes for the things they caught such as:

- ssl->arrays->preMasterSecret is pre-allocated so copy into it instead of
  moving ownership of buffer.
- server does not need to save the public key.
- in TLSX_KeyShare_Parse() don't call TLSX_KeyShare_Use() because its done in
  TLSX_PopulateExtensions().
- in TLSX_KeyShare_Use(), the server generates the ciphertext while the client
  generates the public key.
- in TLSX_PopulateExtensions(), prevent client from calling TLSX_KeyShare_Use()
  because its already been done.
- Support longer curve/group names.
2021-09-28 17:16:44 -04:00
f4be011b91 Merge pull request #4432 from haydenroche5/cmake_user_settings
Don't automatically set BUILD_ED25519_SMALL and BUILD_CURVE25519_SMALL in the  CMake build when using user_settings.h.
2021-09-28 14:01:39 -07:00
a4f927999f Merge pull request #4431 from haydenroche5/is_on_curve_fips
Don't compile wolfSSL_EC_POINT_is_on_curve for FIPS.
2021-09-28 09:42:08 -07:00
a9870d59a3 Don't automatically set BUILD_ED25519_SMALL and BUILD_CURVE25519_SMALL in the
CMake build when using user_settings.h.

See https://github.com/wolfSSL/wolfssl/pull/4367 for the same change to the
autotools build.
2021-09-28 09:00:50 -07:00
6a0bc995a0 Don't compile wolfSSL_EC_POINT_is_on_curve for FIPS.
This function uses wc_ecc_point_is_on_curve, which isn't in the current (v2)
FIPS module.
2021-09-27 16:08:04 -07:00
847b8f9a1f Reduce openssl verbosity in BIO due to PEM_X509_INFO_read_bio reading 1 byte at a time. Remove duplicate PEM_X509_INFO_read_bio macro. (#4428) 2021-09-28 08:21:23 +10:00
702ba65b1c Add support for X9.42 header 2021-09-27 15:37:11 -05:00
6e7c6e8a66 add comments to dox header file 2021-09-27 14:01:15 -06:00
41f3a006ac sanity check on padding size imported 2021-09-27 14:01:15 -06:00
21181f2437 canned test was made without the wolfssl_idea enum on 2021-09-27 14:01:15 -06:00
13478a94a8 sanity check on block size with block cipher type 2021-09-27 14:01:15 -06:00
8b456b90e0 add test case for tls export/import 2021-09-27 14:01:15 -06:00
1929024029 fix for getting export buffer size 2021-09-27 14:01:15 -06:00
64f53c4e1b fix macro name and make api public 2021-09-27 14:01:15 -06:00
22b6cc675a add import/export of peer info with tls 2021-09-27 14:01:15 -06:00
2871fc670f initial serialization of TLS session 2021-09-27 14:00:13 -06:00
943c98a45e Fix some PKCS11 warnings and spelling errors. (#4427) 2021-09-27 08:23:48 +10:00
3bdce348e9 Added NID_pkcs9_contentType and ub_ to compatibility layer (#4408)
* Added `NID_pkcs9_contentType` and `ub_` values.  ZD 11742

* Improve the API unit test. Also only include when `WOLFSSL_CERT_REQ` defined.
2021-09-27 08:21:53 +10:00
9e4ab9b638 Add BIO_up_ref(), PEM_read_DHparam(), EVP_MD_nid() (#4348)
* add BIO_up_ref

* add PEM_read_DHparams()

* add EVP_MD_nid()

* exclude PEM_read_DHparams when NO_FILESYSTEM defined

* review feedback: single threaded, indents, EVP_MD_nid
2021-09-27 08:20:37 +10:00
32e4d5ad70 Use record size instead of buffer size to validate alert length (#4425) 2021-09-27 08:05:13 +10:00
709a84f8b5 Add support for libwolfcrypttest and libwolfcryptbench to autotools flow.
These can be built by configuring with `--enable-crypttests-libs`.
2021-09-25 10:31:06 -07:00
302938d3c6 Improve wolfcrypt test/bench library comments.
These can be built as shared libraries, too, so the comments shouldn't be
specific about static libraries.
2021-09-25 10:30:01 -07:00
7319627533 Merge pull request #4423 from elms/gcc_makefile_options
GCC makefile: allow overriding and provide more flexibility
2021-09-24 14:07:48 -07:00
9634a54b8f Improve CMake build option handling.
Prior to this commit, we only allowed CMake options to be specified according to
a finite set of values. For example if an option "WOLFSSL_FEATURE" was permitted
to take only the values "yes" and "no" and a user ran
`cmake -DWOLFSSL_FEATURE=ON`, that would fail because ON isn't in `[yes, no]`.
However, this behavior runs counter to CMake's way of evaluating boolean values,
which permits a variety of values that evaluate to true/false (see
https://cmake.org/cmake/help/latest/command/if.html#basic-expressions). This
commit will allow the user to specify any value for a build option. If it's not
in the predefined set of values, we use CMake's "if" logic to reduce the value
to yes or no.
2021-09-24 13:54:18 -07:00
ec857f6f62 Add a CMake option to build wolfcrypt test and bench code as static libs.
Application code can use the resulting CMake targets or the static library
artifacts directly (e.g. libwolfcrypttest.a on *nix).
2021-09-24 13:54:18 -07:00
690b7d9800 GCC makefile: fix warning for hard fault format strings 2021-09-24 10:47:47 -07:00
0bf832bd2a fix uninitialized variables 2021-09-24 23:22:04 +09:00
5b3dfabc32 Introduce global protoVerTbl for SSL_CTX_set_min/max_proto_version 2021-09-24 16:05:55 +09:00
8169e12975 Merge pull request #4424 from SparkiDev/rsa_dec_pkcs15
RSA: cast bitwise negate value to byte before converting to int
2021-09-23 21:47:36 -07:00
24e2eded1e Add to the OpenSSL compatibility layer. (#4404)
- X509_get_extension_flags
- X509_get_key_usage
- X509_get_extended_key_usage
- ASN1_TIME_to_tm
- ASN1_TIME_diff
- PEM_read_X509_REQ
- ERR_load_ERR_strings
- BIO_ssl_shutdown
- BIO_get_ssl
- BIO_new_ssl_connect
- BIO_set_conn_hostname
2021-09-24 12:26:53 +10:00
d5a803d81d RSA: cast bitwise negate value to byte before converting to int 2021-09-24 09:18:49 +10:00
33cb823148 Remove legacy NTRU and OQS (#4418)
* Remove NTRU and OQS

* Keep the DTLS serialization format backwards compatible.

* Remove n from mygetopt_long() call.

* Fix over-zealous deletion.

* Resolve problems found by @SparkiDev
2021-09-24 08:37:53 +10:00
23f4aadf27 GCC makefile: allow overriding and provide more flexibility
- older GCC and additional platforms
 - `NO_EXAMPLES` to exclude building .o files
 - add FIPS optional
2021-09-23 14:55:34 -07:00
79787eaaa4 Merge pull request #4419 from anhu/set1_groups_list
Make quantum-safe groups available to the compatibility layer.
2021-09-23 10:28:02 -07:00
82a3d79c2f unnecessary variable init, else formatting in bio.c 2021-09-23 11:26:17 -06:00
a4609c612f Merge pull request #4413 from kabuobeid/wpas_keying
Add HAVE_KEYING_MATERIAL requirement to WPAS, to use wolfSSL_export_keying_material
2021-09-23 10:20:34 -07:00
8818df2d34 Merge pull request #4415 from elms/ppc/define_gates_64bit_literals
Define gate fixes and sha3 64bit literal definitions
2021-09-23 10:18:03 -07:00
58a02495fe Make the quantum-safe groups available to the OpenSSL compatibility layer. 2021-09-22 15:28:44 -04:00
b716c88e01 smallstack refactors for ge_double_scalarmult_vartime(), sp_ModExp_4096(), and sp_DhExp_4096(). 2021-09-22 13:58:05 -05:00
e6e7795140 Make subj alt name order match openSSL (#4406) 2021-09-22 10:29:57 +10:00
df30a88dc6 Merge pull request #4414 from JacobBarthelmeh/devcrypto
update macro guard on SHA256 transform call
2021-09-21 10:03:51 -07:00
63a3eef97a Merge pull request #4403 from dgarske/zd12852_sniffer
Sniffer improvements for handling TCP ack unseen and retransmission issues
2021-09-21 09:53:27 -07:00
7ec7faddef Merge pull request #4405 from anhu/truncating_last_char
Fix for `set1_curves_list` ignoring last character
2021-09-21 08:49:53 -07:00
34c6e8f975 Merge pull request #4407 from douzzer/linuxkm-SIMD-IRQ
linuxkm-SIMD-IRQ
2021-09-20 14:57:38 -07:00
ef33445316 Define gate fixes and sha3 64bit literal definitions
Found when supporting PPC750
2021-09-20 13:48:34 -07:00
6d715130a2 linuxkm: cleanups and smallstack refactors related to WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED, associated linuxkm-SIMD-IRQ PR, and associated peer review:
smallstack refactors for wolfcrypt/src/rsa.c:wc_CheckProbablePrime_ex() and wolfcrypt/src/pwdbased.c:wc_PKCS12_PBKDF_ex();

add WARN_UNUSED_RESULT macro to types.h;

text format cleanup;

fix internal.c:LowResTimer() implementation.

refactor tls13.c:TimeNowInMilliseconds() for kernel 4.9 and 3.16 compat.

use ktime_get_coarse_real_ts64() only for kernel 5.x+.  in kernel 4.x, use its older form, current_kernel_time64(), and in 3.x, use getnstimeofday().

linuxkm/module_hooks.c: fix wolfssl_init() pie code to be compatible with kernel 4.4-;

fix allocate_wolfcrypt_irq_fpu_states() return codes to all be wolfcrypt codes, and in calling code, pass up that code (suggested by dgarske peer review).
2021-09-20 13:46:51 -05:00
ec21dd6d13 miscellaneous buildability fixes:
configure.ac: fix ed25519/sha512 dependency test to not misfire when ENABLED_32BIT;

wolfssl/wolfcrypt/curve{25519,448}.h: fix redundant typedefs of curve{25519,448}_key (fixes -Wpedantic warnings);

configure.ac: fix for "ISO C forbids an empty translation unit [-Werror=pedantic]", re wolfcrypt/src/sp_c{32,64}.c;

configure.ac: fixes for --enable-32bit versus pedantic "ISO C forbids an empty translation unit", including explicit exclusion of 32bit-incompatible algorithms from enable-all and enable-all-crypto sets;

tests/api.c: fixes for a couple inadequately gated SHA2 dependencies;

tests/api.c:test_wolfSSL_set_alpn_protos(): fix prototype missing (void);

wolfcrypt/src/misc.c and wolfssl/wolfcrypt/misc.h: fix ForceZero() definition and NO_INLINE prototype to not counterfactually constify the mem ptr, to avoid -Wmaybe-uninitialized from gcc11;

wolfcrypt/src/des3.c: drop obsolete register qualifier from declaration in DesSetKey(), for c++17 compatibility;

src/ssl.c:wolfSSL_BN_mod_word(): fix cast of arg2 to mp_mod_d().
2021-09-20 13:38:52 -05:00
753a931196 Merge pull request #4416 from SparkiDev/mp_submod_addmod_ct
SP math, TFM: constant time addmod, submod
2021-09-20 11:37:45 -07:00
a62f103899 Merge pull request #4412 from anhu/level
Convert post-quantum algorithm group names
2021-09-20 11:27:20 -07:00
83e0e19e03 linuxkm feature additions:
add build-time support for module signing using native Linux facility;

add support for alternative licenses using WOLFSSL_LICENSE macro;

improve load-time kernel log messages;

add support for sp-math-all asm/AVX2 acceleration;

add error-checking and return in SAVE_VECTOR_REGISTERS();

implement support for x86 accelerated crypto from interrupt handlers, gated on WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED:

  * wolfcrypt_irq_fpu_states
  * am_in_hard_interrupt_handler()
  * allocate_wolfcrypt_irq_fpu_states()
  * free_wolfcrypt_irq_fpu_states()
  * save_vector_registers_x86()
  * restore_vector_registers_x86()

add WOLFSSL_LINUXKM_SIMD, WOLFSSL_LINUXKM_SIMD_X86, and WOLFSSL_LINUXKM_SIMD_ARM macros for more readable gating.
2021-09-20 10:27:13 -05:00
2629b8b1fb wolfcrypt/src/wc_port.c LINUXKM time(): use ktime_get_coarse_real_ts64 instead of ktime_get_real_seconds, to avoid GPL-only function, and fix the calculation in the kernel 3.x codepath. 2021-09-20 10:27:13 -05:00
1209908468 tests/api.c: fix key size in test_wc_ecc_shared_secret(). 2021-09-20 10:27:13 -05:00
45e9872714 wolfcrypt/benchmark: fix output buffer size in bench_eccEncrypt(). 2021-09-20 10:27:13 -05:00
ebf1168240 Documenting the level meanings 2021-09-20 10:11:49 -04:00
c733be728f Trivial change to re-trigger jenkins. 2021-09-20 08:37:56 -04:00
f1ff3da47c fix for case of long type on 32bit systems 2021-09-19 21:20:58 -06:00
ec0335cdb3 Use WOLFSSL_SUCCESS instead of 1. 2021-09-19 17:20:55 -07:00
1bf4dbfa32 rename enum value 2021-09-19 17:20:55 -07:00
3f534e7e07 return macro and macro guards 2021-09-19 17:20:55 -07:00
dae4d637c9 define SSL_OP_* in openssl/ssl.h for compatibility 2021-09-19 17:20:54 -07:00
b8c90b369e bump openssl version for Python 3.8.5 port with WOLFSSL_PYTHON 2021-09-19 17:20:54 -07:00
0f344e4b64 add SHA3 NID and name info to wolfssl_object_info[] 2021-09-19 17:20:54 -07:00
f6b91f04ed BIO_set_nbio() should always return 1, check input bio for NULL before using 2021-09-19 17:20:54 -07:00
f63fac82cd SP math, TFM: constant time addmod, submod
Improve performance of fp_submod_ct() and fp_addmod_ct().
Improve performance of sp_submod_ct() and sp_addmod_ct().
2021-09-20 10:12:21 +10:00
9bd300e07d AESNI in FIPS mode does not support zero length inputs (#4411)
* AESNI in FIPS mode does not support zero length inputs

* Update note to specifically note AESNI
2021-09-20 08:29:15 +10:00
f447e4c1fa update macro guard on SHA256 transform call 2021-09-17 15:06:13 -07:00
5c3c2dd1bf Add HAVE_KEYING_MATERIAL requirement to WPAS, to use wolfSSL_export_keying_material 2021-09-17 14:53:01 -07:00
989179a94a set value for number of protocols in table 2021-09-17 14:04:42 -07:00
b14e9c1134 Sniffer improvements for handling TCP out of order, ack unseen and retransmission issues. 2021-09-17 13:16:39 -07:00
79cc6be806 Make jenkins happy 2021-09-17 15:50:06 -04:00
9ee96c484b update macro guard 2021-09-17 13:17:05 -06:00
13d4722678 Convert post-quantum algorithm group names
... from using parameter set names from the papers to NIST levels.
2021-09-17 13:28:34 -04:00
ffa13f314b Merge pull request #4409 from SparkiDev/tfm_submod_ct
TFM: fp_submod_ct fix check for greater
2021-09-17 08:41:20 -07:00
bb70fee1ec Merge pull request #4390 from anhu/hybridizing
Hybridizing NIST ECC groups with the OQS groups.
2021-09-16 22:01:39 -07:00
9623797064 TFM: fp_submod_ct fix check for greater
a can be greater than modulus.
Update fp_montgomery_reduce_mulx() to reflect the updates to
fp_montgomery_reduce_ex().
2021-09-17 10:12:07 +10:00
ff963e7259 fall back to previous version if PRF not compiled in 2021-09-16 14:08:12 -07:00
5151cc289e Make clang happy. 2021-09-16 14:41:19 -04:00
4380e8b94a Merge pull request #4391 from JacobBarthelmeh/Sniffer
add sanity check on buffer size
2021-09-16 09:36:48 -07:00
f2bce42bbd add function wolfSSL_CTX_get_max_proto_version and handling for edge cases 2021-09-16 01:01:38 -07:00
60aa7b9a62 compat layer adjustments, pseudo rand update, fix for peek with ASN1_R_HEADER_TOO_LONG 2021-09-16 00:56:44 -07:00
3503be2c13 Merge pull request #4362 from JacobBarthelmeh/wolfCLU
add wolfclu enable option and remove test macro guard
2021-09-15 13:57:50 -07:00
07656e371c Parameter sanity check and a unit test. 2021-09-15 16:29:55 -04:00
71e8d3ca3c Merge pull request #4358 from SparkiDev/arm_sha512_crypto
AARCH64 SHA512: implementation using crypto instructions added
2021-09-15 09:51:09 -07:00
4f3c55988b We were ignoring the last character of the group name. 2021-09-15 12:50:04 -04:00
4ad8b07c1c wolfSSL_PEM_write_bio_PUBKEY needs to write only the public part (#4354)
* `wolfSSL_PEM_write_bio_PUBKEY` needs to write only the public part

The `wolfSSL_PEM_write_bio_PUBKEY` output can't contain the private portion of the key. This output could be used to distribute the public key and if it contains the private part then it gets leaked to others.

* Add heap hint to `wolfSSL_RSA_To_Der`

* Correct function name in logs
2021-09-15 17:34:43 +10:00
17c2e9e1cd AARCH64 SHA512: implementation using crypto instructions added
Use --enable-armasm=sha512-crypto or define WOLFSSL_ARMASM_CRYPTO_SHA512
to use SHA512 cryptographic instructions.
Checks system register for the feature before using the SHA512
instructions.
Added SHA512 input data alignment test.
Add support for SHA512/224 and SHA512/256 to ARM port.
2021-09-15 12:05:48 +10:00
d86aed210b Merge pull request #4398 from SparkiDev/cppcheck_fixes_7
cppcheck fixes and a config fix
2021-09-14 18:19:30 -07:00
d9767207b7 call alpn selection call-back at server side only (#4377)
* call alpn selection call-back at server side only

* addressed review comment

* addressed jenkins failure
2021-09-15 10:02:18 +10:00
3c21996002 Merge pull request #4353 from SparkiDev/pkcs11_static_link
PKCS #11: support static linking with PKCS #11 library
2021-09-14 15:26:52 -07:00
4be3b2b351 Merge pull request #4401 from embhorn/gh4400
Fix overflow check in ClientMemSend
2021-09-14 12:20:32 -07:00
9c3d3ffcd2 Merge pull request #4396 from kabuobeid/iotsafe_header
Fix exporting iotsafe functions by adding missing include in iotsafe.c.
2021-09-14 10:01:44 -07:00
2274d0b773 Fix overflow check in ClientMemSend 2021-09-14 11:17:01 -05:00
bfbb445e06 Register cleanup with atexit for OpenSSL compat layer 2021-09-14 16:45:11 +02:00
142c7a9892 cppcheck fixes and a config fix
./configure --disable-rsa --disable-ecc --disable-dsa
--enable-curve25519 --disable-ed25519 --disable-curve448
--disable-ed448 --enable-cryptonly

suites.c, testsuite.c: ensure port is an integer for snprintf.

unit.c: make memFailCount an integer for printf.

aes.c:
  Reduce variable scope.
  Check aes is not NULL before use in GHASH implementations.
XTS check sz is greater than or equal to a AES_BLOCK_SIZE rather than
0 as another block is processed.
  wc_AesXtsEncrypt, wc_AesXtsEncrypt - simplify braces and ifdefs
wc_AesEcbEncrypt - subtracting from sz is unnecessary as is unused
after.

asn.c:
StoreKey, StoreEccKey - compiler doesn't see ret != 0 when publicKey
is NULL.
  DecodeAuthInfo - count is not used when after break.
  DecodeSubtree - don't use min and max as variables (already macros).
SetEccPublicKey - initialize pubSz and set sz regardless for
compiler's sake.
wc_EncodeName_ex - use unique variable 'namesASN'; ret isn't set after
last check.
SetEccPublicKey - simplify code by using else rather than check ret
wasn't set.
  DecodeAsymKey - ret not modified in non-template implementaiton.
  SetAsymKeyDer - ret still at initialized value here.
DecodeResponseData - ensure dataASN is freed when single->next->status
failed to allocate.

test.c:
  curve255519_der_test() can't be compiled when NO_ASN is defined.

types.h:
  cast to the appropriate type in EXIT_TEST
test.h
don't return anything when THREAD_RETURN is void and EXIT_TEST is for
threading with stack size.
2021-09-14 16:08:26 +10:00
ab3bbf11e9 add ASN1_R_HEADER_TOO_LONG case (#4392)
* add ASN1_R_HEADER_TOO_LONG case

* addressed review comments
2021-09-14 12:32:30 +10:00
c8bcfe4763 Add implementation to make wolfSSL_BIO_flush work for WOLFSSL_BIO_FILE (#4395) 2021-09-14 10:08:55 +10:00
39ce723577 Fix exporting iotsafe functions by adding missing include in iotsafe.c. 2021-09-13 16:45:18 -07:00
4d49ab6342 add store finished message on Tls13 (#4381)
* add to store finished message on Tls13

* addressed jenkins failure

* jenkins failures

sanity check for size before copying memory

* remove check of finishSz

* addressed review comments
2021-09-14 09:22:16 +10:00
a65ab0c4af Merge pull request #4189 from SparkiDev/sp_calc_vfy_check_ret
SP ECC: calc vfy point not check mod_inv return
2021-09-13 11:17:50 -07:00
f08b1c49a9 Merge pull request #4371 from anhu/doc_update
Documentation fixup to reflect that we will error out if you set a ba…
2021-09-13 11:14:25 -07:00
f06414903c fix for scan build warning and better check on size 2021-09-13 09:35:55 -06:00
f64c22839e Merge pull request #4380 from SparkiDev/fp_submod_ct_overflow
TFM: check size of inputs
2021-09-13 07:56:54 -07:00
05ed3dc9ea Merge pull request #4387 from SparkiDev/popen_host
Get host name: add code to use popen and the command 'host'
2021-09-13 07:55:45 -07:00
51c1f27065 Merge pull request #4393 from SparkiDev/srp_test_1536
SRP test; increase size of N
2021-09-13 07:29:59 -07:00
bce2c010de Merge pull request #4394 from SparkiDev/regression_fixes_2
Fixes for configurations and a cppcheck fix
2021-09-13 07:22:24 -07:00
c42573096a Fixes for configurations and a cppcheck fix
configure --disable-shared --enable-opensslextra --enable-dsa
--enable-curve25519 --enable-ed25519 --enable-curve448 --enable-ed448
--enable-ocsp --enable-all --enable-asn=template
  GetCertName() sets raw in ASN template code too.
  GetBasicDate() not needed for template ASN.
SetAsymKeyDer() ASN template version now returns 0 when output is NULL
too.

./configure '--disable-shared' '--enable-curve25519' '--enable-ed25519'
'--disable-rsa' '--disable-ecc'
  SetBitString() is needed now.

Close the file before return in wolfSSL_save_session_cache() and
wolfSSL_restore_session_cache().
2021-09-13 10:25:19 +10:00
33028de0de SRP test; increase size of N
SHA512 digest was sometimes too big for the 1024-bit N.
Increase N to 1536 bits to ensure no intermittent fails.
2021-09-13 09:18:26 +10:00
4bd87a0c41 sanity check on pkcs7 input size (#4386) 2021-09-13 08:34:23 +10:00
602ec188ad sanity checks on ed25519 private key decode 2021-09-10 21:51:18 -06:00
ae4766ae96 add sanity check on buffer size 2021-09-10 16:49:42 -06:00
42db91e454 Merge pull request #4389 from SparkiDev/sha512_rework
SHA512: Tidy up and have Sha512_224/256 FinalRaw return smaller digest
2021-09-10 13:01:08 -07:00
93d805352f move setting of ENABLED_MD5 2021-09-10 12:17:11 -06:00
1168d4ce49 changes to address dgarske's comments 2021-09-10 13:51:44 -04:00
c9cf39de64 Make jenkins windows happy? 2021-09-10 13:26:19 -04:00
fb733b4662 Hybridizing the OQS groups with NIST ECC groups. 2021-09-10 13:12:12 -04:00
5a5bc9c571 Remove NAMED_DH_MASK as its usage catches some OQS groups. 2021-09-10 09:44:12 -04:00
cd8bff272c SHA512: Tidy up and have Sha512_224/256 FinalRaw return smaller digest
Make code cleaner by passing in parameters instead of determining from
type.
Remove trailing whitespace.
2021-09-10 09:52:01 +10:00
5e3f7d8778 Add return value checking for FREESCALE_RNGA (#4388) 2021-09-10 08:52:34 +10:00
98f286d8cb Consistent return value from SSL_CTX_load_verify_locations{,_ex} (#4341)
On any failure, return `WOLFSSL_FAILURE`

If there was a failure and a successful processing of certs from the
same directory, the return value depended on the last cert processed
which not guarenteed to be the same order. If the last cert load
failed, it would return the specific wolfSSL error code. If it
succeeded, then WOLFSSL_FAILURE would be returned as a generic failure
due to a previous cert error.
2021-09-10 08:45:13 +10:00
649aa9c95f Add error handling to wolfSSL_BIO_get_len (#4385) 2021-09-10 08:15:30 +10:00
72486333c3 Get host name: add code to use popen and the command 'host'
When compiling for QEMU, the gethostbyname call doesn't have access to
the OS DNS.
Implemented a lookup of hostname that uses the system command host.

Fix for QEMU Aarch64 where 'char' is unsigned and the -1 return is being
converted to 255 in wolfSSL_OPENSSL_hexchar2int().

Test TLSv1.3 with www.google.com if wolfSSL supports it.

CMAC: cannot cast size_t* to word32* when big-endian.

SP math all: Random prime - munge bits before moving them around for
big-endian.

BIO, no filesystem: Allow BIO_prinf to be used with mem BIO.
2021-09-09 18:32:19 +10:00
89dd1a65ca TFM: check size of inputs
fp_submod_ct and fp_addmod_ct need modulus (c) words plus one.
Check that the modulus length is valid for fixed data array size.
Improved fp_submod_ct to only use as many words as necessary.
Added comments to fp_submod_ct and fp_addmod_ct.
2021-09-09 09:20:11 +10:00
934b0ab572 free structure on error case (#4383) 2021-09-09 08:07:22 +10:00
b6665df6a8 Fixes for sniffer handling of TCP spurious retransmission (#4372)
* Fix for sniffer to better handle spurious retransmission edge case. ZD 12852

* Fix for sniffer to not send alerts during application data processing.

* Fix for missing semi-colon on XFREE.

* Fix for `bench_stats_print` with stack variable name used in `bench_ecc`. Improve benchmark thread cleanup, CPU count calcuation and stat blocking logic.
2021-09-08 09:40:58 +10:00
078e0a7379 add unlock of mutex in fail cases (#4378) 2021-09-08 08:51:34 +10:00
a118de1043 copy sessionCtxSz (#4375) 2021-09-08 08:03:35 +10:00
3ca1900528 Merge pull request #4379 from haydenroche5/cmake
Fix issue with CMake build where CMAKE_C_FLAGS is empty.
2021-09-07 14:15:18 -07:00
93d3739ae7 Fix issue with CMake build where CMAKE_C_FLAGS is empty. 2021-09-07 12:11:43 -07:00
51a2f9de17 return value convention on compatibility layer (#4373)
* return value convention

* addressed review comments

* addressed review comment part2

* fix jenkins failures
2021-09-07 08:15:08 +10:00
d4387493fb keep CRLInfo at own cert memory (#4374) 2021-09-07 08:11:29 +10:00
10a4cfae9d Documentation fixup to reflect that we will error out if you set a bad group identifier 2021-09-03 12:46:44 -04:00
4844f7598e account for 32bit build with ed25519 2021-09-03 10:03:37 -06:00
90116a2873 Add support for wolfSSL_EVP_PBE_scrypt (#4345) 2021-09-03 15:49:02 +10:00
35cef831bf Fix for missing heap hint with RSA PSS and WOLFSSL_PSS_LONG_SALT (#4363)
* Fix for missing heap hint with RSA PSS and `WOLFSSL_PSS_LONG_SALT`. This fix will only allocate buffer if it exceeds the local buffer. Added `wc_RsaPSS_CheckPadding_ex2` to support heap hint if required. Fixed asn.c build issue with `NO_CERTS`. Fixed several spelling errors in asn.c. ZD12855.

* Improve the dynamic memory NULL checking in `wc_RsaPSS_CheckPadding_ex2` with `WOLFSSL_PSS_LONG_SALT` defined.
2021-09-03 15:42:31 +10:00
a3ee84bf6d Merge pull request #4355 from anhu/check_support_of_group
BUGFIX: Its possible to send a supported group that is not supported.
2021-09-02 20:03:32 -07:00
43cb7d5ada Merge pull request #4368 from haydenroche5/cmake
Make sure CMAKE_C_FLAGS gets parsed for defines to add to options.h.
2021-09-02 20:01:08 -07:00
fd77cb8918 fix wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex bound checks (#4369)
RFC3394 in must be at least 2 64-bit blocks and output is one block longer.
On Unwrapping the input must then be a minimum of 3 64-bit blocks
2021-09-03 12:48:01 +10:00
1662b01157 Merge pull request #4367 from julek-wolfssl/zd12834
Changes for ED25519 and `HAVE_SECRET_CALLBACK`
2021-09-02 15:46:44 -07:00
c412d23b07 add wolfclu enable option 2021-09-02 16:46:38 -06:00
a9a1158f46 Remove test cases not supported by ARM64_ASM in FIPS mode - OE25 (#4342) 2021-09-03 08:37:34 +10:00
26c7592d4b leantls only supports secp256r1. 2021-09-02 17:38:04 -04:00
12d7487774 Make sure CMAKE_C_FLAGS gets parsed for defines to add to options.h.
For example, if a user does

```
cmake -DCMAKE_C_FLAGS="-DWOLFSSL_AESGCM_STREAM -DFP_MAX_BITS=16384" ..
```

definitions for `WOLFSSL_AESGCM_STREAM` and `FP_MAX_BITS 16384` should wind up
in options.h (same as the autotools build).
2021-09-02 13:00:24 -07:00
428fe29537 Remove authentication related logic from TLSX_ValidateSupportedCurves() 2021-09-02 14:07:06 -04:00
03fba72027 Merge pull request #4361 from julek-wolfssl/GetASNHeader-return
Missing `GetASNHeader` return handling
2021-09-02 09:18:06 -07:00
587389d137 Merge pull request #4366 from douzzer/cpp-anon-inline-unions
C++ HAVE_ANONYMOUS_INLINE_AGGREGATES sensing
2021-09-02 09:14:31 -07:00
4a26b53dfc Changes for ED25519 and HAVE_SECRET_CALLBACK
- `HAVE_SECRET_CALLBACK` needs to have `wolfSSL_SSL_CTX_get_timeout` and `wolfSSL_SSL_get_timeout` available
- Call `wolfSSL_KeepArrays` for `HAVE_SECRET_CALLBACK`
- Increase the default `DTLS_MTU_ADDITIONAL_READ_BUFFER` and make it adjustable by the user
- Don't truncate application data returned to user in `wolfSSL_read_internal`
2021-09-02 15:58:30 +02:00
abc046b5b7 Missing GetASNHeader return handling 2021-09-02 14:56:58 +02:00
56843fbefd Add support for EVP_sha512_224/256 (#4257) 2021-09-02 14:05:07 +10:00
504e27dfa7 Merge pull request #4357 from gojimmypi/patch-1
Espressif README Syntax / keyword highlighting / clarifications
2021-09-01 18:35:32 -07:00
e079b357df copy missing Espressif/ESP-IDF files from wolfssl/wolfcrypt/benchmark (#4273)
* copy missing files from wolfssl/wolfcrypt/benchmark

* instead of GitHub copy, update setup to perform the copy of ESP-IDF benchmark files; add --verbose option

* update setup to perform the copy of ESP-IDF benchmark files; add --verbose option

* copy benchmark.c / benchmark.h at setup time
2021-09-01 18:34:46 -07:00
bac0497c35 PKCS7 fix for double free on error case and sanity check on set serial number (#4356)
* check for error value on set serial number

* set pointer in fail case
2021-09-02 09:13:35 +10:00
c8f65ec404 wolfcrypt/types.h: fix HAVE_ANONYMOUS_INLINE_AGGREGATES sensing to correctly accommodate C++ builds. 2021-09-01 17:01:55 -05:00
5e12fa3eb7 Some small bugfixes uncovered by the unit tests. 2021-09-01 16:25:04 -04:00
096db7577f Make jenkins happy. \n\nI feel like I should put the guard around the whole function but then other things break. 2021-09-01 10:54:52 -04:00
0d6d171fa4 BUGFIX; Its possible to sending a supported group that is not supported.
This change fixes that.
2021-09-01 10:54:52 -04:00
d23b0784b3 Fix for building session tickets without TLS v1.3. Broken in PR #4275. (#4360) 2021-09-01 10:06:31 +10:00
9b6cf56a6e Expanded support for Curve25519/Curve448 and TLS v1.3 sniffer (#4335)
* Fixes for building with Ed/Curve25519 only. Fix for IoT safe demo to exit after running once. Added `WOLFSSL_DH_EXTRA` to `--enable-all` and `--enable-sniffer`. Cleanup uses of `==` in configure.ac. Various spelling fixes.

* Fix for sniffer with TLS v1.3 session tickets.

* Fix for ASN Template Ed25519 key export (missing version / not setting OID correctly).

* Add key import/export support for Curve25519/Curve448. Refactor of the 25519/448 ASN code to combine duplicate code.

* Refactor of Curve25519 code. Improved public key export to handle generation when only private is set. Improved private scalar buffer sizing.

* Fix for static ephemeral loading of file buffer.

* Added sniffer Curve25519 support and test case.

* Fix for sniffer to not use ECC for X25519 if both are set.

* Fix Curve448 public export when only private is set.

* Fix for `dh_generate_test` for small stack size.

* Reduce stack size use on new asymmetric DER import/export functions. Cleanup pub length calc.

* Fix invalid comment.
2021-09-01 09:28:24 +10:00
e25b17b108 Syntax / keyword highlighting / clarifications
See https://github.com/espressif/esp-wolfssl/issues/11
2021-08-30 17:35:17 -07:00
0f0ba46ac5 Merge pull request #4352 from haydenroche5/dsa_fips
Allow OpenSSL DSA sign/verify functions with FIPS.
2021-08-30 15:47:38 -07:00
35a917e527 Merge pull request #4337 from miyazakh/py_get_ca_certs
fix python ut, get_ca_certs
2021-08-30 14:02:05 -07:00
4645a6917c Merge pull request #4168 from JacobBarthelmeh/wolfCLU
function additions and fixes for expansion of wolfCLU
2021-08-30 13:42:50 -07:00
078d49ea6f Merge pull request #4333 from dgarske/evp_devid
EVP key support for heap hint and crypto callbacks
2021-08-30 11:59:27 -07:00
ee07bd3fa9 Merge pull request #4331 from SparkiDev/jenkins_fixes_4
Jenkins nighlty fixes
2021-08-30 10:29:00 -07:00
85df95e10d Merge pull request #4324 from miyazakh/maxfragment
add set_tlsext_max_fragment_length support
2021-08-30 10:21:59 -07:00
2a6b8f4912 Merge pull request #4275 from JacobBarthelmeh/Compatibility-Layer
add set num tickets compat function
2021-08-30 09:26:49 -07:00
218f4c80f9 PKCS #11: support static linking with PKCS #11 library
--enable-pkcs11=static LIBS=-l<pkcs11 static library>
or
define HAVE_PKCS11_STATIC
2021-08-30 12:28:28 +10:00
3ca77bb09b Allow OpenSSL DSA sign/verify functions with FIPS. 2021-08-29 18:22:30 -07:00
0488caed4c Merge pull request #4346 from cconlon/verifyPostHandshake
TLS 1.3: add support for WOLFSSL_VERIFY_POST_HANDSHAKE verify mode
2021-08-30 09:47:23 +10:00
c7645a42a7 Merge pull request #4320 from anhu/liboqs_keyshare_updated
WolfSSL support for OQS's implementation of NIST Round 3 KEMs as TLS 1.3 groups
2021-08-27 17:42:25 -07:00
070029fd08 add support for WOLFSSL_VERIFY_POST_HANDSHAKE verify mode 2021-08-27 14:49:47 -06:00
65cfef5337 fix for free with test case 2021-08-27 14:10:06 -06:00
9a438ce289 liboqs integration using keyshare/supported_groups extensions in TLS 1.3 2021-08-27 13:56:53 -04:00
83d39932bb add test case for X509 EXTENSION set 2021-08-27 11:30:44 -06:00
412528e18b Merge pull request #4336 from elms/sp_out_of_range
sp_math: error on multiplier larger than curve order
2021-08-27 10:15:42 -07:00
8b79f77fb0 Merge pull request #4327 from JacobBarthelmeh/Compatibility-Layer-Part3
add implementation of AUTHORITY_INFO_ACCESS_free
2021-08-27 09:27:34 -07:00
40a4015491 add no server macro guard 2021-08-27 08:28:50 -06:00
ff9fed08a3 fix count on number of tickets sent 2021-08-26 21:17:45 -06:00
db8f4e4f19 Jenkins nighlty fixes
wolfSSL_Rehandshake(): don't set 'ret' unless HAVE_SESSION_TICKET
defined (otherwise compiler will complain:  warning: Value stored to
'ret' is never read)

AES GCM streaming: fix 64-bit word version to compile and pass testing
Use '--enable-aesgcm=word' to get the word32 or word64 implementation
depending on the availabilty of 64-bit type.
2021-08-27 08:46:39 +10:00
a52df87c8a adjust type for max tickets variable and number sent with WOLFSSL_TLS13_TICKET_BEFORE_FINISHED macro 2021-08-26 15:45:21 -06:00
21159659cf add implementation of AUTHORITY_INFO_ACCESS_free 2021-08-26 14:48:12 -06:00
ef0fb6520d Merge pull request #4283 from JacobBarthelmeh/Compatibility-Layer-Part2
couple more compatibility functions
2021-08-26 11:50:09 -07:00
c631cffe3d Merge pull request #4334 from miyazakh/py_store_stats
fix python unit test failure, cert_store_stats
2021-08-26 10:24:24 -06:00
b5d42eb773 Merge pull request #4318 from kojo1/i2d_RSA
arg type compatibility
2021-08-26 09:51:43 -06:00
3896016121 fix python ut, get_ca_certs 2021-08-26 13:51:28 +09:00
be2ad82e6d sp_math: error on multiplier larger than curve order
zd 12674
2021-08-25 14:59:51 -07:00
cb3f42482b Merge pull request #4332 from dgarske/zd12791
Improve CRL error codes
2021-08-25 13:57:46 -07:00
3a9d463ef4 Fix use of hardcoded number and added comment. 2021-08-25 09:57:10 -07:00
77eff68b95 addressed review comment 2021-08-25 11:07:32 +09:00
9b4a635372 fix python unit test failure, cert_store_stats 2021-08-25 10:20:48 +09:00
3f2abef212 Merge pull request #4321 from haydenroche5/libimobiledevice
Make changes to support libimobiledevice.
2021-08-24 17:19:26 -07:00
b8263f44f7 Added new EVP API for creating a private key for use with crypto callbacks. Improvements to heap hint and devId with EVP layer. 2021-08-24 12:14:44 -07:00
700b1c56c1 Improve CRL error codes. Add --enable-crl=io option. ZD 12791 2021-08-24 11:12:12 -07:00
196e092023 Merge pull request #4328 from dgarske/zd12801
Fix for sniffer TCP sequence rollover
2021-08-24 10:05:49 -07:00
3d8dc68266 free test case object 2021-08-24 10:59:38 -06:00
ff521a14e4 add test case and macro mapping 2021-08-24 10:59:38 -06:00
de3416998c fix for memory leak 2021-08-24 10:58:33 -06:00
80d4e0f644 function additions and fixes for expansion of wolfCLU 2021-08-24 10:58:33 -06:00
7ff1351971 Make changes to support libimobiledevice.
- `EVP_PKEY_assign_RSA` should store the private key in DER format, not the
public key.
- The last call to `infoCb` in `wolfSSL_BIO_write` should provide the length of
the data to write.
- We should be able to parse RSA public keys starting with BEGIN RSA PUBLIC KEY
and ending with END RSA PUBLIC KEY.
2021-08-24 08:52:43 -07:00
a1e26e7bc7 Merge pull request #4308 from dgarske/sess_row_cache
Improvements to session locking to allow per-row
2021-08-24 09:07:03 +10:00
9c541568fc Merge pull request #4313 from SparkiDev/rsa_vfy_only
SP RSA verify only: fix to compile
2021-08-23 14:42:56 -07:00
fe83d2d941 Fix for sniffer TCP sequence rollover. The math to detect and compute the rollover was off by one. ZD 12801. 2021-08-23 13:54:28 -07:00
da6e8d394f shift instead of multiply and add comment 2021-08-23 13:24:27 -06:00
a13c2e2304 Fix for macro arg paren and double ampersand. Fixes building with ENABLE_SESSION_CACHE_ROW_LOCK. 2021-08-23 09:56:07 -07:00
6ec28f508e Merge pull request #4325 from SparkiDev/jenkins_fixes_3
OpenSSL Extra builds: fixes from nightly builds failing
2021-08-23 09:30:15 -07:00
206b4641e8 Merge pull request #4326 from danielinux/iotsafe-fix-warning
Fix compiler warnings
2021-08-23 08:35:29 -07:00
b56c89bb84 Fix compiler warnings (ZD12802 and others) 2021-08-23 08:12:24 +02:00
4bfd0443a7 OpenSSL Extra builds: fixes from nightly builds failing
Prototype is required when internal.h is not included and GetCA is not
defined.

wolfSSL_EVP_CIPHER_CTX_set_iv_length() is called with CBC cipher in
api.c. Function is not specificly for GCM, though not strictly needed
for CBC.
2021-08-23 12:55:27 +10:00
8808e6a3ac implement set_tlsext_max_fragment_length 2021-08-23 09:08:14 +09:00
26cf17e602 Merge pull request #4317 from SparkiDev/math_x86_asm_fix
Maths x86 asm: change asm snippets to get compiling
2021-08-20 13:42:15 -07:00
c8926a45ab Improvements to session locking to allow per-row. Can manually be enabled with ENABLE_SESSION_CACHE_ROW_LOCK or forcefully disabled using NO_SESSION_CACHE_ROW_LOCK. Enabled by default for Titan cache. ZD 12715. 2021-08-20 13:03:50 -07:00
10c5e33027 arg type compatibility 2021-08-20 15:21:06 +09:00
dbb03cb5a3 SP RSA verify only: fix to compile
Configurations:
./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=small2048 --enable-sp-math

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=2048 --enable-sp-math

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=small2048 --enable-sp-math-all

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=small2048 --enable-sp-math --enable-sp-asm

./configure --disable-asn --disable-filesystem --enable-cryptonly
--disable-dh --disable-sha224 --disable-ecc CFLAGS=-DWOLFSSL_PUBLIC_MP
--enable-rsavfy --enable-sp=2048 --enable-sp-math --enable-sp-asm
2021-08-20 13:16:58 +10:00
fa8f23284d Maths x86 asm: change asm snippets to get compiling
TFM:
  Use register or memory for c0, c1, c2 in SQRADD and SQRADD2.
SP:
  Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD,
SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
2021-08-20 10:35:49 +10:00
e7ef48d2b7 Merge pull request #3869 from SparkiDev/asn1_template
ASN1 Template: stricter and simpler DER/BER parsing/construction
2021-08-19 12:47:04 -07:00
3226e69649 --enable-linuxkm-pie (FIPS Linux kernel module) (#4276)
* Adds `--enable-linuxkm-pie` and associated infrastructure, to support FIPS mode in the Linux kernel module.
* Adds `tests/api.c` missing (void) arglist to `test_SSL_CIPHER_get_xxx()`.
2021-08-19 09:15:52 -07:00
16ad5cf3c5 Merge pull request #4315 from SparkiDev/g++_fix_3
SRP test: use proper SRP hash type for g++
2021-08-19 08:56:43 -07:00
17a569d4dd SRP test: use proper SRP hash type for g++ 2021-08-19 11:40:43 +10:00
d486b89c61 ASN1 Template: stricter and simpler DER/BER parsing/construction
Reduce debug output noise
2021-08-19 11:32:41 +10:00
63fde01e32 Merge pull request #4311 from haydenroche5/rsyslog
Make improvements for rsyslog port.
2021-08-18 16:55:32 -07:00
9a1233c04d Merge pull request #4312 from julek-wolfssl/DH_set_length
Implement `DH_set_length`.
2021-08-18 16:42:38 -07:00
eaded189ff Merge pull request #4310 from haydenroche5/dsa_fips
Don't run test_wolfSSL_DSA_SIG if HAVE_FIPS is defined.
2021-08-18 16:33:26 -07:00
18314e5a4f Merge pull request #4309 from dgarske/sniff_cleanups
Improved sniffer statistics and documentation
2021-08-18 16:03:38 -07:00
c2b88a1fca Merge pull request #4306 from dgarske/pk_tls13
Fixes for PK callbacks with TLS v1.3
2021-08-18 15:42:19 -07:00
8df65c3fa7 Merge pull request #4270 from dgarske/zd12586
Fixes for various PKCS7 and SRP build issues
2021-08-19 08:12:15 +10:00
ef77cd05d4 Merge pull request #4302 from haydenroche5/libssh2
Add missing ECDSA_SIG getter/settter for libssh2.
2021-08-18 15:08:06 -07:00
c5f9e55567 Fixes for CMAC compatibility layer with AES CBC disabled. CMAC code cleanups. Fixes for "make check" with AES CBC disabled. 2021-08-18 11:30:18 -07:00
6237a7a00d Merge pull request #4305 from TakayukiMatsuo/i2t
Add support for wolfSSL_i2t_ASN1_OBJECT
2021-08-18 10:37:08 -06:00
162f14aaf9 Implement DH_set_length. 2021-08-18 13:24:51 +02:00
3c06dd6fa8 SP ECC: calc vfy point not check mod_inv return
Not all implementations return an error though.
2021-08-18 10:05:29 +10:00
8f7e09d9b5 Merge pull request #4294 from dgarske/tls13_earlydata
Fix early data max size handling in TLS v1.3
2021-08-18 08:48:42 +10:00
d1e027b6fa Fix for pedantic warning with pre-processor in macro. 2021-08-17 14:55:42 -07:00
f5076cad1b Added new files to include.am. 2021-08-17 13:20:34 -07:00
d6f5f815e1 Fix for srp_test_digest return code checking. Added GCC-ARM TLS server example. 2021-08-17 11:12:40 -07:00
95178e3bdc Use void* on heap hint test. Also previously fixed in hmac.c. 2021-08-17 10:52:50 -07:00
89904ce82e Fixes for building without AES CBC and support for PKCS7 without AES CBC. 2021-08-17 10:47:19 -07:00
a9b8b6d3de Fix for PKCS7 heap hint in API unit test. 2021-08-17 10:46:53 -07:00
e1f603301b Fixes for SRP with heap hint. 2021-08-17 10:45:50 -07:00
c598688f89 Fix for static memory with bucket size matching. 2021-08-17 10:38:27 -07:00
69d01afd3a Merge pull request #4250 from danielinux/iotsafe
IoT-Safe with TLS demo
2021-08-17 08:26:19 -07:00
5209e235a7 Merge pull request #4307 from SparkiDev/srp_test_digests
SRP test: increase size of N to support larger digests
2021-08-17 08:24:47 -07:00
c16127d9ab Make improvements for rsyslog port.
- Remove FP_MAX_BITS and RSA_MAX_BITS definitions from rsyslog config. A user
configuring wolfSSL for rsyslog support should set them as they see fit (i.e.
based on the key sizes they need to support).
- After testing with wolfSSL FIPS, I discovered that some functions were missing
from the compatibility layer that rsyslog needs. Notably wolfSSL_DH_generate_key
and wolfSSL_DH_set0_pqg. These were gated out of compilation based on HAVE_FIPS.
However, they only need to be compiled out if WOLFSSL_DH_EXTRA is defined. This
is because these functions call SetDhInternal, which calls wc_DhImportKeyPair
if WOLFSSL_DH_EXTRA is defined. wc_DhImportKeyPair isn't available in the FIPS
module's dh.c. So, these functions can exist in the FIPS build provided
WOLFSSL_DH_EXTRA isn't defined. This commit accounts for this scenario.
2021-08-17 08:19:43 -07:00
421be50cb8 Add support for wolfSSL_i2t_ASN1_OBJECT 2021-08-17 10:52:20 +09:00
95ab6ce4b8 Don't run test_wolfSSL_DSA_SIG if HAVE_FIPS is defined.
This test calls `wolfSSL_DSA_do_sign_ex` and `wolfSSL_DSA_do_verify_ex`, both
of which don't exist if `HAVE_FIPS` is defined.
2021-08-16 17:42:00 -07:00
5c00951f09 Do not add DH padding on failure. 2021-08-16 16:31:18 -07:00
9898b5d82b Various spelling fixes. 2021-08-16 16:31:18 -07:00
0ea5046b39 Improved documentation for sniffer statistics (ZD 12731). 2021-08-16 16:31:18 -07:00
9066ab6051 SRP test: increase size of N to support larger digests
Test all digests supported by SRP.
2021-08-17 09:15:07 +10:00
6ac03d41ef Merge pull request #4203 from SparkiDev/tls13_peek_fix_off
TLS 1.3: ability to turn peek change off
2021-08-16 15:25:58 -07:00
63d1bd13d4 Add missing ECDSA_SIG getter/settter for libssh2. 2021-08-16 14:43:13 -07:00
c8fd5d552e IoTSafe Improvements. Use new hex to char functions in misc.c. Fix for arm-none-eabi missing nano specs. Cleanups for IoTSafe code, README.md and user_settings.h. Fix linker script to use flash at 0x8000000. Support for TLS v1.3. 2021-08-16 13:13:32 -07:00
490eeb4003 Support for IoT-Safe with TLS demo 2021-08-16 13:13:30 -07:00
70535f51d5 Fixes for PK callbacks with TLS v1.3. Tested with ./configure --enable-pkcallbacks CFLAGS="-DTEST_PK_PRIVKEY -DDEBUG_PK_CB". 2021-08-16 13:09:17 -07:00
c6f0fb11d0 Merge pull request #4253 from julek-wolfssl/lighttpd-1.4.55
Implement `wolfSSL_set_client_CA_list` and add 'HIGH' cipher suite
2021-08-16 15:05:51 -05:00
1ac95b5716 Merge pull request #4303 from haydenroche5/rsyslog
Add support for rsyslog.
2021-08-16 11:20:28 -07:00
6a37309ece Merge pull request #4300 from julek-wolfssl/libimobiledevice
Missing API for libimobiledevice
2021-08-16 09:40:42 -07:00
93a53d72de mem_buf only used with memory and pair BIOs 2021-08-16 13:38:51 +02:00
bbb514fa6d Add support for rsyslog.
- Add an --enable-rsyslog option to configure.ac.
- Add a few missing `WOLFSSL_ERROR` calls that were expected by rsyslog unit
  tests.
- Add better documentation around `WOLFSSL_SHUTDOWN_NOT_DONE` and define it to
  be 0 (rather than 2) when `WOLFSSL_ERROR_CODE_OPENSSL` is defined. This is in
  accordance with OpenSSL documentation. Without this change, rsyslog was
  failing to do the bidirectional shutdown properly because it was checking the
  shutdown return value against 0. I'm keeping the old value when
  `WOLFSSL_ERROR_CODE_OPENSSL` isn't defined because it's part of the public
  wolfssl interface (it's in ssl.h).
2021-08-13 23:24:28 -07:00
0f6e564093 Rebase fixes 2021-08-14 00:35:55 +02:00
6a5f40d698 Code review fixes. 2021-08-14 00:25:00 +02:00
72f1d0adac Refactor client_CA API to use wolfSSL_sk_X509_NAME_* API 2021-08-14 00:24:24 +02:00
62cab15c64 Reorganize wolfSSL_sk_X509_NAME_*
Make the `wolfSSL_sk_X509_NAME_*` API's available in OPENSSL_EXTRA for use with `client_CA_list` API's.
2021-08-14 00:24:24 +02:00
d4391bd997 Parse distinguished names in DoCertificateRequest
The CA names sent by the server are now being parsed in `DoCertificateRequest` and are saved on a stack in `ssl->ca_names`.
2021-08-14 00:24:08 +02:00
647e007eea Implement wolfSSL_set_client_CA_list and add 'HIGH' cipher suite 2021-08-14 00:24:08 +02:00
b2380069f0 Merge pull request #4261 from dgarske/rsa_der_pub 2021-08-13 13:36:01 -07:00
ca06694bfb Merge pull request #4282 from miyazakh/SSL_CIPHER_xx
Add SSL_CIPHER_get_xxx_nid support
2021-08-13 13:48:31 -06:00
5235b7d1e6 Merge pull request #4291 from miyazakh/PARAM_set1_ip
Add X509_VERIFY_PARAM_set1_ip support
2021-08-13 13:45:33 -06:00
1acf64a782 Add support for value zero as version parameter for SSL_CTX_set_min/max_proto_version 2021-08-14 02:16:34 +09:00
ec4e336866 Merge pull request #4299 from haydenroche5/evp_pkey_dec_enc_improvements
Make improvements to wolfSSL_EVP_PKEY_encrypt and wolfSSL_EVP_PKEY_decrypt.
2021-08-13 08:10:20 -07:00
14bbf49118 Merge pull request #3726 from julek-wolfssl/openresty
Openresty
2021-08-13 08:06:46 -07:00
59d04efee8 Missing API for libimobiledevice 2021-08-13 16:32:53 +02:00
3be13f7358 Make improvements to wolfSSL_EVP_PKEY_encrypt and wolfSSL_EVP_PKEY_decrypt.
- Handle case where output buffer is NULL. In this case, passed in output buffer
  length pointer should be given the maximum output buffer size needed.
- Add better debug messages.
2021-08-12 18:46:15 -07:00
7dea1dcd39 OpenResty 1.13.6.2 and 1.19.3.1 support
# New or Updated APIs
- wolfSSL_get_tlsext_status_type
- wolfSSL_X509_chain_up_ref
- wolfSSL_get0_verified_chain
- SSL_CTX_set_cert_cb
- SSL_certs_clear
- SSL_add0_chain_cert ssl_cert_add0_chain_cert
- SSL_add1_chain_cert ssl_cert_add1_chain_cert
- sk_X509_NAME_new_null
- SSL_CTX_set_cert_cb
- SSL_set0_verify_cert_store
- SSL_set_client_CA_list

# Other Changes
- Ignore gdbinit
- Add api.c tests for new API
- Add `WOLFSSL_X509_STORE* x509_store_pt` to `WOLFSSL`
- Add macro to select the `WOLFSSL` specific store when available and the associated `WOLFSSL_CTX` store otherwise. Calls to `ssl->ctx->cm` and `ssl->ctx->x509_store*` were replaced by macros.
- NO-OP when setting existing store
- Add reference counter to `WOLFSSL_X509_STORE`
- Cleanup MD5 redundant declarations
- WOLFSSL_ERROR may map to nothing so make assignment outside of it
- refMutex fields are excluded with SINGLE_THREADED macro
- Chain cert refactor
- Make `wolfSSL_add0_chain_cert` and `wolfSSL_add1_chain_cert` not affect the context associated with the SSL object
- `wolfSSL_CTX_add1_chain_cert` now updates the `ctx->certChain` on success and stores the cert in `ctx->x509Chain` for later free'ing
2021-08-12 23:58:22 +02:00
8601c14f1c Merge pull request #4297 from anhu/master
Fix a race condition in the benchmark example and …
2021-08-12 13:51:43 -07:00
cccb8f940a Merge pull request #4209 from julek-wolfssl/net-snmp
Add support for net-snmp
2021-08-12 13:06:21 -07:00
96c223e585 Merge pull request #4288 from julek-wolfssl/get-date-from-cert
Add a test/example for parsing the date from a certificate
2021-08-12 12:52:52 -07:00
93a1fe4580 Merge pull request #4205 from julek-wolfssl/wpas-include-extra-stuff
Include stuff needed for EAP in hostap
2021-08-12 11:17:23 -07:00
d4b0ec0705 Merge pull request #4290 from TakayukiMatsuo/general
Add wolfSSL_GENERAL_NAME_print
2021-08-12 09:51:28 -06:00
7c75b9836e Changes to make Jenkins happy and reduce verbosity.
- added HAVE_PTHREAD guards
- usleep ---> XSLEEP_MS
- only print polling message if verbose output requested.
2021-08-12 11:13:15 -04:00
5dff4dd4e0 Merge pull request #4280 from dgarske/caam_macros
Fixes for CAAM build macros and spelling
2021-08-12 19:19:31 +07:00
e583d0ab76 SslSessionCacheOn -> SslSessionCacheOff 2021-08-12 13:52:25 +02:00
517309724a Add wolfSSL_GENERAL_NAME_print 2021-08-12 14:17:41 +09:00
0b070166cb addressed review comments 2021-08-12 10:44:07 +09:00
4fa69c0a3a addressed review comments 2021-08-12 07:41:24 +09:00
9c3502bea9 Merge pull request #4285 from haydenroche5/alerts
During the handshake, make sure alerts are getting read on the client side in the event of an error.
2021-08-11 15:22:05 -07:00
0a238483c1 Merge pull request #4296 from lealem47/fix-link
Fix broken link in examples/README.md
2021-08-11 15:21:43 -07:00
fc4e4eacba Merge pull request #4292 from kojo1/evp
EVP_CIPHER_CTX_set_iv_length
2021-08-11 16:13:26 -06:00
586317f198 Fix a race condition in the benchmark example and all output goes to stderr. 2021-08-11 17:07:01 -04:00
9bbb32c352 Merge pull request #4295 from haydenroche5/stunnel_key_gen
Turn on key generation for --enable-stunnel.
2021-08-11 11:17:30 -07:00
d39b91de27 Merge pull request #4266 from dgarske/hexchar 2021-08-11 10:56:53 -07:00
d4d225e33f Fix broken link in examples/README.md 2021-08-11 10:49:38 -06:00
dd4adacee8 Code review changes 2021-08-11 17:58:46 +02:00
d487916557 Merge pull request #4279 from haydenroche5/pkcs12
Cleanups for PKCS8 and PKCS12 macros (always support parsing PKCS8 header)
2021-08-10 18:37:33 -07:00
65a00d9430 Turn on key generation for --enable-stunnel. 2021-08-10 17:14:06 -07:00
0c74e18eaf Fix early data max size handling. Fixes issue with size checking around wolfSSL_CTX_set_max_early_data and wolfSSL_set_max_early_data, which was checking against the padded size. Also was adding to the earlyDataSz and checking against it with un-padded data size. ZD 12632. 2021-08-10 16:32:41 -07:00
b258321219 Fixes for misc.c to not be included unless required. 2021-08-10 16:11:22 -07:00
df10152b54 Refactor hex char to byte conversions. 2021-08-10 12:07:41 -07:00
fdb6c8141e Merge pull request #4274 from haydenroche5/pyopenssl
Add support for pyOpenSSL.
2021-08-10 11:49:07 -07:00
fdc350fb52 Add a macro guard WOLFSSL_CHECK_ALERT_ON_ERR that has the client check for
alerts in the event of an error during the handshake.
2021-08-10 09:43:12 -07:00
ef5510cbcc During the handshake, make sure alerts are getting read on the client side in
the event of an error.
2021-08-09 14:26:53 -07:00
0e4b200df1 Merge pull request #4267 from elms/key_overflow
tls13: avoid buffer overflow with size check
2021-08-09 09:19:46 -07:00
1a8109f77d rename function parameter 2021-08-09 22:52:45 +07:00
e698d08317 Merge pull request #4286 from douzzer/cryptocb-pedantic-c99
--enable-cryptocb CFLAGS='-std=c99 -pedantic'
2021-08-09 08:29:36 -07:00
5c55be72ec fix jenkins failure part2 2021-08-09 10:00:35 +09:00
c0b085dd4a EVP_CIPHER_CTX_set_iv_length 2021-08-08 14:49:28 +09:00
cf9d5ea8b6 fix jenkins failure part2 2021-08-07 14:14:39 +09:00
dbf0977ed0 fix fenkins failure 2021-08-07 11:42:03 +09:00
a066c48f55 fix jenkins failure 2021-08-07 11:13:41 +09:00
a851e13f1d implemented X509_VERIFY_PARAM_set1_ip 2021-08-07 10:50:57 +09:00
bd6b765b17 Merge pull request #4287 from ejohnstown/ac-upd
flags update
2021-08-06 16:22:15 -07:00
2c62880fd2 flags update
1. Fixed typo in ifdef for HAVE_ED448.
2. Fixed typos in comments in sha512.
3. Add include config.h to bio.c.
2021-08-06 11:28:20 -06:00
b4131f355e Add a test/example for parsing the date from a certificate 2021-08-06 14:51:57 +02:00
1b2d57123f tests/api.c: add missing (void) arg lists. 2021-08-05 15:30:33 -05:00
6a92db7722 add overrideable HAVE_ANONYMOUS_INLINE_AGGREGATES macro, set to 0 or 1 in wolfcrypt/types.h, and use it to conditionalize feature usage in wolfcrypt/cryptocb.h. 2021-08-05 15:30:16 -05:00
0df28083d3 Fixes for CAAM build macros and spelling. 2021-08-05 10:12:59 -07:00
fab227411f Free ECC cache per thread when used 2021-08-05 15:34:47 +02:00
1e491993ca add a2i_IPADDRESS 2021-08-05 16:53:36 +07:00
67e773db91 implement SSL_CIPHER_xxxx 2021-08-05 09:42:55 +09:00
5465d40ee3 Attempt to move asn.c RSA API defs into asn_public.h, since ASN is not in FIPS boundary. 2021-08-04 17:42:46 -07:00
699728c70c Fix for PKCS12 with NO_ASN. 2021-08-04 17:37:05 -07:00
d8a54e1a32 tls13: avoid buffer overflow with size check
For cases where a private key that is larger than the configured
maximum is passed.
2021-08-04 17:14:25 -07:00
35a33b2f00 Add support for pyOpenSSL.
pyOpenSSL needs the OpenSSL function X509_EXTENSION_dup, so this commit adds
that to the compatibility layer. It also needs to be able to access the DER
encoding of the subject alt names in a cert, so that's added as well.
2021-08-04 14:08:43 -07:00
3e894a9804 Merge pull request #4277 from lealem47/ex-repo-link
Adding README.md to examples dir and links to examples github repo in…
2021-08-04 12:43:57 -07:00
ed8edde9c4 Merge pull request #4264 from maximevince/zephyr-module-support
wolfSSL as a Zephyr module (without setup.sh)
2021-08-04 12:26:14 -07:00
fdbe3f0ff1 Merge pull request #4258 from miyazakh/evp_md_do_all
add EVP_MD_do_all and OBJ_NAME_do_all support
2021-08-04 12:17:27 -06:00
333aa9f24b Merge pull request #4269 from JacobBarthelmeh/PKCS7
sanity check on pkcs7 stream amount read
2021-08-04 06:41:50 -07:00
d39893baa0 add ctx set msg callback 2021-08-04 16:49:01 +07:00
b1212ff979 set the default number of tickets to 1 2021-08-04 14:40:17 +07:00
f1377ed861 Merge pull request #4215 from lealem47/Md2HashTest
Added wc_Md2Hash() unit testing to test.c
2021-08-03 16:51:05 -06:00
d64768abff Merge pull request #4265 from miyazakh/ecc_pubkey
update der size in actual length
2021-08-03 16:41:36 -06:00
b3c502890c Merge pull request #4263 from kabuobeid/x509StoreWpas
Fix x509_store_p compilation error in WOLFSSL_CERT_MANAGER when defining WOLFSSL_WPAS_SMALL without OPENSSL_EXTRA.
2021-08-03 15:27:11 -07:00
45eddc68e2 Fix to always support parsing of the PKCS8 header. Improved macro logic for PKCS8 and PKCS12. Added --disable-pkcs8 option. Fix to enable PWDBASED and PKCS8 if PKCS12 is enabled. 2021-08-03 14:45:45 -07:00
67ee3ddb0f Set explicit conversion 2021-08-03 19:29:08 +02:00
3b366d24f2 Rebase fixes 2021-08-03 19:29:08 +02:00
c7a6b17922 Need to free ecc cache 2021-08-03 19:29:08 +02:00
51b6c413d3 For Windows API socklen_t = int 2021-08-03 19:29:08 +02:00
2bbd04f10f Implement BIO_new_accept and BIO_do_accept 2021-08-03 19:29:08 +02:00
8b4345734e net-snmp support patch 2021-08-03 19:28:53 +02:00
9aa528d19d Merge pull request #4165 from haydenroche5/ntp
Make changes to support port of NTP from OpenSSL to wolfSSL.
2021-08-03 09:16:26 -07:00
2cd499d2df Refactor session cache on checking into function 2021-08-03 17:52:50 +02:00
46b061c7bc Include stuff needed for EAP in hostap
Patch that includes the API needed for EAP in hostapd and wpa_supplicant
2021-08-03 17:52:50 +02:00
ba7b1d3be0 Only compile in PKCS12 code if PKCS8 is also compiled in. 2021-08-03 07:09:34 -07:00
ea6f81cc54 Move zephyr/include.am to toplevel Makefile.am 2021-08-03 09:43:03 +02:00
0722fb56d8 Adding README.md to examples dir and links to wolfssl-examples github repo in client/server.c 2021-08-02 20:27:41 -06:00
dc7ae37f7a Make changes to support port of NTP from OpenSSL to wolfSSL. 2021-08-02 13:33:18 -07:00
9f6a963c60 Merge pull request #4262 from haydenroche5/libssh2
Add support for libssh2.
2021-08-02 11:29:54 -07:00
9600d533c1 Merge pull request #4268 from JacobBarthelmeh/ECC
fix for memset with small stack
2021-08-02 09:53:21 -07:00
2479346f5c add set num tickets compat function 2021-08-02 23:47:53 +07:00
a5b55344b1 Merge pull request #2760 from kojo1/EVP-test
additional test on EVP_CipherUpdate/Final
2021-08-02 09:23:00 -07:00
96e4970258 Merge pull request #4271 from TakayukiMatsuo/shake
Add support for EVP_shake128/256
2021-08-02 09:40:36 -06:00
f932736f23 Fix include.am / EXTRA_DIST 2021-08-02 16:44:07 +02:00
279b0facb5 Add support for libssh2. 2021-08-02 05:54:08 -07:00
0dc98b8299 Add support for EVP_shake128/256 2021-08-02 13:00:31 +09:00
b27b4768ae fix jenkins failure 2021-07-31 18:26:07 +09:00
293755917e sanity check on pkcs7 stream amount read 2021-07-30 22:11:45 +07:00
725f95364d fix for memset with small stack 2021-07-30 20:42:48 +07:00
447705a2cb fix jenkins failure 2021-07-30 10:21:16 +09:00
bad9a973b4 remove hard tabs and other minor fixes 2021-07-30 07:07:40 +09:00
297ae23521 additional test on EVP_CipherUpdate/Final 2021-07-30 06:50:01 +09:00
a802c270e1 Merge pull request #4260 from dgarske/dep_rc4
RC4 Cipher Deprecation
2021-07-29 10:26:11 -07:00
07e0c60ce1 Merge pull request #4259 from dgarske/cleanups
Cleanups for memory docs and Arduino
2021-07-29 10:16:43 -07:00
2e415ccaed Merge pull request #4243 from SparkiDev/ecc_large_mul
ECC: ecc point multiply doesn't handle large multipliers
2021-07-29 09:30:09 -07:00
c69d6d2491 Added public API wc_RsaKeyToPublicDer_ex to allow getting RSA public key without ASN.1 header (can return only seq + n + e). Related to PR #4068. Cleanup documentation for RSA and wolfIO. Consolidate duplicate code in wc_RsaPublicKeyDerSize. 2021-07-29 09:27:50 -07:00
6f2853ef28 Merge pull request #4251 from dgarske/openssl_all
Fixes for edge case builds with openssl all
2021-07-29 08:58:22 -07:00
9df4312c4e Merge pull request #3823 from per-allansson/checkaltname-fix
wolfSSL_X509_check_ip_asc/CheckForAltName fixes
2021-07-29 08:08:06 -07:00
2b43052f36 update pkey sz in actual length 2021-07-29 23:28:10 +09:00
7acbf61e53 zephyr: fix CMakeLists.txt 2021-07-29 12:36:34 +02:00
3f802d19e4 Update zephyr/README.md 2021-07-29 12:16:05 +02:00
7532ac530a Remove IDE/zephyr/include.am from IDE/include.am for now 2021-07-29 12:03:40 +02:00
9d562a59bc wolfSSL as a Zephyr module 2021-07-29 11:58:13 +02:00
e333632ad0 add obj_name_do_all 2021-07-29 14:37:10 +09:00
2abf23cbc9 fix jenkins failure 2021-07-29 09:03:38 +09:00
b2b5d4e603 add evp_md_do_all 2021-07-29 08:59:26 +09:00
0ec848e2bd Merge pull request #4255 from SparkiDev/afalg_msg_fix
AF_ALG: fix debug messages
2021-07-28 16:40:09 -07:00
85521c2a74 Fix x509_store_p compilation error in WOLFSSL_CERT_MANAGER when defining WOLFSSL_WPAS_SMALL without OPENSSL_EXTRA. 2021-07-28 14:50:08 -07:00
71cf55a947 Added wc_Md2Hash() unit testing to test.c 2021-07-28 13:45:02 -06:00
2c1fed8262 Fixes for edge case builds with openssl all. Improvements to the test_wolfSSL_PKCS8_d2i. Allow forceful disable of OCSP with ./configure --enable-opensslall --disable-ocsp. 2021-07-28 12:32:08 -07:00
50ae93071d Merge pull request #4237 from kabuobeid/dupSSL
Fix missing CBIOSend and properly guard hmac in DupSSL().
2021-07-28 10:50:17 -07:00
27b96753e2 Disable RC4 unless forcefully enabled with --enable-rc4 or if WOLFSSL_ALLOW_RC4 is specified. Related to issue #4248 2021-07-28 10:31:15 -07:00
c29a373308 Cleanups for Arduino examples. Resolves PR #3126 2021-07-28 09:50:37 -07:00
1b13eef354 Merge pull request #4254 from dgarske/zd12681
Sniffer fix for possible math issue around 64-bit pointer and 32-bit unsigned int
2021-07-28 09:16:57 -07:00
8376a2adc2 Improved memory documentation and examples. Resolves PR #3834. 2021-07-28 09:03:40 -07:00
c41f10e708 CheckForAltNames fixes
- Missing conversion from char to unsigned char caused any IP
  address with a byte > 127 to be wrong
- IPv6 address was converted to wrong format XX:YY:...
   (which also caused a buffer overrun)
- Anything that is not an IPv4 or IPv6 address should be ignored
2021-07-28 09:46:33 +02:00
4da7fbb654 tests: use different IPv4 address in + add IPv6 SAN to generated cert 2021-07-28 09:36:21 +02:00
0d0dfc3f5e Merge pull request #4238 from dgarske/xc32
Fixes for building with Microchip XC32 and ATECC
2021-07-28 09:33:01 +10:00
f404107330 AF_ALG: fix debug messages 2021-07-28 09:30:07 +10:00
3ea22ffa32 Remove use of assert (replace with soft failures). Note: Session hash will always return value < HASH_SIZE. 2021-07-27 12:07:08 -07:00
3abb2b86d6 Fix possible issues with math around 64-bit pointer and unsigned int (32-bit). ZD 12681 2021-07-27 12:05:37 -07:00
2dac9a2a81 Merge pull request #4228 from miyazakh/EVP_blake2xx
add EVP_blake2 compatibility layer API
2021-07-27 11:45:37 -06:00
d49d8a9286 Merge pull request #4204 from SparkiDev/ecies_sec1
ECIES: SEC.1 and ISO 18033 support
2021-07-27 09:43:53 -07:00
4f1d30d0db Merge pull request #4249 from dgarske/ecc_heap
Fix for `wc_ecc_ctx_free` and heap hint
2021-07-27 09:31:01 -07:00
917fdfbaf7 Peer review fix (second try) 2021-07-27 08:20:22 -07:00
f1209367d9 Peer review fix for undef. Cleanup wc_ecc_check_key return code. 2021-07-27 08:20:22 -07:00
a92f03a11e Fixes for building with Microchip XC32 and ATECC. 2021-07-27 08:20:20 -07:00
f3cb8e4ada Merge pull request #4252 from douzzer/gcc-11-fix-pedantic-fallthrough
fix FALL_THROUGH for gcc-11 -pedantic
2021-07-27 22:07:01 +07:00
3ecd7262b7 Merge pull request #4236 from kabuobeid/serialSz
Fix signed comparison issue with serialSz.
2021-07-27 13:54:38 +07:00
8c63701577 Merge pull request #4247 from SparkiDev/dhp_to_der_fix
OpenSSL API: DH params to der
2021-07-26 17:00:34 -07:00
31dde4706e ECIES: Support SEC 1 and ISO 18033
Default is SEC 1.
To use old ECIES implementation: --enable-eccencrypt=old or define
WOLFSSL_ECIES_OLD
To use ISO-18033 implememtation: --enable-eccencrypt=iso18033 or
define WOLFSSL_ECIES_ISO18033
Support passing NULL for public key into wc_ecc_decrypt().
Support not having public key in privKey passed into wc_ecc_encrypt() -
public key is calculated and stored in priKey.
Add decrypt KAT test for ECIES.
2021-07-27 09:30:53 +10:00
55029acc84 Merge pull request #4244 from SparkiDev/config_fix_4
Configuration: fixes for uncommon configurations
2021-07-26 10:32:32 -07:00
af3a10ed83 wolfcrypt/types.h: fix FALL_THROUGH macro to work warning-free on gcc-11. 2021-07-26 12:08:56 -05:00
28e8f02525 Fix for wc_ecc_ctx_free and heap hint. Fixes #4246. 2021-07-26 09:56:29 -07:00
028c056c55 Merge pull request #4213 from lealem47/leakFixes
Addressing possible leaks in ssl.c and api.c
2021-07-26 23:32:19 +07:00
ce7e1ef94a Merge pull request #4230 from douzzer/configure-max-bits-and-ex-data
configure options for max rsa/ecc bits and ex_data
2021-07-26 09:27:20 -06:00
7d5271ed71 OpenSSL API: DH params to der
Fix calculation of length of encoding in ssl.c.
Fix encoding to check proper length in asn.c.
Fix tests to check for correct value (api.c).
2021-07-26 22:47:46 +10:00
ec6ffb0583 Configuration: fixes for uncommon configurations
./configure --enable-all --disable-filesystem
./configure --enable-all CC=g++ --enable-intelasm
2021-07-26 16:34:20 +10:00
da0fd5c6cf Merge pull request #4235 from JacobBarthelmeh/Docs
update mention of report to include CVE number and last names
2021-07-26 15:01:30 +10:00
27c49b1673 Merge pull request #4075 from julek-wolfssl/bind-dns
Bind 9.17.9 and 9.11.22 Support
2021-07-26 11:24:57 +07:00
6cb4f0fe08 ECC: ecc point multiply doesn't handle large multipliers
Detect large multiplier and return error.
2021-07-26 09:34:56 +10:00
494e285cf1 configure.ac: add --with-max-rsa-bits, --with-max-ecc-bits, and --enable-context-extra-user-data[=#]; untabify and otherwise clean up whitespace; tweak api.c, ecc.h, rsa.h, and settings.h, for compatibility with new options. 2021-07-23 22:02:58 -05:00
cbb013ca11 wolfssl/test.h: in wolfsentry_*(), correctly use WOLFSENTRY_MASKIN_BITS(), not WOLFSENTRY_CHECK_BITS(), to test for setness of bits. 2021-07-23 22:02:58 -05:00
671147549f Fix missing CBIOSend and properly guard hmac in DupSSL(). 2021-07-23 12:11:30 -07:00
8bd304e4c5 Fix signed comparison issue with serialSz. 2021-07-23 11:15:40 -07:00
3bb2d55257 Merge pull request #4233 from JacobBarthelmeh/fuzzing
fix memory leak with SMIME
2021-07-23 10:26:02 -07:00
e8d636771f Merge pull request #4231 from haydenroche5/des3-iv-fips
Use correct DES IV size when using FIPS v2.
2021-07-23 09:38:56 -07:00
8ee9024da9 More rebase fixes 2021-07-23 18:22:46 +02:00
23cff71bbf Second wc_EccPrivateKeyDecode not needed now that it supports PKCS8 2021-07-23 18:14:54 +02:00
9f7aa32662 Fix merge conflict resolution in ECC_populate_EVP_PKEY 2021-07-23 18:14:54 +02:00
10168e093a Rebase fixes 2021-07-23 18:14:54 +02:00
c7d6e26437 Fix DSA signature length
The length of the DSA signature is 40 bytes for N=160 but 64 bytes for N=256. New enum values are added for better clarity.
2021-07-23 18:14:18 +02:00
142ff6d885 Bind 9.11.22 2021-07-23 18:14:18 +02:00
553c930ecb dot system test passed 2021-07-23 18:14:18 +02:00
763aa9b66d Fix race condition with RsaKey
When RsaKey is shared and RsaPublicEncryptEx is called simultaneously by multiple threads, the key->state may be incorrectly set in some threads. This side-steps the state logic when building for bind9.
2021-07-23 18:14:18 +02:00
69948b3648 WIP 2021-07-23 18:14:18 +02:00
06ebcca913 Code review and mp_int memory leak fixes 2021-07-23 18:14:18 +02:00
b4fd737fb1 Bind 9.17.9 Support
- Add `--enable-bind` configuration option
- New compatibility API:
  - `RSA_get0_crt_params`
  - `RSA_set0_crt_params`
  - `RSA_get0_factors`
  - `RSA_set0_factors`
  - `RSA_test_flags`
  - `HMAC_CTX_get_md`
  - `EVP_MD_block_size`
  - `EC_KEY_check_key`
  - `o2i_ECPublicKey`
  - `DH_get0_key`
  - `DH_set0_key`
- Calling `EVP_MD_CTX_cleanup` on an uninitialized `EVP_MD_CTX` structure is no longer an error
- `DH_generate_parameters` and `DH_generate_parameters_ex` has been implemented
2021-07-23 18:14:12 +02:00
9f99253a8b Merge pull request #4219 from SparkiDev/math_neg_mod_2d
Maths: mp_mod_2d supports negative value now
2021-07-23 08:40:56 -07:00
2372ea45fb Merge pull request #4229 from SparkiDev/ssl_reorg_4
Reorg of ssl.c: CONF, BIO, RAND and EVP_CIPHER
2021-07-23 07:45:30 -07:00
92b1f233c9 Merge pull request #4234 from SparkiDev/g++_fix_2
C++ fix: cast from void* to X509_OBJECT*
2021-07-23 07:45:05 -07:00
b80d14a872 update mention of report to include CVE number and last names 2021-07-23 21:38:58 +07:00
e130da181b Merge pull request #4232 from SparkiDev/small_build_fixes
Small configurations: get compiling
2021-07-23 14:20:56 +07:00
94373781b2 C++ fix: cast from void* to X509_OBJECT* 2021-07-23 14:56:38 +10:00
f2852dad4a fix memory leak with SMIME 2021-07-23 10:38:11 +07:00
9452c22653 Small configurations: get compiling
./configure --enable-psk -disable-rsa --disable-dh -disable-ecc
--disable-asn C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK --disable-coding
--disable-filesystem CFLAGS=-DNO_WOLFSSL_SERVER

./configure --enable-psk -disable-rsa --disable-dh -disable-ecc
--disable-asn C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK --disable-coding
--disable-filesystem CFLAGS=-DNO_WOLFSSL_CLIENT
2021-07-23 11:55:08 +10:00
ec180f3901 Use correct DES IV size when using FIPS v2. 2021-07-22 18:17:41 -07:00
715a8303d2 Reorg of ssl.c: CONF, BIO, RAND and EVP_CIPHER
Remove whitespace at end of lines in ssl.c.
2021-07-23 09:55:07 +10:00
ab226e1a73 Merge pull request #4212 from SparkiDev/sp_c_perf
SP C: change number of words for RSA/DH
2021-07-22 09:33:51 -07:00
d372f097f7 SP C: change number of words for RSA/DH
Faster small code and fast code.
Allow fixed 4096-bit FFDHE parameters in benchmark.
Convert [u]int[32|64|128]*_t types to sp_[u]int[32|64|128].
Add a div for when top bits are all 1
WOLFSSL_SP_FAST_LARGE_CODE added to make mul_add function faster on
non-embedded platforms.
Change mod_exp window sizes for same performance but less memory.
P256 with c32 now 9 words instead of 10.
2021-07-22 13:12:31 +10:00
6a3ff81f2d use EVP_get_digestbyname 2021-07-22 08:17:55 +09:00
b4c61b4df9 add EVP_blake2xyyy 2021-07-22 08:17:54 +09:00
ffd69f6426 Merge pull request #4141 from kaleb-himes/FIPS_ANDROID_v454
Changes to support Android app with wolfCrypt module v4.5.4
2021-07-21 11:23:42 -06:00
c544c19013 Merge pull request #4227 from miyazakh/ERR_lib_error_string
add ERR_lib_error_string compatibility layer API
2021-07-21 11:19:29 -06:00
83c6688bee Merge pull request #4135 from dgarske/evp_set1_eckey
Fixes for handling PKCS8 ECC key with EVP PKEY
2021-07-22 00:17:11 +07:00
49a6c19069 Merge pull request #4216 from dgarske/cube_4.8.0
Improvements to the ST Cube pack configuration template
2021-07-21 11:16:33 -06:00
2177430b8d Merge pull request #4224 from JacobBarthelmeh/Release
update docs for 4.8.1
2021-07-21 09:00:42 -07:00
73ad0315ce Merge pull request #4226 from douzzer/valgrind-fixes-20210720
fixes for valgrind-detected leaks and undefined data accesses
2021-07-21 08:43:00 -07:00
ede738b6e4 Merge pull request #4223 from SparkiDev/mem_usage_fixes_1
Memory allocation: fixes from memory usage generation
2021-07-21 08:20:09 -07:00
b76d44dad9 add ERR_lib_error_string 2021-07-21 10:31:00 +09:00
dc19ba2aa7 Memory allocation: fixes from memory usage generation
1. Configuration: If not fast math then don't set ALT_ECC_SIZE when
configuring.
2. ECC KeyShare: Key share entry's key was allocated with type
DYNAMIC_TYPE_PRIVATE_KEY, free with same type.
3. Ed25519: free the SHA-512 temporary object. WOLFSSL_SMALL_STACK_CACHE
builds have dynamicaly allocated data.
4. RSA: Don't keep allocating a new hash object in RsaMGF1 when compiled
with WOLFSSL_SMALL_STACK_CACHE.
2021-07-21 09:54:11 +10:00
2014d39254 fixes for valgrind-detected leaks and undefined data accesses: wolfSSL_{SHA*,MD5}_Final (OpenSSL compat wrappers): call wc_*Free() on sha state that otherwise leaks when _SMALL_STACK_CACHE; test_wc_curve25519_shared_secret_ex(): properly initialize public_key. 2021-07-20 18:26:05 -05:00
60288a5083 Merge pull request #4222 from TakayukiMatsuo/tk12625
SSL APIs: Add sanity check to some APIs
2021-07-21 09:00:03 +10:00
f18344c191 Fix logic error for calculation of PKCS header size in wolfSSL_i2d_PUBKEY. 2021-07-20 15:11:32 -07:00
aedd2a33db Merge pull request #4221 from douzzer/sanitizer-fixes-20210719
misc sanitizer fixes etc
2021-07-21 00:40:09 +07:00
1a7c8ccbd1 Peer review fixes. 2021-07-20 10:02:16 -07:00
762b384be2 Fixes for -pedantic errors. 2021-07-20 10:02:16 -07:00
be6fd26f54 Fix for backwards compatibility for i2d_PrivateKey. 2021-07-20 10:02:16 -07:00
b344246549 Fix the new PKCS8 header check in wc_CreatePKCS8Key to use the right input buffer. 2021-07-20 10:02:16 -07:00
b8ed577e9a Peer review fixes and improvements. Resolves issue with public API compatibility. 2021-07-20 10:02:16 -07:00
fd52424dd5 Improvements to PKCS8 handling.
* Fixes for handling PKCS8 in keys with EVP PKEY. Resolves QT test issues. Replacement to PR #3925.
* Improved code handling for PKCS 8 headers. Change PemToDer to not strip the PKCS8 header.
* Add support in the ECC/RSA/DH key import code to support detection / handling of the PKCS8 header.
* Fix for `wc_RsaKeyToDer` to be exposed with `OPENSSL_EXTRA`.
* Adds EVP PKCS8 test case for RSA and ECC.
* Refactor `test_wolfSSL_OPENSSL_hexstr2buf` to resolve g++ compiler warning.
* Added new `WOLFSSL_TRAP_MALLOC_SZ` build option to trap mallocs that are over a specified size.
2021-07-20 10:02:16 -07:00
673becee74 Merge pull request #4210 from JacobBarthelmeh/Testing
handle edge case of input buffer malloc'd to location immediately aft…
2021-07-20 09:56:27 -07:00
932abbb6e6 update docs for 4.8.1 2021-07-20 21:20:15 +07:00
4cdbe0e23e Merge pull request #4207 from haydenroche5/sblim-sfcb
Add support for sblim-sfcb port.
2021-07-20 20:41:46 +07:00
38fd577ded Merge pull request #4218 from SparkiDev/sp_ecc_add_dbl
SP: ecc proj add point, dbl point fix
2021-07-20 18:57:48 +07:00
35a0258f47 Merge pull request #4220 from SparkiDev/ecc_neg_string
ECC: where reading strings, check for neg (invalid)
2021-07-20 18:56:00 +07:00
ed6e173fc3 Maths: mp_mod_2d supports negative value now
SRP: don't clear an mp_int that hasn't been initialized
2021-07-20 18:33:55 +10:00
f630fded44 Add sanity check to some APIs 2021-07-20 13:23:16 +09:00
a43cc4ebfa openssl/sha.h: enlarge WOLFSSL_SHA384_CTX.holder to accommodate wc_Sha512.{devId,devCtx}. 2021-07-19 21:41:15 -05:00
fe94c36a7b configure.ac: fix wrong constructions in environment setup for ENABLED_REPRODUCIBLE_BUILD. 2021-07-19 18:31:13 -05:00
5507a07563 Add support for sblim-sfcb port. 2021-07-19 16:28:44 -07:00
f8d1befdff autogen.sh: leave .git/hooks/pre-{commit,push} alone unless they don't exist, to allow for local ecosystem-dependent customizations of the hooks. 2021-07-19 16:31:22 -05:00
4df6fb74b0 fix sanitizer-detected uninitialized/null data accesses: wc_SrpComputeKey(), XChaCha20Poly1305_test(). 2021-07-19 16:29:43 -05:00
77c9b36b5a Merge pull request #4181 from dgarske/sniffer_keycb
Sniffer fixes and new sniffer key callback support
2021-07-19 13:26:17 -07:00
020e23783b Merge pull request #4180 from kaleb-himes/DEFAULT_CA_BOOL
Fix basic constraints extension present and CA Boolean not asserted
2021-07-19 23:08:27 +07:00
5b621cf039 ECC: where reading strings, check for neg (invalid) 2021-07-19 22:58:07 +10:00
d45e78b715 SP: ecc proj add point, dbl point fix
Set infinity field of points.
2021-07-19 12:45:52 +10:00
bbe47a81b7 Merge pull request #4183 from douzzer/ED-streaming-verify
add streaming API to the ED verify routines
2021-07-18 14:12:42 -07:00
186ff2b365 make -DNO_ED25519_KEY_{IMPORT,EXPORT} buildable, and fix api.c and suites.c so that -DNO_ED*_KEY_{IMPORT,EXPORT} pass make check. 2021-07-16 23:07:28 -05:00
ac92204c15 make -DNO_ED448_KEY_{IMPORT,EXPORT} buildable 2021-07-16 18:21:30 -05:00
785a8f83ed evp.c: fixes in wolfSSL_EVP_CIPHER_CTX_ctrl() from peer review. 2021-07-16 17:52:28 -05:00
070ca6c34d Fixes to properly support sniffer with secure renegotiation. 2021-07-16 14:48:22 -07:00
c97eff6e61 evp.c: add missing checks and logic in wolfSSL_EVP_CIPHER_CTX_ctrl(), and fix api.c:test_IncCtr() to exercise wolfSSL_EVP_CIPHER_CTX_ctrl() with EVP_CTRL_GCM_IV_GEN using an AES cipher, with thanks to Juliusz. 2021-07-16 15:30:23 -05:00
05128968f6 fixes for null pointer accesses detected by clang sanitizer. also, gate SuiteTest() on !NO_WOLFSSL_CIPHER_SUITE_TEST in tests/unit.c, greatly reducing time to completion when not debugging cipher suites. 2021-07-16 13:49:47 -05:00
5e8da2348f ED: add --enable-ed25519-stream and --enable-ed448-stream to configure.ac, disabled by default, and add them to --enable-all and --enable-all-crypto lists, along with --enable-aesgcm-stream; report AES-GCM and ED* streaming API options in feature summary rendered at end;
refactor ED routines to pivot on WOLFSSL_ED*_PERSISTENT_SHA and WOLFSSL_ED*_STREAMING_VERIFY macros, with sha state in the key struct only when WOLFSSL_ED*_PERSISTENT_SHA, otherwise on the stack as before;

add ed*_hash_init() and ed*_hash_free() local helpers;

ED* peer review: fix line lengths, remove superfluous retval checks, tweaks for efficiency, and add ED448_PREHASH_SIZE to ed448.h.
2021-07-16 13:49:47 -05:00
9b43e57ccf ED: add streaming API to the ED verify routines: wc_ed*_verify_msg_init(), wc_ed*_verify_msg_update(), wc_ed*_verify_msg_final();
harmonize the ED448 API with the ED25519 API by making wc_ed448_verify_msg_ex() and wc_ed448_init_ex() public functions;

track devId and heap pointer in ed*_key.{devId,heap}, and pass them through to sha init functions;

add ed*_key.{sha,sha_clean_flag}, and ed*_hash_{reset,update,final} functions, and use them for all ED hashing ops, to support streaming API and for optimally efficient reuse for the preexisting ED calls;

add ed448_hash() akin to ed25519_hash(), and use it in place of wc_Shake256Hash(), for .sha_clean_flag dynamics.

add to wc_ed*_import_private_key() the ability to import the combined key generated by wc_ed*_export_private() without supplying the redundant public key;

add macro asserts near top of ed*.h to assure the required hash functions are available;

fix {NO,HAVE}_ED*_{SIGN,VERIFY};

wolfcrypt/test/test.c: add missing key initializations in ed*_test();

wolfcrypt/test/test.c: fix unaligned access in myDecryptionFunc() detected by -fsanitize=address,undefined.
2021-07-16 13:49:47 -05:00
fe77e29ba0 Fix for SNI refactor handling of return codes. Fix for possible use of NULL on client array. 2021-07-16 11:23:20 -07:00
f408eeb5bb Implement peer review suggestions 2021-07-16 09:57:11 -06:00
73323e694f Addressing possible leaks in ssl.c and api.c 2021-07-16 09:48:06 -06:00
b9c707511b Merge pull request #4211 from SparkiDev/ocsp_no_check
OCSP: improve handling of OCSP no check extension
2021-07-16 16:06:41 +07:00
f93083be72 OCSP: improve handling of OCSP no check extension 2021-07-16 12:19:39 +10:00
8e6c31b15d ECC bench: can't use SAKKE curve with ECDH/ECDSA
Skip curve benchmarking when all curves are being benchmarked.
2021-07-16 12:06:14 +10:00
af98e64b88 Merge pull request #4208 from dgarske/leaks
Fixes for possible leaks with ECCSI and DH test
2021-07-16 08:59:11 +10:00
8a8b315ed8 Improvements to the ST Cube pack configuration template. 2021-07-15 14:02:56 -07:00
12a4517d6b handle edge case of input buffer malloc'd to location immediately after output buffer 2021-07-15 22:38:48 +07:00
6c3c635be7 Merge pull request #4206 from julek-wolfssl/remove-api 2021-07-15 06:41:00 -07:00
6a0809b53b Merge pull request #4185 from guidovranken/fix-gh-issue-4184
Fix compilation failure with WOLFSSL_PUBLIC_ECC_ADD_DBL
2021-07-15 16:19:30 +07:00
fc6aa19eb8 Merge pull request #4200 from haydenroche5/tcpdump
Add support for tcpdump with wolfSSL.
2021-07-15 14:57:47 +07:00
6458a8cedd Merge pull request #4187 from SparkiDev/sp_math_mod_red_fix
SP math: montgomery reduction edge case
2021-07-15 14:33:26 +07:00
2959902a10 TLS 1.3: ability to turn peek change off
Allow post-handshake peeking for handshaking messages to be disabled.
Not all customers want to handle this.
Clear WOLFSSL_ERROR_WANT_READ error on entry to ReceiveData which was
set when peeking found handshake message.
2021-07-15 10:14:13 +10:00
fbbb290d9e Fixes for possible leaks with HAVE_WOLF_BIGINT used by async in ECCSI and DH test. Fixes for GCC -fsanitize=address with --enable-all. 2021-07-14 14:57:32 -07:00
3ff21171cb Fix for secure renegotiation, which was not keeping handshake resources. Added NULL checks for case where handshake resources might be free'd to prevent possible use of NULL. Refactor the SNI client hello processing to not assume TLS header is in prior buffer (not there for decrypted handshake packets). 2021-07-14 10:44:33 -07:00
f82fd01283 Merge pull request #4202 from JacobBarthelmeh/BuildOptions
fix for build with wpas and disable tls13
2021-07-14 09:07:08 -07:00
b5eef78cdb Merge pull request #4176 from SparkiDev/sp_math_read_bin_max
SP math all: allow reading of bin up to max digit size
2021-07-14 16:03:32 +07:00
18399091ce Merge pull request #4012 from julek-wolfssl/haproxy
HaProxy 2.4-dev18 support
2021-07-14 15:46:04 +07:00
81f3f417e8 Merge pull request #4190 from SparkiDev/bench_sakke_ecdsa
ECC bench: can't use SAKKE curve with ECDH/ECDSA
2021-07-13 15:39:25 -05:00
10987a69d7 Merge pull request #4201 from JacobBarthelmeh/Release
bump version for dev
2021-07-13 11:41:51 -07:00
0d55dcaaa0 Merge pull request #4188 from guidovranken/mp_invmod_slow-check
Add missing return value check in mp_invmod_slow
2021-07-14 01:27:10 +07:00
3f22721a86 use version from wolfssl/version.h with driver 2021-07-13 22:39:39 +07:00
2592a04d8a fix for build with wpas and disable tls13 2021-07-13 15:49:40 +07:00
3bebcaaf54 bump version for dev 2021-07-13 04:18:52 +07:00
52b8c7b1fa Merge pull request #4192 from haydenroche5/ocsp_http_header
Improve wolfIO_HttpProcessResponse HTTP header checking logic.
2021-07-12 14:13:07 -07:00
9f8e728672 Add support for tcpdump with wolfSSL. 2021-07-12 14:06:25 -07:00
db32570ab3 Fix for missing sp_radix_size with WC_MP_TO_RADIX. 2021-07-12 13:40:55 -07:00
add4a68465 Merge pull request #4199 from JacobBarthelmeh/Certs
Lighttpd build fix and gencertbuf on updated ed25519 certs
2021-07-12 09:15:50 -07:00
851c1fe1cf fix for lighttpd build 2021-07-12 16:25:50 +07:00
2f9af5f753 gencertbuf on updated ed25519 certs 2021-07-12 14:31:03 +07:00
30baa83a0b Merge pull request #4198 from douzzer/fix-linuxkm-for-v4.8 2021-07-09 19:15:23 -07:00
50d007ded8 Merge pull request #4196 from JacobBarthelmeh/Release
Release version 4.8.0
2021-07-09 14:33:26 -07:00
84539be656 Merge pull request #4197 from JacobBarthelmeh/Jenkins
Updates found with Jenkins tests
2021-07-09 14:32:43 -07:00
15c890179f Linux kernel module: add an explicit -ffreestanding to CFLAGS in linuxkm/Makefile, and in wc_port.h ifdef WOLFSSL_LINUXKM, ignore -Wtype-limits in Linux kernel header files (needed for kernel v5.13), and suppress inclusion of stdint-gcc.h. 2021-07-09 15:23:07 -05:00
88b70a3906 update google cert that was set to expire in Dec 2021 2021-07-09 23:57:50 +07:00
c01a63508a account for testing on big endian system 2021-07-09 08:18:39 -06:00
f4c4cf8afe update changelog for release 4.8.0 2021-07-09 17:02:18 +07:00
e1b487ab9f Fix for wc_export_int with WC_TYPE_HEX_STR, which was not returning the correct length. 2021-07-08 14:36:36 -07:00
4f055653c7 Restore TLS v1.3 hello_retry behavior with session id. Fix for SNI with default (no name) putting newline due to fgets. 2021-07-08 13:50:08 -07:00
500a6c8b27 prepare for release 4.8.0 2021-07-08 12:02:40 -06:00
4cb076f22b Cleanup to remove duplicate stat sslResumptionValid. Add print of sslResumptionInserts. 2021-07-08 09:49:13 -07:00
ddbe0e6dab Fix for sniffer stats on resume miss. The logic for hello_retry_request will no longer try and do resume, so restore BAD_SESSION_RESUME_STR error. 2021-07-08 09:31:59 -07:00
127add4bf7 include stddef for size_t type for ptr 2021-07-08 07:06:20 -06:00
7bcd0da164 warning for length used on strncpy 2021-07-08 15:51:17 +07:00
263e03748e fix issue of handling partially streamed PKCS7 input 2021-07-08 15:25:40 +07:00
a250e1f23a Merge pull request #4194 from ejohnstown/to-fix
Timeout Fix
2021-07-08 14:34:42 +07:00
c9aa23ac7a Merge pull request #4191 from dgarske/htons
Fix for missing `XHTONS` with `WOLFSSL_USER_IO` and session tickets
2021-07-07 16:21:59 -07:00
00cab36b36 Timeout Fix
The macros setting up the timeout for the select used to timeout just
multiplied the ms by 1000 to make us. The BSD select used on macOS
doesn't like the us to be greater than 999999. Modified to carry the
excess us over into the seconds.
2021-07-07 16:14:48 -07:00
849020660f Merge pull request #4182 from JacobBarthelmeh/CAAM
check return of DSA decode
2021-07-08 08:16:46 +10:00
b9dac74086 Merge pull request #4193 from JacobBarthelmeh/StaticAnalysisTests
Static analysis tests
2021-07-07 14:23:58 -07:00
86e5287a14 Merge pull request #4032 from TakayukiMatsuo/tk11968
Make wolfSSL_CTX_set_timeout reflect to Session-ticket-lifetime-hint
2021-07-07 22:26:06 +07:00
b7bd3766c7 Fix pedantic errors about macros in macros 2021-07-07 10:54:34 +02:00
7b9d6a3f5e Merge pull request #3792 from TakayukiMatsuo/os_keylog
Add wolfSSL_CTX_set_keylog_callback
2021-07-07 15:34:33 +07:00
7422f07fb5 Improve wolfIO_HttpProcessResponse HTTP header checking logic.
Modify this function to just ensure that the response header starts with "HTTP
1.x 200" (where x is 0, 1, etc.).
2021-07-06 15:18:26 -07:00
41ac17cdc6 Improve support for XHTONS with WOLFSSL_USER_IO and session tickets with default encryption implementation !WOLFSSL_NO_DEF_TICKET_ENC_CB. 2021-07-06 13:13:35 -07:00
b1a6d88af6 fix for memory leak 2021-07-06 23:37:35 +07:00
fc7533fe5e Code review changes 2021-07-06 16:14:25 +02:00
1acf906612 Code review changes 2021-07-06 15:39:23 +02:00
6dfc702364 Correct serverDH_Pub length on renegotiation
On a renegotiation the serverDH_Pub buffer may be too short. The previous DhGenKeyPair call may have generated a key that has a shorter binary representation (usually by one byte). Calling DhGenKeyPair with this shorter buffer results in a WC_KEY_SIZE_E error.
2021-07-06 15:39:23 +02:00
1b6b16c2c3 HaProxy 2.4-dev18 support
*This patch is dependent on https://github.com/wolfSSL/wolfssl/pull/3871 because proto version selection logic is refactored in that pull request.*
This patch contains the following changes:
- Enable more options with `--enable-haproxy`
- Compatibility layer additions
    - `STACK_TYPE_X509_OBJ`
    - `OCSP_id_cmp`
    - `X509_STORE_get0_objects`
    - `X509V3_EXT_nconf_nid`
    - `X509V3_EXT_nconf`
    - `X509_chain_up_ref`
    - `X509_NAME_hash`
    - `sk_X509_NAME_new_null`
    - `X509_OBJECT_get0_X509`
    - `X509_OBJECT_get0_X509_CRL`
    - `ASN1_OCTET_STRING_free`
    - `X509_LOOKUP_TYPE`
    - `OSSL_HANDSHAKE_STATE`
- New `OPENSSL_COMPATIBLE_DEFAULTS` define will set default behaviour that is compatible with OpenSSL
    - WOLFSSL_CTX
        - Enable all compiled in protocols
        - Allow anonymous ciphers
        - Set message grouping
        - Set verify to SSL_VERIFY_NONE
- In `SetSSL_CTX`, don't change `send` and `recv` callback if currently using `BIO`
- `ssl->peerVerifyRet`
    - Return first that occured
    - Set correct value on date error
    - Set revoked error on OCSP or CRL error
    - Save value in session and restore on resumption
    - Add to session serialization
- With `OPENSSL_EXTRA`, send an alert on invalid downgrade attempt
- Handle sni callback `SSL_TLSEXT_ERR_NOACK`
- Add `WOLFSSL_VERIFY_DEFAULT` option for `wolfSSL_CTX_set_verify` and `wolfSSL_set_verify` to allow resetting to default behaviour
2021-07-06 15:39:23 +02:00
a6ce91f3bb fix for gcc-11 build with blake2 2021-07-06 14:53:39 +07:00
ae00b5acd0 some minor changes for unintialized and null infer reports 2021-07-06 14:13:45 +07:00
34528eb6c9 ECC bench: can't use SAKKE curve with ECDH/ECDSA
Skip curve benchmarking when all curves are being benchmarked.
2021-07-06 12:19:50 +10:00
e0f268e522 Simplify mp_invmod_slow fix 2021-07-06 02:29:31 +02:00
9783d64f7e Add missing return value check in mp_invmod_slow 2021-07-06 02:13:42 +02:00
08ebd34f31 SP math: montgomery reduction edge case
4 and 6 word specific implementations now handle rare overflow correctly
in last mul-add of loop.
2021-07-06 10:03:24 +10:00
460b513594 Fix compilation failure with WOLFSSL_PUBLIC_ECC_ADD_DBL
Fixes https://github.com/wolfSSL/wolfssl/issues/4184
2021-07-03 19:31:29 +02:00
5df0f7820a Add wolfSSL_CTX_set_keylog_callback 2021-07-03 14:51:23 +09:00
89866846d6 check return of DSA decode 2021-07-03 03:41:40 +07:00
26789ef877 Fix variable declaration mid-code. 2021-07-02 13:24:25 -07:00
2dd169f9a1 Added new sniffer API for callback for key use ssl_SetKeyCallback. Support indicated by WOLFSSL_SNIFFER_KEY_CALLBACK. Trace cleanup for custom error. 2021-07-02 12:18:56 -07:00
93a8f36530 Fix basic constraints extension present and CA Boolean not asserted 2021-07-02 12:16:16 -06:00
567d8ed704 Make wolfSSL_set_session return success on timeout under WOLFSSL_ERROR_CODE_OPENSSL macro definition. 2021-07-02 10:50:00 +09:00
aef9e560b1 Make wolfSSL_CTX_set_timeout call wolfSSL_CTX_set_TicketHint internally to change session-ticket-lifetime-hint. 2021-07-02 09:15:01 +09:00
197b959916 Merge pull request #4177 from SparkiDev/ecc_exp_point_size
ECC: validate ordinate length before export
2021-07-01 17:07:35 -07:00
d16e374972 Merge pull request #4160 from JacobBarthelmeh/fuzzing
better checking on length of streaming buffer
2021-07-01 17:04:49 -07:00
43f8c5ba1b Merge pull request #4121 from JacobBarthelmeh/PKCS7
wc_PKCS7_DecodeCompressedData optionally handle a packet without cont…
2021-07-01 17:03:56 -07:00
9b8142c1ff Merge pull request #4174 from SparkiDev/zephyr_2_6_99
Zephyr Project: update port to work with latest
2021-07-02 03:23:10 +07:00
e9e41d3344 Merge pull request #4070 from elms/fsanitize/undefined_fixes
address errors with `-fsanitize=undefined`
2021-07-01 13:00:06 -05:00
45486ac904 Merge pull request #4166 from miyazakh/supportedversion_ex_mindowngrade
not include smaller versions than minimum downgrade
2021-07-01 21:00:20 +07:00
7a42096643 Merge pull request #4175 from SparkiDev/sp_thumb_clang
SP: Thumb implementaton that works with clang
2021-07-01 20:39:06 +07:00
a992480f91 ECC: validate ordinate length before export 2021-07-01 15:50:04 +10:00
75e807abc6 Fixes for gcc-10 and -fsanitize=undefined for rabbit.c
* One introduced in #4156
* One from previous commit in this PR
2021-06-30 22:20:17 -07:00
6694775d4b Changes to compile without XTREAM_ALIGN
Use macro to load 32 bits from input parameters key in hc128.c and input
in rabbit.c
Also fix warning about string copy.
2021-06-30 21:58:30 -07:00
56d879f422 address scan-build issues for clang 6 and 10 2021-06-30 21:58:30 -07:00
c9597ea735 sha3: align data for Sha3Update 2021-06-30 21:58:30 -07:00
dc7beab784 address errors with -fsanitize=undefined
- fix null dereferences or undefined `memcpy` calls
 - fix alignment in `myCryptoDevCb`
 - fix default dtls context assignment
 - add align configure option to force data alignment

TESTED:
 `./configure CFLAGS=-fsanitize=undefined\ -DWOLFSSL_GENERAL_ALIGNMENT=1 --enable-all`
2021-06-30 21:58:30 -07:00
4cff893c5f SP math all: allow reading of bin up to max digit size 2021-07-01 14:29:58 +10:00
f9cd83743a Fix include.am typo. 2021-06-30 08:42:15 -07:00
23b573c70a Autoconf Include.am fixes, spelling and copyright. 2021-06-30 08:38:17 -07:00
c820b5679a Merge pull request #4173 from SparkiDev/sp_int_mingw64 2021-06-30 06:57:58 -07:00
893b71e8c1 remove dead code 2021-06-30 19:54:25 +07:00
0277fa6d7c Remove unused wolfSSL_StartSecureRenegotiation 2021-06-30 13:51:11 +02:00
23eededc36 simplify and fix max stream buffer length 2021-06-30 15:26:44 +07:00
b0688688c1 addressed review comments 2021-06-30 13:52:46 +09:00
60a520c525 SP: Thumb implementaton that works with clang 2021-06-30 13:10:29 +10:00
d1fb736136 Zephyr Project: update port to work with latest 2021-06-30 10:29:54 +10:00
36d534034c SP math: cast number to sp_digit rather than declare as long 2021-06-30 09:28:51 +10:00
ae68de060a Merge pull request #4171 from SparkiDev/sp_small_fast_modexp
SP: allow fast mod_exp to be compiled for small C code
2021-06-29 13:32:55 -07:00
0d1672dfee Merge pull request #4170 from SparkiDev/sp_mingw64
SP: Don't cast number to sp_digit rather than declare as long
2021-06-29 13:32:28 -07:00
9179071af5 Merge pull request #4153 from JacobBarthelmeh/Testing
fix for keyid with ktri cms
2021-06-29 11:40:00 -06:00
e59cc79a1f Document new WOLFSSL_SP_FAST_MODEXP option. 2021-06-29 09:16:27 -07:00
a748b5264e Fix for wolfcrypt/src/sp_int.c:2720:34: error: left shift count >= width of type with mingw64. 2021-06-29 09:13:32 -07:00
b0e9531f26 Merge pull request #4169 from SparkiDev/dh_anon_tls12
TLS: Get DH anon working TLS 1.2 and below
2021-06-29 08:53:44 -07:00
303f944935 SP: allow fast mod_exp to be compiled for small C code 2021-06-29 12:51:21 +10:00
08e560e0a7 SP: Don't cast number to sp_digit rather than declare as long
mingw64 has numbers as 32-bit type when declarted long.
Fixup some line lengths.
2021-06-29 11:07:47 +10:00
f56bf3d8ee TLS: Get DH anon working TLS 1.2 and below
Send the server DH parameters in ServerKeyExchange.
./configure '--enable-anon' '--disable-rsa' '--enable-oldtls'
2021-06-29 10:29:39 +10:00
0bb66f3023 Merge pull request #4167 from danielinux/pka_readme
port/st: added mention of the PKA support in README
2021-06-28 10:35:32 -07:00
33174cec5c Merge pull request #4161 from dgarske/ssl_doxy
Added inline documentation for `wolfSSL_CTX_load_verify_buffer_ex`
2021-06-28 12:35:11 -05:00
15080317ce port/st: added mention of the PKA support in README 2021-06-28 14:39:58 +02:00
80480e5d1f Merge pull request #4163 from lealem47/rsa-test
Rsa test
2021-06-25 13:12:58 -07:00
5adbcfb3be Merge pull request #4151 from SparkiDev/sp_math_all_base10
SP math all: fix read radix 10
2021-06-25 09:37:05 -07:00
63ad5d58a2 Merge pull request #4162 from ejohnstown/abi-update
ABI Update
2021-06-25 08:36:07 -07:00
5437883da7 Merge pull request #4164 from dgarske/async_frag
Fix for async with fragmented packets
2021-06-25 08:33:50 -07:00
74b9b5a8cd Merge pull request #4156 from SparkiDev/regression_fixes_1
Regression test fixes
2021-06-25 07:48:02 -07:00
729fea6b71 unused variable fix in rsa_oaep_padding_test fix 2021-06-25 08:39:44 -06:00
5038a27cda add test cases and set content oid with decode encrypted data 2021-06-25 21:16:01 +07:00
55002c56d2 update for ber padding 2021-06-25 18:57:28 +07:00
5bb52915b9 update test conf to fix jenkins failures 2021-06-25 16:31:49 +09:00
fbe086534a SP math all: fix read radix 10
Ensure first digit is 0 when zeroing a number.
Check size of output in _sp_mul_d() - only place to be sure of overflow.
Modify callers of _sp_mul_d() to check return.
2021-06-25 15:55:32 +10:00
d576e3ef96 not send smaller versions than minimum downgradable version as supportedversion ext 2021-06-25 14:51:34 +09:00
dab6724059 Regression fixes: more configurations
./configure --disable-rsa --disable-ecc --disable-dh --enable-curve25519
&& make
./configure --disable-aescbc --disable-chacha --disable-poly1305
--disable-coding && make
2021-06-25 15:23:51 +10:00
873f10b0cf Simplifying rsa_test() by extracting sections as separate functions 2021-06-24 20:47:14 -06:00
1994811d24 Merge pull request #4144 from haydenroche5/pkcs8
Make a bunch of PKCS#8 improvements.
2021-06-25 12:22:11 +10:00
dae6683803 Merge pull request #4030 from julek-wolfssl/ZD12235
Expand SHA-3 support
2021-06-25 12:18:03 +10:00
8592053856 Regression test fixes
./configure --enable-all --disable-rsa
./configure --disable-chacha --disable-asm
./configure --disable-rsa --disable-ecc --disable-dh --enable-curve25519
--enable-cryptonly (and ed25519, curve448, ed448)
./configure --disable-tls13 --enable-psk --disable-rsa --disable-ecc
--disable-dh C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK
./configure --disable-oldtls --enable-psk -disable-rsa --disable-dh
-disable-ecc --disable-asn C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK
--enable-lowresource --enable-singlethreaded --disable-asm
--disable-errorstrings --disable-pkcs12 --disable-sha3 --disable-sha224
--disable-sha384 --disable-sha512 --disable-sha --disable-md5
-disable-aescbc --disable-chacha --disable-poly1305 --disable-coding
Various build combinations with WOLFSSL_SP_MATH and WOLFSSL_SP_MATH_ALL
2021-06-25 09:18:06 +10:00
45ef68d5c7 Fix for async with fragmented packets where inline crypto could be overwritten on reprocessing fragment. FIxes unit tests with --enable-all --enable-asynccrypt. Minor cleanup for line length and free verify RSA buffer sooner.
Reproducible with:

```
./examples/server/server -v 3 -l ECDHE-ECDSA-AES256-GCM-SHA384 -c ./certs/server-ecc.pem -k ./certs/ecc-key.pem -2
./examples/client/client -v 3 -l ECDHE-ECDSA-AES256-GCM-SHA384 -A ./certs/ca-ecc-cert.pem -F 6 -2
```
2021-06-24 16:03:12 -07:00
66c29ef1ca ABI Update
Add wolfSSL_CTX_set_verify to the ABI list.
2021-06-24 14:08:28 -07:00
4ef3c5d75c Added inline documentation for wolfSSL_CTX_load_verify_buffer_ex. 2021-06-24 10:38:34 -07:00
656e49cc3b Expand SHA-3 support
Add more support in the EVP layer as well as add signing support. The SHA-3 OID's were also added for DER algorithm identifier encoding.
2021-06-24 19:31:43 +02:00
c59d1f2e8d Merge pull request #4155 from SparkiDev/ssl_reorg_3
Reorg of ssl.c: standard C wrappers, EX_DATA, BUF_MEM, TXT_DB
2021-06-24 09:53:53 -07:00
1ec212be81 Merge pull request #4159 from SparkiDev/sakke_eccsi_fix_1
SAKKE: fix configurations
2021-06-24 09:48:14 -07:00
97ab1bb013 Merge pull request #4154 from SparkiDev/hmac_update_ct
TLS hmac: handle truncated mac in Hmac_UpdateFinal_CT()
2021-06-24 09:28:22 -07:00
b826083fbf better checking on length of streaming buffer 2021-06-24 23:06:37 +07:00
2fb6a9eacf SAKKE: fix configurations
Fix position of sp_1024_norm_18 now that div requires it:
./configure --disable-shared --enable-sakke --disable-eccsi
--enable-sp
Fix missing '{' in sp_mulmod_table_1024:
./configure --disable-shared --enable-sakke --enable-eccsi
--enable-smallstack  --enable-sp
2021-06-24 14:01:27 +10:00
92a4e30b69 Merge pull request #4158 from dgarske/nxp_ltc_rsa2
Fixes for NXP LTC with RSA and Blinding
2021-06-24 12:14:04 +10:00
73c90369c6 Fix for int neg being defined mid code. Fix limit check for mp_mulmod using hardware vs software. Resolves issue when using WC_RSA_BLINDING. 2021-06-23 14:45:52 -07:00
2d1b113f51 Fix for missing wolfcrypt_mp_prime_is_prime_ex def. 2021-06-23 14:45:52 -07:00
ae2f2b246e Merge pull request #4148 from BrianAker/master
Fix for make distcheck, maintainer-clean, to allow distribution builds.
2021-06-23 10:33:06 -07:00
81daf9172b Merge pull request #3872 from ejohnstown/pcExt
Policy Constraints Extension
2021-06-23 09:40:15 -07:00
b3401bd102 Make a bunch of PKCS#8 improvements.
- Add doxygen documentation for wc_GetPkcs8TraditionalOffset, wc_CreatePKCS8Key,
wc_EncryptPKCS8Key, and wc_DecryptPKCS8Key.
- Add a new API function, wc_CreateEncryptedPKCS8Key, which handles both
creation of an unencrypted PKCS#8 key and the subsequent encrypting of said key.
This is a wrapper around TraditionalEnc, which does the same thing. This may
become a first-class function at some point (i.e. not a wrapper). TraditionalEnc
is left as is since it is used in the wild.
- Added a unit test which exercises wc_CreateEncryptedPKCS8Key and
wc_DecryptPKCS8Key. Testing wc_CreateEncryptedPKCS8Key inherently also tests
TraditionalEnc, wc_CreatePKCS8Key, and wc_EncryptPKCS8Key.
- Modified wc_EncryptPKCS8Key to be able to return the required output buffer
size via LENGTH_ONLY_E idiom.
- Added parameter checking to wc_EncryptPKCS8Key and wc_DecryptPKCS8Key.
2021-06-23 08:39:20 -07:00
f762672a12 Merge pull request #4157 from julek-wolfssl/app-data-reason
Add a reason text for APP_DATA_READY
2021-06-23 08:30:19 -07:00
4eff3ff3dd Add a reason text for APP_DATA_READY 2021-06-23 13:43:56 +02:00
945acb4c2f Reorg of ssl.c: standard C wrappers, EX_DATA, BUF_MEM, TXT_DB 2021-06-23 11:28:38 +10:00
2923d812bd Merge pull request #4058 from miyazakh/qt_oslext_cs
TLS: extend set_cipher_list() compatibility layer API
2021-06-23 10:12:11 +10:00
5cf7e17820 TLS hmac: handle truncated mac in Hmac_UpdateFinal_CT() 2021-06-23 09:54:41 +10:00
a5852fe440 Merge pull request #4119 from julek-wolfssl/dtls-seq-num-refactor
Refactor `dtls_expected_peer_handshake_number` handling
2021-06-22 16:29:45 -07:00
eccfb4f632 Merge pull request #4125 from dgarske/sniffer_etsi
TLS: Fixes for sniffer and static ephemeral keys
2021-06-23 09:17:13 +10:00
4b3bd3e384 Merge pull request #4049 from miyazakh/set_verifyDepth_3
Set verify depth limit
2021-06-22 10:23:43 -06:00
b70e028200 Merge pull request #4087 from miyazakh/get_ciphers_compat
higher priority of cipher suite is on top of stack
2021-06-22 10:22:43 -06:00
446393bcab Merge pull request #3793 from TakayukiMatsuo/os_base64
Add wolfSSL_EVP_Encode/Decode APIs
2021-06-22 10:19:30 -06:00
b050463dce Merge pull request #4059 from miyazakh/qt_unit_test
fix qt unit test
2021-06-22 10:12:48 -06:00
647bde671c macro guard on test case 2021-06-22 22:56:35 +07:00
2b1a6cfb54 add setting contentOID with decode enveloped data 2021-06-22 22:06:16 +07:00
a4b5ebb62f remove contentOID check 2021-06-22 21:59:57 +07:00
31e8784057 fix for compressedData eContent encoding with PKCS7 2021-06-22 21:59:57 +07:00
9c2de0e40a wc_PKCS7_DecodeCompressedData optionally handle a packet without content wrapping 2021-06-22 21:59:57 +07:00
3cd43cf692 fix for keyid with ktri cms 2021-06-22 21:33:12 +07:00
67b87a8883 Merge pull request #4127 from douzzer/wolfsentry-client
outbound connection filtering and wolfSentry integration
2021-06-22 07:27:18 -07:00
c4ea64b7fc Merge pull request #4140 from SparkiDev/set_sig_algs 2021-06-21 19:18:10 -07:00
52582ede28 Merge pull request #4146 from SparkiDev/pkcs11_dec_final
PKCS #11: Use C_Decrypt instead of C_DecryptUpdate
2021-06-21 15:28:45 -07:00
ab2c1e117e Merge pull request #4149 from guidovranken/wc_ecc_verify_hash_ex-alloc-check
ECC: wc_ecc_verify_hash_ex, return if ALLOC_CURVE_SPECS() fails
2021-06-22 08:24:22 +10:00
716237c5dd Fix minor line length and spelling. 2021-06-21 15:09:39 -07:00
4942220718 Merge pull request #4150 from elms/fix/sniffer_no_dh
Fix build with `--enable-sniffer --disable-dh`
2021-06-21 12:47:58 -07:00
a409e7c9ce Fix build with --enable-sniffer --disable-dh 2021-06-21 09:42:51 -07:00
7491a44bb4 Fix for possible memory leak case on mp_init failure in wc_ecc_verify_hash_ex with WOLFSSL_SMALL_STACK. 2021-06-21 09:19:47 -07:00
7c600e3ebc In wc_ecc_verify_hash_ex, return if ALLOC_CURVE_SPECS() fails
This prevents a NULL pointer dereference later in the function.
2021-06-20 22:29:20 +02:00
2d497d1cf5 Fix for make distcheck, maintainer-clean, to allow distribution builds.
This the second pass at this after seeing how fips is added to tree in later phases.
This allow autoreconf to be directly called which allows the Makefile to rebuild when seeing that changes have been ( having an autogen.sh is older convention which left to history in the way autotools are invoked )
This fixes "make distcheck" and "make maintainer-clean" which are required by most distributions packaging systems.

The files previously touched by autogen.sh are now properly placed into autoconf.
The include files files are generated by configure. ( There is a note placed in configure.ac as to why and reference to the automake documention for this ). Append to file was done on purpose, touch cannot be in configure safetly. Normally autoheader would be used for this but since the include files are created out of tree, care has to be taken to not overwrite those file.
For the source files, they were moved into the coresponding automake file. It is safe to use touch in automake. Since files can optionally copied from elsewhere, they have to be listed in BUILT_SOURCES. They are written srcdir in order to allow make to do VPATH builds ( which is configure by make distcheck ).
To show fips files are preserved without having the actual fips files, a C style comment can be echoed into the files.
There are a few current, but outstanding issues.
1) config.h needs to be fixed configure.ac to use autoheader in order to allow configure to know to rebuilt depencies on its changes. ( Out of scope for this patch. )
2) verion.h checked into the tree and it is a built file. A make maintainer-clean followed by "git status --ignored" will confirm this. ( Out of scope for this patch )
3) autogen.sh has not been updated to reflect fixes. I believe that for this patch, it should be left alone and checked for regression in Jenkins by itself.
4) There is an out of date .spec file for building RPM which should be updated now that distcheck is working.
5) maintainer-clean should have rule added to remove build-aux testdriver.

This has been tested on current Ubuntu testing, OSX, Fedora 34, and Debian 10.

Additionaly "make distcheck" should be added to regression testing, along with "make maintainer-check".

Other improvement possibilities:
A possible future improvement is to let autoconf handle build with optional out of dist files.
Modify fips configure.ac check to allow for an injection of comments into blank fips files in order to prove distribution of fips/non-fips builds.
Update git rules to use 'make maintainer-clean', 'autoreconf -if', 'make distcheck'.
2021-06-19 20:16:14 -07:00
149920fc14 Merge pull request #4110 from dgarske/config_examples
Additional user_settings.h examples
2021-06-18 12:00:29 -05:00
5a685ca37e Merge pull request #4139 from SparkiDev/etm_check_pad
TLS EtM: check all padding bytes are the same value
2021-06-18 08:14:46 -07:00
15065175d8 Merge pull request #4145 from SparkiDev/sp_int_neg_mod
SP int negative: check size of a in mp_mod
2021-06-18 08:14:02 -07:00
7224fcd9bc TLS: add support for user setting signature algorithms 2021-06-18 16:19:01 +10:00
fbb7a40295 simplified string parse 2021-06-18 11:55:09 +09:00
b52ff200de addressed code review part2 2021-06-18 11:22:23 +09:00
368dd7b501 address review comments part1 2021-06-18 11:22:22 +09:00
23a3c7f5f5 fixed no-termination 2021-06-18 11:22:21 +09:00
1ebb4a47f6 addressed jenkins failure 2021-06-18 11:22:20 +09:00
a4ff5de369 always tls13 suites in the front position 2021-06-18 11:22:20 +09:00
4feedb72cc simulate set_ciphersuites comp. API 2021-06-18 11:22:19 +09:00
699a75c211 PKCS #11: Use C_Decrypt instead of C_DecryptUpdate
Some PKCS #11 devices need final called (implicit in C_Decrypt).
2021-06-18 12:14:34 +10:00
23fc810b3c added more context 2021-06-18 11:10:13 +09:00
ddf2a0227f additional fix for set verify depth to be compliant with openssl limit 2021-06-18 11:00:51 +09:00
2bbf7cc0fb addressed review comments 2021-06-18 10:49:24 +09:00
3d5c5b39ac Merge pull request #4134 from embhorn/joi-cert
Update use of joi cert and add to renew script.
2021-06-17 18:28:12 -07:00
b59c60db8a ssl.c: fix build gating on wolfSSL_X509_get_ex_new_index() again (fixing rebase error). 2021-06-17 20:14:54 -05:00
8c75553e08 wolfSentry integration: move rest of recyclable code out of examples and into wolfsentry_setup() in wolfssl/test.h, and implement peer review corrections on error codes and string.h wrapper macros. 2021-06-17 20:05:40 -05:00
55ed985c9a include error-ssl.h, not error-crypt.h, in wolfssl/test.h, and fix rebase error in src/ssl.c. 2021-06-17 20:05:40 -05:00
1c9ea6228c ssl.c: fix build gating on wolfSSL_X509_get_ex_new_index(). 2021-06-17 20:05:40 -05:00
93dfb4c7f4 add outbound connection filtering support to libwolfssl, add wolfSentry support to the test client, and add wolfSentry JSON config file support to the test client and server using --wolfsentry-config.
also, add mygetopt_long() to wolfssl/test.h, and add --help and Japanese counterpart options to test client and server.
2021-06-17 20:05:40 -05:00
2fb80ceb59 Merge pull request #4133 from dgarske/crypto_cb_25519
Adds crypto callback support for Ed/Curve25519 and SHA2-512/384
2021-06-18 09:47:30 +10:00
18fc1b7e63 Merge pull request #4006 from elms/refactor_pointer_manipulation 2021-06-17 16:37:03 -07:00
485cfd798b SP int negative: check size of a in mp_mod
When using negative numbers, t is allocated to be one digit longer than
a->used. Fail when a->used is SP_DIGIT_MAX.
2021-06-18 09:28:51 +10:00
951de64e2c set PSK at the beginning 2021-06-18 07:59:35 +09:00
3386069490 add LOAD flag to be compliant with OpenSSL 2021-06-18 07:59:34 +09:00
af917cc55e tell error code 2021-06-18 07:59:34 +09:00
976b6ae97c not push CA, revert error code when being OpensslExtra mode 2021-06-18 07:59:33 +09:00
cd73cf3d0f fix Qt unit test verifyClientCert 2021-06-18 07:59:32 +09:00
8b9bf041c1 addressed review comments 2021-06-18 07:50:06 +09:00
98ce4e901a TLS EtM: check all padding bytes are the same value
Must be constant time so as not to provide an oracle.
That is, don't leak length of data and padding.
2021-06-18 08:42:48 +10:00
22430ccdd3 higher priority of cipher suite is on top of stack 2021-06-18 07:42:41 +09:00
9181c949ae Added static ciphers and sniffer. Fixed spelling. 2021-06-17 15:19:45 -07:00
ffb9a8b440 Improve the user_settings_template to incude Windows. Added STM32 configuration example. 2021-06-17 15:19:45 -07:00
8b14bf2951 Additional user_settings.h examples. 2021-06-17 15:19:45 -07:00
4bff3b6c69 Fix issue with WOLFSSL object copying CTX and object free'ing. Track ownership of the static key info. 2021-06-17 15:12:07 -07:00
155621b611 Fix to prevent static ephemeral memory leak if WC_PK_TYPE_NONE is used for auto-detect. Add DER PK auto detect support. Add sniffer ssl_SetWatchKey_buffer support for static ephemeral. 2021-06-17 15:11:03 -07:00
258e0c10da Merge pull request #4142 from elms/fix/memtest
test: Fix memtest callbacks
2021-06-17 14:01:21 -07:00
5440b6c63c Fix for intel asm SHA512 where HAVE_INTEL_AVX1 or HAVE_INTEL_AVX2 is defined, but USE_INTEL_SPEEDUP is not. Fix for scan-build error with test.c ret not used. 2021-06-17 13:50:09 -07:00
bd6a353921 Merge pull request #4083 from dgarske/stm32_aes_gcm
Fix for STM32 AES GCM for HAL's that support byte sized headers
2021-06-17 13:08:15 -06:00
91f002235e make: --enable-memtest track and --enable-memtest=fail to force failure 2021-06-17 10:45:39 -07:00
ad59b8af45 test: Fix memtest callbacks 2021-06-17 10:15:11 -07:00
c802ea7ebd Fix for unaligned authentication tag sizes when the STM32 Cube HAL supports it with CRYP_HEADERWIDTHUNIT_BYTE. 2021-06-17 08:15:44 -07:00
b6ec698a83 Fix for FIPS case with hkdf_test. 2021-06-17 08:15:44 -07:00
14b845a9a5 Fixes for wolfCrypt HMAC test without SHA1/SHA2. Added NO RNG option to cube pack configuration template. 2021-06-17 08:15:44 -07:00
e8c4f857e1 Fix to use accelerated AES GCM when auth is not 4-byte aligned on platforms supporting byte header size. 2021-06-17 08:15:44 -07:00
a1517dbfe4 Merge pull request #4138 from SparkiDev/ssl_reorg_2
Reorg of ssl.c: X509_STORE_CTX and X509_STORE APIs isolated
2021-06-17 07:38:25 -07:00
eb7896919b Merge pull request #4137 from SparkiDev/tls13_hrr_ch_ems
TLS EMS ext: TLS13 - send in second CH if in first
2021-06-17 07:29:19 -07:00
5751e20bcc Merge pull request #4136 from SparkiDev/tfm_size_checks
tfm: fix length check in add and mul_d
2021-06-17 07:28:40 -07:00
b29fa9bd33 Changes to support Android app with wolfCrypt module v4.5.4 2021-06-17 08:11:40 -06:00
ad4baec0f5 Merge pull request #4090 from JacobBarthelmeh/CAAM
CAAM: add dynamic setup of entropy delay on init
2021-06-17 17:06:01 +10:00
d09b7153f2 address review items 2021-06-17 09:43:06 +07:00
4bba282a70 TLS EMS ext: TLS13 - send in second CH if in first 2021-06-17 11:40:48 +10:00
effa7e079d Reorg of ssl.c: X509_STORE_CTX and X509_STORE APIs isolated 2021-06-17 11:38:26 +10:00
98147de422 Fix for wolfCrypt test not calling init for ed25519 tests. 2021-06-16 16:44:28 -07:00
54cef64250 Merge pull request #4128 from SparkiDev/ssl_reorg_1
Reorg of ssl.c: PKCS7, PKCS12, crypto-only APIs isolated
2021-06-16 16:12:03 -07:00
9023c4d65a tfm: fix length check in add and mul_d
Check that the overflow digit is going to fit rather than whether we are
at limit after adding digit.
2021-06-17 09:11:01 +10:00
93ae372c55 Merge pull request #4132 from dgarske/exebits
Remove execute bit on update pem/der files
2021-06-16 17:20:53 -05:00
0fc9c33f84 Wire up Ed25519 SHA512 to use devId. 2021-06-16 13:15:06 -07:00
54f69079a8 Merge pull request #4131 from elms/fix/g++_enum_logical_op
fixes build with g++ automatically converting enum to int
2021-06-16 13:09:06 -07:00
1307972344 Update use of joi cert and add to renew script. 2021-06-16 13:55:36 -05:00
15d761a0c2 Added ED25519 and Curve25519 crypto callback support. 2021-06-16 11:49:24 -07:00
9c24731e3c Added SHA2-384/512 crypto callback support. 2021-06-16 11:49:24 -07:00
27218e1d40 Merge pull request #4129 from JacobBarthelmeh/Testing
add cert generation to renewcerts script
2021-06-16 10:21:59 -07:00
90d894b9fd Remove execute bit on update pem/der files. 2021-06-16 10:17:20 -07:00
852892c85b Merge pull request #4130 from embhorn/zd12463
Fix BIO_free_all return type
2021-06-16 10:06:49 -07:00
e39fc4b6ec Merge pull request #4099 from embhorn/zd12274
Fix nonblocking ret value from crlIOCb
2021-06-16 10:05:04 -07:00
75445f7810 fixes build with g++ automatically converting enum to int 2021-06-16 09:40:20 -07:00
b3bfe2d12b Fix BIO_free_all return type 2021-06-16 09:51:45 -05:00
9e02655ac4 Merge remote-tracking branch 'upstream/master' into os_base64 2021-06-16 23:19:52 +09:00
d8fc01aabf add cert generation to renewcerts script 2021-06-16 14:31:33 +07:00
2ca6550207 Reorg of ssl.c: PKCS7, PKCS12, crypto-only APIs isolated
Moved functions to bottom of file in groups.
Whitespace changed but not code.
PKCS7 APIs and wolfSSL_d2i_PKCS12_fp now protected by !NO_CERTS
2021-06-16 16:08:24 +10:00
3a885aba23 Refactor pointer manipulation to be independent of datatype width
Tested with `./configure CFLAGS="-DNO_64BIT" --disable-sha512
--disable-sha384 --enable-harden` on a 64-bit machine
2021-06-15 21:08:49 -07:00
5bb639f6db Merge pull request #4126 from dgarske/certs_test_expired
Fixes for expired test certs
2021-06-16 11:25:54 +10:00
d849606bba Merge pull request #4109 from guidovranken/Base64_SkipNewline-fixes
Additional length check improvements in Base64_SkipNewline
2021-06-16 08:52:32 +10:00
b73673a218 Merge pull request #3794 from TakayukiMatsuo/os_keyprint
Add wolfSSL_EVP_PKEY_print_public
2021-06-16 08:43:41 +10:00
1374ab7da5 Merge pull request #4123 from SparkiDev/sp_int_neg_cmp
SP math all: sp_cmp handling of negative values
2021-06-15 15:33:29 -07:00
6d95188f4b Fixes for expired test certs. Generated using cd certs/test && ./gen-testcerts.sh. 2021-06-15 15:07:34 -07:00
8900d05167 Fix nonblocking ret value from crlIOCb 2021-06-15 15:31:29 -05:00
2f39e6c217 Merge pull request #4122 from kaleb-himes/BUGREPORT_M_W_GCOV
Address bug that fails to ignore select files generated by gcov. Thanks to M.W. for the report
2021-06-15 11:07:30 -07:00
a9515b80eb Merge pull request #4108 from elms/fix/scripts/paths_w_spaces
tests: fix test scripts for paths with spaces
2021-06-15 08:18:08 -07:00
c6680d08ba Fix coding issues 2021-06-15 11:16:38 +09:00
cce96f5fe6 Merge pull request #4114 from dgarske/secrene_extmst
Check for insecure build combination of secure renegotiation and no extended master secret
2021-06-15 10:52:25 +10:00
12c358bc30 Merge pull request #3979 from dgarske/tls13_async
Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
2021-06-15 10:02:19 +10:00
b9715432f8 SP math all: sp_cmp handling of negative values 2021-06-15 09:44:06 +10:00
07784e9f56 Merge pull request #4066 from dgarske/stm_pka
Fixes for STM32 PKA with ECC
2021-06-15 08:33:50 +10:00
77df7d8630 Merge pull request #3968 from elms/pedantic_cleanup
Fixes for some `-pedantic` errors
2021-06-14 13:46:39 -07:00
831e1713f1 Merge pull request #4076 from TakayukiMatsuo/st_timeout
Add session ticket timeout check in DoSessionTicket
2021-06-14 13:44:32 -07:00
fd6b30ef32 Merge pull request #4111 from elms/silabs/fix_ecc_shared_secret_outlen
silabs: fix `wc_ecc_shared_secret` to only return x coordinate
2021-06-14 13:44:00 -07:00
eea9866967 Address bug that fails to ignore select files generated by gcov. Thanks to M.W. for the report 2021-06-14 14:40:11 -06:00
7ad4a3dffd Merge pull request #4086 from miyazakh/psk_length_zero
treats a return of zero from callback as no psk available
2021-06-14 13:54:00 -06:00
a8d185cb9e Merge pull request #4117 from TakayukiMatsuo/tk12403
Add null-parameters-test cases for SHA(), SHA224(), MD5() and MD5_xxx().
2021-06-14 13:52:01 -06:00
9d569dfeb7 Merge pull request #4116 from miyazakh/tcp_accept
fix api unit test compile failure
2021-06-14 13:49:00 -06:00
9ae021d2cb tests: server example doesn't like empty string params
But it's ok with them at the end
2021-06-14 12:01:09 -07:00
a110f249bd Merge pull request #4118 from JacobBarthelmeh/ECC
add error return with alloc curve macro
2021-06-14 10:46:42 -07:00
2ffc0a8392 Remove casts that are not needed. 2021-06-14 08:47:40 -07:00
4d4b3c9e8a Fixes for return codes on STM PKA code. Fix for const warnings. 2021-06-14 08:47:40 -07:00
98ab62ea74 Fix for STM32 PKA ECC point mapping, which is handled in hardware. 2021-06-14 08:47:38 -07:00
7b6005d467 Remove unused STM32 cofactor. 2021-06-14 08:46:20 -07:00
b0782cb8f8 Fix for improperly initialized PKA_ECDSASignOutTypeDef on STM32 PKA sign. 2021-06-14 08:46:20 -07:00
839231c508 Fixes for STM32 PKA compiler warnings. 2021-06-14 08:46:20 -07:00
70063213a5 additional comments, code readability, and error check 2021-06-14 21:40:51 +07:00
1ee0c3a7fd Refactor dtls_expected_peer_handshake_number handling
Moving the `dtls_expected_peer_handshake_number` value along has been moved to one location. It has also been changed to not keep state before a cookie exchange has been completed.
2021-06-14 15:51:04 +02:00
bba1c8b433 add error return with alloc curve macro 2021-06-14 20:33:20 +07:00
64298a2c4a Merge pull request #4094 from guidovranken/DecodePolicyOID-XSNPRINTF
Improve checking of XSNPRINTF return value in DecodePolicyOID
2021-06-14 19:58:09 +07:00
ed4cf6e91c silabs: fix wc_ecc_shared_secret to only return x coordinate
secure element computes and returns the full coordinate. The wolfSSL
API should only return the x component.
2021-06-13 21:46:23 -07:00
ebec2fbd25 Fixed uninitialized parameter for Base16_Encode 2021-06-14 13:45:12 +09:00
21db484f50 tests: fix test scripts for paths with spaces 2021-06-13 21:37:07 -07:00
f163a4e18f Return BUFFER_E from DecodePolicyOID if XSNPRINTF indicates insufficient buffer space 2021-06-14 03:55:13 +02:00
220bfe9926 Fix Base64_SkipNewline such that tests pass 2021-06-14 03:42:41 +02:00
3180ec96a5 Merge pull request #3963 from dgarske/nxp_ltc_rsa
Fixes for NXP LTC ECC/RSA
2021-06-14 08:29:24 +10:00
50526cfe67 Changed some logics for simplicity 2021-06-14 03:26:00 +09:00
6d3b9aec80 fix api compile failure 2021-06-12 09:24:11 +09:00
5e6b8e50c8 Fix to set groups for client benchmark test. 2021-06-11 14:12:15 -07:00
2e4e65f518 Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
* Added async support to `SendTls13ClientHello`, `DoTls13ServerHello` and `DoTls13ClientHello`.
* Cleanup of the example client/server use key share code.
* Fix some scan-build warnings.
ZD 12065
2021-06-11 14:12:12 -07:00
7eb840d615 Merge pull request #4115 from SparkiDev/ed25519_openssl_fix
ED25119 and SHAKE-256: fixes
2021-06-11 10:41:51 -07:00
5f99979597 Peer review feedback and improvements. 2021-06-11 09:10:26 -07:00
b28aab4cf9 Merge pull request #4098 from SparkiDev/san_hw_name_fix
Certs: fix leak when multiple hardware names in SAN
2021-06-11 08:25:28 -07:00
5a78574a8a Add new scripts to include.am. 2021-06-11 08:19:23 -07:00
ed5cb0a1bd Modified along the revire comments 2021-06-11 21:08:27 +09:00
779e3701e6 Merge branch 'master' of github.com:wolfSSL/wolfssl into os_keyprint 2021-06-11 13:56:52 +09:00
1a9b59b183 Add macro guard for LowResTimer 2021-06-11 11:58:55 +09:00
89156908da Merge pull request #4021 from embhorn/zd12233
Fix heap-buffer-overflow issues in wolfSSL_SMIME_read_PKCS7
2021-06-11 12:38:52 +10:00
36a9cd3010 Merge pull request #3911 from TakayukiMatsuo/tk11851
Fix SSL_read behaving differently from openSSL after bidirectional shutdown
2021-06-11 10:25:39 +10:00
e720762b5a Merge pull request #4010 from JacobBarthelmeh/fuzzing
fix for use after free issue on error cases
2021-06-11 10:21:30 +10:00
ed14e593c7 ED25119 and SHAKE-256: fixes
SHAKE-256 is off by default now. Make sure WOLFSSL_SHAKE256 doesn't make
it into options.h.
Fix openssl.test usage of ed25519 certificates.
Add scripts that regenerate certificates
2021-06-11 10:13:31 +10:00
61314f3971 Added build error for insecure build combination of secure renegotiation enabled with extended master secret disabled when session resumption is enabled. 2021-06-10 16:44:23 -07:00
4e881a226a Merge pull request #4088 from julek-wolfssl/dtls-mtu-define
Change magic number 100 bytes to an enum define
2021-06-10 09:22:08 -07:00
624e150c7b Merge pull request #3827 from SparkiDev/tls13_psk_hash
TLS 1.3 PSK: use the hash algorithm to choose cipher suite
2021-06-10 06:59:40 -07:00
2fc5b03d71 Merge pull request #4102 from danielinux/psoc6-sha-fixes
[PSOC6_CRYPTO] Do not directly include psoc6 port header to prevent loops
2021-06-10 06:57:17 -07:00
3ecb8d5a3e Merge pull request #4062 from dgarske/dh_key
DH Key and Params Export cleanups and Apache httpd fixes
2021-06-10 20:54:32 +10:00
4d3f2f92fd Add test cases for SHA(), SHA224(), MD5() and MD5_xxx() to test with null parameters. 2021-06-10 16:40:51 +09:00
56c317e1ab Merge pull request #4052 from elms/gcc11_fixes
fixes for gcc 11 compile and other whitespace
2021-06-10 15:51:04 +10:00
7e0c372e4c TLS 1.3 PSK: use the hash algorithm to choose cipher suite
See RFC 8446: 4.2.11
With TLS 1.3 PSK callback, If the returned cipher suite isn't available,
use the hash from the cipher suite and choose from available list.
Require exact match when: WOLFSSL_TLS13_PSK_NO_MATCH_HASH

Alternative callback for client added that is passed a cipher suite
string. Called for each cipher suite that is to be negotiated.
If cipher suite to be used with PSK then return client identity.
Returning an identity based on cipher suite hash will result in
only one PSK extension being added per hash.
2021-06-10 09:55:27 +10:00
c6c7dfd5db Merge pull request #4053 from SparkiDev/cppcheck_fixes_6
cppcheck: fixes from reviewing report
2021-06-09 12:51:30 -07:00
a6edff7bd5 Merge pull request #4017 from SparkiDev/not_ecc_pk_cb
ECC: Disable ECC but have Curve25519/448 and PK callbacks fix
2021-06-09 12:38:37 -07:00
c6fc709502 Merge pull request #4072 from SparkiDev/ecc_sp_c_mod_sub_fix
SP C ECC: mont sub - always normalize after sub before check for add
2021-06-09 12:36:46 -07:00
fb366f063e Additional length check improvements in Base64_SkipNewline 2021-06-09 19:16:07 +02:00
a68542e6f4 Fix heap-buffer-overflow issues in wolfSSL_SMIME_read_PKCS7 2021-06-09 08:32:52 -05:00
5a54bb656b make macros for pragma to compile with gcc11 2021-06-08 19:20:20 -07:00
d8cd7cbee1 Merge pull request #4024 from kabuobeid/zd12245
PKCS7: Check size in wc_PKCS7_InitWithCert before XMEMCPY to avoid overflow.
2021-06-09 10:06:02 +10:00
c6646ae9c8 Merge pull request #4044 from julek-wolfssl/ZD12270
Check for XREAD when XFREAD fails
2021-06-09 09:48:25 +10:00
50dca86dcf Merge pull request #3878 from JacobBarthelmeh/ECC
add deterministic k generation for ECC sign
2021-06-09 09:47:19 +10:00
8fa4dedf97 Merge pull request #4096 from vaintroub/master
MSVC, ARM64  - correct 64bit detection
2021-06-09 09:40:47 +10:00
32c215775a Merge pull request #4093 from guidovranken/DecodeResponseData-allocation-check
ASN: Catch allocation failure in DecodeResponseData
2021-06-09 09:38:53 +10:00
9580574382 Merge pull request #3999 from dgarske/user_io
Fixes for building with `WOLFSSL_USER_IO`
2021-06-09 08:55:36 +10:00
70d2c838bb Merge pull request #4080 from kaleb-himes/SHAKE_DEFAULT_FIX
Sync SHAKE256 default (disabled) with parent default edDSA448 (disabled) and remove WOLFSSL_NO_SHAKE256 flag
2021-06-09 08:52:05 +10:00
ae4af3c681 Merge pull request #4071 from SparkiDev/fp_ecc_long_order
ECC FP: cached doesn't work when order has more bits than prime
2021-06-08 12:17:04 -07:00
4a85127507 Improve wc_DhKeyToDer for public key size calculation. Fixes bug with the output too (was missing 1 byte in length for the unused bits byte in bit string). 2021-06-08 09:55:56 -07:00
9b215c5138 Fixes for DH Pub key import/export and new test case. Improve wc_DhParamsToDer. 2021-06-08 09:27:30 -07:00
6db0b42c7f * Refactor of DH key and param exports code (moved into asn.c) enabled with WOLFSSL_DH_EXTRA.
* Cleanup `WOLFSSL_DH_EXTRA` macro logic and do not allow with FIPS v1 or v2.
* Fixes for httpd (if `SSL_CONF_FLAG_FILE` is defined it is used to indicate support for `SSL_CONF_CTX_set_flags` and `SSL_CONF_cmd_value_type`).
* Add Curve448 and ED448 key type to `enum wc_PkType`.
* Expand `dh_ffdhe_test` to include 4096 bit.
2021-06-08 09:27:26 -07:00
54d13f63c1 Merge pull request #4067 from haydenroche5/pkcs8
Add an API function wc_EncryptPKCS8Key to handle encrypting a DER, PKCS#8-formatted key.
2021-06-08 09:21:53 -07:00
34d8073fbd remove dead code 2021-06-08 22:45:28 +07:00
de70681229 Improve code comments to explain FP_ECC limitation for SECP160R1, SECP160R2, SECP160K1 and SECP224K1. 2021-06-08 08:41:36 -07:00
61eae79f71 Merge pull request #4074 from SparkiDev/ecdsa_dbl_table_point
ECDSA FP ECC: fix corner case
2021-06-08 08:35:17 -07:00
5586bc349c Merge pull request #4056 from SparkiDev/mp_int_rem_apis
MP Integer: remove unsupported API prototypes
2021-06-08 08:08:04 -07:00
50e8509a36 Merge pull request #4037 from SparkiDev/prime_test_err_check
TFM prime checking: check for more errors
2021-06-08 08:06:37 -07:00
9497c74283 Merge pull request #4081 from strongX509/master
SHA3-based RSA signatures require SHA-3 hash OIDs
2021-06-08 07:46:18 -07:00
0186d19aba Fix some coding style issues. 2021-06-08 16:25:28 +09:00
6d1981abd1 Do not directly include psoc6 port header to prevent loops 2021-06-08 08:24:43 +02:00
88322b82a5 Merge pull request #3871 from julek-wolfssl/openvpn-master
OpenVPN additions and fixes
2021-06-08 13:54:14 +10:00
194b494741 Merge pull request #4034 from embhorn/zd12261
Fix declarations for EVP_VerifyFinal and RSA_private_encrypt
2021-06-08 12:15:30 +10:00
b3352648dd Merge pull request #4097 from guidovranken/blake2-init-key-fixes
Check return value in BLAKE2 key init functions
2021-06-08 11:54:29 +10:00
8ee1dda2f9 Merge pull request #4001 from dgarske/time_long
Improve TLS v1.3 time rollover support and fixes for NO_ASN_TIME
2021-06-08 11:17:55 +10:00
23d733f837 Merge pull request #4063 from guidovranken/zd12328
Fix length calculations in Base64_SkipNewline
2021-06-08 10:55:15 +10:00
c726cddf1b session_ticket: Add separate member to track compatCb
This resolves an error:
`ISO C forbids conversion of object pointer to function pointer type`

Instead of casting the function pointer, the extra
member contains the function pointer.
2021-06-07 15:42:38 -07:00
5c01613acb Add GCC extension to bypass select -pedantic warnings
Add wrapper macro for `__extension__` to suppress pedantic warnings
2021-06-07 15:38:15 -07:00
9fadc21e0f add version print out 2021-06-08 04:18:22 +07:00
3e307aa626 Merge pull request #4091 from JacobBarthelmeh/Testing
add strict check on signature length
2021-06-07 11:02:02 -07:00
4e318ade36 In wc_PBKDF1_ex, break out of outer loop on error 2021-06-07 16:21:02 +02:00
f97ca1c1ca adjust test case and add useful comments 2021-06-07 19:44:05 +07:00
e76ae2b8ac Certs: fix leak when multiple hardware names in SAN
Can only be one hardware name in SAN as this indicates the certificate
is for verifying signatures created by hardware module.
2021-06-07 12:02:23 +10:00
96b7b193d7 Check return value in BLAKE2 key init functions
If built with smallstack, allocations in `blake2s_update` and `blake2b_update` may fail,
so the error must be propagated.
2021-06-07 03:34:44 +02:00
bd7b57783d Remove excess space characters 2021-06-07 03:20:16 +02:00
898b9d5e24 Merge pull request #4084 from dgarske/sp_math_keygen
Fix for building SP small math only (no DH) with key generation
2021-06-07 10:48:01 +10:00
29968716ea MSVC, ARM64 - correct 64bit detection
Fixes https://github.com/wolfSSL/wolfssl/issues/4095
2021-06-06 23:30:27 +02:00
1af3f482cb Catch allocation failure in ASNToHexString 2021-06-06 19:52:15 +02:00
1606746d2d a return of zero from callback as no psk available 2021-06-06 11:53:02 +09:00
8cb576009d Improve bounds check in EncodePolicyOID 2021-06-06 04:07:02 +02:00
a1257429bd Improve checking of XSNPRINTF return value in DecodePolicyOID 2021-06-06 03:54:15 +02:00
76e0a8666b Catch allocation failure in DecodeResponseData 2021-06-06 03:12:53 +02:00
5d33161032 Fixes for RSA keygen with SP (no DH). Thanks Sean. 2021-06-04 13:32:59 -07:00
c245c4a812 add strict check on signature length 2021-06-05 03:09:33 +07:00
9ef43c5aff add dynamic setup of entropy delay on init 2021-06-05 00:41:10 +07:00
d7117cd8bb Merge pull request #4089 from danielinux/psoc6-sha-fixes
psoc6_Crypto port: fixes to sha256/sha512 objects
2021-06-04 09:16:42 -07:00
a5a4925370 Fixed sha256 and sha512 interface for psoc6 crypto module 2021-06-04 13:22:17 +02:00
588a424d8d Change magic number 100 bytes to an enum define 2021-06-04 11:27:57 +02:00
961773b384 Merge pull request #4079 from lealem47/PKCS12UnitTest
Pkcs12 unit test
2021-06-03 16:07:54 -06:00
21060afb80 Fix for building SP math only (small) with key generation. Fix for WOLFSSL_EXTRA. Fix for RSA without PSS. Fix for ed25519 spelling error. 2021-06-03 10:56:54 -07:00
66c7acb076 add use of heap hint for malloc 2021-06-03 23:38:30 +07:00
195ca2b3f0 Add corner test cases for EVP_EncodeFinal and EVP_DecodeFinal 2021-06-03 20:02:48 +09:00
eb63ab19e2 Fix for mp_mulmod with NXP LTC. 2021-06-01 16:33:58 -07:00
6cfb982740 Merge pull request #3981 from miyazakh/qt_oslext_cnf
Added compatibility layer API
2021-06-01 15:25:37 -06:00
72fc7e62b8 Fixed spacing 2021-06-01 14:47:51 -06:00
0caf3ba456 SHA3-based RSA signatures require SHA-3 hash OIDs
The SHA-3 ASN.1 OIDs are defined by NIST under the
nistalgorithm/hashAlgs node.
2021-06-01 22:02:23 +02:00
a27cdc538a Fix typo 2021-06-01 13:30:32 -06:00
3a9c6ea924 fix FIPS v2 check ($ENABLED_FIPS not set for v2) 2021-06-01 13:29:39 -06:00
94831eadf1 Sync SHAKE256 default (disabled) with parent default edDSA448 (disabled) and remove WOLFSSL_NO_SHAKE256 flag 2021-06-01 11:38:17 -06:00
03a5395b53 Fixed casting issue 2021-06-01 09:46:30 -06:00
69cf5ef266 Chage to use WOLFSSL_SESSION.bornON instead of WOLFSSL_SESSION.timestamp to hold the ticket creation time. 2021-06-01 15:30:07 +09:00
5f7477980c Add session ticket timeout check in DoSessionTicket 2021-06-01 00:09:50 +09:00
2db233d10e Added wolfssl_PKCS12_verify_mac testing in test_wolfSSL_PKCS12() function in api.c 2021-05-28 16:33:46 -06:00
15931fa199 Merge pull request #4060 from kojo1/encrypt_len
FP_MAX_BITS for ENCRYPT_LEN
2021-05-28 15:55:58 -06:00
ab07c55609 check on hmac free and add else if case for check if key is 0's 2021-05-28 16:27:54 +07:00
9fff404313 Merge pull request #4073 from TakayukiMatsuo/tk12138
Add calling wc_FreeMutex for globalRNGMutex
2021-05-28 16:11:00 +10:00
c69665b999 ECDSA FP ECC: fix corner case
When the same table is used for both base point and public point (which
is not a valid thing to do) then a corner case occurs when the table
point can be added to the same point. This has to be a double operation
instead.
The table point isn't able to be doubled as it has a z-ordinate of 0 and
the original point is overwritten with the invalid add result.
Fix this case by:
 - copying the table point into the result,
 - setting z-ordinate to Montgomery form of 1,
 - double the result point in place.
2021-05-28 13:06:20 +10:00
54dba6a2f2 Add calling wc_FreeMutex for globalRNGMutex 2021-05-28 11:19:40 +09:00
3deb635155 skip memory callback tests with STATIC_MEMORY and LINUXKM 2021-05-27 14:46:45 -07:00
7a98c517e4 Fixes for some -pedantic errors
Some of the API with callbacks may not be compatible with pedantic
2021-05-27 14:46:45 -07:00
252971aad7 better comments on RFC steps and fixes for combining code blocks, fix for check on sign_k value 2021-05-27 17:27:15 +07:00
4e88521a90 SP C ECC: mont sub - always normalize after sub before check for add 2021-05-27 11:08:05 +10:00
6bf9a887e1 ECC FP: cached doesn't work when order has more bits than prime
Small curves that are not commonly used do not work with scalars that
are the length of the order when the order is longer than the prime.
The table is generated based on modulus length not order length.
Simple fix is to not allow these curves to be used with FP_ECC.
Order isn't passed into the pseudo-public APIs.
2021-05-27 09:53:03 +10:00
1fe445368c Merge pull request #4069 from guidovranken/zd12349
Several ASN decoder fixes
2021-05-26 16:13:54 -07:00
d1e3be1f43 Replace return code from literal to value 2021-05-27 06:20:34 +09:00
1fbc3dc2d4 Heap-allocate additional CertStatus structs in DecodeResponseData 2021-05-26 21:41:47 +02:00
cfef249041 Several ASN decoder fixes
See ZD 12349
2021-05-26 20:15:32 +02:00
88370285cc Add an API function wc_DecryptPKCS8Key to handle decrypting a DER, PKCS#8
encrypted key.
2021-05-26 10:48:14 -07:00
5e4e73d6e9 Add an API function wc_EncryptPKCS8Key to handle encrypting a DER,
PKCS#8-formatted key.

There's already a function wc_CreatePKCS8Key, but this only creates the
unencrypted PKCS#8 key. TraditionalEnc exists, which takes a non-PKCS#8 key,
converts it to PKCS#8 format, and encrypts it, but this function isn't in the
public-facing API. I've modified TraditionalEnc to use wc_EncryptPKCS8Key after
wc_CreatePKCS8Key. wc_EncryptPKCS8Key is essentially the encryption portion of
TraditionalEnc moved out into its own function. wc_EncryptPKCS8Key will be in
the API going forward so that users can do PKCS#8 encryption without relying on
the non-API TraditionalEnc. Next, I'll be adding a corresponding
wc_DecryptPKCS8Key to handle decryption.
2021-05-26 10:48:11 -07:00
8bf2cbf55e Fix for NXP LTC to not modify incoming math variables (use temp). Added build option for testing/validation of the LTC math operation. 2021-05-26 10:30:47 -07:00
0d3530b45d Cleanup NXP LTC logic. 2021-05-25 16:49:58 -07:00
c59349c7a7 Fix for ecc_map, which is handled in hardware. Fix for NXP LTC mp_mul N value. Fix for MMCAU cast warnings. 2021-05-25 15:58:22 -07:00
63ac9decfc Added error response checking for NXP LTC LTC_PKHA_ModMul. Isolated the result C to it's own variable. 2021-05-25 15:58:22 -07:00
9453f83d28 Fix bad logic flow in WC_NO_RNG case. 2021-05-25 15:58:22 -07:00
64ae0a827c Fixes for RSA with NXP LTC. The invmod function must reduce if A > B. Added RSA Key Generation acceleration. 2021-05-25 15:58:22 -07:00
41af3da0e3 Merge pull request #4057 from SparkiDev/no_tls12_pkcb
TLS: fix build with no TLSv12 but PK callbacks
2021-05-25 15:26:40 -07:00
360d6c8a4f Additional fix for Base64_SkipNewline 2021-05-26 00:25:27 +02:00
3cc69ee6a0 Merge pull request #4064 from SparkiDev/evp_aes_gcm_stream_leak
EVP AES-GCM Streaming: must free Aes
2021-05-25 15:11:03 -07:00
1c0fd3f1c0 addressed review comments part3 2021-05-26 06:17:33 +09:00
e2284d59bf addressed review comments part2 2021-05-26 06:07:48 +09:00
ae502c7a09 addressed review comments part1 2021-05-26 06:07:48 +09:00
af67965f65 addressed jenkins failures part1 2021-05-26 06:07:48 +09:00
33e91c577f added unit test cases for cmdline 2021-05-26 06:07:47 +09:00
394c0b5cdc implemented CONF_cmd 2021-05-26 06:07:47 +09:00
7127dbeeec fixes for gcc 11 compile and other whitespace 2021-05-25 12:34:04 -07:00
e1bc0c4447 EVP AES-GCM Streaming: must free Aes
AES streaming implementation allocates data in Aes objects, when small
stack, that needs to be freed.
Fix memory leaks in streaming test case too.
2021-05-25 15:57:09 +10:00
b7663a51b4 Fix length calculations in Base64_SkipNewline
ZD 12328
2021-05-25 03:52:16 +02:00
956a0f2b5f Merge pull request #3931 from julek-wolfssl/dsa-engine
Add more DSA parameters support
2021-05-24 14:57:02 -06:00
399ce70aba Merge pull request #4055 from JacobBarthelmeh/PKCS7
set content type parsed
2021-05-24 13:21:19 -06:00
d03ce69009 Merge pull request #4050 from julek-wolfssl/devkitpro
Add support for running `wolfcrypt/test/testwolfcrypt` on Dolphin emulator
2021-05-24 13:20:42 -06:00
159fe1541a FP_MAX_BITS for ENCRYPT_LEN 2021-05-24 07:12:07 +09:00
6747055d46 TLS: fix build with no TLSv12 but PK callbacks
./configure '--disable-tlsv12' '-enable-pkcallbacks'
Disable non-TLS13 cipher suite test as well.
2021-05-21 10:59:23 +10:00
573c0fcba7 MP Integer: remove unsupported API prototypes
mp_read_signed_bin, mp_signed_bin_size, mp_to_signed_bin - not
implemented anywhere. (Removed fp versions that were commented out too.)
mp_read_raw, mp_raw_size, mp_toraw - map to unimplemented mp_*_signed_*
APIs.
2021-05-21 08:22:04 +10:00
ceadb62d5b Add support for running wolfcrypt/test/testwolfcrypt on Dolphin emulator 2021-05-20 21:07:50 +02:00
f4959cca8d set content type parsed 2021-05-21 01:42:10 +07:00
2c6285ccba cppcheck: fixes from reviewing report 2021-05-20 17:55:06 +10:00
0e23d40250 Merge pull request #4038 from TakayukiMatsuo/tk12254
Add test cases for wc_ShaxxxUpdate funcs
2021-05-18 15:38:02 -06:00
b87af6ae89 Merge pull request #4046 from SparkiDev/coverity_1
TFM: get returned error to act on
2021-05-18 14:26:04 -05:00
687736fd56 Merge pull request #4047 from elms/automake_branch_switch
make: fix timing error when switching between revisions
2021-05-18 13:50:46 -05:00
9661677d4d Merge pull request #4041 from SparkiDev/tls13_psk_early_test_fix
TLS 1.3 PSK EarlyData testing
2021-05-18 10:00:03 -07:00
82981e9305 make: fix timing error when switching between revisions
On switching over revision that added server target specific CFLAGS,
could receive: `error: #warning "For timing resistance / side-channel
attack prevention consider using harden options"`
2021-05-18 09:43:29 -07:00
ed5b134161 TLS 1.3 PSK EarlyData testing
Fix test to expect 3 or 5 lines with "Early Data" (release or debug
build).
2021-05-18 15:25:12 +10:00
c1490bb91a TFM: get returned error to act on 2021-05-18 14:30:26 +10:00
ed3a0ae694 TFM prime checking: check for more errors
Small stack can produce errors that were being ignored.
Checks for valid size in fp_exptmod was being ignored.
2021-05-18 08:51:55 +10:00
d8312a2e61 Merge pull request #4040 from JacobBarthelmeh/CAAM
add caam header files to make install
2021-05-17 12:22:41 -07:00
4a1907ae88 Merge pull request #3976 from rliebscher/Use_Renesas_RX_intrinsics_with_CC-RX_compiler
Renesas RX: Use intrinsics for rot[rl], revl
2021-05-17 11:05:01 -07:00
379312d23e Merge pull request #4042 from danielinux/dcp_explicit_casts 2021-05-17 08:05:39 -07:00
58e7d5388a Check for XREAD when XFREAD fails
On Windows we would always fail with `NOT_COMPILED_IN` when reading a  file BIO.
2021-05-17 16:57:53 +02:00
b09df89200 NXP DCP: add explicit casts 2021-05-17 10:35:00 +02:00
efa478c121 add caam header files to make install 2021-05-15 15:42:50 +07:00
e18880f7dc Merge pull request #4036 from SparkiDev/sp_asm_x86_64_ifdef
SP ASM: x86_64 asm files - protect with WOLFSSL_SP_X86_64_ASM
2021-05-14 10:35:59 -07:00
8c71fb4113 Add test cases for wc_ShaxxxUpdate funcs 2021-05-14 09:46:21 +09:00
740f200156 SP ASM: x86_64 asm files - protect with WOLFSSL_SP_X86_64_ASM 2021-05-14 09:22:41 +10:00
19526f050e Merge pull request #4035 from JacobBarthelmeh/CAAM
add macro guard on debug print
2021-05-13 12:46:11 -07:00
82a2797b56 add macro guard on debug print 2021-05-13 23:58:51 +07:00
263105abec Merge pull request #4033 from JacobBarthelmeh/CAAM
set partition number on key import and use ocb address for free'ing d…
2021-05-13 09:39:36 -07:00
44a9346305 Merge pull request #4025 from danielinux/hdrbg_double_include_sha256
Fix double include of sha256.h causing a build error
2021-05-13 09:15:51 -07:00
9eebaaf352 Fix declarations for EVP_VerifyFinal and RSA_private_encrypt 2021-05-13 10:48:49 -05:00
5865dc08dd Code review changes 2021-05-13 15:21:33 +02:00
311c929fe2 set partition number on key import and use ocb address for free'ing dangling partitions on close 2021-05-13 17:34:30 +07:00
420a48a5aa Removed unnecessary headers 2021-05-13 07:40:22 +02:00
563c7391ed DCP: moved guards so code is not included when building *.c 2021-05-13 07:29:33 +02:00
6ea5254bb9 DCP refactor: do not override wc_Sha types 2021-05-12 17:11:09 +02:00
0a8996f467 Merge pull request #4028 from danielinux/freescale_rng
Allow use of FREESCALE hw RNG without a specific port
2021-05-12 06:41:01 -07:00
1dfde34852 Allow use of FREESCALE hw RNG without a specific port 2021-05-12 10:10:42 +02:00
f3c07e5f3f include sha256.h when required by smallstackcache 2021-05-12 09:42:41 +02:00
8c008b81ac random.h: removed include of sha256.h with HASHDBRG 2021-05-12 07:46:22 +02:00
8a17e6c10e Merge pull request #4019 from dgarske/zd11435
ECC, SP math all: Add `wc_ecc_gen_k` arg checking. Fix SP math debug support (mp_dump)
2021-05-12 08:21:56 +10:00
c75830e2e8 Merge pull request #4011 from miyazakh/set_verify_depth2
fix out of bound access when peer's chain is greater than verifyDepth + 1
2021-05-11 15:38:39 -06:00
cba029a436 PKCS7: Check size in wc_PKCS7_InitWithCert before XMEMCPY to avoid overflow. 2021-05-11 14:35:41 -07:00
ae0591b1db Merge pull request #4016 from miyazakh/qt_sanity_check
add sanity check
2021-05-11 15:06:54 -06:00
64330d468e Merge pull request #4023 from danielinux/dcp_rt1060_fixes_aes
DCP port: Fixed AES, aligned key for the HW module
2021-05-11 09:55:50 -07:00
92a524820b Merge pull request #4018 from SparkiDev/jenkins-nightly-1
Fixes from nightly builds
2021-05-11 09:11:42 -07:00
fce9870a64 Merge pull request #4020 from ejohnstown/options-export
New Option Export/Import
2021-05-11 09:10:17 -07:00
d9cc013fd2 DCP port: Fixed AES, aligned key for the HW module 2021-05-11 08:27:03 +02:00
d74b74d156 Also adjust for v3 of export, and update the API test case. 2021-05-10 18:06:31 -07:00
7e69277680 Improve SP mp_dump to use macro. 2021-05-10 16:27:06 -07:00
bab0d9bd4a Merge pull request #4022 from dgarske/test_fix
Test AES CBC: Fix for the unmodified check for AesCbc test
2021-05-11 08:38:04 +10:00
db7888ceaa Fix for the unmodified check for AesCbc test. 2021-05-10 10:04:50 -07:00
a608b083b4 Take into account a new flag in the DTLS state export and import. 2021-05-10 09:33:38 -07:00
8c91a0c6b0 Support for mp_dump with SP Math ALL. 2021-05-10 09:26:33 -07:00
f5509780c6 Add argument checking to wc_ecc_gen_k . Cleanup return codes for wc_ecc_mulmod_ex2. 2021-05-10 09:26:33 -07:00
ead656c4db Fixes for NO_BIO related to ZD11886. Replaces PR #3888. 2021-05-10 09:19:08 -07:00
ddbd26305f OpenVPN additions and fixes
- `SSL_CTX_set_min_proto_version` now allows setting not compiled in protocols but checks that the constraints leave any compiled in protocol available
- wolfSSL_HmacCopy return already returns `WOLFSSL_SUCCESS` or `WOLFSSL_FAILURE`
2021-05-10 12:00:18 +02:00
0c1af66843 Fixes from nightly builds
output not read.
g++ realloc cast.
curve25519 - no fix, only format changes
2021-05-10 11:59:52 +10:00
8779c3a884 ECC: Disable ECC but have Curve25519/448 and PK callbacks fix
Fix ed25519 certificates.
Tidy up testsuite.c
2021-05-10 10:32:55 +10:00
07872189eb add sanity check 2021-05-08 13:15:50 +09:00
e247161b2e Merge pull request #3992 from embhorn/zd12169
Allow parsing spaces in Base64_SkipNewline
2021-05-07 14:30:24 -07:00
49717328dd Merge pull request #4014 from haydenroche5/cmake
Add support for reproducible builds with CMake.
2021-05-07 15:54:01 -05:00
aa3f9f8459 Merge pull request #4013 from kabuobeid/smime_fixes
S/MIME: Fix issue with canonSection size when adding newlines.
2021-05-07 13:12:54 -07:00
28e2d68677 Merge pull request #4015 from embhorn/zd12221
Fix XMALLOC of sp_point_256 array
2021-05-07 13:11:41 -07:00
3807304243 Fixes in additional places for incorrect point heap allocation size in SP ecc_mulmod with small stack or SP no malloc. 2021-05-07 09:43:17 -07:00
0bc0e0f562 Fix XMALLOC of sp_point_256 array 2021-05-07 09:12:22 -05:00
051d1c2579 Add support for reproducible builds with CMake.
Unlike the autotools build, I've chosen NOT to make the build un-deterministic
if WOLFSSL_REPRODUCIBLE_BUILD is set to no (the default). Instead, I just use
whatever CMake's default is. On my system, ar and ranlib run in deterministic
mode by default, and the CMake defaults for the relevant ar and ranlib variables
are:

CMAKE_C_ARCHIVE_CREATE = <CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>
CMAKE_C_ARCHIVE_APPEND = <CMAKE_AR> q  <TARGET> <LINK_FLAGS> <OBJECTS>
CMAKE_C_ARCHIVE_FINISH = <CMAKE_RANLIB> <TARGET>

So my builds are automatically deterministic. This is normal on my system so I
wouldn't want to make them not deterministic by default, hence the decision.

I validated with md5sum on libwolfssl.a that explicitly making the build not
deterministic indeed results in different checksums across multiple runs. The
checksums are the same when flipping back to deterministic mode.
2021-05-06 23:05:33 -07:00
62bb0a8527 S/MIME: Fix issue with canonSection size when adding newlines. 2021-05-06 16:35:24 -07:00
6c131e3e8b Fix off by 1 in rollover calculation. 2021-05-06 14:46:35 -07:00
c88afdef87 Fixes for building with WOLFSSL_USER_IO (with no built-in socket support). Related to issue #3998. 2021-05-06 11:07:05 -07:00
1cd8bd3a94 Merge pull request #3993 from ejohnstown/actions 2021-05-06 08:32:37 -07:00
2a39f1dc5c fixed memory leak 2021-05-06 16:55:51 +09:00
93f04543b0 fixed unit test intermittent failure 2021-05-06 15:40:24 +09:00
0539b99c86 fix boundary access when peer's chain is less than verifyDepth + 1 2021-05-06 14:54:16 +09:00
2c2f389373 set pointer to null after free 2021-05-06 12:11:52 +07:00
e185a9b7ca reset pointer on SMIME fail case 2021-05-06 11:44:46 +07:00
4cfa6c43a5 Merge pull request #4000 from dgarske/sizeof_ctc
Fix for SIZEOF detection and issue with CTC_SETTINGS
2021-05-05 15:46:14 -07:00
014bd21df0 Merge pull request #3983 from tmael/tls_down
TLS minimum downgrade option
2021-05-05 15:38:45 -07:00
bc043ee358 Merge pull request #3980 from embhorn/gh3978
Fix Espressif win script
2021-05-05 15:37:04 -07:00
0b16b33de4 Merge pull request #3973 from SparkiDev/pkcs11_sign
PKCS#11: rework RSA operations to be clearer
2021-05-05 15:35:27 -07:00
94c0bff839 Merge pull request #3997 from tmael/minor_fixes
Fix test build
2021-05-04 08:51:30 -07:00
ed188903e0 Merge pull request #4007 from haydenroche5/ocsp_bug
Fix test_wolfSSL_CertManagerCheckOCSPResponse.
2021-05-03 16:55:52 -07:00
822aa92fcc Fix test_wolfSSL_CertManagerCheckOCSPResponse.
This test broke once we went past the nextUpdate time in the static, raw OCSP
response being used. This change makes it so that response is valid until 2048.
2021-05-03 15:26:39 -07:00
6e0197e171 Merge pull request #4002 from kabuobeid/smime_fixes
S/MIME: Canonicalize multi-part messages before hashing.  Improve error checking in wc_MIME_parse_headers.
2021-05-03 09:24:43 -07:00
9eab854c61 Revised logic along review comments 2021-05-03 07:44:04 +09:00
8071fac306 S/MIME: Add smime-test-canon.p7s to include.am 2021-04-30 15:30:55 -07:00
effcecf40d S/MIME: Add non-canonicalized test case 2021-04-30 15:07:37 -07:00
f8ecd4b441 Fixes for building with NO_ASN_TIME. If used with TLS user must supply LowResTimer and TimeNowInMilliseconds. 2021-04-30 15:04:31 -07:00
c9634952d5 Fix to handle time rollover in TLS v1.3 diff calculation. 2021-04-30 15:04:09 -07:00
651860dce7 Merge pull request #3991 from kaleb-himes/OE6_MINOR_PORTING_CHANGE
Implement minor port change requested by customer
2021-04-30 14:37:35 -07:00
9e48de9d42 Merge pull request #3970 from embhorn/zd12122
Clarify that units of size parameters are in bits
2021-04-30 14:28:50 -07:00
fa9f1f8012 Merge pull request #3977 from embhorn/zd12136
Improve PSK callback doc
2021-04-30 14:26:39 -07:00
ea2e2994af Reversing hunk in test.c for DEOS (suspect that was in error). 2021-04-30 14:21:23 -07:00
baa80284c0 S/MIME: Code review fixes 2021-04-30 14:00:59 -07:00
57e03d7e2f Merge pull request #3961 from miyazakh/qt_oslext_pskss_cb
added psk session callback compatibility layer API
2021-04-30 14:26:44 -06:00
44b7dd828e Merge pull request #3972 from TakayukiMatsuo/newindex
Add wolfSSL_CRYPTO_get_ex_new_index
2021-04-30 14:21:55 -06:00
3daafb47d5 Merge pull request #3982 from dgarske/atca_bool
Fix for ATECC on platforms where bool and int have different sizes
2021-04-30 13:59:49 -06:00
37cb24874e Merge pull request #3994 from miyazakh/esp_rsa_hw
Fixed esp32 RSA hw accelerator initialization issue
2021-04-30 13:58:24 -06:00
573d51966a S/MIME: Canonicalize multi-part messages before hashing. Improve error checking in wc_MIME_parse_headers. 2021-04-30 12:50:27 -07:00
6489d69c7c For platforms that support limits.h or windows make sure both SIZEOF_LONG_LONG and SIZEOF_LONG are set, otherwise causes issues with CTC_SETTINGS. 2021-04-30 11:06:09 -07:00
e97692c521 Merge pull request #3926 from vppillai/vppillai-patch-2
Fix ATECC608A TNGTLS certificate size issue
2021-04-30 10:58:09 -07:00
751cb8f43f Merge pull request #3974 from JacobBarthelmeh/sniffer
add fatal error return value for sniffer
2021-04-30 10:57:33 -07:00
1388956a35 Merge pull request #3995 from SparkiDev/sha3_align
SHA-3: Aligned access of 64 bit value.
2021-04-30 10:54:21 -07:00
f9a9b139ed Fix a build err 2021-04-29 16:44:51 -07:00
1fbe0cb408 SHA-3: Aligned access of 64 bit value. 2021-04-30 08:45:05 +10:00
8ede17f337 code formating changes based on PR review. 2021-04-29 07:48:31 +05:30
f4935f52b5 clear PROT_RSA_PD bit in PORT_RSA_PD_CTRL_REG to be initialization and activate RSA accelerator 2021-04-29 09:20:16 +09:00
3aa3fc889f Add simple push and pull-request triggered build checks. 2021-04-28 16:52:54 -07:00
985482a2ad PKCS#11: rework RSA operations to be clearer 2021-04-29 08:42:53 +10:00
cdede0515c Allow parsing spaces in Base64_SkipNewline 2021-04-28 10:30:16 -05:00
0b4b0193e7 Implement minor port change requested by customer 2021-04-28 08:58:23 -06:00
f652ac2a04 Removed unused macro guard. 2021-04-28 10:47:22 +09:00
a56de6361d Removed the double-defined function. 2021-04-28 10:41:49 +09:00
c4782a7a1c Fix macro guard for wolfSSL_CRYPTO_get_ex_new_index and get_ex_new_index. 2021-04-28 10:41:49 +09:00
9c0ff73370 Add wolfSSL_CRYPTO_get_ex_new_index 2021-04-28 10:38:53 +09:00
4063e33b02 addressed review comments p1 2021-04-28 10:08:22 +09:00
9de3fab74c fixed jenkins failures part1 2021-04-28 10:08:21 +09:00
0e40293798 added psk session callback 2021-04-28 10:08:21 +09:00
385e0bedaa Merge pull request #3990 from haydenroche5/ocsp_bug
Fix CompareOcspReqResp.
2021-04-27 17:07:58 -07:00
edb0beb9b6 Merge pull request #3969 from TakayukiMatsuo/koyo
Add wolfSSL_DH_get0_pqg
2021-04-27 17:52:17 -06:00
6fad8c4a57 Merge pull request #3975 from TakayukiMatsuo/resumable
Add implementation for wolfSSL_SESSION_is_resumable.
2021-04-27 16:45:34 -06:00
73076940af Fix CompareOcspReqResp.
There was a bug in this function that could cause a match to be reported even
when the OCSP request and response in fact had a mismatch.
2021-04-27 13:54:43 -07:00
1bff411191 Merge pull request #3986 from miyazakh/qt_ctx_min_max_proto
add MIN/MAX_PROTO into CTX_ctrl
2021-04-27 14:54:16 -06:00
6d381a6c7f do nothing when version is zero 2021-04-27 21:13:19 +09:00
3b070e1bd0 add MIN/MAX_PROTO into CTX_ctrl
add unit test for min/max proto of CTX ctrl
2021-04-27 21:13:17 +09:00
e716fcc635 do not reserve ATMEL_SLOT_ECDHE type for TNGTLS 2021-04-27 16:51:49 +05:30
c34fcf908c code cleanup based on PR review comments 2021-04-27 12:17:23 +05:30
7e87c01a7d Merge pull request #3987 from tmael/pss_salt
RSA: Fix RSA PSS padding check
2021-04-27 14:50:32 +10:00
1637bd3e02 Fix RSA PSS padding 2021-04-26 19:21:23 -07:00
b7b2347804 Merge pull request #3985 from elms/fix/dtls_no_asn
fix define gates for `AddFragHeaders` with DTLS
2021-04-26 15:13:59 -07:00
d20f7e7143 fix define gates for AddFragHeaders with DTLS
fixes build with `./configure --enable-dtls --disable-asn`
2021-04-24 07:23:50 -07:00
3502bdc8df Merge pull request #3960 from elms/msys_build_fix
mingw/msys: fix build error with TFM
2021-04-23 15:56:10 -07:00
f8e9f32eb8 Add a new file 2021-04-23 15:56:09 -07:00
54b17ba465 Merge pull request #3952 from julek-wolfssl/ZD12062
Using `--enable-chacha=noasm` wouldn't actually enable chacha
2021-04-23 15:55:10 -07:00
40fe746710 Merge pull request #3942 from dgarske/get_static_ephemeral
Added API's for getting pointer to loaded static ephemeral key
2021-04-23 15:54:46 -07:00
47fe114a02 Merge pull request #3901 from dgarske/bio_read
Fix for BIO read callback not called
2021-04-23 15:51:38 -07:00
bbda833909 Merge pull request #3720 from elms/deos/project_files
DEOS: Add project files for shared library
2021-04-23 15:44:33 -07:00
91e90f7a98 Merge pull request #3604 from haydenroche5/stunnel
Make changes to get latest verison of stunnel (5.57) working with wolfSSL.
2021-04-23 15:41:22 -07:00
c3fefc6e27 Merge pull request #3889 from douzzer/network-introspection
--enable-wolfsentry
2021-04-23 15:38:01 -07:00
0c16ef4b29 Check for TLS downgrade 2021-04-23 14:45:35 -07:00
fa353b1ee0 Fix for ATECC on platforms where bool and int have different sizes. Related to issue #3971 2021-04-23 11:15:36 -07:00
33f9f98569 Deos: fixup readme 2021-04-23 10:15:23 -07:00
2b6f623777 Add implementation for wolfSSL_SESSION_is_resumable. 2021-04-23 11:12:20 +09:00
c442841e4a Fix some along review. 2021-04-23 10:53:22 +09:00
d22ed7443b Fix unit test. 2021-04-23 09:47:24 +09:00
568c09bcde Add guard to the unit test 2021-04-23 09:47:24 +09:00
63826e227b Add wolfSSL_DH_get0_pqg 2021-04-23 09:47:24 +09:00
878e0006ad Merge pull request #3965 from miyazakh/qt_oslext_epk_param_ck
added wofSSL_EVP_PKEY_param_check for compatibility layer API
2021-04-22 15:43:47 -06:00
a83c6c68fe Merge pull request #3940 from miyazakh/qt_v5p15p2_r3
Added compatibility layer API for Qt5.15.2 part2
2021-04-22 15:36:20 -06:00
cb02f46fec Fix Espressif win script 2021-04-22 16:20:34 -05:00
3c0a77485e Improve PSK callback doc 2021-04-22 10:47:46 -05:00
fa98477f22 Renesas RX: Use intrinsics for rot[rl], revl
For byte order reverse and rotation we have builtins
in the CC-RX compiler.
Especially when rotating registers with fixed amounts
this can be compiled efficiently into opcodes with
embedded values for shift (without needing other registers).
2021-04-22 16:44:19 +02:00
14ddfa6894 add fatal error return value for sniffer 2021-04-22 14:28:10 +07:00
9c7ee3fa64 examples/server/server.c: when TEST_IPV6, set the remote address to IPv6 localhost for wolfsentry_route_insert_static(). 2021-04-22 00:20:12 -05:00
1650e8b88a ssl.c: add back missing line continuation backslash. 2021-04-21 17:45:08 -05:00
0cf9bacf1b WOLFSSL_WOLFSENTRY_HOOKS/HAVE_EX_DATA*: refactor wolfSSL_CRYPTO_cleanup_ex_data() to take only one arg (the WOLFSSL_CRYPTO_EX_DATA *); fix preprocessor gates on wolfSSL_set_ex_data() and wolfSSL_X509_get_ex_new_index(); fix line lengths. 2021-04-21 17:34:47 -05:00
40d5aad8fe configure.ac: improve dynamics of --enable-wolfsentry and --with-wolfsentry*, including existence-checking user-supplied paths. 2021-04-21 17:28:27 -05:00
67277d13cd Merge pull request #3937 from elms/intime/dir_pre_intimever6
INTIME: support CRL for INTIME version < 6
2021-04-21 10:42:33 -07:00
0afcd4227b ssl.c/internal.c: refactor _EX_DATA_CLEANUP_HOOKS cleanup in _free() routines to use a common wolfSSL_CRYPTO_cleanup_ex_data() routine; remove superfluous WOLFSSL_API qualifiers in ssl.c. 2021-04-21 12:20:56 -05:00
89d7f4faf3 tests/api.c: add missing void arglists. 2021-04-21 03:22:10 -05:00
660e64cdff examples/server/server.c: clean up wolfsentry printfs. 2021-04-21 03:19:55 -05:00
c874d9259c configure.ac: add --with-wolfsentry option. 2021-04-21 03:19:35 -05:00
23b5447050 Qt v5.15 requires greater than version 1.1.1 2021-04-21 17:01:06 +09:00
cb976db02b server.c: update for wolfSentry API changes. 2021-04-20 23:59:58 -05:00
6175e11156 server.c: update wolfsentry_init() usage (hpi pointer). 2021-04-20 23:59:58 -05:00
23d8df720e remove WOLFSSL_NETWORK_INTROSPECTION code; add wolfSSL_X509_STORE_set_ex_data_with_cleanup(); refactor WOLFSSL_WOLFSENTRY_HOOKS code in server.c to use HAVE_EX_DATA/HAVE_EX_DATA_CLEANUP_HOOKS. 2021-04-20 23:59:58 -05:00
4458ed37c1 fix a couple stray WOLFSSL_NETWORK_INTROSPECTION gates that needed to be WOLFSSL_WOLFSENTRY_HOOKS. 2021-04-20 23:59:58 -05:00
2a05fcb59a examples/server: fix wolfSentry integration to handle DTLS correctly. 2021-04-20 23:59:57 -05:00
1cbe696716 checkpoint: fully functioning demo via examples/server/ and unit.test (which produces a "filtered" error on a subtest when built --enable-wolfsentry). 2021-04-20 23:59:57 -05:00
734860f535 WOLFSSL_NETWORK_INTROSPECTION WIP 2021-04-20 23:59:57 -05:00
ba2cc00e5d initial implementation of WOLFSSL_NETWORK_INTROSPECTION: --enable-network-introspection, struct wolfSSL_network_connection, wolfSSL_*_endpoints*(), NetworkFilterCallback_t, wolfSSL_*set_AcceptFilter(). 2021-04-20 23:59:57 -05:00
38ff193368 Merge pull request #3962 from julek-wolfssl/dtls-allow-future
Change default DTLS future packet behaviour
2021-04-20 17:32:42 -07:00
6e7b43056d Merge pull request #3956 from dgarske/zd12010
Fix in sniffer for possible use of uninitialized variable
2021-04-20 17:29:46 -07:00
9d387b13d0 Merge pull request #3938 from julek-wolfssl/dtls-mtu
Refactor DTLS MTU logic
2021-04-20 17:18:12 -07:00
d3b41a2fed addressed review comments p1 2021-04-21 09:10:32 +09:00
2f5b280d6c fixed jenkins failure part1 2021-04-21 07:53:19 +09:00
e063984d17 added EVP_PKEY_param_check 2021-04-21 07:53:18 +09:00
b37f1ac0c0 addressed review comments part1 2021-04-21 07:39:13 +09:00
bca3cd1d49 fix jenkins failures 2021-04-21 07:39:12 +09:00
89b5b90be6 added compatibility layer API stub for Qt 5.15.2 2021-04-21 07:39:12 +09:00
31bc2e4114 Merge pull request #3967 from embhorn/zd12116
PKCS#11: Add debug for failure in wc_Pkcs11_Initialize
2021-04-21 08:06:14 +10:00
b9c52729d1 Merge pull request #3959 from kaleb-himes/WINCE_settings_update
Update WINCE for wolfEngine and turn off MD5
2021-04-20 10:15:44 -06:00
537d33d5fa Merge pull request #3951 from dgarske/stm32_aes_h7
Fix for AES GCM with STM32H7
2021-04-20 10:14:13 -06:00
f931e67cd7 Merge pull request #3946 from TakayukiMatsuo/tk11899
Add test cases for EVP_CIPHER_CTX_cleanup and BIO_free
2021-04-20 10:10:41 -06:00
c3aee06b23 Merge pull request #3939 from miyazakh/qt_v5p15p2_r1
added and modified compatibility layer APIs for Qt v5.15.2 part1
2021-04-20 10:02:27 -06:00
bd5dc0b21d Merge pull request #3948 from miyazakh/qt_unittest_cert
added favourite drink pilot attribute
2021-04-20 09:50:30 -06:00
1d50962889 Clarify that units of size parameters are in bits 2021-04-20 09:28:17 -05:00
9dd5768ecc Intime: simplify and fix stat on different directory 2021-04-19 22:34:31 -07:00
94eb096e42 Add debug for failure in wc_Pkcs11_Initialize 2021-04-19 17:53:21 -05:00
d08a2b1761 Merge pull request #3966 from SparkiDev/arm-jenkins-2
ARMv8 ASM AES-CBC: Fix parameter validation
2021-04-19 17:06:48 -05:00
d274c80789 ARMv8 ASM AES-CBC: Fix parameter validation 2021-04-19 16:47:34 +10:00
d7b0b97352 Merge pull request #3955 from kaleb-himes/OE18-external-to-module-changes
non-const versions only needed when using inlined ARM assembly in the module.
2021-04-19 09:13:11 +10:00
a26a19b4c8 Deos: rebase fix and add note about importing to readme 2021-04-16 16:35:30 -07:00
6600a531c8 Deos: project relative include paths and ignore fips files by default 2021-04-16 15:39:24 -07:00
3e6f663a38 DEOS: update readme 2021-04-16 15:39:24 -07:00
d6a29b269d DEOS: add files to dist 2021-04-16 15:39:24 -07:00
57f4adf438 DEOS: updated memory and add DTLS
Tested: DDC-I 9.2.0r94156 and OpenArbor on PPC hardware
2021-04-16 15:39:19 -07:00
3da32e75ad Correct commentary based on peer feedback 2021-04-16 15:12:35 -06:00
099f88e45b Revert the change to test.c. 2021-04-16 12:02:04 -07:00
7cfd22304e Fix to improve STM32 AES GCM with partial blocks. Use a local buffer for partial remainder and make sure remainder is zero'd. 2021-04-16 11:58:45 -07:00
2bc2a911d7 Change default DTLS future packet behaviour
This is a better default for most users. Most users who make use of DTLS, allow messages from "too far into the future". It makes sense that DTLS may lose connection for a period of time and will lose all messages from this period. Losing connection effectively stalls the wolfSSL DTLS connection.
2021-04-16 19:27:39 +02:00
70a3857ae8 Fragmentation for ServerKeyExchange and CeriticateVerify
- The `ssl->dtlsMtuSz` value is the maximum possible size of the DTLS record layer. We read `ssl->dtlsMtuSz + 100` in case peer has slightly different MTU set.
- The `-u` option in the examples takes the value of the MTU size.
- MTU tests are added in `tests/test-dtls-mtu.conf`
2021-04-16 17:30:51 +02:00
9553188099 Added type cast to the parm of wolfSSL_BIO_write. 2021-04-16 11:51:58 +09:00
1a4adab52e Changed DumpElement() so that the allocated buffer is freed in the WOLFSSL_SMALL_STACK build case. 2021-04-16 10:05:48 +09:00
5955603c51 Merge pull request #3958 from TakayukiMatsuo/tk11969
Changed the logic for determining the group used for KeyShare in TLSX_PopulateExtensions.
2021-04-16 09:34:54 +10:00
cc0359accb changed callback func name corresponding other cb func name convention 2021-04-16 08:20:12 +09:00
cc4116de24 mingw/msys: fix build error with TFM
Conditional was always true. Rule out using preprocessor.
2021-04-15 15:16:21 -07:00
38637bb276 Merge pull request #3957 from SparkiDev/sp_div_word_fix
SP DIV word C: Add instead of OR
2021-04-15 12:20:56 -07:00
96256a3ec1 Update WINCE for wolfEngine and turn off MD5 2021-04-15 10:27:41 -06:00
64c7830c93 Fix for possible use of invalid *sslFrame and calculated headerSz in partial case with WOLFSSL_SNIFFER_CHAIN_INPUT. 2021-04-15 09:01:11 -07:00
2db06eb3b7 Changed the logic for determining the group used for KeyShare. 2021-04-15 19:30:02 +09:00
bb75c4d610 SP DIV word C: Add instead of OR 2021-04-15 09:22:29 +10:00
d34161e482 Fix in sniffer for possible use of uninitialized length when skipPartial is set. ZD 12010 2021-04-14 15:14:14 -07:00
5a1d171236 fixed unit test failure 2021-04-14 21:25:50 +09:00
03cfc3dc8f addressed review comments part1 2021-04-14 11:15:23 +09:00
88aed28a3f Refactor following peer review 2021-04-13 17:28:43 -06:00
f8e7f9bf03 addressed review comment part1 2021-04-14 07:58:22 +09:00
f245ba0ca1 Merge remote-tracking branch 'upstream/master' into tk11899
# Conflicts:
#	tests/api.c
2021-04-14 06:13:46 +09:00
21faeff478 Merge pull request #3916 from JacobBarthelmeh/PKCS7
fix for streaming with PKCS7
2021-04-13 14:04:06 -06:00
c129f630e2 Merge pull request #3933 from miyazakh/rand_bytes_regression
fix retrun code regression on RAND_bytes
2021-04-13 13:55:04 -06:00
71e2f191a6 Merge pull request #3947 from dgarske/nxp_ltc
Fixes for NXP LTC
2021-04-13 13:49:22 -06:00
87a2cdea31 const poisoning - gcc 4.x prefers consistency in prototypes and implementations 2021-04-13 13:29:40 -06:00
4cd3f2e826 Make changes to get latest verison of stunnel (5.57) working with wolfSSL. 2021-04-13 09:18:25 -05:00
295418fa3e Merge pull request #3954 from ejohnstown/m1
M1 Update
2021-04-13 12:08:11 +08:00
54e111aa85 Update copy/paste error in comment. 2021-04-12 17:02:35 -07:00
89e4bae8d2 Fix for STM32 AES GCM decrypt to support partial (not multiple of 4) for auth tag calculation. 2021-04-12 16:57:57 -07:00
2739759072 Merge pull request #3953 from JacobBarthelmeh/build-tests
add option to use an engine with openssl test script
2021-04-12 13:22:52 -06:00
c6077b6767 Refactor DTLS MTU logic
- wolfSSL_GetMaxRecordSize will now take additional cipher data into account
- The set MTU size is understood as the maximum size of a DTLS record. The WOLFSSL_MAX_MTU was adjusted to account for UDP/IP headers.
2021-04-12 21:01:15 +02:00
74df158c5c Update the check for 64-bit on the M1 to filter out other ARM processors. 2021-04-12 11:18:52 -07:00
021c22c038 Merge pull request #3950 from embhorn/zd11850
Fix build error with NO_PKCS12
2021-04-12 10:46:45 -07:00
0f1a702f58 Merge pull request #3949 from JacobBarthelmeh/StaticAnalysisTests
remove dead code, variable gn will currently always be null
2021-04-12 10:26:02 -07:00
501de37cad fixed memory leak in unit test 2021-04-12 18:34:07 +09:00
ad6f8e4246 added and modified compatibility layer APIs for Qt v5.15.2 part1 2021-04-12 18:34:07 +09:00
4a7434a56d add missing ret checks 2021-04-12 16:33:14 +08:00
160faa851c add deterministic k generation for ECC sign 2021-04-12 16:33:14 +08:00
d44549fd77 only update OPENSSL_ENGINE_ID if already set 2021-04-12 01:47:01 -06:00
7345b2418b Merge pull request #3944 from guidovranken/zd12039
Account for sp_sqr failure in _sp_exptmod_nct
2021-04-12 11:03:38 +10:00
0197e133b1 Merge pull request #3929 from hicksjacobp/tls13-cbclientcert
fix: call CBClientCert for TLS 1.3 certificate requests
2021-04-12 09:25:22 +10:00
ee22d27cf8 add sanity check that engine can be loaded 2021-04-11 20:48:18 +07:00
c34025b186 add option to use an engine with openssl test script 2021-04-11 20:06:13 +07:00
8538869d33 Added runtime checking for LTC big integer buffer sizes. 2021-04-09 15:51:57 -07:00
070dfad07a Fix for NXP LTC ECC public key computation broken in PR #2859 for contstant time changes. 2021-04-09 15:51:30 -07:00
04cc48b810 Merge pull request #3935 from miyazakh/x509_store_ex_data
add X509_STORE_get/set_ex_data
2021-04-08 21:51:03 -05:00
a4ebeac932 fix minor typo in function return comment 2021-04-08 16:37:16 -06:00
18eca4deff INTIME: fix check returns Find{First,Next,Close} for version <6 2021-04-08 10:23:26 -07:00
beff4daf7e Refactor wolfSSL_BIO_BASE64_write to simplify its logic 2021-04-08 19:11:55 +02:00
07022eebe7 Add a OPENSSL_EXTRA guard to call SSL_get_early_data_status 2021-04-09 01:10:45 +09:00
f298bb9f22 Peer review feedback. 2021-04-08 08:06:45 -07:00
424d97ca3d Merge remote-tracking branch 'upstream/master' into tk11899
# Conflicts:
#	src/ssl.c
2021-04-08 23:59:51 +09:00
bc7191ca4c Added test cases for NULL-parameter 2021-04-08 23:11:00 +09:00
d8dd69cf44 Using --enable-chacha=noasm wouldn't actually enable chacha 2021-04-08 12:46:05 +02:00
3b9e7942ea Merge pull request #3908 from embhorn/zd11866
Sanity check size in TLSX_Parse
2021-04-07 16:34:56 -07:00
b3177ffc17 Merge pull request #3945 from dgarske/ecc_nomalloc
Improve ECC with `WOLFSSL_NO_MALLOC`
2021-04-07 16:29:13 -07:00
418e5b46d6 Merge pull request #3934 from SparkiDev/armv8-asm-sha256-fix
ARMv8 SHA-256: recalc data in SHA256 update
2021-04-07 16:22:27 -07:00
86fe77d776 Merge pull request #3924 from dgarske/sp_math_all
Sp math all fixes
2021-04-07 16:21:58 -07:00
de8653be35 Merge pull request #3941 from JacobBarthelmeh/Compatibility-Layer
add implementation of EC_KEY_set_group
2021-04-07 16:20:50 -07:00
9e9506c260 Merge pull request #3919 from JacobBarthelmeh/StaticAnalysisTests_2
Static analysis tests 2
2021-04-07 16:18:37 -07:00
acf1a9833b Fix for AES GCM with STM32H7 to use crypto hardware in all cases except IV size != 12. 2021-04-07 15:51:50 -07:00
ef69a9b458 Fix build error with NO_PKCS12 2021-04-07 15:36:35 -05:00
4747ba9ccb Fix for BIO base64 write valgrind issue. 2021-04-07 12:23:26 -07:00
f16136c29b remove dead code, variable gn will currently always be null 2021-04-07 20:56:50 +07:00
8e6710e030 added favourite drink pilot attribute
fix OCSP authority access info
2021-04-07 18:44:32 +09:00
7da85c6f3f Merge remote-tracking branch 'upstream/master' into tk11899 2021-04-07 12:01:39 +09:00
786bbabbdc Improve ECC with WOLFSSL_NO_MALLOC
Tested with `./configure --enable-cryptonly --disable-examples --disable-rsa --disable-dh CFLAGS="-DWOLFSSL_NO_MALLOC -DBENCH_EMBEDDED" && make check`.
All ECC operations can work now with WOLFSSL_NO_MALLOC and variables will be on stack.
ZD 11829
2021-04-06 15:31:40 -07:00
779dabc04e Cleanups to KSDK port for LTC. 2021-04-06 13:50:33 -07:00
f4e1d96cfc Fixes for building K82. Fixes for warning with const mp_int* k changes. 2021-04-06 11:38:05 -07:00
4eb8265c46 add ecc guard on test case 2021-04-06 20:01:15 +07:00
0a05acff09 Add test cases for EVP_CIPHER_CTX_cleanup and BIO_free 2021-04-06 14:21:53 +09:00
52e6ff7c56 Account for sp_sqr failure in _sp_exptmod_nct
ZD 12039
2021-04-06 01:34:09 +02:00
5ebe5d071f Fixes for wolfSSL_BIO_BASE64_write changes. 2021-04-05 14:35:47 -07:00
1a9d59c185 front may be unused and generate a warning 2021-04-05 14:35:47 -07:00
d257cf5003 Return error when using not compiled in BIO
Refactor base64 BIO write into static function
2021-04-05 14:35:47 -07:00
5b751d9eaa Fix for possible unused label "exit_chain". 2021-04-05 14:35:47 -07:00
8984ce03e9 Refactor BIO read/write to use switch. 2021-04-05 14:35:47 -07:00
072e6e010c Handle the BIO want read in BioReceive. 2021-04-05 14:35:47 -07:00
5c762afb94 Fix for BIO with callbacks not called after PR #3824 (was always returning WANT_READ). 2021-04-05 14:35:47 -07:00
e13c93d493 Added API's for getting pointer to load static ephemeral key. 2021-04-05 13:40:48 -07:00
6b46669641 Merge pull request #3917 from embhorn/zd11959
Sanity check sockfd max value
2021-04-05 11:50:13 -07:00
7935b7c485 Merge pull request #3920 from SparkiDev/sp_int_ullong
SP int: Handle ULLONG_MAX not being defined
2021-04-05 11:48:38 -07:00
53d97d1961 Fix for DSA only case and missing sp_read_radix 2021-04-05 11:43:21 -07:00
24d8e1b104 SP math all edge cases without RSA. 2021-04-05 11:31:55 -07:00
eb37953061 Fix for WOLFSSL_SP_MATH_ALL typo. Plus a few other minor ones. 2021-04-05 11:31:55 -07:00
63c96c3585 add implementation of EC_KEY_set_group 2021-04-05 22:22:31 +07:00
9a86f133c8 additional fixes for reports with test cases 2021-04-05 21:26:52 +07:00
71fea2bdd1 initialize hash size variable to 0 in the case that getting the digest size returns 0 2021-04-05 21:26:52 +07:00
4e8769ba6b initialize variable 2021-04-05 21:26:52 +07:00
39f34ef88b check return values 2021-04-05 21:26:52 +07:00
1c3ba77bee remove dead code path 2021-04-05 21:26:52 +07:00
fdb3221ea7 check variable is not null before use in error case 2021-04-05 21:26:52 +07:00
b4c0301f57 add sanity check on serial size 2021-04-05 21:26:52 +07:00
9ea60db80a add free of bio in error case 2021-04-05 21:26:22 +07:00
4ead19e21f check return value of hash digest size 2021-04-05 21:26:22 +07:00
75abeebaf7 free memory in test case 2021-04-05 21:26:22 +07:00
97b83a2550 free PKCS7 structure on error case 2021-04-05 21:26:22 +07:00
141d1cb5af fix for potential leak on fail case 2021-04-05 21:26:22 +07:00
379e1fb630 INTIME: support CRL for INTIME version < 6 2021-04-01 11:15:23 -07:00
c5b6d20483 Add more DSA parameters support
- Implement wc_DsaParamsDecode and wc_DsaKeyToParamsDer
- Don't include NIDs without OpenSSL builds
2021-04-01 19:47:09 +02:00
ea0f4580de add X509_STORE_get/set_ex_data 2021-04-01 17:06:02 +09:00
e3c86f8f77 ARMv8 SHA-256: recalc data in SHA256 update 2021-04-01 17:01:21 +10:00
fd94d05b0a Merge pull request #3932 from guidovranken/zd12012
MP integer.c: Use unsigned integers in mp_is_bit_set
2021-04-01 15:41:01 +10:00
b8684f3f7e fix retrun code regression on RAND_bytes
fix jenkins fail
2021-04-01 13:35:50 +09:00
2ecaa3c4c6 Use unsigned integers in mp_is_bit_set
ZD 12012
2021-04-01 00:57:06 +02:00
95b91d8913 Merge pull request #3886 from DKubasekRA/fix/RA/v4.7.0-coverity
RA - Fixes for Coverity issues
2021-03-31 10:41:54 -07:00
49b29bec32 Merge pull request #3930 from JacobBarthelmeh/Testing
add link to wolfssl-examples repository in README
2021-03-31 10:10:44 -07:00
38cec4b0d4 Merge pull request #3922 from dgarske/have_secret
Expose functions to get client/server random for have secret callback
2021-03-30 16:03:57 -07:00
f7046ca12a Merge pull request #3906 from douzzer/AES-BAD_ALIGN_E-consistency
Adds optional AES CBC length checking
2021-03-30 16:01:29 -07:00
4d1ad6acd6 Merge pull request #3885 from JacobBarthelmeh/StaticAnalysisTests
Static analysis fixes for items listed as high priority
2021-03-30 16:00:03 -07:00
4044b30363 Merge pull request #3915 from TakayukiMatsuo/os_ecdh
Add unit tests for OpenSSL compat APIs
2021-03-30 16:18:16 -06:00
dfb7848320 add link to wolfssl-examples repository in README 2021-03-31 01:34:14 +07:00
0ea9163253 fix: call CBClientCert for TLS 1.3 certificate requests 2021-03-30 07:25:05 -05:00
56b1406a30 Fix to call wc_FreeDhKey only after wc_InitDhKey succeeds. 2021-03-30 00:18:40 +09:00
c3fcb2e95f Merge pull request #3923 from dgarske/armv8
ARMv8: do not compile code if module is disabled
2021-03-29 08:50:41 +10:00
4911977946 rename I2C address var per cryptoauthlib 3.3.0 2021-03-28 00:11:11 +05:30
ccc50714d0 Fix TNGTLS certificate size issue
TNGTLS devices has shown variations in the device and signer certificate sizes causing failure.
This fix makes the size query dynamic.
2021-03-28 00:02:17 +05:30
a9ff314840 Merge pull request #3912 from miyazakh/rsa_bits_
Added RSA_bits
2021-03-26 17:00:56 -06:00
b67f270e3d Merge pull request #3910 from miyazakh/openssl_ext_unit_test
Update compatibility layer api unit test
2021-03-26 16:58:21 -06:00
a22defec50 Fix for availability of wolfSSL_SESSION_print. 2021-03-26 15:39:55 -07:00
95ff75c43d Fix for wolfSSL_SESSION_print 2021-03-26 13:41:11 -07:00
724a415d51 Fix ARMv8 to not compile code if module is disabled 2021-03-26 13:28:15 -07:00
f65e1f1f09 Expose functions to get client/server random when HAVE_SECRET_CALLBACK is defined. 2021-03-26 13:23:00 -07:00
5f6b618e71 configure.ac: add --enable-aescbc-length-checks and add it to --enable-all; api.c: fix expected error code in WOLFSSL_AES_CBC_LENGTH_CHECKS path of test_wc_AesCbcEncryptDecrypt(); aes.c: add explanatory comment on WOLFSSL_AES_CBC_LENGTH_CHECKS to top of file. 2021-03-26 14:04:25 -05:00
5d9ee97530 WOLFSSL_AES_CBC_LENGTH_CHECKS: add gated logic to aes.c wc_AesCbc{En,De}crypt() to return BAD_LENGTH_E when input length is not a multiple of AES_BLOCK_SIZE; add gated tests of new functionality in test_wc_AesCbcEncryptDecrypt(); fix first encrypt-decrypt-memcmp in test_wc_AesCbcEncryptDecrypt() to span all of test vector and extend test vector length to be block-multiple; add ungated logic in platform-specific wc_AesCbc{En,De}crypt() routines to return with early success when blocks == 0 (also mitigates buffer overrun on short (less-than-AES_BLOCK_SIZE) input); add BAD_LENGTH_E error code; update documentation. 2021-03-26 13:40:08 -05:00
f201d65459 Merge pull request #3898 from elms/intime_rtos/crl_directory_fix
INTIME: add support for directory file search
2021-03-26 09:37:21 -07:00
79fa71d600 Merge pull request #3882 from TakayukiMatsuo/tk11899
Return code differences in wolfSSL_EVP_PKEY_cmp et al.
2021-03-26 09:36:52 -07:00
212be50a23 Merge pull request #3899 from SparkiDev/shake256_improve
SHA-3: Improve SHAKE256 change to support longer output
2021-03-26 09:35:52 -07:00
bb7dce8b46 Merge pull request #3921 from SparkiDev/sp_modinv_win
SP MSVC: movslq -> movsxd
2021-03-26 09:34:15 -07:00
f7477b932d Add return value checks and fixed typos. 2021-03-26 17:06:14 +09:00
5456765dca Changed API names to call in unit tests. 2021-03-26 17:05:25 +09:00
1b832bf8fa SHA-3: Improve SHAKE256 change to support longer output
Added tests for 1 complete block output and longer from NIST's CAVP
tests vectors.
2021-03-26 14:59:12 +10:00
a188ef251c SP MSVC: movslq -> movsl 2021-03-26 14:12:58 +10:00
4460180214 Fix implicit conv error. 2021-03-26 08:18:16 +09:00
08be489bf5 SP int: Handle ULLONG_MAX not being defined 2021-03-26 09:03:39 +10:00
0d995527aa Merge pull request #3918 from dgarske/fix_ecc_mulmod_fast
Fix for SP ecc_mulmod_fast
2021-03-26 08:39:48 +10:00
5887c2f2e2 Fix fall through. 2021-03-26 04:45:10 +09:00
23bd46bac6 Sanity check sockfd 2021-03-25 14:40:38 -05:00
79837eeb8e Changed the function name to be called in the unit test to the OpeSSL function name. 2021-03-26 04:30:36 +09:00
11189fe386 Sanity check size in TLSX_Parse 2021-03-25 14:16:22 -05:00
da9131d30d Added return value checks and removed ToDec() 2021-03-26 04:14:14 +09:00
dd6db22bc6 Changed the function name to be called in the unit test to the OpenSSL function name. 2021-03-26 04:08:02 +09:00
4eb4cecff4 INTIME: whitespace fixup and zero context in wc_ReadDirFirst 2021-03-25 10:54:05 -07:00
c9b5806575 Fix for ecc_mulmod_fast broken in PR #3868. The "t" needs 1 extra point for "rt". 2021-03-25 09:19:17 -07:00
06966a203b Merge pull request #3914 from SparkiDev/sp_c_sub_fixes
SP C 32/64: fix corner cases around subtraction
2021-03-25 08:11:06 -07:00
6c7b3d806a Fixed modifying a const value. 2021-03-25 15:36:30 +01:00
fd7131197f Updated fix of CID 587269. 2021-03-25 13:28:47 +01:00
a472d2af4a fix for streaming with PKCS7 2021-03-25 18:54:09 +07:00
67d4611fda Review fixes. 2021-03-25 11:26:34 +01:00
8dcaa8c4b6 Merge remote-tracking branch 'upstream/master' into os_ecdh
# Conflicts:
#	tests/api.c
2021-03-25 19:17:22 +09:00
952a9b3497 Add unit tests for CONT_modules_xxx, CRYPTO_set_dynlock_xxx, CRYPTO_THREADID_xxx and ENGINE_cleanup. 2021-03-25 19:02:13 +09:00
d8a81d0c0f SP C 32/64: fix corner cases around subtraction
Affected RSA PSS
2021-03-25 16:19:54 +10:00
c9be50c3a0 added RSA_bits 2021-03-25 13:31:47 +09:00
03bad1c056 Added logic to wait for TCP disconnect so that SSL_read behaves the same as OpenSSL after a bidirectional shutdown. 2021-03-25 12:54:05 +09:00
8bee2af550 Merge pull request #3904 from julek-wolfssl/dtls-chacha-poly-fix
Chacha-Poly AEAD fix for SCR
2021-03-24 18:53:46 -07:00
64555cdd11 Merge pull request #3907 from JacobBarthelmeh/CAAM 2021-03-24 18:47:47 -07:00
662d04ce74 Merge pull request #3879 from julek-wolfssl/dtls-timeout
Let user inspect error in wolfSSL_dtls_got_timeout
2021-03-24 18:31:05 -07:00
f2f2976e96 Merge pull request #3837 from haydenroche5/zd11808
Fix for ZD 11808.
2021-03-24 18:24:04 -07:00
08ea90ad94 Merge pull request #3905 from dgarske/sp_nb_sync
SP ECC: Fix for non-blocking test and synchronization of changes
2021-03-25 10:35:30 +10:00
f7652d18a0 use compatibility layer API when they are enabled 2021-03-25 08:09:06 +09:00
e074513d38 fix for memory management with mmap function calls 2021-03-25 01:32:37 +07:00
183917f102 change debug message type from review 2021-03-25 01:16:20 +07:00
7f64950da4 Fixed fix of CID 576329. 2021-03-24 17:23:49 +01:00
bf1482a2d7 Fixed another CID 529732. 2021-03-24 17:05:02 +01:00
13d81f1fb9 Merge pull request #3902 from dgarske/snicb
Fix for SNI recv callback
2021-03-24 15:34:35 +07:00
a6851a44af Fix for ECC non-blocking test R/S values not zero padded causing occasstional wolfCrypt test failures with ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS="-DWOLFSSL_PUBLIC_MP". 2021-03-23 17:32:36 -07:00
a6e9e71fde Synchronization of SP ECC non-blocking code. Adds WOLFSSL_ECDSA_SET_K_ONE_LOOP support to SP ECC non-block. Removes double code in verify steps. Fixes verify result logic. Spelling error. 2021-03-23 17:30:56 -07:00
14ef517b61 Merge pull request #3884 from SparkiDev/tfm_read_bin
TFM read_unsigned_bin: endian may not be defined
2021-03-23 14:47:18 -07:00
d539dc59be Merge pull request #3903 from SparkiDev/sha2_arm
ARMv8 SHA256, SHA512: Add wc_Sha256Transform, wc_Sha512Transform
2021-03-23 14:46:45 -07:00
1643bec05f Merge pull request #3862 from kaleb-himes/WIN32_WCE_PORTING
_WIN32_WCE port of wolfCrypt - OE12
2021-03-23 14:40:48 -07:00
6134de6a22 Merge pull request #3855 from miyazakh/openssl_ext_r2
Compatibility layer API addition
2021-03-23 14:37:47 -07:00
ee79e1082a Updated fix of 58787. 2021-03-23 13:19:32 +01:00
3abcdf059a Chacha-Poly AEAD fix for SCR
Wrong cipher material was being used when using Chacha-Poly AEAD for DTLS 1.2 with secure renegotiation
2021-03-23 10:38:48 +01:00
089ebf277f ARMv8 SHA256, SHA512: Add wc_Sha256Transform, wc_Sha512Transform 2021-03-23 12:53:06 +10:00
9313d59479 Fix for SNI callback
* Fix for SNI callback on server to make sure the SNI data is stored even without setting a hostname. This makes sure the SNI extension is set when there is a registered SNI recv callback.
* Fix for Apache HTTPD to include `WOLFSSL_ALWAYS_KEEP_SNI`
2021-03-22 11:28:16 -07:00
b3eb2e3ddd Implement peer review feedback
Fix items that were missed from peer review

Remove dead code

Add ret capture of return from XVSNPRINTF
2021-03-22 11:55:16 -06:00
3accd4dd86 Merge pull request #3900 from JacobBarthelmeh/CAAM
account for leading 0's with r and s during ECC verify
2021-03-22 09:08:44 -07:00
b7ac12edb6 account for leading 0's with r and s during ECC verify 2021-03-22 18:16:21 +07:00
2e25c53111 Revert "Fixed CID 583215."
This reverts commit 26578be1a7.
2021-03-22 09:50:20 +01:00
a8abeeb50e Fixed CID 58787. 2021-03-22 09:47:52 +01:00
24b67599c8 Merge pull request #3896 from strongX509/wolfssl-shake256
Full implementation of SHAKE256
2021-03-22 09:57:05 +10:00
53c54ab475 Added bounds checks. 2021-03-21 12:30:45 +09:00
a86a638698 Fix for PRB tests. 2021-03-21 08:19:02 +09:00
6bf14dfa56 Added bounds checks, smallstack pattern. 2021-03-21 07:37:02 +09:00
a1ff026670 Revert the change of wolfSSL_EVP_CHIPER_CTX_cleanup. 2021-03-21 00:14:57 +09:00
c3e6195da5 INTIME: add support for directory file search
Directory support allows CRL use with undefining `NO_WOLFSSL_DIR`

Also increase stack size to avoid page fault and add
`_USE_64BIT_TIME_T` to example project to pass ASN test
2021-03-20 00:53:02 -07:00
526688a1a5 adressed review comments part 5-1 2021-03-20 14:57:26 +09:00
fae36f108e adressed review comments part 5 2021-03-20 12:29:42 +09:00
14b7d70ae4 Merge pull request #3846 from kabuobeid/builtinEngsRandMethod
Add wolfSSL_RAND_set_rand_method() and document ENGINE_load_builtin_engines()
2021-03-19 14:23:03 -07:00
a0a1406a43 Merge pull request #3894 from SparkiDev/eccsi_sakke_g++
ECCSI/SAKKE: fix for g++
2021-03-19 14:03:06 -07:00
fc2dff0af6 Merge pull request #3895 from SparkiDev/no_dhe_psk_fix
TLS 1.3 PSK no DHE: When not doing PSK don't allow noPskDheKe to be set
2021-03-19 14:02:43 -07:00
19c321f165 Merge pull request #3891 from JacobBarthelmeh/PKCS7
adjust size when streaming with PKCS7 verify
2021-03-19 11:53:38 -06:00
761bebc4a0 Merge pull request #3893 from SparkiDev/sp_dyn_stack
SP dyanmic stack: WOLFSSL_SP_NO_DYN_STACK disable use
2021-03-19 10:53:02 -07:00
f49e8669cd Merge pull request #3892 from dgarske/stm32g0
Adds support for STM32G0
2021-03-19 11:31:17 -06:00
6e383cf6cd Full implementation of SHAKE256
The current SHAKE256 implementation squeezes output bytes only up
to the rate limit of 136 bytes. This has been fixed to support
the output of an unlimited amount of bytes complying with the
NIST FIPS 202 standard.
2021-03-19 11:13:54 +01:00
4136dcb098 Add modifications to fix following issues:
- bounds checks
- sanity checks
- smallstack pattern
- coding standard
- typos
2021-03-19 14:58:56 +09:00
491f3bc423 Add two public key files in certs folder and register them to gencertbuf.pl 2021-03-19 14:52:58 +09:00
62304411dd Remove wc_EccPublicKeyDecode_ex 2021-03-19 14:48:46 +09:00
1c81afcc0a Add wc_FreeDhKey in wolfSSL_d2i_PUBKEY 2021-03-19 14:23:40 +09:00
364e35575c Add following modifications to unit-test:
- Modify reference data in test_wolfSSL_EVP_PKEY_print_public
- Remove test_wc_EccPublicKeyDecode_ex
- Rewrite test_wc_DhPublicKeyDecode to have Assert
2021-03-19 14:17:26 +09:00
300cbf7a5b fixed NO_WOLFSSL_DIR configuration case 2021-03-19 13:13:03 +09:00
ffa6a80725 addressed review comments part 4 2021-03-19 13:13:02 +09:00
7b81ff1bc6 fixed api testing for hash dir 2021-03-19 13:13:01 +09:00
c5327866a4 addressed review comments part 3 2021-03-19 13:13:01 +09:00
84368eed3f addressed review comment part 2 moving BY_DIR_xxx functions to internal 2021-03-19 13:13:00 +09:00
4650aaf4fb addressed review comments part 1 2021-03-19 13:13:00 +09:00
f9c9de5855 free Mutex 2021-03-19 13:12:59 +09:00
2d79578eda addressed jenkins failure
fix missing mutex initialization
2021-03-19 13:12:59 +09:00
a13784abe1 fixed jenkins failure 2021-03-19 13:12:58 +09:00
cb0f082e39 simplified wc_EncodeName* 2021-03-19 13:12:57 +09:00
e73b06e797 add comments and description to new function and API 2021-03-19 13:12:57 +09:00
39b0c4eaf8 fixed sanitize errors 2021-03-19 13:12:56 +09:00
b4a573ca98 Initial implemented X509_LOOKUP_ctrl L_ADD_DIR 2021-03-19 13:12:55 +09:00
ce485d99b3 implemented L_FILE_LOAD case 2021-03-19 13:12:54 +09:00
e7472384c2 TLS 1.3 PSK no DHE: When not doing PSK don't allow noPskDheKe to be set 2021-03-19 12:11:30 +10:00
7cacfc53e6 ECCSI/SAKKE: fix for g++
Cast XMALLOC return.
2021-03-19 10:49:34 +10:00
f6840ca907 SP dyanmic stack: WOLFSSL_SP_NO_DYN_STACK disable use
For small code and not small stack, arrays are being defined with a size
dependent on the input parameters, where compiler supports it.
Disable this with: WOLFSSL_SP_NO_DYN_STACK
2021-03-19 09:56:56 +10:00
a688245738 Merge pull request #3868 from dgarske/sp_nomalloc
Fixes for SP RSA/DH with `WOLFSSL_SP_NO_MALLOC`
2021-03-19 09:41:30 +10:00
14e79a165a Merge pull request #3880 from embhorn/cov_fixes
Fix resource leak
2021-03-18 15:18:38 -07:00
a363077b1e Merge pull request #3841 from SparkiDev/aes_gcm_stream
AES GCM: implement streaming
2021-03-18 14:36:55 -07:00
6bf3c08634 Fixes for SP RSA/DH with WOLFSSL_SP_NO_MALLOC. Cleanup of the SP no malloc code for ECC, RSA and DH. 2021-03-18 14:00:51 -07:00
a27a61c937 Adds support for STM32G0. 2021-03-18 11:25:48 -07:00
a85e348c0e Change void return from RAND_seed back to int. 2021-03-18 11:20:56 -07:00
5aa23424a4 wolfSSL_RAND_set_rand_method: Cleanup 2021-03-18 10:27:31 -07:00
de50209cdf adjust size when streaming with PKCS7 verify 2021-03-18 22:52:36 +07:00
e7ad9b423f Merge pull request #3881 from embhorn/zd11906
Fix der struct mem leak in AddTrustedPeer
2021-03-18 07:40:27 -07:00
89a461595f Merge pull request #3890 from douzzer/fix-linuxkm-tls13-typo
src/tls13.c: fix typo introduced in commit 697d34c80d.
2021-03-18 07:36:58 -07:00
360c961b48 fix for unused variable in dh.c from Jenkins test 2021-03-18 20:34:38 +07:00
a64bb8aef7 fix unused variable in test case from Jenkins test 2021-03-18 15:17:08 +07:00
717c0089c0 src/tls13.c: fix typo introduced in commit 697d34c80d. 2021-03-18 00:04:53 -05:00
832c99597c wolfSSL_RAND_set_rand_method: Code review feedback 2021-03-17 17:02:20 -07:00
7760dcb43b Fixes and cleanups for the openssl compatibility layer RAND_ functions. For opensslextra=x509small don't include the RAND method code. Removed abandonded "ENABLED_SMALL" option in configure.ac. 2021-03-17 15:51:52 -07:00
1477af9a22 Add wolfSSL_RAND_set_rand_method() and support for RAND_ callbacks. 2021-03-17 14:29:24 -07:00
a3be049e0e Merge pull request #3883 from SparkiDev/sp_asm_config
SP config: allow asm to be an SP options (--enable-sp=asm,yes)
2021-03-17 12:53:14 -07:00
12b290cbaf remove duplicate (deadcode) for clearing mp_int's 2021-03-17 17:34:54 +07:00
6ef905c9e3 use err goto for error out 2021-03-17 17:06:03 +07:00
2732ba2bba check return value is not negative 2021-03-17 16:50:53 +07:00
1ca3604212 add check on init mutex return value 2021-03-17 16:42:16 +07:00
da56c33f48 add debug message on BIO write return value when printing out error nodes 2021-03-17 16:33:37 +07:00
d439694eb6 sanity check on length in wolfSSL_BN_rand 2021-03-17 13:41:27 +07:00
6995f6dedc help out static analyizer and memset buffer created 2021-03-17 12:34:12 +07:00
48d13bbfa5 fix for leak with wolfSSL_a2i_ASN1_INTEGER 2021-03-17 12:24:18 +07:00
2dafb3ed96 TFM read_unsigned_bin: endian may not be defined 2021-03-17 12:10:06 +10:00
38d268dbbb fixup 2021-03-17 11:31:03 +10:00
7f1e63e7f5 SP config: allow asm to be an SP options (--enable-sp=asm.yes) 2021-03-17 11:24:55 +10:00
3bd7127188 Wrap some long lines. 2021-03-17 06:58:51 +09:00
cba348dbf1 Merge pull request #3853 from SparkiDev/sp_add_d
SP int neg add_d/sub_d: handle small values properly
2021-03-16 14:16:01 -07:00
07807526c6 Change the following functions to behave the same as opeSSL:
- EVP_CIPHER_CTX_cleanup
- BIO_free
- EVP_PKEY_cmp
2021-03-17 05:47:45 +09:00
3f8444e7ea Fix der struct mem leak in AddTrustedPeer 2021-03-16 11:57:49 -05:00
e668b9b5d6 Merge pull request #3876 from kabuobeid/sslSuitesNullCheck
Fix missing NULL check in FreeSuites().  Fixes #3873.
2021-03-16 09:02:10 -07:00
df2e0905e0 Merge pull request #3874 from dgarske/cryptocb_devctx
Fixes for for crypto callbacks (SHA1, HMAC and CMAC)
2021-03-16 21:26:50 +07:00
9f6d1fe964 Merge branch 'master' of github.com:wolfSSL/wolfssl into os_keyprint 2021-03-16 15:55:51 +09:00
35659be06f AES GCM: implement streaming
Updated EVP layer to use streaming API when enabled.
Assembly for x64 updated to include streaming.
2021-03-16 16:39:49 +10:00
f3900be6dc Merge pull request #3877 from SparkiDev/sakke_eccsi_fixup 2021-03-15 20:18:09 -07:00
9fd8fde714 Add fixes along the review commnents. 2021-03-16 11:55:18 +09:00
9caf366a25 SP x86_64 asm: put back in lost fixes
Corner case for P-256.
ModInv P-256 AVX2 fix carry and use movslq for clang.
Get entry P-384 non-AVX2 don't assume table data is aligned.
2021-03-16 11:08:34 +10:00
6fc0440904 SP int neg add_d/sub_d: handle small values properly 2021-03-16 10:22:48 +10:00
5c82ef9420 Merge pull request #3858 from julek-wolfssl/x509-set-pub-key
wolfSSL_X509_set_pubkey fix
2021-03-15 17:19:30 -07:00
5c4c101ac5 Merge pull request #3863 from JacobBarthelmeh/Testing
fix for wolfSSL_ASN1_TIME_adj set length
2021-03-15 17:17:33 -07:00
1b8c0c73a9 Merge pull request #3851 from SparkiDev/sp_read_bin_align
SP int: read_unsigned_bin and BIG_ENDIAN
2021-03-15 17:12:23 -07:00
3ac03d3d66 Merge pull request #3805 from JacobBarthelmeh/copyright
update copyright date to 2021
2021-03-15 16:16:50 -07:00
5fd0950a3a Merge pull request #3654 from SparkiDev/sakke_eccsi
ECCSI and SAKKE: add support
2021-03-15 16:15:59 -07:00
46b3beeccd Fix missing NULL check in FreeSuites(), with OPENSSL_ALL enabled, this was causing a segfault in when freeing a WOLFSSL object created with wolfSSL_write_dup(). 2021-03-15 16:15:21 -07:00
0fa39a04dc Let user inspect error in wolfSSL_dtls_got_timeout 2021-03-15 19:00:11 +01:00
2e247cc176 Merge pull request #3870 from JacobBarthelmeh/Benchmark
fix for using devId with benchmarking ECC
2021-03-15 10:09:23 -07:00
d4d30a0078 Merge pull request #3875 from SparkiDev/sp_get_entry
SP x86_64 non-AVX2: Fix get_entry to no load table aligned
2021-03-15 10:00:27 -07:00
0f605b2aab SP x86_64 non-AVX2: Fix get_entry to no load table aligned 2021-03-15 18:05:10 +10:00
e2aee302ef Merge pull request #3867 from douzzer/autoconf-2.71-gcc-10.2-updates 2021-03-12 16:19:28 -08:00
7a020e4bb6 Fix for FIPS and CMAC init. 2021-03-12 14:23:34 -08:00
36f80d53aa Fix resource leak 2021-03-12 14:57:45 -06:00
92854a5ddc configure.ac: advance AC_PREREQ from 2.63 (2008) to 2.69 (2012) to reflect current automated testing coverage, and to avoid intractable best-practice conflicts between 2.63 and 2.70 (2020); advance AM_INIT_AUTOMAKE from 1.11 (2009) to 1.14.1 (2013) to reflect current automated testing coverage; advance LT_PREREQ from 2.2 (2008) to 2.4.2 (2011) to reflect current automated testing coverage. 2021-03-12 13:49:29 -06:00
697d34c80d Fix for for crypto callback devCtx on symmetric algorithms (missing for SHA1 and CMAC). Fix for HMAC to use devId for hashing. Fixes for CMAC crypto callbacks and testing. 2021-03-12 11:49:25 -08:00
62ec4ef3b9 Policy Constraints Extension
Read the policy constraints extension from a certificate. Save the skip value but don't do anything with it at this time.
2021-03-12 10:23:23 -08:00
c5c80b67d2 wolfSSL_X509_set_pubkey fix
wolfSSL_X509_set_pubkey should always regenerate the key to make sure that it does not contain the private key
2021-03-12 18:13:15 +01:00
e9b39c3091 fix for using devId with benchmarking ECC 2021-03-12 21:14:20 +07:00
fa8934c5fc Merge pull request #3861 from haydenroche5/cmake_session_ticket 2021-03-11 21:05:31 -08:00
5369c133ad add macro guard around test 2021-03-12 11:44:09 +07:00
a20b7fae32 ECCSI/SAKKE: add loop count to generation functions 2021-03-12 13:57:53 +10:00
a55e94cf6f ECCSI and SAKKE: add support
Fixes for static code analysis included.
Added const to function parameters.
Zeroise some temporaries.
2021-03-12 09:31:22 +10:00
771a7418ea fixes for compat with autoconf 2.70 and gcc-10: update m4/ax_pthread.m4 and m4/ax_tls.m4 from upstream, fix declaration syntax in tests/api.c, add AC_CANONICAL_TARGET in configure.ac, and fix two spots with bad quoting syntax in configure.ac and m4/ax_linuxkm.m4. also fix myriad whitespace flubs in api.c. 2021-03-11 17:29:12 -06:00
c091b968a3 Merge pull request #3864 from cconlon/0311
api.c fix for --enable-opensslall and --enable-debug
2021-03-11 14:54:40 -08:00
e93568816e Merge pull request #3859 from TakayukiMatsuo/os_ecdh
Remove NO_WOLFSSL_STUB guard and add a comment to each API
2021-03-11 15:31:21 -07:00
6241d56eec Merge pull request #3865 from haydenroche5/fix_have_aes_ecb
Change WOLFSSL_AES_ECB to HAVE_AES_ECB in api.c.
2021-03-11 14:12:46 -08:00
211eefa155 Change WOLFSSL_AES_ECB to HAVE_AES_ECB in api.c. 2021-03-11 14:03:54 -06:00
e184cf5c29 fix api.c build with --enable-opensslall and --enable-debug 2021-03-11 12:56:13 -07:00
1d5d946273 Cleanup user_settings.h 2021-03-11 06:39:39 -07:00
eb8b40c64a fix for wolfSSL_ASN1_TIME_adj set length 2021-03-11 20:34:17 +07:00
b9464befb6 Merge branch 'master' of github.com:wolfSSL/wolfssl into os_keyprint 2021-03-11 16:21:09 +09:00
c729318ddd update copyright date 2021-03-11 13:42:46 +07:00
fceba6eb6f Merge pull request #3860 from julek-wolfssl/scr-hello-verify
SCR cookie exchange shouldn't change seq and epoch numbers
2021-03-10 16:11:03 -08:00
16d55b0b86 _WIN32_WCE port of wolfCrypt - OE12
Add user_settings.h for OE12

Restrict LPCWSTR typecast to be WINCE specific
2021-03-10 17:02:21 -07:00
72eebd6e75 Merge pull request #3795 from JacobBarthelmeh/CAAM
Addition of QNX CAAM driver
2021-03-10 15:04:21 -08:00
44c5ca9d39 Merge pull request #3825 from julek-wolfssl/openssl-key-wrap
Implement `AES_wrap_key` and `AES_unwrap_key`
2021-03-10 15:01:51 -08:00
b081243af3 Merge pull request #3850 from SparkiDev/sp_x64_asm_fixes
SP ECC: Fix P-256 modinv for AVX2
2021-03-10 14:57:17 -08:00
385ef17099 Merge pull request #3852 from SparkiDev/mp_is_bit_set
MP int: fix word range check in mp_is_bit_set()
2021-03-10 14:54:58 -08:00
2b92abdd35 Merge pull request #3857 from embhorn/zd11865
Fix header cir ref with WPAS
2021-03-10 14:54:50 -08:00
0bcde126d9 Merge pull request #3791 from TakayukiMatsuo/ZD11641
Causes SSL_CTX_load_verify_locations and X509_LOOKUP_load_file to return zero on failure if WOLFSSL_ERR_CODE_OPENSSL is defined
2021-03-10 14:54:14 -08:00
40b5d94db8 Merge pull request #3848 from JacobBarthelmeh/Testing
sanity check on size before compare
2021-03-10 15:18:44 -07:00
0403990cc8 Add support for session tickets in CMake.
Additionally, ensure duplicate definitions don't make it into options.h.
2021-03-10 11:48:59 -06:00
26fb658206 SCR cookie exchange shouldn't change seq and epoch numbers 2021-03-10 18:34:09 +01:00
0e699ff046 Remove NO_WOLFSSL_STUB guard and add a comment to each wolfSSL_set_dynlock_xxx API. 2021-03-11 00:04:17 +09:00
4ad1b52108 Merge pull request #3824 from julek-wolfssl/ssl-bio-use-chain
WOLFSSL_BIO_SSL BIO should use remaining chain for IO
2021-03-10 18:21:09 +07:00
28ae8e3e11 add include file for getting WOLFSSL_CAAM_DEVID in test case 2021-03-10 17:27:40 +07:00
d7838155e5 WOLFSSL_BIO_SSL BIO should use remaining chain for IO
This is accomplished by passing the next BIO in the chain in to the `wolfSSL_set_bio` API.
2021-03-10 10:13:42 +01:00
ce62a24325 Merge pull request #3856 from embhorn/gh3849
Typo in client example
2021-03-09 15:49:30 -08:00
f421f949c9 Fix header cir ref with WPAS 2021-03-09 17:09:04 -06:00
23396a94c4 Merge pull request #3822 from TakayukiMatsuo/os_ecdh
Add CTX_set_ecdh_auto
2021-03-09 15:15:38 -07:00
fd6618170d Merge pull request #3843 from julek-wolfssl/dtls-reset-seq-num
Correctly move the Tx sequence number forward
2021-03-09 13:06:04 -08:00
d4302cc71b Correctly reset the Tx sequence number
All DTLS records after the ClientHello should try to start from the sequence number of the ClientHello if it is available.
2021-03-09 18:30:10 +01:00
9f9bf7345b Fixed CID 13482 2021-03-09 15:12:31 +01:00
dc1f11666d Fixed CID 588443 2021-03-09 14:49:30 +01:00
9e68d0d1a8 Fixed CID 586938 2021-03-09 12:30:39 +01:00
153859f2b2 Merge remote-tracking branch 'upstream/master' into os_ecdh
# Conflicts:
#	tests/api.c
2021-03-09 12:00:15 +09:00
5e953d5968 Typo in client example 2021-03-08 17:31:12 -06:00
ff3325fcaf SP ECC: Fix P-256 modinv for AVX2
modinv AVX2: do quick norm on result twice and convert 32-bit signed to
64-bit signed before adding
P-256 mont_add, mont_dbl, mont_tpl, mont_sub x64: handle mul/sqr result
being greater than modulus but not greater than 1<<256.
2021-03-09 08:42:07 +10:00
b271da2954 Fix for ZD 11808. 2021-03-08 12:23:32 -06:00
c73965b471 Merge pull request #3842 from danielinux/imx-rt1060-fixes
Fixed regressions in sha modules when compiling with WOLFSSL_IMXRT_DCP
2021-03-08 10:21:40 -08:00
7b2aa54044 Merge pull request #3801 from TakayukiMatsuo/os_bio
Add wolfSSL_BIO_tell
2021-03-08 09:56:01 -07:00
ec58765498 Merge pull request #3769 from miyazakh/openssl_ext_r1
Compatibility layer API addition
2021-03-08 09:54:07 -07:00
419b426a1b MP int: fix word range check in mp_is_bit_set() 2021-03-08 15:45:04 +10:00
98683bf71c SP int: read_unsigned_bin and BIG_ENDIAN
When unaligned access of sp_int_digit pointer causes segfault, define:
WOLFSSL_SP_INT_DIGIT_ALIGN
2021-03-08 15:17:12 +10:00
feeb0ceb96 Change macro name to WS_RETURN_CODE and add more comments. 2021-03-08 11:57:36 +09:00
2275c97602 check ret of lock and adjust return type 2021-03-06 14:21:44 +07:00
e497a8f589 sanity check on size before compare 2021-03-06 08:58:37 +07:00
3b768bcb5e addressed review comments 2021-03-06 10:18:31 +09:00
5efd0bf2a4 Fixed CID 587445. 2021-03-06 00:58:39 +01:00
db275268a1 Fixed CID 581667. 2021-03-06 00:40:08 +01:00
c2629d34b5 Fixed CID 577166, 577196. 2021-03-06 00:07:37 +01:00
5841ee8efb Fixed CID 576945. 2021-03-05 23:40:49 +01:00
7d9661d75c Fixed CID 576884. 2021-03-05 23:24:34 +01:00
876cc9239d Fixed CID 576574. 2021-03-05 23:16:50 +01:00
b6130513e3 Merge pull request #3844 from SparkiDev/mp_read_radix_fail
MP small: read radix set result to 0 on all errors
2021-03-05 12:09:38 -08:00
8428823881 Merge pull request #3840 from SparkiDev/mp_neg_fixes
MP: fixes for negative
2021-03-05 12:08:45 -08:00
b55e428795 Merge pull request #3826 from tmael/ecc_err
WOLFSSL_STATIC_MEMORY no longer requires fast math
2021-03-05 11:49:01 -08:00
af7b1bd25e Fixed CID 587328. 2021-03-05 17:18:34 +01:00
e76da394b7 Fixed CID 587287. 2021-03-05 15:44:00 +01:00
d01d32b6ed Fixed the fix of CID 578018 2021-03-05 14:59:18 +01:00
175fe250ba Merge branch 'fix/RA/v4.7.0-coverity' of https://github.com/DKubasekRA/wolfssl into fix/RA/v4.7.0-coverity 2021-03-05 14:44:10 +01:00
97a9938f94 Fixed CID 584275 2021-03-05 14:43:52 +01:00
9732f6e74b Fixed CID 587328. 2021-03-05 14:27:47 +01:00
f7fbd0fceb Fixed CID 587287. 2021-03-05 13:35:27 +01:00
8588998234 Fixed CID 586797. 2021-03-05 12:22:59 +01:00
8539e8c170 Fixed CID 584000. 2021-03-05 12:10:40 +01:00
0caed02db7 Fixed CID 576609. 2021-03-05 12:04:30 +01:00
d2b26f66d5 Fixed CID 578018 2021-03-05 10:59:08 +01:00
ad70112fd8 Fixed CID 576268 2021-03-05 10:35:14 +01:00
d510c270cd Fixed CID 212170. 2021-03-05 09:44:47 +01:00
6d0dbbe1c0 add IDE/QNX/README.md and add WOLFSSL_QNX_CAAM guard 2021-03-05 14:43:23 +07:00
298ebd6024 MP small: read radix set result to 0 on all errors 2021-03-05 10:02:07 +10:00
046b279ae2 MP: fixes for negative
sp_int.c:
  - sp_addmod_ct(), sp_submod_ct(), sp_gcd() and sp_lcm() only support
positive numbers: updated comments.
  - sp_mod(0, neg): fix to not add 0 and neg.
  - sp_div(): set sign on rem when a is greater than d but same bit length
and fix sign setting on result when absolute values equal or
close.
  - Modular exponentation functions: compare absolute values when
determining whether base needs to be reduced.
- Fix calculation of hex string when negative: add -ve nibble before
checking for need of extra 0.
  - Fix size allocation in sp_mod when WOLFSSL_SP_INT_NEGATIVE defined
tfm.c:
  - fp_mod(0, neg): fix to not add 0 and neg.
  - fp_isone(): fixed to check for negative
  - fp_add_d(): fix small stack version to support negative numbers
integer.c:
  - mp_isone(): fixed to check for negative
2021-03-05 09:29:46 +10:00
896245cae7 addressed jenkins cavp test failure 2021-03-05 08:19:25 +09:00
464f82a575 addressed jenkins failure part4 2021-03-05 08:19:24 +09:00
2246ea33cc addressed sanitize failure 2021-03-05 08:19:23 +09:00
302c6dfe11 addressed jenkins failure part3 2021-03-05 08:19:22 +09:00
9bae05525c addressed review comments 2021-03-05 08:19:22 +09:00
5ddd2710d7 addressed jenkins failure part2 2021-03-05 08:19:21 +09:00
cd26444e01 addressed jenkins failure part1 2021-03-05 08:19:21 +09:00
5fb9aa3f9b implemented SHA512_Transform and unit test 2021-03-05 08:19:20 +09:00
82fb498ed5 Implemented MD5 unit tests 2021-03-05 08:19:19 +09:00
525d28f38f Implemented MD5_Transform 2021-03-05 08:19:18 +09:00
502e1458f9 Implemented SHA one shot
Implemented SHA_Transform
2021-03-05 08:19:17 +09:00
95cf3675e9 implemented SHA256_Transform
WIP SHA512_Transform
2021-03-05 08:19:17 +09:00
cb3fa8ff9e SHA224 implementation 2021-03-05 08:19:16 +09:00
141d07e21b addressed pre-review comments 2021-03-05 08:19:16 +09:00
e39477c531 initial implement SSL_get_early_data_status 2021-03-05 08:19:15 +09:00
44a20c8ce6 add more unit test case for load_crl_file 2021-03-05 08:19:14 +09:00
544ed32893 implemented X509_load_crl_file 2021-03-05 08:19:14 +09:00
2e223fb101 implemeted wolfSSL_CTX_get0/set1_param, and corresponding to sub-methods 2021-03-05 08:19:13 +09:00
f15450f63e Merge pull request #3839 from cconlon/pkcs7free
fix PKCS7 dynamic content save/restore in PKCS7_VerifySignedData
2021-03-05 05:53:38 +07:00
19fa75c6a8 static memory no longer requires fast math 2021-03-04 14:40:14 -08:00
16f39b4e77 Fix _sp_add_d err 2021-03-04 14:40:14 -08:00
25228cb6c0 Merge pull request #3798 from dgarske/no_hash
wolfcrypt: Fixes for building without hash or rng
2021-03-05 08:16:34 +10:00
7983734dcb Merge pull request #3786 from tmael/cc310_ecc_importkey
Add Cryptocell wc_ecc_import_x963_ex
2021-03-04 13:59:54 -08:00
53a7397418 Merge pull request #3828 from elms/test/fix_openssl_ticket_noaes
test: fix compile with session-ticket without AES-GCM
2021-03-04 11:15:20 -08:00
bd57e3e4cf Merge pull request #3818 from dgarske/zd11760
Fix for InTime RTOS v5 random
2021-03-04 11:14:34 -08:00
b8235649ea Merge pull request #3812 from haydenroche5/get-certs-refactor
Improve wolfSSL_CertManagerGetCerts.
2021-03-04 11:14:05 -08:00
0a74fbf95f Merge pull request #3789 from fabiankeil/configure-accept-amd64
configure: When enabling --enable-sp-asm, accept host_cpu amd64
2021-03-04 11:11:13 -08:00
12d5c6d416 Merge pull request #3783 from haydenroche5/socat
Add support for OpenSSL compatibility function SSL_CTX_get_min_proto_…
2021-03-04 11:10:17 -08:00
90d45028cc Merge pull request #3781 from fabiankeil/NO_WOLFSSL_STUB-build-fix
Fix build with  NO_WOLFSSL_STUB
2021-03-04 11:07:26 -08:00
447b8c9318 Merge pull request #3831 from SparkiDev/sp_int_not_inf
SP int: define errors for backward compatability
2021-03-04 11:06:15 -08:00
ea243e0906 Merge branch 'fix/RA/v4.7.0-coverity' of https://github.com/DKubasekRA/wolfssl into fix/RA/v4.7.0-coverity 2021-03-04 18:26:20 +01:00
027f05e349 Fixed CID 583215. 2021-03-04 13:40:45 +01:00
f056601d26 Fixed CID 587549. 2021-03-04 11:16:40 +01:00
dbaf545694 Fixed CID 587348 and CID 587349. 2021-03-04 11:08:25 +01:00
86b5434dcc Fixed CID 587342. 2021-03-04 10:45:49 +01:00
da75a4f803 Add comment to each added function and fix return value of wolfSSL_EVP_DecodedFinal 2021-03-04 18:39:47 +09:00
5043f0229a Add comment to each added functions 2021-03-04 17:41:18 +09:00
7610e4989c iMX-RT1060 support: Fixed missing definition of wc_Sha256Free 2021-03-04 08:34:15 +01:00
791a5b4244 iMXRT1060 support: Fixed duplicate definition of wc_InitSha & wc_ShaCopy 2021-03-04 08:33:20 +01:00
871933e3e8 Add s comment to wolfSSL_BIO_tell 2021-03-04 15:41:03 +09:00
b141c2f4f2 Add comment for each added function 2021-03-04 15:02:53 +09:00
d5cd9c4a7f Fixed CID 591810. 2021-03-04 01:02:11 +01:00
2be80acdd3 fix PKCS7 dynamic content save/restore in PKCS7_VerifySignedData for multiPart bundles with certs 2021-03-03 16:19:58 -07:00
8c3b5c3402 Merge pull request #3838 from guidovranken/zd11824
Return error code from sp_cond_swap_ct
2021-03-04 08:30:19 +10:00
b383d93274 Fixed CID 582952. 2021-03-03 21:32:34 +01:00
3770d4c581 Fixed CID 577295. 2021-03-03 21:20:33 +01:00
c634c6c850 Fixed CID 577188. 2021-03-03 21:09:24 +01:00
d3314f142a Fixed CID 576946. 2021-03-03 21:04:51 +01:00
f2b832415e Fixed CID 576799. 2021-03-03 20:57:40 +01:00
9ea66868d8 Fixed CID 536133. 2021-03-03 20:37:29 +01:00
05156083ec Fixed CID 529770. 2021-03-03 20:29:21 +01:00
c27c78f9e4 Fixed CID 529748. 2021-03-03 20:12:59 +01:00
6725a4f5d2 Return error code from sp_cond_swap_ct
ZD 11824
2021-03-03 20:03:10 +01:00
d941cb4456 Fixed CID 587279. 2021-03-03 19:48:54 +01:00
806313ff1a Fixed CID 576473. 2021-03-03 19:43:19 +01:00
af42e2a799 Fixed CID 576329. 2021-03-03 19:21:51 +01:00
b47678513a Merge branch 'fix/RA/v4.7.0-coverity' of https://github.com/DKubasekRA/wolfssl into fix/RA/v4.7.0-coverity 2021-03-03 18:49:06 +01:00
1aa718a438 Fixed CID 143658, 463100, 529732. 2021-03-03 18:49:00 +01:00
061120dda6 Fixed CID 587340. 2021-03-03 17:18:24 +01:00
18163c9a2a Fixed CID 587269. 2021-03-03 16:38:28 +01:00
d5c3d9ca4f Fixed CID 587064. 2021-03-03 16:03:32 +01:00
27c5714f11 Fixed CID 586826. 2021-03-03 15:58:55 +01:00
0bdb2bf40c Fixed CID 583972. 2021-03-03 15:55:02 +01:00
26578be1a7 Fixed CID 583215. 2021-03-03 15:51:22 +01:00
ef34e613e8 Fixed CID 582947. 2021-03-03 15:46:37 +01:00
38cfe71732 Fixed CID 576552. 2021-03-03 15:41:28 +01:00
b801a6e809 silence warning of unused parameter in certain builds 2021-03-03 18:45:40 +07:00
9db0257e2e changes after initial review 2021-03-03 18:45:40 +07:00
26a6643383 fix typo on black keymod size and set devid default with TLS 2021-03-03 18:45:40 +07:00
73349d9a83 add missing header file 2021-03-03 18:45:40 +07:00
ffbd565285 fix for cryptocb with private key check 2021-03-03 18:45:40 +07:00
79ec07f5e1 adjustment after rebase 2021-03-03 18:45:40 +07:00
69a0b643be removing some magic numbers 2021-03-03 18:45:40 +07:00
4409be2a4e some misra c changes 2021-03-03 18:45:40 +07:00
99f19b19d4 fix for valgrind ecc verify issue 2021-03-03 18:45:40 +07:00
3757e83c64 use hardset mmap device memory for flags 2021-03-03 18:45:40 +07:00
49aeafaa8d adjust dist files and fix warning 2021-03-03 18:45:40 +07:00
749425e1e8 first pre alpha code for QNX + CAAM
manual run of RNG init and JDKEK print

job ring does initial rng

is successful on some red key blob operations

caam red key blob test pass

ecdsa sign/verify

ecdsa ecdh/sign/verify with black secure key

ecdsa ecdh/sign/verify with black secure key

initial cmac addition

initial cmac addition

black blob encap

black keys with cmac

add invalidate memory

refactoring and clean up

more code cleanup

add files for dist and remove some printf's

remove unneeded macro guard

use resource manager
2021-03-03 18:45:40 +07:00
5dbc6db295 Fixed CID 576149 2021-03-03 10:25:54 +01:00
bbf1284112 Replace immediate value "0" with WOLFSSL_FAILURE and add comment to the RETURN_CODE macro 2021-03-03 11:23:11 +09:00
7b78c61ed3 Merge pull request #3833 from dgarske/ecc_keydp
ECC: Improve the key ecc_set NULL checking
2021-03-03 09:47:32 +10:00
3752347f14 Improve the random logic for the INTIME RTOS RNG. 2021-03-02 15:04:01 -08:00
4d8068a328 Merge pull request #3813 from douzzer/configure-autotools-boilerplate-at-the-top
configure.ac: put autotools boilerplate at the top
2021-03-02 09:22:09 -08:00
7e8aa99471 Merge pull request #3820 from haydenroche5/cmake-options-cleanup
Clean up CMake option strings.
2021-03-02 08:55:12 -08:00
4ff886dbda test: fix compile with session-ticket without AES-GCM
EVP compat layer doesn't support poly chacha so test shouldn't be
included to try and test it.
2021-03-02 08:40:19 -08:00
9fe7be5ac4 Improve the key ecc_set NULL checking for possible use of key->dp == NULL cases. This is cases where the key has not been properly iniailized or loaded prior to calling from a public API. 2021-03-01 17:17:40 -08:00
9d4d36f7fe Fix hasty copy/paste with privSz2. 2021-03-01 16:02:51 -08:00
84d5d37f61 SP int: define errors for backward compatability 2021-03-02 08:34:23 +10:00
14faf16955 Dismiss unused warnings for dh_test. 2021-03-01 10:14:28 -08:00
8c1a93d9e1 Using "rand()" to seed our PRNG as its available on all INTIME RTOS versions. 2021-03-01 09:23:19 -08:00
39a28eeec2 Add RSA_NO_PADDING to wolfSSL_RSA_private_encrypt 2021-03-01 13:21:26 +01:00
42e87fa542 Add DH key initialization 2021-03-01 01:13:25 +09:00
a34c5b018f Move the local variable declaration to the beginning of the function 2021-03-01 00:49:50 +09:00
e72948b018 Fix for PR tests 2021-02-28 10:27:43 +09:00
265b456cac Improve wolfSSL_CertManagerGetCerts.
- Use wolfSSL_d2i_X509. wolfSSL_CertManagerGetCerts duplicated a lot of work
that wolfSSL_d2i_X509 can do for us.
- This function gets the caLock from the CertManager and then calls ParseCert.
Ultimately, ParseCert calls GetCA, which attempts to acquire the same caLock.
Deadlock ensues. The solution is to get the caLock, make a copy of all the
certs, and release the lock. Then, we use the copy of the certs to build up
the stack of X509 objects. What happens if one of the certs is removed from
the CertManager between our copying and calling wolfSSL_d2i_X509? Nothing of
consequence for this use case. ParseCertRelative won't set the DecodedCert's ca
field, but we don't need that to be set here.
2021-02-26 10:45:27 -06:00
cd9f400cf3 Clean up CMake option strings.
This commit makes all the binary CMake options (i.e. yes/no) conform to one
string convention: "yes/no." Previously, we had a mixture of yes/no and ON/OFF.
2021-02-26 10:30:46 -06:00
78e2e37fd6 Remove unneccessary local variable initializations and remove local variable declarations in for-loops 2021-02-26 17:17:32 +09:00
e9719595fa Removed commented-out line 2021-02-26 12:49:32 +09:00
a54e3aadea Fix for PR tests 2021-02-26 12:42:42 +09:00
ec471af9c5 Add following stub funcs:
- wolfSSL_THREADID_current
- wolfSSL_THREADID_hash
- wolfSSL_CTX_set_ecdh_auto
2021-02-26 11:26:10 +09:00
4c1a94a6ad Merge pull request #3768 from SparkiDev/mp_add_d_too_big
MP small: mp_add_d doesn't support adding a digit greater than MP_DIG…
2021-02-25 16:56:23 -08:00
e18eacfcd2 Merge pull request #3779 from embhorn/zd11711
Squelch interfering def of SHA_CTX
2021-02-25 16:05:24 -08:00
2d13a43e71 Merge pull request #3819 from elms/fix/nightly_g++
ssl: fix g++ compile warning with explicit cast
2021-02-25 16:04:05 -08:00
5682d61e75 Merge pull request #3817 from SparkiDev/i2d_x509_name_mv
ASN: move wolfSSL_i2d_X509_NAME to ssl.c
2021-02-25 16:03:30 -08:00
7d002a7645 Merge pull request #3816 from SparkiDev/win_curve448
Windows Project: Include the X448 and Ed448 files
2021-02-25 16:00:53 -08:00
dbc4c51a4e Merge pull request #3815 from SparkiDev/sp_math_keygen
SP int: get keygen working with SP math again
2021-02-25 16:00:27 -08:00
8d37da24dc Merge pull request #3814 from SparkiDev/gcd_lcm_zero
Math: GCD(0,0) is undefined and LCM(0,*) is undefined.
2021-02-25 16:00:04 -08:00
10181b7bbf Add support for OpenSSL compatibility function SSL_CTX_get_min_proto_version.
This is needed by socat-1.7.4.1.
2021-02-25 17:04:41 -06:00
bc585e85b6 Dismiss unused warnings for rsa_test. 2021-02-25 11:23:21 -08:00
2eb253330f Implement AES_wrap_key and AES_unwrap_key
Add `wc_AesKeyWrap_ex` and `wc_AesKeyUnWrap_ex` API to accept an `Aes` object to use for the AES operations
2021-02-25 20:01:51 +01:00
afbe3607d7 ssl: fix g++ compile warning with explicit cast
cast OpenSSL callback to `void*` for storage as context to be used by
static callback
2021-02-25 11:01:16 -08:00
acff0e8781 Fix for InTime RTOS v5. The arc4random_buf wasn't added until v6, so opting to use arc4random. ZD 11760. 2021-02-25 08:54:30 -08:00
442f182c67 Merge pull request #3778 from haydenroche5/cmake_curve_ed
Add CMake support for CURVE25519, ED25519, CURVE448, and ED448.
2021-02-25 08:01:26 -08:00
d271092aef ASN: move wolfSSL_i2d_X509_NAME to ssl.c
Move WOLFSSL_X509_NAME APIs out of asn.[ch].
2021-02-25 11:45:12 +10:00
7bc12bb536 Windows Project: Include the X448 and Ed448 files 2021-02-25 11:10:46 +10:00
d805a5c681 SP int: get keygen working with SP math again
./configure --enable-sp --enable-sp-math --enable-keygen
2021-02-25 10:01:27 +10:00
982ba6c1e0 Math: GCD(0,0) is undefined and LCM(0,*) is undefined.
All integers divide 0 so there is no greatest common divisor.
0 is not in the set of numbers for LCM.
2021-02-25 09:29:21 +10:00
5cc8979309 Review feedback for unused `pubSz2. 2021-02-24 15:09:51 -08:00
3a3c0be43f Fixes for build warnings for CryptoCell with ECC and RSA. 2021-02-24 15:05:27 -08:00
9be1e74dc3 configure.ac: move the autotools boilerplate/initializations back to the top, before --enable-distro and --enable-reproducible-build handling. 2021-02-24 17:04:33 -06:00
101b35e766 cmake: mirror configure logic for SHA3, SHAKE256, SHA224 2021-02-24 14:25:30 -08:00
49a0f70c24 Fix errors from last commit. 2021-02-24 14:19:13 -08:00
074090049b Add CMake support for CURVE25519, ED25519, CURVE448, and ED448. 2021-02-24 13:57:34 -08:00
8988f1d5a2 Squelch interfering def of SHA_CTX 2021-02-24 15:46:02 -06:00
9ebdc8d61c Additional fixes for building without RNG. Fix for possible use of key->dp == NULL in wc_ecc_export_ex. 2021-02-24 13:21:54 -08:00
c201b6801c Merge pull request #3808 from lechner/enable-base64-with-all
Enable Base64 as part of --enable-all.
2021-02-24 14:39:20 -06:00
764207a9f5 Merge pull request #3806 from elms/autoconf/oot_fips_check
configure: fix for FIPS out-of-tree builds
2021-02-24 14:38:26 -06:00
94a23c1d48 Merge pull request #3646 from julek-wolfssl/nginx-1.19.6
Add support for Nginx 1.19.6
2021-02-24 12:21:51 -08:00
d8a053ac35 Merge pull request #3809 from embhorn/zd11773
Warnings and error fixes
2021-02-24 12:14:08 -08:00
bf63b41465 Fixes for building without hash. If all hash algorithms are disabled wc_HashAlg could report empty union. ZD 11585. 2021-02-24 11:04:03 -08:00
36ba2e134b configure: FIPS error and compatability cleanup
Use autotools macros for case and if. Simplify validation logic.
2021-02-24 08:53:50 -08:00
1d16af4f32 Warnings and error fixes 2021-02-24 09:08:15 -06:00
ae28550667 Enable Base64 as part of --enable-all.
Part of an effort to standardize build options across distributions.

When building with all options, this includes Base64, a feature that
was requested in the past.

This commit passed Debian's Salsa CI pipeline [1] as part of a larger
commit streamlining the build options for distributions. [2]

A related pull request by douzzer activated reproducible builds for
distributions by default. [3]

Thanks to David Garske for his generous contributions to this commit!

[1] https://salsa.debian.org/lechner/wolfssl/-/pipelines/233601
[2] https://salsa.debian.org/lechner/wolfssl/-/blob/debian/master/debian/patches/standardize-distro-options.patch
[3] e30b3d3554
2021-02-23 19:46:56 -08:00
ac38e53fec Merge pull request #3804 from tmael/aws-sdk
Use Unix line endings
2021-02-23 18:33:07 -08:00
e30b3d3554 Merge pull request #3807 from douzzer/distro-reproducible-build
--enable-distro implies --enable-reproducible-build
2021-02-23 18:32:04 -08:00
9dadd02fb9 configure.ac move --enable-distro handling to top (preceding --enable-reproducible-build handling), and turn on reproducible-build by default when enable-distro; fix spelling error in reproducible-build help text. 2021-02-23 17:05:44 -06:00
3cdbc242b4 Merge pull request #3803 from dgarske/zd11759
Fix misplaced endif and brace
2021-02-24 09:04:38 +10:00
47872224d8 configure: fix for FIPS out-of-tree builds
Check for fips files relative to source directory.
2021-02-23 14:17:35 -08:00
7a71ec4692 Merge pull request #3802 from tmael/pkcs8err
Fix PKCS8 build config
2021-02-23 13:42:17 -08:00
9bfbc999d9 Move variable declarations to the top 2021-02-23 13:21:50 -08:00
2d0207fc60 Fix undeclared identifier errors 2021-02-24 05:38:28 +09:00
0dfdf92ff7 Merge pull request #3784 from elms/cmake_curve_ed
configure: ED448 to enable SHA3 and SHAKE256 properly
2021-02-24 03:20:38 +07:00
5eba89c3ca Merge pull request #3742 from julek-wolfssl/error-queue-per-thread
Add --enable-error-queue-per-thread
2021-02-23 12:02:16 -08:00
ef916df1b1 Merge pull request #3761 from JacobBarthelmeh/Release
update changelog and bump version to 4.7.1 for development bundles
2021-02-23 12:00:59 -08:00
60614ff8b1 Merge pull request #3772 from SparkiDev/sp_ecdsa_set_k
SP ECDSA sign: fix multiple loops work of generating k
2021-02-23 12:00:21 -08:00
a1db869491 Merge pull request #3775 from haydenroche5/openldap
Add a define to openssl/ssl.h needed for openldap port.
2021-02-23 11:58:37 -08:00
363185669a Merge pull request #3776 from cconlon/pkcs7testfix
fix wolfCrypt PKCS#7 test when PKCS7_OUTPUT_TEST_BUNDLES is defined
2021-02-23 11:58:00 -08:00
e471cba8df Merge pull request #3780 from SparkiDev/tls13_key_up_resp
TLS 1.3: add API to tell if a KeyUpdate response is required
2021-02-23 11:57:10 -08:00
d3c8720b56 Use Unix line endings 2021-02-23 11:54:02 -08:00
244accece1 Merge pull request #3799 from SparkiDev/sp_gcd_protect
SP int: fix guard around sp_gcm and sp_lcm
2021-02-23 11:53:25 -08:00
6cc137dce0 Fix misplaced endif and brace. 2021-02-23 10:22:59 -08:00
760ea219a8 Fix for "unused variable" warning 2021-02-24 02:33:46 +09:00
b199c2e444 Fix PKCS8 test 2021-02-23 09:33:14 -08:00
c0a9f86de3 Move some variable declarations to the beginning of the block 2021-02-24 01:33:51 +09:00
362d2a2d68 Moved int pos declaration at the top the func 2021-02-24 01:07:45 +09:00
d074e7443f Remove default ticket cb as this will be added in another PR 2021-02-23 10:06:11 +01:00
22349e0539 Merge pull request #3800 from dgarske/zd11759
Fixes for warnings in Windows and failing `wc_BufferKeyEncrypt` test
2021-02-23 17:07:14 +10:00
9e4dcfb66c Add wolfSSL_BIO_tell 2021-02-23 11:12:12 +09:00
b5239f97c4 Fixes for warnings in Windows. Fix for failing wc_BufferKeyEncrypt with PBKDF disabled. ZD 11759. 2021-02-22 16:51:17 -08:00
3ac40be091 Merge pull request #3797 from tmael/builderr
Correct a build error with a non-standard configurations
2021-02-22 16:33:01 -08:00
d2f9f4c4ce SP int: fix guard around sp_gcm and sp_lcm 2021-02-23 10:21:32 +10:00
fc6394b923 Merge pull request #3796 from elms/fix_valgrind_fpecc
tests: fix preprocessor test for gcd/lcm
2021-02-23 09:42:35 +10:00
a7cca8a99b Fix wolfSSL_EVP_PKEY_print_public 2021-02-23 07:57:45 +09:00
e9cdcf5bac Merge pull request #3764 from embhorn/zd11668
Fix typo
2021-02-22 14:12:12 -08:00
243c3ceacc Fix build err 2021-02-22 13:36:21 -08:00
c4d2e7cfdb configure: split SHA3 and SHAKE256 to work with ED448
Define flags and defaults early, but set CFLAGS later to allow
override.
2021-02-22 10:14:21 -08:00
451b8ede51 tests: fix preprocessor test for gcd/lcm
Fixes `--enable-valgrind --enable-fpecc --enable-ecc` build
2021-02-22 09:53:55 -08:00
b495e12179 Fix such as "for loop initial declaration" 2021-02-23 02:29:37 +09:00
e25284c690 Add wolfSSL_EVP_PKEY_print_public 2021-02-22 23:51:27 +09:00
49d1b859d4 Add wolfSSL_EVP_Encode/Decode APIs 2021-02-22 17:51:44 +09:00
4264a49246 Causes SSL_CTX_load_verify_locations and X509_LOOKUP_load_file to return zero on failure if WOLFSSL_ERR_CODE_OPENSSL is defined 2021-02-22 08:05:11 +09:00
41c4a25b25 Merge pull request #3785 from embhorn/zd11752
Fix ret val for wolfSSL_BIO_set_ssl
2021-02-22 08:34:47 +10:00
1b319804ad configure: When enabling --enable-sp-asm, accept host_cpu amd64 as alternative to x86_64
Allows to use --enable-sp-asm on ElectroBSD amd64.

Previouly configure failed with:
 configure: error: ASM not available for CPU. Supported CPUs: x86_64, aarch64, arm
2021-02-20 14:25:05 +01:00
c7b1dc8f94 Fix Cryptocell ECC tests 2021-02-19 16:39:45 -08:00
ebb2c7ae71 Fix ret val for wolfSSL_BIO_set_ssl 2021-02-19 16:35:01 -06:00
078d78a884 Merge pull request #3782 from JacobBarthelmeh/Async 2021-02-19 14:24:09 -08:00
31d3dfdd4d configure: ED448 to enable SHA3 and SHAKE256 properly
SHA3 and SHAKE256 are required for ED448, but were potentially
overwritten after being set when ED448, specifically others than
x86_64/aarch64
2021-02-19 13:18:52 -08:00
3079ca4d6a add comment that use is blocking and adjust indentation 2021-02-20 02:54:10 +07:00
8d7c61cf10 prep for Async release 2021-02-19 11:51:23 -07:00
2002ae9dca tests/api.c: Fix build with NO_WOLFSSL_STUB defined 2021-02-19 05:45:19 +01:00
400a1d6927 Compile wolfSSL_ASN1_TIME_set_string() independently of NO_WOLFSSL_STUB 2021-02-19 05:45:09 +01:00
8fabb9e9bb Merge pull request #3767 from dgarske/rsapubonly
Fixes for building with RSA verify or public only
2021-02-19 10:36:00 +10:00
fa7b5f55ee TLS 1.3: add API to tell if a KeyUpdate response is required 2021-02-19 10:21:08 +10:00
31c76dcc1a Merge pull request #3777 from elms/cmake/configure_test_paths
cmake: configure `test_paths.h`
2021-02-18 15:02:19 -08:00
70ddaf8f2e cmake: configure test_paths.h 2021-02-18 12:17:55 -08:00
4da0328e1a fix wolfCrypt PKCS#7 test when PKCS7_OUTPUT_TEST_BUNDLES is defined 2021-02-18 12:14:48 -07:00
10be54054e Minor fixes for build errors and bad macro names. 2021-02-18 10:55:47 -08:00
c62b48f7d0 Fixes for building with RSA public or verify only. Fixes issue with reserved "div" keyword as variable name. ZD11585 2021-02-18 07:47:00 -08:00
2290d1b4c8 Add a define to openssl/ssl.h needed for openldap port. 2021-02-18 09:17:47 -06:00
3bf9b49274 SP ECDSA sign: fix multiple loops work of generating k
Support only one loop of generated k.
2021-02-18 09:06:50 +10:00
ad58478d29 Merge pull request #3765 from embhorn/zd11703
Validate name size
2021-02-18 08:42:26 +10:00
276e090a1f Merge pull request #3763 from embhorn/zd11726
Adding wolfSSL_CTX_get_TicketEncCtx
2021-02-18 08:35:03 +10:00
5dc6de3063 Merge pull request #3771 from JacobBarthelmeh/Testing
fix build for apache without tls 1.3
2021-02-18 08:19:29 +10:00
caa39f78ae Fix from review and leak in wolfSSL_X509_get_serialNumber 2021-02-17 13:53:30 -06:00
d31f184c49 Adding tests 2021-02-17 13:34:38 -06:00
608083f559 Add more checks for name->sz 2021-02-17 12:19:42 -06:00
4def38dd7e fix build for apache without tls 1.3 2021-02-17 18:23:03 +07:00
7ce3860e19 MP small: mp_add_d doesn't support adding a digit greater than MP_DIGIT_MAX 2021-02-17 09:24:22 +10:00
80e75c3db8 Merge pull request #3766 from guidovranken/zd11733
Better error propagation in _fp_exptmod_ct
2021-02-17 08:45:43 +10:00
cc37227f18 Merge pull request #3762 from guidovranken/zd11732
Fix memory leak in fp_gcd
2021-02-16 13:04:10 -08:00
806b5d7d23 Validate name size 2021-02-16 14:58:58 -06:00
b47809e718 Better error propagation in _fp_exptmod_ct 2021-02-16 19:54:59 +01:00
3a9d533d2c update changelog with researchers names, thanks Aina and Olivier 2021-02-17 00:04:16 +07:00
5f3ee2985c bump version for development bundles 2021-02-16 23:57:47 +07:00
7bd3cccd87 Fix memory leak in fp_gcd
ZD 11732
2021-02-16 17:47:00 +01:00
b8f841599c Add --enable-error-queue-per-thread 2021-02-16 16:08:13 +01:00
89fd0b375b Correctly read anon cipher run-time options 2021-02-16 14:27:19 +01:00
9265c3f71f Use native API for ticket callback 2021-02-16 14:25:45 +01:00
0ae1a8b8c5 Jenkins fixes
- Change pushCAx509Chain to an iterative implementation
- Fix variable names shadowing global names
2021-02-16 14:25:45 +01:00
e80158a96e Set full chain with known CA's in wolfSSL_set_peer_cert_chain 2021-02-16 14:25:45 +01:00
b90862fa3f Free OcspEntry.status only when the struct owns the pointer 2021-02-16 14:25:45 +01:00
26df833074 Compat layer session tickets
- OpenSSL uses an internal mechanism by default for session tickets. This is now implemented for OPENSSL_EXTRA in wolfSSL.
- Add testing of wolfSSL_CTX_set_tlsext_ticket_key_cb
2021-02-16 14:25:45 +01:00
9a1e54cfd5 Nginx 1.19.6 Fixes 2021-02-16 14:25:45 +01:00
b63f43a2af Nginx 1.19.6
- Implement X509_pubkey_digest
- Initialize entire WOLFSSL_X509_NAME struct to zero
- Set raw and rawLen when copying WOLFSSL_X509_NAME
2021-02-16 14:25:45 +01:00
8f88ac7442 add note about s/mime addition to changelog 2021-02-16 08:35:21 +07:00
830de9a9fb Merge pull request #3760 from JacobBarthelmeh/Release
prepare for release v4.7.0
2021-02-15 14:29:51 -08:00
30462fcf95 Merge pull request #3756 from SparkiDev/sp_math_dh_agree
DH SP math: return key size error with DH Agree
2021-02-15 12:26:04 -08:00
917205442b Merge pull request #3757 from SparkiDev/sp_smallstack_fixes
sp_lcm small stack: fix size of temporary
2021-02-15 12:25:13 -08:00
888fab501b Merge pull request #3758 from SparkiDev/sp_exch_fix
SP math all: sp_exch fixed up
2021-02-15 12:23:28 -08:00
742731a65f Merge pull request #3759 from JacobBarthelmeh/Testing
fix for haproxy and nginx build, remove execute bit on certs
2021-02-15 12:21:56 -08:00
847938f4d6 prepare for release v4.7.0 2021-02-16 02:41:37 +07:00
b7b07e1945 Adding wolfSSL_CTX_get_TicketEncCtx 2021-02-15 11:28:46 -06:00
f4519018eb remove execute bit on smime bundles 2021-02-15 23:33:31 +07:00
0b0f370384 fix for haproxy and nginx build 2021-02-15 22:09:44 +07:00
ba1c67843a Merge pull request #3752 from JacobBarthelmeh/Jenkins
changes from nightly Jenkins test review
2021-02-15 16:32:40 +10:00
c5190d1294 Merge pull request #3753 from dgarske/wpas_revert
Fixes for hostapd (revert some configure.ac changes in PR #3289)
2021-02-15 09:45:27 +07:00
e4f8545e36 SP math all: sp_exch fixed up 2021-02-15 10:29:45 +10:00
e187a74b1c sp_lcm small stack: fix size of temporary
Temporary sp_int needs to be allocated to be 1 digit larger than a or b
for the div operation.
Change sp_div to check sizes of r and rem when passed in.
Fix sp_invmod, sp_gcm, sp_submod to use temporary sp_int sizes that work
with calls to sp_div().
2021-02-15 09:48:18 +10:00
4b1c89ab38 DH SP math: return key size error with DH Agree
SP math requires SP to support DH operations.
When SP doesn't support bit size, WC_KEY_SIZE_E must be returned.
2021-02-15 09:04:43 +10:00
505514415d Merge pull request #3748 from JacobBarthelmeh/Testing
always check index into certs
2021-02-15 08:20:28 +10:00
98b5900266 Revert of changes in PR #3289, which should not have removed the HAVE_SECRET_CALLBACK and WOLFSSL_PUBLIC_ECC_ADD_DBL. These are required for hostapd. 2021-02-12 14:11:17 -08:00
fc005f941c Merge pull request #3750 from embhorn/buffer_conflict
Fix use of 'buffer' in test
2021-02-12 13:59:18 -08:00
bde1a2209a tests: add include for ecc.h to fix compile error
fix testsuite implicit definition of `wc_ecc_fp_free` with
`./configure --enable-fpecc --enable-ecc --enable-stacksize`
2021-02-13 01:31:01 +07:00
f311c9a038 Merge pull request #3751 from SparkiDev/aes_gcm_type
AES-GCM type fixes: internal functions now have word32 type parameters
2021-02-12 10:12:26 -08:00
1c852f60ab fix for g++ build 2021-02-12 23:26:54 +07:00
7e72fafd44 do not turn on FP_64BIT by default on Aarch64 2021-02-12 23:16:04 +07:00
a49c867b38 increase test buffer size for updated pkcs7 bundle 2021-02-12 23:16:04 +07:00
0938a0055d always use MAX_CHAIN_DEPTH for args->certs buffer 2021-02-12 15:18:14 +07:00
3926ccd39b AES-GCM type fixes: internal functions now have word32 type parameters
Lengths were signed int for decrypt while unsigned int for encrypt.
Use word32 across the board.
Also fix AES-NI code on Windows to cast lengths to word64 before
multiplying by 8 to avoid averflow.
2021-02-12 08:30:08 +10:00
2ac826c37e Fix use of 'buffer' in test 2021-02-11 15:58:26 -06:00
ae073b7ce2 Merge pull request #3741 from elms/test/openssl_distcheck_fix
testing: fix openssl test for `distcheck`
2021-02-11 13:53:09 -08:00
81dcf0d28b Merge pull request #3640 from tmael/evp_rsa2
Remove EVP_PKEY_RSA2
2021-02-11 13:51:46 -08:00
1283a4d9f0 Merge pull request #3686 from embhorn/zd11571
Fix Free/SafeRTOS with XMALLOC_USER
2021-02-11 13:50:55 -08:00
d40ea03621 Merge pull request #3703 from SparkiDev/sp_int_malloc
SP int: Rework allocation of temporaries
2021-02-11 13:49:45 -08:00
f0ce6ada0f Merge pull request #3702 from guidovranken/zd11603
Prevent dangling pointer in TLSX_Cookie_Use
2021-02-11 12:31:02 -08:00
3eeeb39fb7 Merge pull request #3711 from dgarske/ecc_encrypt_rng
Fix for `--enable-eccencrypt` with timing resistance enabled
2021-02-11 12:28:13 -08:00
80b9949052 Merge pull request #3739 from kaleb-himes/FusionRTOS-Porting-R3
Fusion RTOS porting round 3
2021-02-11 12:25:55 -08:00
e87e818c6e Merge pull request #3749 from dgarske/zd11624_pkcs11
Fix another PKCS11 case where the ECC key type is not set
2021-02-12 01:36:41 +07:00
2c2bdca200 Fix typo 2021-02-11 12:27:43 -06:00
39cb84de25 Merge pull request #3697 from julek-wolfssl/openvpn-2.5-missing-stuff
OpenVPN master additions
2021-02-11 08:56:45 -08:00
f006479645 Fix another PKCS11 case where the ECC key type is not set and causes failures. Broke in PR #3687. 2021-02-11 08:04:58 -08:00
90140fc5a4 always check index into certs 2021-02-11 21:50:51 +07:00
d05dc921a7 Merge pull request #3745 from douzzer/enable-reproducible-build 2021-02-11 06:39:28 -08:00
d64315a951 configure.ac: add --enable-reproducible-build: put ar and ranlib in deterministic mode, and leave LIBWOLFSSL_CONFIGURE_ARGS and LIBWOLFSSL_GLOBAL_CFLAGS out of the generated config.h. relates to PR #3417 . 2021-02-11 00:12:05 -06:00
b330196c28 SP int: Rework allocation of temporaries
Allocate only as much is as needed.
Use macros to simplify code.
Don't use an sp_int if you can use an array of 'sp_int_digit's.
2021-02-11 10:34:40 +10:00
acdc267104 Merge pull request #3718 from SparkiDev/sp_int_fast_nct
SP int: allow faster NCT exptmod to be compiled in
2021-02-10 16:14:39 -08:00
032cc1645c Merge pull request #3713 from SparkiDev/tls_def_sess_ticket_cb
TLS Session Ticket: default encryption callback
2021-02-10 16:13:33 -08:00
389a5e0301 Merge pull request #3684 from SparkiDev/sp_fixes_5
SP fixes: even mod testing, ECC compilation with SP
2021-02-10 16:10:21 -08:00
6983aa9331 Merge pull request #3700 from SparkiDev/sp_math_lshb
SP math lshb: check space for result
2021-02-10 16:01:27 -08:00
67b1280bbf Merge pull request #3545 from kabuobeid/smime
Added support for reading S/MIME messages via SMIME_read_PKCS7.
2021-02-10 15:59:32 -08:00
0403f5f18d Merge pull request #3744 from JacobBarthelmeh/Certs
run renewcerts.sh script
2021-02-11 09:43:49 +10:00
5151e1f749 Merge pull request #3715 from JacobBarthelmeh/Testing
openssl x509 small with req cert gen
2021-02-11 09:39:15 +10:00
7efaf14fce Merge pull request #3727 from JacobBarthelmeh/Prime
check prime is prime with ecc compressed keys
2021-02-11 09:22:40 +10:00
d67934f6b8 scripts: remove use of realpath and fix external.test
`external.test` could fail quietly for not finding `ping.test` for
out-of-tree builds. Make it look relative to the script location.
2021-02-10 14:18:32 -08:00
ac96e58928 Merge pull request #3743 from dgarske/zd11624
Fix for copy/paste error for ECC key type
2021-02-11 04:02:54 +07:00
41e5e547c4 run renewcerts.sh script 2021-02-11 03:12:54 +07:00
223ba43c2c Add debug message regarding failure 2021-02-10 12:15:43 -07:00
9e6ab4ab70 Address indendation, fix return on stub, remove warning 2021-02-10 11:26:29 -07:00
c9c4a7ee68 Fix spelling errors. 2021-02-10 10:17:51 -08:00
0c75099111 Fix for copy/paste error in PR 3728, which makes sure the ECC key type is specified. 2021-02-10 10:14:31 -08:00
4c171524dd Address missed CloseSocket item and revert some white space changes 2021-02-10 09:14:54 -07:00
9b6f382b2c testing: fix openssl test for distcheck
Previously missed case of cert locations for out-of-tree build. Use
relative path from script location for certificate path
2021-02-10 07:15:22 -08:00
3c0563908f openssl x509 small with req cert gen
add test for build case with x509small and add back in function

adjust macro guard for i2d_X509_NAME implementation

add macro guard on test case
2021-02-10 21:48:29 +07:00
7e428f90f2 Revert zero return, to be handled in stand-alone PR 2021-02-10 05:31:57 -07:00
15f9902e94 Address new file issue by Jenkins and peer feedback on return val of time 2021-02-10 04:16:34 -07:00
64bc4b663d SP fixes: even mod testing, ECC compilation with SP
Even mod inversion will sometimes work with integer.c.
Don't call SP code to perform ECC ops unless WOLFSSL_HAVE_SP_ECC is
defined.
2021-02-10 14:38:58 +10:00
794cb5c7a9 TLS Session Ticket: default encryption callback
Encrypts with ChaCha20-Poly1305 or AES-GCM.
Two keys in rotation.
Key used for encryption until ticket lifetime goes beyond expirary
(default 1 hour). If key can still be used for decryption, encrypt with
other key.
Private random used to generate keys.
2021-02-10 14:31:54 +10:00
89b97a0fbf Implement peer feedback 2021-02-09 18:42:23 -07:00
b704c3b3f8 Merge pull request #3693 from SparkiDev/curve448_ppc64
Curve448 PPC64: 'char' is not always signed - use type 'sword8'
2021-02-09 16:08:06 -08:00
75d0496f77 Merge pull request #3722 from SparkiDev/sp_clang_fix
test.c: don't check key NULL when not small stack
2021-02-09 16:07:04 -08:00
157ad65a6e Merge pull request #3677 from SparkiDev/ecdsa_keep_e
ECDSA: don't modify the e mp_int (hash) value
2021-02-09 16:06:05 -08:00
47b2e8342b Merge pull request #3698 from SparkiDev/sp_math_no_asm_fix
SP math: fix one word Montgomery Reduction for non-asm
2021-02-09 16:04:38 -08:00
32424f715c Merge pull request #3699 from SparkiDev/sp_ecdsa_vfy_fix
SP ECC verify: check point for z=0 and set to infinity
2021-02-09 16:02:51 -08:00
27475291b1 Merge pull request #3733 from SparkiDev/sp_int_mont_red_size
SP int: mont_red - check size of a relative to m
2021-02-09 16:00:24 -08:00
ae3706d5e5 Merge pull request #3734 from SparkiDev/sp_int_8_bit
SP int: fixes for 8-bit digits
2021-02-09 15:59:26 -08:00
2f47934184 Merge pull request #3735 from SparkiDev/sp_int_32_bit
SP int SP_WORD_SIZE=32: cast down explicitly
2021-02-09 15:56:49 -08:00
fc30f379ee Merge pull request #3736 from SparkiDev/sp_int_neg_zero
SP int neg: fix handling of negative zero and mp_cond_copy
2021-02-09 15:48:21 -08:00
cfadc7e25a Merge branch 'FusionRTOS-Porting-R3' of https://github.com/kaleb-himes/wolfssl into FusionRTOS-Porting-R3 2021-02-09 16:47:44 -07:00
3472191af5 Remove ++ from VisualDSP dir, seems to be causing issues with make dist 2021-02-09 16:39:00 -07:00
f63f0ccb94 Merge pull request #3740 from SparkiDev/tls13_one_hrr_sh
TLS 1.3: Only allow one ServerHello and one HelloRetryRequest
2021-02-09 14:59:10 -08:00
ca3c5bf6c4 SP math lshb: check space for result 2021-02-10 08:58:58 +10:00
33bfee0f1a Merge pull request #3717 from kaleb-himes/OE11_ACVP
XSTRNCASECMP for OE11 ACVP (CMSIS RTOS)
2021-02-09 14:52:21 -08:00
9792e062c3 SP int: allow faster NCT exptmod to be compiled in
For small builds, this may be needed to get the right performance.
2021-02-10 08:51:32 +10:00
9a7aba265a Merge pull request #3716 from kaleb-himes/OE10_ACVP_OE13_ACVP_WPAA
OE10 and OE13 ACVP updates for armv8 PAA
2021-02-09 14:50:42 -08:00
73d7709724 Update comment about location for porting changes. 2021-02-09 15:39:12 -07:00
6d23728a56 Fusion RTOS porting round 3 2021-02-09 15:33:06 -07:00
250b59f8fd Merge pull request #3688 from julek-wolfssl/correct-cert-free
Use wolfSSL_X509_free to free ourCert
2021-02-09 12:41:12 -08:00
012841bba3 Merge pull request #3738 from embhorn/cmp_layer_high
Compatibility layer API
2021-02-09 08:33:41 -07:00
47d5f6f624 Merge pull request #3714 from SparkiDev/sp_int_rsavfy 2021-02-09 07:28:40 -08:00
71b495c422 Merge pull request #3712 from miyazakh/RND_bytes
handle size greater than RNG_MAX_BLOCK_LEN
2021-02-09 08:26:30 -07:00
5818923762 Merge pull request #3723 from douzzer/AesCcmEncrypt-zero-inSz-null-in
AES-CCM null payload buffers with inSz zero
2021-02-09 17:22:03 +10:00
bdd4ceb445 aes.c: fix overwide code text in wc_AesCcmEncrypt(). 2021-02-08 21:50:29 -06:00
4d70d3a3c4 TLS 1.3: Only allow one ServerHello and one HelloRetryRequest 2021-02-09 12:51:53 +10:00
539ef512fc SP int neg: fix handling of negative zero and mp_cond_copy
mp_cond_copy: copy sign when available.
Check for zero and ensure sign is MP_ZPOS.
2021-02-09 11:03:06 +10:00
a4e819c60a Added support for reading S/MIME messages via SMIME_read_PKCS7. 2021-02-08 17:14:37 -07:00
763f388471 SP int: get rsavfy and rsapub working again 2021-02-09 09:58:23 +10:00
0d499a28e5 Merge pull request #3725 from elms/build/fix_distcheck
build: fix `make distcheck`
2021-02-08 15:57:04 -08:00
3217c7afae Merge pull request #3732 from miyazakh/setverifydepth
issue callback when exceeding depth limit rather than error out
2021-02-09 09:51:45 +10:00
f14f1f37d2 Merge pull request #3673 from elms/ssl_api/get_verify_mode
SSL: add support for `SSL_get_verify_mode`
2021-02-08 15:40:19 -08:00
58f9b6ec01 Merge pull request #3676 from SparkiDev/tls13_blank_cert
TLS 1.3: ensure key for signature in CertificateVerify
2021-02-08 15:27:05 -08:00
7a583d5b4b aesccm_test(): test for (and require) BAD_FUNC_ARG when in or out pointer to wc_AesCcm{En,De}crypt() is null and inSz > 0. 2021-02-08 16:43:38 -06:00
b8a019dedd AES-CCM: allow null payload buffers in wc_AesCcmEncrypt() and wc_AesCcmDecrypt() when inSz is zero, and add to aesccm_test() a test for this, tolerating early BAD_FUNC_ARG (for FIPS and arch-specific 3rd party code), and a test for the zero-length string, that must succeed. 2021-02-08 16:34:09 -06:00
dda4c3b3c4 Merge pull request #3724 from embhorn/zd11646
Move var declaration to top
2021-02-08 11:09:28 -08:00
12eddee104 scripts: fix tests for out of tree distcheck
Copying or using certs from directory relative to scripts source directory.
2021-02-08 10:43:31 -08:00
6cff3f8488 Adding X509_LOOKUP_ctrl 2021-02-08 12:17:14 -06:00
47b9c5b054 Adding X509_STORE_CTX API 2021-02-08 08:25:14 -06:00
de47b9d88a Adding X509_VERIFY_PARAM API 2021-02-08 08:25:14 -06:00
812b44d58e guard check on prime with macro WOLFSSL_VALIDATE_ECC_IMPORT 2021-02-08 20:25:01 +07:00
36d124ed2f Merge pull request #3730 from guidovranken/zd11650
SP math: Better error propagation
2021-02-08 14:17:43 +10:00
c3cc36c55f SP int SP_WORD_SIZE=32: cast down explicitly 2021-02-08 13:20:12 +10:00
7986b37aa5 SP int: fixes for 8-bit digits
Fix mask type in mp_cond_copy to be at least 16 bits to handle 'used'
being larger than 8-bit but mp_digit being 8-bit.
When large numbers are used with 8-bit words, mul/sqr partial sums will
overflow a word. Fix implementations to handle this.
2021-02-08 12:24:28 +10:00
f13186827a issue callback when exceeding depth limit rather than error out 2021-02-08 11:01:45 +09:00
aefddaf2b8 SP int: mont_red - check size of a relative to m 2021-02-08 10:07:15 +10:00
cced2038b8 conditional compile and check on idx 2021-02-08 06:10:04 +07:00
358dbd5090 _sp_exptmod_base_2: Break out of loops on error 2021-02-08 00:09:29 +01:00
2933db8915 Merge pull request #3729 from guidovranken/zd11649
SHA 256,512: Only write hash if no error has occurred
2021-02-08 08:47:51 +10:00
ea4b3110e8 Merge pull request #3728 from dgarske/zd11624
Fix for PKCS11 not properly exporting the public key due to a missing key type field
2021-02-08 08:32:04 +10:00
bc707d67c3 SP math: Better error propagation
ZD 11650
2021-02-06 09:09:41 +01:00
3fd2647383 SHA 256,512: Only write hash if no error has occurred
ZD 11649
2021-02-06 08:15:30 +01:00
644636e0f8 only check prime value with custom curves 2021-02-06 05:46:19 +07:00
e26f1529c0 build: revert change so make generates testsuite.test
A change to `include.am` caused `make check` to generate, but `make`
without arguments to not generate it.`
2021-02-05 14:39:07 -08:00
c17597a4fb build: arbitrary path for make check
To support builds in other directories, unit.test and wolfcrypt test
must be aware of the source and build directory.
2021-02-05 12:10:32 -08:00
70b382e6cf Fix for PKCS11 not properly exporting the public key due to a missing key type field. This broke due to changes in PR #3687. Also resolved mismatch of enum types for the key type check. 2021-02-05 11:49:31 -08:00
c2be5dbe2b check prime is prime with ecc compressed keys 2021-02-06 01:54:25 +07:00
93ea355217 build: fix make distcheck
Need to check if `unit.test` was run from make process and set
different path to run unit test executable.

Writing files in the dist is not allowed during distcheck so write
files to subdirectory used build during distmake
2021-02-05 07:25:07 -08:00
e4d79bf49e Move var declaration to top 2021-02-05 08:41:42 -06:00
c4afce76f7 test.c: don't check key NULL when not small stack 2021-02-05 14:57:00 +10:00
4ade6eb802 XSTRNCASECMP for OE11 ACVP (CMSIS RTOS) 2021-02-03 16:03:20 -07:00
776964f7c7 OE10 and OE13 ACVP updates for armv8 PAA 2021-02-03 15:38:08 -07:00
431e1c8ffe handle size greater than RNG_MAX_BLOCK_LEN 2021-02-03 12:23:36 +09:00
714aa97490 Merge pull request #3710 from cconlon/0202
fix and update README.md markdown
2021-02-02 16:15:53 -08:00
72a8a1069a Fix to only set missing RNG if needed. Resolves unit test, which already sets the RNG on the private key and the incoming context is not provided (use local). 2021-02-02 14:16:21 -08:00
04e7fa3657 Fix for --enable-eccencrypt with timing resistance enabled. The ECC shared secret was missing the RNG. Fixes https://github.com/wolfSSL/wolfssl-examples/issues/243 2021-02-02 13:55:42 -08:00
7eb71b1bb1 Merge pull request #3344 from guidovranken/PKCS7_EncodeSigned-leak-fix
Check the right size before freeing flatSignedAttribs in PKCS7_EncodeSigned
2021-02-02 13:53:20 -07:00
f833d96ba3 Check the right size before freeing flatSignedAttribs in PKCS7_EncodeSigned 2021-02-02 10:15:00 -08:00
30c1c4a4f8 fix and update README.md markdown 2021-02-02 10:38:09 -07:00
542e0d79ec Jenkins Fixes
- explicit conversions
- not all curves available for wolfSSL_CTX_set1_groups_list
- group funcs depend on HAVE_ECC
- `InitSuites` after `ssl->suites` has been set
2021-02-02 12:06:11 +01:00
8a669615f8 Generate correct GCM tag 2021-02-02 12:06:11 +01:00
921fd34876 Detect version even if not compiled in 2021-02-02 12:06:11 +01:00
69dca4fd08 Rebase fixes
- wolfSSL_CTX_set1_groups_list and wolfSSL_set1_groups_list should use wolfSSL_CTX_set1_groups and wolfSSL_set1_groups respectively because it converts to correct groups representation
- Change to using "SHA1" as main name for SHA1
2021-02-02 12:06:11 +01:00
46821196ab Fix call to wolfSSL_connect when in wolfSSL_connect_TLSv13
If a client is:
- TLS 1.3 capable
- calls connect with wolfSSL_connect_TLSv13
- on an WOLFSSL object that allows downgrading
then the call to wolfSSL_connect should happen before changing state to HELLO_AGAIN. Otherwise wolfSSL_connect will assume that messages up to ServerHelloDone have been read (when in reality only ServerHello had been read).

Enable keying material for OpenVPN
2021-02-02 12:06:11 +01:00
ff43d39015 GCC complains about empty if 2021-02-02 12:06:11 +01:00
f5cf24dbdc SHA1 should not be called SHA. Leave alias for compatibility. 2021-02-02 12:06:11 +01:00
5d5d2e1f02 Check that curves in set_groups functions are valid 2021-02-02 12:06:11 +01:00
c18701ebe7 Implement RFC 5705: Keying Material Exporters for TLS 2021-02-02 12:06:11 +01:00
fdde2337a4 Add static buffer to wolfSSL_ERR_error_string
Add ED448 and ED25519 to wolfssl_object_info
Add more error messages
2021-02-02 12:06:11 +01:00
6ed45a23d9 Fix getting cipher suites in compat layer 2021-02-02 12:06:11 +01:00
294e46e21a Set options when creating SSL 2021-02-02 12:06:11 +01:00
3494218d98 Implement missing functionality for OpenVPN 2.5 2021-02-02 12:06:11 +01:00
5577a2215f Merge pull request #3708 from JacobBarthelmeh/Testing 2021-02-01 10:11:16 -08:00
ab5f9831ab Merge pull request #3707 from douzzer/test-openssl-small-stack
wolfcrypt/test/test.c: smallstack refactor of openssl test routines.
2021-02-01 09:30:04 -08:00
a7066a9be2 add stdint to test.c if using non blocking ecc test 2021-02-01 23:07:03 +07:00
fd01f79f86 add guard for rsa public only 2021-01-31 23:43:53 +07:00
d14f4f8451 wolfcrypt/test/test.c: smallstack refactor of openssl test routines. 2021-01-30 00:01:15 -06:00
f5f19fda42 Merge pull request #3704 from douzzer/aesgcm-table-small-stack
--enable-aesgcm=table --enable-smallstack
2021-01-29 19:53:08 -08:00
d0b20f90d5 wolfcrypt/test/test.c: use HEAP_HINT, not NULL, for XREALLOC() too. 2021-01-29 20:16:51 -06:00
8c0100e60e blake2b.c/blake2s.c: refactor so that smallstack code paths match performance of !smallstack path. 2021-01-29 17:19:42 -06:00
a332cf36b5 add DYNAMIC_TYPE_AES and DYNAMIC_TYPE_CMAC to enum in types.h, and use these where appropriate;
in test.c: use use HEAP_HINT, not NULL in XMALLOC/XFREE calls;

fix a couple typos in aes_test() re WOLFSSL_ASYNC_CRYPT;

add various missing WOLFSSL_SMALL_STACK_STATIC qualifiers;

and streamline old smallstack refactor on-stack declarations declarations to use the much neater [1] construct.
2021-01-29 17:17:31 -06:00
eae4124908 Merge pull request #3705 from lechner/repology-packaging-status
Show packaging status across Linux distributions in README.md
2021-01-29 14:48:26 -08:00
2033970369 Show packaging status across Linux distributions in README.md (from Repology)
Repology offers badges for wolfSSL's packaging status across all known
Linux distributions. [1] In Markdown documents, the HTML version with
a right-hand alignment uses up less space. It is added here.

The badge itself provides a hyperlink to more information [2]
including repositories in which wolfSSL is not yet represented.

[1] https://repology.org/project/wolfssl/badges
[2] https://repology.org/project/wolfssl/versions
2021-01-29 10:40:32 -08:00
0f6ae330da wolfcrypt: smallstack refactors of AES code for lkm compatibility with --enable-aesgcm=table. 2021-01-28 22:51:28 -06:00
91299c5abd Merge pull request #3701 from dgarske/pkcs7_devId
Fixes for PKCS7 with crypto callback (devId) with RSA and RNG
2021-01-29 10:56:41 +10:00
4f6deb8ae9 Merge pull request #3594 from haydenroche5/zd10911
Fix issue with DoHandShakeMsgType/ShrinkInputBuffer when encryption i…
2021-01-28 16:55:04 -08:00
fc845da9f0 Fix issue with DoHandShakeMsgType/ShrinkInputBuffer when encryption is on (e.g.
during renegotiation).

This issue was brought to light by ZD 10911. When encryption is on (indicated
by the return value of IsEncryptionOn), DoHandShakeMsgType will finish up by
incrementing the input buffer index past the padding and MAC (if encrypt-then-
mac is enabled). In ProcessReply, if there are more messages to be read, the
index is decremented back before the padding and MAC. The issue arises when
ShrinkInputBuffer is called in between and copies data from the dynamic input
buffer to the static one. That function will get called with the index post-
increment, and thus the padding and MAC won't get copied into the static buffer,
which isn't what we want, since ProcessReply is going to decrement the index
since it thinks the padding and MAC are still there. This commit makes it so
the padding and MAC get included in the call to ShrinkInputBuffer when
encryption is on.
2021-01-28 15:37:00 -06:00
3da6b8364e Prevent dangling pointer in TLSX_Cookie_Use
ZD 11603
2021-01-28 18:53:35 +01:00
2bd63d27bf Fixes for PKCS7 with crypto callback (deviceId), where it was not being used for RSA and RNG. ZD 11163. 2021-01-28 09:52:13 -08:00
311a0d25dd Merge pull request #3696 from JacobBarthelmeh/Testing
fix for tested x509 small build
2021-01-28 06:59:26 -08:00
590597a0e2 SP ECC verify: check point for z=0 and set to infinity 2021-01-28 14:43:51 +10:00
0ccb0d5fce SP math: fix one word Montgomery Reduction for non-asm
Set the word size for x86.
2021-01-28 09:54:58 +10:00
bbcb98a8f7 fix for tested x509 small build 2021-01-27 23:00:24 +07:00
7486cad291 Curve448 PPC64: 'char' is not always signed - use type 'sword8'
Ensure type 'sword8' is signed.
2021-01-27 18:16:25 +10:00
c739b4d474 ECDSA sign: cleanup comments and variables
Remove mod at end as mulmod does this.
Change mp_add to mp_addmod_ct to keep the size of numbers to less than
order for mp_mulmod.
2021-01-27 09:39:11 +10:00
a1e083b5b1 Merge pull request #3689 from douzzer/fips-option-check-source
configure.ac: check compatibility of chosen FIPS option with source
2021-01-26 12:29:52 -08:00
d0e2566ad8 Merge pull request #3679 from julek-wolfssl/dtls-window
Correct old DTLS msg rcv update
2021-01-26 12:20:59 -08:00
3d4f836c00 Correctly insert out of order msgs to queue 2021-01-26 15:12:08 +01:00
4da9ade290 Use wolfSSL_X509_free to free ourCert 2021-01-26 11:32:05 +01:00
a89087ed2d configure.ac: check compatibility of chosen FIPS option with the source tree, for early prevention of accidental attempts to build FIPS with non-FIPS source, or non-FIPS with FIPS source. 2021-01-25 17:56:28 -06:00
6e0e507dad Merge pull request #3660 from dgarske/sess_ticket_aes_gcm
Added support for AES GCM session ticket encryption
2021-01-25 15:00:03 -08:00
f91dcb950c Merge pull request #3670 from dgarske/keil
Fix for ARM Keil MDK compiler issue with `DECLARE_VAR_INIT`.
2021-01-25 14:57:05 -08:00
27ef5b9a3d Merge pull request #3675 from SparkiDev/tls_no_ticket
TLS Session Ticket: Option to disable for TLS 1.2 and below
2021-01-25 14:54:10 -08:00
f35f57c378 Merge pull request #3683 from SparkiDev/sp_int_mont_red_1
SP math all: fix 1 word Montgomery Reduce
2021-01-25 14:47:35 -08:00
d201820e3a Merge pull request #3687 from guidovranken/x963-export-reject-invalid-keys
Reject undefined keys (eg. state is ECC_STATE_NONE) from X963 export …
2021-01-25 14:46:59 -08:00
cf9e4f0caf Merge pull request #3518 from julek-wolfssl/openssh-fixes-v2
Fixes for openssh
2021-01-25 14:45:56 -08:00
234bf0c209 SSL: add const for *get_verify_mode to match openSSL 2021-01-25 10:37:50 -08:00
a2917ae29c SSL: cleanup verify_mode coding style 2021-01-25 10:29:36 -08:00
05e1ee1694 Cleanup to use fixed sizes from defines for DECLARE_VAR. Resolves issue with Visual Studio and using a variable (even const) to declare an array size. 2021-01-25 09:14:12 -08:00
29f7eebef7 Reject undefined keys (eg. state is ECC_STATE_NONE) from X963 export functions
Additionally, harmonize the failure conditions of wc_ecc_export_x963 and
wc_ecc_export_x963_compressed.
2021-01-25 16:22:21 +01:00
f7408560c6 Fix Free/SafeRTOS with XMALLOC_USER 2021-01-25 09:10:15 -06:00
4f0ed55232 SP math all: fix 1 word Montgomery Reduce
May have 3 words in partial result before shifting down.
2021-01-25 10:19:27 +10:00
fb9836ed28 Merge pull request #3678 from guidovranken/zd11556
Fix wc_ecc_sign_hash memory leak. ZD 11556.
2021-01-22 18:06:56 -08:00
d29518ecac Remove duplicate macro 2021-01-22 13:02:30 -08:00
21ac86adb3 SSL: refactor SSL verify mode to be more compatible
This follows the bit flag pattern closer. Still doesn't support
`SSL_VERIFY_CLIENT_ONCE` and maybe other flags.
2021-01-22 12:17:07 -08:00
13468d34e3 Apply same VS fixes to api.c as well. 2021-01-22 10:50:18 -08:00
46aee19de3 Fix for Visual Studio issue with non-cost in array declaration. 2021-01-22 10:44:38 -08:00
920c443864 Merge pull request #3250 from JacobBarthelmeh/Benchmark
add brainpool benchmark
2021-01-22 10:08:21 -08:00
cd4dae8f09 Merge pull request #3674 from ejohnstown/alerts
Alerts
2021-01-22 09:16:56 -08:00
b918fb9efe Correct old DTLS msg rcv update 2021-01-22 14:33:33 +01:00
6fa1556daf guard -ecc-all with HAVE_SELFTEST macro 2021-01-22 16:13:31 +07:00
905f0b1f5a Fix wc_ecc_sign_hash memory leak. ZD 11556. 2021-01-22 09:55:30 +01:00
a84f1c813a TLS Session Ticket: Option to disable for TLS 1.2 and below
Customer may want session ticket supported with TLS 1.3 but not TLS 1.2
and below.
2021-01-22 13:19:29 +10:00
9c34ecc130 ECDSA: don't modify the e mp_int (hash) value
Multiple loops of generating signatures require the same e value.
2021-01-22 12:51:21 +10:00
fad1e67677 TLS 1.3: ensure key for signature in CertificateVerify 2021-01-22 11:54:53 +10:00
9012317f5b Fix copy/paste typo. 2021-01-21 17:41:11 -08:00
1ee40ad7bd Fix to always init the variable (not just when from heap). Cleanup of the DECLARE_ uses to make sure all allocations succeeded. 2021-01-21 17:12:29 -08:00
6f21995ec5 Alerts
Expand the guard around sending the PSK identity alert with a more limited option than enabling it with all the other alerts.
2021-01-21 16:42:54 -08:00
4b47bf7b4e Merge pull request #3090 from lechner/utf8
Convert a header file to UTF-8 encoding.
2021-01-21 16:32:27 -08:00
2017de1b0f Merge pull request #3617 from haydenroche5/cmake_user_settings
Add support for user settings to CMake.
2021-01-21 16:21:55 -08:00
07f459b8d7 Merge pull request #3650 from kojo1/RsaSetRNG
add wc_RsaSetRNG to doc
2021-01-21 16:21:00 -08:00
830b3cb676 Merge pull request #3653 from kojo1/fopen_binMode
binary mode, fopen
2021-01-21 16:20:07 -08:00
aa64a8e835 Merge pull request #3672 from embhorn/zd11547
Fix FIPS compile errors
2021-01-21 16:08:53 -08:00
95d83c9856 SSL: refactor to allow session override or mode 2021-01-21 16:03:02 -08:00
1acd6dfab2 Merge pull request #3635 from SparkiDev/hmac_openssl_fix
HMAC OpenSSL API: initialise HMAC ctx on new and allow key length of 0
2021-01-21 15:57:30 -08:00
a8cfc23683 Merge pull request #3642 from SparkiDev/ecdsa_set_k_one_loop
ECDSA set k: WOLFSSL_ECDSA_SET_K_ONE_LOOP only tries k and fails when…
2021-01-21 15:56:36 -08:00
5837d5e8de Merge pull request #3649 from dgarske/stm_aesgcm_perf
STM32 AES GCM crypto hardware performance improvements
2021-01-21 15:55:58 -08:00
85f08466f9 Merge pull request #3655 from SparkiDev/ext_cache_sess
SESSION: internal cache sessions can't be freed same as external
2021-01-21 15:54:16 -08:00
e9e96dff6a Merge pull request #3662 from embhorn/gh3659
Check method for NULL
2021-01-21 15:50:58 -08:00
7b12dddf75 Merge pull request #3666 from SparkiDev/tls13_tick_before_group
TLS 1.3: don't group and wait on send session ticket
2021-01-21 15:49:52 -08:00
22e6d52b7b Merge pull request #3667 from SparkiDev/sp_fixes_4
SP int: fix _sp_mul_d inclusion checks
2021-01-21 15:49:03 -08:00
b825e51d23 Merge pull request #3664 from SparkiDev/sp_math_all_ppc64
SP math all: Fixes for PPC64 compiler
2021-01-21 15:48:34 -08:00
848ae3e514 Merge pull request #3668 from SparkiDev/jenkins_fixes_2
Compress: fix unused vars
2021-01-21 15:46:30 -08:00
344ad2a3f8 Merge pull request #3625 from SparkiDev/disable_alg_fix
Disable algs: fix code to compile with various algs off/on
2021-01-21 15:45:29 -08:00
fe7be3e15f Alerts
Alerts the server sends between receiving the client's CCS message and before it sends its own CCS message should not be encrypted.
2021-01-21 14:48:10 -08:00
7112a6dd78 SSL: add test and fix SSL_get_verify_mode 2021-01-21 14:20:27 -08:00
fbe5fe1945 Merge pull request #3669 from embhorn/gh3657
Protect use of globalRNG
2021-01-21 14:09:59 -08:00
af3d842663 SSL: add support for SSL_get_verify_mode 2021-01-21 13:45:20 -08:00
3e4c3d13fe Merge pull request #3671 from julek-wolfssl/dtls-scr-2
DTLS secure renegotiation fixes
2021-01-21 13:37:05 -08:00
fd8527c15e Fix FIPS compile errors 2021-01-21 15:27:42 -06:00
b418936f72 account for FIPS and g++ builds 2021-01-22 04:21:23 +07:00
177f4aecb6 add all curves to benchmark 2021-01-22 03:20:41 +07:00
e3fa462d72 add brainpool benchmark of key generation 2021-01-22 02:55:26 +07:00
fe37137f12 add brainpool benchmark 2021-01-22 02:44:11 +07:00
d8a01c6f8b DTLS: client re-send on duplicate HelloRequest as well 2021-01-21 12:45:16 +01:00
969de38764 Reset dtls_start_timeout on a timeout 2021-01-21 12:45:16 +01:00
774fdc9fd6 Free HS data on rehandshake
When we call _Rehandshake before we receive application data and the receive application data during the renegotiation process then it is possible for the send queue to be preemptively deleted
2021-01-21 12:45:16 +01:00
17f101ef13 Fix for ARM Keil MDK compiler issue with DECLARE_VAR_INIT. 2021-01-20 16:57:30 -08:00
02114e7739 Protect use of globalRNG 2021-01-20 16:30:18 -06:00
a3cbcf255f Fix from review 2021-01-20 11:34:02 -06:00
57b06f700d Merge pull request #3656 from haydenroche5/windows_rsa_public_decrypt
Allow wolfSSL_RSA_public_decrypt on Windows.
2021-01-20 09:09:49 -08:00
12abb5191d Allow wolfSSL_RSA_public_decrypt on Windows. 2021-01-20 06:57:59 -06:00
55be60a63e Compress: fix unused vars
configure: C_EXTRA_FLAGS="-fdebug-types-section -g1" --disable-memory
--enable-mcapi --enable-ecc --enable-sha512 --with-libz
2021-01-20 13:09:43 +10:00
e3182ff06e SP int: fix _sp_mul_d inclusion checks
configuration: --disable-asn --disable-filesystem --disable-shared --enable-cryptonly --enable-sp=smallrsa2048 --enable-sp-math --disable-dh --disable-ecc --disable-sha224 --enable-rsavfy --enable-rsapss
2021-01-20 12:38:10 +10:00
7ec8d70eee TLS 1.3: don't group and wait on send session ticket
The state machine goes on and frees the handshake resources which frees
the digest for the client Finished message.
2021-01-20 10:57:37 +10:00
9044f709c1 Add support for STM32_AESGCM_PARTIAL build option to speedup platforms that allow AAD header sizes that are not a multiple of 4 bytes. ZD 11364. 2021-01-19 13:54:53 -08:00
ea5af87de3 Revert of uint32_t and uint8_t changes in PR #3658, which caused warnings. 2021-01-19 13:54:26 -08:00
9ea5041d9d Benchmark for GMAC (AES GCM GHASH). 2021-01-19 13:42:25 -08:00
eaa1bc1ace Merge pull request #3595 from julek-wolfssl/dtls-only-resend-on-timeout
Only resend previous flight on a timeout from the network layer
2021-01-19 10:43:13 -08:00
59305e9346 Fix for new include to pull in the AES GCM IV sizes in FIPS mode. 2021-01-19 07:53:36 -08:00
8d1d616b39 Cleanup for the AES GCM IV and CCM IV sizes, which are missing with some FIPS builds. 2021-01-19 07:53:36 -08:00
219cbd47eb Added support for AES GCM session ticket encryption. If ChaCha/Poly is disabled it will use AES GCM. Thanks Sean for the code in ZD 11511. 2021-01-19 07:53:36 -08:00
523119289b SP math all: Fixes for PPC64 compiler 2021-01-19 21:30:36 +10:00
209c4c08e1 Merge pull request #3663 from SparkiDev/sp_int_fixes_3
SP int: make sp_copy more available
2021-01-18 22:02:34 -08:00
7d869a43b4 ECDSA set k: WOLFSSL_ECDSA_SET_K_ONE_LOOP only tries k and fails when it fails 2021-01-19 14:07:03 +10:00
949af909bf SP int: make sp_copy more available 2021-01-19 11:01:00 +10:00
6a5e802cc4 Disable algs: fix code to compile with various algs off/on
benchmark.c: Only X25519/Ed25519/X448/Ed448 now compiles
asn.c/asn.h: Only DSA now compiles
2021-01-19 09:54:21 +10:00
a13e9bde29 Merge pull request #3599 from julek-wolfssl/nginx-mem-leak
Fix memory leaks
2021-01-18 15:31:50 -08:00
5b7e6ccc14 Merge pull request #3613 from SparkiDev/sp_rand_prime_len
SP rand_prime: fix length check
2021-01-18 15:23:15 -08:00
279c3f4c1b Merge pull request #3614 from SparkiDev/aes_test_fix
AES test: Remove unneeded loop
2021-01-18 15:22:06 -08:00
78d2b3b440 Merge pull request #3616 from SparkiDev/sp_int_funcs
SP int: Hide func decls if only available with WOLFSSL_SP_MATH_ALL
2021-01-18 15:21:39 -08:00
267b00e0a2 Merge pull request #3620 from haydenroche5/zd11434
Clamp the normalization value at the end of sp_mont_norm.
2021-01-18 15:21:03 -08:00
85faf974aa Merge pull request #3621 from SparkiDev/sp_mac_arm64
SP arm64 MAC: stop non-ct mod inv from using x29
2021-01-18 15:19:46 -08:00
87a0ee5ef4 Merge pull request #3622 from SparkiDev/sp_int_fixes_2
SP math all: doco fix and don't assign 0 to o
2021-01-18 15:19:06 -08:00
4b5d7d0595 Merge pull request #3624 from SparkiDev/tls13_set_groups
TLS 1.3 key share: add a key share from supported list
2021-01-18 15:18:14 -08:00
8ae609d078 Merge pull request #3626 from SparkiDev/tls13_middlebox_fix
TLS send change cipher: Don't set keys when negotiating TLS 1.3
2021-01-18 15:14:58 -08:00
1e9394d5a8 Merge pull request #3627 from elms/EVP/ofb_rc4_size
EVP: return proper cipher type and block size
2021-01-18 15:13:55 -08:00
50843b22cd Check method for NULL 2021-01-18 16:18:49 -06:00
563e3c6b60 Merge pull request #3628 from SparkiDev/even_mp_test
RSA/DH test: even number error check fixup
2021-01-18 13:39:54 -08:00
cd78a5dfb2 Merge pull request #3630 from SparkiDev/no_fs_all
X509 API no file system: hide wolfSSL_X509_NAME_print_ex_fp
2021-01-18 13:39:21 -08:00
d514cc31b3 Merge pull request #3631 from SparkiDev/rsa_vfy_only_sp_fixes
RSA: verify only build fixes
2021-01-18 13:38:52 -08:00
5a7e79cbfd Merge pull request #3632 from SparkiDev/all_not_tls13_fix
Configuration: enable all, disable TLS 1.3 - turn off TLS 1.3 only op…
2021-01-18 13:37:34 -08:00
3bae6e2dc2 Merge pull request #3633 from SparkiDev/ecc_gen_z_fix
ECC gen z: convert blinding value to Montgomery form before using
2021-01-18 13:36:13 -08:00
fff3c77568 Merge pull request #3644 from dgarske/zd11476
Fix for sniffer with TLS v1.2 static ECDH ciphers
2021-01-18 13:32:57 -08:00
b1c8825e74 Merge pull request #3647 from dgarske/zd11424
Fix for TLS v1.3 early data mac digest
2021-01-18 13:31:44 -08:00
67d4f7c37b Merge pull request #3658 from SparkiDev/curve25519_uint64_t
Curve25519: replace uint64_t with word64
2021-01-18 13:29:16 -08:00
ac76ef8ee7 Curve25519: replace uint64_t with word64
Remove usages of stdint.h types
Added a sword type for signed words.
2021-01-18 17:30:36 +10:00
eda1b52ee2 TLS 1.3 integrity only: initialize HMAC
Ensure the HMAC object is initialized when allocated.
2021-01-15 11:27:26 +10:00
878f797a2b SESSION: internal cache sessions can't be freed same as external
refMutex is initialized for external sessions but not internal.
Differentiate by ensuring the refCount is always 1 or more for external
and 0 for internal.
2021-01-15 11:02:34 +10:00
0ac43bb095 Merge pull request #3618 from haydenroche5/ocsp_self_signed_issue
Modify ParseCertRelative to ensure issuerKeyHash gets parsed and copi…
2021-01-14 14:22:06 -08:00
d72f0a50f4 binary mode fopen to avoid auto expand to CR/LF on Widonws 2021-01-15 06:05:55 +09:00
e21fddf553 add wc_RsaSetRNG to doc 2021-01-14 10:42:49 +09:00
5a4dfc1a29 Don't set encrypt side if sending early data
Make check to see if early data has been or is going to be sent.
Last message encrypted with this key is EndOfEarlyData message.
2021-01-14 09:44:09 +10:00
22ce25afba Merge pull request #3648 from douzzer/disable-ecc-enable-dsa
--disable-ecc --enable-dsa
2021-01-13 14:00:20 -08:00
1e49bc2e82 asn.c/asn.h: fix --disable-ecc --enable-dsa. 2021-01-13 13:55:06 -06:00
d7aa8e1795 Fix for issue where mac digest changes between early data and server_hello, which can leave section of response uninitialized. ZD11424 2021-01-13 11:10:12 -08:00
382deb1f86 Merge pull request #3645 from douzzer/sp_copy_pedantic_error_handling
sp_copy() pedantic error handling
2021-01-13 10:05:35 +10:00
f8013580df sp_int.c: fix 4 instances of "Value stored to 'o' is never read" found by LLVM9 scan-build. 2021-01-12 15:01:28 -06:00
fb82114866 sp_int.c: pay attention to the return value from sp_copy(), for general hygiene and to eliminate an inlining-related warning in sp_todecimal(). 2021-01-12 14:58:29 -06:00
aaec9832e4 Fix for sniffer with TLS v1.2 static ECDH ciphers. The sniffer will now correctly try using the key for ECC if the RSA key decode fails. ZD 11476. 2021-01-12 09:49:32 -08:00
129f3fd13f HMAC OpenSSL API: initialise HMAC ctx on new and allow key length of 0 2021-01-12 09:16:24 +10:00
8fec1de07c EVP: address CTR block size 2021-01-11 12:03:01 -08:00
3b07f5d8e3 EVP: expand tests for EVP_CIPHER_block_size 2021-01-11 12:03:01 -08:00
a6535528f3 EVP: add tests for openssl block size (including RC4) 2021-01-11 12:03:01 -08:00
0cccf58fec EVP: return proper cipher type for AES OFB 2021-01-11 12:03:01 -08:00
88faef9bd9 Merge pull request #3641 from JacobBarthelmeh/Testing
add ca-cert-chain.der to renewcerts.sh, update ed25519 certs and gen …
2021-01-11 11:00:55 -08:00
e2b411805d add ca-cert-chain.der to renewcerts.sh, update ed25519 certs and gen script 2021-01-12 00:40:15 +07:00
a3cc4110b0 Clamp the normalization value at the end of sp_mont_norm. 2021-01-11 09:59:11 -06:00
798d9ed0d5 Various CMake changes.
- Add support for user settings to CMake.
- Update version number.
- Add an option to enable/disable generation of config.h and the HAVE_CONFIG_H
  define.
2021-01-08 12:15:58 -06:00
a745947498 Code review changes 2021-01-08 15:27:30 +01:00
23a4d64caf wolfSSL_EVP_PKEY_set1_EC_KEY should generate PKCS8 internal DER buffer
This PKCS8 buffer should include both the private and the public parts of the key.
2021-01-08 15:27:30 +01:00
cd4affddac Set ecc_key.rng when using ECC_TIMING_RESISTANT
Set ecc_key.rng to either a local rng struct or the globalRNG object when using ECC_TIMING_RESISTANT
Add helpful logs to some ecc functions
2021-01-08 15:18:00 +01:00
0fe3efb8b4 Add option to only resend previous DTLS flight on a network read timeout 2021-01-07 19:13:35 +01:00
c57fee136a Merge pull request #3568 from miyazakh/espidf_unittest
fix wolfssl unit test on ESP-IDF
2021-01-07 09:18:18 -07:00
f955c92008 ECC gen z: convert blinding value to Montgomery form before using 2021-01-07 11:30:58 +10:00
209ad82df2 Merge pull request #3629 from ejohnstown/aarch64
M1 Support
2021-01-06 14:12:45 -08:00
931dc5b29f Merge pull request #3619 from tmael/fuzz_math
Fix for OSS-Fuzz issue #29103: out-of-bounds read in TLSX_CSR_Parse()
2021-01-06 14:10:28 -08:00
d4e13796c2 M1 Support
We separate out 64-bit desktop support based on the Intel check. With
the advent of the new Apple chip, ARM can also be a desktop processor.
Detect it like we do the Intel 64-bit, and treat it similarly with
respect to fast and normal math.
2021-01-06 09:21:07 -08:00
fa86c1aa91 Configuration: enable all, disable TLS 1.3 - turn off TLS 1.3 only options
configuration: --enable-all --disable-tls13
Post-handshake authentication and HRR cookie are enable with
'--enable-all' but disabling TLS 1.3 caused configure to fail.
Don't enable these TLS 1.3 only options when TLS 1.3 is disabled.

Also fix up tests that don't work without TLS 1.3 enabled.
2021-01-06 14:19:57 +10:00
cd0670cbd7 RSA: verify only build fixes
configuration: --disable-ecc --disable-dh --disable-aes --disable-aesgcm
--disable-sha512 --disable-sha384 --disable-sha --disable-poly1305
--disable-chacha --disable-md5 --disable-sha3 --enable-cryptonly
--disable-inline --enable-rsavfy --disable-asn --disable-oaep
--disable-rng --disable-filesystem --enable-sp=rsa2048 --enable-sp-math
Fixes to make code build again.
2021-01-06 11:58:15 +10:00
5accd57c21 X509 API no file system: hide wolfSSL_X509_NAME_print_ex_fp
configuration: --enable-all --disable-filesystem
wolfSSL_X509_NAME_print_ex_fp has XFILE as a parameter and cannot be
compiled with --disable-filesystem
2021-01-06 11:05:58 +10:00
10722fba14 RSA/DH test: even number error check fixup
Configuration: --enable-sp=3072
Test only enabled when SP is used.
Return codes checked are those we expect from SP.
Code, with configuration, is compiled so that 2048-bit operations are
not going to SP and the error returns were not correct.
2021-01-06 09:39:24 +10:00
b8997d0b47 revert test_wolfssl.c changes
add test.c as src target
2021-01-05 16:20:42 +09:00
99d4a7417a fix wolfssl unit test on ESP-IDF 2021-01-05 16:08:05 +09:00
a6b69b6864 TLS send change cipher: Don't set keys when negotiating TLS 1.3 2021-01-05 14:32:48 +10:00
f196c60c66 TLS 1.3 key share: add a key share from supported list 2021-01-05 13:08:48 +10:00
1b94309a6c SP math all: doco fix and don't assign 0 to o
o is not used after that point so no need to zero it.
2021-01-05 10:40:34 +10:00
2a2b194d71 SP arm64 MAC: non-ct mod inv not use so many registers 2021-01-05 10:23:14 +10:00
46e260dd61 Correct unsigned arithmetic 2021-01-04 15:48:27 -08:00
54f072fd8d Merge pull request #3607 from douzzer/WOLFSSL_TEST_SUBROUTINE
test.c: add WOLFSSL_TEST_SUBROUTINE macro to make subtests optionally static
2021-01-04 10:10:56 -07:00
96ece3ac7d Modify ParseCertRelative to ensure issuerKeyHash gets parsed and copied into the
decoded cert for self-signed CA certs.

The bit of code that does this copy was previously inside a conditional that's
only entered if the certificate is not self-signed. The primary purpose of this
conditional is to set the maxPathLen field. It's possible that the copying of
the issuerKeyHash was mistakenly included in the "else" block here, when it
should be outside.
2021-01-04 10:34:09 -06:00
b5403fe6b9 SP int: Hide func decls if only available with WOLFSSL_SP_MATH_ALL 2021-01-04 16:39:51 +10:00
413bde9146 Merge pull request #3608 from tmael/sp_squre
Fix SP integer square
2021-01-04 16:29:40 +10:00
faf7d307b4 Merge pull request #3606 from dgarske/zd11438
Fix for possible ECC sign memory leak with custom "k"
2021-01-04 15:39:53 +10:00
01c27068c1 Correct SP x->used with sp_clamp() 2021-01-03 20:08:06 -08:00
68c2e36ad5 AES test: Remove unneeded loop 2021-01-04 12:43:34 +10:00
40ab08be45 SP rand_prime: fix length check
-ve length indicates to use a BBS prime (last two bits set)
2021-01-04 12:31:59 +10:00
ef56bc09f1 Merge pull request #3596 from julek-wolfssl/dtls-multiple-hellorequest
Calling wolfSSL_Rehandshake during renegotiation should not be an error
2020-12-31 13:53:32 -08:00
fbb3e9fca3 Merge pull request #3605 from tmael/cm_free
Free mutex and fix tls13.test script
2020-12-31 08:40:35 -08:00
c9ac64d77d Merge pull request #3609 from douzzer/lkm_kvmalloc
use kvmalloc()/kvfree() for heap allocations in the linuxkm build
2020-12-31 08:37:53 -08:00
9dc8721032 linuxkm: on kernels >= 4.12, use kvmalloc()/kvfree() and a partial implementation of realloc() leveraging them, rather than kmalloc()/kfree()/krealloc(). this makes large allocations possible and relatively safe. note that the realloc() implementation fails gracefully when the supplied pointer is larger than the page size, but otherwise works normally. 2020-12-31 00:30:35 -06:00
a2dec7ce9c test.c: work around toolchain/ecosystem bug on aarch64 linux 4.14.0-xilinx-v2018.3. 2020-12-30 20:03:13 -06:00
9598c03716 Free mutex and fix test script 2020-12-30 17:40:15 -08:00
3d88676ff1 test.c: add WOLFSSL_TEST_SUBROUTINE macro to qualify all previously global subtest handlers, defaulting to the empty string. this restores the version<=4.5 test.c namespace allowing end users to call the tests directly piecemeal. --enable-linuxkm[-defaults] sets -DWOLFSSL_TEST_SUBROUTINE=static for extra namespace hygiene. 2020-12-30 16:12:08 -06:00
060ebd1ca2 Fix for possible ECC sign memory leak when using WOLFSSL_ECDSA_SET_K and wc_ecc_sign_set_k, where the k is not valid. ZD 11438. 2020-12-30 09:54:54 -08:00
7fb2c0f63f Merge pull request #3603 from haydenroche5/zd11434
Ensure that all leading zeros are skipped in sp_tohex.
2020-12-30 08:28:52 -08:00
1b6a988dc0 Merge pull request #3601 from tmael/mp_rand_p
Add parameter check in sp_rand_prime()
2020-12-30 08:20:18 -08:00
81f70fba5f Ensure that all leading zeros are skipped in sp_tohex. 2020-12-30 08:32:01 -06:00
d366ca74af Review comments and cast 2020-12-29 19:48:45 -08:00
c482d16029 Merge pull request #3544 from haydenroche5/ocsp_stapling_bug
Fix bug where OCSP stapling wasn't happening even when requested by client
2020-12-29 14:23:10 -08:00
da007ecd7b Merge pull request #3409 from kojo1/mqx
add IDE/MQX
2020-12-29 13:53:37 -07:00
c6abb59343 Merge pull request #3593 from tmael/sp_cast
casting fix for clang-12
2020-12-29 09:51:37 -08:00
837e9856f5 Merge pull request #3590 from dgarske/stcube_rel
Fixes for STM Cube Pack rename
2020-12-29 09:37:39 -08:00
dc21d56545 Merge pull request #3600 from douzzer/low-resources-fixes
--enable-lowresource --enable-sp-math-all
2020-12-29 08:01:51 -08:00
2bd0d4c467 wolfcrypt/src/evp.c: fix wolfSSL_EVP_CipherUpdate_GCM() to not fail when inl is zero, to properly handle realloc implementations that return NULL for zero-size allocations. 2020-12-28 23:49:48 -06:00
fbcfc6adbf test.c: rehab fail codes in ecc_test_curve_size(). 2020-12-28 21:56:39 -06:00
b0ca598d59 sp_int.h and ecc.h: add one more to SP_INT_DIGITS and FP_SIZE_ECC, to accommodate extra digit used by sp_mul(), sp_mulmod(), sp_sqr(), and sp_sqrmod(). 2020-12-28 18:06:18 -06:00
cedec3ae28 Add parameter check 2020-12-28 15:53:56 -08:00
764b3cf09d examples/client/client.c: add missing !defined(NO_SESSION_CACHE) gate around wolfSSL_get_session() for "print out session" code. 2020-12-28 17:49:58 -06:00
8c07aafc43 Fix memory leaks
- Freeing the session object depends on the callback return
- The session object is malloc'ed when ssl->options.internalCacheOff
- wolfSSL_CTX_use_certificate needs to own the cert when KEEP_OUR_CERT because either it is up ref'ed or copied
2020-12-28 22:33:01 +01:00
54479359f3 Calling wolfSSL_Rehandshake during renegotiation should not be an error
If we call wolfSSL_Rehandshake during a renegotiation then it should not result in a SECURE_RENEGOTIATION_E. wolfSSL_Rehandshake might be called when multiple HelloRequest messages are processed or the user could call this API during renegotiation. Either way wolfSSL should not treat this as an error if renegotiation is enabled.
2020-12-24 12:10:04 +01:00
8b517975d1 Fixes from peer review. 2020-12-23 16:54:29 -08:00
4280861af0 Merge pull request #3591 from dgarske/wolftpm
Added helper configure option '--enable-wolftpm`
2020-12-23 12:22:44 -08:00
5c4011b3b4 cast to int 2020-12-23 12:09:35 -08:00
b2155e6e26 Merge pull request #3592 from douzzer/verbose-heap-instrumentation
--enable-trackmemory=verbose
2020-12-23 11:40:45 -08:00
d5dd35c739 add --enable-trackmemory=verbose, and add WOLFSSL_TEST_MAX_RELATIVE_HEAP_{BYTES,ALLOCS} and -m/-a (runtime counterparts) to wolfcrypt_test(). also add -h to wolfcrypt_test() to print available options. 2020-12-23 12:03:06 -06:00
daa6833f37 Added helper configure option '--enable-wolftpm` to enable options used by wolfTPM. This enables (cert gen/req/ext, pkcs7, cryptocb and aes-cfb). 2020-12-23 08:09:24 -08:00
e0f36baebe Fixes for STM Cube Pack rename. 2020-12-23 07:02:12 -08:00
542ad0a81b linuxkm/module_hooks.c: separate cleanup into static libwolfssl_cleanup(), and call it from wolfssl_init() if wolfcrypt_test() fails. 2020-12-22 21:57:17 -06:00
e6c71a1465 Merge branch 'master' into mqx 2020-12-21 07:28:26 -08:00
c47b98bca1 Allow OCSP stapling and NO_WOLFSSL_CLIENT to coexist. 2020-12-15 16:56:21 -06:00
eb6473b00f Fix bugs that made it so client side wasn't verifying certificate status. 2020-12-15 16:56:21 -06:00
801aa18b9e Fix bug where OCSP stapling wasn't happening even when requested by client.
The OCSP request that we created didn't have a URL for the OCSP responder, so
the server couldn't reach out to the responder for its cert status.
2020-12-15 16:56:21 -06:00
203b7739c9 fix paths, add download site in README 2020-12-13 19:42:20 +09:00
d3aacf4934 add IDE/MQX 2020-12-13 17:41:14 +09:00
6154f29a31 Merge https://github.com/wolfssl/wolfssl 2020-12-13 17:27:53 +09:00
1d2eb44bfb Merge https://github.com/wolfssl/wolfssl 2020-11-11 08:34:03 +09:00
22816b53de set tag for zero len case 2020-10-30 16:13:37 +09:00
24e10bf4ab Convert a header file to UTF-8 encoding.
The file contained characters from the ISO 8859-1 legacy text
encoding. This commit onverts the file to UTF-8.
2020-06-30 11:14:52 -07:00
1312 changed files with 612636 additions and 115513 deletions

28
.github/workflows/macos-check.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: macOS Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: brew
run: brew install automake libtool
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

26
.github/workflows/ubuntu-check.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Ubuntu Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

38
.github/workflows/windows-check.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Windows Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: wolfssl64.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

47
.gitignore vendored
View File

@ -27,6 +27,7 @@ rpm/spec
stamp-h
cyassl/options.h
wolfssl/options.h
.build_params
libtool.m4
aclocal.m4
aminclude.am
@ -207,14 +208,6 @@ TAGS
support/cyassl.pc
support/wolfssl.pc
cyassl/ctaocrypt/stamp-h1
swig/_cyassl.so
swig/_wolfssl.so
swig/cyassl.py
swig/wolfssl.py
swig/cyassl.pyc
swig/wolfssl.pyc
swig/cyassl_wrap.c
swig/wolfssl_wrap.c
stamp-h1
clang_output_*
internal.plist
@ -230,6 +223,7 @@ IDE/MDK-ARM/LPC43xx/LPC43xx/
*.gcno
*.gcda
*.gcov
*.dgcov
!linuxkm/Makefile
/Kbuild
linuxkm/*.ko
@ -239,9 +233,14 @@ linuxkm/modules.order
linuxkm/wolfcrypt
linuxkm/libwolfssl.mod
linuxkm/libwolfssl.mod.c
linuxkm/libwolfssl.lds
linuxkm/module_exports.c
linuxkm/linuxkm/get_thread_size
# autotools generated
scripts/unit.test
wolfcrypt/test/test_paths.h
# MPLAB Generated Files (OS X)
mcapi/wolfcrypt_mcapi.X/nbproject/Makefile-*
mcapi/wolfcrypt_mcapi.X/nbproject/Package-default.bash
@ -322,6 +321,10 @@ IDE/HEXIWEAR/wolfSSL_HW/Debug
# Linux-SGX
IDE/LINUX-SGX/*.a
IDE/iotsafe/*.map
IDE/iotsafe/*.elf
IDE/iotsafe/*.bin
# Binaries
wolfcrypt/src/port/intel/qat_test
/mplabx/wolfssl.X/dist/default/
@ -351,6 +354,30 @@ IDE/XCODE/Index
/IDE/Renesas/e2studio/Projects/test/*.launch
/IDE/Renesas/e2studio/Projects/test/*.scfg
/IDE/Renesas/e2studio/RX65N/GR-ROSE/.metadata
/IDE/Renesas/e2studio/RX65N/GR-ROSE/smc/src
/IDE/Renesas/e2studio/RX65N/GR-ROSE/smc/trash
/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/src/smc_gen
/IDE/Renesas/e2studio/RX65N/GR-ROSE/test/generate
/IDE/Renesas/e2studio/RX65N/RSK/.metadata
/IDE/Renesas/e2studio/RX65N/RSK/smc/src
/IDE/Renesas/e2studio/RX65N/RSK/smc/trash
/IDE/Renesas/e2studio/RX65N/RSK/test/src/smc_gen
/IDE/Renesas/e2studio/RX65N/RSK/test/generate
/IDE/Renesas/e2studio/RX72N/EnvisionKit/.metadata
/IDE/Renesas/e2studio/RX72N/EnvisionKit/smc/src
/IDE/Renesas/e2studio/RX72N/EnvisionKit/smc/trash
/IDE/Renesas/e2studio/RX72N/EnvisionKit/test/src/smc_gen
/IDE/Renesas/e2studio/RX72N/EnvisionKit/test/generate
# QNX CAAM
/IDE/QNX/example-server/server-tls
/IDE/QNX/example-client/client-tls
/IDE/QNX/example-cmac/cmac-test
/IDE/QNX/CAAM-DRIVER/wolfCrypt
# Emacs
*~
@ -358,3 +385,7 @@ IDE/XCODE/Index
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
# GDB Settings
\.gdbinit

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,613 @@
# wolfSSL Release 5.1.1 (Jan 3rd, 2021)
Release 5.1.1 of wolfSSL embedded TLS has a high vulnerability fix:
### Vulnerabilities
* \[High\] In connections using AES-CBC or DES3 with TLS/DTLS 1.2 or 1.1 the IV being used is not random. Users using wolfSSL version 5.0.0 or 5.1.0 doing TLS/DTLS 1.2 or 1.1 connections, without AEAD only, should update the version of wolfSSL used.
# wolfSSL Release 5.1.0 (Dec 27, 2021)
Release 5.1.0 of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* \[Low\] Potential for DoS attack on a wolfSSL client due to processing hello packets of the incorrect side. This affects only connections using TLS v1.2 or less that have also been compromised by a man in the middle attack. Thanks to James Henderson, Mathy Vanhoef, Chris M. Stone, Sam L. Thomas, Nicolas Bailleut, and Tom Chothia (University of Birmingham, KU Leuven, ENS Rennes for the report.
* \[Low\] Client side session resumption issue once the session resumption cache has been filled up. The hijacking of a session resumption has been demonstrated so far with only non verified peer connections. That is where the client is not verifying the servers CA that it is connecting to. There is the potential though for other cases involving proxies that are verifying the server to be at risk, if using wolfSSL in a case involving proxies use wolfSSL_get1_session and then wolfSSL_SESSION_free when done where possible. If not adding in the session get/free function calls we recommend that users of wolfSSL that are resuming sessions update to the latest version (wolfSSL version 5.1.0 or later). Thanks to the UK's National Cyber Security Centre (NCSC) for the report.
### New Feature Additions
###### Ports
* Curve25519 support with NXP SE050 added
* Renesas RA6M4 support with SCE Protected Mode and FSP 3.5.0
* Renesas TSIP 1.14 support for RX65N/RX72N
###### Post Quantum
* Post quantum resistant algorithms used with Apache port
* NIST round 3 FALCON Signature Scheme support added to TLS 1.3 connections
* FALCON added to the benchmarking application
* Testing of cURL with wolfSSL post quantum resistant build
###### Compatibility Layer Additions
* Updated NGINX port to NGINX version 1.21.4
* Updated Apache port to Apache version 2.4.51
* Add support for SSL_OP_NO_TLSv1_2 flag with wolfSSL_CTX_set_options function
* Support added for the functions
- SSL_CTX_get_max_early_data
- SSL_CTX_set_max_early_data
- SSL_set_max_early_data
- SSL_get_max_early_data
- SSL_CTX_clear_mode
- SSL_CONF_cmd_value_type
- SSL_read_early_data
- SSL_write_early_data
###### Misc.
* Crypto callback support for AES-CCM added. A callback function can be registered and used instead of the default AES-CCM implementation in wolfSSL.
* Added AES-OFB to the FIPS boundary for future FIPS validations.
* Add support for custom OIDs used with CSR (certificate signing request) generation using the macro WOLFSSL_CUSTOM_OID
* Added HKDF extract callback function for use with TLS 1.3
* Add variant from RFC6979 of deterministic ECC signing that can be enabled using the macro WOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT
* Added the function wc_GetPubKeyDerFromCert to get the public key from a DecodedCert structure
* Added the functions wc_InitDecodedCert, wc_ParseCert and wc_FreeDecodedCert for access to decoding a certificate into a DecodedCert structure
* Added the macro WOLFSSL_ECC_NO_SMALL_STACK for hybrid builds where the numerous malloc/free with ECC is undesired but small stack use is desired throughout the rest of the library
* Added the function wc_d2i_PKCS12_fp for reading a PKCS12 file and parsing it
### Fixes
###### PORT Fixes
* Building with Android wpa_supplicant and KeyStore
* Setting initial value of CA certificate with TSIP enabled
* Cryptocell ECC build fix and fix with RSA disabled
* IoT-SAFE improvement for Key/File slot ID size, fix for C++ compile, and fixes for retrieving the public key after key generation
###### Math Library Fixes
* Check return values on TFM library montgomery function in case the system runs out of memory. This resolves an edge case of invalid ECC signatures being created.
* SP math library sanity check on size of values passed to sp_gcd.
* SP math library sanity check on exponentiation by 0 with mod_exp
* Update base ECC mp_sqrtmod_prime function to handle an edge case of zero
* TFM math library with Intel MULX multiply fix for carry in assembly code
###### Misc.
* Fix for potential heap buffer overflow with compatibility layer PEM parsing
* Fix for edge memory leak case with an error encountered during TLS resumption
* Fix for length on inner sequence created with wc_DhKeyToDer when handling small DH keys
* Fix for sanity check on input argument to DSA sign and verify
* Fix for setting of the return value with ASN1 integer get on an i386 device
* Fix for BER to DER size checks with PKCS7 decryption
* Fix for memory leak with PrintPubKeyEC function in compatibility layer
* Edge case with deterministic ECC key generation when the private key has leading 0s
* Fix for build with OPENSSL_EXTRA and NO_WOLFSSL_STUB both defined
* Use page aligned memory with ECDSA signing and KCAPI
* Skip expired sessions for TLS 1.3 rather than turning off the resume behavior
* Fix for DTLS handling dropped or retransmitted messages
### Improvements/Optimizations
###### Build Options and Warnings
* Bugfix: could not build with liboqs and without DH enabled
* Build with macro NO_ECC_KEY_EXPORT fixed
* Fix for building with the macro HAVE_ENCRYPT_THEN_MAC when session export is enabled
* Building with wolfSentry and HAVE_EX_DATA macro set
###### Math Libraries
* Improvement for performance with SP C implementation of montgomery reduction for ECC (P256 and P384) and SP ARM64 implementation for ECC (P384)
* With SP math handle case of dividing by length of dividend
* SP math improvement for lo/hi register names to be used with older GCC compilers
###### Misc.
* ASN name constraints checking code refactor for better efficiency and readability
* Refactor of compatibility layer stack freeing calls to simplify and reduce code
* Scrubbed code for trailing spaces, hard tabs, and any control characters
* Explicit check that leaf certificate's public key type match cipher suite signature algorithm
* Additional NULL sanity checks on WOLFSSL struct internally and improve switch statement fallthrough
* Retain OCSP error value when CRL is enabled with certificate parsing
* Update to NATIVE LwIP support for TCP use
* Sanity check on PEM size when parsing a PEM with OpenSSL compatibility layer API.
* SWIG wrapper was removed from the codebase in favor of dedicated Java and Python wrappers.
* Updates to bundled example client for when to load the CA, handling print out of IP alt names, and printing out the peers certificate in PEM format
* Handling BER encoded inner content type with PKCS7 verify
* Checking for SOCKET_EPIPE errors from low level socket
* Improvements to cleanup in the case that wolfSSL_Init fails
* Update test and example certificates expiration dates
# wolfSSL Release 5.0.0 (Nov 01, 2021)
Release 5.0.0 of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* [\Low\] Hang with DSA signature creation when a specific q value is used in a maliciously crafted key. If a DSA key with an invalid q value of either 1 or 0 was decoded and used for creating a signature, it would result in a hang in wolfSSL. Users that are creating signatures with DSA and are using keys supplied from an outside source are affected.
* [\Low\] Issue with incorrectly validating a certificate that has multiple subject alternative names when given a name constraint. In the case where more than one subject alternative name is used in the certificate, previous versions of wolfSSL could incorrectly validate the certificate. Users verifying certificates with multiple alternative names and name constraints, are recommended to either use the certificate verify callback to check for this case or update the version of wolfSSL used. Thanks to Luiz Angelo Daros de Luca for the report.
### New Feature Additions
###### New Product
* FIPS 140-3 -- currently undergoing laboratory testing, code review and ultimately CMVP validation. Targeting the latest FIPS standard.
###### Ports
* IoT-Safe with TLS demo
* SE050 port with support for RNG, SHA, AES, ECC (sign/verify/shared secret) and ED25519
* Support for Renesas TSIP v1.13 on RX72N
###### Post Quantum
* Support for OQS's (liboqs version 0.7.0) implementation of NIST Round 3 KEMs as TLS 1.3 groups --with-liboqs
* Hybridizing NIST ECC groups with the OQS groups
* Remove legacy NTRU and QSH
* Make quantum-safe groups available to the compatibility layer
###### Linux Kernel Module
* Full support for FIPS 140-3, with in-kernel power on self test (POST) and conditional algorithm self test(s) (CAST)
* --enable-linuxkm-pie -- position-independent in-kernel wolfCrypt container, for FIPS
* Vectorized x86 acceleration in PK algs (RSA, ECC, DH, DSA) and AES/AES-GCM
* Vectorized x86 acceleration in interrupt handlers
* Support for Linux-native module signatures
* Complete SSL/TLS and Crypto API callable from other kernel module(s)
* Support for LTS kernel lines: 3.16, 4.4, 4.9, 5.4, 5.10
###### Compatibility Layer Additions
* Ports
- Add support for libssh2
- Add support for pyOpenSSL
- Add support for libimobiledevice
- Add support for rsyslog
- Add support for OpenSSH 8.5p1
- Add support for Python 3.8.5
* API/Structs Added
- ERR_lib_error_string
- EVP_blake2
- wolfSSL_set_client_CA_list
- wolfSSL_EVP_sha512_224
- wolfSSL_EVP_sha512_256
- wc_Sha512_224/2256Hash
- wc_Sha512_224/256Hash
- wc_InitSha512_224/256
- wc_InitSha512_224/256_ex
- wc_Sha512_224/256Update
- wc_Sha512_224/256FinalRaw
- wc_Sha512_224/256Final
- wc_Sha512_224/256Free
- wc_Sha512_224/256GetHash
- wc_Sha512_224/256Copy
- wc_Sha512_224/256SetFlags
- wc_Sha512_224/256GetFlags
- wc_Sha512_224/256Transform
- EVP_MD_do_all and OBJ_NAME_do_all
- EVP_shake128
- EVP_shake256
- SSL_CTX_set_num_tickets
- SSL_CTX_get_num_tickets
- SSL_CIPHER_get_auth_nid
- SSL_CIPHER_get_cipher_nid
- SSL_CIPHER_get_digest_nid
- SSL_CIPHER_get_kx_nid
- SSL_CIPHER_is_aead
- SSL_CTX_set_msg_callback
- a2i_IPADDRESS
- GENERAL_NAME_print
- X509_VERIFY_PARAM_set1_ip
- EVP_CIPHER_CTX_set_iv_length
- PEM_read_bio_RSA_PUBKEY
- i2t_ASN1_OBJECT
- DH_set_length
- Set_tlsext_max_fragment_length
- AUTHORITY_iNFO_ACCESS_free
- EVP_PBE_scrypt
- ASN1_R_HEADER_TOO_LONG
- ERR_LIB
- X509_get_default_cert_file/file_env/dir/dir_env() stubs
- SSL_get_read_ahead/SSL_set_read_ahead()
- SSL_SESSION_has_ticket()
- SSL_SESSION_get_ticket_lifetime_hint()
- DIST_POINT_new
- DIST_POINT_free
- DIST_POINTS_free
- CRL_DIST_POINTS_free
- sk_DIST_POINT_push
- sk_DIST_POINT_value
- sk_DIST_POINT_num
- sk_DIST_POINT_pop_free
- sk_DIST_POINT_free
- X509_get_extension_flags
- X509_get_key_usage
- X509_get_extended_key_usage
- ASN1_TIME_to_tm
- ASN1_TIME_diff
- PEM_read_X509_REQ
- ERR_load_ERR_strings
- BIO_ssl_shutdown
- BIO_get_ssl
- BIO_new_ssl_connect
- BIO_set_conn_hostname
- NID_pkcs9_contentType
###### Misc.
* KCAPI: add support for using libkcapi for crypto (Linux Kernel)
* Configure option for --with-max-rsa-bits= and --with-max-ecc-bits=
* SP ARM Thumb support for Keil and performance improvements
* Add support for WOLFSSL_VERIFY_POST_HANDSHAKE verify mode
* PKCS #11: support static linking with PKCS #11 library --enable-pkcs11=static LIBS=-l
* Add build option --enable-wolfclu for use with wolfCLU product
* Add support for X9.42 header i.e “BEGIN X9.42 DH PARAMETERS”
* Add --enable-altcertchains for configuring wolfSSL with alternate certificate chains feature enabled
* Add public API wc_RsaKeyToPublicDer_ex to allow getting RSA public key without ASN.1 header (can return only seq + n + e)
* Add SNI and TLSx options to CMake build
### Fixes
###### PORT Fixes
* Add return value checking for FREESCALE_RNGA
* Fix MMCAU_SHA256 type warnings
* Fixes for building with Microchip XC32 and ATECC
###### Math Library Fixes
* TFM check that the modulus length is valid for fixed data array size
* TFM fp_submod_ct fix check for greater
* Check return value of mp_grow in mp_mod_2d
* Fix for ECC point multiply to error out on large multipliers
* SP ECC error on multiplier larger than curve order
###### TLS 1.3
* TLS1.3 sanity check for cases where a private key is larger than the configured maximum
* Fix early data max size handling in TLS v1.3
* Fixes for PK callbacks with TLS v1.3
* Check min downgrade when no extensions are sent with the ServerHello
###### Misc.
* Previously wolfSSL enum values were used as NIDs. Now only the compatibility layer NID enums are the NID values:
- CTC_SHAwDSA -> NID_dsaWithSHA1
- CTC_SHA256wDSA -> NID_dsa_with_SHA256
- CTC_MD2wRSA -> NID_md2WithRSAEncryption
- CTC_MD5wRSA -> NID_md5WithRSAEncryption
- CTC_SHAwRSA -> NID_sha1WithRSAEncryption
- CTC_SHA224wRSA -> NID_sha224WithRSAEncryption
- CTC_SHA256wRSA -> NID_sha256WithRSAEncryption
- CTC_SHA384wRSA -> NID_sha384WithRSAEncryption
- CTC_SHA512wRSA -> NID_sha512WithRSAEncryption
- CTC_SHA3_224wRSA -> NID_RSA_SHA3_224
- CTC_SHA3_256wRSA -> NID_RSA_SHA3_256
- CTC_SHA3_384wRSA -> NID_RSA_SHA3_384
- CTC_SHA3_512wRSA -> NID_RSA_SHA3_512
- CTC_SHAwECDSA -> NID_ecdsa_with_SHA1
- CTC_SHA224wECDSA -> NID_ecdsa_with_SHA224
- CTC_SHA256wECDSA -> NID_ecdsa_with_SHA256
- CTC_SHA384wECDSA -> NID_ecdsa_with_SHA384
- CTC_SHA512wECDSA -> NID_ecdsa_with_SHA512
- CTC_SHA3_224wECDSA -> NID_ecdsa_with_SHA3_224
- CTC_SHA3_256wECDSA -> NID_ecdsa_with_SHA3_256
- CTC_SHA3_384wECDSA -> NID_ecdsa_with_SHA3_384
- CTC_SHA3_512wECDSA -> NID_ecdsa_with_SHA3_512
- DSAk -> NID_dsa
- RSAk -> NID_rsaEncryption
- ECDSAk -> NID_X9_62_id_ecPublicKey
- BASIC_CA_OID -> NID_basic_constraints
- ALT_NAMES_OID -> NID_subject_alt_name
- CRL_DIST_OID -> NID_crl_distribution_points
- AUTH_INFO_OID -> NID_info_access
- AUTH_KEY_OID -> NID_authority_key_identifier
- SUBJ_KEY_OID -> NID_subject_key_identifier
- INHIBIT_ANY_OID -> NID_inhibit_any_policy
* Fix for DES IV size used with FIPSv2
* Fix signed comparison issue with serialSz
* Fix missing CBIOSend and properly guard hmac in DupSSL()
* Fix calculation of length of encoding in ssl.c
* Fix encoding to check proper length in asn.c
* Fix for wc_ecc_ctx_free and heap hint
* Fix for debug messages with AF_ALG build
* Fix for static memory with bucket size matching.
* Fixes for SRP with heap hint.
* Fixes for CAAM build macros and spelling for Keil build
* Sniffer fix for possible math issue around 64-bit pointer and 32-bit unsigned int
* Fix for sniffer TCP sequence rollover
* wolfSSL_PEM_write_bio_PUBKEY to write only the public part
* Fix for sending only supported groups in TLS extension
* Fix for sniffer to better handle spurious retransmission edge case
* SSL_set_alpn_protos and SSL_CTX_set_alpn_protos now returns 0 on successFixes issue with SSL_CTX_set1_curves_list and SSL_set1_curves_list not checking the last character of the names variable provided, non-0 on failure to better match expected return values
* Fixes and improvements for crypto callbacks with TLS (mutual auth)
* Fix for bad memory_mutex lock on static memory cleanup
* Zero terminate name constraints strings when parsing certificates
* Fix for verifying a certificate when multiple permitted name constraints are used
* Fix typo in ifdef for HAVE_ED448
* Fix typos in comments in SHA512
* Add sanity check on buffer size with ED25519 key decode
* Sanity check on PKCS7 stream amount read
* PKCS7 fix for double free on error case and sanity check on set serial number
* Sanity check on PKCS7 input size wc_PKCS7_ParseSignerInfo
* Forgive a DTLS session trying to send too much at once
### Improvements/Optimizations
###### Build Options and Warnings
* Rework of RC4 disable by default and depreciation
* wolfSSL as a Zephyr module (without setup.sh)
* Add include config.h to bio.c
* Support for PKCS7 without AES CBC.
* Fixes for building without AES CBC
* Added WOLFSSL_DH_EXTRA to --enable-all and --enable-sniffer
* Add a CMake option to build wolfcrypt test and bench code as libraries
* GCC makefile: allow overriding and provide more flexibility
###### Math Libraries
* Improve performance of fp_submod_ct() and fp_addmod_ct()
* Improve performance of sp_submod_ct() and sp_addmod_ct()
* SP int, handle even modulus with exponentiation
###### Misc.
* Cleanups for Arduino examples and memory documentation
* Refactor hex char to byte conversions
* Added GCC-ARM TLS server example
* Improvements to session locking to allow per-row
* Improved sniffer statistics and documentation
* EVP key support for heap hint and crypto callbacks
* Reduced stack size for dh_generation_test and Curve ASN functions
* Espressif README Syntax / keyword highlighting / clarifications
* AARCH64 SHA512: implementation using crypto instructions added
* wc_RsaPSS_CheckPadding_ex2 added for use with HEAP hint
* wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex bound checks on input and output sizes
* Add additional error handling to wolfSSL_BIO_get_len
* Add code to use popen and the command 'host', useful with qemu
* Adjustment to subject alt names order with compatibility layer to better match expected order
* Reduce BIO compatibility layer verbosity
* Set a default upper bound on error queue size with compatibility layer
* WOLFSSL_CRL_ALLOW_MISSING_CDP macro for Skip CRL verification in case no CDP in peer cert
* Fixes for scan-build LLVM-13 and expanded coverage
* Increase the default DTLS_MTU_ADDITIONAL_READ_BUFFER and make it adjustable
# wolfSSL Release 4.8.1 (July 16, 2021)
Release 4.8.1 of wolfSSL embedded TLS has an OCSP vulnerability fix:
### Vulnerabilities
* [High] OCSP verification issue when response is for a certificate with no relation to the chain in question BUT that response contains the NoCheck extension which effectively disables ALL verification of that one cert. Users who should upgrade to 4.8.1 are TLS client users doing OCSP, TLS server users doing mutual auth with OCSP, and CertManager users doing OCSP independent of TLS. Thanks to Jan Nauber, Marco Smeets, Werner Rueschenbaum and Alissa Kim of Volkswagen Infotainment for the report.
# wolfSSL Release 4.8.0 (July 09, 2021)
Release 4.8.0 of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* [Low] CVE-2021-37155: OCSP request/response verification issue. In the case that the serial number in the OCSP request differs from the serial number in the OCSP response the error from the comparison was not resulting in a failed verification. We recommend users that have wolfSSL version 4.6.0 and 4.7.0 with OCSP enabled update their version of wolfSSL. Version 4.5.0 and earlier are not affected by this report. Thanks to Rainer Mueller-Amersdorffer, Roee Yankelevsky, Barak Gutman, Hila Cohen and Shoshi Berko (from CYMOTIVE Technologies and CARIAD) for the report.
* [Low] CVE-2021-24116: Side-Channel cache look up vulnerability in base64 PEM decoding for versions of wolfSSL 4.5.0 and earlier. Versions 4.6.0 and up contain a fix and do not need to be updated for this report. If decoding a PEM format private key using version 4.5.0 and older of wolfSSL then we recommend updating the version of wolfSSL used. Thanks to Florian Sieck, Jan Wichelmann, Sebastian Berndt and Thomas Eisenbarth for the report.
### New Feature Additions
###### New Product
* Added wolfSentry build with --enable-wolfsentry and tie-ins to wolfSSL code for use with wolfSentry
###### Ports
* QNX CAAM driver added, supporting ECC black keys, CMAC, BLOBs, and TRNG use
* _WIN32_WCE wolfCrypt port added
* INTIME_RTOS directory support added
* Added support for STM32G0
* Renesas RX: Added intrinsics for rot[rl], revl (thanks @rliebscher)
* Added support for running wolfcrypt/test/testwolfcrypt on Dolphin emulator to test DEVKITPRO port
* Zephyr project port updated to latest version 2.6.X
###### ASN1 and PKCS
* Storing policy constraint extension from certificate added
* Added support for NID_favouriteDrink pilot
* Added the API function wc_EncryptPKCS8Key to handle encrypting a DER, PKCS#8-formatted key
###### Compatibility Layer Additions
* Open Source PORTS Added/Updated
- OpenVPN
- OpenLDAP
- socat-1.7.4.1
- Updated QT port for 5.15.2
* Changes to extend set_cipher_list() compatibility layer API to have set_ciphersuites compatibility layer API capability
* Added more support for SHA3 in the EVP layer
* API Added
- MD5/MD5_Transform
- SHA/SHA_Transform/SHA1_Transform
- SHA224/SHA256_Transform/SHA512_Transform
- SSL_CTX_get0_param/SSL_CTX_set1_param
- X509_load_crl_file
- SSL_CTX_get_min_proto_version
- EVP_ENCODE_CTX_new
- EVP_ENCODE_CTX_free
- EVP_EncodeInit
- EVP_EncodeUpdate
- EVP_EncodeFinal
- EVP_DecodeInit
- EVP_DecodeUpdate
- EVP_DecodeFinal
- EVP_PKEY_print_public
- BIO_tell
- THREADID_current
- THREADID_hash
- SSL_CTX_set_ecdh_auto
- RAND_set_rand_method()
- X509_LOOKUP_ctrl()
- RSA_bits
- EC_curve_nist2nid
- EC_KEY_set_group
- SSL_SESSION_set_cipher
- SSL_set_psk_use_session_callback
- EVP_PKEY_param_check
- DH_get0_pqg
- CRYPTO_get_ex_new_index
- SSL_SESSION_is_resumable
- SSL_CONF_cmd
- SSL_CONF_CTX_finish
- SSL_CTX_keylog_cb_func
- SSL_CTX_set_keylog_callback
- SSL_CTX_get_keylog_callback
###### Misc.
* Added wolfSSL_CTX_get_TicketEncCtx getter function to return the ticket encryption ctx value
* Added wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex APIs to accept an Aes object to use for the AES operations
* Added implementation of AES-GCM streaming (--enable-aesgcm-stream)
* Added deterministic generation of k with ECC following RFC6979 when the macro WOLFSSL_ECDSA_DETERMINISTIC_K is defined and wc_ecc_set_deterministic function is called
* Implemented wc_DsaParamsDecode and wc_DsaKeyToParamsDer
* Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
* Added crypto callback support for Ed/Curve25519 and SHA2-512/384
* TLS 1.3 wolfSSL_key_update_response function added to see if a update response is needed
### Fixes
* Fix for detecting extra unused bytes that are in an ASN1 sequence appended to the end of a valid ECC signature
* Fix for keyid with ktri CMS (breaks compatibility with previous keyid ASN1 syntax)
* Fix for failed handshake if a client offers more than 150 cipher suites. Thanks to Marcel Maehren, Philipp Nieting, Robert Merget from Ruhr University Bochum Sven Hebrok, Juraj Somorovsky from Paderborn University
* Fix for default order of deprecated elliptic curves SECP224R1, SECP192R1, SECP160R1. Thanks to Marcel Maehren, Philipp Nieting, Robert Merget from Ruhr University Bochum Sven Hebrok, Juraj Somorovsky from Paderborn University
* Fix for corner TLS downgrade case where a TLS 1.3 setup that allows for downgrades but has TLS 1.3 set as the minimum version would still downgrade to TLS 1.2
###### PKCS7 (Multiple fixes throughout regarding memory leaks with SMIME and heap buffer overflows due to streaming functionality)
* Fix PKCS7 dynamic content save/restore in PKCS7_VerifySignedData
* Fix for heap buffer overflow on compare with wc_PKCS7_DecryptKtri
* Fix for heap buffer overflow with wc_PKCS7_VerifySignedData
* Fix for heap buffer overflow with wc_PKCS7_DecodeEnvelopedData
* Check size of public key used with certificate passed into wc_PKCS7_InitWithCert before XMEMCPY to avoid overflow
* Fix for heap buffer overflow fix for wolfSSL_SMIME_read_PKCS7
* Fix to cleanly free memory in error state with wolfSSL_SMIME_read_PKCS7
* SMIME error checking improvements and canonicalize multi-part messages before hashing
###### DTLS Fixes
* DTLS fix to correctly move the Tx sequence number forward
* DTLS fix for sequence and epoch number with secure renegotiation cookie exchange
* Fix for Chacha-Poly AEAD for DTLS 1.2 with secure renegotiation
###### PORT Fixes
* Fix AES, aligned key for the HW module with DCP port
* Fix ATECC608A TNGTLS certificate size issue (thanks @vppillai)
* Fixes for mingw compile warnings
* Fixes for NXP LTC ECC/RSA
* Fix ESP32 RSA hw accelerator initialization issue
* Fixes for STM32 PKA with ECC
* Fixes for STM32 AES GCM for HAL's that support byte sized headers
* Espressif ESP32 SHA_CTX macro conflict resolved
###### Math Library Fixes
* For platforms that support limits.h or windows make sure both SIZEOF_LONG_LONG and SIZEOF_LONG are set to avoid issues with CTC_SETTINGS
* SP C 32/64: fix corner cases around subtraction affecting RSA PSS use
* Fix to return the error code from sp_cond_swap_ct when malloc fails
* Fix potential memory leak with small stack in the function fp_gcd
* Static Analysis Fixes
* Fixes made from Coverity analysis including:
* Cleanups for some return values,
* Fix for leak with wolfSSL_a2i_ASN1_INTEGER
* Sanity check on length in wolfSSL_BN_rand
* Sanity check size in TLSX_Parse catching a possible integer overflow
* Fixes found with -fsanitize=undefined testing
* Fix null dereferences or undefined memcpy calls
* Fix alignment in myCryptoDevCb
* Fix default DTLS context assignment
* Added align configure option to force data alignment
###### Misc.
* Fix for wolfSSL_ASN1_TIME_adj set length
* Fix for freeing structure on error case in the function AddTrustedPeer
* Return value of SSL_read when called after bidirectional shutdown
* Fix for build options ./configure --enable-dtls --disable-asn
* FIx for detection of a salt length from an RSA PSS signature
* Fix to free up globalRNGMutex mutex when cleaning up global RNG
* Fix leak when multiple hardware names are in SAN
* Fix nonblocking ret value from CRL I/O callbacks
* Fix wolfSSL_BIO_free_all return type to better match for compatibility layer
* Fix for make distcheck, maintainer-clean, to allow distribution builds
* Fix for async with fragmented packets
* Fix for the build or RSA verify or public only
* Fix for return value of wolfSSL_BIO_set_ssl to better match expected compatibility layer return value
* Fix for sanity checks on size of issuer hash and key along with better freeing on error cases with DecodeBasicOcspResponse
* Fix for potential memory leak with wolfSSL_OCSP_cert_to_id
### Improvements/Optimizations
###### DTLS/TLS Code Base
* Improved TLS v1.3 time rollover support
* TLS 1.3 PSK: use the hash algorithm to choose cipher suite
* TLS Extended Master Secret ext: TLS13 - send in second Client Hello if in first
* TLS Encrypt then MAC: check all padding bytes are the same value
* wolfSSL_GetMaxRecordSize updated to now take additional cipher data into account
* Updated session export/import with DTLS to handle a new internal options flag
* Refactored dtls_expected_peer_handshake_number handling
* Added wolfSSL_CTX_get_ephemeral_key and wolfSSL_get_ephemeral_key for loading a constant key in place of an ephemeral one
* Improved checking of XSNPRINTF return value in DecodePolicyOID
###### Build Options and Warnings
* Added wolfSSL_CTX_set_verify to the ABI list
* Adjusted FP_ECC build to not allow SECP160R1, SECP160R2, SECP160K1 and SECP224K1. FP_ECC does not work with scalars that are the length of the order when the order is longer than the prime.
* Added CMake support for CURVE25519, ED25519, CURVE448, and ED448
* cmake addition to test paths when building
* Added support for session tickets in CMake
* Added support for reproducible builds with CMake
* Turn on reproducible-build by default when enable-distro
* Windows Project: Include the X448 and Ed448 files
* GCC-11 compile time warning fixes
* Fix for compiling build of ./configure '--disable-tlsv12' '-enable-pkcallbacks'
* Added build error for insecure build combination of secure renegotiation enabled with extended master secret disabled when session resumption is enabled
* Updated building and running with Apple M1
* Apache httpd build without TLS 1.3 macro guard added
* Enable SHA3 and SHAKE256 requirements automatically when ED448 is enabled
* Added option for AES CBC cipher routines to return BAD_LENGTH_E when called with an input buffer length not a multiple of AES_BLOCK_SIZE
* Macro WOLFSSL_SP_INT_DIGIT_ALIGN added for alignment on buffers with SP build. This was needed for compiler building on a Renesas board.
* Build support with no hashes enabled an no RNG compiled in
* Allow use of FREESCALE hardware RNG without a specific port
* Resolved some warnings with Windows builds and PBKDF disabled
* Updated the version of autoconf and automake along with fixes for some new GCC-10 warnings
###### Math Libraries
* SP: Thumb implementation that works with clang
* SP math all: sp_cmp handling of negative values
* SP C ECC: mont sub - always normalize after sub before check for add
* TFM math library prime checking, added more error checks with small stack build
* Sanity checks on 0 value with GCD math function
* fp_exptmod_ct error checking and small stack variable free on error
* Sanity check on supported digit size when calling mp_add_d in non fastmath builds
* Support for mp_dump with SP Math ALL
* WOLFSSL_SP_NO_MALLOC for both the normal SP build and small SP build now
* WOLFSSL_SP_NO_DYN_STACK added for SP small code that is not small stack build to avoid dynamic stack
###### PKCS 7/8
* wc_PKCS7_DecodeCompressedData to optionally handle a packet without content wrapping
* Added setting of content type parsed with PKCS7 wc_PKCS7_DecodeAuthEnvelopedData and wc_PKCS7_DecodeEnvelopedData
* PKCS8 code improvements and refactoring
###### Misc.
* Sanity checks on null inputs to the functions wolfSSL_X509_get_serialNumber and wolfSSL_X509_NAME_print_ex
* Added ARM CryptoCell support for importing public key with wc_ecc_import_x963_ex()
* Improved checking for possible use of key->dp == NULL cases with ECC functions
* Updated SHAKE256 to compile with NIST FIPS 202 standard and added support for OID values (thanks to strongX509)
* Improved ECC operations when using WOLFSSL_NO_MALLOC
* Added WOLFSSL_SNIFFER_FATAL_ERROR for an return value when sniffer is in a fatal state
* Allow parsing spaces in Base64_SkipNewline
* Issue callback when exceeding depth limit rather than error out with OPENSSL_EXTRA build
* Added NXP LTC RSA key generation acceleration
# wolfSSL Release 4.7.0 (February 16, 2021)
Release 4.7.0 of wolfSSL embedded TLS has bug fixes and new features including:
### New Feature Additions
* Compatibility Layer expansion SSL_get_verify_mode, X509_VERIFY_PARAM API, X509_STORE_CTX API added
* WOLFSSL_PSK_IDENTITY_ALERT macro added for enabling a subset of TLS alerts
* Function wolfSSL_CTX_NoTicketTLSv12 added to enable turning off session tickets with TLS 1.2 while keeping TLS 1.3 session tickets available
* Implement RFC 5705: Keying Material Exporters for TLS
* Added --enable-reproducible-build flag for making more deterministic library outputs to assist debugging
* Added support for S/MIME (Secure/Multipurpose Internet Mail Extensions) bundles
### Fixes
* Fix to free mutex when cert manager is freed
* Compatibility layer EVP function to return the correct block size and type
* DTLS secure renegotiation fixes including resetting timeout and retransmit on duplicate HelloRequest
* Fix for edge case with shrink buffer and secure renegotiation
* Compile fix for type used with curve448 and PPC64
* Fixes for SP math all with PPC64 and other embedded compilers
* SP math all fix when performing montgomery reduction on one word modulus
* Fixes to SP math all to better support digit size of 8-bit
* Fix for results of edge case with SP integer square operation
* Stop non-ct mod inv from using register x29 with SP ARM64 build
* Fix edge case when generating z value of ECC with SP code
* Fixes for PKCS7 with crypto callback (devId) with RSA and RNG
* Fix for compiling builds with RSA verify and public only
* Fix for PKCS11 not properly exporting the public key due to a missing key type field
* Call certificate callback with certificate depth issues
* Fix for out-of-bounds read in TLSX_CSR_Parse()
* Fix incorrect AES-GCM tag generation in the EVP layer
* Fix for out of bounds write with SP math all enabled and an edge case of calling sp_tohex on the result of sp_mont_norm
* Fix for parameter check in sp_rand_prime to handle 0 length values
* Fix for edge case of failing malloc resulting in an out of bounds write with SHA256/SHA512 when small stack is enabled
### Improvements/Optimizations
* Added --enable-wolftpm option for easily building wolfSSL to be used with wolfTPM
* DTLS macro WOLFSSL_DTLS_RESEND_ONLY_TIMEOUT added for resending flight only after a timeout
* Update linux kernel module to use kvmalloc and kvfree
* Add user settings option to cmake build
* Added support for AES GCM session ticket encryption
* Thread protection for global RNG used by wolfSSL_RAND_bytes function calls
* Sanity check on FIPs configure flag used against the version of FIPs bundle
* --enable-aesgcm=table now is compatible with --enable-linuxkm
* Increase output buffer size that wolfSSL_RAND_bytes can handle
* Out of directory builds resolved, wolfSSL can now be built in a separate directory than the root wolfssl directory
### Vulnerabilities
* [HIGH] CVE-2021-3336: 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. For the code change see https://github.com/wolfSSL/wolfssl/pull/3676. Thanks to Aina Toky Rasoamanana and Olivier Levillain from Télécom SudParis for the report.
* [LOW] In the case of using custom ECC curves there is the potential for a crafted compressed ECC key that has a custom prime value to cause a hang when imported. This only affects applications that are loading in ECC keys with wolfSSL builds that have compressed ECC keys and custom ECC curves enabled.
* [LOW] With TLS 1.3 authenticated-only ciphers a section of the server hello could contain 16 bytes of uninitialized data when sent to the connected peer. This affects only a specific build of wolfSSL with TLS 1.3 early data enabled and using authenticated-only ciphers with TLS 1.3.
# wolfSSL Release 4.6.0 (December 22, 2020)
Release 4.6.0 of wolfSSL embedded TLS has bug fixes and new features including:
@ -1609,9 +2219,9 @@ More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html
- No filesystem build fixes for various configurations
- Certificate generation now supports several extensions including KeyUsage,
SKID, AKID, and Ceritifcate Policies
SKID, AKID, and Certificate Policies
- CRLs can be loaded from buffers as well as files now
- SHA-512 Ceritifcate Signing generation
- SHA-512 Certificate Signing generation
- Fixes for sniffer reassembly processing
See INSTALL file for build instructions.

View File

@ -17,8 +17,8 @@ Step 2: Copy the directory wolfSSL that was just created to:
Step 3: Edit `<arduino-libraries>/wolfSSL/user_settings.h`
If building for Intel Galileo platform add: `#define INTEL_GALILEO`.
Add any other custom settings, for a good start see the below in wolfssl root.
(See wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/user_settings.h)
Add any other custom settings, for a good start see the examples in wolfssl root
"/examples/configs/user_settings_*.h"
Step 4: If you experience any issues with custom user_settings.h see the wolfssl
porting guide here for more assistance: https://www.wolfssl.com/docs/porting-guide/

View File

@ -1,6 +1,6 @@
/* wolfssl_client.ino
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -24,8 +24,8 @@
#include <wolfssl/ssl.h>
#include <Ethernet.h>
const char host[] = "192.168.1.148"; // server to connect to
const int port = 11111; // port on server to connect to
const char host[] = "192.168.1.148"; /* server to connect to */
const int port = 11111; /* port on server to connect to */
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
@ -51,7 +51,7 @@ void setup() {
Serial.println("unable to get ctx");
return;
}
// initialize wolfSSL using callback functions
/* initialize wolfSSL using callback functions */
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
@ -119,7 +119,10 @@ void loop() {
if ((wolfSSL_write(ssl, msg, msgSz)) == msgSz) {
Serial.print("Server response: ");
while (client.available() || wolfSSL_pending(ssl)) {
/* wait for data */
while (!client.available()) {}
/* read data */
while (wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
total_input += input;
if (input < 0) {

View File

@ -1,6 +1,6 @@
/* wolfssl_server.ino
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -31,7 +31,7 @@
#error Please undefine NO_WOLFSSL_SERVER for this example
#endif
const int port = 11111; // port to listen on
const int port = 11111; /* port to listen on */
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
@ -59,12 +59,12 @@ void setup() {
return;
}
// initialize wolfSSL using callback functions
/* initialize wolfSSL using callback functions */
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
// setup the private key and certificate
/* setup the private key and certificate */
err = wolfSSL_CTX_use_PrivateKey_buffer(ctx, ecc_key_der_256,
sizeof_ecc_key_der_256, WOLFSSL_FILETYPE_ASN1);
if (err != WOLFSSL_SUCCESS) {
@ -78,7 +78,7 @@ void setup() {
return;
}
// Start the server
/* Start the server */
server.begin();
return;
@ -110,7 +110,7 @@ void loop() {
int replySz = 0;
const char* cipherName;
// Listen for incoming client requests.
/* Listen for incoming client requests. */
client = server.available();
if (!client) {
return;
@ -142,7 +142,10 @@ void loop() {
Serial.println(cipherName);
Serial.print("Server Read: ");
while (client.available() || wolfSSL_pending(ssl)) {
/* wait for data */
while (!client.available()) {}
/* read data */
while (wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
if (input < 0) {
err = wolfSSL_get_error(ssl, 0);
@ -159,7 +162,7 @@ void loop() {
}
}
// echo data
/* echo data */
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);

View File

@ -11,20 +11,29 @@ space(){
}
if [ "$DIR" = "ARDUINO" ]; then
rm -rf wolfSSL
mkdir wolfSSL
if [ ! -d "wolfSSL" ]; then
mkdir wolfSSL
fi
cp ../../src/*.c ./wolfSSL
cp ../../wolfcrypt/src/*.c ./wolfSSL
mkdir wolfSSL/wolfssl
if [ ! -d "wolfSSL/wolfssl" ]; then
mkdir wolfSSL/wolfssl
fi
cp ../../wolfssl/*.h ./wolfSSL/wolfssl
mkdir wolfSSL/wolfssl/wolfcrypt
if [ ! -d "wolfSSL/wolfssl/wolfcrypt" ]; then
mkdir wolfSSL/wolfssl/wolfcrypt
fi
cp ../../wolfssl/wolfcrypt/*.h ./wolfSSL/wolfssl/wolfcrypt
# support misc.c as include in wolfcrypt/src
mkdir ./wolfSSL/wolfcrypt
mkdir ./wolfSSL/wolfcrypt/src
if [ ! -d "./wolfSSL/wolfcrypt" ]; then
mkdir ./wolfSSL/wolfcrypt
fi
if [ ! -d "./wolfSSL/wolfcrypt/src" ]; then
mkdir ./wolfSSL/wolfcrypt/src
fi
cp ../../wolfcrypt/src/misc.c ./wolfSSL/wolfcrypt/src
cp ../../wolfcrypt/src/asm.c ./wolfSSL/wolfcrypt/src
@ -37,31 +46,36 @@ if [ "$DIR" = "ARDUINO" ]; then
cp ./wolfSSL/wolfssl/bio.c ./wolfSSL/wolfcrypt/src/bio.c
# copy openssl compatibility headers to their appropriate location
mkdir ./wolfSSL/wolfssl/openssl
if [ ! -d "./wolfSSL/wolfssl/openssl" ]; then
mkdir ./wolfSSL/wolfssl/openssl
fi
cp ../../wolfssl/openssl/* ./wolfSSL/wolfssl/openssl
echo "/* Generated wolfSSL header file for Arduino */" > ./wolfSSL/wolfssl.h
echo "#include <user_settings.h>" >> ./wolfSSL/wolfssl.h
echo "#include <wolfssl/wolfcrypt/settings.h>" >> ./wolfSSL/wolfssl.h
echo "#include <wolfssl/ssl.h>" >> ./wolfSSL/wolfssl.h
echo "/* Generated wolfSSL user_settings.h file for Arduino */" > ./wolfSSL/user_settings.h
echo "#ifndef ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
echo "#define ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "/* Platform */" >> ./wolfSSL/user_settings.h
echo "#define WOLFSSL_ARDUINO" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "/* Math library (remove this to use normal math)*/" >> ./wolfSSL/user_settings.h
echo "#define USE_FAST_MATH" >> ./wolfSSL/user_settings.h
echo "#define TFM_NO_ASM" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "/* RNG DEFAULT !!FOR TESTING ONLY!! */" >> ./wolfSSL/user_settings.h
echo "/* comment out the error below to get started w/ bad entropy source" >> ./wolfSSL/user_settings.h
echo " * This will need fixed before distribution but is OK to test with */" >> ./wolfSSL/user_settings.h
echo "#error \"needs solved, see: https://www.wolfssl.com/docs/porting-guide/\"" >> ./wolfSSL/user_settings.h
echo "#define WOLFSSL_GENSEED_FORTEST" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "#endif /* ARDUINO_USER_SETTINGS_H */" >> ./wolfSSL/user_settings.h
if [ ! -f "./wolfSSL/user_settings.h" ]; then
echo "/* Generated wolfSSL user_settings.h file for Arduino */" > ./wolfSSL/user_settings.h
echo "#ifndef ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
echo "#define ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
space ./wolfSSL/user_settings.h
echo "/* Platform */" >> ./wolfSSL/user_settings.h
echo "#define WOLFSSL_ARDUINO" >> ./wolfSSL/user_settings.h
space ./wolfSSL/user_settings.h
echo "/* Math library (remove this to use normal math)*/" >> ./wolfSSL/user_settings.h
echo "#define USE_FAST_MATH" >> ./wolfSSL/user_settings.h
echo "#define TFM_NO_ASM" >> ./wolfSSL/user_settings.h
space ./wolfSSL/user_settings.h
echo "/* RNG DEFAULT !!FOR TESTING ONLY!! */" >> ./wolfSSL/user_settings.h
echo "/* comment out the error below to get started w/ bad entropy source" >> ./wolfSSL/user_settings.h
echo " * This will need fixed before distribution but is OK to test with */" >> ./wolfSSL/user_settings.h
echo "#error \"needs solved, see: https://www.wolfssl.com/docs/porting-guide/\"" >> ./wolfSSL/user_settings.h
echo "#define WOLFSSL_GENSEED_FORTEST" >> ./wolfSSL/user_settings.h
space ./wolfSSL/user_settings.h
echo "#endif /* ARDUINO_USER_SETTINGS_H */" >> ./wolfSSL/user_settings.h
fi
cp wolfSSL/wolfssl/wolfcrypt/settings.h wolfSSL/wolfssl/wolfcrypt/settings.h.bak
echo " /* wolfSSL Generated ARDUINO settings */" > ./wolfSSL/wolfssl/wolfcrypt/settings.h

122
IDE/Android/Android.bp Normal file
View File

@ -0,0 +1,122 @@
cc_library_shared {
name: "libwolfssl",
arch: {
arm: {
instruction_set: "arm",
},
arm64: {
cflags: ["-DARM64"],
},
},
compile_multilib: "both",
export_include_dirs: ["."],
shared_libs: ["liblog"],
cflags: [
"-DWOLFSSL_USER_SETTINGS",
"-Os",
"-fomit-frame-pointer",
/* If using WOLFSSL_ARMASM then add these cflags for ARM crypto extensions */
/* "-mcpu=cortex-a73+crypto", */
/* "-march=armv8-a", */
/* "-mstrict-align", */
],
include_dirs: [
"external/wolfssl/wolfssl",
"external/wolfssl",
],
srcs: [
"./src/crl.c",
"./src/internal.c",
"./src/keys.c",
"./src/ocsp.c",
"./src/sniffer.c",
"./src/ssl.c",
"./src/tls.c",
"./src/tls13.c",
"./src/wolfio.c",
] + [
"./wolfcrypt/src/aes.c",
"./wolfcrypt/src/arc4.c",
"./wolfcrypt/src/asm.c",
"./wolfcrypt/src/asn.c",
"./wolfcrypt/src/blake2b.c",
"./wolfcrypt/src/blake2s.c",
"./wolfcrypt/src/camellia.c",
"./wolfcrypt/src/chacha.c",
"./wolfcrypt/src/chacha20_poly1305.c",
"./wolfcrypt/src/cmac.c",
"./wolfcrypt/src/coding.c",
"./wolfcrypt/src/compress.c",
"./wolfcrypt/src/cpuid.c",
"./wolfcrypt/src/cryptocb.c",
"./wolfcrypt/src/curve25519.c",
"./wolfcrypt/src/curve448.c",
"./wolfcrypt/src/des3.c",
"./wolfcrypt/src/dh.c",
"./wolfcrypt/src/dsa.c",
"./wolfcrypt/src/ecc.c",
"./wolfcrypt/src/ecc_fp.c",
"./wolfcrypt/src/ed25519.c",
"./wolfcrypt/src/ed448.c",
"./wolfcrypt/src/error.c",
"./wolfcrypt/src/fe_448.c",
"./wolfcrypt/src/fe_low_mem.c",
"./wolfcrypt/src/fe_operations.c",
"./wolfcrypt/src/fips.c",
"./wolfcrypt/src/fips_test.c",
"./wolfcrypt/src/ge_448.c",
"./wolfcrypt/src/ge_low_mem.c",
"./wolfcrypt/src/ge_operations.c",
"./wolfcrypt/src/hash.c",
"./wolfcrypt/src/kdf.c",
"./wolfcrypt/src/hc128.c",
"./wolfcrypt/src/hmac.c",
"./wolfcrypt/src/idea.c",
"./wolfcrypt/src/integer.c",
"./wolfcrypt/src/kdf.c",
"./wolfcrypt/src/logging.c",
"./wolfcrypt/src/md2.c",
"./wolfcrypt/src/md4.c",
"./wolfcrypt/src/md5.c",
"./wolfcrypt/src/memory.c",
"./wolfcrypt/src/pkcs12.c",
"./wolfcrypt/src/pkcs7.c",
"./wolfcrypt/src/poly1305.c",
"./wolfcrypt/src/pwdbased.c",
"./wolfcrypt/src/rabbit.c",
"./wolfcrypt/src/random.c",
"./wolfcrypt/src/rc2.c",
"./wolfcrypt/src/ripemd.c",
"./wolfcrypt/src/rsa.c",
"./wolfcrypt/src/selftest.c",
"./wolfcrypt/src/sha256.c",
"./wolfcrypt/src/sha3.c",
"./wolfcrypt/src/sha512.c",
"./wolfcrypt/src/sha.c",
"./wolfcrypt/src/signature.c",
"./wolfcrypt/src/sp_arm32.c",
"./wolfcrypt/src/sp_arm64.c",
"./wolfcrypt/src/sp_armthumb.c",
"./wolfcrypt/src/sp_c32.c",
"./wolfcrypt/src/sp_c64.c",
"./wolfcrypt/src/sp_cortexm.c",
"./wolfcrypt/src/sp_dsp32.c",
"./wolfcrypt/src/sp_int.c",
"./wolfcrypt/src/sp_x86_64.c",
"./wolfcrypt/src/srp.c",
"./wolfcrypt/src/tfm.c",
"./wolfcrypt/src/wc_dsp.c",
"./wolfcrypt/src/wc_encrypt.c",
"./wolfcrypt/src/wc_pkcs11.c",
"./wolfcrypt/src/wc_port.c",
"./wolfcrypt/src/wolfcrypt_first.c",
"./wolfcrypt/src/wolfcrypt_last.c",
"./wolfcrypt/src/wolfevent.c",
"./wolfcrypt/src/wolfmath.c",
],
}

37
IDE/Android/README.md Normal file
View File

@ -0,0 +1,37 @@
# Android wolfSSL Support
Tested on Android v8.1 with WPA Supplicant and KeyStore to replace BoringSSL.
## Files
* `Android.bp`: Template build system file for wolfSSL.
* `user_settings.h`: Template build settings for wolfSSL
## Installation
1) Place the wolfSSL library into `./external/wolfssl`
2) Copy `Android.bp` into `./external/wolfssl`
3) Copy `user_settings.h` into `./external/wolfssl`
4) Add `PRODUCT_PACKAGES += libwolfssl` to your device .mk.
## Typical Android build instruction
```sh
source build/envsetup.sh
lunch [num]
mm -j8
```
## Using wolfSSL in your Application
In your `Android.mk` build file for your application add the following:
```makefile
# Crypto Provider - wolfSSL
LOCAL_CFLAGS += -DWOLFSSL_USER_SETTINGS -Iexternal/wolfssl -Iexternal/wolfssl/wolfssl
LOCAL_SHARED_LIBRARIES += libwolfssl
```
## Support
For questions please email support@wolfssl.com

8
IDE/Android/include.am Normal file
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/Android/Android.bp \
IDE/Android/README.md \
IDE/Android/user_settings.h

141
IDE/Android/user_settings.h Normal file
View File

@ -0,0 +1,141 @@
/* Custom build settings for Android */
#ifndef _WOLF_USER_SETTINGS_H_
#define _WOLF_USER_SETTINGS_H_
#if 0
#define HAVE_FIPS_VERSION 2
#define HAVE_FIPS
#endif
#ifdef __aarch64__
#if !defined(__clang__) || \
(defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 5)
/* older clang v4 has issue with inline assembly contraints */
#define WOLFSSL_ARMASM
#endif
#endif
#if 1 /* SP Assembly Speedups (wPAA) */
#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
#ifdef WOLFSSL_ARMASM
#define WOLFSSL_SP_ARM64_ASM
#endif
#endif
/* WPA Supplicant Support */
#define WOLFSSL_WPAS_SMALL
#define OPENSSL_ALL
#define HAVE_THREAD_LS
#define USE_FAST_MATH
#define FP_MAX_BITS (4096*2) /* Maximum math bits (Max RSA key bits * 2) */
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define WC_RSA_BLINDING
#define HAVE_HASHDRBG
#if 1
#define WOLFSSL_TLS13
#endif
#define WC_RSA_PSS
#define HAVE_SESSION_TICKET
#define HAVE_TLS_EXTENSIONS
#define HAVE_SUPPORTED_CURVES
#define HAVE_EXTENDED_MASTER
#define HAVE_ENCRYPT_THEN_MAC
#define WOLFSSL_ENCRYPTED_KEYS
#define HAVE_KEYING_MATERIAL
#define NO_OLD_TLS
#define NO_CHECK_PRIVATE_KEY
/* enable PK callback support for signing operations to key store */
#define HAVE_PK_CALLBACKS
/* crypto callback support is not in FIPS 3389 */
#ifndef HAVE_FIPS
#define WOLF_CRYPTO_CB
#endif
#define KEEP_OUR_CERT
#define KEEP_PEER_CERT
#define WOLFSSL_ALWAYS_VERIFY_CB
#define WOLFSSL_ALWAYS_KEEP_SNI
#define HAVE_EX_DATA
#define HAVE_EXT_CACHE
#define WOLFSSL_EITHER_SIDE
#define WOLFSSL_PUBLIC_MP
#define WOLFSSL_DER_LOAD
#define WOLFSSL_CERT_GEN
#define WOLFSSL_CERT_EXT
#define WOLFSSL_CERT_REQ
#define WOLFSSL_KEY_GEN
#define WC_RSA_NO_PADDING
#define WOLFSSL_DH_CONST
#define HAVE_FFDHE_2048
#define HAVE_FFDHE_3072
#define HAVE_FFDHE_4096
#define HAVE_DH_DEFAULT_PARAMS
#ifdef HAVE_FIPS
#define WOLFSSL_VALIDATE_FFC_IMPORT
#define HAVE_FFDHE_Q
#endif
#define WOLFSSL_SHA224
#define WOLFSSL_SHA512
#define WOLFSSL_SHA384
#define WOLFSSL_NOSHA512_256
#define WOLFSSL_NOSHA512_224
#define WOLFSSL_SHA3
#define HAVE_HKDF
#define HAVE_PKCS8
#define HAVE_ECC
#define TFM_ECC256
#define ECC_SHAMIR
#define HAVE_COMP_KEY
#ifdef HAVE_FIPS
#define HAVE_ECC_CDH
#define WOLFSSL_VALIDATE_ECC_IMPORT
#endif
#ifdef __i386
#define TFM_NO_ASM
#endif
#define HAVE_AESGCM
#define HAVE_AESCCM
#define WOLFSSL_AES_DIRECT
#define WOLFSSL_AES_COUNTER
#define HAVE_AES_ECB
#define WOLFSSL_CMAC
#define WOLFSSL_BASE64_ENCODE
#define HAVE_CRL
#define NO_DSA
#define NO_RC4
#define NO_HC128
#define NO_RABBIT
#define NO_RC4
#define NO_PSK
#define WOLFSSL_NO_SHAKE256
#define NO_MD4
#define NO_OLD_MD5_NAME
#define NO_OLD_SHA_NAMES
#define NO_OLD_SHA256_NAMES
#define NO_OLD_WC_NAMES
#if 0
#define DEBUG_WOLFSSL
#define WOLFSSL_ANDROID_DEBUG
#endif
#endif /* _WOLF_USER_SETTINGS_H_ */

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -18,6 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -41,6 +41,7 @@ extern "C" {
#endif
#if defined(WOLFSSL_CRYPTOCELL)
/* see SASI_AES_KEY_MAX_SIZE_IN_BYTES in the nRF5 SDK */
#define AES_MAX_KEY_SIZE 128
#endif /* WOLFSSL_CRYPTOCELL*/
@ -137,6 +138,9 @@ extern "C" {
#if 1
#define HAVE_ECC
#include <strings.h>
/* strings.h required for strncasecmp */
/* Manually define enabled curves */
#undef ECC_USER_CURVES
#define ECC_USER_CURVES

View File

@ -1,71 +1,64 @@
# Deos Port
## Overview
You can enable the wolfSSL support for Deos RTOS available [here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using the `#define WOLFSSL_DEOS`.
Deos is a time & space partitioned, multi-core enabled, DO-178C DAL A certifiable RTOS.
You can enable the wolfSSL support for Deos RTOS available
[here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using
the `#define WOLFSSL_DEOS`. Deos is a time & space partitioned,
multi-core enabled, DO-178C DAL A certifiable RTOS.
## Usage
You can start with your OpenArbor IDE-based example project for Deos with the network stack (lwip) to integrate wolfSSL source code.
You can start with your OpenArbor IDE-based example project for Deos
with the network stack (lwip) to integrate wolfSSL source code.
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/DEOS/user_settings.h` file.
wolfSSL supports a compile-time user configurable options in the
`IDE/ECLIPSE/DEOS/user_settings.h` file.
The `tls_wolfssl.c` example application provides a simple function to run the selected examples at compile time through the following four #defines in user_settings.h. You can undefine any of these macro options to run a test.
```
1. #undef NO_CRYPT_TEST
2. #undef NO_CRYPT_BENCHMARK
3. #undef NO_WOLFSSL_CLIENT
4. #undef NO_WOLFSSL_SERVER
```
Do one of the following steps for building and running wolfSSL with the Deos kernel examples, which are included in the DDS release:
If you want to create a project from scratch, skip the Importing the project section and follow the steps in the other sections.
### Importing the project
If you want to use an pre-configured example project, go to the Importing the project section, skip the other sections and follow the Building and Running section.
#### Importing the project
In this section you will import a pre-configured example project.
Note: To work wolfssl directory must not be under the workspace directory.
1. Launch the OpenArbor IDE as an administrator
2. In the Workspace Launcher dialog, in the Workspace field, enter your
workspace
2. In the Workspace Launcher dialog, in the Workspace field, enter
your workspace
3. Right-click in the Project Explorer view and select Import
4. In the Import dialog, select General > Existing Projects into Workspace, then click Next.
5. In the Import Projects dialog, select Select archive file, then browse to `IDE/ECLIPSE/DEOS/` and double-click `deosWolfssl.zip` file
4. In the Import dialog, select General > Existing Projects into
Workspace, then click Next.
5. In the Import Projects dialog, select `Select root directory` and
browse to `IDE/ECLIPSE/DEOS/deos_wolfssl` and select the wolfssl
project
6. In the Import Projects dialog, click Finish
#### Dependencies
* ansi
* gnu-language
* deos-time
### Setting up a Deos project with wolfSSL
The `tls_wolfssl.c` example application provides a simple function to
run the selected examples at compile time through the following four
`#defines` in `user_settings.h`. You can undefine any of these macro
options to run a test.
#### Setting up a Deos project with wolfSSL
1. Download the wolfSSL source code or a zip file from GitHub. You can remove all of the files except for these folders and its contents. The top folder for this example is wolfsslPort.
```
wolfsslPort
|-- IDE
| -- ECLIPSE
| -- DEOS
|-- src
|-- wolfcrypt
| -- benchmark
| -- src
| -- test
|-- wolfssl
|-- openssl
|-- wolfcrypt
|-- port
#undef NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
#undef NO_WOLFSSL_CLIENT
#undef NO_WOLFSSL_SERVER
```
2. Remove these two platform specific assembly source files:
- wolfsslPort/wolfcrypt/src/aes_asm.asm
- wolfsslPort/wolfcrypt/src/aes_asm.S
3. Launch the OpenArbor IDE as an administrator
4. Create a DDC-I Deos example project. In the main menu, go to File >DDC-I Deos example project > socket > udp-vs-tcp
5. Import the `wolfSSLPort` source code into your project.
- Right-click the ` udp-vs-tcp` project and choose File -> Import.
- Expand the General folder and select File System, then click Next. You should now see the Import File system dialog.
- Browse to the location containing the wolfSSL code and choose OK. Select the `wolfsslPort` folder and check the `Create top-level folder` button, then select Finish. You should see the folder hierarchy the same as wolfSSL folder structures.
6. Review the configuration in $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h
1. Launch the OpenArbor IDE
7. Review the custom malloc/realloc/free configuration $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/deos_malloc.c . Memory allocated with malloc() is never freed.
2. Create a DDC-I Deos example project. In the main menu, go to File >
DDC-I Deos example project > socket > udp-vs-tcp
3. Customize your config/udp-vs-tcp.pd.xml with the following changes:
#### Configuring the Deos Project
1. Customize your config/udp-vs-tcp.pd.xml with the following changes:
```
<processTemplate
mutexQuota = "5"
@ -90,35 +83,54 @@ wolfsslPort
</processTemplate>
```
Depending on your configuration, wolfSSL uses upto four mutexes. You also need to configure enough memory for the stack of each threads and the process logical memory pool.
Depending on your configuration, wolfSSL uses upto four mutexes. You
also need to configure enough memory for the stack of each threads and
the process logical memory pool.
4. Right click on the `udp-vs-tcp` project, select properties and add
the following macros in the DDC-I Options > C Compile >
Preprocessor
* WOLFSSL_USER_SETTINGS
5. Add the following directory paths in the DDC-I Options > C Compile >
Directories and in the DDC-I Options > C++ Compile > Directories
* $(PROJECT_DIR.wolfssl)/../../../..
* $(PROJECT_DIR.wolfssl)/..
* $(PROJECT_DIR.printx)/code
6. Add the following library dependencies in the
DDC-I Options > Deos > Dependencies
* math
* ansi
* deos-time
For benchmark and test code:
* printx - You must add printx into your workspace, File >DDC-I
Deos example project > training > printx
7. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to
customize your configuration. For example, you can undef or define
these tests.
* `#undef NO_CRYPT_TEST`
* `#undef NO_CRYPT_BENCHMARK`
* `#undef NO_WOLFSSL_CLIENT`
* `#undef NO_WOLFSSL_SERVER`
8. Edit your application source file where main() thread is defined
and add the following:
* #include "printx.h"
* #include "tls_wolfssl.h"
* and a call to `wolfsslRunTests()`
2. Right click on the `udp-vs-tcp` project, select properties and add the following macros in the DDC-I Options > C Compile > Preprocessor
- DEOS_ALLOW_OBSOLETE_DEFINITIONS
- WOLFSSL_USER_SETTINGS
3. Add the following directory paths in the DDC-I Options > C Compile > Directories and in the DDC-I Options > C++ Compile > Directories
- $(PROJECT_DIR)/wolfsslPort
- $(PROJECT_DIR)/wolfsslPort/wolfssl
- $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS
- $(PROJECT_DIR.printx)/code
4. Change the optimization level in the DDC-I Options > C Compile > Code Generation > Optimization level:g
- g
5. Add the following library dependencies in the DDC-I Options > Deos > Dependencies
- math
- dart
- ansi
- printx
- You must add printx into your workspace, File >DDC-I Deos example project > training > printx
6. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to customize your configuration. For example, you can undef or define these tests.
- #undef NO_CRYPT_TEST
- #undef NO_CRYPT_BENCHMARK
- #undef NO_WOLFSSL_CLIENT
- #undef NO_WOLFSSL_SERVER
7. Edit your application source file where main() thread is defined and add the following:
- #include "printx.h"
- #include "tls_wolfssl.h"
- and a call to `wolfsslRunTests()`
Here's an example:
```
#include <deos.h>
#include <printx.h>
@ -137,7 +149,10 @@ int main(void)
}
```
8. Review $(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config configuration.
9. Review `$(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config`
configuration.
```
transportConfigurationId
2 # Client thread quota - for client and server TCP
@ -166,45 +181,62 @@ userServiceThread # Server thread template name
/
```
#### Building and Running
1. Build your project, then load and run your image on a target platform. Review the test results on the console output.
#### Building and Running
1. Build your project, then load and run your image on a target
platform. Review the test results on the console output.
### `wolfcrypt_test()`
wolfcrypt_test() prints a message on the target console similar to the following output:
`wolfcrypt_test()` prints a message on similar to the following:
```
error test passed!
base64 test passed!
asn test passed!
...
```
This example doesn't show the whole output.
### `benchmark_test()`
benchmark_test() prints a message on the target console similar to the following output.
`benchmark_test()` prints a message on the similar to the following:
```
------------------------------------------------------------------------------
wolfSSL version 3.15.5
wolfSSL version 4.6.0
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 225 KB tooks 1.026 seconds, 219.313 KB/s
AES-128-CBC-enc 250 KB toks 1.105 seconds 226.210 KB/s
AES-128-CBC-dec 225 KB tooks 1.005 seconds, 223.922 KB/s
RNG 2 MB took 1.000 seconds, 2.124 MB/s
AES-128-CBC-enc 5 MB took 1.000 seconds, 5.127 MB/s
AES-128-CBC-dec 5 MB took 1.000 seconds, 4.907 MB/s
AES-192-CBC-enc 5 MB took 1.000 seconds, 4.736 MB/s
AES-192-CBC-dec 5 MB took 1.000 seconds, 4.761 MB/s
...
```
This example doesn't show the whole output.
### `wolfssl_client_test()`
You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros in the `tls_wolfssl.c` file to configure the host address and port. You will also need to define the server certificate. The example client uses the GET request to get a web resource from the server at https://google.com.
You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros
in the `tls_wolfssl.c` file to configure the host address and
port. You will also need to define the server certificate. The example
client uses the GET request to get a web resource from the server at
https://google.com.
### `wolfssl_server_test()`
You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to configure the port number to listen on a local-host.
Once you start the TLS server and `Listening for client connection` displays on the serial console, the server is ready to accept client connections.
You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to
configure the port number to listen on a local-host. Once you start
the TLS server and `Listening for client connection` displays on the
serial console, the server is ready to accept client connections.
You can connect to the server using the wolfssl TLS client example
from your Linux or Windows host as follows:
You can connect to the server using the wolfssl TLS client example from your Linux or Windows host as follows:
```
$ ./examples/client/client.exe -h TLS_SERVER_IP_ADDRESS
@ -218,8 +250,10 @@ I hear ya fa shizzle!
## References
The test results were collected from the qemu-x86 reference platform target with the following software and tool chains:
- OpenArbor, eclipse based IDE, toolVersion = "3.31.0"
The following software and tool chains were used for testing:
- OpenArbor 7.0.0
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
For more information or questions, please email [support@wolfssl.com](mailto:support@wolfssl.com)
For more information or questions, please email
[support@wolfssl.com](mailto:support@wolfssl.com)

View File

@ -1,6 +1,6 @@
/* deos_malloc.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -19,27 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1))
#define SIZEOF_HEADER sizeof(size_t) /* tracks size of allocated block */
#define HEAP_SIZE_MAX (1*1024*1024)
static size_t allocatedMemory = 0;
size_t getMemAllocatedSize_deos(size_t* size){
if (size)
*size = allocatedMemory;
return allocatedMemory;
}
/* Simply returns without freeing any memory. */
#include <wolfssl/wolfcrypt/types.h>
#include <deos.h>
void free_deos(void *ptr) {
//printf("fake free_deos()\n");
free(ptr);
return;
}
@ -51,10 +35,6 @@ void *realloc_deos(void *ptr, size_t size) {
newptr = malloc_deos(size);
if (ptr != NULL && newptr != NULL) {
if ( *((char *)ptr - SIZEOF_HEADER) < *((char *)newptr - SIZEOF_HEADER))
size = *((char *)ptr - SIZEOF_HEADER);
XMEMCPY((char *) newptr, (const char *) ptr, size);
free_deos(ptr);
}
@ -63,46 +43,5 @@ void *realloc_deos(void *ptr, size_t size) {
}
void *malloc_deos(size_t size) {
PDEOS_SYSTEM_INFO systemInfoPtr;
static VirtualAddressTYP heapAddr = NULL;
static VirtualAddressTYP freeAddr = NULL;
VirtualAddressTYP retAddr = NULL;
DWORD allocationSize = 0;
static int initialized = 0;
if (size <= 0)
return NULL;
if (!initialized) {
systemInfoPtr = (PDEOS_SYSTEM_INFO)getSystemInfoDEOS();
freeAddr = (VirtualAddressTYP)getNextLibraryStartAddress();
allocationSize = (((HEAP_SIZE_MAX - 1) / systemInfoPtr->dwPageSize) + 1) *
systemInfoPtr->dwPageSize;
if (virtualAllocDEOS(freeAddr, allocationSize) != allocSuccess){
printf("ERROR: virtualAllocDEOS failed\n");
return NULL;
}
setNextLibraryStartAddress(freeAddr + allocationSize);
heapAddr = freeAddr;
initialized = 1;
}
size = ROUND_UP(size, sizeof(size_t));
if ((size + SIZEOF_HEADER) > (HEAP_SIZE_MAX - (freeAddr - heapAddr))){
printf("ERROR: malloc_deos cannot allocate from heap memory anymore\n");
return NULL;
}
*freeAddr = size;
freeAddr += SIZEOF_HEADER;
retAddr = freeAddr;
XMEMSET(retAddr, 0, size);
freeAddr += size;
allocatedMemory += size;
return retAddr;
return malloc(size);
}

View File

@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.eclipse.cdt.core.default.config.472844465">
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.472844465" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
<externalSettings/>
<extensions/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry base-path="C:/DDC-I/desk/ppc/include" include="./" kind="inc" path="" system="true"/>
<pathentry base-path="C:/DDC-I/desk/include" include="./" kind="inc" path="" system="true"/>
<pathentry base-path="C:/" include="./" kind="inc" path="" system="true"/>
<pathentry kind="mac" name="DIAGNOSTIC" path="" value=""/>
<pathentry kind="mac" name="WOLFSSL_USER_SETTINGS" path="" value=""/>
<pathentry kind="mac" name="__OpenArbor_editor" path="" value=""/>
<pathentry kind="mac" name="__DBL_MIN_EXP__" path="" value="(-1021)"/>
<pathentry kind="mac" name="__FLT32X_MAX_EXP__" path="" value="1024"/>
<pathentry kind="mac" name="__builtin_vsx_xvmsubmsp" path="" value="__builtin_vsx_xvmsubsp"/>
<pathentry kind="mac" name="__UINT_LEAST16_MAX__" path="" value="0xffff"/>
<pathentry kind="mac" name="__ATOMIC_ACQUIRE" path="" value="2"/>
<pathentry kind="mac" name="__FLT_MIN__" path="" value="1.1754943508222875e-38F"/>
<pathentry kind="mac" name="__GCC_IEC_559_COMPLEX" path="" value="2"/>
<pathentry kind="mac" name="__UINT_LEAST8_TYPE__" path="" value="unsigned char"/>
<pathentry kind="mac" name="__INTMAX_C(c)" path="" value="c ## LL"/>
<pathentry kind="mac" name="__CHAR_BIT__" path="" value="8"/>
<pathentry kind="mac" name="__UINT8_MAX__" path="" value="0xff"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmaddadp" path="" value="__builtin_vsx_xvnmadddp"/>
<pathentry kind="mac" name="__WINT_MAX__" path="" value="0xffffffffU"/>
<pathentry kind="mac" name="__FLT32_MIN_EXP__" path="" value="(-125)"/>
<pathentry kind="mac" name="__builtin_vsx_xxlnor" path="" value="__builtin_vec_nor"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmsubmdp" path="" value="__builtin_vsx_xvnmsubdp"/>
<pathentry kind="mac" name="__ORDER_LITTLE_ENDIAN__" path="" value="1234"/>
<pathentry kind="mac" name="__SIZE_MAX__" path="" value="0xffffffffU"/>
<pathentry kind="mac" name="__WCHAR_MAX__" path="" value="0x7fffffffL"/>
<pathentry kind="mac" name="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1" path="" value="1"/>
<pathentry kind="mac" name="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2" path="" value="1"/>
<pathentry kind="mac" name="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" path="" value="1"/>
<pathentry kind="mac" name="__DBL_DENORM_MIN__" path="" value="((double)4.9406564584124654e-324L)"/>
<pathentry kind="mac" name="__GCC_ATOMIC_CHAR_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__GCC_IEC_559" path="" value="2"/>
<pathentry kind="mac" name="__FLT32X_DECIMAL_DIG__" path="" value="17"/>
<pathentry kind="mac" name="__FLT_EVAL_METHOD__" path="" value="0"/>
<pathentry kind="mac" name="__unix__" path="" value="1"/>
<pathentry kind="mac" name="__FLT64_DECIMAL_DIG__" path="" value="17"/>
<pathentry kind="mac" name="__GCC_ATOMIC_CHAR32_T_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="pixel" path="" value="pixel"/>
<pathentry kind="mac" name="bool" path="" value="bool"/>
<pathentry kind="mac" name="__UINT_FAST64_MAX__" path="" value="0xffffffffffffffffULL"/>
<pathentry kind="mac" name="__SIG_ATOMIC_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__DBL_MIN_10_EXP__" path="" value="(-307)"/>
<pathentry kind="mac" name="__FINITE_MATH_ONLY__" path="" value="0"/>
<pathentry kind="mac" name="__GNUC_PATCHLEVEL__" path="" value="0"/>
<pathentry kind="mac" name="__FLT32_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmaddasp" path="" value="__builtin_vsx_xvnmaddsp"/>
<pathentry kind="mac" name="__UINT_FAST8_MAX__" path="" value="0xffffffffU"/>
<pathentry kind="mac" name="__has_include(STR)" path="" value="__has_include__(STR)"/>
<pathentry kind="mac" name="__DEC64_MAX_EXP__" path="" value="385"/>
<pathentry kind="mac" name="__INT8_C(c)" path="" value="c"/>
<pathentry kind="mac" name="__INT_LEAST8_WIDTH__" path="" value="8"/>
<pathentry kind="mac" name="__UINT_LEAST64_MAX__" path="" value="0xffffffffffffffffULL"/>
<pathentry kind="mac" name="__SHRT_MAX__" path="" value="0x7fff"/>
<pathentry kind="mac" name="__LDBL_MAX__" path="" value="1.7976931348623157e+308L"/>
<pathentry kind="mac" name="__UINT_LEAST8_MAX__" path="" value="0xff"/>
<pathentry kind="mac" name="__GCC_ATOMIC_BOOL_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="_ARCH_PPC" path="" value="1"/>
<pathentry kind="mac" name="__UINTMAX_TYPE__" path="" value="long long unsigned int"/>
<pathentry kind="mac" name="__DEC32_EPSILON__" path="" value="1E-6DF"/>
<pathentry kind="mac" name="__FLT_EVAL_METHOD_TS_18661_3__" path="" value="0"/>
<pathentry kind="mac" name="__CHAR_UNSIGNED__" path="" value="1"/>
<pathentry kind="mac" name="__UINT32_MAX__" path="" value="0xffffffffUL"/>
<pathentry kind="mac" name="__LDBL_MAX_EXP__" path="" value="1024"/>
<pathentry kind="mac" name="__WINT_MIN__" path="" value="0U"/>
<pathentry kind="mac" name="__builtin_vsx_xvmaddmdp" path="" value="__builtin_vsx_xvmadddp"/>
<pathentry kind="mac" name="__builtin_vsx_vperm" path="" value="__builtin_vec_perm"/>
<pathentry kind="mac" name="__INT_LEAST16_WIDTH__" path="" value="16"/>
<pathentry kind="mac" name="__SCHAR_MAX__" path="" value="0x7f"/>
<pathentry kind="mac" name="__WCHAR_MIN__" path="" value="(-__WCHAR_MAX__ - 1)"/>
<pathentry kind="mac" name="vector" path="" value="vector"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmsubmsp" path="" value="__builtin_vsx_xvnmsubsp"/>
<pathentry kind="mac" name="__INT64_C(c)" path="" value="c ## LL"/>
<pathentry kind="mac" name="__DBL_DIG__" path="" value="15"/>
<pathentry kind="mac" name="__GCC_ATOMIC_POINTER_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__SIZEOF_INT__" path="" value="4"/>
<pathentry kind="mac" name="__SIZEOF_POINTER__" path="" value="4"/>
<pathentry kind="mac" name="__USER_LABEL_PREFIX__" path="" value=""/>
<pathentry kind="mac" name="__STDC_HOSTED__" path="" value="1"/>
<pathentry kind="mac" name="__LDBL_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__builtin_vsx_xvmaddmsp" path="" value="__builtin_vsx_xvmaddsp"/>
<pathentry kind="mac" name="__FLT32_DIG__" path="" value="6"/>
<pathentry kind="mac" name="__FLT_EPSILON__" path="" value="1.1920928955078125e-7F"/>
<pathentry kind="mac" name="__SHRT_WIDTH__" path="" value="16"/>
<pathentry kind="mac" name="_CALL_SYSV" path="" value="1"/>
<pathentry kind="mac" name="__LDBL_MIN__" path="" value="2.2250738585072014e-308L"/>
<pathentry kind="mac" name="__STDC_UTF_16__" path="" value="1"/>
<pathentry kind="mac" name="__DEC32_MAX__" path="" value="9.999999E96DF"/>
<pathentry kind="mac" name="__FLT32X_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__INT32_MAX__" path="" value="0x7fffffffL"/>
<pathentry kind="mac" name="__INT_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__SIZEOF_LONG__" path="" value="4"/>
<pathentry kind="mac" name="__UINT16_C(c)" path="" value="c"/>
<pathentry kind="mac" name="__PTRDIFF_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__DECIMAL_DIG__" path="" value="17"/>
<pathentry kind="mac" name="__FLT64_EPSILON__" path="" value="2.2204460492503131e-16F64"/>
<pathentry kind="mac" name="__INTMAX_WIDTH__" path="" value="64"/>
<pathentry kind="mac" name="__has_include_next(STR)" path="" value="__has_include_next__(STR)"/>
<pathentry kind="mac" name="__LDBL_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__FLT64_MANT_DIG__" path="" value="53"/>
<pathentry kind="mac" name="__GNUC__" path="" value="7"/>
<pathentry kind="mac" name="__FLT_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__SIZEOF_LONG_DOUBLE__" path="" value="8"/>
<pathentry kind="mac" name="__BIGGEST_ALIGNMENT__" path="" value="16"/>
<pathentry kind="mac" name="__FLT64_MAX_10_EXP__" path="" value="308"/>
<pathentry kind="mac" name="__DBL_MAX__" path="" value="((double)1.7976931348623157e+308L)"/>
<pathentry kind="mac" name="__INT_FAST32_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__DBL_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmaddmdp" path="" value="__builtin_vsx_xvnmadddp"/>
<pathentry kind="mac" name="__DEC32_MIN_EXP__" path="" value="(-94)"/>
<pathentry kind="mac" name="__builtin_vsx_xxlandc" path="" value="__builtin_vec_andc"/>
<pathentry kind="mac" name="__INTPTR_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__FLT32X_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__INT_FAST16_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__LDBL_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__DEC128_MAX__" path="" value="9.999999999999999999999999999999999E6144DL"/>
<pathentry kind="mac" name="__INT_LEAST32_MAX__" path="" value="0x7fffffffL"/>
<pathentry kind="mac" name="__DEC32_MIN__" path="" value="1E-95DF"/>
<pathentry kind="mac" name="__DBL_MAX_EXP__" path="" value="1024"/>
<pathentry kind="mac" name="__WCHAR_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__FLT32_MAX__" path="" value="3.4028234663852886e+38F32"/>
<pathentry kind="mac" name="__DEC128_EPSILON__" path="" value="1E-33DL"/>
<pathentry kind="mac" name="__PTRDIFF_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__FLT32_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__LONG_LONG_MAX__" path="" value="0x7fffffffffffffffLL"/>
<pathentry kind="mac" name="__SIZEOF_SIZE_T__" path="" value="4"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmaddmsp" path="" value="__builtin_vsx_xvnmaddsp"/>
<pathentry kind="mac" name="__PPC__" path="" value="1"/>
<pathentry kind="mac" name="__SIZEOF_WINT_T__" path="" value="4"/>
<pathentry kind="mac" name="__LONG_LONG_WIDTH__" path="" value="64"/>
<pathentry kind="mac" name="__FLT32_MAX_EXP__" path="" value="128"/>
<pathentry kind="mac" name="__GXX_ABI_VERSION" path="" value="1011"/>
<pathentry kind="mac" name="__FLT_MIN_EXP__" path="" value="(-125)"/>
<pathentry kind="mac" name="__INT_FAST64_TYPE__" path="" value="long long int"/>
<pathentry kind="mac" name="__FP_FAST_FMAF" path="" value="1"/>
<pathentry kind="mac" name="__FP_FAST_FMAL" path="" value="1"/>
<pathentry kind="mac" name="__FLT64_DENORM_MIN__" path="" value="4.9406564584124654e-324F64"/>
<pathentry kind="mac" name="__DBL_MIN__" path="" value="((double)2.2250738585072014e-308L)"/>
<pathentry kind="mac" name="__FLT32X_EPSILON__" path="" value="2.2204460492503131e-16F32x"/>
<pathentry kind="mac" name="__FLT64_MIN_EXP__" path="" value="(-1021)"/>
<pathentry kind="mac" name="__FLT64_MIN_10_EXP__" path="" value="(-307)"/>
<pathentry kind="mac" name="__DEC128_MIN__" path="" value="1E-6143DL"/>
<pathentry kind="mac" name="__REGISTER_PREFIX__" path="" value=""/>
<pathentry kind="mac" name="__UINT16_MAX__" path="" value="0xffff"/>
<pathentry kind="mac" name="__DBL_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__builtin_vsx_xxland" path="" value="__builtin_vec_and"/>
<pathentry kind="mac" name="__FLT32_MIN__" path="" value="1.1754943508222875e-38F32"/>
<pathentry kind="mac" name="__UINT8_TYPE__" path="" value="unsigned char"/>
<pathentry kind="mac" name="__NO_INLINE__" path="" value="1"/>
<pathentry kind="mac" name="__FLT_MANT_DIG__" path="" value="24"/>
<pathentry kind="mac" name="__LDBL_DECIMAL_DIG__" path="" value="17"/>
<pathentry kind="mac" name="__VERSION__" path="" value="&quot;7.3.0&quot;"/>
<pathentry kind="mac" name="__UINT64_C(c)" path="" value="c ## ULL"/>
<pathentry kind="mac" name="__BIG_ENDIAN__" path="" value="1"/>
<pathentry kind="mac" name="__GCC_ATOMIC_INT_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__pixel" path="" value="__attribute__((altivec(pixel__))) unsigned short"/>
<pathentry kind="mac" name="__FLT32_MANT_DIG__" path="" value="24"/>
<pathentry kind="mac" name="__FLOAT_WORD_ORDER__" path="" value="__ORDER_BIG_ENDIAN__"/>
<pathentry kind="mac" name="__SCHAR_WIDTH__" path="" value="8"/>
<pathentry kind="mac" name="__INT32_C(c)" path="" value="c ## L"/>
<pathentry kind="mac" name="__DEC64_EPSILON__" path="" value="1E-15DD"/>
<pathentry kind="mac" name="__ORDER_PDP_ENDIAN__" path="" value="3412"/>
<pathentry kind="mac" name="__DEC128_MIN_EXP__" path="" value="(-6142)"/>
<pathentry kind="mac" name="__FLT32_MAX_10_EXP__" path="" value="38"/>
<pathentry kind="mac" name="__INT_FAST32_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__UINT_LEAST16_TYPE__" path="" value="short unsigned int"/>
<pathentry kind="mac" name="unix" path="" value="1"/>
<pathentry kind="mac" name="__INT16_MAX__" path="" value="0x7fff"/>
<pathentry kind="mac" name="__SIZE_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__UINT64_MAX__" path="" value="0xffffffffffffffffULL"/>
<pathentry kind="mac" name="__INT8_TYPE__" path="" value="signed char"/>
<pathentry kind="mac" name="__ELF__" path="" value="1"/>
<pathentry kind="mac" name="__HAVE_BSWAP__" path="" value="1"/>
<pathentry kind="mac" name="__FLT_RADIX__" path="" value="2"/>
<pathentry kind="mac" name="__INT_LEAST16_TYPE__" path="" value="short int"/>
<pathentry kind="mac" name="__LDBL_EPSILON__" path="" value="2.2204460492503131e-16L"/>
<pathentry kind="mac" name="__UINTMAX_C(c)" path="" value="c ## ULL"/>
<pathentry kind="mac" name="__SIG_ATOMIC_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__GCC_ATOMIC_WCHAR_T_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__SIZEOF_PTRDIFF_T__" path="" value="4"/>
<pathentry kind="mac" name="__FLT32X_MANT_DIG__" path="" value="53"/>
<pathentry kind="mac" name="__FLT32X_MIN_EXP__" path="" value="(-1021)"/>
<pathentry kind="mac" name="__DEC32_SUBNORMAL_MIN__" path="" value="0.000001E-95DF"/>
<pathentry kind="mac" name="__INT_FAST16_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__vector" path="" value="__attribute__((altivec(vector__)))"/>
<pathentry kind="mac" name="__FLT64_DIG__" path="" value="15"/>
<pathentry kind="mac" name="__UINT_FAST32_MAX__" path="" value="0xffffffffU"/>
<pathentry kind="mac" name="__UINT_LEAST64_TYPE__" path="" value="long long unsigned int"/>
<pathentry kind="mac" name="__builtin_vsx_xvmsubadp" path="" value="__builtin_vsx_xvmsubdp"/>
<pathentry kind="mac" name="__builtin_vsx_xxsel" path="" value="__builtin_vec_sel"/>
<pathentry kind="mac" name="__FLT_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__bool" path="" value="__attribute__((altivec(bool__))) unsigned"/>
<pathentry kind="mac" name="__FLT_MAX_10_EXP__" path="" value="38"/>
<pathentry kind="mac" name="__LONG_MAX__" path="" value="0x7fffffffL"/>
<pathentry kind="mac" name="__DEC128_SUBNORMAL_MIN__" path="" value="0.000000000000000000000000000000001E-6143DL"/>
<pathentry kind="mac" name="__FLT_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__unix" path="" value="1"/>
<pathentry kind="mac" name="__UINT_FAST16_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__DEC64_MAX__" path="" value="9.999999999999999E384DD"/>
<pathentry kind="mac" name="__INT_FAST32_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__CHAR16_TYPE__" path="" value="short unsigned int"/>
<pathentry kind="mac" name="__PRAGMA_REDEFINE_EXTNAME" path="" value="1"/>
<pathentry kind="mac" name="__SIZE_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__INT_LEAST16_MAX__" path="" value="0x7fff"/>
<pathentry kind="mac" name="__DEC64_MANT_DIG__" path="" value="16"/>
<pathentry kind="mac" name="__INT64_MAX__" path="" value="0x7fffffffffffffffLL"/>
<pathentry kind="mac" name="__UINT_LEAST32_MAX__" path="" value="0xffffffffUL"/>
<pathentry kind="mac" name="__FLT32_DENORM_MIN__" path="" value="1.4012984643248171e-45F32"/>
<pathentry kind="mac" name="__GCC_ATOMIC_LONG_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__SIG_ATOMIC_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__INT_LEAST64_TYPE__" path="" value="long long int"/>
<pathentry kind="mac" name="__INT16_TYPE__" path="" value="short int"/>
<pathentry kind="mac" name="__INT_LEAST8_TYPE__" path="" value="signed char"/>
<pathentry kind="mac" name="__STDC_VERSION__" path="" value="201112L"/>
<pathentry kind="mac" name="__DEC32_MAX_EXP__" path="" value="97"/>
<pathentry kind="mac" name="_BIG_ENDIAN" path="" value="1"/>
<pathentry kind="mac" name="__INT_FAST8_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__INTPTR_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__FLT64_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__PPC" path="" value="1"/>
<pathentry kind="mac" name="__FLT32_MIN_10_EXP__" path="" value="(-37)"/>
<pathentry kind="mac" name="__FLT32X_DIG__" path="" value="15"/>
<pathentry kind="mac" name="__builtin_vsx_xvmsubasp" path="" value="__builtin_vsx_xvmsubsp"/>
<pathentry kind="mac" name="__LDBL_MANT_DIG__" path="" value="53"/>
<pathentry kind="mac" name="__svr4__" path="" value="1"/>
<pathentry kind="mac" name="__DBL_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__FLT64_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__SIG_ATOMIC_MIN__" path="" value="(-__SIG_ATOMIC_MAX__ - 1)"/>
<pathentry kind="mac" name="__INTPTR_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__UINT16_TYPE__" path="" value="short unsigned int"/>
<pathentry kind="mac" name="__WCHAR_TYPE__" path="" value="long int"/>
<pathentry kind="mac" name="__SIZEOF_FLOAT__" path="" value="4"/>
<pathentry kind="mac" name="__UINTPTR_MAX__" path="" value="0xffffffffU"/>
<pathentry kind="mac" name="__INT_FAST64_WIDTH__" path="" value="64"/>
<pathentry kind="mac" name="__DEC64_MIN_EXP__" path="" value="(-382)"/>
<pathentry kind="mac" name="__FLT32_DECIMAL_DIG__" path="" value="9"/>
<pathentry kind="mac" name="__INT_FAST64_MAX__" path="" value="0x7fffffffffffffffLL"/>
<pathentry kind="mac" name="__GCC_ATOMIC_TEST_AND_SET_TRUEVAL" path="" value="1"/>
<pathentry kind="mac" name="__FLT_DIG__" path="" value="6"/>
<pathentry kind="mac" name="__FLT32_HAS_INFINITY__" path="" value="1"/>
<pathentry kind="mac" name="__UINT_FAST64_TYPE__" path="" value="long long unsigned int"/>
<pathentry kind="mac" name="__INT_MAX__" path="" value="0x7fffffff"/>
<pathentry kind="mac" name="__INT64_TYPE__" path="" value="long long int"/>
<pathentry kind="mac" name="__FLT_MAX_EXP__" path="" value="128"/>
<pathentry kind="mac" name="__builtin_vsx_xxlor" path="" value="__builtin_vec_or"/>
<pathentry kind="mac" name="__DBL_MANT_DIG__" path="" value="53"/>
<pathentry kind="mac" name="__INT_LEAST64_MAX__" path="" value="0x7fffffffffffffffLL"/>
<pathentry kind="mac" name="__GCC_ATOMIC_CHAR16_T_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__builtin_vsx_xxlxor" path="" value="__builtin_vec_xor"/>
<pathentry kind="mac" name="__DEC64_MIN__" path="" value="1E-383DD"/>
<pathentry kind="mac" name="__WINT_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__UINT_LEAST32_TYPE__" path="" value="long unsigned int"/>
<pathentry kind="mac" name="__SIZEOF_SHORT__" path="" value="2"/>
<pathentry kind="mac" name="__LDBL_MIN_EXP__" path="" value="(-1021)"/>
<pathentry kind="mac" name="__FLT64_MAX__" path="" value="1.7976931348623157e+308F64"/>
<pathentry kind="mac" name="__WINT_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__INT_LEAST8_MAX__" path="" value="0x7f"/>
<pathentry kind="mac" name="__FLT32X_MAX_10_EXP__" path="" value="308"/>
<pathentry kind="mac" name="__LDBL_MAX_10_EXP__" path="" value="308"/>
<pathentry kind="mac" name="__ATOMIC_RELAXED" path="" value="0"/>
<pathentry kind="mac" name="__DBL_EPSILON__" path="" value="((double)2.2204460492503131e-16L)"/>
<pathentry kind="mac" name="__UINT8_C(c)" path="" value="c"/>
<pathentry kind="mac" name="PPC" path="" value="1"/>
<pathentry kind="mac" name="__FLT64_MAX_EXP__" path="" value="1024"/>
<pathentry kind="mac" name="__INT_LEAST32_TYPE__" path="" value="long int"/>
<pathentry kind="mac" name="__SIZEOF_WCHAR_T__" path="" value="4"/>
<pathentry kind="mac" name="__UINT64_TYPE__" path="" value="long long unsigned int"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmsubadp" path="" value="__builtin_vsx_xvnmsubdp"/>
<pathentry kind="mac" name="__INT_FAST8_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__GNUC_STDC_INLINE__" path="" value="1"/>
<pathentry kind="mac" name="__FLT64_HAS_DENORM__" path="" value="1"/>
<pathentry kind="mac" name="__FLT32_EPSILON__" path="" value="1.1920928955078125e-7F32"/>
<pathentry kind="mac" name="__DBL_DECIMAL_DIG__" path="" value="17"/>
<pathentry kind="mac" name="__STDC_UTF_32__" path="" value="1"/>
<pathentry kind="mac" name="__INT_FAST8_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__DEC_EVAL_METHOD__" path="" value="2"/>
<pathentry kind="mac" name="__FLT32X_MAX__" path="" value="1.7976931348623157e+308F32x"/>
<pathentry kind="mac" name="__VEC_ELEMENT_REG_ORDER__" path="" value="__ORDER_BIG_ENDIAN__"/>
<pathentry kind="mac" name="__builtin_vsx_xvmaddadp" path="" value="__builtin_vsx_xvmadddp"/>
<pathentry kind="mac" name="__ORDER_BIG_ENDIAN__" path="" value="4321"/>
<pathentry kind="mac" name="__UINT32_C(c)" path="" value="c ## UL"/>
<pathentry kind="mac" name="__INTMAX_MAX__" path="" value="0x7fffffffffffffffLL"/>
<pathentry kind="mac" name="__BYTE_ORDER__" path="" value="__ORDER_BIG_ENDIAN__"/>
<pathentry kind="mac" name="__FLT_DENORM_MIN__" path="" value="1.4012984643248171e-45F"/>
<pathentry kind="mac" name="__builtin_vsx_xvnmsubasp" path="" value="__builtin_vsx_xvnmsubsp"/>
<pathentry kind="mac" name="__INT8_MAX__" path="" value="0x7f"/>
<pathentry kind="mac" name="__LONG_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__UINT_FAST32_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__CHAR32_TYPE__" path="" value="long unsigned int"/>
<pathentry kind="mac" name="__FLT_MAX__" path="" value="3.4028234663852886e+38F"/>
<pathentry kind="mac" name="__FP_FAST_FMA" path="" value="1"/>
<pathentry kind="mac" name="__INT32_TYPE__" path="" value="long int"/>
<pathentry kind="mac" name="__SIZEOF_DOUBLE__" path="" value="8"/>
<pathentry kind="mac" name="__FLT_MIN_10_EXP__" path="" value="(-37)"/>
<pathentry kind="mac" name="__FLT64_MIN__" path="" value="2.2250738585072014e-308F64"/>
<pathentry kind="mac" name="__INT_LEAST32_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__INTMAX_TYPE__" path="" value="long long int"/>
<pathentry kind="mac" name="__DEC128_MAX_EXP__" path="" value="6145"/>
<pathentry kind="mac" name="__FLT32X_HAS_QUIET_NAN__" path="" value="1"/>
<pathentry kind="mac" name="__ATOMIC_CONSUME" path="" value="1"/>
<pathentry kind="mac" name="__GNUC_MINOR__" path="" value="3"/>
<pathentry kind="mac" name="__INT_FAST16_WIDTH__" path="" value="32"/>
<pathentry kind="mac" name="__UINTMAX_MAX__" path="" value="0xffffffffffffffffULL"/>
<pathentry kind="mac" name="__DEC32_MANT_DIG__" path="" value="7"/>
<pathentry kind="mac" name="__FLT32X_DENORM_MIN__" path="" value="4.9406564584124654e-324F32x"/>
<pathentry kind="mac" name="__builtin_vsx_xvmaddasp" path="" value="__builtin_vsx_xvmaddsp"/>
<pathentry kind="mac" name="__DBL_MAX_10_EXP__" path="" value="308"/>
<pathentry kind="mac" name="__LDBL_DENORM_MIN__" path="" value="4.9406564584124654e-324L"/>
<pathentry kind="mac" name="__INT16_C(c)" path="" value="c"/>
<pathentry kind="mac" name="__STDC__" path="" value="1"/>
<pathentry kind="mac" name="__builtin_vsx_xvmsubmdp" path="" value="__builtin_vsx_xvmsubdp"/>
<pathentry kind="mac" name="__PTRDIFF_TYPE__" path="" value="int"/>
<pathentry kind="mac" name="__ATOMIC_SEQ_CST" path="" value="5"/>
<pathentry kind="mac" name="__UINT32_TYPE__" path="" value="long unsigned int"/>
<pathentry kind="mac" name="__FLT32X_MIN_10_EXP__" path="" value="(-307)"/>
<pathentry kind="mac" name="__UINTPTR_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__DEC64_SUBNORMAL_MIN__" path="" value="0.000000000000001E-383DD"/>
<pathentry kind="mac" name="__DEC128_MANT_DIG__" path="" value="34"/>
<pathentry kind="mac" name="__LDBL_MIN_10_EXP__" path="" value="(-307)"/>
<pathentry kind="mac" name="__SIZEOF_LONG_LONG__" path="" value="8"/>
<pathentry kind="mac" name="_Bool" path="" value="_Bool"/>
<pathentry kind="mac" name="__GCC_ATOMIC_LLONG_LOCK_FREE" path="" value="1"/>
<pathentry kind="mac" name="__FLT32X_MIN__" path="" value="2.2250738585072014e-308F32x"/>
<pathentry kind="mac" name="__LDBL_DIG__" path="" value="15"/>
<pathentry kind="mac" name="__FLT_DECIMAL_DIG__" path="" value="9"/>
<pathentry kind="mac" name="__UINT_FAST16_MAX__" path="" value="0xffffffffU"/>
<pathentry kind="mac" name="__GCC_ATOMIC_SHORT_LOCK_FREE" path="" value="2"/>
<pathentry kind="mac" name="__INT_LEAST64_WIDTH__" path="" value="64"/>
<pathentry kind="mac" name="__UINT_FAST8_TYPE__" path="" value="unsigned int"/>
<pathentry kind="mac" name="__ATOMIC_ACQ_REL" path="" value="4"/>
<pathentry kind="mac" name="__ATOMIC_RELEASE" path="" value="3"/>
</storageModule>
</cproject>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://www.ddci.com/DEOS_SHARED_OBJECToptions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ddci:/xsd/DEOS_SHARED_OBJECT.xsd http://www.ddci.com/DEOS_SHARED_OBJECToptions">
<version>26</version>
<targetArch>ppc</targetArch>
<variant>diagnostic</variant>
<depend>kernel</depend>
<depend variant="diagnostic">video</depend>
<depend>ansi</depend>
<depend>math</depend>
<depend>deos-time</depend>
<depend>sal</depend>
<depend>mtl</depend>
<depend>printx</depend>
<depend>gnu-language</depend>
<kernelFile kfs="hypstart">lib$(PROJECT_NAME).so</kernelFile>
<copyToAppbin>$(BINARY)</copyToAppbin>
<copyToAppbin>$(BINARY).dbg</copyToAppbin>
<gccCCompileDirectories targetArch="arm">$(DESK_DIR)/arm/include</gccCCompileDirectories>
<gccCCompileDirectories targetArch="ppc">$(DESK_DIR)/ppc/include</gccCCompileDirectories>
<gccCCompileDirectories targetArch="x86">$(DESK_DIR)/x86/include</gccCCompileDirectories>
<gccCCompileDirectories>$(DESK_DIR)/include</gccCCompileDirectories>
<gccCCompileDirectories>$(PROJECT_DIR)/../../../..</gccCCompileDirectories>
<gccCCompileDirectories>$(PROJECT_DIR)/../../../../fips</gccCCompileDirectories>
<gccCCompileDirectories>$(PROJECT_DIR)/..</gccCCompileDirectories>
<gccCCompileDirectories>$(PROJECT_DIR.printx)/code</gccCCompileDirectories>
<gccCCompileDefinedMacros>WOLFSSL_USER_SETTINGS</gccCCompileDefinedMacros>
<gccCppLinkDirectories targetArch="arm">$(DESK_DIR)/arm/appbin</gccCppLinkDirectories>
<gccCppLinkDirectories targetArch="ppc">$(DESK_DIR)/ppc/appbin</gccCppLinkDirectories>
<gccCppLinkDirectories targetArch="x86">$(DESK_DIR)/x86/appbin</gccCppLinkDirectories>
<gccCppLinkUseIntermediateArchive>true</gccCppLinkUseIntermediateArchive>
<gccCppLinkAdditionalOptions>-L $(PROJECT_DIR.printx)/output/powerpc-motorola-elf/diagnostic</gccCppLinkAdditionalOptions>
<fpuType>none</fpuType>
<ignore>fips.c</ignore>
<ignore>fips_test.c</ignore>
<ignore>selftest.c</ignore>
</project>

View File

@ -0,0 +1,634 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>wolfssl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.ddci.common.ide.Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.ddci.common.ide.DdciNature</nature>
<nature>com.ddci.common.ide.ExecutableNature</nature>
<nature>com.ddci.deos.common.deosLoadListNature</nature>
<nature>com.ddci.common.ide.DEOS_SHARED_OBJECT</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
</natures>
<linkedResources>
<link>
<name>deos_malloc.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/IDE/ECLIPSE/DEOS/deos_malloc.c</locationURI>
</link>
<link>
<name>fips.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/fips/fips.c</locationURI>
</link>
<link>
<name>fips_test.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/fips/fips_test.c</locationURI>
</link>
<link>
<name>selftest.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/fips/selftest.c</locationURI>
</link>
<link>
<name>user_settings.h</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/IDE/ECLIPSE/DEOS/user_settings.h</locationURI>
</link>
<link>
<name>wolfssl</name>
<type>2</type>
<locationURI>WOLFSSL_ROOT/wolfssl</locationURI>
</link>
<link>
<name>src/crl.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/crl.c</locationURI>
</link>
<link>
<name>src/internal.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/internal.c</locationURI>
</link>
<link>
<name>src/keys.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/keys.c</locationURI>
</link>
<link>
<name>src/ocsp.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/ocsp.c</locationURI>
</link>
<link>
<name>src/sniffer.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/sniffer.c</locationURI>
</link>
<link>
<name>src/ssl.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/ssl.c</locationURI>
</link>
<link>
<name>src/tls.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/tls.c</locationURI>
</link>
<link>
<name>src/tls13.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/tls13.c</locationURI>
</link>
<link>
<name>src/wolfio.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/src/wolfio.c</locationURI>
</link>
<link>
<name>wolfcrypt/benchmark</name>
<type>2</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/benchmark</locationURI>
</link>
<link>
<name>wolfcrypt/test</name>
<type>2</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/test</locationURI>
</link>
<link>
<name>wolfcrypt/src/aes.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/aes.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/arc4.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/arc4.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/asm.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/asm.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/asn.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/asn.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/blake2b.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/blake2b.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/blake2s.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/blake2s.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/camellia.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/camellia.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/chacha.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/chacha.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/chacha20_poly1305.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/chacha20_poly1305.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/cmac.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/cmac.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/coding.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/coding.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/compress.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/compress.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/cpuid.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/cpuid.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/cryptocb.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/cryptocb.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/curve25519.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/curve25519.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/curve448.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/curve448.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/des3.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/des3.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/dh.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/dh.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/dsa.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/dsa.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ecc.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ecc.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ecc_fp.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ecc_fp.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ed25519.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ed25519.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ed448.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ed448.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/error.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/error.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/fe_448.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_448.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/fe_low_mem.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_low_mem.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/fe_operations.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_operations.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/fe_x25519_128.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_x25519_128.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mont_small.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mont_small.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_12.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_12.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_17.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_17.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_20.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_20.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_24.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_24.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_28.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_28.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_3.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_3.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_32.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_32.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_4.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_4.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_48.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_48.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_6.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_6.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_64.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_64.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_7.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_7.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_8.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_8.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_9.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_9.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_mul_comba_small_set.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_small_set.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_12.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_12.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_17.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_17.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_20.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_20.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_24.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_24.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_28.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_28.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_3.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_3.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_32.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_32.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_4.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_4.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_48.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_48.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_6.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_6.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_64.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_64.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_7.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_7.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_8.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_8.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_9.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_9.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/fp_sqr_comba_small_set.i</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_small_set.i</locationURI>
</link>
<link>
<name>wolfcrypt/src/ge_448.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_448.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ge_low_mem.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_low_mem.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ge_operations.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_operations.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/kdf.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hash.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hc128.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/hc128.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hmac.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/hmac.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/idea.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/idea.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/integer.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/integer.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/logging.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/logging.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/md2.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/md2.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/md4.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/md4.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/md5.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/md5.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/memory.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/memory.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/pkcs12.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/pkcs12.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/pkcs7.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/pkcs7.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/poly1305.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/poly1305.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/pwdbased.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/pwdbased.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/rabbit.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/rabbit.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/random.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/random.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/rc2.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/rc2.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/ripemd.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ripemd.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/rsa.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/rsa.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sha.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sha256.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha256.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sha3.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha3.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sha512.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sha512.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/signature.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/signature.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_arm32.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_arm32.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_arm64.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_arm64.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_armthumb.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_armthumb.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_c32.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_c32.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_c64.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_c64.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_cortexm.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_cortexm.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_dsp32.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_dsp32.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_int.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_int.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/sp_x86_64.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/sp_x86_64.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/srp.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/srp.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/tfm.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/tfm.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/wc_dsp.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_dsp.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/wc_encrypt.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_encrypt.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/wc_pkcs11.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_pkcs11.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/wc_port.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wc_port.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/wolfevent.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfevent.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/wolfmath.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/wolfmath.c</locationURI>
</link>
</linkedResources>
<variableList>
<variable>
<name>WOLFSSL_ROOT</name>
<value>$%7BPARENT-4-PROJECT_LOC%7D</value>
</variable>
</variableList>
</projectDescription>

View File

@ -7,4 +7,7 @@ EXTRA_DIST += \
IDE/ECLIPSE/DEOS/user_settings.h \
IDE/ECLIPSE/DEOS/tls_wolfssl.h \
IDE/ECLIPSE/DEOS/tls_wolfssl.c \
IDE/ECLIPSE/DEOS/deos_malloc.c
IDE/ECLIPSE/DEOS/deos_malloc.c \
IDE/ECLIPSE/DEOS/deos_wolfssl/.cproject \
IDE/ECLIPSE/DEOS/deos_wolfssl/.options \
IDE/ECLIPSE/DEOS/deos_wolfssl/.project

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -65,6 +65,8 @@ You can get the current time from https://www.unixtimestamp.com/
#define HAVE_ED25519
#define ED25519_SMALL
#define WOLFSSL_DTLS
/* TLS 1.3 */
#if 0
#define WOLFSSL_TLS13
@ -103,8 +105,6 @@ You can get the current time from https://www.unixtimestamp.com/
#endif
#define printf printx
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,28 +4,33 @@
Including the following examples:
* simple tls_client/server
* crypt test
* crypt benchmark
* Simple [tls_client](./examples/wolfssl_client/)/[server](./examples/wolfssl_server/)
* Cryptographic [test](./examples/wolfssl_test/)
* Cryptographic [benchmark](./examples/wolfssl_benchmark/)
The *user_settings.h* file enables some of the hardened settings.
## Requirements
1. ESP-IDF development framework
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
1. [ESP-IDF development framework](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/)
Note: This expects to use Linux version.
## 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
Uncomment out #define WOLFSSL_ESPWROOM32 in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
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_`/esp-idf/components/wolfssl/`
3. Find [Example programs](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples) under _/path/to/esp_`/esp-idf/examples/protocols/wolfssl_xxx` (where xxx is the project name)
4. Uncomment out `#define WOLFSSL_ESPIDF` in _/path/to/esp_`/esp-idf/components/wolfssl/wolfssl/wolfcrypt/settings.h`
Uncomment out `#define WOLFSSL_ESPWROOM32` in _/path/to/esp_`/esp-idf/components/wolfssl/wolfssl/wolfcrypt/settings.h`
for example the default:
`~/esp/esp-idf/components/wolfssl/wolfssl/wolfcrypt/settings.h`
## Configuration
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
1. The `user_settings.h` can be found in _/path/to/esp_`/esp-idf/components/wolfssl/include/user_settings.h`
## Build examples
1. See README in each example folder
@ -34,7 +39,6 @@ Including the following examples:
For question please email [support@wolfssl.com]
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
- OS: Ubuntu 18.04.1 LTS and Microsoft Windows 10 Pro 10.0.19041 and well as WSL Ubuntu
- ESP-IDF: v4.4-dev-4031-gef98a363e3-dirty and v4.0.1-dirty
- Module : ESP32-WROOM-32

View File

@ -1,35 +1,31 @@
# DEMO program with ATECC608A on ESP-WROOM-32SE
## Overview
Running demo programs with ATECC608A on 32SE by setting *WOLFSSL_ESPWROOM32SE* definition
Running demo programs with ATECC608A on 32SE by setting `WOLFSSL_ESPWROOM32SE` definition
Including the following examples:
* simple tls_client/tls_server
* simple `tls_client`/`tls_server`
* crypt benchmark
The *user_settings.h* file enables some of the hardened settings.
## Requirements
1. ESP-IDF development framework
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
The `user_settings.h` file enables some of the hardened settings.
## Requirements
1. ESP-IDF development framework: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/
2. Microchip CryptoAuthentication Library: https://github.com/MicrochipTech/cryptoauthlib
2. Microchip CryptoAuthentication Library
[https://github.com/MicrochipTech/cryptoauthlib]
## Setup
1. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
2. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
3. Uncomment out #define WOLFSSL_ESPWROOM32SE in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
Note : Need to enable WOLFSSL_ESPIDF
Note : crypt test will fail if enabled WOLFSSL_ESPWROOM32SE
1. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
2. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
3. Uncomment out `#define WOLFSSL_ESPWROOM32SE` in `/path/to/wolfssl/wolfssl/wolfcrypt/settings.h`
* **Note:** Need to enable `WOLFSSL_ESPIDF`
* **Note:** crypt test will fail if enabled `WOLFSSL_ESPWROOM32SE`
## Configuration
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
1. The `user_settings.h` can be found in `/path/to/esp-idf/components/wolfssl/include/user_settings.h`
## Build examples
1. See README in each example folder
1. See `README` in each example folder
## Benchmark
w/o atecc608a
@ -48,11 +44,11 @@ ECDSA 256 verify 14 ops took 1.079 sec, avg 77.071 ms, 12.975 ops/sec
```
## Support
For question please email [support@wolfssl.com]
For question please email [support@wolfssl.com](mailto:support@wolfssl.com)
Note: This is tested with the following condition:
- Model : ESP32-WROOM-32SE
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
Note: This is tested with the following condition:
- Model : ESP32-WROOM-32SE
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
- CryptAuthLib: commit hash : c6b176e
- OS : Ubuntu 18.04.1 LTS (Bionic Beaver)

View File

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

View File

@ -0,0 +1,25 @@
/* wolfcrypt/test/test_paths.h
*
* Copyright (C) 2006-2021 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 NO_FILESYSTEM
#define CERT_PREFIX "@abs_top_srcdir@/"
#define CERT_WRITE_TEMP_DIR "@abs_top_builddir@/"
#endif /* NO_FILESYSTEM */

View File

@ -1,8 +1,8 @@
#wolfSSL Example
# wolfSSL Benchmark Example
The Example contains of wolfSSL benchmark program.
1. "make menuconfig" to configure the program.
1. `idf.py menuconfig` to configure the program.
1-1. Example Configuration ->
BENCH_ARG : argument that you want to use. Default is "-lng 0"
@ -10,7 +10,7 @@ The Example contains of wolfSSL benchmark program.
When you want to run the benchmark program
1. "make flash" to compile and load the firmware
2. "make monitor" to see the message
1. `idf.py -p <PORT> flash` to compile and load the firmware
2. `idf.py monitor` to see the message
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -1,6 +1,6 @@
/* helper.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -23,6 +23,7 @@
#include <string.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include "sdkconfig.h"
@ -118,7 +119,7 @@ int construct_argv()
__argv[cnt] = malloc(10);
sprintf(__argv[cnt], "benchmark");
__argv[9] = '\0';
__argv[cnt][9] = '\0';
cnt = 1;
while (*ch != '\0')

View File

@ -2,21 +2,26 @@
The Example contains of wolfSSL tls client demo.
1. "make menuconfig" to config the project
1-1. Example Configuration ->
1. `idf.py menuconfig` to config the project
1-1. Example Configuration ->
WIFI SSID: your own WIFI, which is connected to the Internet.(default is "myssid")
WIFI Password: WIFI password, and default is "mypassword"
Target host ip address : the host that you want to connect to.(default is 127.0.0.1)
1-2. Example Connection Configuration ->
WIFI SSID: your own WIFI, which is connected to the Internet.(default is "myssid")
WIFI Password: WIFI password, and default is "mypassword"
Note: the example program uses 11111 port. If you want to use different port
, you need to modify DEFAULT_PORT definition in the code.
When you want to test the wolfSSL client
1. "make flash monitor" to load the firmware and see the context
1. `idf.py -p <PORT> flash` and then `idf.py monitor` to load the firmware and see the context
2. You can use <wolfssl>/examples/server/server program for test.
e.g. Launch ./examples/server/server -v 4 -b -i
e.g. Launch ./examples/server/server -v 4 -b -i -d
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -1,17 +1,5 @@
menu "Example Configuration"
config WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.
config WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.
config TARGET_HOST
string "Target host"
default "127.0.01.1"

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -51,10 +51,10 @@ static void set_time()
time_t now;
struct tm timeinfo;
char strftime_buf[64];
/* please update the time if seeing unknown failure. */
/* this could cause TLS communication failure due to time expiration */
/* incleasing 31536000 seconds is close to spend 356 days. */
utctime.tv_sec = 1598661910; /* dummy time: Fri Aug 29 09:45:00 2020 */
/* please update the time if seeing unknown failure when loading cert. */
/* this could cause TLS communication failure due to time expiration */
/* incleasing 31536000 seconds is close to spend 356 days. */
utctime.tv_sec = 1619650800; /* dummy time: Wed April 28 23:00:00 2021 */
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;

View File

@ -1,17 +1,18 @@
#wolfSSL Example
# wolfSSL Server Example
The Example contains a wolfSSL simple server.
1. "make menuconfigure" to configure the project
1. `idf.py menuconfigure` to configure the project
1-1. Example Configuration ->
1-1. Example Connection Configuration ->
WIFI SSID : your own WIFI, which is connected to the Internet.(default is "myssid")
WIFI Password : WIFI password, and default is "mypassword"
When you want to test the wolfSSL simple server demo
1. "make flash" to compile the code and load the firmware
2. "make monitor" to see the context. The assigned IP address can be found in output message.
1. `idf.py -p <PORT> flash` to compile the code and load the firmware
2. `idf.py monitor` to see the context. The assigned IP address can be found in output message.
3. Once the server connects to the wifi, it is waiting for client request.
("Waiting for a connection..." message will be displayed.)
@ -19,4 +20,3 @@ When you want to test the wolfSSL simple server demo
e.g ./example/client/client -h xx.xx.xx
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -48,10 +48,10 @@ static void set_time()
time_t now;
struct tm timeinfo;
char strftime_buf[64];
/* please update the time if seeing unknown failure. */
/* this could cause TLS communication failure due to time expiration */
/* incleasing 31536000 seconds is close to spend 356 days. */
utctime.tv_sec = 1598661910; /* dummy time: Fri Aug 29 09:45:00 2020 */
/* please update the time if seeing unknown failure when loading cert. */
/* this could cause TLS communication failure due to time expiration */
/* incleasing 31536000 seconds is close to spend 356 days. */
utctime.tv_sec = 1619650800; /* dummy time: Wed April 28 23:00:00 2021 */
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;

View File

@ -1,10 +1,10 @@
#wolfSSL Example
# wolfSSL Crypt Test Example
The Example contains of wolfSSL test program.
When you want to run the benchmark program
1. "make menuconfig" to configure the program,first
2. "make flash" to compile and load the firmware
3. "make monitor" to see the message
1. `idf.py menuconfig` to configure the program,first
2. `idf.py build` to compile and `idf.py -p <PORT> flash` to load the firmware
3. `idf.py monitor` to see the message
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -16,12 +16,22 @@ set(COMPONENT_SRCDIRS "./src/"
set(COMPONENT_REQUIRES lwip)
set(COMPONENT_ADD_INCLUDEDIRS
"."
"./include"
"../freertos/include/freertos"
"${WOLFSSL_ROOT}"
)
if(IS_DIRECTORY ${IDF_PATH}/components/freertos/FreeRTOS-Kernel/)
set(COMPONENT_ADD_INCLUDEDIRS
"."
"./include"
"../freertos/FreeRTOS-Kernel/include/freertos"
"${WOLFSSL_ROOT}"
)
else()
set(COMPONENT_ADD_INCLUDEDIRS
"."
"./include"
"../freertos/include/freertos"
"${WOLFSSL_ROOT}"
)
endif()
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")

View File

@ -22,6 +22,20 @@ BASEDIR=`cd ${BASEDIR} && pwd -P`
WOLFSSLLIB_TRG_DIR=${IDF_PATH}/components/wolfssl
WOLFSSLEXP_TRG_DIR=${IDF_PATH}/examples/protocols
if [ "$1" == "--verbose" ]; then
WOLFSSSL_SETUP_VERBOSE=true
fi
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo Verbose mode on!
echo BASEDIR=${BASEDIR}
echo SCRIPTDIR=${SCRIPTDIR}
echo WOLFSSL_ESPIDFDIR=${WOLFSSL_ESPIDFDIR}
echo WOLFSSLLIB_TRG_DIR=${WOLFSSLLIB_TRG_DIR}
echo WOLFSSLEXP_TRG_DIR=${WOLFSSLEXP_TRG_DIR}
echo ""
fi
if [ ! -d $IDF_PATH ]; then
echo "ESP-IDF Development Framework doesn't exist.: $IDF_PATH"
exit 1
@ -31,7 +45,12 @@ fi
pushd $IDF_PATH > /dev/null
echo "Copy files into $IDF_PATH"
# Remove/Create directories
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Remove/Create directories..."
fi
${RMDCMD} ${WOLFSSLLIB_TRG_DIR}/
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/
@ -39,6 +58,7 @@ ${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/src
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfssl
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfssl/openssl
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/test
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/include
@ -46,17 +66,30 @@ popd > /dev/null # $WOLFSSL_ESPIDFDIR
pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR
# copying ... files in src/ into $WOLFSSLLIB_TRG_DIR/src
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Copying ... files in src/ into \$WOLFSSLLIB_TRG_DIR/srcs ..."
fi
${CPDCMD} ./src/*.c ${WOLFSSLLIB_TRG_DIR}/src/
${CPDCMD} -r ./wolfcrypt/src/*.{c,i} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src/
${CPDCMD} -r ./wolfcrypt/src/port ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src/port/
${CPDCMD} -r ./wolfcrypt/test ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/
# Copy dummy test_paths.h to handle the case configure hasn't yet executed
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/dummy_test_paths.h ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/test/test_paths.h
${CPDCMD} -r ./wolfcrypt/benchmark ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/
${CPDCMD} -r ./wolfssl/*.h ${WOLFSSLLIB_TRG_DIR}/wolfssl/
${CPDCMD} -r ./wolfssl/openssl/*.h ${WOLFSSLLIB_TRG_DIR}/wolfssl/openssl/
${CPDCMD} -r ./wolfssl/wolfcrypt ${WOLFSSLLIB_TRG_DIR}/wolfssl/
# user_settings.h
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Copying user_settings.h to ${WOLFSSLLIB_TRG_DIR}/include/"
fi
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/user_settings.h ${WOLFSSLLIB_TRG_DIR}/include/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/dummy_config_h ${WOLFSSLLIB_TRG_DIR}/include/config.h
@ -71,15 +104,24 @@ ${CPDCMD} ./libs/component.mk ${WOLFSSLLIB_TRG_DIR}/
pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR
# Benchmark program
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo ""
fi
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
${CPDCMD} ${BASEDIR}/wolfcrypt/benchmark/benchmark.h ${BASEDIR}/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/benchmark.h
${CPDCMD} ${BASEDIR}/wolfcrypt/benchmark/benchmark.c ${BASEDIR}/IDE/Espressif/ESP-IDF/examples/wolfssl_benchmark/main/benchmark.c
${CPDCMD} -r ./wolfcrypt/benchmark/benchmark.c ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_benchmark/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_benchmark/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
# Crypt Test program
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Copying wolfssl_test to ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/"
fi
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
@ -89,6 +131,9 @@ ${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_test/* ${WOLFSSLEXP_TRG_DIR}/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_test/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
# TLS Client program
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Copying TLS Client program to ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/..."
fi
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/
@ -99,6 +144,9 @@ ${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/main/* ${WOLFSSLEXP_TR
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/main/include/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/include/
# TLS Server program
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Copying TLS Server program to ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/..."
fi
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/main/
@ -110,4 +158,8 @@ ${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_server/main/include/* ${WOLFS
popd > /dev/null #
if [ "${WOLFSSSL_SETUP_VERBOSE}" == "true" ]; then
echo "Copy complete!"
fi
exit 1

View File

@ -17,13 +17,14 @@ 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%
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%\wolfssl\openssl
mkdir %WOLFSSLLIB_TRG_DIR%\test
mkdir %WOLFSSLLIB_TRG_DIR%\include
@ -32,10 +33,14 @@ 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 /E/Y/Q %BASEDIR%\wolfcrypt\test %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\
rem Copy dummy test_paths.h to handle the case configure hasn't yet executed
echo F |xcopy /E/Y %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLLIB_TRG_DIR%\wolfcrypt\test\test_paths.h
xcopy /E/Y/Q %WOLFSSL_ESPIDFDIR%\dummy_test_paths.h %WOLFSSLIB_TRG_DIR%\wolfcrypt\test\test_paths.h
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\
xcopy /Y/Q %BASEDIR%\wolfssl\openssl\*.h %WOLFSSLLIB_TRG_DIR%\wolfssl\openssl\
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\
@ -49,8 +54,12 @@ 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\
echo F |xcopy /E/Y %BASEDIR%\wolfcrypt\benchmark\benchmark.h %BASEDIR%\IDE\Espressif\ESP-IDF\examples\wolfssl_benchmark\main\benchmark.h
echo F |xcopy /E/Y %BASEDIR%\wolfcrypt\benchmark\benchmark.c %BASEDIR%\IDE\Espressif\ESP-IDF\examples\wolfssl_benchmark\main\benchmark.c
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\
xcopy /E/F/Q/Y %WOLFSSL_ESPIDFDIR%\examples\wolfssl_benchmark %WOLFSSLEXP_TRG_DIR%\wolfssl_benchmark\
rem Crypt Test program
rmdir /S/Q %WOLFSSLEXP_TRG_DIR%\wolfssl_test\

View File

@ -1,6 +1,6 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_MAIN_DRIVER -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCDIRS ".")
set(COMPONENT_SRCS "test_wolfssl.c" "../wolfcrypt/test/test.c")
set(COMPONENT_ADD_INCLUDEDIRS ".")
set(COMPONENT_REQUIRES unity test_utils wolfssl)

View File

@ -3,9 +3,8 @@
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. "idf.py menuconfig" to configure unit test app.
4. "idf.py -T wolfssl build" to build wolfssl unit test app.
1. Go to /esp-idf/tools/unit-test-app/ folder
2. `idf.py menuconfig` to configure unit test app.
3. `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

@ -666,7 +666,7 @@ TEST_CASE("wolfssl sha crypt-test", "[wolfssl]")
ESP_LOGI(TAG, "sha256_test()");
TEST_ASSERT_EQUAL(0, sha256_test());
#endif
#ifdef WOLSSL_SHA384
#ifdef WOLFSSL_SHA384
ESP_LOGI(TAG, "sha384_test()");
TEST_ASSERT_EQUAL(0, sha384_test());
#endif

View File

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

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -637,6 +637,10 @@ extern unsigned int my_rng_seed_gen(void);
#undef NO_SIG_WRAPPER
//#define NO_SIG_WRAPPER
#undef WOLFSSL_IGNORE_FILE_WARN
#define WOLFSSL_IGNORE_FILE_WARN
#ifdef __cplusplus
}
#endif

View File

@ -1,6 +1,6 @@
BUILD_DIR = ./Build
all: WolfSSLStaticLib WolfCryptTest WolfCryptBench WolfSSLClient
all: WolfSSLStaticLib WolfCryptTest WolfCryptBench WolfSSLClient WolfSSLServer
WolfCryptTest:
$(MAKE) -f Makefile.test
@ -8,6 +8,8 @@ WolfCryptBench:
$(MAKE) -f Makefile.bench
WolfSSLClient:
$(MAKE) -f Makefile.client
WolfSSLServer:
$(MAKE) -f Makefile.server
WolfSSLStaticLib:
$(MAKE) -f Makefile.static

View File

@ -6,37 +6,39 @@ BUILD_DIR = ./Build
# Toolchain location and prefix
#TOOLCHAIN =
TOOLCHAIN = /opt/gcc-arm-none-eabi/bin/arm-none-eabi-
TOOLCHAIN ?= /opt/gcc-arm-none-eabi/bin/arm-none-eabi-
# Tools selection
CC = $(TOOLCHAIN)gcc
AS = $(TOOLCHAIN)gcc
LD = $(TOOLCHAIN)gcc
AS = $(CC)
LD = $(CC)
AR = $(TOOLCHAIN)ar
NM = $(TOOLCHAIN)nm
OBJCOPY = $(TOOLCHAIN)objcopy
OBJDUMP = $(TOOLCHAIN)objdump
SIZE = $(TOOLCHAIN)size
OBJCOPY ?= $(TOOLCHAIN)objcopy
OBJDUMP ?= $(TOOLCHAIN)objdump
SIZE ?= $(TOOLCHAIN)size
# Includes
INC = -I./Header \
-I./Source \
-I../..
USER_SETTINGS_DIR ?= ./Header
INC = -I$(USER_SETTINGS_DIR) \
-I../..
# Defines
DEF = -DWOLFSSL_USER_SETTINGS
# Architecture
ARCHFLAGS = -mcpu=cortex-m4 -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
# Compiler and linker flags
ASFLAGS = $(ARCHFLAGS)
CFLAGS = $(ARCHFLAGS) -std=gnu99 -Wall -Wno-cpp
LDFLAGS = $(ARCHFLAGS)
ASFLAGS ?= $(ARCHFLAGS)
CFLAGS_EXTRA ?= -Wno-cpp
CFLAGS ?= $(ARCHFLAGS) -std=gnu99 -Wall $(CFLAGS_EXTRA)
LDFLAGS ?= $(ARCHFLAGS)
FIPS?=1
# LD: Link with nosys
LDFLAGS += --specs=nosys.specs
@ -70,12 +72,15 @@ LDFLAGS += $(DBGFLAGS)
# FILES
# Port and Test/Benchmark
ifndef NO_EXAMPLES
SRC_C += ./Source/wolf_main.c
SRC_C += ./Source/armtarget.c
SRC_C += ../../wolfcrypt/test/test.c
SRC_C += ../../wolfcrypt/benchmark/benchmark.c
endif
# WOLFSSL TLS FILES
SRC_C += ../../src/bio.c
SRC_C += ../../src/crl.c
SRC_C += ../../src/internal.c
SRC_C += ../../src/keys.c
@ -87,7 +92,9 @@ SRC_C += ../../src/tls13.c
SRC_C += ../../src/wolfio.c
# wolfCrypt Core (FIPS)
ifeq "$(FIPS)" "1"
SRC_C += ../../wolfcrypt/src/wolfcrypt_first.c
endif
SRC_C += ../../wolfcrypt/src/aes.c
SRC_C += ../../wolfcrypt/src/cmac.c
SRC_C += ../../wolfcrypt/src/des3.c
@ -100,26 +107,38 @@ SRC_C += ../../wolfcrypt/src/sha.c
SRC_C += ../../wolfcrypt/src/sha256.c
SRC_C += ../../wolfcrypt/src/sha512.c
SRC_C += ../../wolfcrypt/src/sha3.c
ifeq "$(FIPS)" "1"
SRC_C += ../../wolfcrypt/src/fips.c
SRC_C += ../../wolfcrypt/src/fips_test.c
SRC_C += ../../wolfcrypt/src/wolfcrypt_last.c
endif
# wolfCrypt Additional
SRC_C += ../../wolfcrypt/src/asm.c
SRC_C += ../../wolfcrypt/src/asn.c
SRC_C += ../../wolfcrypt/src/blake2s.c
SRC_C += ../../wolfcrypt/src/chacha.c
SRC_C += ../../wolfcrypt/src/cmac.c
SRC_C += ../../wolfcrypt/src/chacha20_poly1305.c
SRC_C += ../../wolfcrypt/src/coding.c
SRC_C += ../../wolfcrypt/src/compress.c
SRC_C += ../../wolfcrypt/src/cpuid.c
SRC_C += ../../wolfcrypt/src/cryptocb.c
SRC_C += ../../wolfcrypt/src/curve25519.c
SRC_C += ../../wolfcrypt/src/curve448.c
SRC_C += ../../wolfcrypt/src/ecc_fp.c
SRC_C += ../../wolfcrypt/src/eccsi.c
SRC_C += ../../wolfcrypt/src/ed25519.c
SRC_C += ../../wolfcrypt/src/ed448.c
SRC_C += ../../wolfcrypt/src/error.c
SRC_C += ../../wolfcrypt/src/evp.c
SRC_C += ../../wolfcrypt/src/fe_448.c
SRC_C += ../../wolfcrypt/src/fe_low_mem.c
SRC_C += ../../wolfcrypt/src/fe_operations.c
SRC_C += ../../wolfcrypt/src/ge_448.c
SRC_C += ../../wolfcrypt/src/ge_low_mem.c
SRC_C += ../../wolfcrypt/src/ge_operations.c
SRC_C += ../../wolfcrypt/src/hash.c
SRC_C += ../../wolfcrypt/src/kdf.c
SRC_C += ../../wolfcrypt/src/integer.c
SRC_C += ../../wolfcrypt/src/logging.c
SRC_C += ../../wolfcrypt/src/md5.c
@ -129,6 +148,8 @@ SRC_C += ../../wolfcrypt/src/pkcs12.c
SRC_C += ../../wolfcrypt/src/pkcs7.c
SRC_C += ../../wolfcrypt/src/poly1305.c
SRC_C += ../../wolfcrypt/src/pwdbased.c
SRC_C += ../../wolfcrypt/src/rc2.c
SRC_C += ../../wolfcrypt/src/sakke.c
SRC_C += ../../wolfcrypt/src/signature.c
SRC_C += ../../wolfcrypt/src/srp.c
SRC_C += ../../wolfcrypt/src/sp_arm32.c
@ -137,13 +158,25 @@ 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_dsp32.c
SRC_C += ../../wolfcrypt/src/sp_int.c
SRC_C += ../../wolfcrypt/src/sp_x86_64.c
SRC_C += ../../wolfcrypt/src/tfm.c
SRC_C += ../../wolfcrypt/src/wc_dsp.c
SRC_C += ../../wolfcrypt/src/wc_encrypt.c
SRC_C += ../../wolfcrypt/src/wc_pkcs11.c
SRC_C += ../../wolfcrypt/src/wc_port.c
SRC_C += ../../wolfcrypt/src/wolfevent.c
SRC_C += ../../wolfcrypt/src/wolfmath.c
ifeq "$(ASYNC)" "1"
SRC_C += ../../wolfcrypt/src/async.c
endif
ifeq "$(SELFTEST)" "1"
SRC_C += ../../wolfcrypt/src/selftest.c
endif
# wolfCrypt non-standard algorithms (disabled by default)
SRC_C += ../../wolfcrypt/src/arc4.c
SRC_C += ../../wolfcrypt/src/blake2b.c
@ -165,11 +198,11 @@ vpath %.c $(dir $(SRC_C))
build_hex: $(BUILD_DIR) $(BUILD_DIR)/$(BIN).hex
@echo ""
$(CMD_ECHO) @$(SIZE) $(BUILD_DIR)/$(BIN).elf
$(CMD_ECHO) $(SIZE) $(BUILD_DIR)/$(BIN).elf
build_static: $(BUILD_DIR) $(BUILD_DIR)/$(BIN).a
@echo ""
$(CMD_ECHO) @$(SIZE) $(BUILD_DIR)/$(BIN).a
$(CMD_ECHO) $(SIZE) $(BUILD_DIR)/$(BIN).a
$(BUILD_DIR):
$(CMD_ECHO) mkdir -p $(BUILD_DIR)

View File

@ -0,0 +1,7 @@
# Project name
BIN = WolfSSLServer
SRC_C = ./Source/tls_server.c
all: build_hex
include Makefile.common

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* tls_client.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -23,7 +23,7 @@
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#ifndef WOLFCRYPT_ONLY
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_CLIENT)
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/logging.h>
@ -100,11 +100,11 @@ static int tls_client(void)
/*---------------------*/
/* for no peer auth: */
/*---------------------*/
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
/*---------------------*/
/* end peer auth option*/
/*---------------------*/
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != SSL_SUCCESS) {
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != WOLFSSL_SUCCESS) {
wolfSSL_CTX_free(ctx);
printf("CTXset_cipher_list failed, error: %d\n", ret);
goto fail;
@ -123,14 +123,14 @@ static int tls_client(void)
}
/* non blocking accept and connect */
ret = SSL_FAILURE;
ret = WOLFSSL_FAILURE;
while (ret != SSL_SUCCESS) {
while (ret != WOLFSSL_SUCCESS) {
/* client connect */
ret = wolfSSL_connect(ssl);
error = wolfSSL_get_error(ssl, 0);
if (ret != SSL_SUCCESS) {
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
if (ret != WOLFSSL_SUCCESS) {
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
/* Fail */
printf("wolfSSL connect failed with return code %d\n", error);
goto fail;
@ -146,7 +146,7 @@ static int tls_client(void)
ret = wolfSSL_write(ssl, msg, msgSz);
error = wolfSSL_get_error(ssl, 0);
if (ret != msgSz) {
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
/* Write failed */
goto fail;
}
@ -159,7 +159,7 @@ static int tls_client(void)
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
error = wolfSSL_get_error(ssl, 0);
if (ret < 0) {
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
/* Can put print here, the server enters a loop waiting to read
* a confirmation message at this point */
// printf("client read failed\n");
@ -186,14 +186,14 @@ fail:
return -1;
}
#endif
#endif /* !WOLFCRYPT_ONLY && !NO_WOLFSSL_CLIENT */
int main(void)
{
int ret;
#ifndef WOLFCRYPT_ONLY
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_CLIENT)
wolfSSL_Init();
ret = tls_client();

View File

@ -0,0 +1,206 @@
/* tls_server.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_SERVER)
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/logging.h>
#include <stdio.h>
#define MAXSZ 1024
/*------------------------------------------------------------------------*/
/* TLS SERVER */
/*------------------------------------------------------------------------*/
static int CbIORecv(WOLFSSL *ssl, char *buf, int sz, void *ctx)
{
int ret = WOLFSSL_CBIO_ERR_GENERAL;
(void)ssl;
(void)ctx;
/* TODO: Exchange data over your own transport */
#warning TODO: Implement your own recv data transport
#if 0
ret = usart_read_buffer_wait(&cdc_uart_module, buf, sz);
if (ret == STATUS_ERR_TIMEOUT)
return WOLFSSL_CBIO_ERR_WANT_READ;
return (ret == STATUS_OK) ? sz : WOLFSSL_CBIO_ERR_GENERAL;
#else
return ret;
#endif
}
static int CbIOSend(WOLFSSL *ssl, char *buf, int sz, void *ctx)
{
int ret = WOLFSSL_CBIO_ERR_GENERAL;
(void)ssl;
(void)ctx;
/* TODO: Exchange data over your own transport */
#warning TODO: Implement your own send data transport
#if 0
ret = usart_write_buffer_wait(&cdc_uart_module, buf, sz);
if (ret == STATUS_ERR_TIMEOUT)
return WOLFSSL_CBIO_ERR_WANT_WRITE;
return (ret == STATUS_OK) ? sz : WOLFSSL_CBIO_ERR_GENERAL;
#else
return ret;
#endif
}
static int tls_server(void)
{
char reply[MAXSZ];
int ret, error;
WOLFSSL* ssl = NULL;
WOLFSSL_CTX* ctx = NULL;
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method())) == NULL) {
printf("CTXnew failed.\n");
goto fail;
}
/*------------------------------------------------------------------------*/
/* ECDHE-ECDSA */
/*------------------------------------------------------------------------*/
/*--------------------*/
/* for peer auth use: */
/*--------------------*/
// wolfSSL_CTX_load_verify_buffer(ctx, rsa_key_der_1024,
// sizeof_rsa_key_der_1024, SSL_FILETYPE_ASN1);
// wolfSSL_CTX_load_verify_buffer(ctx, server_cert_der_1024,
// sizeof_server_cert_der_1024, SSL_FILETYPE_ASN1);
/*---------------------*/
/* for no peer auth: */
/*---------------------*/
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
/*---------------------*/
/* end peer auth option*/
/*---------------------*/
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != WOLFSSL_SUCCESS) {
wolfSSL_CTX_free(ctx);
printf("CTXset_cipher_list failed, error: %d\n", ret);
goto fail;
}
/*------------------------------------------------------------------------*/
/* END CIPHER SUITE OPTIONS */
/*------------------------------------------------------------------------*/
wolfSSL_CTX_SetIORecv(ctx, CbIORecv);
wolfSSL_CTX_SetIOSend(ctx, CbIOSend);
if ((ssl = wolfSSL_new(ctx)) == NULL) {
error = wolfSSL_get_error(ssl, 0);
printf("wolfSSL_new failed %d\n", error);
wolfSSL_CTX_free(ctx);
return -1;
}
/* non blocking accept and connect */
ret = WOLFSSL_FAILURE;
while (ret != WOLFSSL_SUCCESS) {
/* server accept */
ret = wolfSSL_accept(ssl);
error = wolfSSL_get_error(ssl, 0);
if (ret != WOLFSSL_SUCCESS) {
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
/* Fail */
printf("wolfSSL accept failed with return code %d\n", error);
goto fail;
}
}
/* Success */
}
/* read and write */
while (1) {
/* server read */
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
error = wolfSSL_get_error(ssl, 0);
if (ret < 0) {
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
/* Can put print here, the server enters a loop waiting to read
* a confirmation message at this point */
// printf("server read failed\n");
goto fail;
}
continue;
}
else {
/* Can put print here, the server enters a loop waiting to read
* a confirmation message at this point */
reply[ret] = '\0';
// printf("Server Received Reply: %s\n", reply);
break;
}
}
while (1) {
/* server write / echo */
ret = wolfSSL_write(ssl, reply, XSTRLEN(reply));
error = wolfSSL_get_error(ssl, 0);
if (ret != XSTRLEN(reply)) {
if (error != WOLFSSL_ERROR_WANT_READ && error != WOLFSSL_ERROR_WANT_WRITE) {
/* Write failed */
goto fail;
}
}
/* Write succeeded */
break;
}
return 0;
fail:
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
#endif /* !WOLFCRYPT_ONLY && !NO_WOLFSSL_SERVER */
int main(void)
{
int ret;
#if !defined(WOLFCRYPT_ONLY) && !defined(NO_WOLFSSL_SERVER)
wolfSSL_Init();
ret = tls_server();
wolfSSL_Cleanup();
#else
ret = NOT_COMPILED_IN;
#endif
return ret;
}

View File

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

View File

@ -8,11 +8,13 @@ EXTRA_DIST+= IDE/GCC-ARM/Source/wolf_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/benchmark_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/test_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/tls_client.c
EXTRA_DIST+= IDE/GCC-ARM/Source/tls_server.c
EXTRA_DIST+= IDE/GCC-ARM/linker.ld
EXTRA_DIST+= IDE/GCC-ARM/linker_fips.ld
EXTRA_DIST+= IDE/GCC-ARM/Makefile
EXTRA_DIST+= IDE/GCC-ARM/Makefile.bench
EXTRA_DIST+= IDE/GCC-ARM/Makefile.client
EXTRA_DIST+= IDE/GCC-ARM/Makefile.server
EXTRA_DIST+= IDE/GCC-ARM/Makefile.common
EXTRA_DIST+= IDE/GCC-ARM/Makefile.test
EXTRA_DIST+= IDE/GCC-ARM/Makefile.static

View File

@ -1,6 +1,6 @@
# Makefile
#
# Copyright (C) 2006-2020 wolfSSL Inc.
# Copyright (C) 2006-2021 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#/
ENVI=hexagon

View File

@ -1,6 +1,6 @@
# Makefile
#
# Copyright (C) 2006-2020 wolfSSL Inc.
# Copyright (C) 2006-2021 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
#/
ENVI=UbuntuARM

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1975,6 +1975,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\kdf.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\hc128.c</name>
</file>

View File

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

View File

@ -1956,6 +1956,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\kdf.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c</name>
</file>

View File

@ -2346,6 +2346,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\kdf.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c</name>
</file>

View File

@ -45,6 +45,7 @@ wolfssl (latest version)
# hmac.c tfm.c #
# md4.c wc_encrypt.c #
# md5.c wc_port.c #
# kdf.c #
#---------------------------------------------#
5. Once those are all added go to

View File

@ -46,6 +46,7 @@
<ClCompile Include="..\..\wolfcrypt\src\ge_low_mem.c" />
<ClCompile Include="..\..\wolfcrypt\src\ge_operations.c" />
<ClCompile Include="..\..\wolfcrypt\src\hash.c" />
<ClCompile Include="..\..\wolfcrypt\src\kdf.c" />
<ClCompile Include="..\..\wolfcrypt\src\hc128.c" />
<ClCompile Include="..\..\wolfcrypt\src\hmac.c" />
<ClCompile Include="..\..\wolfcrypt\src\idea.c" />

View File

@ -14,7 +14,7 @@ extern "C" {
#define INTIME_RTOS
#undef WOLF_EXAMPLES_STACK
#define WOLF_EXAMPLES_STACK 65536
#define WOLF_EXAMPLES_STACK (1<<17)
#undef WOLFSSL_GENERAL_ALIGNMENT
#define WOLFSSL_GENERAL_ALIGNMENT 4
@ -27,7 +27,7 @@ extern "C" {
/* disable directory support */
#undef NO_WOLFSSL_DIR
#define NO_WOLFSSL_DIR
//#define NO_WOLFSSL_DIR
/* disable writev */
#undef NO_WRITEV

0
IDE/INTIME-RTOS/wolfExamples.sln Executable file → Normal file
View File

View File

@ -66,7 +66,7 @@
</Link>
<ClCompile>
<ExceptionHandling>Async</ExceptionHandling>
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;_USE_64BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>

View File

@ -165,6 +165,11 @@
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>src/wolfcrypt-src/kdf.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>src/wolfcrypt-src/hc128.c</name>
<type>1</type>

View File

@ -61,6 +61,7 @@ Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/ecc.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/error.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/hash.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/kdf.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/hc128.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/hmac.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/integer.c\

View File

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

View File

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

View File

@ -20,6 +20,7 @@ CSRCS := ../../wolfcrypt/src/rsa.c \
../../wolfcrypt/src/memory.c \
../../wolfcrypt/src/coding.c \
../../wolfcrypt/src/hash.c \
../../wolfcrypt/src/kdf.c \
../../wolfcrypt/src/hmac.c \
../../wolfcrypt/src/md5.c \
../../wolfcrypt/src/wc_port.c \

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* config-BEREFOOT.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -215,12 +215,6 @@
#define BUILD_AESGCM
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <h>Others

View File

@ -1,6 +1,6 @@
/* config-FS.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -252,12 +252,6 @@
#define BUILD_AESGCM
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <h>Others

View File

@ -1,6 +1,6 @@
/* config-RTX-TCP-FS.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -274,12 +274,6 @@
#define BUILD_AESGCM
#endif
// </e>
// <e>NTRU (need License, "crypto_ntru.h")
#define MDK_CONF_NTRU 0
#if MDK_CONF_NTRU == 1
#define HAVE_NTRU
#endif
// </e>
// </h>
// <h>Others

View File

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

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -74,7 +74,7 @@ __task void tcp_tick (void)
__task void tcp_poll (void)
{
WOLFSSL_MSG("TCP polling started.\n") ;
WOLFSSL_MSG("TCP polling started.") ;
while (1) {
main_TcpNet ();
#if defined (HAVE_KEIL_RTX)
@ -128,7 +128,7 @@ void main_task (void)
#endif
#ifdef HAVE_KEIL_RTX
WOLFSSL_MSG("Terminating tcp_main\n") ;
WOLFSSL_MSG("Terminating tcp_main") ;
os_tsk_delete_self ();
#endif

View File

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

View File

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

View File

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

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