Compare commits

...

12188 Commits

Author SHA1 Message Date
00e42151ca Merge pull request #7725 from JacobBarthelmeh/release
prepare for release 5.7.2
2024-07-08 11:02:46 -07:00
c8aa0fa351 remove * in changelog created from search and replace 2024-07-08 10:31:13 -06:00
203f65a636 prepare for release 5.7.2 2024-07-08 09:47:46 -06:00
595e71d7f4 Merge pull request #7718 from douzzer/20240705-coverity-fixes
20240705-coverity-fixes
2024-07-06 21:53:16 -06:00
e35e713c4a wolfcrypt/src/asn.c: fix for copy-paste error in FillSigner() WOLFSSL_DUAL_ALG_CERTS path. 2024-07-06 10:04:26 -05:00
780fd98f40 src/internal.c: in ProcessPeerCerts(), smallstack refactor of a span gated on HAVE_CERTIFICATE_STATUS_REQUEST_V2, to get DecodedCert off the stack. 2024-07-06 10:04:06 -05:00
c8a9bdbe15 wolfcrypt/src/asn.c: fix for -Wconversion in FillSigner(). 2024-07-05 20:42:32 -05:00
88af1a2932 fixes for Coverity #394680, #394682, #394693, #394712. 2024-07-05 20:42:32 -05:00
d8757a51b3 Merge pull request #7717 from JacobBarthelmeh/coverity
Some additional Coverity touch ups
2024-07-05 15:49:53 -07:00
fee9788bb0 fix for coverity report 394710 2024-07-05 15:40:47 -06:00
b948f6797c account for negative return value, fixes coverity issue 394678 2024-07-05 15:34:28 -06:00
de20bb7ba9 fix for coverity issue 394677 2024-07-05 15:13:28 -06:00
d5016d451f Merge pull request #7714 from JacobBarthelmeh/coverity
Coverity issues reported
2024-07-05 13:49:20 -07:00
7ef424b193 Merge pull request #7715 from kaleb-himes/C394706
Address coverity issue 394706
2024-07-05 14:46:54 -06:00
f8eb0c3776 fix for coverity issue 394676 possible null dereference 2024-07-05 14:06:19 -06:00
f42fb587a5 Address coverity issue 394706 2024-07-05 13:54:23 -06:00
d4cf93c2cf avoid overflow if clamping a digit with used size 0 2024-07-05 13:17:53 -06:00
c880fcf822 add check on padSz return, coverity issue 394711 2024-07-05 12:07:42 -06:00
25d52dde3f fix coverity issue 367842 possible null dereference 2024-07-05 11:56:45 -06:00
50a7243486 fix for coverity issue 394670 possible overflow 2024-07-05 11:53:19 -06:00
fbdb064a4b coverity issue 394701 possible derefernce before null check 2024-07-05 11:24:42 -06:00
ac52660d5b Merge pull request #7713 from SparkiDev/dilithium_sign_small_alloc
Dilithium: add implementation of signing that allocated less
2024-07-05 10:38:19 -06:00
8946e3fb4b Merge pull request #7702 from rizlik/ocspv2
ocsp stapling improvements
2024-07-05 10:29:25 -06:00
053170613a fixup! csrv2multi: pending ca list 2024-07-05 15:26:41 +00:00
5ca9b2f8a4 Merge pull request #7712 from SparkiDev/kyber_ml_kem
KYBER/ML-KEM: make ML-KEM available
2024-07-05 09:15:08 -06:00
44a5e1a398 Dilithium: add implementation of signing that allocated less
Added implementation of signing that allocates less memory by doing the
matrix/vector loops in the sign code - WOLFSSL_DILITHIUM_SIGN_SMALL_MEM.
Split out vector operations into vector and polynomial operations so
that small mem signing can call them.
Fix benchmark to be able to compile with only Dilithium and no
asymmetric algorithms.
2024-07-05 16:20:06 +10:00
e6fbe25398 Merge pull request #7711 from SparkiDev/dilithium_kats
Dilithium: Add KATs and fix key generation
2024-07-04 19:40:08 -06:00
1fd9f2af91 KYBER/ML-KEM: make ML-KEM available
Added ML-KEM instead of Kyber implementation with WOLFSSL_ML_KEM.
Tests added from NIST for ML-KEM operations.
2024-07-04 23:51:23 +10:00
387f36657c Dilithium: Add KATs and fix key generation
Add KATs from NIST and fix key generation to produce output of KATs.
2024-07-04 22:22:11 +10:00
3e58cfd864 fixup! ocsp: improvements 2024-07-04 10:21:20 +02:00
fe932b893c fixup! csrv2multi: pending ca list 2024-07-04 10:21:20 +02:00
1c23d2222c Merge pull request #7693 from philljj/zd18204
Fixes ZD 18204: check hashsigalgo matches ssl suites.
2024-07-03 17:12:43 -06:00
f7f3ba9c76 check hashsigalgo matches ssl suites on client side. 2024-07-03 11:59:18 -05:00
ba1eedb46b Merge pull request #7697 from SparkiDev/arm32_ldrd_strd_fix
ARM32 SHA-3 ASM: fix ldrd/strd for ARMv6
2024-07-02 17:18:06 -06:00
d7b0aa92cb Merge pull request #7694 from SparkiDev/sp_x64_asm_fix_3
SP Intel x64 ASM: fix get_from_table ASM
2024-07-02 17:13:49 -06:00
6409b68b21 Merge pull request #7698 from dgarske/asan_compat_list
Fix ASAN warning with compatibility layer cipher list parsing
2024-07-02 17:12:38 -06:00
4ff0af79c7 Merge pull request #7705 from aidangarske/SHA3-cryptocb
Sha3.c wc_Sha3Update and  wc_Sha3Final Hash Type Change
2024-07-02 17:11:01 -06:00
a490d4fdf7 Merge pull request #7628 from SparkiDev/alert_after_ch
TLS: wrong TLS version in alert after ClientHello
2024-07-02 17:10:24 -06:00
5aca239714 Merge pull request #7692 from gasbytes/sni-csharp-wrapper-patch
Sni csharp wrapper patch
2024-07-02 16:49:31 -06:00
804f25d76b Sha3.c wc_Sha3Update and wc_Sha3Final changes so that hash type is determined in the processing functions. 2024-07-02 10:32:57 -07:00
9222cb1304 ocsp: improvements 2024-07-02 09:51:34 +02:00
b5206e8504 csrv2multi: pending ca list 2024-07-02 09:51:34 +02:00
7814e4c264 DoCertificateStatus: Clean up logic in WOLFSSL_CSR2_OCSP_MULTI 2024-07-02 01:29:44 +02:00
dabfad9f6c Fix ocsp stapling test 2 2024-07-02 01:29:44 +02:00
32066373c2 Merge pull request #7695 from dgarske/compat_realloc
Fixes for building the compatibility layer with no realloc
2024-07-01 11:37:52 -06:00
bbf3bb4bf4 Merge pull request #7699 from SparkiDev/regression_fixes_13
Regression testing: fix compilation for unusual configs
2024-07-01 11:02:46 -06:00
1e3f623ff3 Regression testing: fix compilation for unusual configs
Disable ECC but have OPENSSL_EXTRA and curve25519 - fix #ifdef
protection in ssl.c.

tests/api.c:
SSL_SESSION_get_max_fragment_length is not available when no session
cache.
ASN1 APIs using generalized time disabled when NO_ASN_TIME defined so
disable tests.
2024-07-01 21:52:56 +10:00
45442db047 ARM32 SHA-3 ASM: fix ldrd/strd for ARMv6
LDRD/STRD not available with ARMv6 and the alternative is two ldr/str
operations. Pointer was 64-bits causing second ldr/str to be 8 bytes
passed first and not 4 bytes. Fixed in asm to add 4 rather than index.
2024-07-01 15:23:53 +10:00
7dfef18cf4 Refactor unneeded PickHashSigAlgo_ex function. 2024-06-28 18:32:13 -05:00
98a5a4c201 Merge pull request #7660 from julek-wolfssl/zd/18188
wolfSSL_get_SSL_CTX: Make parameter const
2024-06-28 16:40:06 -06:00
7faf0dccc7 Fix for ASAN warning with compatibility layer lists in ParseCipherList and CheckcipherList (ZD 18175). Add test case for ASAN to trigger NULL + 1 warning. Cleanup messy WOLFSSL_TIRTOS in api.c. 2024-06-28 15:26:40 -07:00
2fd7a2e4ae Fix for test.c memcb_test and missing XREALLOC. 2024-06-28 15:25:01 -07:00
80d4f71eb9 Merge pull request #7683 from SparkiDev/def_ticket_cb_inlen
SSL default ticket encryption callback: check in len on decrypt
2024-06-28 16:04:58 -06:00
4913289ce5 Merge pull request #7696 from SparkiDev/dilithium_fix_2
Dilithium: fixes
2024-06-28 16:00:05 -06:00
864a9d0598 Dilithium: fixes
TLS uses DER API now and needs to be protected with the right #ifdefs.
Do the right check of size in wc_Dilithium_PrivateKeyDecode().
Don't require public key when doing private DER.
2024-06-28 10:55:16 +10:00
2a86ca43f8 Fixes for building the compatibility layer with WOLFSSL_NO_REALLOC. Tested using ./configure --enable-opensslextra CFLAGS="-DWOLFSSL_NO_REALLOC".
Improve benchmark FreeRTOS default tick rate logic. For example Xilinx FreeRTOS uses 10ms tick (not default 1ms), so include `configTICK_RATE_HZ` in calculation if available.
Fix test.c warning around too many parens with no realloc.
2024-06-27 16:02:28 -07:00
4dc52484f6 SP Intel x64 ASM: fix get_from_table ASM
Use movdqu instead of vmovdqu so that function works on SSE2 only CPUs.
2024-06-28 07:42:56 +10:00
85552d0fc8 Merge pull request #7662 from julek-wolfssl/enable-WOLFSSL_RSA_KEY_CHECK
Enable WOLFSSL_RSA_KEY_CHECK with OPENSSLALL
2024-06-27 09:49:00 -06:00
107cc82a06 Fixes ZD 18204: check hashsigalgo matches ssl suites. 2024-06-27 10:45:02 -05:00
c047e55b92 Merge pull request #7687 from douzzer/20240626-EvictSessionFromCache-ticketNonce-data-leak
20240626-EvictSessionFromCache-ticketNonce-data-leak
2024-06-27 09:41:42 -06:00
91cad98d67 1023 <- 1024, changed buffer to textmate 2024-06-27 17:35:43 +02:00
5420c1a081 Merge pull request #7689 from douzzer/20240626-linuxkm-cp-no-clobber
20240626-linuxkm-cp-no-clobber
2024-06-27 09:32:24 -06:00
7691bb6a2a Merge pull request #7690 from SparkiDev/regression_fixes_12
Regression testing: memory allocation failure
2024-06-27 09:32:00 -06:00
97adb4be6e fixed wolfSSL_SNI_GetFromBuffer 2024-06-27 17:03:05 +02:00
f66e5a52bd wolfSSL_get_SSL_CTX: Make parameter const 2024-06-27 15:48:46 +02:00
6dd43caae9 wolfSSL_SNI_GetRequest working, fixing up wolfSSL_SNI_GetFromBuffer 2024-06-27 15:05:02 +02:00
4d56cc1790 Regression testing: memory allocation failure
Fixes from memory allocation failure testing.
Also:
fix asn.c to have ifdef protection around code compiled in with dual
algorithm certificates.
  fix test_tls13_rpk_handshake() to support no TLS 1.2 or no TLS 1.3.
fix wc_xmss_sigsleft() to initialize the index to avoid compilation
error.
2024-06-27 17:17:53 +10:00
ae0d40b119 linuxkm/Makefile: use old/deprecated cp --no-clobber rather than newfangled cp --update=none in libwolfssl.ko recipe, for compatibility with older cp (pre-coreutils-9.3 of 2023-04-18). note that coreutils-9.5 restores the behavior of --no-clobber pre-9.2, whereby skips of existing files are non-errors. 2024-06-26 17:58:29 -05:00
4d43dbf83b src/ssl_sess.c: in EvictSessionFromCache(), free session->ticketNonce.data if it was dynamically allocated. fixes memory leak via wolfSSL_Cleanup(). 2024-06-26 14:15:42 -05:00
474b8a0673 Merge pull request #7682 from SparkiDev/dilithium_fix_1
Dilithium: fix public and private key decode
2024-06-26 00:03:03 -04:00
3d7583e743 Merge pull request #7684 from kojo1/pk-fix
Fix in pk.c
2024-06-26 11:33:38 +09:00
72b6074b93 Fixes in pk.c 2024-06-26 08:47:41 +09:00
6d0dc7f2e7 SSL default ticket encryption callback: check in len on decrypt
Make sure that the length of the data to decrypt is correct for the
default ticket encryption implementation.
2024-06-26 08:21:17 +10:00
22abd37408 Merge pull request #7681 from SparkiDev/kyber_improv_1
Kyber: Improve performance
2024-06-25 15:25:51 -06:00
38335f4947 Merge pull request #7678 from bandi13/fixReturnType
ret will be set to 1 (WOLFSSL_SUCCESS), the rest checks for 'ret == 0'
2024-06-25 10:53:03 -06:00
263eb6c60f Merge pull request #7666 from SparkiDev/sp_x64_asm_fix_2
SP Intel x64 ASM: fixes
2024-06-25 10:18:31 -06:00
f466453d61 Merge pull request #7680 from philljj/fix_infer_issues
Fix Infer issues.
2024-06-25 09:42:49 -06:00
8bba660f9c Dilithium: fix public and private key decode
Fixes to decoding to prevent accessing NULL key.
2024-06-25 19:37:11 +10:00
aa61f98955 Kyber: Improve performance
Unroll loops and use larger types.
Allow benchmark to run each kyber parameter separately.
Allow benchmark to have -ml-dsa specified which runs all parameters.
Fix thumb2 ASM C code to not have duplicate includes and ifdef checks.
Fix thumb2 ASM C code to include error-crypt.h to ensure no empty
translation unit.
Check for WOLFSSL_SHA3 before including Thumb2 SHA-3 assembly code.
2024-06-25 18:53:53 +10:00
394948ce94 Fix Infer issues. 2024-06-24 20:44:33 -05:00
5793f626ac Merge pull request #7677 from Laboratory-for-Safe-and-Secure-Systems/mldsa_fixes
Fixes for WolfSSL ML-DSA implementation
2024-06-25 09:12:25 +10:00
b7394274ae Enable WOLFSSL_RSA_KEY_CHECK with OPENSSLALL 2024-06-24 22:15:04 +02:00
be68ba4850 Merge pull request #7676 from SparkiDev/dilithium_opt_1
Dilithium: C code optimized
2024-06-24 12:09:29 -07:00
773451a5dc ret will be set to 1 (WOLFSSL_SUCCESS), the rest checks for 'ret == 0'
Need to use another type of return code
2024-06-24 12:11:57 -04:00
7cd610bc45 Fixes for WolfSSL ML-DSA implementation
* Update OIDs etc. to match OQS ML-DSA values (old ones were Dilithium
  Round 3 values)
* Make sure private key files/buffers containing both the private and
  the public key are parsed correctly

Signed-off-by: Tobias Frauenschläger
<tobias.frauenschlaeger@oth-regensburg.de>
2024-06-24 15:00:44 +02:00
0900e00ee7 Merge pull request #7650 from kaleb-himes/SRTP-KDF-CODEREVIEWr2
Add sanity for case id'd in optesting review
2024-06-24 17:04:13 +10:00
75475ae624 Merge pull request #7633 from JacobBarthelmeh/netos
use WOLFSSL_NETOS_STACK_SZ for stack size when creating tx thread
2024-06-24 16:44:47 +10:00
f1b1483c63 Merge pull request #7669 from JacobBarthelmeh/x509_dn
sanity check for empty directory strings
2024-06-24 16:44:03 +10:00
a094831e1a Dilithium: C code optimized
Changes to get best out of 32-bit ARM chips.
Fixes come compile errors when cutting out functions.
WOLFSSL_DILITHIUM_SIGN_CHECK_Y and WOLFSSL_DILITHIUM_SIGN_CHECK_W0 added
to speed up signing. No longer specification conformat when either used.
2024-06-24 16:37:43 +10:00
2312cb4563 Merge pull request #7667 from SparkiDev/sha3_thumb2_arm32_asm
SHA-3 Thumb2, ARM32 ASM: Add assembly implemention
2024-06-23 20:16:32 -07:00
59c7abf635 Merge pull request #7675 from douzzer/20240622-SHA3-CRYPTO_CB
20240622-SHA3-CRYPTO_CB
2024-06-22 18:21:30 -07:00
b4e15d028c WOLF_CRYPTO_CB && WOLFSSL_SHA3: add FIPS gating to wc_CryptoCb_Sha3Hash() and test routine myCryptoDevCb(). 2024-06-22 11:20:53 -05:00
0cf5421e5a Merge pull request #7673 from douzzer/20240621-fix-oqs_dilithium_make_key-leak
20240621-fix-oqs_dilithium_make_key-leak
2024-06-21 15:37:24 -06:00
7405ea8162 Merge pull request #7671 from miyazakh/dtls_ocsp
Fix ocsp response message build for DTLS
2024-06-21 14:43:29 -06:00
c9d83babe0 Merge pull request #7363 from kaleb-himes/WinCE-supporting-work
Manually check-in pre-operational-testing changes for WinCE port effort
2024-06-21 14:02:48 -06:00
23f796c0b4 Cleanup excess line 2024-06-21 15:55:08 -04:00
871dc9c19b Implement peer review feedback 2024-06-21 15:54:04 -04:00
a1645d684a 448 streaming base on ENABLED flag and below FIPS section 2024-06-21 15:54:04 -04:00
f00e5247bb Add sanity for case id'd in optesting review 2024-06-21 15:54:04 -04:00
e72db4a306 Merge pull request #7612 from dgarske/rsa_pad
Improvements to RSA padding to expose Pad/Unpad API's
2024-06-21 13:19:28 -06:00
aea32e37a9 Merge pull request #7140 from kaleb-himes/140-3-ARMv8-PAA-porting
XCODE support for v5.2.3 of the FIPS module
2024-06-21 13:14:54 -06:00
25b72497d8 wolfcrypt/src/dilithium.c: add missing OQS_SIG_free() in oqs_dilithium_make_key() (liboqs wrapper). 2024-06-21 14:04:32 -05:00
0303a828ec Merge pull request #7670 from aidangarske/CryptocbSHA3
Added crypto callback for SHA3.
2024-06-21 11:28:01 -06:00
3eda3436d1 Peer review, great catch! Thanks @JacobBarthelmeh 2024-06-21 10:44:24 -06:00
610af43d03 XCODE support for v5.2.3 of the FIPS module 2024-06-21 10:36:57 -06:00
94e031e905 Manually check-in pre-operational-testing changes for WinCE port effort 2024-06-21 09:52:57 -06:00
8734f1251d SHA-3 Thumb2, ARM32 ASM: Add assembly implemention
Add SHA-3 assembly implementation for Thumb2 and ARM32.
2024-06-21 14:38:51 +10:00
ac5b81edd1 fix unit test 2024-06-21 13:22:00 +09:00
30eb558d58 fix ocsp response when using DTLS 2024-06-21 09:57:59 +09:00
e8c3a7dfce fix for wolfcrypt/src/sha3.c (void)type 2024-06-20 15:03:51 -07:00
1ef9a8fe7c Added crypto callback for SHA3 and extended the test.c tests for it in cryptocb_test. 2024-06-20 14:15:28 -07:00
8ee01ebaf2 sanity check for empty directory strings 2024-06-20 13:42:31 -06:00
63f666a599 Merge pull request #7659 from embhorn/zd18179
Fixes in ASN1 and X509
2024-06-20 13:10:40 -06:00
d545253df7 Merge pull request #7594 from JacobBarthelmeh/socat
Updating socat version support
2024-06-20 09:17:41 -07:00
118d2cc8cc Merge pull request #7664 from anhu/derLenType
Der --> Len. Copy paste typo.
2024-06-20 08:53:00 +10:00
75d06cd6f3 SP Intel x64 ASM: fixes
Don't use RIP relative with XMM/YMM instructions.
For MSVC asm, explicitly state type for pointer.
For MSVC asm, don't use vmodvqu for saving XMM registers unless this is
AVX2 code.
2024-06-20 08:33:05 +10:00
32ca92bd97 Der --> Len. Copy paste typo. 2024-06-19 17:25:54 -04:00
38c7327660 Merge pull request #7622 from SparkiDev/ml-dsa
Dilithium/ML-DSA: Implementation of ML-DSA-44/65/87
2024-06-19 13:32:35 -04:00
3e3a00dafd Dilithium/ML-DSA: Implementation of ML-DSA-44/65/87
Impemented FIPS 204 (Draft) Module-Lattice-Based Signature Standard.
Implementation include making a key, signing and verification.
Make key API added.
Updated liboqs calls to use ML-DSA implementation instead of Dilithium.
2024-06-19 21:27:01 +10:00
24291b4147 Merge pull request #7600 from SparkiDev/wc_ecc_mulmod_zero_z1
ECC: when multiplying by zero, set z to 1
2024-06-18 16:36:35 -06:00
2b0d724a4d Merge pull request #7658 from douzzer/20240618-linuxkm-4.14.336LTS
20240618-linuxkm-4.14.336LTS
2024-06-18 16:31:37 -06:00
71be6524f7 Merge pull request #7649 from SparkiDev/cortexm_label_fix
Cortex-M inline assembly: labels with unique number appended
2024-06-18 15:31:13 -07:00
6f4aa54f5b Merge pull request #7655 from JacobBarthelmeh/vcpkg
add no stub and ex data cmake options
2024-06-19 07:45:31 +10:00
9175355c81 set LD_LIBRARY_PATH for socat test
work around hang from test 373 to 374

add setting SHELL env for socat test

remove some tests for exec sniffing and sorted address options failing with actions but not locally
2024-06-18 14:46:09 -06:00
d4a90e8a71 Fix wolfSSL_ASN1_TIME_to_generalizedtime with UTC time 2024-06-18 15:08:01 -05:00
5efa82a239 Check for null sig in wolfSSL_X509_CRL_get_signature 2024-06-18 14:47:01 -05:00
95cd9c81c8 Add attr to get_dn_attr_by_nid 2024-06-18 14:41:58 -05:00
f6f83a20ed linuxkm/linuxkm_wc_port.h: add a suppression needed for targeting LTS kernel version 4.14.336. 2024-06-18 14:39:44 -05:00
684fef2429 add no stub and ex data cmake options 2024-06-18 10:20:18 -06:00
eef20ceb51 Merge pull request #7654 from SparkiDev/kyber_c_ntt_invntt_fast
Kyber: Improve performance of C implementation
2024-06-18 09:38:25 -06:00
0cd3bd7ad3 Merge pull request #7653 from SparkiDev/sm2_offical_tv
SM2: change to official test vector
2024-06-18 09:33:05 -06:00
1eea3720e3 Merge pull request #7647 from douzzer/20240614-WOLFSSL_MSG-code-points
20240614-WOLFSSL_MSG-code-points
2024-06-18 18:37:35 +10:00
f863513f37 Kyber: Improve performance of C implementation
Add larger faster implementations of NTT and inverse NTT.
Allow smaller but still fast implementations to be used as well.
2024-06-18 18:09:33 +10:00
187dbd9974 wolfcrypt/src/logging.c: address peer review for PR #7647. 2024-06-17 23:37:13 -05:00
c91d306531 Merge pull request #7646 from kojo1/i2d-ecdsa
alloc a buffer for NULL pointer
2024-06-18 11:47:44 +10:00
fbd69f9b48 ECC: when multiplying by zero, set z to 1
Make sure zero times a point is infinity but z is 1 as it is assumed
later on.
2024-06-18 11:30:57 +10:00
2f379ed322 alloc a buff for NULL pointer 2024-06-18 09:41:11 +09:00
8d77df15ef SM2: change to official test vector
Change create digest to official test vector.
2024-06-18 10:40:47 +10:00
a141041d13 Merge pull request #7652 from douzzer/20240617-fix-wc_Sha256-overalignment
20240617-fix-wc_Sha256-overalignment
2024-06-18 10:39:15 +10:00
87114faa94 Revert "compatibility for EVP_CipherUpdate with AES-GCM"
This reverts commit b7a28cc704.

WOLFSSL_AESGCM_STREAM needs to be conditional as arranged by configure.ac.
2024-06-17 19:04:19 -05:00
f3c93a7b57 wolfssl/wolfcrypt/sha256.h: in definition of struct wc_Sha256, conditionalize alignment optimization of digest and buffer slots on defined(WC_64BIT_CPU), to avoid overalignment warnings on 32 bit targets. this also fixes overalignment of struct Hmac. 2024-06-17 19:03:38 -05:00
7018f464ee Merge pull request #4718 from kojo1/oss-compat
compatibility for EVP_CipherUpdate with AES-GCM
2024-06-18 08:48:36 +10:00
8aaf5670f4 Cortex-M inline assembly: labels with unique number appended
When functions are inlined, the labels need to be unique.
Putting '%=' on the end of the label ensures that the compilers appends
a unique number to the end.
2024-06-17 17:47:40 +10:00
2c69e4a56b add --debug-code-points and WOLFSSL_DEBUG_CODEPOINTS,
add file_name and line_number args to wolfssl_log(),

and inside WOLFSSL_DEBUG_CODEPOINTS gates,

add WOLFSSL_MSG_EX2(), WOLFSSL_MSG2(), WOLFSSL_ENTER2(), and WOLFSSL_LEAVE2(), each with file and line args,

and add wrapper macros for WOLFSSL_MSG, WOLFSSL_MSG_EX, WOLFSSL_ENTER, and WOLFSSL_LEAVE, that pass in file and line.
2024-06-15 00:54:39 -05:00
5df57207ac Merge pull request #7642 from julek-wolfssl/sasl-action
Add sasl action
2024-06-14 19:21:48 -04:00
38089f11cd Merge pull request #7643 from julek-wolfssl/net-snmp-action
Add net-snmp action
2024-06-14 19:20:50 -04:00
a4ee5af1ed Add sasl action 2024-06-14 12:43:53 +02:00
a120b83dac Merge pull request #7585 from kaleb-himes/SRTP-KDF-CODEREVIEW
Add FIPS required forward declaration of streaming struct
2024-06-14 00:53:39 -04:00
512b468dbb explicit socat path with test 2024-06-13 13:15:31 -06:00
98d2ca1d42 fix updated socat yml file 2024-06-13 13:01:57 -06:00
3d70fb1d50 adjust test yml file 2024-06-13 12:51:51 -06:00
385a097646 Merge pull request #7638 from gasbytes/patch
added check if the buf is at least RECORD_HEADER_SZ
2024-06-13 14:27:40 -04:00
fce14ffddb Add net-snmp action 2024-06-13 17:41:15 +02:00
88527a3d6e word32 -> sword32 2024-06-13 13:44:50 +02:00
8ca8827b58 Isolate forward declaration of Gmac 2024-06-12 18:16:33 -04:00
20911f254b ECC, DH, GCM, GMAC, CCM and AES updated services 2024-06-12 18:16:33 -04:00
ae9291f4d3 Add FIPS required forward declaration of streaming struct 2024-06-12 18:16:33 -04:00
897d55f060 Merge pull request #7630 from julek-wolfssl/libvncserver-action
Add libvncserver action
2024-06-12 17:08:28 -04:00
d2f4cc9e28 Merge pull request #7616 from embhorn/zd17762
Static analysis fixes
2024-06-12 17:07:02 -04:00
b0d0a1afe8 Merge pull request #7639 from bandi13/fixLibOQS
liboqs depends on pthreads now
2024-06-12 14:52:50 -04:00
372f57e528 Address PR suggestions 2024-06-12 14:22:10 -04:00
211742bfe0 liboqs depends on pthreads now 2024-06-12 13:45:57 -04:00
9f9a82e469 Merge pull request #7637 from lealem47/armasm_fips
Force inline ASM for armv7 with FIPS
2024-06-12 07:53:37 -06:00
845e2f752c added check if the buf is at least RECORD_HEADER_SZ
when adding the record headers through quic
2024-06-11 22:10:18 +02:00
b7d32d0609 Force inline ASM for armv7 with FIPS 2024-06-11 13:32:46 -06:00
d49308e64a Merge pull request #7634 from douzzer/20240608-WOLFSSL_DEBUG_TRACE_ERROR_CODES
20240608-WOLFSSL_DEBUG_TRACE_ERROR_CODES
2024-06-11 21:25:22 +10:00
ac459e3cec Merge pull request #7631 from dgarske/cmake_singlethreaded
Fix for CMake single threaded
2024-06-10 19:29:10 -04:00
30dbf7c047 add socat yml CI test 2024-06-10 16:56:54 -06:00
202b0a15b4 Merge pull request #7629 from julek-wolfssl/test_wrong_cs_downgrade-clamp
test_wrong_cs_downgrade: clamp error to exact value
2024-06-10 18:26:54 -04:00
b9e5c0252d remove extra asign and use ExpectIntEQ test directly 2024-06-10 16:19:27 -06:00
1b907d05ed WOLFSSL_DEBUG_TRACE_ERROR_CODES: restore several initializations, one because needed (in wolfSSL_UseSecureRenegotiation()), the rest in an abundance of caution, and rearrange wolfSSL_CryptHwMutexInit() and wolfSSL_CryptHwMutexUnLock() in a similar abundance of caution. 2024-06-10 13:44:03 -05:00
b3e8f0ad24 add --enable-debug-trace-errcodes, WOLFSSL_DEBUG_TRACE_ERROR_CODES, WC_ERR_TRACE(), WC_NO_ERR_TRACE(), support/gen-debug-trace-error-codes.sh. also add numerous deployments of WC_NO_ERR_TRACE() to inhibit frivolous/misleading errcode traces when -DWOLFSSL_DEBUG_TRACE_ERROR_CODES. 2024-06-08 16:39:53 -05:00
1753d524d7 use WOLFSSL_NETOS_STACK_SZ for stack size when creating tx thread 2024-06-07 14:30:26 -06:00
f7bc78cad0 Merge pull request #7602 from night1rider/Parsing-bug
Send BUFFER_ERROR if size does not meet minimum Requirements
2024-06-07 13:54:03 -06:00
ebca3376ef Send BUFFER_ERROR if size does not meet minimum reqs for the extension 2024-06-07 10:26:30 -06:00
e960a00650 Merge pull request #7625 from JacobBarthelmeh/x509
sanity check on non conforming serial number of 0
2024-06-07 08:33:38 -07:00
fda8b4f64f Fix for CMake single threaded. https://github.com/wolfSSL/wolfssl/issues/7609#issuecomment-2154327463 2024-06-07 06:59:59 -07:00
6a29dfc6fb Add libvncserver action
Depends on https://github.com/wolfSSL/osp/pull/176
2024-06-07 12:40:48 +02:00
8c47e8d6f2 test_wrong_cs_downgrade: clamp error to exact value 2024-06-07 11:33:38 +02:00
d7d8d14e95 TLS: wrong TLS version in alert after ClientHello
Ignore protocol version being less than expected when received directly
after ClientHello.
Protocol version negotiation hasn't taken place and a lower version can
be sent to cover minimum supported protocol version.
2024-06-07 10:42:12 +10:00
1c51465584 Merge pull request #7627 from douzzer/20240606-clang-tidy-and-mingw-fixes
20240606-clang-tidy-and-mingw-fixes
2024-06-07 10:08:55 +10:00
d09f955e6c Merge pull request #7626 from lealem47/parseServerHello
Improved fix for TLS1.3 to TLS1.2 client downgrade
2024-06-06 17:16:30 -06:00
c82230324e Merge pull request #7546 from oltolm/cmake
cmake: fix generation of options.h
2024-06-07 08:51:12 +10:00
3d33c78e9d use unsigned char instead of uint8_t 2024-06-06 16:30:40 -06:00
467b3cb561 add parsing 0 serial numbers for certs with python 2024-06-06 16:24:48 -06:00
ac5cabaac9 fixes for USE_WINDOWS_API && !NO_FILESYSTEM && !NO_WOLFSSL_DIR:
* in wc_port.h, add XWRITE and XREAD definitions and include <io.h>;
* in wolfSSL_BIO_read(), implement Windows support for XREAD and XWRITE;
* in wolfSSL_BIO_write_filename(), add 'b' flag to XFOPEN flags;
* in wolfSSL_RAND_file_name(), add support for XALTHOMEVARNAME, and add Windows definition for it to wc_port.h alongside XWRITE and XREAD.

fixes test_wolfSSL_BIO, test_wolfSSL_X509_print, test_wolfSSL_RAND, test_wolfSSL_RSA_print in cross-mingw-all-crypto scenario.
2024-06-06 17:14:12 -05:00
5a1ac2742c Reviewer feedback 2024-06-06 16:08:39 -06:00
71db561c96 wolfcrypt/src/port/riscv/riscv-64-aes.c: fix trailing whitespace. 2024-06-06 16:25:50 -05:00
ef925b8b30 wolfcrypt/src/wc_kyber_poly.c: fix bugprone-macro-parentheses for FROM_MSG_BIT. 2024-06-06 16:21:32 -05:00
68f52cb49a add test case 2024-06-06 15:06:15 -06:00
3de358ef06 Ensure extensions are only parsed once 2024-06-06 14:10:56 -06:00
d80f05bf77 Merge pull request #7624 from gasbytes/stack-on-calcdx
update CalcDX with small-stack support
2024-06-06 16:05:56 -04:00
7cc0ac14c4 Adding test case 2024-06-06 13:24:07 -06:00
690d8f7f89 sanity check on non conforming serial number of 0 2024-06-06 13:22:57 -06:00
f3061359d8 Improved fix for TLS1.3 to TLS1.2 client downgrade 2024-06-06 12:22:50 -06:00
60ccaf379d Remove uses of stdint in api.c. 2024-06-06 10:57:46 -07:00
29df90197e Merge pull request #7623 from bandi13/FixOpenSSLTest
Sometimes the first call hangs because the server is not completely up
2024-06-06 09:11:36 -06:00
b69482ffac Merge pull request #7569 from SparkiDev/riscv_aes_asm
AES RISC-V 64-bit ASM: ECB/CBC/CTR/GCM/CCM
2024-06-06 08:11:31 -07:00
7ce9ebde15 Merge pull request #7618 from julek-wolfssl/jwt-cpp
Fixes for jwt-cpp
2024-06-06 08:57:46 -06:00
fbb2737c2a Sometimes the first call hangs because the server is not completely up 2024-06-06 10:38:11 -04:00
acd604db3d AES RISC-V 64-bit ASM: ECB/CBC/CTR/GCM/CCM
Add implementations of AES for ECB/CBC/CTR/GCM/CCM for RISC-V using
assembly.
Assembly with standard/scalar cryptography/vector cryptographt
instructions.
2024-06-06 13:16:00 +10:00
5132a17fab Merge pull request #7613 from SparkiDev/kyber_fixes_2
Kyber: fix kyber_from_msg()
2024-06-05 17:28:39 -07:00
b7d0c257e6 Merge pull request #7621 from douzzer/20240605-rename-fe_x25519_128
20240605-rename-fe_x25519_128
2024-06-06 09:41:52 +10:00
162dffb463 Merge pull request #7619 from lealem47/zd18074
Fix for TLS1.3 to 1.2 downgrade
2024-06-06 09:39:32 +10:00
1f75d0e1d7 Merge pull request #7620 from anhu/doc_wolfSSL_is_init_finished
Quick fixup in API doc for wolfSSL_is_init_finished()
2024-06-05 15:43:40 -07:00
92bbd651b6 rename wolfcrypt/src/fe_x25519_128.i to wolfcrypt/src/fe_x25519_128.h to avoid appearance as a cleanable intermediate. 2024-06-05 16:56:03 -05:00
0de974c3a7 Quick fixup in API doc for wolfSSL_is_init_finished() 2024-06-05 16:40:06 -04:00
d20ac2ce42 Fix for TLS1.3 to 1.2 downgrade 2024-06-05 11:26:10 -06:00
70d317ec79 Merge pull request #7571 from rlm2002/internship
Test case for wc_HpkeGenerateKeyPair() NULL argument
2024-06-05 10:57:19 -06:00
589353f346 update CalcDX with small-stack support 2024-06-05 18:53:34 +02:00
18526152fe Merge pull request #7610 from gasbytes/sni-wrappers
CSharp Wrapper SNI Support
2024-06-05 10:27:42 -06:00
8d63fb5fe5 Merge pull request #7590 from julek-wolfssl/expose-alerts
Allow user to send a user_canceled alert
2024-06-05 10:08:21 -06:00
592a4522e1 Merge pull request #7615 from jackctj117/ssl-static-memory
Added Static Buffer Allocation API
2024-06-05 09:56:06 -06:00
453e2fadc1 dh2048Pem -> dhparam 2024-06-05 17:45:34 +02:00
f3b61487e5 Merge pull request #7617 from julek-wolfssl/ipmitool
Add ipmitool action
2024-06-05 08:39:54 -07:00
b3e795c4a5 Add jwt-cpp action 2024-06-05 15:06:12 +02:00
72243300bf HMAC: fix signature 2024-06-05 13:43:57 +02:00
ea02fea3ef opensslv: include version.h for libwolfssl hex symbol 2024-06-05 13:43:57 +02:00
2ab709c89a - Platform specific function to correctly set the path for the certificates;
- Updated all the examples with it;
2024-06-05 13:28:30 +02:00
6cb97a7262 fixed windows build path problem 2024-06-04 23:12:16 +02:00
f231c7be03 updated the README & haveSNI function 2024-06-04 23:08:56 +02:00
119d2a5da1 do session conversion dance 2024-06-04 14:41:01 -06:00
55837fa254 Static analysis fixes 2024-06-04 12:37:46 -05:00
70fc5c97fb made the workflow to compile & executes easier, updated the readme also 2024-06-04 19:13:51 +02:00
7adf0fde8c Added Static Buffer Allocation API 2024-06-04 10:30:21 -06:00
983610ed68 - Applied David's patch to get access to the missing sni callback (arg)
- removed tlsext callback (since it's a compatibility one)
- updated testing examples and wrapper
2024-06-04 18:26:01 +02:00
5d0b7e0d18 updated readme & sni function 2024-06-04 17:54:21 +02:00
0397d90713 Merge pull request #7614 from julek-wolfssl/pam-ipmi-tests
Fix pam-ipmi test
2024-06-04 08:20:27 -07:00
ede8cde8a7 dtls: Increment sequence number in SendAlert 2024-06-04 17:13:04 +02:00
e428c2833b Allow user to send a user_canceled alert 2024-06-04 17:13:04 +02:00
2c644eb38a Add ipmitool action 2024-06-04 16:44:59 +02:00
04430f55ca Fix pam-ipmi test 2024-06-04 16:09:35 +02:00
df44face56 Kyber: fix kyber_from_msg()
New compilers with specific optimization levels will produce
non-constant time code for kyber_from_msg().
Add in an optimization blocker that stops the compiler from assuming
anything about the value to be ANDed with KYBER_Q_1_HALF.
2024-06-04 22:20:22 +10:00
eb8f26926d Move the options.h.in template for cmake into new location. Added note about adding new options. 2024-06-03 15:38:36 -07:00
514fdfcd43 Merge pull request #7591 from dgarske/wolfssh_template
Template for wolfSSH minimal build using user_settings.h
2024-06-03 15:34:17 -07:00
78b056c1b0 Merge pull request #7611 from lealem47/gh7609
cmake: Define SINGLE_THREADED macro when option enabled
2024-06-03 15:28:16 -07:00
8763b127d9 Add CI test for the new user_settings_wolfssh.h. 2024-06-03 14:27:07 -07:00
b2e7707f18 removed sniHostName no longer used 2024-06-03 21:33:55 +02:00
c04c7685b1 added callback example: setting sni cb & arg server side, and passing the name client side via -S flag 2024-06-03 21:24:54 +02:00
305a754de3 Improvements to RSA padding. Expose API's to support external pad/unpad. 2024-06-03 12:23:31 -07:00
d07d4fb8ac Update support for wolfSSH with RSA_LOW_MEM. 2024-06-03 12:08:37 -07:00
1f684e62d6 Merge pull request #7604 from ColtonWilley/explicit_len_pattern_match
Rewrite pattern matching to use explicit length
2024-06-03 12:04:12 -07:00
c325de993d removed WOLFSSL_SNI_HOST_NAME_OUTER && minor fix (missing sniHostName got lost during editing) 2024-06-03 20:05:00 +02:00
a2e26fb36e cmake: define SINGLE_THREADED macro when option enabled 2024-06-03 12:01:50 -06:00
b4910c4615 wolfSSH size optimizations. Disable RSA OAEP, enable SHA-1 with DH. Do not need SHA2-384/512. 2024-06-03 09:34:53 -07:00
cfbadc8b07 Fixes for wolfSSH user_settings.h template. Add low resource option. 2024-06-03 09:34:53 -07:00
3d374239a1 Template for wolfSSH minimal build using user_settings.h. ZD 17991. 2024-06-03 09:34:52 -07:00
43f4ba91da Merge pull request #7608 from ejohnstown/rsa-add
Import Raw RSA Private Key
2024-06-03 09:33:38 -07:00
0c0069331b Use same types for i and chklen, bring all lines under 80 chars 2024-06-03 09:25:41 -07:00
4140a05fe4 Merge pull request #7592 from julek-wolfssl/pam-ipmi-tests
Add pam-ipmi action
2024-06-03 09:12:22 -07:00
e8e6eaeb4d Import Raw Rsa Key
1. Add API for importing an RSA private key, `wc_RsaPrivateKeyDecodeRaw()`,
   when all you have are the components of the key in raw arrays. Also
   recalculates dP and dQ if missing.
2. Add API test for `wc_RsaPrivateKeyDecodeRaw()`.
2024-06-03 09:03:29 -07:00
b1146becfd Add pam-ipmi action 2024-06-03 14:13:06 +02:00
6f567b58bc completed the examples 2024-06-02 00:01:51 +02:00
15ac366bf9 added missing wrappers for sni setup & frees 2024-06-01 17:46:17 +02:00
3975af88cf Merge pull request #7191 from kojo1/ecpoint-h2p
Add EC_POINT_hex2point
2024-06-01 07:13:31 -07:00
bc2b184c98 Add EC_POINT_hex2point: zd #17090 2024-06-01 13:45:35 +09:00
26284e2e5d Merge pull request #7607 from gojimmypi/PR-fix-7606
Fix for #7606: ESP_LOGI typo in esp32_sha.c
2024-05-31 17:59:08 -07:00
533aa48b14 adjust macro guards around get max fragment 2024-05-31 16:52:31 -06:00
2445fe844a rework get max fragment length 2024-05-31 16:45:50 -06:00
4d2ce1131a Fix for #7606: ESP_LOGI typo 2024-05-31 15:33:46 -07:00
2caee1c7c5 add support for spaces around '=' with x509 name print 2024-05-31 15:04:01 -06:00
ff7626419e add some simple test cases 2024-05-31 15:02:58 -06:00
01a1685159 updating socat support to version 1.8.0.0 2024-05-31 15:02:58 -06:00
5657d88ddb Merge pull request #7605 from douzzer/20240531-linuxkm-6v10-updates
20240531-linuxkm-6v10-updates
2024-05-31 11:41:27 -07:00
d3a6b71f5f linuxkm/Makefile: copy link tree of wolfcrypt/ as a whole, rather than just wolfcrypt/src/ and wolfcrypt/test/, to pull in wolfcrypt/benchmark/. 2024-05-31 13:11:52 -05:00
40562a0cb3 Merge pull request #7599 from dgarske/asn_checkcertsig
Expose `wc_CheckCertSigPubKey` with `WOLFSSL_SMALL_CERT_VERIFY`
2024-05-31 09:20:35 -06:00
0789ecb808 Fix the CheckCertSignature API mess. 2024-05-31 06:58:35 -07:00
447f73c25e Merge branch 'master' of github.com:ColtonWilley/wolfssl into explicit_len_pattern_match 2024-05-30 20:12:16 -07:00
4b77d4caa1 Merge pull request #7589 from rizlik/sp800_56c
wolfcrypt: support NIST 800-56C Option 1 KDF
2024-05-31 11:55:12 +10:00
fc8a509b06 Merge pull request #7597 from ColtonWilley/max_altnames_and_name_constraints
Max limits on number of alternative names and name constraints
2024-05-31 11:24:30 +10:00
f646cbcecb Address review comments, fix handling of . in name matching and add more tests for . handling 2024-05-30 18:03:38 -07:00
7fadd4ed9f Merge pull request #7595 from JacobBarthelmeh/static
Pull in some staticmemory features
2024-05-30 16:31:54 -07:00
bb57c1de94 Merge pull request #7603 from lealem47/detect_cut
Fix cut detection in configure.ac
2024-05-30 15:42:55 -07:00
af3828b2b7 Rewrite pattern matching to always use explicit lengths instead of expecting NULL terminated strings, thus replicating the behavior of openssl X509_check_host() 2024-05-30 15:33:17 -07:00
ecef3c214c Fix cut detection in configure.ac 2024-05-30 16:09:04 -06:00
ebdc8b9a32 rename of macros, add descriptions, minor fixes 2024-05-30 14:48:52 -06:00
1310c97a22 Add new certs to include.am 2024-05-30 12:45:46 -07:00
66a5d8cc8a Merge pull request #7601 from douzzer/20240529-linuxkm-6v10-updates
20240529-linuxkm-6v10-updates
2024-05-30 11:49:11 -07:00
107c10d795 Merge pull request #7596 from JacobBarthelmeh/decl
make function signature match declaration
2024-05-30 10:59:04 -07:00
61fea768b3 Merge pull request #7598 from JacobBarthelmeh/x509
fix typo with NO_CERTS macro
2024-05-30 09:59:37 -07:00
41cbbfe3ab linuxkm: updates for kernel 6.10: use new _noprof names for newly macro-shimmed kmalloc, krealloc, kzmalloc, kvmalloc_node, and kmalloc_trace, and refactor linuxkm/Makefile and linuxkm/Kbuild to set up links to sources in the dest tree (works around breakage from linux commit 9a0ebe5011). 2024-05-30 11:21:42 -05:00
34ca03770f still compile in wc_RsaKeyToDer with keygen but NO_CERTS 2024-05-30 09:58:25 -06:00
52f1caf699 minor changes to the prototypes and actual implementation 2024-05-30 16:44:34 +02:00
095609107d prototypes 2024-05-30 16:14:17 +02:00
23bfb01e54 environment setup, updated the README 2024-05-30 15:41:01 +02:00
174456437e wolcrypt: NIST_SP_800_56C address reviewer's comments 2024-05-30 11:39:49 +02:00
f13a82610c Add flag guard for IGNORE_NAME_CONSTRAINTS 2024-05-29 22:41:36 -07:00
a17677c946 Remove trailing whitespace 2024-05-29 21:29:55 -07:00
473de5796c Free ctx before return 2024-05-29 20:52:09 -07:00
284dea43fe Unify max name testing to use cert files for both cases. 2024-05-29 19:00:15 -07:00
e620b47e1a Add configuration file for generating cert with too many name constraints 2024-05-29 18:23:13 -07:00
a4544ce2eb Updates to address review comments 2024-05-29 17:54:52 -07:00
af537a6ae3 Move definition to beginning of block 2024-05-29 17:02:29 -07:00
3e9f656ac3 Merge pull request #7580 from kareem-wolfssl/zd17975
Fix missing stdio.h include on Freescale MQX.  Use sprintf as snprintf is not available on MQX.
2024-05-29 16:55:34 -07:00
0b7f293691 Expose wc_CheckCertSigPubKey with WOLFSSL_SMALL_CERT_VERIFY. 2024-05-29 16:32:31 -07:00
cf61df129c fix typo with NO_CERTS macro 2024-05-29 17:08:01 -06:00
9673b3f218 make function signature match declaration 2024-05-29 17:00:22 -06:00
b00ae2ac69 Initial implementation of max limits on number of alternative names and name constraints 2024-05-29 15:55:17 -07:00
511c403631 account for yes/no options 2024-05-29 15:59:51 -06:00
6cca3a0d92 tie in static memory debug callback 2024-05-29 15:50:14 -06:00
288fe430f5 tying in lean staticmemory build with --enable-staticmemory=small 2024-05-29 15:50:11 -06:00
18d80864b9 add lean static memory build 2024-05-29 15:44:09 -06:00
8d41e68d1f fix: minor typos 2024-05-28 22:59:01 +02:00
5306a85465 wolfcrypt: support NIST 800-56C Option 1 KDF 2024-05-28 14:40:52 +02:00
200f309e0e Merge pull request #7587 from douzzer/20240524-pq-clang-tidy
20240524-pq-clang-tidy
2024-05-24 16:40:11 -07:00
021b573027 Merge pull request #7581 from dgarske/embos_emnet
Fixes for Segger emNet to handle non-blocking want read/want write
2024-05-24 17:31:16 -04:00
8de00d7651 fix benign clang-analyzer-deadcode.DeadStores in pq crypto files introduced in 9a58301ab1. 2024-05-24 14:24:02 -05:00
911f21ed36 Fix missing stdio.h include and XSNPRINTF definition on Freescale MQX. 2024-05-24 11:54:23 -07:00
a5154b22f1 Merge pull request #7583 from gasbytes/patch-segv
separating two x509_store xmalloc checks
2024-05-24 19:58:29 +02:00
063e48014a fix tabs and spaces 2024-05-24 17:52:54 +02:00
9b058ec3a2 Fixes for EMNET with non-blocking to handle want read/want write. ZD 18012 2024-05-24 07:42:18 -07:00
3b5517692e Merge pull request #7582 from aidangarske/hpke_test_fix
Revert change from PR #7570
2024-05-24 07:35:39 -07:00
51f19f42c6 Merge pull request #7574 from douzzer/20240522-quantum-safe-linuxkm
20240522-quantum-safe-linuxkm
2024-05-24 07:35:01 -07:00
76e7d8627f Merge pull request #7584 from Frauschi/zephyr_fix
Zephyr fix for XSTRNCASECMP
2024-05-24 07:32:53 -07:00
30eb26bd79 Zephyr fix for XSTRNCASECMP
The macro missed the third argument for wc_strncasecmp().

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-05-24 11:49:58 +02:00
3f96d14b32 80 characters limit fix 2024-05-24 00:12:38 +02:00
12a5cb45fb separating two x509_store xmalloc checks 2024-05-23 23:04:00 +02:00
078fb66b29 Negative tests for all NULL arguments 2024-05-23 14:16:17 -06:00
b8838dca44 Tests all NULL argument cases 2024-05-23 13:36:48 -06:00
3670bfb9ae Revert change from PR #7570 2024-05-23 12:34:59 -07:00
d28dd602e5 Various fixes for dual algorithm certificates (#7577)
This commit adds varios fixes for the implementation of hybrid
certificates with two algorithms:
* Support for Certificate Signing Requests (both creating hybrid ones
  and also verifying ones)
* Fix for SAN fields in the DecodedCert and PreTBS generation
* Fix related to WOLFSSL_SMALL_STACK

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-05-23 15:03:55 -04:00
b98e4e0093 Merge pull request #7576 from Frauschi/pqc_private_key_fix
Fix PQC and hybrid certificate regressions
2024-05-23 15:03:16 -04:00
e05dbd531e Merge pull request #7570 from jackctj117/test
Code Coverage for hpke.c test case HAVE_CURVE448 using test.c
2024-05-23 11:49:37 -06:00
688ae60cd9 Merge pull request #7573 from aidangarske/hpke_sha512_test
Add test for HPKE for Curve448
2024-05-23 11:46:30 -06:00
ff6e6848de Merge pull request #7578 from Frauschi/stm32h5_aes
Add support for STM32H5 AES hardware acceleration
2024-05-23 10:38:44 -07:00
40db521f8b Merge pull request #7575 from josepho0918/cmac
Simplify CMAC verification logic
2024-05-23 10:37:57 -07:00
9a58301ab1 Fix PQC and hybrid certificate regressions
Due to recent changes in the logic to decode private keys and to parse
the TLS1.3 CertificateVerify message, some regressions regarding PQC
private keys and hybrid certificates have been introduced:
* Decoding PQC private keys fails as the PKCS8 header of a decoded DER
  file is now already removed before parsing the key.
* The key size wasn't properly stored in the context for PQC keys after
  decoding a certificate (always the maximum size)
* The two 16-bit size values in case of a hybrid signature in the
  CertificateVerify message have been incorrectly decoded as 32-bit
  values instead of 16-bit values. This resulted in wrong values,
  leading to segmentation faults.

All three regressions are fixed with the changes in this commit.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-05-23 16:01:28 +02:00
023f604213 Merge pull request #7572 from douzzer/20240522-sha256-avx1-IS_INTEL_SHA
20240522-sha256-avx1-IS_INTEL_SHA
2024-05-23 22:37:54 +10:00
82642c1ee1 Add support for STM32H5 AES hardware acceleration
Tested with STM32H573i discovery board.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-05-23 12:22:11 +02:00
8a7e3ba52e Simplify CMAC verification logic 2024-05-23 15:12:10 +08:00
5c497c62e7 initial linuxkm compatibility (no asm yet) for wc_kyber, wc_xmss, and wc_lms, and smallstack refactors for kyber512_kat(), kyber768_kat(), kyber1024_kat(), and kyber_test(). 2024-05-23 00:15:32 -05:00
f2492da6a4 include negative test comment and BAD_FUNC_ARG 2024-05-22 16:20:20 -06:00
14068fb7f3 Removed returns & check next case for ret 2024-05-22 15:58:09 -06:00
159981f442 include negative test comment and BAD_FUNC_ARG 2024-05-22 15:23:38 -06:00
110f4ec737 wolfcrypt/src/sha256.c: in WC_NO_INTERNAL_FUNCTION_POINTERS code path (linuxkm), fix oversight whereby Transform_Sha256_AVX1_Sha() was used on targets with false IS_INTEL_SHA(intel_flags). the former SHA256_AVX1 method id is now split into SHA256_AVX1_SHA and SHA256_AVX1_NOSHA, with corresponding fixes in Sha256_SetTransform(), inline_XTRANSFORM() and inline_XTRANSFORM_LEN(). 2024-05-22 15:39:46 -05:00
24f581fe13 Merge pull request #7557 from cconlon/jniSessionCerts
Update --enable-jni to define SESSION_CERTS for wolfJSSE
2024-05-22 13:08:00 -07:00
fe5cc9589b Add HPKE Curve448 test case, however HPKE does not support 448 yet, so expect bad function argument return code. 2024-05-22 12:49:56 -07:00
1a000ef94c single_test and BAD_FUNC_ARG fix 2024-05-22 13:13:56 -06:00
52b6c361f9 test.c code coverage test hpke.c 2024-05-22 11:51:44 -06:00
cb0048dbb1 Merge pull request #7567 from embhorn/gh7564
Fix doc for wolfSSL_CTX_EnableOCSP
2024-05-22 08:46:20 -07:00
425dd1986b Merge pull request #7568 from lealem47/fips_pkcallback
Fix building FIPS v5 with PK callbacks
2024-05-22 08:45:58 -07:00
fe9882769e Test case for wc_HpkeGenerateKeyPair() NULL argument 2024-05-22 09:13:31 -06:00
32c5acca22 Merge pull request #7566 from douzzer/20240521-fix-overshifts
20240521-fix-overshifts
2024-05-22 07:42:49 +10:00
314afc9e10 Fix doc for wolfSSL_CTX_EnableOCSP 2024-05-21 16:12:23 -05:00
ba5cc9bdaf Fix building FIPS v5 with PK callbacks 2024-05-21 15:07:32 -06:00
c5ce984966 wolfcrypt/src/wc_xmss_impl.c:wc_xmssmt_sign_next_idx(): use (XmssIdx)1, not (word32)1, for a shift-by-height operand;
src/ssl.c:set_curves_list(): don't attempt to enable curves that are out-of-range for word32 disabled.
2024-05-21 13:57:40 -05:00
caaa9feb64 Merge pull request #7551 from gojimmypi/PR-DSA-SHA1
Add settings.h check: DSA needs SHA1
2024-05-21 08:47:10 -07:00
603b5d1795 Merge pull request #7563 from josepho0918/mqx_v5
Always use old I/O for MQXv5
2024-05-21 08:19:15 -07:00
87b71c429a Merge pull request #7562 from gojimmypi/PR-ssl_load-correction
Correct warning message file name in ssl_load.c
2024-05-21 22:14:24 +10:00
ed321cd640 Always use old I/O for MQXv5 2024-05-21 10:00:40 +08:00
543a746ddc Add settings check to disable DSA when SHA-1 is disabled 2024-05-20 17:58:25 -07:00
84032fa24c Correct error message file name in ssl_load.c 2024-05-20 17:20:39 -07:00
43b2c80862 Merge pull request #7552 from dgarske/ecies_own_salt
Add option for using a custom salt for ourselves
2024-05-21 09:19:12 +10:00
095906f37a Merge pull request #7561 from kaleb-himes/SRTP-KDF-MAINTENANCE
Address periodic CAST failures observed in unit.test by pre-empting CASTs
2024-05-21 09:16:23 +10:00
7d4e601902 Merge pull request #6623 from bigbrett/FIPS-TLS-benchmark-CAST-fix
Fix benchmark failure on FIPS builds
2024-05-20 14:07:59 -07:00
a22956d881 Address periodic CAST failures observed in unit.test by pre-empting the CASTs 2024-05-20 16:35:50 -04:00
c6db51b8a0 fixed formatting 2024-05-20 12:47:30 -06:00
fc172e9abd Merge pull request #7559 from gojimmypi/PR-PlatformIO-FreeRTOS
Update PlatformIO README and Examples
2024-05-20 09:36:23 -07:00
0987bf4c1a Merge pull request #7544 from josepho0918/iar
Expand supported attributes for IAR
2024-05-20 09:34:55 -07:00
5a0594d257 Match wc_ecc_ctx_set_kdf_salt argument names between header and implementation. 2024-05-20 08:38:23 -07:00
b8aec63e14 Merge pull request #7560 from douzzer/20240518-XtsAesStreamData
20240518-XtsAesStreamData
2024-05-20 08:33:41 +10:00
d0e73783f1 wolfcrypt/src/aes.c and wolfssl/wolfcrypt/aes.h: add FIPS_AES_XTS_MAX_BYTES_PER_TWEAK and struct XtsAesStreamData, with improved error checking on streaming AES-XTS APIs;
wolfcrypt/test/test.c and linuxkm/lkcapi_glue.c: update AES-XTS streaming calls to use struct XtsAesStreamData;

linuxkm/lkcapi_glue.c: add handling for CONFIG_CRYPTO_MANAGER*.
2024-05-18 22:00:00 -05:00
5c6218696b wolfcrypt/src/misc.c: fix -Wconversions in CopyString();
src/ssl.c: fix missing semicolon in wolfSSL_CTX_check_private_key().
2024-05-18 02:31:58 -05:00
22af731dd9 Update PlatformIO README and Examples 2024-05-17 16:47:07 -07:00
8f1029f86d Update --enable-jni to define SESSION_CERTS for wolfJSSE 2024-05-17 15:08:37 -06:00
2d5e8402e8 Merge pull request #7553 from JacobBarthelmeh/coexist
error out if conflicting OPENSSL compat macros are defined
2024-05-17 12:56:59 -07:00
15af87af8f Merge pull request #7555 from lealem47/forceSHA3
Force SHA3 on with FIPS V5
2024-05-17 12:30:20 -07:00
16b39e8374 Merge pull request #7556 from gasbytes/patch
u_int16_t -> uint16_t
2024-05-17 12:29:54 -07:00
391431c7d8 Merge pull request #7539 from bandi13/fixConversionPart2
Fix conversion part2
2024-05-17 12:29:46 -07:00
54bf7fd5d9 Force SHA3 on with FIPS V5 2024-05-17 11:03:18 -06:00
a40dcd3cb3 u_int16_t -> uint16_t 2024-05-17 18:44:15 +02:00
568ec43213 error out if conflicting OPENSSL compat macros are defined 2024-05-17 09:24:38 -06:00
95095f5bc4 Add option for using a custom salt for ourselves. ZD 17988 2024-05-17 08:16:04 -07:00
e823da99ae declare loop variable at top of function body 2024-05-17 07:08:32 -07:00
9fa838881c fixed bug where tls_bench failed KATs for FIPS builds in a multithreaded environment 2024-05-17 07:08:32 -07:00
7782f8eed2 Merge pull request #7528 from gojimmypi/PR-PlatformIO-FreeRTOS
Introduce IDE/PlatformIO; add wolfSSL Benchmark and Test Examples
2024-05-17 06:42:47 -07:00
c0015cbda6 Merge pull request #7549 from douzzer/20240516-wc_AesXtsEnDecryptFinal
20240516-wc_AesXtsEnDecryptFinal
2024-05-17 09:43:26 +10:00
219a338107 Merge pull request #7547 from philljj/spelling_cleanup
Used codespell and fixed some obvious typos.
2024-05-16 14:10:19 -07:00
b866bf6b3d Merge pull request #7548 from julek-wolfssl/grpc
Point grpc.yml to the wolfssl repo
2024-05-16 14:09:57 -07:00
6d0f611ab5 AES-XTS: add wc_AesXtsEncryptFinal() and wc_AesXtsDecryptFinal() for API consistency, and add error-checking (block alignment check) to wc_AesXtsEncryptUpdate() and wc_AesXtsDecryptUpdate(). 2024-05-16 15:20:37 -05:00
a8dd736b1e Merge pull request #7158 from JacobBarthelmeh/psk
warning fix for small PSK build
2024-05-16 12:57:08 -07:00
e4f20aff8b Point grpc.yml to the wolfssl repo 2024-05-16 21:32:04 +02:00
040e0c956a Used codespell and fixed obvious typos. 2024-05-16 13:53:26 -05:00
dd55542949 Merge pull request #7541 from kaleb-himes/wolfEntropy-first-checkin
Add a recipe for wolfEntropy checkout
2024-05-16 11:51:46 -07:00
0aa8e2eee7 Merge pull request #7445 from julek-wolfssl/grpc
Add grpc support
2024-05-16 11:41:54 -07:00
439d81e0c9 Add PlatformIO license headers 2024-05-16 10:50:02 -07:00
74c0d9b9f6 Update example/configs list, sort order. 2024-05-16 10:48:14 -07:00
f744043db1 change the way "wolfssl/options.h.in" is generated 2024-05-16 18:55:27 +02:00
5f46809988 fix compilation of tests with GCC 2024-05-16 18:55:27 +02:00
76aba42bfa Fix api signature 2024-05-16 18:20:53 +02:00
c07f73b1c7 Fix typo 2024-05-16 18:20:53 +02:00
12b9367598 test_wolfSSL_check_domain: doesn't work with WOLFSSL_HOSTNAME_VERIFY_ALT_NAME_ONLY 2024-05-16 18:20:53 +02:00
d9a236ba1e SSL_get_error does not return x509 errors 2024-05-16 18:20:53 +02:00
fcb5c362f9 Add grpc testing 2024-05-16 18:20:53 +02:00
d9f7629296 Add grpc support
- Fix BIO_BIO type
  - Set retry flags correctly
- Add CRL callback
- Copy the alt names instead of trying to share a pointer
- Allow calling wolfSSL_get_servername on client side (to get the requested name)
- Return the chain in wolfSSL_X509_STORE_CTX_get_chain in the correct order
  - Peer first, top CA last
- Fix leak in RebuildFullName
- Add CopyString helper function
- Implement
  - X509_CRL_dup
  - ASN1_UTCTIME_set
  - X509_STORE_CTX_get0_param
  - X509_STORE_get0_param
  - X509_STORE_set_verify_cb
  - X509_STORE_set_get_crl
  - X509_set1_notAfter
  - X509_set1_notBefore
2024-05-16 18:20:53 +02:00
79595a3602 account for sp math which defines NO_BIG_INT but still allows mp_int types 2024-05-16 09:48:56 -06:00
712ff0a58d Merge pull request #7537 from dgarske/cleanups_20240515
Various typo and copy/paste cleanups
2024-05-16 09:38:38 -06:00
21204244c5 Merge pull request #7394 from embhorn/zd17779
Add null check to wolfSSL_Free
2024-05-16 09:31:37 -06:00
55ea3301b2 Merge pull request #7542 from gojimmypi/PR-Espressif-PlatformIO-semphr
Fix PlatformIO freertos semphr.h include
2024-05-16 08:28:12 -07:00
fe7f92c2f1 Merge pull request #7545 from bandi13/reenableOpenVPNmasterTest
Reenable failing external project test
2024-05-16 11:26:04 -04:00
c0e372005b Reenable failing external project test 2024-05-16 09:26:01 -04:00
931ca9524a warn_used_result and unused __attribute__ on IAR 2024-05-16 14:53:31 +08:00
7f1af2feb3 Fix PlatformIO freertos semphr.h include 2024-05-15 18:24:00 -07:00
503bbbec8f Update PlatformIO wolfssl/wolfssl@^5.7.0-rev.3c 2024-05-15 17:13:03 -07:00
db38351919 Merge pull request #7470 from kaleb-himes/SRTP-KDF-OPTEST
Srtp kdf optest
2024-05-15 16:33:26 -07:00
ca47d492d4 Merge pull request #7218 from anhu/gcmccm
Fixup places where it should be CCM instead of GCM.
2024-05-16 09:24:43 +10:00
abd1e367a5 Merge pull request #7420 from anhu/cmp_name_case
When comparing subject names, do not worry about case.
2024-05-16 09:10:56 +10:00
1d1800a3bd Merge pull request #7380 from oltolm/yesno
make "yes;no" cmake options boolean instead of string
2024-05-15 15:18:42 -07:00
51f814e6b7 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into PR-PlatformIO-FreeRTOS 2024-05-15 14:47:29 -07:00
1e2fb8f244 Fixup places where it should be CCM instead of GCM.
Fixes https://github.com/wolfSSL/wolfssl/issues/7216
2024-05-15 17:32:09 -04:00
42feca7028 Add a recipe for wolfEntropy checkout 2024-05-15 15:23:43 -06:00
412447ac41 Enable OPTION_CHECKING by default
This should halt `./configure` when an option is passed that is not recognized.
2024-05-15 16:54:55 -04:00
287323ab4c Merge pull request #6933 from kareem-wolfssl/zd16927
Add stub for wolfSSL_set_ecdh_auto.
2024-05-15 13:04:06 -07:00
8ba96e6881 Merge pull request #7534 from ColtonWilley/deny_null_term_altnames
Do not match altnames with NULL terminators in the middle
2024-05-15 12:41:37 -07:00
76527c3eaa Address a report from multi-test about 8-bit chars 2024-05-15 15:21:41 -04:00
0eb11ff466 Standard way to set defaults 2024-05-15 15:19:42 -04:00
b83d8f0cf6 Make sure MAX_ECC_BITS >= MIN_ECC_BITS 2024-05-15 15:19:13 -04:00
35ef7f4093 There is no default defined. Expected to be unset 2024-05-15 15:16:24 -04:00
4e5a98e65d Fix from rebase 2024-05-15 14:03:12 -05:00
fa08e2cb62 Fix a long line in pbkdf2 test 2024-05-15 14:02:44 -04:00
6719909f4e Add logging.h header in pwdbased.c when DEBUG_WOLFSSL 2024-05-15 14:02:44 -04:00
7047991cda Log when iterations LT 1000 but take no action 2024-05-15 14:02:44 -04:00
a9511e118a Add SP800-132 112 bit minimum applicable after stretch/strengthen 2024-05-15 14:02:44 -04:00
a365d38762 After careful evaluation deciding not to include mem-zero check (for now) 2024-05-15 14:02:43 -04:00
82d9a7bbae Initialize scratch buffer 2024-05-15 14:02:43 -04:00
673c5993a7 Make the memzero check default with FIPS, fix benchmark app 2024-05-15 14:02:43 -04:00
766c3b5ad8 Comments and further relaxing of some other hmac restrictions 2024-05-15 14:02:43 -04:00
49e9c06679 (Has dependency PR) API Service update HmacSizeByType 2024-05-15 14:02:43 -04:00
fd4db1497f Merge pull request #7536 from gasbytes/buffer_overflows_fix
added check that checks if the SEQ's length is > than the buff's length
2024-05-15 10:56:42 -07:00
ac7aea9674 Merge pull request #7478 from JacobBarthelmeh/staticmemory
add global heap hint setter function
2024-05-15 10:43:15 -07:00
4481f9b626 Add stub for wolfSSL_set_ecdh_auto. 2024-05-15 10:19:47 -07:00
9166c1aa1c Various typo and copy/paste cleanups. 2024-05-15 10:01:40 -07:00
b156a51e82 Code cleanup per review comments 2024-05-15 09:51:00 -07:00
9aeef1d857 add void and remove rebase issue 2024-05-15 10:28:39 -06:00
2f24b35ab1 added check that checks if the SEQ's length is > than the buff's length 2024-05-15 18:20:33 +02:00
de0a492499 Remove trailing whitespace 2024-05-15 09:12:00 -07:00
c73e4333bf Merge pull request #7535 from gojimmypi/PR-fix-sha512-endianness
Fix Espressif SHA512 SW fallback endianness
2024-05-15 09:04:07 -07:00
9c4c9234b1 Merge pull request #7532 from SparkiDev/wc_ecc_mulmod_zero
ECC: handle zero in wc_ecc_mulmod()
2024-05-15 09:02:02 -07:00
d522feb1cd Free X509 object 2024-05-15 08:37:39 -07:00
958b5ac465 Clean up cast warning 2024-05-15 08:30:38 -07:00
eb24bce93f Add test case for bad alternative name 2024-05-15 08:22:11 -07:00
b25a4f1082 Use zero, not Espressif macro for return code 2024-05-15 08:06:06 -07:00
1024d7a809 Fix Espressif SHA512 SW fallback endianness 2024-05-15 07:36:10 -07:00
92806a61c0 Merge pull request #7522 from douzzer/20240511-aes-xts-stream
20240511-aes-xts-stream
2024-05-15 06:22:20 -07:00
1469aab109 linuxkm/lkcapi_glue.c: add native test coverage for WOLFSSL_AESXTS_STREAM.
wolfcrypt/test/test.c:
* add WOLFSSL_AESXTS_STREAM testing to the LARGE_XTS_SZ exercise in aes_xts_128_test().
* add the LARGE_XTS_SZ exercise to aes_xts_256_test().
* add aes_xts_192_test().
* fix -Werror=frame-larger-than=2048 in ed25519_test().
2024-05-15 00:45:51 -05:00
4331bc092b configure.ac: on armasm, disable ENABLED_AESXTS_STREAM by default (not implemented). 2024-05-14 19:24:27 -05:00
2fe366cc74 wolfcrypt/test/test.c: add test coverage for WOLFSSL_AESXTS_STREAM.
linuxkm/lkcapi_glue.c: typographic cleanups, and failsafe error return constructs when skcipher_walk_virt() returns zero walk.nbytes.

wolfcrypt/src/aes.c: additional comments and inline documentation.

.github/workflows/openvpn.yml: disable test on master branch.
2024-05-14 19:11:39 -05:00
8392748cda wolfcrypt/src/aes.c: de-deduplicate code, AesXts{En,De}crypt_sw() vs AesXts{En,De}cryptUpdate_sw(). 2024-05-14 19:11:39 -05:00
4f1f7b3a4d linuxkm/lkcapi_glue.c: update names of wc_AesXts{En,De}cryptInit().
wolfcrypt/src/aes.c: activate _AesXtsHelper() in AesXts{En,De}cryptUpdate_sw().
2024-05-14 19:11:39 -05:00
643f472cfb AES-XTS ASM x64: Add Intel x64 implementation of streaming
Changed APIs from wc_AesXts*Start -> wc_AesXts*Init.
Enabled ASM for x64 in aes.c.
AesXtsDecryptStart_sw same as AesXtsEncryptStart_sw so changed them to
AesXtsInit_sw.
2024-05-14 19:11:39 -05:00
f874d8753d AES-XTS-streaming: refactor API to eliminate caller-supplied tweak_block. instead, caller-supplied iv is used as a readwrite buffer. 2024-05-14 19:11:39 -05:00
9e06524c6f wolfcrypt/src/aes.c: add prototypes and linkages for AES_XTS_{encrypt,decrypt}_{start,update}_{avx1,aesni}. 2024-05-14 19:11:39 -05:00
3ad5ec4e0a make --enable-linuxkm-lkcapi-register require --enable-experimental, except for the known-good --enable-linuxkm-lkcapi-register="xts(aes)". 2024-05-14 19:11:39 -05:00
70d7b6e48b add WOLFSSL_AESXTS_STREAM, --enable-aesxts-stream, wc_AesXtsEncryptStart(), wc_AesXtsDecryptStart(), wc_AesXtsEncryptUpdate(), wc_AesXtsDecryptUpdate(), and implement fixes in linuxkm/lkcapi_glue.c to use the streaming API when needed. also added support for 2*192 bit AES-XTS, needed for Linux kernel. 2024-05-14 19:11:38 -05:00
676dfb7edb Do not allow NULL terminators in the middle of alt name for pattern matching. ZD 17987 2024-05-14 16:59:28 -07:00
b63f308812 fixup 2024-05-15 09:07:04 +10:00
36754683d6 ECC: handle zero in wc_ecc_mulmod()
Public API needs to handle multiplying by zero as the underlying code
doesn't and needn't.
2024-05-15 09:05:31 +10:00
6d1416d006 addressing PR comments 2024-05-14 16:02:56 -04:00
28bd4ebeea Merge pull request #7520 from bandi13/fixConversion
Fix conversion
2024-05-14 11:26:37 -07:00
7526f527d1 Merge pull request #7526 from lealem47/addCast
Fix for type conversion error
2024-05-14 10:30:08 -07:00
a1797f0d0d Fix casts depending on OS 2024-05-14 11:03:20 -04:00
a59a3d109f Explicit cast 2024-05-14 11:03:20 -04:00
12768cdf57 Fix conversion tls13.c 2024-05-14 11:02:28 -04:00
bf92797cbc Fix conversion error in client.c 2024-05-14 11:02:28 -04:00
0bf69e240a Fix build failures 2024-05-14 11:02:28 -04:00
702b6c25d5 Fix conversion error in benchmark.c 2024-05-14 11:02:28 -04:00
692a7d55ff Fix conversion error in wolfio.c 2024-05-14 11:02:28 -04:00
affd0a318e Fix sign conversion errors 2024-05-14 11:02:28 -04:00
0e2bb28ff3 Merge pull request #7529 from SparkiDev/aes_decrypt_fixes
AES: NO_AES_DECRYPT defined
2024-05-14 06:59:02 -07:00
1ee315bbab Merge pull request #7505 from gojimmypi/PR-Apple-Homekit-SRP-fix
Espressif updates to fix Apple Homekit SHA / SRP
2024-05-14 06:58:31 -07:00
e1274013d8 AES: NO_AES_DECRYPT defined
Allow code to compile with NO_AES_DECRYPT with AES modes enabled and
disabled.
2024-05-14 16:27:36 +10:00
fe5e5955bd Introduce IDE/PlatformIO 2024-05-13 19:12:34 -07:00
1c4479867e Merge pull request #7416 from SparkiDev/ecc_blind_k
ECC: blind private key after use in signing
2024-05-13 18:56:44 -07:00
a950e90215 Merge pull request #7527 from douzzer/20240513-test_wc_ecc_sm2_create_digest-clang-analyzer-optin.core.EnumCastOutOfRange
20240513-test_wc_ecc_sm2_create_digest-clang-analyzer-optin.core.EnumCastOutOfRange
2024-05-14 11:03:55 +10:00
8ee7c36bb1 tests/api.c: add suppression for clang-analyzer-optin.core.EnumCastOutOfRange in "Bad hash type" subtest in test_wc_ecc_sm2_create_digest(). 2024-05-13 19:06:54 -05:00
b7eca574bb SSL/TLS: blind private key DER
When WOLFSSL_BLIND_PRIVATE_KEY is defined, blind the private key DER
encoding so that stored private key data is always changing.
2024-05-14 09:47:51 +10:00
f24ebdde25 ECC: blind private key after use in signing
Use a mask to blind the private key after use so that stored private key
is always changing.
2024-05-14 09:41:06 +10:00
009ea6640b Merge pull request #7493 from SparkiDev/sm3_benchmark_fix
Benchmark, SM3: fix full hash testing
2024-05-13 19:22:22 -04:00
f4275d53c4 Fix for type conversion error 2024-05-13 16:32:12 -06:00
6b79e5380d Merge pull request #7525 from bandi13/fixCDTDisableOptionsTest
Unused variable error
2024-05-13 13:13:06 -07:00
44ec470df0 Update esp32 sha uintptr_t types; ret (0/1 not TRUE/FALSE) 2024-05-13 12:36:35 -07:00
7cce5684e6 Merge pull request #7468 from gojimmypi/PR-include-am
Cleanup & sort IDE include.am
2024-05-13 10:36:09 -07:00
29f7578a61 Merge pull request #7446 from julek-wolfssl/hostap
hostap update
2024-05-13 10:35:01 -07:00
e5a0c0d5bf Unused variable error 2024-05-13 13:18:20 -04:00
4b81a99f91 Merge pull request #7424 from SparkiDev/aes_xts_x64_msvc
AES XTS asm x64 MSVC
2024-05-13 13:05:23 -04:00
1be10fddba Merge pull request #7509 from miyazakh/user_threading
Add user threading macro definition
2024-05-13 09:24:44 -07:00
4eab5267f1 Merge pull request #7511 from julek-wolfssl/ec-meth
Stub EC_KEY_METHOD
2024-05-13 09:22:23 -07:00
56129bd160 Merge pull request #7480 from gojimmypi/PR-cmake-liboqs-kyber
Introduce cmake SET_WOLFSSL_DEFINITIONS; Add Kyber and OQS
2024-05-13 09:21:23 -07:00
a9164293c2 Merge pull request #7513 from julek-wolfssl/gh/7510
ed25519: check that the signature is smaller than the order
2024-05-13 09:16:17 -07:00
568fda0e8b Merge pull request #7517 from bandi13/bugFixes
Bug fixes
2024-05-13 09:01:00 -07:00
d39ab765f6 Merge pull request #7519 from julek-wolfssl/gh/7516
Return length in wc_Curve448PublicKeyToDer with NULL output param
2024-05-13 09:00:33 -07:00
81c22128e3 Merge pull request #7523 from douzzer/20240511-clang-analyzer-unix.Stream
20240511-clang-analyzer-unix.Stream
2024-05-13 21:53:13 +10:00
0d996f4e5f Merge pull request #7524 from douzzer/20240512-pkcs12_test-leak
20240512-pkcs12_test-leak
2024-05-13 09:06:04 +10:00
1faa70c128 wolfcrypt/test/test.c:
* fix unconditional memory leak in pkcs12_test().
* refactor pkcs12_test() to fix error-conditional memory leaks.
* fix various old-style return codes in sm4_ccm_test(), pkcs12_test(), prf_test(), tls12_kdf_test(), xmss_test(), xmss_test_verify_only(), lms_test(), and lms_test_verify_only().
2024-05-12 14:13:06 -05:00
9ac6bdd438 fixes and suppressions for defects reported by clang-analyzer-unix.Stream (new in llvm-19.0.0_pre20240504):
* added POSIX definitions for XFEOF(), XFERROR(), and XCLEARERR(), currently with no-op fallbacks for !POSIX.
* added missing file handle checks in testsuite/testsuite.c:file_test() and tests/utils.h:copy_file().
* added fixes and suppression around tests/api.c:test_wolfSSL_SMIME_read_PKCS7().
* added various fixes in examples/asn1/asn1.c and examples/pem/pem.c.
2024-05-11 15:24:54 -05:00
c5773f5f26 Make the function flow better
Will return 0 on failure.
2024-05-10 15:56:56 -04:00
f73a9f0d4f Fix function logic 2024-05-10 15:03:17 -04:00
239706615c Return length in wc_Curve448PublicKeyToDer with NULL output param 2024-05-10 20:10:23 +02:00
d68f3cf63c add macro guard around test case 2024-05-10 11:08:45 -06:00
98a19f9fdd add debug log and adjust set global heap hint function 2024-05-10 11:08:43 -06:00
de3d1a488d add global heap hint setter function 2024-05-10 11:08:01 -06:00
add7428d1c TLS, SM2: fixes to get SM handshakes working
Pass around the algorithm id from the private key so that the WOLFSSL or
WOLFSSL_CTX get the correct key format set.
Use different verification context when self-signed certificate with SM2
and SM3 signature but public key OID is ECC.
2024-05-10 10:15:47 +10:00
b87b521044 AES XTS asm x64 MSVC
Use assembly code for AES-XTS with MSVC for x64.
2024-05-10 09:10:36 +10:00
cb689104d1 Merge pull request #7466 from julek-wolfssl/gh/7273
Mark all record sequence numbers before stateful parsing as read
2024-05-09 13:57:13 -04:00
2335eb6bc6 Merge pull request #7488 from SparkiDev/asn_template_debug_fix
Asn template debug fix
2024-05-09 12:16:51 -04:00
2ed2da0a8f Merge pull request #7515 from douzzer/20240509-fix-linuxkm-x86_vector_register_glue
20240509-fix-linuxkm-x86_vector_register_glue
2024-05-09 11:53:36 -04:00
b62e8c1467 ASN template debug compile error
Variable is length instead of len.
2024-05-09 10:44:36 -05:00
ab03324dc7 ed25519: put entire order into buffer for sanity check 2024-05-09 10:36:37 +02:00
611a1642a1 linuxkm/include.am: add linuxkm/x86_vector_register_glue.c to EXTRA_DIST. 2024-05-09 02:03:16 -05:00
f7e1e370a0 Merge pull request #7438 from julek-wolfssl/zephr-no-malloc
zephyr no malloc
2024-05-09 02:57:20 -04:00
10b31cc481 Merge pull request #7507 from rizlik/update_err_code_cert
tls13: update error code to NO_CERT_ERROR when no cert is set
2024-05-09 01:38:26 -04:00
af928faca7 Merge pull request #7489 from anhu/zero_len_hash
Allow for zero length hash.  Its not an error.
2024-05-09 01:34:24 -04:00
d53abc2e37 Merge pull request #7441 from kareem-wolfssl/zd17857
Allow using wolfSSL_CTX_set_default_verify_paths without WOLFSSL_SYS_CA_CERTS defined.
2024-05-09 00:38:04 -04:00
ac17616873 Merge pull request #7514 from douzzer/20240508-linuxkm-x86_vector_register_glue
20240508-linuxkm-x86_vector_register_glue
2024-05-08 21:45:39 -04:00
5a784c818d Merge pull request #7319 from SparkiDev/chacha_poly1305_asm_msvc
ChaCha20, Poly1305 ASM for MSVC
2024-05-08 19:03:56 -04:00
76b302381b Merge pull request #7484 from SparkiDev/mem_fail_fixes_1
Mem fail fix: ProcessingBuffer()
2024-05-08 18:36:45 -04:00
5ceb992035 address review comments 2024-05-09 07:05:51 +09:00
bc8664164b linuxkm: move the *SAVE_VECTOR_REGISTERS* code from linuxkm/linuxkm_memory.c to linuxkm/x86_vector_register_glue.c, to move various fidgity/unstable kernel function calls outside the PIE wolfCrypt container. 2024-05-08 16:18:33 -05:00
2508c9e1f4 ed25519: check that the signature is smaller than the order 2024-05-08 17:54:37 +02:00
d6291522b9 fixup! Stub EC_KEY_METHOD 2024-05-08 16:41:00 +02:00
0f06faf3d4 Stub EC_KEY_METHOD 2024-05-08 16:37:30 +02:00
8f9c8a1203 Fix infinite loop
'ret' could be set to non-zero inside the loop and the 'cmac->bufferSz' never gets reset causing 'add' to become 0 in the subsequent loop.
2024-05-08 09:52:37 -04:00
df425b306f Fix https://github.com/wolfSSL/wolfssl/issues/7391 2024-05-08 10:35:42 +02:00
86c120a3f0 Increase hostap test timeout 2024-05-08 10:35:42 +02:00
16ec3e52b7 Jenkins fixes 2024-05-08 10:35:42 +02:00
433f3ae0b9 Add latest patch set to CI 2024-05-08 10:35:42 +02:00
a987e76677 Use uml for hostap tests
Remove tests that fail with openssl
2024-05-08 10:33:30 +02:00
6b47ebd66a Expose *_set_groups for TLS < 1.3
- Add test to make sure we fail on curve mismatch
2024-05-08 10:33:20 +02:00
020bcd0043 Advertise all supported sigalgs by default 2024-05-08 10:33:20 +02:00
66f72a258f Remove unused internal API 2024-05-08 10:33:20 +02:00
77a7297c42 Filter cipher list on TLS version change 2024-05-08 10:33:20 +02:00
06798ab8bf EAP-FAST
Implement PACs for EAP-FAST
- wolfSSL_set_session_ticket_ext_cb
- server side wolfSSL_set_session_secret_cb (tls <=1.2 only)
2024-05-08 10:33:20 +02:00
52861cbdbf Merge pull request #7476 from per-allansson/one-crl-to-rule-them-all
An expired CRL should not override a successful match in other CRL
2024-05-08 09:47:22 +10:00
95e9806e9e add user threading macro definition 2024-05-08 06:56:43 +09:00
97110700b2 Merge pull request #7430 from jpbland1/check-session-setup
Add `wolfSSL_SessionIsSetup`
2024-05-07 13:51:33 -04:00
33817747c4 Merge pull request #7506 from julek-wolfssl/gh/no-main
Don't use main.yml since it has a limit of 20 jobs
2024-05-07 09:22:56 -04:00
14ce8ce198 Jenkins fixes 2024-05-07 11:46:36 +02:00
b0c991eeb2 tls13: update error code to NO_CERT_ERROR when no cert is set 2024-05-07 10:55:48 +02:00
589bdba256 Apply suggestions from code review
Co-authored-by: Bill Phipps <bill@wolfssl.com>
2024-05-07 10:38:01 +02:00
77a6481d65 fixup! Add testing for zephyr no malloc 2024-05-07 10:38:01 +02:00
d7361b3677 Increase zephyr thread sample memory 2024-05-07 10:38:01 +02:00
8d8f4d4e1e fixup! zephyr no malloc 2024-05-07 10:38:01 +02:00
cbd490d1d7 fixup! zephyr no malloc 2024-05-07 10:38:01 +02:00
550d9ad9a4 Add testing for zephyr no malloc 2024-05-07 10:38:01 +02:00
7ed5e0b3ba zephyr no malloc
- cert gen
- csr gen
- pkcs12
- Compiles for Zephyr 3.4.0 and 2.7.4
- Add support for CONFIG_POSIX_API
2024-05-07 10:38:01 +02:00
2ffb5cc16c Move haproxy.yml to disabled directory 2024-05-07 10:31:04 +02:00
4e6a34504d Merge pull request #7500 from SparkiDev/lms_xmss_move_wolfcrypt
LMS, XMSS: move code into wolfCrypt
2024-05-07 01:12:18 -04:00
95abc1074b Merge pull request #7278 from JacobBarthelmeh/pkcs7-validate
add guard around public key validation on import
2024-05-06 13:51:29 -06:00
7bc73d351f Merge pull request #7504 from ejohnstown/generic-pool-fix
Generic Memory Pools Fix
2024-05-06 13:11:47 -06:00
7206508329 Don't use main.yml since it has a limit of 20 jobs 2024-05-06 17:18:01 +02:00
e90c6bcd24 Espressif updates to fix Apple Homekit SRP. 2024-05-04 14:33:23 -07:00
195bbcc315 Generic Memory Pools Fix
1. Add some expository comments describing the purpose of:
   * WOLFMEM_MAX_BUCKETS
   * WOLFMEM_DEF_BUCKETS
   * WOLFMEM_BUCKETS
   * WOLFMEM_DIST
2. Switch the API test for LoadStaticMemory() to named constants.
3. Delete redundant test case. Add a new test case.
4. In the wolfCrypt test for the memory constants, check the sizes of
   the WOLFMEM_BUCKETS and WOLFMEM_DIST lists against
   WOLFMEM_DEF_BUCKETS which should be their length. Check that
   WOLFMEM_DEF_BUCKETS is not greater than WOLFMEM_MAX_BUCKETS.
5. Default for WOLFMEM_MAX_BUCKETS should be WOLFMEM_DEF_BUCKETS, set it
   to what is specified. Add a warning if MAX is less than DEF.
6. Separate the definition of the constant LARGEST_MEM_BUCKET so it is
   dependent on config and not if WOLFMEM_BUCKETS isn't set.
2024-05-03 16:15:38 -07:00
081731be8b Merge pull request #7392 from gojimmypi/PR-Espressif-wolfcrypt-test
Update Espressif Examples and Libraries
2024-05-03 15:31:23 -06:00
4ddba7ac8a When comparing subject names, do not worry about case. 2024-05-03 15:03:07 -04:00
e47f1d4190 LMS, XMSS: move code into wolfCrypt
Move implementations of LMS and XMSS into wolfCrypt and use by default.
2024-05-03 15:43:22 +10:00
b88803cbb3 Fix formatting 2024-05-03 06:43:15 +02:00
d22991bb03 Merge pull request #7499 from douzzer/20240502-test_server_loop-double-close
20240502-test_server_loop-double-close
2024-05-02 23:53:04 -04:00
0c1d583ab4 tests/api.c: fix double close in test_server_loop(). 2024-05-02 19:07:36 -05:00
51b85ee1e3 Merge pull request #7490 from dgarske/ecc_curvecache_nomalloc
Support for ECC_CACHE_CURVE with no malloc
2024-05-02 07:17:01 +10:00
75b178f666 Merge pull request #7492 from JacobBarthelmeh/porting
remove assumption of struct layout
2024-05-02 07:14:06 +10:00
b61a6baf2b Merge pull request #7497 from douzzer/20240501-fix-pqcrypto-private_key-callback-names
20240501-fix-pqcrypto-private_key-callback-names
2024-05-01 16:02:29 -04:00
ba89e0786d Merge pull request #7498 from douzzer/20240501-openssl-sha3-sizeof-fix
20240501-openssl-sha3-sizeof-fix
2024-05-01 15:50:17 -04:00
678038a077 wolfssl/openssl/sha3.h: use sizeof(wc_Sha3), not sizeof(struct wc_Sha3), for compatibility with afalg_hash.h and other ports that don't define a struct wc_Sha3. 2024-05-01 14:19:32 -05:00
5905f9289d fix namespace collision: rename types read_private_key_cb and write_private_key_cb to wc_{lms,xmss}_read_private_key_cb and wc_{lms,xmss}_write_private_key_cb. 2024-05-01 13:58:57 -05:00
866468ec2c Merge pull request #7496 from douzzer/20240501-xilinx-wc_Sha3
20240501-xilinx-wc_Sha3
2024-05-01 14:51:56 -04:00
a25644c379 Merge pull request #7495 from bandi13/fixWindowsNetdb_h
Fix windows 'gethostbyname' declaration
2024-05-01 14:16:45 -04:00
7f6f824594 wolfssl/wolfcrypt/port/xilinx/xil-sha3.h: fix struct name -- struct wc_Sha3, not struct Sha3. 2024-05-01 12:47:23 -05:00
c3131b3234 Fix windows 'gethostbyname' declaration 2024-05-01 13:37:22 -04:00
3afa420c31 Add option NO_ECC_CACHE_CURVE to allow disabling ECC curve cache with async. 2024-05-01 07:25:28 -07:00
1ddc552828 TLS, SM2: fix ecc key type
Set the curve explicitly if it is SM2.
Set the key type to signature algorithm to handle SM2.
2024-05-01 17:56:49 +10:00
e45686cce9 Merge pull request #7494 from douzzer/20240430-xmss-analyzer-cleanups
20240430-xmss-analyzer-cleanups
2024-05-01 14:36:46 +10:00
840d1e9fac Benchmark, SM2: initialize vars for small stack
Variables may not be initialized in benchmark test when building for
small stack.
2024-05-01 13:52:46 +10:00
fa30d3ae0b wolfcrypt/benchmark/benchmark.c: fixes for clang-analyzer-deadcode.DeadStores in bench_xmss_sign_verify();
wolfcrypt/test/test.c: fix for invalidPrintfArgType_sint in xmss_test_verify_only().
2024-04-30 22:48:48 -05:00
aab97fe9e2 ChaCha20, Poly1305 ASM for MSVC
Make ChaCha20 and Poly1305 asm available for MSVC.
2024-05-01 13:44:25 +10:00
db6b1388ce Benchmark, SM3: fix full hash testing
Test now has an array of hashes.
Use only first hash when testing full digest operation.
2024-05-01 09:57:13 +10:00
4594151588 Merge pull request #7418 from ejohnstown/generic-pool
Generic Memory Pools
2024-05-01 08:53:56 +10:00
72d49964b9 Merge pull request #7379 from mrdeep1/enable-rpk
configure.ac: Add in --enable-rpk option
2024-05-01 08:44:08 +10:00
2a125ad304 Merge pull request #7479 from gojimmypi/PR-cmake-update
Introduce cmake_policy CMP0128 NEW
2024-05-01 08:39:58 +10:00
76e478ad8d Merge pull request #7491 from bandi13/fixDTLStest
Make the DTLS tests a bit more resilient
2024-05-01 08:38:41 +10:00
5aa39a6397 remove assumption of struct layout 2024-04-30 15:42:38 -06:00
256d81795a Make the DTLS tests a bit more resilient
The assumption is that the wrong PIDs are getting killed. Better use the current shell's child processes (ie: 'jobs' command) than storing some calculated PID
2024-04-30 15:49:51 -04:00
6be55269db Generic Memory Pools
1. Add API for function `wc_UnloadStaticMemory()` which frees the mutex
   used by the static memory pool.
2. Update the `wc_LoadStaticMemory_ex()` test to free the static memory
   pool's mutex on each successful test case.
2024-04-30 09:34:48 -07:00
f6ae432be1 Generic Memory Pools
1. Add API test for function `wc_LoadStaticMemory_ex()`.
2024-04-30 09:29:20 -07:00
216925a946 Introduce cmake get/set_wolfssl_definitions; Add Kyber and OQS 2024-04-30 08:41:46 -07:00
eaa5edb65b Support for ECC_CACHE_CURVE with no malloc. ZD 17774 2024-04-30 08:22:56 -07:00
529b6a1eb9 Allow for zero length hash. Its not an error.
Fixes ZD17910
2024-04-30 11:06:30 -04:00
f18633a000 Merge pull request #7474 from miyazakh/renesas_rz_rsip_update
Improve Renesas RZ support
2024-04-30 21:59:12 +10:00
d4b265e84c convert outLen type correctly 2024-04-30 17:19:11 +09:00
6b1e6e3ef9 Spelling fixes. 2024-04-30 17:19:11 +09:00
07de40e4bd fix warnings
fix encrypted key use case

Update README
2024-04-30 17:19:11 +09:00
980e26da63 Introduce cmake_policy CMP0128 NEW 2024-04-29 19:27:41 -07:00
0d86137317 Merge pull request #7487 from bandi13/fixDockerfile
Fix dockerfile
2024-04-30 11:50:24 +10:00
068a3b5e99 Merge pull request #7481 from douzzer/20240424-sha-C-dynamic-fallback
20240424-sha-C-dynamic-fallback
2024-04-30 09:00:57 +10:00
5cc05956d5 Merge pull request #7485 from dgarske/pkcs11_async
Improved the prioritization of crypto callback vs async crypt in ECC …
2024-04-30 08:41:14 +10:00
bb4c2cbad6 address peer review: typography in linuxkm/linuxkm_memory.c, typography, clarity, and efficiency in wolfcrypt/src/sha256.c and wolfcrypt/src/sha512.c. 2024-04-29 14:02:44 -05:00
5af0b1e83b Improved the prioritization of crypto callback vs async crypt in ECC and RSA. Resolves possible use of uninitialized value on ECC/RSA key when PKCS11 is enabled. See #7482 2024-04-29 10:34:01 -07:00
b90035d7b0 Remove 'dunfell' as its support ends in 3 days 2024-04-29 12:26:29 -04:00
13f83045a4 Add in 'langdale' and 'scarthgap' containers 2024-04-29 12:22:54 -04:00
aa1f253a8a Force a rebuild using the latest sources 2024-04-29 12:21:47 -04:00
41eaa8466d Mem fail fix: ProcessingBuffer()
When ProcessBufferCertTypes() is not called, 'der' is not freed.
2024-04-29 23:05:29 +10:00
e96a65a93d An expired CRL should not override a successful match in other CRL 2024-04-29 09:35:28 +02:00
bd9a27a39b Merge pull request #7472 from ColtonWilley/remove-des3-guard-from-pkcs12-tests
Remove DES3 flag guard from pkcs12 tests
2024-04-29 10:54:39 +10:00
393bf4a8e2 wolfssl/openssl/sha3.h: use sizeof(struct wc_Sha3) only ifdef WOLFSSL_SHA3. 2024-04-27 13:17:01 -05:00
7260cc124c smallstack refactors of wolfcrypt/src/evp.c:wolfssl_evp_digest_pk_final() and wolfcrypt/test/test.c:openssl_test(). 2024-04-27 12:35:23 -05:00
885497ba5a add missing gate around Sha256_SetTransform() declaration in wolfcrypt/src/sha256.c;
remove stray definitions of XTRANSFORM*() in wolfcrypt/src/sha512.c;

restore global intel_flags in the !WC_NO_INTERNAL_FUNCTION_POINTERS paths of sha256.c and sha512.c;

disable test_wolfSSL_dtls_compare_stateless() in tests/api.c when DEBUG_VECTOR_REGISTER_ACCESS_FUZZING (it depends on a stable SHA512 hash of the in-memory struct WOLFSSL image).
2024-04-27 12:35:23 -05:00
0566584191 implement full support for --enable-intelasm --enable-linuxkm. also add --enable-curve25519=noasm to allow use of the existing NO_CURVED25519_X64 code path by the linuxkm build (fe_x25519_asm.S is not kernel-compatible). 2024-04-27 12:35:23 -05:00
326fd87b4f linuxkm/linuxkm_memory.c: fix circular dependency around wolfCrypt_Init(), allocate_wolfcrypt_linuxkm_fpu_states(), wc_linuxkm_fpu_state_assoc(), on FIPS. 2024-04-27 12:35:23 -05:00
3f8e33369c implement WC_C_DYNAMIC_FALLBACK for SHA-3. 2024-04-27 12:35:23 -05:00
4184b0e4f3 implement WC_C_DYNAMIC_FALLBACK for SHA512. 2024-04-27 12:35:23 -05:00
65649b63d1 implement WC_C_DYNAMIC_FALLBACK for SHA256. 2024-04-27 12:35:23 -05:00
4cc27fa58b rename WC_AES_C_DYNAMIC_FALLBACK to WC_C_DYNAMIC_FALLBACK. 2024-04-27 12:35:23 -05:00
2496cc0c21 Merge pull request #7477 from julek-wolfssl/issue/7390-2
Fix quic header protect cipher return
2024-04-27 07:10:18 -07:00
d23994862c Generic Memory Pools
1. Added some extra parameter checking to wc_LoadStaticMemory_ex().
2. Added some extra parameter checking to wc_StaticBufferSz_ex().
3. Rename some parameters and add some logging prints.
4. Some static functions have some parameter checking and they are only
   calling in one spot, remove it.
2024-04-26 15:08:17 -07:00
c1f23cc505 Allow using wolfSSL_CTX_set_default_verify_paths without WOLFSSL_SYS_CA_CERTS defined. 2024-04-26 10:22:40 -07:00
21058820fb Fix NO_WOLFSSL_STUB typo. 2024-04-26 10:22:40 -07:00
2328270222 Code review 2024-04-26 15:56:20 +02:00
49952a97d7 Fix quic header protect cipher return 2024-04-26 14:18:40 +02:00
e1bd4dd1ec Merge pull request #7473 from douzzer/20240425-fixes
20240425-fixes
2024-04-26 15:52:05 +10:00
e41454004e Merge pull request #7475 from douzzer/20240425-master-for-jenkins
20240425-master-for-jenkins
2024-04-26 14:54:20 +10:00
442d3f30cc src/ssl.c: refactor fix in wolfSSL_RAND_bytes() for race on initGlobalRNG to retain the initial check on initGlobalRNG, and just recheck it, to avoid possible access to uninitialized globalRNGMutex. 2024-04-25 23:47:39 -05:00
185f35287e configure.ac: fix copyright year. 2024-04-25 22:44:28 -05:00
59290cd066 src/quic.c: fix -Wunused-function for evp_cipher_eq(). 2024-04-25 22:09:28 -05:00
963e14a1fe src/ssl.c: code style tweak from peer review. 2024-04-25 22:09:28 -05:00
8e8e9bd0eb src/ssl.c: fix races in wolfSSL_Init() and wolfSSL_RAND_bytes(). 2024-04-25 22:09:28 -05:00
460991a6f0 wolfcrypt/test/test.c: fix invalidPrintfArgType_sint in lms_test_verify_only(). 2024-04-25 22:09:28 -05:00
c8e51112c3 Merge pull request #7372 from julek-wolfssl/zd/17435
Add secret logging callback to TLS <= 1.2
2024-04-26 09:41:58 +10:00
5ee0e34d89 Merge pull request #7465 from julek-wolfssl/issue/7390
Clean up EVP usage in quic
2024-04-26 09:38:40 +10:00
54022b146b Merge pull request #7456 from mrdeep1/enable-dtls13
dtls1.3: Fix issues when --enable-dtls13 enabled
2024-04-26 09:24:01 +10:00
7881f4e04c Merge pull request #7471 from ColtonWilley/update-benchmark-rsa-size-parsing
Update benchmark to only parse rsa size if keygen is enabled
2024-04-26 09:11:32 +10:00
e22ae7a1f8 Merge pull request #7469 from douzzer/20240424-fix-ports-whitespace
20240424-fix-ports-whitespace
2024-04-26 09:00:38 +10:00
039fd26baf Merge pull request #7467 from anhu/quick_fix
Get rid of some code with NO_OLD_TLS
2024-04-26 08:57:46 +10:00
9ac918c0d4 Merge pull request #7462 from kaleb-himes/SRTP-KDF-HARNESSrev2
Srtp kdf harness rev2
2024-04-26 08:21:37 +10:00
2fb70b260b Remove DES3 flag guard from pkcs12 tests that do not depend on DES3 code 2024-04-25 12:15:02 -07:00
7485e9935d Update benchmark to only parse rsa size if keygen is enabled, update keygen option help in configure.ac 2024-04-25 11:46:18 -07:00
c62faa048c Add secret logging callback to TLS <= 1.2 2024-04-25 17:11:07 +02:00
d61fec5af9 Clean up EVP usage in quic 2024-04-25 16:34:38 +02:00
7644d792b6 Mark all record sequence numbers before stateful parsing as read
Fixes https://github.com/wolfSSL/wolfssl/issues/7273
2024-04-25 16:23:41 +02:00
e862c85db4 fix formatting infractions in the ports (hard tabs, trailing whitespace, C++ comments, stray Unicode including numerous homoglyphs). 2024-04-24 18:32:48 -05:00
565058370f Cleanup & sort IDE include.am 2024-04-24 15:36:15 -07:00
329650fb4c Get rid of some code with NO_OLD_TLS 2024-04-24 16:00:45 -04:00
24eed7de34 Remove debug printf and place comments inside gate 2024-04-24 10:55:13 -04:00
e36df36f84 dtls1.3: Fix issues when --enable-dtls13 enabled
Fixed issue reported by scan-build when DTLS13 is enabled.

Fix compile issue when WOLFSSL_DTLS_CH_FRAG is enabled.

Fix running of scripts/dtlscid.test by removing 'set -e' as bwrap
command may not be there.
2024-04-24 12:07:29 +01:00
6e49aa7543 Merge pull request #7421 from philljj/update_lms_parms
Update enum wc_LmsParm for wolfboot support.
2024-04-24 16:39:10 +10:00
c26f4041c6 Merge pull request #7463 from ColtonWilley/hmac-oversized-key-test-update
Update HMAC oversized key tests
2024-04-24 15:34:28 +10:00
7f19be05bd Modify HMAC oversized key tests to consistently use test vectors from RFC. 2024-04-23 15:23:51 -07:00
9d7913508b Merge pull request #7460 from douzzer/20240423-linuxkm-sha-2-3-asm-save-vector-regs
20240423-linuxkm-sha-2-3-asm-save-vector-regs
2024-04-24 07:33:05 +10:00
4a1df83b6f configure.ac: Add in --enable-rpk option
By default RPK (RFC7250) support is not enabled, but is enabled when
--enable-rpk, --enable-all or --enable-dist is used.

Makes use of the HAVE_RPK compile time option.

Fix clang issue reported in tests/api.c during test suites
2024-04-23 21:30:21 +01:00
80d21f10c6 Remove excess empty line 2024-04-23 13:47:26 -04:00
690671d447 ECC allow keyVer of 192-bit (import OK, generate restricted) 2024-04-23 13:45:41 -04:00
094ddb62c2 Add wc_LmsKey_ExportPubRaw to wolfcrypt test. 2024-04-23 10:48:53 -05:00
a75c2befb5 Add CUDA support (#7436)
* Redirect the AesEncrypt_C call to device
* Fix function declarations
* Force CC=nvcc with CUDA
* Don't let C++ mangle function names
* Add larger parallelization
* Add in memory copy to device
* `nvcc` does not support '-Wall' nor '-Wno-unused'
* Add in README.md
* Clean up script to output color coded data
* Fix Asymmetric cipher comparisons
* Add in standard output parsing in addition to the CSV
* Add option to output results in a CSV

---------

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2024-04-23 08:26:27 -07:00
bc00c95fe5 Update enum wc_LmsParm for wolfboot support. 2024-04-23 09:37:07 -05:00
5d9154e8c6 wolfcrypt/src/sha{256,512,3}.c add SAVE_VECTOR_REGISTERS() for SHA-2 and SHA-3 vectorized implementations, and add WC_NO_INTERNAL_FUNCTION_POINTERS code paths to fix GOT relocations around implementation function pointers. 2024-04-23 01:31:43 -05:00
c3d9fb61a8 Merge pull request #7444 from miyazakh/trackmem_exclusion
Exclusively tracking mem properties
2024-04-23 11:08:42 +10:00
eb125851cd Merge pull request #7447 from Naruto/feature/enable_sccache
add ENABLE_SCCACHE option
2024-04-23 11:05:43 +10:00
3a89c452b3 Merge pull request #7454 from lealem47/stm32AesCtr
Fix for AES CTR on STM32
2024-04-22 10:04:06 -07:00
0b5c83f589 Generic Memory Pools
1. Make the function wolfSSL_GetMemStats() public.
2024-04-22 08:54:40 -07:00
7a0bcb05fb Generic Memory Pools
1. Add checks for listSz against WOLFMEM_MAX_BUCKETS.
2. Use WOLFMEM_DEF_BUCKETS for the size when using the default memory
   descriptions.
3. Whitespace.
2024-04-22 08:54:40 -07:00
15a0ae4244 Generic Memory Pools
1. Add generic function wolfSSL_StaticBufferSz_ex() where one specifies
   the memory bucket list sizes and distribution.
2. Rewrote wolfSSL_StaticBufferSz() in terms of the new function.
3. Changed the list pointers on wc_LoadStaticMemory_ex() and
   wc_init_memory_heap() to be pointers to const.
2024-04-22 08:54:40 -07:00
7481644842 Generic Memory Pools
1. Add the function wc_LoadStaticMemory_ex(), which is a generic version
   of wc_LoadStaticMemory().
2. Modify wc_LoadStaticMemory() to call wc_LoadStaticMemory_ex() with
   the bucket lists.
3. Rename the function wolfSSL_load_static_memory() as
   wc_partition_static_memory(), make it static, move it higher in the file.
2024-04-22 08:54:40 -07:00
2168b154b6 Generic Memory Pools
1. Modify wolfSSL_CTX_load_static_memory() to use wc_LoadStaticMemory()
   instead of reimplementing it.
2. Initialize the pointers in wc_LoadStaticMemory() to null.
3. Whitespace changes.
2024-04-22 08:54:37 -07:00
b17ad46b30 Merge pull request #7458 from douzzer/20240422-wc_SRTCP_KDF_ex-Wconversion
20240422-wc_SRTCP_KDF_ex-Wconversion
2024-04-22 21:30:14 +10:00
44e8f392ae wolfcrypt/src/kdf.c: fix -Wconversions in wc_SRTCP_KDF_ex(). 2024-04-22 01:11:46 -05:00
5bb22d8343 Merge pull request #7439 from JacobBarthelmeh/build_test
fix for WOLFSSL_NO_PEM build
2024-04-22 10:48:57 +10:00
e1b66ca62d Merge pull request #7407 from mrdeep1/key_share
Handle PSK-Only negotiation with key_share not being sent in Server Hello
2024-04-22 10:45:56 +10:00
cfe645ca70 Merge pull request #7455 from kaleb-himes/SRTCP-48bit-indices
Srtcp 48bit indices
2024-04-22 10:43:07 +10:00
eeadb2a7f3 Merge pull request #7457 from douzzer/20240420-wc_linuxkm_fpu_state_assoc-fixups
20240420-wc_linuxkm_fpu_state_assoc-fixups
2024-04-22 10:39:55 +10:00
0a4eb1fbc7 linuxkm/linuxkm_memory.c: require kernel 5.4+ for AESNI/AVX, and add fixup code in wc_linuxkm_fpu_state_assoc_unlikely() to cope with migrations. in save_vector_registers_x86(), on kernel < 5.17, check test_thread_flag(TIF_NEED_FPU_LOAD) as a workaround for irq_fpu_usable() missing check for in_kernel_fpu. 2024-04-20 13:55:37 -05:00
eafa425019 Engine doesn't need NO_OLD_RNG_NAME 2024-04-19 16:15:38 -06:00
78670f5098 Merge pull request #7453 from douzzer/20240419-wolfSSL_CTX_SetTmpDH-double-free
20240419-wolfSSL_CTX_SetTmpDH-double-free
2024-04-19 13:48:37 -06:00
4b1edc78bb Add test case 2024-04-19 13:16:19 -06:00
acc6ff84d8 Move rng seed cb call to wolfcrypt_test 2024-04-19 12:36:20 -06:00
9bc0e31a32 Fix for AES CTR on STM32 2024-04-19 12:35:33 -06:00
e835517633 SRTCP 32-bit indices default plus errata 48-bit indices 2024-04-19 12:31:08 -06:00
69be7a7c54 Merge pull request #7431 from lealem47/aes_cfb
Fix for AES-CFB1 encrypt/decrypt on size (8*x-1) bits
2024-04-19 10:55:27 -06:00
a63ff277ed Merge pull request #7452 from douzzer/20240419-linuxkm-intelasm-expansion
20240419-linuxkm-intelasm-expansion
2024-04-19 10:46:11 -06:00
39e2405e2f src/ssl_load.c: fix double-free in wolfSSL_CTX_SetTmpDH(). 2024-04-19 11:43:32 -05:00
5f9ed54aaa Merge pull request #7451 from SparkiDev/test_fixes_1
Fixes from configuration testing
2024-04-19 10:43:31 -06:00
c7f852fbbd Merge pull request #7450 from anhu/reneg_indic
check for conflicting secure renegotiation macros (settings.h)
2024-04-19 10:41:26 -06:00
9242f611b2 Merge pull request #7449 from lealem47/nginx_stubs
Adding stubs required for latest nginx
2024-04-19 10:38:17 -06:00
7b22681287 Handle PSK-Only negotiation with key_share not being sent in Server Hello
The wrong cipher suite is potentially chosen if key_share is not seen by the client.

$ cat /tmp/test
Client_identitySHA256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Server:
$ gnutls-serv --http --priority NORMAL:+ECDHE-PSK:+PSK:+ECDHE-ECDSA:+AES-128-CCM-8:+CTYPE-CLI-ALL:+CTYPE-SRV-ALL:+SHA256 --pskpasswd=/tmp/test

Client:
$ examples/client/client -vd -g -s -p 5556 2>&1| grep HTTP
2024-04-19 17:14:28 +01:00
0264a518e1 wolfcrypt/src/ed25519.c: in ed25519_pairwise_consistency_test(), add casts to mollify -Wconversion. 2024-04-19 01:41:35 -05:00
28480ec0ea linuxkm/Kbuild: add SHA-2, SHA-3, ChaCha20, and poly1305, to kernel-safe vectorized-asm list. 2024-04-19 01:35:45 -05:00
85f3fb9d07 Merge pull request #7409 from SparkiDev/asm_x64_rip_fix
SHA-256 x64 ASM - fix use of %rip
2024-04-19 02:33:47 -04:00
d2b9a365f2 ChaCha20 and Poly1305 x64 ASM - fixu use of %rip
Get the address of the constants into a register at start instead of
calculating the address relative to the instruction pointer each time.
2024-04-19 09:59:54 +10:00
97d560d9af Fixes from configuration testing
asn1.c: Allow sample to build without coding (base64 decoding).

set_curves_list(): function for ECC, Ed25519, Ed448 but this block of
code is ECC only. Fixed #ifdef protection.

wolfSSL_CTX_set1_curves_list and wolfSSL_set1_curves_list also available
when Curve25519/Curve448 compiled in but not ECC.
2024-04-19 08:40:19 +10:00
7a7af18887 Guard with OPENSSL_EXTRA instead of WOLFSSL_NGINX 2024-04-18 16:33:37 -06:00
85326da7fc check for conflicting HAVE_RENEGOTIATION_INDICATION and HAVE_SECURE_RENEGOTIATION in settings.h 2024-04-18 17:51:33 -04:00
fe671f72e1 Merge pull request #7435 from SparkiDev/ssl_misc_fixup
ssl_misc.c: wolfssl_file_len() protection
2024-04-18 14:36:38 -06:00
ef153101b7 Merge pull request #7433 from SparkiDev/eddsa_fips_checks
EdDSA FIPS checks on public key
2024-04-18 14:34:31 -06:00
9666e4d7e4 Merge pull request #7448 from douzzer/20240418-pq-hybrid-fixes
20240418-pq-hybrid-fixes
2024-04-18 14:31:27 -06:00
e48f06bd53 fixes for WOLFSSL_DUAL_ALG_CERTS: "cannot take address of bit-field ‘altKeyType’" and "‘altPrivateKeyType’" in ProcessBufferTryDecode(), "‘heap’ undeclared" in ProcessBufferCertAltPublicKey(), "‘consumed’ undeclared" in ProcessFile(), "‘keySz’ undeclared" in wolfSSL_CTX_use_PrivateKey_Id(). 2024-04-18 13:49:44 -05:00
a1cf316630 Adding stubs required for latest nginx 2024-04-18 12:28:31 -06:00
295033441c Fix for AES-CFB1 encrypt/decrypt on size (8*x-1) bits 2024-04-18 11:31:28 -06:00
38dc4f299c add ENABLE_SCCACHE option 2024-04-19 00:40:57 +09:00
0bd5967093 Adjust FIPS version and default configuration 2024-04-18 08:41:05 -06:00
08b42b7c93 Merge pull request #7443 from douzzer/20240418-fix-aes_xts_128_test-DEBUG_VECTOR_REGISTER_ACCESS
20240418-fix-aes_xts_128_test-DEBUG_VECTOR_REGISTER_ACCESS
2024-04-18 21:10:40 +10:00
dab6726e58 fix tracking mem properties under multi-threads 2024-04-18 15:14:25 +09:00
436efb0078 wolfcrypt/test/test.c: in aes_xts_128_test(), change DEBUG_VECTOR_REGISTER_ACCESS gates to DEBUG_VECTOR_REGISTER_ACCESS_AESXTS (currently unused), after refactor of AES-XTS C fallback in 9f55dba2f2. (per-call fallback is no longer supported for AES-XTS.) 2024-04-18 00:59:03 -05:00
41f31f4635 Merge pull request #7440 from douzzer/20240417-fix-LoadSystemCaCertsWindows
20240417-fix-LoadSystemCaCertsWindows
2024-04-17 15:47:48 -06:00
58167a2ebb Merge pull request #7434 from douzzer/20240416-fips-v6-fixes
20240416-fips-v6-fixes
2024-04-17 13:52:35 -06:00
6e3a9d5447 src/ssl_load.c: in LoadSystemCaCertsWindows(), fix flub introduced in 8e9810e87e. 2024-04-17 13:24:26 -05:00
c2e60d523f fix for WOLFSSL_NO_PEM build 2024-04-17 11:16:18 -06:00
593cb77e51 ssl_misc.c: wolfssl_file_len() protection
wolfssl_file_len is now used by wolfssl_read_file_static() which is
compiled in with less restrictions.
Fix #ifdef protection.
2024-04-17 22:44:13 +10:00
804cf1c3b7 re-add function to new file 2024-04-17 04:04:00 -04:00
b184cdf7b5 add underscore to make it more consistient and readable 2024-04-17 03:56:07 -04:00
c1dbbcc81e add wolfSSLSessionIsSetup so the user can check if
a session ticket has been sent by the server
2024-04-17 03:54:51 -04:00
c590fe514f EdDSA FIPS checks on public key
Check that the Ed25519 and Ed448 public key is valid even without
private key.
Perform pairwise consistency test, only in FIPS, when making a key i
Ed25519 and Ed448.
2024-04-17 17:50:33 +10:00
3df11e7eab fixes for cppcheck uninitvar src/pk.c (false positives) and nullPointerRedundantCheck in src/ssl_load.c (true positive). 2024-04-17 01:00:41 -05:00
fac834c80a configure.ac: in setup for enable-all and enable-all-crypto with enable-32bit, fix inconsistency whereby SHAKE was enabled but SHA512 and SHA3 weren't; remove unneeded+unwanted ENABLED_32BIT conditional force-off of SHA512, SHA384, SHA3, ED25519 (harmonizes with FIPS v6). 2024-04-17 00:43:41 -05:00
d0edb3d0a9 scripts/aria-cmake-build-test.sh: fix masked exit value. 2024-04-17 00:43:41 -05:00
855175da47 wolfcrypt/src/fe_448.c: fix several out-of-order declarations in fe448_mul_8(). 2024-04-17 00:43:41 -05:00
9f55dba2f2 wolfcrypt/src/aes.c: in AES-XTS AESNI, use cautious strategy as in AESGCM_STREAM for SAVE_VECTOR_REGISTERS, due to random failures seen with DEBUG_VECTOR_REGISTER_ACCESS_FUZZING using the old per-call fallback strategy. 2024-04-17 00:43:41 -05:00
b2f594e84b fixes for --enable-32bit CFLAGS=-m32 --enable-fips=v6 (fixes "#error ED448 requires SHAKE256"). 2024-04-17 00:43:41 -05:00
03ed52bd81 Merge pull request #7297 from SparkiDev/ssl_move_5
ssl.c: Move functions out to separate files
2024-04-16 17:56:55 -06:00
1f61ed3536 Merge pull request #7397 from dalybrown/expose-dtsl-in-ada
Expose DTLS in Ada wrapper and update examples
2024-04-16 13:37:23 -06:00
73a85af9b9 Merge pull request #7429 from julek-wolfssl/hostap-cert-update
Update hostap certs ref
2024-04-16 12:43:28 -04:00
52a593c883 Update hostap certs ref 2024-04-16 17:53:29 +02:00
8e9810e87e ssl.c: Move functions out to separate files
Moved E[CD][25519||448] APIs to pk.c
Move public key PEM APIs to pk.c.
Move wolfSSL loading and using of private keys and certificates to
ssl_load.c
Move PKCS#7 and PKCS#12 APIs to ssl_p7p12.c.
Move session and session cache APIs to ssl_sess.c.
Other minor fixes.
2024-04-16 10:30:59 +10:00
9b92aea245 Merge pull request #7422 from douzzer/20240412-fips-v5-v6-linuxkm-fixes
20240412-fips-v5-v6-linuxkm-fixes
2024-04-15 17:32:53 -06:00
281c2a431e wolfcrypt/test/test.c: fix return code in pbkdf2_test(), add DEBUG_WOLFSSL gates on keysize report in ecc_test_curve(), and add missing PRIVATE_KEY_UNLOCK()s in cryptocb_test() for fips-dev coverage. 2024-04-15 14:11:21 -05:00
6e0a90190f fixes for v5 and v6+ FIPS builds, including linuxkm v6+ builds. 2024-04-15 14:11:21 -05:00
be74cb7d94 Merge pull request #7419 from anhu/winpq
Add PQ Files for windows.
2024-04-15 10:21:47 -06:00
1cb34a8bed Merge pull request #7411 from douzzer/20240410-lock-free-wc_linuxkm_fpu_state_assoc
20240410-lock-free-wc_linuxkm_fpu_state_assoc
2024-04-15 10:20:39 -06:00
3742c4dd57 Merge pull request #7413 from gojimmypi/PR-PlatformIO-FreeRTOS
Modify PlatformIO FreeRTOS include path, settings.h
2024-04-12 14:32:55 -06:00
3113e6c855 Merge pull request #7393 from philljj/xmss_w64_settings
Adjust wc_xmss and wc_lms settings to support wolfboot.
2024-04-12 14:14:50 -06:00
7d0ce39408 Merge pull request #7396 from miyazakh/renesas_rx72n
fix rx72n compile failure
2024-04-12 14:03:45 -06:00
77bbb35830 Merge pull request #7415 from bandi13/addDockerCrossCompilerDependency
Add yet another cross compiling tool
2024-04-12 13:19:27 -06:00
85765b1a57 Add PQ Files for windows. 2024-04-12 15:05:29 -04:00
6ae99485a1 Additional changes to support wolfboot wc_lms. 2024-04-12 10:51:55 -05:00
5e85adee0f Add yet another cross compiling tool 2024-04-11 23:14:16 -04:00
8b656d5a5f Merge pull request #7295 from kaleb-himes/SRTP-KDF-FS
SRTP-KDF FS Preview
2024-04-11 13:41:05 -06:00
73e5303718 Removed duplicate file from project 2024-04-11 12:16:21 -06:00
29a41d5ff9 Add new fips-ready dependencies to WIN10 project 2024-04-11 10:56:46 -06:00
b1261f5471 Modify PlatformIO FreeRTOS include path, settings.h 2024-04-11 07:46:35 -07:00
954005af9a linuxkm/linuxkm_memory.c: refactor wc_linuxkm_fpu_state_assoc() as a lock-free O(1) mechanism with per-CPU rather than per-process state. 2024-04-11 00:06:28 -05:00
ff09f418c0 Merge pull request #7408 from SparkiDev/asn_templ_rid
X.509 RID ASN template behaviour
2024-04-10 11:42:07 -06:00
264dcd4e15 Fix a file mode and more overlong lines 2024-04-10 10:18:49 -06:00
4a8443f0e4 Address new file item reported by Jenkins 2024-04-10 11:05:11 -04:00
8b3fbe47e6 SHA-256 x64 ASM - fix use of %rip
Get the address of table K instead of using it directly each time a
value is required.
2024-04-10 15:02:19 +10:00
36b47d1374 Merge pull request #7352 from JacobBarthelmeh/coverity4
Coverity Fixes
2024-04-10 10:46:54 +10:00
b48b5c47f4 X.509 RID ASN template behaviour
Don't set the DNS entry for RID unless OPENSSL_ALL is defined to match
the behaviour of original ASN code.
2024-04-10 10:39:45 +10:00
2aae5eb0f5 Multi-test doesn't like over-long lines 2024-04-09 16:54:17 -06:00
55fc9c09e4 Set debugging off by default 2024-04-09 16:24:35 -06:00
455f1a6875 Addendum to windows support with OpenSSL Extra enabled 2024-04-09 16:19:48 -06:00
a8415a7926 Merge pull request #7367 from mrdeep1/hello_verify_request
Support DTLS1.3 downgrade when using PSK
2024-04-09 16:17:59 -06:00
b8d31b042f Windows support 2024-04-09 13:55:05 -06:00
71e83cdd19 Resolve armasm fips wrappers and sanity 2024-04-09 11:41:41 -06:00
0d83d0d199 Make wolfEntropy optional and bring settings.h in sync w/ master 2024-04-09 10:44:17 -06:00
e45867bbc3 WIN fips section refactor / wolfEntropy API syntax adjustment 2024-04-09 09:48:33 -06:00
a3413ad009 Address Jenkins caught item 2024-04-09 09:48:33 -06:00
ef2a636610 Expose additional features of opensslall in a compliant way 2024-04-09 09:48:33 -06:00
afeb3f5358 More peer feedback 2024-04-09 09:48:33 -06:00
d40700b93d Fix offset (whitespace) 2024-04-09 09:48:33 -06:00
84e5ccece5 Implement peer review feedback 2024-04-09 09:48:33 -06:00
8485f88688 Bring fips-dev inline with fips-ready 2024-04-09 09:48:33 -06:00
2e63ae750d Comments for SP800-38E TODO, wolfEntropy optional setup and remove forced errors api.c 2024-04-09 09:48:33 -06:00
8092104396 Address a flush-left in test.c and gt 80 column limit in settings.h 2024-04-09 09:48:33 -06:00
b7d88e0852 Cleanup duplicate forward dec logic with different macros 2024-04-09 09:48:33 -06:00
84f5b4e5bf Touchup a few more edge cases caught by Jenkins 2024-04-09 09:48:33 -06:00
829d028d98 Add configure for wolfEngine with new module 2024-04-09 09:48:33 -06:00
4df091ae2a Restore debug messages that were cluttering up logs 2024-04-09 09:48:33 -06:00
81f5ac7f6c SRTP-KDF FS Preview 2024-04-09 09:48:33 -06:00
dd79ca5d96 Merge pull request #7405 from SparkiDev/mismatch_cs_alert
No match cipher suite alert type change
2024-04-09 09:31:12 -06:00
144ffdc713 Merge pull request #7400 from philljj/test_xmss_pubraw
Add wc_XmssKey_ExportPubRaw to wolfcrypt test.
2024-04-09 09:14:23 -06:00
4a069ee5c1 Small cleanup for review. 2024-04-08 21:41:33 -05:00
707e60aa79 Address gnatprove issues in tls client 2024-04-08 19:40:06 -04:00
d96e5ec589 No match cipher suite alert type change
TLS 1.0/1.1/1.2 specifications require the of a return a handshake
failure alert when no cipher suites match.
TLS 1.3 specification requires the return of a "handshake_failure" or
"insufficient_security" fatal alert.

Change alert sent from "illegal_parameter" to "handshake_failure".
2024-04-08 11:25:50 +10:00
d1efccd259 Merge pull request #7381 from dgarske/netdb_ioctl
Restore `HAVE_NETDB_H` and `HAVE_SYS_IOCTL_H` checks in the wolfio.c.
2024-04-05 16:02:21 -04:00
a518f493b5 Merge pull request #7388 from JacobBarthelmeh/x509_cases
check for critical policy extension when not supported
2024-04-05 15:59:03 -04:00
7d66cc46ff Merge pull request #7375 from mrdeep1/fix_rpk
RPK: Define Certificates correctly for (D)TLS1.2
2024-04-05 15:48:25 -04:00
2ba12a89df Merge pull request #7386 from anhu/reseed_public
Make wc_RNG_DRBG_Reseed() a wolfCrypt API.
2024-04-05 14:27:26 -04:00
cf2f58bfdf Merge pull request #7395 from douzzer/20240403-RPK-cleanups
20240403-RPK-cleanups
2024-04-05 13:43:15 -04:00
3908bc34ed Merge pull request #7399 from douzzer/20240405-tls-endian-fixes
20240405-tls-endian-fixes
2024-04-05 13:40:07 -04:00
d0802335a8 Add wc_XmssKey_ExportPubRaw to wolfcrypt test. 2024-04-05 12:09:04 -05:00
97e731f27b Address gnatprove warnings and errors 2024-04-05 12:09:11 -04:00
cdf2504612 fixes for non-portable (endian-sensitive) code patterns around word16 in TLS layer. 2024-04-05 10:42:05 -05:00
9d56484d33 Merge pull request #7398 from douzzer/20240404-fips-VERSION3
20240404-fips-VERSION3
2024-04-05 07:53:32 -06:00
5cab707d8e Update Espressif Examples and Libraries 2024-04-04 20:40:52 -07:00
9542843874 wolfssl/wolfcrypt/settings.h: streamline definitions of WOLFSSL_FIPS_VERSION_CODE for the !HAVE_FIPS and !HAVE_FIPS_VERSION cases; add WOLFSSL_FIPS_VERSION2_CODE and fix the incumbent FIPS_VERSION_{LT,LE,EQ,GE,GT} definitions to use it. 2024-04-04 22:27:51 -05:00
ae2a92e449 add "VERSION3" variants of macros for testing and computing FIPS versions. 2024-04-04 17:39:07 -05:00
42f7be20c8 Fix assertion that address length must be greater than zero 2024-04-04 16:19:44 -04:00
63547d954a Fix formatting issues and remove unused variable 2024-04-04 16:06:19 -04:00
be72849d48 Expose DTLS in Ada wrapper and update examples 2024-04-04 15:52:14 -04:00
6c029badcc fix rx72n compile 2024-04-04 15:40:15 +09:00
747755b3c4 fixes for analyzer carps around HAVE_RPK:
fix clang-analyzer-deadcode.DeadStores in src/tls.c TLSX_ClientCertificateType_GetSize();

fix clang-analyzer-deadcode.DeadStores in tests/api.c test_tls13_rpk_handshake();

fix null pointer to XMEMCPY() in src/internal.c CopyDecodedName().
2024-04-04 00:15:01 -05:00
0c22f1f048 wc_xmss_impl requires misc.c functions. 2024-04-03 14:52:05 -05:00
8b587b563c Merge pull request #7286 from Frauschi/hybrid_signatures
Improvements to dual algorithm certificates
2024-04-03 13:37:16 -06:00
8511b2dc6b ProcessBuffer(): in WOLFSSL_DUAL_ALG_CERTS code path, fall through without disrupting ret, if cert->sapkiOID and cert->sapkiLen are unset. 2024-04-03 13:54:57 -05:00
79abae8c3d Only require WOLFSSL_W64_WRAPPER if WOLFSSL_XMSS_MAX_HEIGHT greater than 32. 2024-04-03 12:16:03 -05:00
57603823e3 Merge pull request #7387 from JacobBarthelmeh/sm2
fix for oss-fuzz sm2 test build
2024-04-03 10:08:46 -07:00
f6a24efe23 Merge pull request #7389 from dgarske/nxp_mmcau_sha256
Fix the NXP MMCAU HW acceleration for SHA2-256
2024-04-03 10:39:04 -06:00
9bfab33726 Address comments from Jacob. 2024-04-03 09:04:28 -04:00
d7c6d7af44 Fix the NXP MMCAU HW acceleration for SHA2-256. Broken with LMS SHA2 refactor. 2024-04-02 19:32:41 -07:00
c768f76d5a Merge pull request #7315 from fabiankeil/disable-3des-ciphers
Allow to enable DES3 support without the DES3 ciphers
2024-04-02 17:48:01 -06:00
75da69911c Merge pull request #7369 from dgarske/infineon_modustoolbox
Support for Infineon Modus Toolbox with wolfSSL
2024-04-02 17:34:07 -06:00
983616afa0 check for critical policy extension when not supported 2024-04-02 16:46:47 -06:00
04ebc966d0 Merge pull request #7385 from philljj/spelling_cleanup
Used codespell and fixed obvious typos.
2024-04-02 14:35:51 -06:00
d4f5825fd2 fix for sp build with ecc_map_ex 2024-04-02 11:40:53 -06:00
ed4f052215 Merge pull request #7382 from bandi13/reEnableTest
Revert "Disable broken library"
2024-04-02 10:51:50 -06:00
b334750bf2 Merge pull request #7383 from embhorn/zd17763
Fix build error with RECORD_SIZE defined
2024-04-02 10:51:11 -06:00
598a3bfdcd Make wc_RNG_DRBG_Reseed() a wolfCrypt API. 2024-04-02 12:33:35 -04:00
b65e42bf4d Used codespell and fixed obvious typos. 2024-04-02 10:19:39 -05:00
e072677379 Fix build error with RECORD_SIZE defined 2024-04-02 10:02:35 -05:00
790129ee71 cmake: Add WOLFSSL_DES3_TLS_SUITES option 2024-04-02 16:27:11 +02:00
092dba4593 wolfcrypt/src/asn.c: fix for benign identicalInnerCondition in ParseCertRelative(). 2024-04-01 23:50:05 -05:00
10d210ce26 Parenthesis 2024-04-01 19:05:59 -04:00
2d532dd6b8 Clean up after another round of analyzer execution. 2024-04-01 18:56:44 -04:00
6524fbb43f Revert "Disable broken library"
This reverts commit ce52a68c3d.
2024-04-01 18:11:42 -04:00
3a3a7c2a67 Forgot to clean up the preTBS. 2024-04-01 17:37:04 -04:00
6a4d4bf6f1 cks_order is used later; don't let it fall out of scope. 2024-04-01 17:37:03 -04:00
8f599defe0 Add check inspired by original implementation of asn. 2024-04-01 17:37:03 -04:00
2f3495f286 src/tls13.c: remove unreachable break in DoTls13CertificateVerify().
tests/api.c: fix various use-after-frees of file in do_dual_alg_root_certgen() and do_dual_alg_server_certgen().
2024-04-01 17:37:03 -04:00
e4b7857e43 If WOLFSSL_TRUST_PEER_CERT is defined, the negative test is no longer negative. 2024-04-01 17:37:03 -04:00
136eaae4f1 Improvements to dual alg certificates
* Support for external keys (CryptoCb interface)
* Support for usage in mutual authentication
* better entity cert parsing
* Fix for Zephyr port to support the feature
* Check key support
* Proper validation of signatures in certificate chains
* Proper validation of peer cert with local issuer signature
	(alt pub key is cached now)
* Support for ECC & RSA as alt keys with PQC as primary
* Support for PQC certificate generation
* Better support for hybrid signatures with variable length signatures
* Support for primary and alternative private keys in a single
  file/buffer
* More API support for alternative private keys

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-04-01 17:37:03 -04:00
da6a11d1d1 Restore HAVE_NETDB_H and HAVE_SYS_IOCTL_H checks in the wolfio.c. 2024-04-01 09:49:22 -07:00
78b8ea3646 make "yes;no" cmake options boolean instead of string 2024-04-01 16:20:11 +02:00
d930825a92 Merge pull request #7362 from jpbland1/rsa-make-key-no-malloc
fix wc_MakeRsaKey and wc_RsaKeyToDer to work with WOLFSSL_NO_MALLOC
2024-03-30 03:19:27 -04:00
d8e9e90f9d refactor rawLen to avoid unused warning 2024-03-30 02:12:32 -04:00
03d7eac9c4 Merge pull request #7337 from gojimmypi/PR-test-certbuf-256
wolfcrypt tests: improve file system gating for USE_CERT_BUFFERS
2024-03-30 00:43:20 -04:00
5c486cb7a6 Merge pull request #7371 from douzzer/20240327-tls-int-overflows
20240327-tls-int-overflows
2024-03-29 11:37:08 -07:00
a0f3933881 Support (D)TLS1.3 downgrade when using PSK
DTLS Server:
examples/server/server -v3 -u -s

DTLS Client:
examples/client/client -vd -g -u -s

TLS Server:
examples/server/server -v3 -s

TLS Client:
examples/client/client -vd -g -s

Support checking for DTLS1.2 Hello Verify Request when using PSK.

Unset options.tls1_3 when handling a DTLS1.2 Hello Verify Request.

Unset options.tls1_3 when handling a (D)TLS1.2 Server Hello to stop
checking of Encrypted Client Hello

Requires ./configure --enable-all --enable-dtls13

Add in tests for DTLS1.3 and TLS1.3 downgrade when using PSK.
2024-03-29 18:04:30 +00:00
038be95a4a wolfssl/wolfcrypt/types.h: add WC_SAFE_SUM_WORD32().
src/internal.c: mitigations for potential integer overflows in figuring allocation sizes.
2024-03-29 11:45:11 -05:00
3f3dd4743a Merge pull request #7365 from rizlik/ecc_cmp_param_cleanup
wc_ecc_cmp_param cleanup
2024-03-29 01:48:46 -04:00
1caed2139b Merge pull request #7374 from gojimmypi/PR-Kyber-Init
Initialize some Kyber client variables
2024-03-29 01:44:56 -04:00
7e8c0156fe Merge pull request #7325 from dgarske/zephyr
Improve Zephyr support
2024-03-29 00:57:55 -04:00
5b3772c5d2 Merge pull request #7377 from douzzer/20240328-multi-test-fixes
20240328-multi-test-fixes
2024-03-28 16:58:30 -04:00
83dc3dfac1 Add support for the Infineon/Cypress HAL TRNG. 2024-03-28 13:57:26 -07:00
58462840c1 src/ssl.c: add missing cast in wolfSSL_GetSessionFromCache(). 2024-03-28 15:14:19 -05:00
f2e6f49721 RPK: Define Certificates correctly for (D)TLS1.2
As per https://datatracker.ietf.org/doc/html/rfc7250#section-3 Figure 1,
the RPK is a single ASN.1_subjectPublicKeyInfo, whereas X509 certificates
etc. are transmitted as a certificate list (even if there is only 1).

This is for (D)TLS1.2 transfers, and this PR fixes this.

As per https://datatracker.ietf.org/doc/html/rfc8446#section-4.4.2 all
certificates (both RPK and Z509) are transferred using a certificate list.

Update examples client to support RPK certificates.

For testing:-
Server:
$ gnutls-serv --http --x509fmtder --priority NORMAL:+CTYPE-CLI-RAWPK:+CTYPE-SRV-RAWPK --rawpkfile certs/server-keyPub.der --rawpkkeyfile certs/server-key.der

Client:
$ examples/client/client -g -p 5556 -c certs/client-keyPub.der -k certs/client-key.der --rpk --files-are-der
2024-03-28 17:58:02 +00:00
7c0423eb65 reduce der buffer size 2024-03-28 12:56:26 -04:00
7a283edd68 Merge pull request #7373 from bandi13/FixMultiTestWarning
Fix sanitizer complaint in multi-test script
2024-03-28 12:35:45 -04:00
5bffbdb20c Initialize some Kyber client variables 2024-03-28 09:14:53 -07:00
4cb176ffff Fix sanitizer complaint 2024-03-28 11:44:12 -04:00
6cc32e90b0 trim down buffer size 2024-03-28 03:01:46 -04:00
254eb23443 add missing make call 2024-03-28 02:56:08 -04:00
04db5baaa1 test wolfcrypt only 2024-03-28 02:56:08 -04:00
6272465c44 use only one matrix index 2024-03-28 02:56:08 -04:00
f63501f035 fix bad CFLAGS 2024-03-28 02:56:08 -04:00
30189e5766 add autogen.sh to workflow 2024-03-28 02:56:08 -04:00
71e52487bf add no malloc to main workflows file 2024-03-28 02:55:31 -04:00
76ac4fa7e3 add github workflow to test no malloc 2024-03-28 02:54:49 -04:00
9cd614fcac update rsa test to support no malloc 2024-03-28 02:54:49 -04:00
4f51183b45 fix bad indenting 2024-03-28 02:54:49 -04:00
305f87561d break out of loop on failure instead of return 2024-03-28 02:54:49 -04:00
fb784a2ac9 more changes from PR comments 2024-03-28 02:54:49 -04:00
0bd8775eae update based on PR comments 2024-03-28 02:54:49 -04:00
d9d3f9a4f4 fix wc_MakeRsaKey and wc_RsaKeyToDer to work with
WOLFSSL_NO_MALLOC
2024-03-28 02:54:49 -04:00
716870cbc2 Merge pull request #7370 from anhu/quickie
sizeof(oriType) ---> sizeof(asnDataOid)
2024-03-28 01:58:01 -04:00
42a0cb23ac Merge pull request #7364 from gojimmypi/PR-Kyber-Init
Initialize some Kyber variables
2024-03-28 00:13:43 -04:00
2f17b756b2 Merge pull request #7360 from rizlik/curl-ticket-nonce-malloc
configure.ac: enable ticket_nonce_malloc when using enable-curl
2024-03-27 23:58:21 -04:00
98c912c3a0 Merge pull request #7359 from SparkiDev/asn1_test_bad_certs
ASN.1 testing: add tests of bad DER encodings
2024-03-27 23:55:57 -04:00
0f6670a437 Merge pull request #7357 from kareem-wolfssl/gh7349
Fix potential division by zero in example server.
2024-03-27 23:52:55 -04:00
ad74fb79ac Merge pull request #7354 from JacobBarthelmeh/ocsp-test
add ocsp test
2024-03-27 23:50:49 -04:00
e8e3e9db43 Merge pull request #7285 from anhu/noMagic274
Get rid of magic number to size structs.
2024-03-27 23:43:28 -04:00
f9b26d8c06 Merge pull request #7358 from bandi13/buildNewYoctoContainer
Build new yocto container
2024-03-27 23:41:46 -04:00
708fd6003f Merge pull request #7320 from bandi13/addExtraToolsToDocker
More application dependencies
2024-03-27 23:39:41 -04:00
2d7f9d1874 Support for Infineon Modus Toolbox with wolfSSL. 2024-03-27 15:37:50 -07:00
28a88d1c7c sizeof(oriType) ---> sizeof(asnDataOid) 2024-03-27 17:05:25 -04:00
0a03940f5a wolfcrypt: wc_ecc_cmp_param: check string len before strncmp
also return -1 on param mismatch.
2024-03-26 14:59:41 +01:00
01ae240fe8 Initialize some Kyber variables 2024-03-25 14:08:47 -07:00
22766578fc Add in powerpc cross compilation tools 2024-03-25 15:39:59 -04:00
bf9775831f Improve wolfcrypt test NO_FILESYSTEM checks 2024-03-22 13:00:25 -07:00
91ab6cafe0 configure.ac: enable ticket_nonce_malloc when using enable-curl
To support new session ticket nonce longer than MAX_TICKET_NONCE_STATIC_SZ. If
`--disable-ticket-nonce-malloc` is explicitly specified, the feature is not
enabled even if `--enable-curl` is specified.
2024-03-22 11:46:22 +01:00
d4b1995a2c ASN.1 testing: add tests of bad DER encodings
Certificates with bad DER encoded ASN.1 added to testing.
Fix comment in asn.c.
2024-03-22 08:51:17 +10:00
0abb381497 Use official repo to build 2024-03-21 16:31:48 -04:00
d867405ffb Fix floating point comparison. 2024-03-20 16:03:43 -07:00
4d4f4e3f30 Fix potential division by zero in example server. 2024-03-20 15:48:46 -07:00
8970ff4c34 Merge pull request #7355 from JacobBarthelmeh/release
prepare for release 5.7.0
2024-03-20 14:39:57 -07:00
85601311a2 rework library versioning 2024-03-21 04:02:28 +07:00
b8bebd6196 Fixes for ARM/Intel ASM support. 2024-03-20 13:14:05 -07:00
e20ddc35b0 update version for CMake 2024-03-21 03:05:34 +07:00
e80deece82 adjust ChangeLog text 2024-03-21 00:18:44 +07:00
e5914effab prepare for release 5.7.0 2024-03-20 19:32:22 +07:00
5884f75cbe add ocsp test 2024-03-20 03:01:43 +07:00
3129e29a19 Merge pull request #7353 from ejohnstown/ocsp-ext
OCSP Extension Encoding Fix
2024-03-20 03:00:27 +07:00
6462986bf2 OCSP Extension Encoding Fix
1. Removed redundant check for the output being NULL in
   `EncodeOcspRequestExtensions()`. The chuck of code being protected
   only cared about the value of ret, not the pointer. The code was
   supposed to calculate the size of the data without writing it.
2024-03-19 09:13:28 -07:00
5e45bb4d25 Using PR version 2024-03-19 11:53:03 -04:00
face8b6e43 Experimental support for Intel and ARM ASM with Zephyr. Related to issue #7116. 2024-03-18 13:40:10 -07:00
9bddddb952 First test build on 2024-03-06 2024-03-18 16:32:24 -04:00
489a79ad8b CID 347893 set test cert manager to null after free 2024-03-19 02:59:06 +07:00
228544c31e CID 327280 use after free in test case 2024-03-19 02:44:45 +07:00
1926e045f3 Merge pull request #7351 from douzzer/20240318-linuxkm-lkcapi-register-yes
20240318-linuxkm-lkcapi-register-yes
2024-03-19 02:33:12 +07:00
790e39ec03 Merge pull request #7350 from JacobBarthelmeh/scan_build_fix
scan-build fixes for pkcs7
2024-03-18 12:31:00 -07:00
a14edf3614 configure.ac: for --enable-linuxkm-lkcapi-register, remap "yes" to "all"; in output config summary, add ENABLED_LINUXKM_LKCAPI_REGISTER, and move ENABLED_EXPERIMENTAL and ENABLED_LINUXKM_BENCHMARKS to the "Features" section. 2024-03-18 13:52:06 -05:00
d51bef3d43 fix for memory leak on error 2024-03-19 00:58:32 +07:00
b9619c3f0b Merge pull request #7343 from douzzer/20240315-pq-experimental
20240315-pq-experimental
2024-03-19 00:54:56 +07:00
50b1044c2f Merge pull request #7347 from JacobBarthelmeh/coverity2
Coverity Fixes QUIC
2024-03-18 09:04:09 -07:00
4751af9b89 scan-build fixes for pkcs7 2024-03-18 22:55:51 +07:00
42091b8970 Normally these tests take 3 minutes, but sometimes they take much longer 2024-03-18 11:22:03 -04:00
74d7696e69 More application dependencies 2024-03-18 11:21:24 -04:00
ffb43d0150 Merge pull request #7348 from JacobBarthelmeh/coverity3
Coverity fixes
2024-03-18 08:20:31 -07:00
69bc5c1c19 Merge pull request #7345 from JacobBarthelmeh/coverity
Coverity fixes
2024-03-18 08:15:59 -07:00
03e306a98f Add include for project for cases when a custom user_settings.h file is used. Tested support with PSA. 2024-03-18 08:14:40 -07:00
85c22abe4e Fix for Zephyr TimeNowInMilliseconds. Resolves issue with TLS v1.3 server and session tickets time (uptime in sim < 1000 ms was being made 0). 2024-03-18 08:14:40 -07:00
737fa53636 Improve Zephyr support. Cleanup user_settings.h mess. Add FIPS support. 2024-03-18 08:14:40 -07:00
dd6db025e3 add parenthesis around define value 2024-03-18 21:13:42 +07:00
36e67af0f8 Merge pull request #7331 from SparkiDev/asn1_templ_issuer_cn
ASN.1 template: store issuer common name
2024-03-18 20:27:04 +07:00
d6b4b27cd1 CID 299893 out of bounds read with XMEMCMP 2024-03-18 16:42:15 +07:00
44f3e4a3b7 CID 337219 allocation using untrusted size 2024-03-18 16:04:37 +07:00
635d326812 CID 337232 sanity check on tainted scalar 2024-03-18 15:03:04 +07:00
be233fc805 Merge pull request #7346 from SparkiDev/regression_fixes_11
Regression test fixes
2024-03-18 14:29:44 +07:00
638d0b1a9f Regression test fixes
pkcs7.c: pkcs7->stream must be restored or there will be a leak.
test.c: when compiled for compression, compiler warning about const
2024-03-18 09:57:22 +10:00
84c42f4a4e ASN.1 template: store issuer common name
Under certain configurations the certificate issuer's common name is
kept in a DecodedCert. Wasn't implemented in ASN.1 template code.
2024-03-18 07:06:32 +10:00
763c4a074c CID 315823 truncate on cast 2024-03-17 23:54:56 +07:00
d71776aced coverity CID 352930, fix for out of bounds write 2024-03-17 23:31:37 +07:00
abd7449f27 Merge pull request #7340 from JacobBarthelmeh/github_tests
workaround for Ubuntu runner, high entropy + ASLR
2024-03-17 08:56:50 -07:00
5106cb16e2 workaround for llvm version and ASLR issue 2024-03-17 22:22:16 +07:00
99dd8a333d Merge pull request #7342 from JacobBarthelmeh/testing1
revert null check in wc_Sha256Update
2024-03-15 14:24:45 -07:00
924887b468 configure.ac and wolfssl/wolfcrypt/settings.h: implement --enable-experimental and add a WOLFSSL_EXPERIMENTAL_SETTINGS gate, and refactor "EXPERIMENTAL" features (all pq) to note and enforce requirement for --enable-experimental and WOLFSSL_EXPERIMENTAL_SETTINGS. 2024-03-15 16:15:26 -05:00
3728cd3dc5 Kyber fixes:
wolfssl/wolfcrypt/wc_kyber.h: in definition of struct KyberKey, use correct type for devId;

wolfcrypt/src/wc_kyber_poly.c: numerous fixes for bugprone-macro-parentheses and readability-inconsistent-declaration-parameter-name;

tests/api.c: in test_tls13_apis(), add missing defined(HAVE_LIBOQS) gate on inclusion of ":P256_KYBER_LEVEL1" in groupList.
2024-03-15 16:06:32 -05:00
5a5648a6ac Merge pull request #7341 from dgarske/psk_openssl
Fix for PSK callback with OPENSSL_EXTRA to correctly handle the 0 length
2024-03-16 02:22:24 +07:00
ab8f5f71a0 revert null check in wc_Sha256Update 2024-03-16 02:03:07 +07:00
2f43cc1c7b Merge pull request #7332 from SparkiDev/asn_templ_neg_int_check
ASN.1 parsing: check for badly encode negative INTEGER
2024-03-15 22:40:55 +07:00
8d1714a307 Fix for PSK callback with OPENSSL_EXTRA to correctly handle the 0 length case. Thank you @miyazakh. Broken in #7302 2024-03-15 08:09:59 -07:00
81c5cf794c Merge pull request #7339 from SparkiDev/regression_fixes_10
Regression testing fixes
2024-03-15 19:29:26 +07:00
d1b16f2c7b Regression testing fixes
api.c: z and ret no longer only when !NO_ASN_TIME.
benchmark.c: rsaKey array type has changed and unusual code path needsed
updating.
cmac.c: Zeroization test failed when checkSz was zero as called function
didn't zero out cmac. checkSz is invalid.
test.c: rsaCaCertDerFile used even when NO_ASN_TIME.
test.h: --enable-sp-math only supports DH of 2048 bits and above. Change
default DH parameters to be 2048 bits.
2024-03-15 13:24:40 +10:00
8684caa304 Merge pull request #7336 from douzzer/20240314-fix-armasm-sha256
20240314 -- fix -Wconversions in asn.c
2024-03-15 10:37:14 +10:00
e3fc43c3d6 Merge pull request #7338 from SparkiDev/sha256_armv8_transform
SHA256 ARMv8: fix wc_Sha256Transform
2024-03-14 19:48:38 -04:00
25efe6b66a wolfcrypt/src/asn.c: fix -Wconversions in GetASN_BitString(), GetASN_UTF8String(), and GetASN_ObjectId(). 2024-03-14 18:42:50 -05:00
a0befd396f SHA256 ARMv8: fix wc_Sha256Transform
wc_Sha256Transform() was passing in data to underlying transform
function even though byte reversed data was in sha256->buffer.
2024-03-15 09:27:15 +10:00
b7b6752e2e Merge pull request #7333 from gojimmypi/PR-tfm-mp_sqr
Enable TFM mp_sqr even when HAVE_ECC disabled
2024-03-14 12:45:09 -07:00
36eec68571 Cleanup DES3 TLS descriptions and macro names. 2024-03-14 10:34:38 -07:00
5dff8aa417 Merge pull request #7334 from SparkiDev/macosx_clang_15_asm_fix
MacOS X Intel ASM clang 15: fix asm to compile without warning
2024-03-14 10:10:42 -07:00
8fd8548142 Merge pull request #7318 from SparkiDev/kyber_1
Kyber: Implementation in wolfSSL
2024-03-14 09:57:52 -07:00
88370d8c3e Merge pull request #7277 from embhorn/readme_folders
Add directory layout to readme.
2024-03-14 19:09:12 +07:00
3fd6af0cd2 Merge pull request #7283 from SparkiDev/lms
LMS: initial implementation
2024-03-14 01:48:57 -04:00
3ba5dd3e6d MacOS X Intel ASM clang 15: fix asm to compile without warning
Don't use align when __APPLE__ is defined.
Make minimum alignment on variables in ASM 8 bytes (.p2align 3).

Fix x86 builds with ASM.
2024-03-14 11:42:12 +10:00
bebfb120d7 Enable TFM mp_sqr even when HAVE_ECC disabled 2024-03-13 16:36:30 -07:00
25b2c664f4 Kyber: Implementation in wolfSSL
Put Kyber implementation into wolfSSL.
2024-03-14 09:14:50 +10:00
40681226aa ASN.1 parsing: check for badly encode negative INTEGER
When encoding a negative number, when the first byte is 0xff then the
next byte can't have top bit set.
2024-03-14 09:01:22 +10:00
448378ce90 Merge pull request #7306 from SparkiDev/asn1_validate_fix_1
ASN.1 template: validate UTF8STRING and OBJECT IDENTIFER data
2024-03-13 15:23:02 -07:00
924c0fd911 Merge pull request #7329 from gojimmypi/PR-Arduino-Build
Ignore build file warnings for Arduino; Update examples
2024-03-13 14:59:07 -07:00
6f65d6749a Merge pull request #7321 from JacobBarthelmeh/vcpkg
fix for warning of no stdint.h include with uintptr_t
2024-03-13 14:43:47 -07:00
c8bc74b232 Merge pull request #7324 from JacobBarthelmeh/sm2_bench
Sm2 benchmark build fix
2024-03-13 14:43:30 -07:00
9057e8120d Ignore build file warnings for Arduino, update examples 2024-03-13 12:24:00 -07:00
9f240bb34c fix for warning of no stdint.h include with uintptr_t 2024-03-14 00:38:02 +07:00
ff14aa20a6 fix for benchmark build with sm4-gcm 2024-03-14 00:05:43 +07:00
5c3b929d90 fix for benchmark build with sm2 2024-03-14 00:05:43 +07:00
1e054b9613 Merge pull request #7302 from dgarske/pk_psk
Support for Public Key (PK) callbacks with PSK
2024-03-14 00:02:23 +07:00
d2fd937075 Merge pull request #7328 from bandi13/disableLibSSH2Test
Disable broken library
2024-03-12 15:26:44 -07:00
ce52a68c3d Disable broken library
The tests on the libssh2 repo are also failing for the same reason
2024-03-12 17:04:20 -04:00
084338dde7 ASN Template: GetASN_UTF8String optional
Allow UTF8String checking to be disabled with WOLFSSL_NO_ASN_STRICT.
2024-03-12 09:59:51 +10:00
5dba7d3975 Merge pull request #7280 from Frauschi/pqc_kyber_fix
Fix for PQC enabled handshake
2024-03-11 09:26:13 -07:00
bd20640e58 Merge pull request #7312 from philljj/zd17621
Handle failed alloc in TLSX_Write.
2024-03-09 15:20:50 -08:00
5d418d67b0 Allow to enable DES3 support without the DES3 ciphers
DES3 support is required to use PBES2-3DES-CBC-encoded keys
but also enabling the DES3 ciphers may be undesirable.
When using Privoxy it results in a "Bad" rating at sites like
https://www.howsmyssl.com/ due to the Sweet32 attack.
2024-03-09 12:22:44 +01:00
0e15a2e83a Handle failed alloc in TLSX_Write. 2024-03-08 22:56:27 -06:00
0c40fb5c5f Merge pull request #7299 from SparkiDev/siphash_asm_fix_2
Siphash: x64 asm fix
2024-03-08 13:15:44 -08:00
9fadcb2edc Merge pull request #7307 from bandi13/fixNightlyCrossworks
Fix nightly crossworks
2024-03-08 13:12:53 -08:00
8298019a85 Merge pull request #7308 from bandi13/fixNightlySGX
Missing functions
2024-03-08 13:12:30 -08:00
83cddc76ce Merge pull request #7309 from bandi13/fixNightlyG++
Missing cast to avoid warning
2024-03-08 13:12:09 -08:00
b5633f9cea Merge pull request #7310 from gojimmypi/PR-Revert-Breadcrumbs
Revert some debug breadcrumbs in #7304
2024-03-08 13:06:41 -08:00
11303ab796 Support for Public Key (PK) callbacks with PSK in TLS v1.2 and TLS v1.3 (client and server). ZD 17383 2024-03-08 12:21:06 -08:00
56f3c93272 Revert per https://github.com/wolfSSL/wolfssl/pull/7304#pullrequestreview-1925571495 2024-03-08 12:05:54 -08:00
082397adda Missing cast to avoid warning 2024-03-08 14:46:17 -05:00
b17db818ce Missing functions
Compilation fails with "undefined reference to `sp_cmp'" etc.
2024-03-08 14:04:35 -05:00
98f8329bf2 Add indentation for legibility 2024-03-08 11:49:38 -05:00
8fcb007301 Missing gating for netdb.h includes 2024-03-08 11:46:49 -05:00
5daf5fff86 Merge pull request #7272 from JacobBarthelmeh/pkcs7-enc
IO callbacks for content and output with PKCS7 bundle sign/encrypt
2024-03-08 07:18:11 +10:00
28e8228744 Merge pull request #7304 from gojimmypi/PR-Arduino-Logging
Update Arduino examples: 32KB TLS Client/Server; Add wolfcrypt breadcrumbs.
2024-03-08 07:12:01 +10:00
c24b187a88 fixes for clang-tidy warnings 2024-03-08 01:54:37 +07:00
a07d92d3d3 refactoring and fixes for new PKCS7 stream code 2024-03-07 21:30:42 +07:00
c568e3c092 Merge pull request #7067 from gojimmypi/PR-Espressif-Monitor-Keyword
Introduce WOLFSSL_ESPIDF_EXIT_MESSAGE macro
2024-03-07 21:57:19 +10:00
77a77a9a9d Merge pull request #7296 from JacobBarthelmeh/autosar
initial AutoSAR shim layer
2024-03-07 21:55:50 +10:00
38d5eec445 Introduce WOLFSSL_ESPIDF_EXIT_MESSAGE macro (+code review edits) 2024-03-07 00:44:11 -08:00
faea635ee2 ASN.1 template: validate UTF8STRING and OBJECT IDENTIFER data
Check the data of UTF8STRING and OBJECT IDENTIFIER to ensure it is
properly encoded.
2024-03-07 18:01:16 +10:00
6c8df33191 LMS: initial implementation
Initial wolfSSL implementation of LMS.
Changed LMS benchmarking to time making a key and reloading.
SHA-256:
  Added wc_Sha256HashBlock to make hashing a block fast.
Fixed assembly code to be able to hash a block from an external
buffer.
  Simplified code were possible.
Moved byte reversal decision logic to one place instead of replicating
length checks.
2024-03-07 11:43:16 +10:00
f011012d8e Merge pull request #7300 from bandi13/codeSonarFixes
Code sonar fixes
2024-03-07 10:17:06 +10:00
b7c36fa603 Merge pull request #7305 from embhorn/zd17629
Fix leak in wolfSSL_X509_STORE_CTX_get_chain
2024-03-07 10:16:44 +10:00
e40eb3c774 Update Arduino examples; add wolfcrypt breadcrumbs. 2024-03-06 15:13:37 -08:00
a0a9680325 Fix leak in wolfSSL_X509_STORE_CTX_get_chain 2024-03-06 15:13:38 -06:00
39ad67607e Merge pull request #7240 from gojimmypi/PR-wolfssl_client_ESP8266
Update TLS client example for Espressif ESP8266
2024-03-06 13:18:28 -07:00
21b82a20d5 Merge pull request #7301 from SparkiDev/thumb2_aes_key_align_fix
Thumb2 AES ASM: don't assume alignment on key
2024-03-06 09:47:38 -08:00
ea9dfecc79 make rng global and get version from LIBWOLFSSL_VERSION_HEX 2024-03-06 17:52:31 +07:00
5408118582 Merge pull request #7298 from douzzer/20240304-wolfcrypttest-fixes
20240304-wolfcrypttest-fixes
2024-03-06 14:51:23 +10:00
321a72c906 misc fixes:
wolfcrypt/test/test.c: fix gating for verify4 in scrypt_test(), and fix WOLFSSL_SMALL_STACK -Wframe-larger-than=2048 warnings in sha256_test() and sha512_test().

src/ssl.c: fix for true-but-benign nullPointerRedundantCheck in ProcessBufferTryDecodeEd25519().

tests/api.c: fix for -Wmaybe-uninitialized in test_wc_PKCS7_VerifySignedData_RSA() identified via cross-m68k-all-asm.
2024-03-05 17:44:33 -06:00
d057f10d58 Thumb2 AES ASM: don't assume alignment on key
Fix AES_set_encrypt_key to not assume a word alignment on key.
2024-03-06 08:50:21 +10:00
86b663d67e Siphash: x64 asm fix
Make gcc-8 compiled code work.
2024-03-05 22:23:20 +10:00
11c9035a62 misc fixes and correct name for test file 2024-03-05 18:31:42 +07:00
ee39a8f17f Merge pull request #7262 from gojimmypi/PR-SHA-Interleave
Introduce SHA256/SHA512 interleave testing, HAVE_DSA; revised ERROR_OUT
2024-03-05 10:13:10 +10:00
39002d82b4 Merge pull request #7294 from douzzer/20240301-wolfSSL_Init-identicalInnerCondition
20240301-wolfSSL_Init-identicalInnerCondition
2024-03-05 09:01:51 +10:00
61749a0171 Merge pull request #7287 from JacobBarthelmeh/pkcs7_verify_stream
PKCS7 checking trailing 0's on indef with verify
2024-03-05 08:20:16 +10:00
30366a9c03 Merge pull request #7293 from douzzer/20240301-linuxkm-leak-and-small-stack-fixes
20240301-linuxkm-leak-and-small-stack-fixes
2024-03-05 08:17:51 +10:00
ee3aff1258 Merge pull request #7291 from dgarske/armasm_thumb_gcmsmall
Thumb2 AES GCM support for GCM_SMALL
2024-03-05 06:58:47 +10:00
717a32808f Fix missing include 2024-03-04 10:24:32 -05:00
089e57371f remove a hard tab 2024-03-04 08:10:41 -07:00
b42a8b6c5d initial AutoSAR shim layer 2024-03-04 07:51:00 -07:00
d81a08a03b Catch error return code and remove redundant condition 2024-03-04 09:48:31 -05:00
2708062d39 add sanity check for null buffer after malloc in test case 2024-03-04 07:33:21 -07:00
f05e47bc09 length of characters and extra sanity check on input 2024-03-04 07:05:07 -07:00
66f419bd18 add user ctx to stream IO callbacks 2024-03-04 06:00:07 -07:00
88f07773d2 Merge pull request #7224 from mpsuzuki/pkg-config-static-link
Add "Libs.private: -m" to wolfssl.pc.in for a static linking
2024-03-01 19:24:05 -05:00
7fbb209684 ssl.c: in wolfSSL_Init(), fix cppcheck identicalInnerCondition warning on non-FIPS configurations. 2024-03-01 17:54:55 -06:00
efda4b5435 Merge pull request #7290 from lealem47/define_ssleay_version
Define SSLEAY_VERSION in wolfssl/openssl/crypto.h
2024-03-01 18:44:24 -05:00
a59080a858 Merge pull request #7288 from bandi13/fixNETDB_H
Move netdb.h and ioctl.h into wolfio.c
2024-03-01 18:36:18 -05:00
cf733c306c Merge pull request #7284 from douzzer/20240229-mutex-initializer-global-refactor
20240229-mutex-initializer-global-refactor
2024-03-01 16:43:10 -06:00
4a167e9834 Merge pull request #7292 from bandi13/addMeta-WolfsslToBuild
This will force building of dependencies in the container
2024-03-01 15:14:24 -07:00
b1edb08119 linuxkm/linuxkm_wc_port.h:
* fix WC_LINUXKM_ROUND_UP_P_OF_2() to not round up values that are already powers of 2, nor values larger than 8192.

linuxkm/lkcapi_glue.c:
* fix gating on km_AesSetKeyCommon().
* small stack refactors of Aes objects in self-test routines.
* change kmalloc/free to malloc/free in self-test routines.
* fix error-path "return"s to "goto exit"s in self-test routines.
* fix memory leak around large_input in aes_xts_128_test().

wolfcrypt/benchmark/benchmark.c:
* smallstack refactors in bench_chacha() and bench_chacha20_poly1305_aead().
* add error handling in bench_chacha().

wolfcrypt/src/chacha20_poly1305.c: smallstack refactor for wc_ChaCha20Poly1305_Encrypt() and wc_ChaCha20Poly1305_Decrypt().
2024-03-01 14:55:49 -06:00
4270f8cda3 This will force building of dependencies in the container
Fewer things to compile in subsequent tests
2024-03-01 15:21:46 -05:00
7c836c8371 Thumb2 AES GCM support for GCM_SMALL. ZD 17225 2024-03-01 11:10:21 -08:00
86966f62c7 Define SSLEAY_VERSION in wolfssl/openssl/crypto.h 2024-03-01 11:24:56 -07:00
065bfb0172 add new test file to make dist 2024-03-02 00:12:01 +07:00
897a8419c1 Move netdb.h and ioctl.h into wolfio.c 2024-03-01 11:59:02 -05:00
90b28b5cef add test case for verify of stream signed PKCS7 bundle 2024-03-01 23:43:46 +07:00
05138154a9 check trailing 0's in signeeds check case 2024-03-01 22:57:10 +07:00
95eb17944c Merge pull request #6961 from TakayukiMatsuo/pkcs7
Add streaming support for PKCS7_VerifySignedData.
2024-03-01 22:38:07 +07:00
fbf1b783da initialize value to resolve warning 2024-03-01 21:39:27 +07:00
c32d9c826c fix for check on hash with ECDSAk case 2024-03-01 21:14:15 +07:00
52f003f5fc Merge pull request #7281 from philljj/zd17416
Fix Coverity issues.
2024-03-01 02:41:48 -05:00
67d4019058 Merge pull request #7270 from philljj/zd17560
Fix dataASN null pointer dereference in asn.c.
2024-03-01 01:53:55 -05:00
d1e62b3ff2 Merge pull request #7282 from SparkiDev/pqcrypto_fix_1
ASN PQC: fix typo
2024-03-01 01:40:04 -05:00
03f9b210d7 Merge pull request #7279 from SparkiDev/ssl_priv_load_fail
SSL: Loading bad private key
2024-03-01 01:35:50 -05:00
032a0405e4 Get rid of magic number to size structs. 2024-02-29 15:23:48 -05:00
b3c276bf0b Fix wc_SetExtKeyUsageOID buffer warning: update size of oid. 2024-02-29 13:17:31 -06:00
dfbde4514b global refactor of static mutex initialization to use WOLFSSL_MUTEX_INITIALIZER, and adjustment of WOLFSSL_MUTEX_INITIALIZER macro to take an argument, for Linux kernel compatibility. 2024-02-29 02:11:32 -06:00
90baf1aadc ASN PQC: fix typo
Replace semicolon with comma.
2024-02-29 07:46:22 +10:00
c24add5da9 Fix dataASN null pointer dereference in asn.c. 2024-02-28 15:37:55 -06:00
9addb3e45d SSL: Change other ProcessBufferTryDecode*()
Ed448, Falcon and Dilithium changed to return 0 when key format is 0.
2024-02-29 07:37:41 +10:00
1768b03ecd Fix wc_SetExtKeyUsageOID buffer warning. 2024-02-28 11:13:33 -06:00
403fcc5a4b Fix for PQC enabled handshake
When PQC Kyber support is enabled, incoming KeyShare messages are tested
regarding the named group is a PQC Kyber group (pure or hybrid). The
boundaries of this test are way too loose (large gap between the pure
ones and the hybrid ones). This could result in failing handshakes in
case a client uses GREASE (Generate Random Extensions And Sustain
Extensibility), as there group numbers in the large gap are used.

The fix is just to make sure that the PQC test uses the two small
boundaries of the PQC named groups.

The lower bound for the hybrid groups has also been updated to reflect
the current OQS definition.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-02-28 17:52:38 +01:00
b53cc0e98c SSL: Loading bad private key
Fix ProcessBufferTryDecodeRsa and ProcessBufferTryDecodeEcc to only
clear error when key format isn't known.
2024-02-28 21:47:45 +10:00
8a6c6ebfd5 add guard around public key validation on import 2024-02-28 13:48:58 +07:00
6500444b26 Merge pull request #7072 from farazrbx/rbx
PlayStation compatibility
2024-02-28 00:52:01 -05:00
daf43cd04f Merge pull request #7260 from kosmas-valianos/missingConst
Add const in the list of wolfSSL_CTX_set1_groups_list() and wolfSSL_set1_groups_list()
2024-02-28 00:28:37 -05:00
af31fbc840 Merge pull request #7271 from bigbrett/cryptocb-random-wctestfix
add full support to wolfcrypt tests for random.c cryptocbs
2024-02-27 19:57:46 -05:00
e64a26d6ae Merge pull request #7274 from SKlimaRA/SKlimaRA/fix-embos-heap-allocation-macros
fixed XMALLOC, XFREE and XREALLOC definitions for embOS
2024-02-27 17:29:10 -05:00
3c6651e1e2 PlayStation compatibility 2024-02-27 12:28:31 -08:00
26c5c6f93c Add directory layout to readme. 2024-02-27 12:07:28 -06:00
55421a11b9 review: removed WOLFSSL_ABI from and refactored args for wc_rng_new_ex, updated tests 2024-02-27 10:17:24 -07:00
c5a5acd26f code review changes 2024-02-27 15:58:12 +01:00
34b4066d2f fixed XMALLOC, XFREE and XREALLOC definitions for embOS 2024-02-27 14:47:39 +01:00
eeda0caeb9 Add streaming support for PKCS7_VerifySignedData. 2024-02-27 15:04:32 +09:00
9eac8cb41f add a test case 2024-02-26 09:44:23 -07:00
2044d6b7dd add callbacks for PKCS7 streaming input and output 2024-02-26 08:28:12 -07:00
10740abf9b warning fix for small PSK build 2024-02-26 15:28:28 +07:00
0775baa2e1 Introduce SHA256/SHA512 interleave, HAVE_DSA; revised ERROR_OUT, cleanup 2024-02-23 17:52:20 -08:00
a77c6d1fa0 Merge pull request #7269 from JacobBarthelmeh/cryptocb
add support for crypto cb only with ECC and CAAM
2024-02-23 13:19:32 -08:00
1a5064cf8c add full support to wolfcrypt tests for random.c cryptocbs 2024-02-23 13:02:05 -07:00
2f6cd765f1 revert some macro guards for support with sp math 2024-02-24 01:07:05 +07:00
aa444c1b2c Merge pull request #7268 from dgarske/bench_fixes
Fixes for benchmark with small stack (RSA was being skipped)
2024-02-23 23:24:55 +07:00
2364b699ff add support for crypto cb only with ECC and CAAM 2024-02-23 08:09:19 -08:00
06469a43bc wolfcrypt/benchmark/benchmark.c:
* remove redundant nullness checks covered by WC_ALLOC_VAR() via WC_ALLOC_DO_ON_FAILURE();
* add "exit:" logic to bench_sm4_gcm();
* add missing WC_ALLOC_VAR() in bench_sm4_ccm();
* fix early return in bench_ed448KeySign().
2024-02-23 01:07:26 -06:00
4055b0d832 Fix for some variable null checks that are not needed. 2024-02-22 16:28:15 -08:00
cd0301fc66 Fixes for benchmark with small stack (RSA was being skipped). Added Thumb2 benchmarks for STM32H753. 2024-02-22 14:56:51 -08:00
8a68e6aaa1 Merge pull request #7266 from bandi13/addYoctoDocker
Add in files for yocto build environment
2024-02-22 19:30:36 +07:00
6f281d7e72 Merge pull request #7267 from douzzer/20240221-reproducible-build-tweaks
20240221-reproducible-build-tweaks
2024-02-22 19:28:12 +07:00
162d4dc483 Merge pull request #7264 from bandi13/dockerFixes
Add in missing dependency for nightly-sp-test
2024-02-22 19:11:07 +07:00
f1afa7eaff Merge pull request #7265 from embhorn/zd17547
Fix order of check for OPENSSL_EXTRA
2024-02-21 20:25:54 -05:00
9e4887bcf4 configure.ac: fix --enable-reproducible-build using -g0 -ffile-prefix-map=... -Wl,--build-id=none. these fixes stabilize the hash of libwolfssl with respect to source and build directory, previously broken for out-of-tree builds. 2024-02-21 16:36:29 -06:00
e74d3e126e Add in files for yocto build environment 2024-02-21 16:49:35 -05:00
2ee47eac4d Add in missing dependency for nightly-sp-test 2024-02-21 16:16:26 -05:00
3ad836ab47 Fix order of check for OPENSSL_EXTRA 2024-02-21 15:09:13 -06:00
d027b305ab Merge pull request #7257 from philljj/zd17540
Fix unchecked ge448_scalarmult_base return value.
2024-02-22 07:05:09 +10:00
88e7d47930 Merge pull request #7230 from anhu/tests_gating
Fixup some gating in the tests.
2024-02-22 01:24:55 +07:00
5aa06c26ff Fix unchecked ge448_scalarmult_base return value. 2024-02-21 08:40:38 -06:00
00c3f5be2e A fixup 2024-02-20 21:50:03 -05:00
fd2b80ec22 Merge pull request #7245 from julek-wolfssl/transient-certs
Implement transient certs
2024-02-20 22:48:19 +07:00
09de233fc0 Add dox for new API 2024-02-20 14:42:58 +01:00
aa19d8221e Add test forcing caTable cleanup during active connections 2024-02-20 14:33:36 +01:00
4caef93346 Implement transient certs
Add wolfSSL_CertManagerUnloadIntermediateCerts API to clear intermediate certs added to store.
2024-02-20 14:33:36 +01:00
73a6935386 Add const in the list of wolfSSL_CTX_set1_groups_list() and wolfSSL_set1_groups_list()
aligning with the wolfSSL_CTX_set1_sigalgs_list()/wolfSSL_set1_sigalgs_list() API
2024-02-20 09:14:39 +01:00
af2b2dddb4 Merge pull request #7253 from julek-wolfssl/zd/17507
wc_ecc_shared_secret_ssh fix
2024-02-20 06:56:28 +10:00
757fcbcc25 Merge pull request #7236 from julek-wolfssl/get-sig-nid
Implement SSL_get_peer_signature_nid and SSL_get_peer_signature_type_nid
2024-02-20 02:46:37 +07:00
565a4e6773 Merge pull request #7256 from douzzer/20240217-fixes
20240217-fixes
2024-02-20 01:54:32 +07:00
8d894fb01b wolfssl/wolfcrypt/types.h: add WC_ARRAY_ARG() and WC_HEAP_ARRAY_ARG() constructors, for passing arrays declared by WC_DECLARE_ARRAY() and WC_DECLARE_HEAP_ARRAY(). used this to refactor bench_rsa_helper() arg list, fixing a cppcheck argumentSize warning.
wolfcrypt/test/test.c: revert overeager constification of xmss_msg and xmss_sig.
2024-02-17 15:24:55 -06:00
7f18338322 Merge pull request #7255 from ejohnstown/ocsp-date
OCSP Date Checks
2024-02-16 20:58:20 -08:00
52f4dcd7aa OCSP Date Checks
When calling DecodeResponseData(), no matter the return value, if it is
not success, it is assigned to ASN_PARSE_E. This isn't the pattern for
other branch parsing. Return the value returned.

This is seen when decoding an OCSP response that is past the
next-available time.
2024-02-16 12:12:27 -08:00
e4ea2651a3 Merge pull request #7252 from douzzer/20240215-benchmark-smallstack-refactors
20240215-benchmark-smallstack-refactors
2024-02-16 11:45:59 -08:00
af620513f1 wolfssl/wolfcrypt/types.h: fix bugprone-macro-parentheses in smallstack WC_ALLOC_VAR(). 2024-02-16 12:39:25 -06:00
815c290293 Merge pull request #7231 from anhu/maxqrng
Use the MAXQ1065/1080 rng when available.
2024-02-16 09:43:46 -08:00
3676dc02a6 wolfcrypt/benchmark/benchmark.c: mollify scan-build with XMEMSET()s in several false positives around WC_DECLARE_ARRAY(). 2024-02-16 10:27:06 -06:00
44e0ee1ecd wolfssl/wolfcrypt/types.h:
* fix overallocation in WC_DECLARE_ARRAY() macro in the !WOLFSSL_SMALL_STACK path.
* rename WC_INIT_ARRAY() to WC_ALLOC_ARRAY() for clarity (it doesn't initialize any memory).
* rename WC_DECLARE_ARRAY_DYNAMIC_DEC(), WC_DECLARE_ARRAY_DYNAMIC_EXE(), and WC_FREE_ARRAY_DYNAMIC() to WC_DECLARE_HEAP_ARRAY(), WC_ALLOC_HEAP_ARRAY(), and WC_FREE_HEAP_ARRAY(), respectively, also for clarity, and refactor out the duplicate definitions.
* add WC_ALLOC_VAR(), and move the XMALLOC() in smallstack WC_DECLARE_VAR() into it.  smallstack WC_DECLARE_VAR() now initializes the pointer to NULL, like smallstack WC_DECLARE_ARRAY(), assuring all pointers are valid upon shortcircuit to cleanup for a failed allocation (see WC_ALLOC_DO_ON_FAILURE below).
* add a new hook "WC_ALLOC_DO_ON_FAILURE" in WC_ALLOC_VAR(), WC_ALLOC_ARRAY(), and WC_DECLARE_ARRAY_DYNAMIC_EXE(), which is invoked when an allocation fails.  by default the hook is defined to WC_DO_NOTHING.
* add basic safety to WC_*_HEAP_ARRAY() by recording/detecting allocation state via idx##VAR_NAME.
* add macros WC_ARRAY_OK() and WC_HEAP_ARRAY_OK() to test if allocation succeeded.
* add macros WC_CALLOC_ARRAY() and WC_CALLOC_HEAP_ARRAY() which zero the objects.
* add macro WC_CALLOC_VAR() which zeros the object.

ED448: smallstack refactor of ge448_scalarmult_base().

src/tls.c tests/api.c wolfcrypt/test/test.c: update WC_DECLARE_VAR()s with now-required matching WC_ALLOC_VAR()s.

wolfcrypt/benchmark/benchmark.c:
* no functional changes in default error-free behavior.
* add definition of WC_ALLOC_DO_ON_FAILURE() that prints error message, sets ret, and does goto exit.
* add BENCH_NTIMES and BENCH_AGREETIMES overrideeable macros, to allow fast sanitizer runs and slow high-precision runs.
* smallstack refactor of all declarations of stack arrays of the form foo[BENCH_MAX_PENDING], using WC_DECLARE_ARRAY() (35 in all).
* additional smallstack refactors, using WC_DECLARE_VAR(), for bench_aesxts(), bench_ed448KeyGen(), bench_eccsi*(), and bench_sakke*().
* fixes for various unhandled error conditions around malloc failures.

wolfcrypt/test/test.c: opportunistically constify several (42) static constants, moving them to the readonly data segment.

linuxkm/Makefile: if ENABLED_LINUXKM_BENCHMARKS, add wolfcrypt/benchmark/benchmark.o to WOLFSSL_OBJ_FILES.

linuxkm/Kbuild: enable FPU for benchmark.o, and remove enablement for module_hooks.o.

linuxkm/module_hooks.c: remove inline include of benchmark.c.
2024-02-16 10:26:21 -06:00
92b8196059 Merge pull request #7251 from miyazakh/ra6m4_jenkins
fix ra6m4 nightly jenkins failure
2024-02-16 09:09:12 -05:00
469760e186 wc_ecc_shared_secret_ssh fix
- wc_ecc_shared_secret_ssh should either be declared or not. Having two different signatures for the same function is error prone.
- Don't use wc_ecc_shared_secret_ssh in our code. Use wc_ecc_shared_secret directly.
2024-02-16 13:38:35 +01:00
44de6dfdd3 Return correct values in get_signature APIs and write tests 2024-02-16 11:32:22 +01:00
98e328dafc Enable master openvpn testing
Depends on https://github.com/wolfSSL/wolfssl/pull/7236
2024-02-16 11:32:04 +01:00
6537c7163c Implement SSL_get_peer_signature_nid and SSL_get_peer_signature_type_nid 2024-02-16 11:32:04 +01:00
72d8acf5aa fix ra6m4 nightly jenkins failure 2024-02-16 15:45:32 +09:00
d34b254247 Merge pull request #7249 from bandi13/missingOpenVPNDependencies
Add in dependencies when compiling with OpenVPN
2024-02-15 15:38:07 -08:00
f0a162c265 Merge pull request #7250 from lealem47/ecbAsync
Fix for AES-ECB benchmark livelock with Async
2024-02-15 15:37:46 -08:00
c8f3a8f14b fix: negotiate handshake until the end in wolfSSL_read/wolfSSL_write (#7237)
* tls: negotiate until hs is complete in wolfSSL_read/wolfSSL_write

Don't rely on ssl->options.handShakeSate == HANDSHAKE_DONE to check if
negotiation is needed. wolfSSL_Connect() or wolfSSL_Accept() job may not yet be
completed and/or some messages may be waiting in the buffer because of
non-blocking I/O.

* tests: test case for handshake with wolfSSL_read()/wolfSSL_write()

* doc: clarify wolfSSL_write()

* internal.c: rename: need_negotiate -> ssl_in_handshake
2024-02-15 13:48:19 -08:00
4cc960787f Fix for AES-ECB benchmark livelock with Async 2024-02-15 12:51:22 -07:00
71fd4782c0 Add in dependencies when compiling with OpenVPN 2024-02-15 13:48:33 -05:00
585f0f1956 Merge pull request #7248 from lealem47/ARMASM_UnitTest
Fix unit test failure for FIPS 140-2 + WOLFSSL_ARMASM
2024-02-15 08:25:42 -08:00
b87f544af6 Reviewer feedback 2024-02-14 16:43:01 -07:00
152c8565b9 Fix unit test failure for FIPS 140-2 + WOLFSSL_ARMASM 2024-02-14 16:24:58 -07:00
d39cf1e499 Merge pull request #7246 from kareem-wolfssl/zd17176
Only include CRL monitor definitions when building with HAVE_CRL_MONITOR.
2024-02-14 13:45:23 -08:00
6dc6d58c04 Remove redundant ifdefs. 2024-02-14 11:22:32 -07:00
375415d042 Merge pull request #7229 from kaleb-himes/win-code-up
Windows doesn't like code before variables
2024-02-14 09:50:34 -08:00
c119826e75 Only include CRL monitor definitions when building with HAVE_CRL_MONITOR. 2024-02-13 15:37:36 -07:00
3b6a7691c5 Merge pull request #7235 from julek-wolfssl/gh/7228
Send alert on bad psk binder
2024-02-14 07:24:52 +10:00
6f88ed0901 Merge pull request #7177 from gojimmypi/PR-Arduino-Update
Improved Arduino Support: ESP32, Due
2024-02-13 09:43:42 -08:00
c8d0bb0bd8 Merge pull request #7212 from SparkiDev/eddsa_check_priv
EdDsa: check private value after sign
2024-02-13 09:27:34 -08:00
e28d6a7b71 EdDsa: check private value after sign
Check the private value hasn't changed during signing with EdDSA.
2024-02-13 22:11:48 +10:00
94680991a9 Merge pull request #7243 from douzzer/20240213-aes256_test-leak
20240213-aes256_test-leak
2024-02-13 22:03:49 +10:00
68fb183fa6 Update TLS client example for Espressif ESP8266 2024-02-13 03:01:40 -08:00
9b7decada0 wolfcrypt/test/test.c: fix Aes init/free lifecycle in aes192_test() and aes256_test(). 2024-02-13 01:23:11 -06:00
2ebc897e31 Merge pull request #7241 from ejohnstown/ocsp-revoke-reason
Decode OCSP Revocation Reason
2024-02-12 15:11:26 -08:00
2b9e9955c3 Merge pull request #7242 from SparkiDev/ct_valgrind_fixes_3
RSA ct test: force RsaFunctionCheckIn to not be inlined
2024-02-12 15:10:47 -08:00
f031d034df RSA ct test: force RsaFunctionCheckIn to not be inlined
In non-debug compilation, RsaFunctionCheckIn may be inlined.
The function operates on the input - value to exponentiate.
Constant time testing excludes all operations in this function.
2024-02-13 07:37:24 +10:00
c17fb7498b OCSP Revocation Reason
1. The ASN.1 parser wasn't handling the OCSP response correctly when
   there was a revocation reason included in the response. The encoded
   reason value is constructed, and was getting marked as not
   constructed in the parser. Changed the flag to mark it as
   constructed.
2024-02-12 13:11:51 -08:00
06f04def1b Merge pull request #7222 from rizlik/early_data_fix
tls13: wolfSSL_read_early_data() set outSz to 0 if no early data and update doc
2024-02-12 11:38:46 -08:00
7b0fefbceb doc: update new wolfSSL_read_early_data() behavior 2024-02-12 17:20:15 +01:00
e923d4c151 tls13: read_early_data: set outSz to 0 if no early data
If not data is read, set outSz to 0. This way the
caller can detect if no early data was read.
2024-02-12 17:20:15 +01:00
83ae7245b0 Merge pull request #7151 from lealem47/pic24
MICROCHIP PIC24 support and example project
2024-02-12 23:15:10 +07:00
9a08296fa0 Fix openssl client psk key so that psk actually works 2024-02-12 15:07:46 +01:00
d5142d8553 Merge pull request #7234 from douzzer/20240208-test-config-and-linuxkm-tweaks
20240208-test-config-and-linuxkm-tweaks
2024-02-12 22:50:28 +10:00
9f0aa38120 Merge pull request #7223 from gojimmypi/PR-debug-messages
Add wolfSSL debug messages
2024-02-12 07:35:50 +10:00
2e970f53c5 Merge pull request #7232 from bandi13/moreDependencies
Add in dependencies of tests
2024-02-10 02:17:28 -05:00
13021708d4 Merge pull request #7227 from julek-wolfssl/gh-retention-days
Increase retention days to make re-running easier
2024-02-10 02:16:34 -05:00
c1931f78de Merge pull request #7225 from bandi13/fixStaticAnalysisError
Static analyzers complain that a->size is never initialized
2024-02-10 02:15:37 -05:00
63fe12efe3 wolfcrypt/src/aes.c: fix WOLFSSL_AESGCM_STREAM && WC_AES_C_DYNAMIC_FALLBACK: establish AESNI status dynamically at time of wc_AesGcmSetKey(), and stick to it (or return failure) until the next wc_AesGcmSetKey(). this matches the semantics of the Linux kernel in-tree implementation, allowing safe registration of the wolfCrypt AESNI implementation with the LKCAPI.
configure.ac: move enable_aesgcm_stream=yes clauses in enable-all and enable-all-crypto to the main section, from the !ENABLED_LINUXKM_DEFAULTS section, and in ENABLED_LINUXKM_LKCAPI_REGISTER setup, remove the !ENABLED_AESNI from the condition for forcing on ENABLED_AESGCM_STREAM.

linuxkm/lkcapi_glue.c:
* remove all special-casing for AES-GCM with AESNI.
* add support for a LINUXKM_LKCAPI_PRIORITY_ALLOW_MASKING macro.

wolfssl/wolfcrypt/memory.h: add missing definition of SAVE_VECTOR_REGISTERS2() when DEBUG_VECTOR_REGISTER_ACCESS_FUZZING && !DEBUG_VECTOR_REGISTER_ACCESS.

wolfcrypt/src/memory.c:
* define SAVE_VECTOR_REGISTERS2_fuzzer() if DEBUG_VECTOR_REGISTER_ACCESS_FUZZING, regardless of DEBUG_VECTOR_REGISTER_ACCESS.
* add a DEBUG_VECTOR_REGISTER_ACCESS clause to the !HAVE_THREAD_LS version of SAVE_VECTOR_REGISTERS2_fuzzer().

wolfcrypt/test/test.c: remove several errant wc_AesFree()s in aes256_test().
2024-02-10 01:09:15 -06:00
bd32dfd282 Send alert on bad psk binder
Issue reported in https://github.com/wolfSSL/wolfssl/pull/7228
2024-02-09 16:12:04 +01:00
d34cf39206 Increase retention days to make re-running easier 2024-02-09 11:36:55 +01:00
6146485d2a linuxkm/linuxkm_wc_port.h:
* add support for DEBUG_LINUXKM_FORTIFY_OVERLAY to allow KASAN analysis of the overlay without actually enabling CONFIG_FORTIFY_SOURCE (which is buggy in combination with KASAN).
* make SAVE_VECTOR_REGISTERS2 definition conditional on !defined(SAVE_VECTOR_REGISTERS2).

wolfssl/wolfcrypt/memory.h: fix the DEBUG_VECTOR_REGISTER_ACCESS definition for SAVE_VECTOR_REGISTERS to properly omit the on-success bookkeeping code even if the supplied fail_clause doesn't return.

wolfcrypt/src/rsa.c: in wc_MakeRsaKey() primality loop, invoke RESTORE_VECTOR_REGISTERS() SAVE_VECTOR_REGISTERS() to prevent lengthy kernel lockups.

wolfcrypt/src/dh.c: in wc_DhGenerateParams() primality loop, invoke RESTORE_VECTOR_REGISTERS() SAVE_VECTOR_REGISTERS() to prevent lengthy kernel lockups.

wolfcrypt/src/{curve25519.c,dh.c,dsa.c,ecc.c,eccsi.c,rsa.c,sakke.c,sp_int.c}: when WOLFSSL_LINUXKM, force {SAVE,RESTORE}_VECTOR_REGISTERS() to WC_DO_NOTHING if settings gate out applicable asm.
2024-02-09 00:47:23 -06:00
91681f378f configure.ac:
* add srtp to enable-all
* add srtp-kdf to enable-all-crypto
* fix typo in enable-all[-crypto] where ENABLED_FIPS was used when FIPS_VERSION was needed.
* in enable-all[-crypto], conditionalize aesxts on !FIPS || FIPS_VERSION == dev.
* move AES-XTS CFLAG setup after FIPS settings, to allow non-dev FIPS to force it off, and add clause to FIPS v5 setup to do that.
* in FIPS v5 setup, add AES-XTS to the list of modes that forces -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB.

wolfcrypt/src/kdf.c: fix several benign -Wconversions.

wolfcrypt/test/test.c: add aes_cfb_test() and aes_xts_test() as top-level tests with separate "pass" messages, for transparency that those modes have indeed been tested in builds that activate them.
2024-02-09 00:46:54 -06:00
e4b1e54235 configure or cmake sets LIBM variable if required, and write it in wolfssl.pc. 2024-02-09 13:58:28 +09:00
bf29066d70 Add wolfSSL debug messages 2024-02-08 17:22:36 -08:00
340e22a6e4 Add in dependencies of tests 2024-02-08 16:48:10 -05:00
d0fd0a287b Fixup some gating in the tests.
Found with:

./configure --enable-wolfclu --enable-asn=template 'CFLAGS=-DNO_ASN_TIME -DWOLFSSL_CUSTOM_OID -DHAVE_OID_ENCODING'
2024-02-08 16:14:43 -05:00
f5670082b6 Windows doesn't like code before variables 2024-02-08 14:12:02 -07:00
16c74a31b2 Use the MAXQ1065/1080 rng when available. 2024-02-08 16:10:36 -05:00
16b40b2f75 Static analyzers complain that a->size is never initialized 2024-02-08 15:13:07 -05:00
14830d0e09 Merge pull request #7226 from bandi13/disableOpenVPN_master
Temporarily disable OpenVPN-master test
2024-02-08 21:06:22 +01:00
de0d1ea1e7 Temporarily disable OpenVPN-master test 2024-02-08 13:52:32 -05:00
7365c3c6ba Merge pull request #7215 from julek-wolfssl/openssh-workflow-update
Point openssh workflow to wolf master
2024-02-08 12:43:53 -05:00
5b5f0ff32c Merge pull request #7194 from anhu/CerManUnExtCb
Adding unknown extension callback to CertManager
2024-02-08 22:10:32 +10:00
9147a7254b Merge pull request #7214 from julek-wolfssl/zd/17314
DTLS sequence number and cookie fixes
2024-02-08 22:08:37 +10:00
24c30d90e7 Add "Libs.private: -m" to wolfssl.pc.in for a static linking 2024-02-08 13:04:36 +09:00
e078e74011 Update Arduino IDE README.md 2024-02-07 13:52:18 -08:00
271462128d Add a test 2024-02-07 16:49:46 -05:00
7e142583c6 Merge pull request #7221 from SparkiDev/thumb2_inline_asm_iar_fix
Thumbs inline ASM IAR: fix register clobber list
2024-02-07 13:30:41 -08:00
dec4caa98f Merge pull request #7206 from julek-wolfssl/gh/7196
Fix write_dup with chacha-poly
2024-02-07 08:40:30 -08:00
91e1fe4496 Merge pull request #7220 from gojimmypi/PR-ssl-session-cache
Introduce MICRO_SESSION_CACHE, update comments
2024-02-07 21:25:53 +10:00
538ade105c Correct C++-style comments in settings.h 2024-02-06 18:25:05 -08:00
fff4effe31 Thumbs inline ASM IAR: fix register clobber list
Change register clobber list so that it reserves the same registers for
constants regardless of WOLFSSL_NO_VAR_ASSIGN_REG.
2024-02-07 10:28:01 +10:00
10b5c375ef introduce MICRO_SESSION_CACHE, update comments 2024-02-06 14:07:50 -08:00
8853096290 Merge pull request #7217 from douzzer/20240206-cmake-install-rule-by-default
20240206-cmake-install-rule-by-default
2024-02-06 10:48:55 -08:00
c69442375b CMakeLists.txt: include the install rule by default, disabled with -DWOLFSSL_INSTALL=no, to restore status quo ante. see #7188 2024-02-06 12:08:57 -06:00
735fbc7cee Merge pull request #7195 from philljj/zd17406
Update IAR-EWARM project user-settings.h.
2024-02-06 09:20:54 -08:00
4244fe9ff4 Run openssh tests on PR's 2024-02-06 13:30:25 +01:00
bdc0b80ddb Don't include unnecessary headers in public header file 2024-02-06 13:27:34 +01:00
4d842f094e Merge pull request #7199 from lealem47/defaultASN
Default to ASN TEMPLATE library
2024-02-05 22:32:57 -05:00
86b1aae218 Merge pull request #7209 from philljj/zd17416
Coverity issues: fix MD5 and SHA buffer overrun.
2024-02-06 08:58:27 +10:00
d36bd47a27 For cppcheck: Explicitly initialize some variables 2024-02-05 15:09:05 -07:00
48e40b8d8e Merge pull request #7201 from SparkiDev/sha256_aarch64_unaligned
SHA-256 Aarch64: fix alignments on loads and stores
2024-02-05 16:50:27 -05:00
8665295573 Merge pull request #7198 from dgarske/tls12only
Template for TLS v1.2 only
2024-02-05 16:14:47 -05:00
1356e079f1 Merge pull request #7207 from julek-wolfssl/update-actions
Update github actions
2024-02-05 16:11:39 -05:00
2b33079d50 Merge pull request #7188 from innolectric/innolectric
Innolectric CMake changes
2024-02-05 16:08:58 -05:00
9060da42a6 Merge pull request #7211 from douzzer/20240203-linuxkm-fixes
20240203-linuxkm-fixes
2024-02-06 07:08:40 +10:00
9ea52c3a51 Update IAR-EWARM project user-settings.h. 2024-02-05 15:01:07 -06:00
5c421d0207 Merge pull request #7178 from anhu/OQS_MEM_LEAKS
Fixes that prevent memory leaks when using OQS.
2024-02-05 13:26:43 -05:00
9b697a5315 Missed gating 2024-02-05 12:38:25 -05:00
54b562f501 Point openssh workflow to wolf master 2024-02-05 18:10:24 +01:00
8bddeb10c7 DTLS sequence number and cookie fixes
- dtls: check that the cookie secret is not emtpy
- Dtls13DoDowngrade -> Dtls13ClientDoDowngrade
- dtls: generate both 1.2 and 1.3 cookie secrets in case we downgrade
- dtls: setup sequence numbers for downgrade
- add dtls downgrade sequence number check test

Fixes ZD17314
2024-02-05 16:09:03 +01:00
83169f91e9 Fix ShaFinal overrun. 2024-02-03 17:36:26 -06:00
3a280e8295 linuxkm fixes:
linuxkm/linuxkm_wc_port.h: add fallback definition for static_assert() to support legacy kernels.
wolfcrypt/src/aes.c: fix AESNI runtime failure/fallback logic in wc_AesXtsSetKeyNoInit().
2024-02-03 13:46:45 -06:00
ca726e97f8 Peer review fixes. 2024-02-03 10:43:46 -08:00
d111d7da1b Fix MD5 and SHA buffer overrun. 2024-02-02 19:50:22 -06:00
851f059023 Merge pull request #7203 from julek-wolfssl/openssh-9.6
openssh 9.6p1 fixes
2024-02-02 19:51:55 -05:00
4ed197d487 Merge pull request #7205 from julek-wolfssl/fix-test_wolfSSL_OPENSSL_hexstr2buf
test_wolfSSL_OPENSSL_hexstr2buf: test was always skipped
2024-02-02 18:45:31 -05:00
866992151b Merge pull request #7208 from philljj/fix_ext_xmss_sigsleft
Fix ext_xmss sigsleft null deref.
2024-02-02 18:28:20 -05:00
7823acbbde Merge pull request #7184 from JacobBarthelmeh/pkcs7-enc
PKCS7 streaming with encode/sign
2024-02-02 18:00:12 -05:00
13e427433c Fix ext_xmss sigsleft null deref. 2024-02-02 16:04:23 -06:00
7592559fd3 rename argument, fix warnings on casts 2024-02-02 14:50:50 -07:00
d1e0b37467 Merge pull request #7202 from julek-wolfssl/bio-include-ssl
If bio.h is included first then it can't include options.h on its own
2024-02-02 16:00:47 -05:00
6230c29194 Merge pull request #7190 from SparkiDev/tls13_hrrcookie_fix
TLS 1.3, HRR Cookie: send cookie back in new ClientHello
2024-02-02 15:05:00 -05:00
31bfac43ea Update github actions
Many of these updates should also speed up some steps
2024-02-02 20:14:28 +01:00
32aecf4c35 Merge pull request #7180 from douzzer/20240126-LINUXKM_LKCAPI_REGISTER
20240126-LINUXKM_LKCAPI_REGISTER
2024-02-02 11:12:35 -08:00
5b5d6481de Fix write_dup with chacha-poly 2024-02-02 19:47:25 +01:00
188a69e649 test_wolfSSL_OPENSSL_hexstr2buf: test was always skipped 2024-02-02 18:29:15 +01:00
be90fe073e tfm and integer: skip whitespace at end in radix read 2024-02-02 14:38:40 +01:00
7ebb8cd007 Update radix tests 2024-02-02 12:09:50 +01:00
d3b0a26b3b If bio.h is included first then it can't include options.h on its own
When EXTERNAL_OPTS_OPENVPN is defined, we should be including options.h internally. When bio.h is included first, we don't include options.h and we don't pass the `#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)` guard.
2024-02-02 11:02:39 +01:00
c8b0aac144 SHA-256 Aarch64: fix alignments on loads and stores
Input buffer must be loaded with a byte alignment.
Fix other loads and stores to be consistent.
2024-02-02 12:41:12 +10:00
10645de648 linuxkm: various tweaks:
* configure.ac: in linuxkm-lkcapi-register section, force ENABLED_AESGCM_STREAM=yes if ENABLED_AESGCM is yes and there is asm or FIPS in the picture.
* linuxkm/module_hooks.c: in updateFipsHash(), if DEBUG_LINUXKM_PIE_SUPPORT || WOLFSSL_LINUXKM_VERBOSE_DEBUG, print the base16 hash to the kernel log.
* linuxkm/lkcapi_glue.c:
  * implement KATs for AES-CBC, AES-CFB, and AES-GCM.
  * clean out extraneous code and macro usage inherited from test/test.c.
  * add post-registration crypto_tfm_alg_driver_name() tests for AES-CBC, AES-CFB, and AES-GCM.
2024-02-01 19:04:02 -06:00
791c9e7aba Add EC_POINT_hex2point 2024-02-02 07:34:38 +09:00
63f7298be2 Default to ASN TEMPLATE library 2024-02-01 14:52:06 -07:00
ed4b87eb37 fix for clang-tidy null dereference error 2024-02-01 14:26:13 -07:00
5fbadbb215 fix warning with test case 2024-02-01 11:50:51 -07:00
8d0dc7a568 fix asn original build, vs warning, and add test cases 2024-02-01 11:50:51 -07:00
bf23357c8c refactor streaming and additional comments 2024-02-01 11:50:51 -07:00
c843064681 update macro guard 2024-02-01 11:50:51 -07:00
75762d44b6 PKCS7 streaming with encode/sign 2024-02-01 11:50:51 -07:00
ee0e25de5f Improved Arduino Support, ESP32, Due; (+ code review x2) 2024-02-01 08:31:00 -08:00
335c51987e openssh 9.6p1 fixes
- wolfSSL_DSA_set0_key: allow setting just the public key
- radix16: allow skipping the end of line whitespace
- Add openssh action
2024-02-01 11:39:56 +01:00
f9bf96d9ba Merge pull request #7187 from SparkiDev/sha256_intel_instrs
SHA-256: Implementation using Intel instructions
2024-01-31 19:15:43 -05:00
1fda249468 Merge pull request #7189 from philljj/fix_static_nomalloc_build
Fix WOLFSSL_NO_MALLOC build.
2024-01-31 18:46:48 -05:00
f48eb638da TLS 1.3, HRR Cookie: send cookie back in new ClientHello
Make it mandatory that the cookie is sent back in new ClientHello when
seen in a HelloRetryRequest.
2024-02-01 07:49:37 +10:00
3064d725b9 Merge pull request #7193 from bandi13/fixOpenWRTTests
Snapshots disappear after a while. Versioned releases stay.
2024-01-31 16:38:55 -05:00
dfc10741a5 Adding unknown extension callback to CertManager 2024-01-31 16:27:07 -05:00
65902308e8 Snapshots disappear after a while. Versioned releases stay. 2024-01-31 16:02:41 -05:00
75bd1af110 Merge pull request #7179 from philljj/fix_ext_xmss_sigsleft
Fix ext_xmss SigsLeft.
2024-01-31 14:33:18 -05:00
9e47703402 Template for TLS v1.2 only. 2024-01-31 10:13:31 -08:00
e1ee5e4421 linuxkm: spruce up arch-dependent CFLAGS setup in linuxkm/Kbuild; add "failed:" to error messages in km_AesGcmEncrypt() and km_AesGcmDecrypt(). 2024-01-31 11:49:46 -06:00
f228a85cee AES-XTS: fix FIPS gating to use defined(HAVE_FIPS), not defined(HAVE_FIPS_VERSION). 2024-01-30 17:16:37 -06:00
7ddf20851d Fix WOLFSSL_NO_MALLOC build. 2024-01-30 09:00:02 -06:00
48b99b0f10 Merge pull request #7185 from JacobBarthelmeh/zephyr
only download parts of zephyr sdk needed for test
2024-01-30 14:46:57 +01:00
492490f7e6 SHA-256: Implementation using Intel instructions
Detects Intel SHA-256 instructions available for CPU.
Preferences implementation using Intel instructions.
2024-01-30 23:17:05 +10:00
f7507f14cb Merge pull request #7186 from douzzer/20240129-fix-wc_RsaFunction_ex
20240129-fix-wc_RsaFunction_ex
2024-01-30 23:14:52 +10:00
3d3c07944e wolfcrypt/src/ecc.c: fix logic around WOLF_CRYPTO_CB_ONLY_ECC in wc_ecc_shared_secret(), _ecc_make_key_ex(), wc_ecc_sign_hash(), and wc_ecc_verify_hash() (defects reported by -Wreturn-type, -Wmaybe-uninitialized around err, and a failure of ecc_onlycb_test()). 2024-01-29 22:30:33 -06:00
67bbe1e1bb wolfcrypt/src/rsa.c: in wc_RsaFunction_ex(), if defined(WOLF_CRYPTO_CB_ONLY_RSA), add clause to return NO_VALID_DEVID if key->devId == INVALID_DEVID. fixes "control reaches end of non-void function" in PRB-single-flag.txt. 2024-01-29 22:00:20 -06:00
11e8a89f67 wolfcrypt/src/aes.c: coddle XCode (clang) to clear frivolous -Wparentheses-equality. 2024-01-29 17:58:13 -06:00
6261108d49 linuxkm: fix line lengths throughout; in linuxkm/lkcapi_glue.c: fix/harmonize error catching, reporting, and error codes; further address peer review feedback. 2024-01-29 17:48:31 -06:00
de91add3d9 Merge pull request #7182 from SparkiDev/armv8_32_align_chacha20_asm
ARMv8 32 bit ChaCha20 ASM: loading from in/out
2024-01-29 14:59:56 -08:00
920abd8b46 only download parts of zephyr sdk needed for test 2024-01-29 15:02:58 -07:00
de4a6f9e00 Merge pull request #7167 from SparkiDev/rsa_dec_check_d
RSA Decryption: check private value after decryption
2024-01-29 14:01:27 -08:00
154841a083 MICROCHIP PIC24 support and example project 2024-01-29 12:50:00 -07:00
a6326bd80a Merge pull request #7183 from SparkiDev/regression_fixes_9
Regression testing fixes
2024-01-29 07:42:34 -08:00
60de159707 Merge pull request #7176 from danielinux/iotsafe-sha384
IoT-Safe sha384+sha512 support
2024-01-29 07:35:50 -08:00
13591dcae8 Regression testing fixes
internal.c: NO_CERT, privateKeySz not used.
./configure --disable-shared --disable-asn --disable-rsa --disable-ecc
--enable-psk

sp_int.c: fix when sp_gcm is available
./configure --disable-shared  --disable-shared --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 --disable-sp-asm
--enable-sp-math
2024-01-29 23:05:46 +10:00
856c9a9a7f wolfcrypt/src/port/arm/armv8-aes.c: revert changes in a0415ce855. 2024-01-29 00:17:19 -06:00
1fc67183a5 linuxkm: address peer review:
* support AES_ENCRYPTION_AND_DECRYPTION only if WC_AES_XTS_SUPPORT_SIMULTANEOUS_ENC_AND_DEC_KEYS is defined, and define it in linuxkm_wc_port.h if LINUXKM_LKCAPI_REGISTER.
* fix a typo in km_AesInitCommon().
* remove #if 0 code in lkcapi_glue.c.
2024-01-28 23:58:46 -06:00
4585c6d508 ARMv8 32 bit ChaCha20 ASM: loading from in/out
Input and output buffers come from the application and are not
necessarily alighed.
Use instructions that allow unaligned access to these buffers.
2024-01-29 11:03:40 +10:00
957fc7460c linuxkm/lkcapi_glue.c: refactor AES-CBC, AES-CFB, and AES-GCM glue around struct km_AesCtx with separate aes_encrypt and aes_decrypt Aes pointers, and no cached key, to avoid AesSetKey operations at encrypt/decrypt time. 2024-01-27 23:16:02 -06:00
8ae031a5ed linuxkm/linuxkm_wc_port.h: improve my_memcpy(), my_memset(), and my_memmove() (CONFIG_FORTIFY_SOURCE workarounds) with copy-by-words codepaths. 2024-01-27 23:12:37 -06:00
82d94dab68 linuxkm: move "#undef HAVE_PTHREAD" from linuxkm/module_hooks.c to wolfssl/wolfcrypt/settings.h. 2024-01-27 23:10:12 -06:00
a0415ce855 wolfcrypt/src/port/arm/armv8-aes.c: fix for AesXts.aes_encrypt and AesXts.aes_decrypt. 2024-01-26 20:19:52 -06:00
b1e5d0f9bb linuxkm: completion and stabilization of LKCAPI integration for AES-CBC, AES-CFB, AES-GCM, and AES-XTS:
linuxkm/lkcapi_glue.c (added in earlier commit):
implement linuxkm_lkcapi_register() and linuxkm_lkcapi_unregister() with idempotency.
add AES-XTS algorithm glue and self-test implementations.
add per-algorithm gating: LINUXKM_LKCAPI_REGISTER_AESCBC, _AESCFB, _AESGCM, and _AESXTS.
carry forward philljj's implementations for AES-CBC, AES-CFB, and AES-GCM, with various cleanups.

linuxkm/module_hooks.c:
print the "wolfCrypt container hashes" message only if DEBUG_LINUXKM_PIE_SUPPORT is set.
render the FIPS version for the self-test success message using the HAVE_FIPS_VERSION* macros.
add a "skipping full wolfcrypt_test() ..." message for --disable-crypttests builds.
add CONFIG_FORTIFY_SOURCE gates.

configure.ac:
add support for --enable-linuxkm-lkcapi-register;
add AES-XTS to output config summary;
rename --enable-xts to --enable-aesxts (retaining old option for backward compatibility).

linuxkm/linuxkm_wc_port.h: add support for CONFIG_FORTIFY_SOURCE.

linuxkm/linuxkm_memory.c:
fix retvals in save_vector_registers_x86() (wc-style MEMORY_E, not sys-style ENOMEM).
add __my_fortify_panic() implementation.

linuxkm/Kbuild: for ENABLED_LINUXKM_PIE in rename-pie-text-and-data-sections recipe, create an .rodata.wolfcrypt section.

linuxkm/include.am: add linuxkm/lkcapi_glue.c to EXTRA_DIST.

wolfcrypt/test/test.c:
when defined(HAVE_FIPS_VERSION), inhibit a test clause in aes_xts_128_test() disallowed by FIPS ("FIPS AES-XTS main and tweak keys must differ").
fix out-of-order user message in ecc_test().
2024-01-26 20:01:19 -06:00
947528ee16 Fix ext_xmss SigsLeft. 2024-01-26 17:07:43 -06:00
39c74a9bf8 AES-XTS:
split XtsAes.aes in two, XtsAes.aes_encrypt and XtsAes.aes_decrypt, and add AES_ENCRYPTION_AND_DECRYPTION option constant, to accommodate Linux kernel crypto API model.
in wc_AesXtsSetKeyNoInit(), add FIPS check that main and tweak keys differ, and allow setting encrypt and decrypt keys simultaneously using AES_ENCRYPTION_AND_DECRYPTION.
in wc_AesXtsEncrypt() and wc_AesXtsDecrypt(), error if the required subkey has not been set.
2024-01-26 15:22:34 -06:00
ec60f91b4a linuxkm: add linuxkm/lkcapi_glue.c. 2024-01-26 15:22:34 -06:00
1f4cf4188d linuxkm:
* LKCAPI integration tweaks for buildability and streamlining.
* add DEBUG_VECTOR_REGISTER_ACCESS_FUZZING && !DEBUG_VECTOR_REGISTER_ACCESS, with a kernel-compatible implementation of SAVE_VECTOR_REGISTERS2_fuzzer().
2024-01-26 15:22:34 -06:00
6e559ed015 linuxkm: squash of philljj's POC work integrating libwolfssl.ko with crypto_register_skcipher/crypto_register_aead, start 2022-12-26, end 2023-01-14. 2024-01-26 15:22:34 -06:00
fe87f16114 Fixes that prevent memory leaks when using OQS.
Fixes ZD 17177.
2024-01-26 14:54:01 -05:00
3db58af4f8 Merge pull request #7173 from gojimmypi/PR-Espressif-SHA-updates
Improved Espressif SHA HW/SW selection
2024-01-26 11:51:15 -07:00
72e34a829a Fixed wrong define 2024-01-26 16:35:08 +01:00
db3873ff40 Merge pull request #7172 from bandi13/fixUninitVar
Fix compilation errors about uninitialized variables
2024-01-26 08:32:41 -07:00
5b3ba8f4bb Removed "256-bit hash" references from doxygen 2024-01-26 10:22:40 +01:00
6dab75368d [IoT-Safe] Add support sha384 + sha512 2024-01-26 10:20:03 +01:00
ac6181d7ae Improved Espressif SHA HW/SW selection 2024-01-25 15:23:58 -08:00
578735e06c Merge pull request #7169 from julek-wolfssl/gh/7160
BIO_BIO: BIO_{write|read} on a BIO pair should wrap around ring buffer
2024-01-25 12:08:10 -08:00
a13d107db4 Merge pull request #7171 from dgarske/stm32_cube_template
Improvements to the STM32Cube template
2024-01-25 10:58:46 -07:00
4c7f038149 Merge pull request #7161 from SparkiDev/xmss
XMSS implementation
2024-01-25 08:41:13 -08:00
4971b9a567 Fix compilation errors about uninitialized variables
When compiling with '--enable-all CFLAGS=-Og' there were a ton of errors that needed fixing.
2024-01-25 09:49:30 -05:00
4f1d777090 BIO_BIO: BIO_{write|read} on a BIO pair should wrap around ring buffer
- BIO_nread0 should return 0 when no data to read and -2 when not initialized
2024-01-25 13:46:45 +01:00
a5961907b0 XMSS implementation
Supporting code for wolfSSL C implementation of XMSS.
2024-01-25 11:21:39 +10:00
7305583f72 Improvements to the STM32Cube template. Fix defaults for ASN template and SNI. Disable Shake by default. Add comment about AES CFB. 2024-01-24 10:35:32 -08:00
199a5476ec Merge pull request #7166 from miyazakh/gcc5_strict-aliasing
fix strict-aliasing rules warning on gcc 5.x
2024-01-24 10:18:13 -08:00
999f84518c RSA Decryption: check private value after decryption 2024-01-24 16:09:15 +10:00
00f4afb5ea fix strict-aliasing rules warning 2024-01-24 12:37:16 +09:00
478c0633e7 Merge pull request #7159 from dgarske/features_20240122
Add PK Callback CMake support. Document `wc_RsaDirect`
2024-01-23 13:08:03 -08:00
fa87e227b4 Restore useful comments above wc_RsaDirect in the .c file. 2024-01-23 08:39:35 -08:00
3cbffd33b1 Merge pull request #7162 from per-allansson/dtls13-fips-missing-return
Fix missing return in DTLS1.3 / FIPS code
2024-01-23 08:30:11 -08:00
1574de1008 Merge pull request #7128 from embhorn/zd17251
XC32 compiler version 4.x compatibility
2024-01-23 08:20:39 -08:00
938698ec6b Merge pull request #7157 from philljj/fix_zephyr_benchmark_rsa
zephyr samples: fix wolfssl_benchmark RSA.
2024-01-23 08:17:10 -08:00
78f7454043 Merge pull request #7154 from anhu/EccKeyParamCopy_error
Fix missing heap hint in `EccKeyParamCopy`
2024-01-23 08:11:35 -08:00
3b20f49544 Merge pull request #7139 from douzzer/20230118-fix-_sp_mont_red-WOLFSSL_NO_CT_OPS
20230118-fix-_sp_mont_red-WOLFSSL_NO_CT_OPS
2024-01-23 07:18:25 -08:00
92d7815b5c Fix missing return in DTLS1.3 / FIPS code 2024-01-23 08:35:07 +01:00
916c22e021 Add PK (public key) callback support to CMake. 2024-01-22 13:42:31 -08:00
3d62896137 Add documentation for wc_RsaDirect. 2024-01-22 13:41:25 -08:00
dcc946575b Fix missing heap hint in EccKeyParamCopy. The XFREE is required or it will leak memory allocated in ASNToHexString. This only applies to WOLFSSL_CUSTOM_CURVES && !WOLFSSL_ASN_TEMPLATE. 2024-01-22 13:18:24 -08:00
b0de0a1c95 Merge pull request #7143 from julek-wolfssl/zd/17303
EVP_Cipher: correct parameter checking
2024-01-23 07:15:20 +10:00
920aaebed7 zephyr samples: fix wolfssl_benchmark RSA. 2024-01-22 14:59:09 -06:00
eb1fff3ad3 Merge pull request #7141 from julek-wolfssl/zd/17249
EarlySanityCheckMsgReceived: version_negotiated should always be checked
2024-01-22 12:18:57 -08:00
f2a76a0630 Merge pull request #7156 from bandi13/checkNullInput
Check NULL input
2024-01-22 12:07:20 -08:00
5c75ca539e Check NULL input 2024-01-22 12:45:42 -05:00
0c150d2391 Merge pull request #7150 from dgarske/getenv
Fix build with `NO_STDIO_FILESYSTEM` and improve checks for `XGETENV`
2024-01-22 08:33:24 -08:00
12dafec3aa Merge pull request #7149 from dgarske/psa_cryptocb
Remove the PSA restriction to allow use with crypto callbacks
2024-01-22 08:24:51 -08:00
2617669302 Merge pull request #7152 from douzzer/20240120-multi-test-fixes
20240120-multi-test-fixes
2024-01-22 08:19:23 -08:00
ccbb726859 Remove dead code in EccKeyParamCopy
Found with:

./configure --enable-ecccustcurves --enable-asn=original CFLAGS=-DWOLFSSL_ECC_CURVE_STATIC
2024-01-22 10:27:59 -05:00
fc7143a8f4 Code review 2024-01-22 16:08:06 +01:00
d2d653cfdc Merge pull request #7145 from douzzer/20240119-DoTls13CertificateVerify-CreateSigData-error-handling
20240119-DoTls13CertificateVerify-CreateSigData-error-handling
2024-01-22 07:36:49 +10:00
b0d64b419d Merge pull request #7084 from julek-wolfssl/set-cipher-ssl
Allow SetCipherList to operate on SSL without modifying on SSL_CTX
2024-01-22 07:31:22 +10:00
2edd18c49d src/x509.c: fix nullPointerRedundantCheck in wolfSSL_X509V3_set_ctx(). also adds thorough WOLFSSL_MSG() coverage for failures. 2024-01-20 13:08:21 -06:00
d043333bee Merge pull request #7148 from gojimmypi/PR-fix-Espressif-cmake
Fix Espressif component cmake for environment variable source
2024-01-19 13:27:32 -08:00
37fbb4fbae Merge pull request #7146 from kareem-wolfssl/zd17295
Remove git ignored files from IAR-EWARM projects.
2024-01-19 13:13:06 -08:00
76550465bd Fixes build with NO_STDIO_FILESYSTEM defined. 2024-01-19 12:49:53 -08:00
111f584d99 Remove the PSA restriction to allow use with crypto callbacks. 2024-01-19 12:15:40 -08:00
a4affd9431 Improve use of XGETENV in wolfSSL_RAND_file_name to check for macro. 2024-01-19 12:13:19 -08:00
92ab2eaca3 Fix Espressif component cmake for environment variable source 2024-01-19 11:54:10 -08:00
6b8280f663 Merge pull request #7144 from bandi13/20240119-codesonar
20240119 codesonar
2024-01-19 09:35:02 -08:00
a3a7012c81 Merge pull request #7136 from jpbland1/x509-new-ex
add heap hint support for a few of the x509 functions
2024-01-19 09:29:47 -08:00
f1e833005b Remove git ignored files from IAR-EWARM projects. 2024-01-19 10:24:50 -07:00
9aa99c0c9a src/tls13.c: in DoTls13CertificateVerify(), add missing error handling in several calls to CreateSigData(). 2024-01-19 11:12:23 -06:00
66f04958e3 use wolfSSL_CTX_new_ex for heap hint support 2024-01-19 11:20:50 -05:00
dbc209d8ea Always initialize 'decryptedKey'
Warning 750167.5627928
2024-01-19 10:58:29 -05:00
7069a1805a Avoid "Use after free"
Warning 544767.5627232
2024-01-19 10:47:38 -05:00
2c162ffb97 Make sure aes->rounds is initialized
Warning 684346.5627323
2024-01-19 10:39:33 -05:00
726e7026cb Uninitialized variable because we don't check return value
Warning 544870.5627882
2024-01-19 10:31:20 -05:00
1288d71132 Address code review 2024-01-19 15:59:22 +01:00
f6ef146149 EarlySanityCheckMsgReceived: version_negotiated should always be checked
Multiple handshake messages in one record will fail the MsgCheckBoundary() check on the client side when the client is set to TLS 1.3 but allows downgrading.
  --> ClientHello
  <-- ServerHello + rest of TLS 1.2 flight
  Client returns OUT_OF_ORDER_E because in TLS 1.3 the ServerHello has to be the last message in a record. In TLS 1.2 the ServerHello can be in the same record as the rest of the server's first flight.
2024-01-19 14:57:35 +01:00
afd0e5af4e Refactor haveAnon into useAnon
(ctx->|ssl->options.)useAnon means that the user has signalled that they want anonymous ciphersuites
2024-01-19 14:53:33 +01:00
b8b847bbcf Allow SetCipherList to operate on SSL without modifying on SSL_CTX 2024-01-19 14:53:28 +01:00
67700a1d70 Add libssh2 test 2024-01-19 12:46:53 +01:00
e438131a3b EVP_Cipher: correct parameter checking
EVP_Cipher(ctx, NULL, NULL, 0) is a valid call for all algorithms. For none-AEAD it results in a no-op.
2024-01-19 12:32:17 +01:00
ac81d9d29c Merge pull request #7110 from Frauschi/pq_secure_element
PQC: add CryptoCb support for PQC algorithms
2024-01-18 13:29:28 -08:00
9be390250d Adding support for dual key/signature certificates. (#7112)
Adding support for dual key/signature certificates with X9.146. Enabled with `--enable-dual-alg-certs` or `WOLFSSL_DUAL_ALG_CERTS`.
2024-01-18 13:20:57 -08:00
8a45f43eb0 Merge pull request #7131 from bandi13/fips-check-upgrades
Fips check upgrades
2024-01-18 08:21:29 -08:00
ec96fcdbae Merge pull request #7138 from ejohnstown/crl-mon-test-fix
CRL Monitor Test Fix
2024-01-18 08:20:05 -08:00
68ea31c52a Fix install step for liboqs port header
Make sure the header file of the liboqs port is properly installed
during a call to `make install`.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-01-18 17:07:39 +01:00
4d259da60a PQC: CryptoCb support for KEM algorithm Kyber
Add support for crypto callback and device id for all three Kyber PQC KEM
function calls.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-01-18 17:02:49 +01:00
8e6d151403 PQC: CryptoCb support for signature algorithms
Add initial support of the crypto callback API to the two PQC signature
algorithms Dilithium and Falcon. This ultimatelly enables the usage of
external hardware modules (e.g. secure elements) for these algorithms.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-01-18 17:02:38 +01:00
9d56de200e wolfcrypt/src/sp_int.c: in _sp_mont_red(), gate calls to ctMaskIntGTE() on !WOLFSSL_NO_CT_OPS. 2024-01-18 00:36:52 -06:00
b66a108e97 CRL Monitor Test Fix
1. For Mach and FreeBsd builds, add the function link_file() which makes
   a hard link for a file.
2. Add a macro STAGE_FILE that either calls copy_file or link_file
   depending on doing a Mach or FreeBSD build or not.

This is to work around how the CRL Monitor is detecting file changes
made by the CRL monitor test in the testsuite. Linux and Windows are
detecting the file copies and deletes, and how macOS detects them.
kevent sees the link as a single change to the parent directory and
reads it. When you copy the file, kevent sees the new file getting
opened and triggering the file update.
2024-01-17 21:38:26 -08:00
41ea1109ec update uses of wolfSSL_X509_new and wolfSSL_X509_d2i
where heap doesn't require a new ex function or struct field to avoid size increase
2024-01-17 18:46:24 -05:00
4f8fd98d0d Merge pull request #7109 from Frauschi/falcon_compat
PQC: Update Falcon support to match OQS
2024-01-17 14:18:32 -08:00
41b70b8386 Giving up and reverting back to what it was. 2024-01-17 17:03:37 -05:00
d5d279454b Merge pull request #7137 from douzzer/20240117-nightly-fixes
20240117-nightly-fixes
2024-01-17 13:57:48 -08:00
5ef6ed56dc Merge pull request #7135 from lealem47/returnParity
Return correct error code in TEMPLATE DecodeECC_DSA_Sig_Ex
2024-01-17 12:34:52 -08:00
81aa495b51 Fix missing tags 2024-01-17 14:46:19 -05:00
64667a5595 src/crl.c: fix "null pointer passed as argument 2" in new XMEMCPY() call in WC_RSA_PSS path of DupCRL_Entry(), added in b140f93b17, detected by gcc 14.0.0_pre20240107 p15 with sanitizers. 2024-01-17 13:38:05 -06:00
03f32b623f update based on PR comments 2024-01-17 13:22:58 -05:00
0b167faa56 Merge pull request #7133 from miyazakh/arm_isb
fix unsupported arm instruction compile error
2024-01-17 09:44:49 -08:00
d1a3646d5c add heap hint support for a few of the x509 functions 2024-01-17 11:26:52 -05:00
b2888a9467 Update Falcon support to match OQS
Update the OIDs and related variables to match the current OQS values.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-01-17 16:54:26 +01:00
cbc8e98876 Return correct error code in TEMPLATE DecodeECC_DSA_Sig_Ex 2024-01-17 08:49:09 -07:00
b2f971555e isb available > armv6 2024-01-17 13:39:48 +09:00
089468fbf1 Merge pull request #7132 from ejohnstown/x25519-ecdhe-psk
ECDHE-PSK with x25519
2024-01-16 20:16:01 -08:00
11029127df Merge pull request #7119 from JacobBarthelmeh/crl
support for RSA-PSS signatures with CRL
2024-01-16 15:23:16 -08:00
1af3502204 Merge pull request #7115 from TakayukiMatsuo/jpcmac
Update cmac-api documents
2024-01-17 08:18:11 +09:00
746ffac84a ECDHE-PSK with x25519
1. Add missing assignment of the WOLFSSL object's ecdhCurveOid value. It
   is set correctly in the previous cases, but got missed for ECDHE-PSK.
2. Add test cases to the unit testing.
2024-01-16 15:18:05 -08:00
b140f93b17 refactor sigParams allocation and adjust test file name 2024-01-16 14:41:24 -07:00
cdc46a7ddb Update cmac-api documents 2024-01-17 06:21:03 +09:00
79272b5861 Only take the latest from the repo. Don't need old history. 2024-01-16 15:41:15 -05:00
7a77d64d56 Merge pull request #7059 from bigbrett/cryptocb-oneshot-cmac
Add cryptoCb hook to one-shot CMAC functions
2024-01-16 12:17:05 -08:00
a51c8d54d2 Standardize script style 2024-01-16 11:58:34 -05:00
5fc32a1124 Add in 'make check' bypass 2024-01-16 11:58:10 -05:00
114d11a8d8 adding RSA-PSS macro guard around CRL use 2024-01-15 15:33:01 -07:00
b38e20a721 add crl_rsapss.pem to make dist 2024-01-15 15:19:04 -07:00
d4272bb48d Merge pull request #7129 from bandi13/configurePrintout
Print out how ./configure was called
2024-01-15 11:01:19 -08:00
abbf9f2b77 Add cryptoCb hooks to one-shot CMAC functions; add CMAC coverage to cryptoCb tests; add context argument to CMAC generate_ex 2024-01-15 11:52:17 -07:00
b5015df35f Print out how ./configure was called
This will make debugging and tracing back from logs much easier
2024-01-15 10:07:00 -05:00
5fc71161e9 add crl rsa pss for asn=original 2024-01-11 16:50:16 -07:00
49d258f01a Merge pull request #7124 from SKlimaRA/SKlimaRA/tls13SessionTicketDoubleFree
fixed double free happening during EvictSessionFromCache
2024-01-12 09:09:29 +10:00
9137ed671e Merge pull request #7107 from ejohnstown/fips-script
FIPS Script
2024-01-12 05:07:04 +10:00
909b437571 cleared ticket and ticketNonce 2024-01-11 19:59:12 +01:00
e63c50b1f3 fixed double free happening during EvictSessionFromCache 2024-01-11 19:52:03 +01:00
8c6de41eb9 Merge pull request #7051 from JacobBarthelmeh/mb
fix and enhancement for AES-GCM use with Xilsecure
2024-01-12 03:44:43 +10:00
5e8fca420e Merge pull request #7127 from dgarske/cryptocb_defhash
Fix for crypto callbacks to allow invalid devId for non _ex single shot hash functions
2024-01-11 11:22:26 +10:00
535d507c16 XC32 compiler version 4.x compatibility 2024-01-10 16:34:40 -08:00
340aed5498 Fix for crypto callbacks to allow invalid devId for non _ex single shot hash functions. 2024-01-10 15:33:10 -08:00
d9751aa103 FIPS Script
1. Update fips-check.sh for checking out v5.2.0.1 of the fips.c file.
2024-01-10 15:12:59 -08:00
06d7b14af1 Merge pull request #7122 from julek-wolfssl/curl-deps
Add curl dependencies
2024-01-11 01:35:07 +10:00
a2cfa35dc1 Merge pull request #7123 from bandi13/liberationFromGitHooks
Since no one uses this, we should remove commit hooks
2024-01-09 23:03:08 -08:00
06a32d3437 Merge pull request #7097 from lealem47/removeUserCrypto
Remove user-crypto functionality and Intel IPP support
2024-01-09 17:33:28 -08:00
f3761ed28e Since no one uses this, we should remove commit hooks 2024-01-09 20:31:44 -05:00
cae231b557 Add curl dependencies 2024-01-09 22:47:59 +01:00
cd07e32b13 update crl files and add in compat support for RSA-PSS 2024-01-08 16:38:11 -08:00
5631bc9b2d Merge pull request #7118 from douzzer/20240107-fix-linuxkm-commercial-POC
20240107-fix-linuxkm-commercial-POC
2024-01-07 14:33:06 -05:00
d722276c50 linuxkm/module_hooks.c: add proper gating for my_fpregs_[un]lock(). 2024-01-07 11:16:43 -06:00
0ebf82474a Merge pull request #7117 from douzzer/20240105-linuxkm-commercial-POC
20240105-linuxkm-commercial-POC
2024-01-07 15:15:56 +10:00
08aa39f538 Merge pull request #7094 from dgarske/armasm_thumb_aes
Fixes for ARM ASM with Thumb
2024-01-07 15:10:16 +10:00
9c36bb9073 linuxkm: add WOLFSSL_COMMERCIAL_LICENSE alternative to kernel_fpu_begin()/kernel_fpu_end() in save_vector_registers_x86()/restore_vector_registers_x86(): allocate wc_linuxkm_fpu_savebufs as a buffer for os_xsave()/os_xrstor(), and use fpregs_lock()/fpregs_unlock() to inhibit softirqs/preemption. 2024-01-05 23:21:24 -06:00
d58acef895 add RSA-PSS CRL test case 2024-01-05 14:47:53 -08:00
74f0625c89 add native asn template RSA-PSS support with CRL 2024-01-05 14:25:12 -08:00
d5d476a3a1 Merge pull request #7113 from bandi13/codeSonarFixes
Leak
2024-01-05 12:38:17 -05:00
8026aa44c8 Merge pull request #7114 from douzzer/20240104-with-liboqs-clang-tidy
20240104-with-liboqs-clang-tidy
2024-01-05 09:17:41 -08:00
9e28d5010c Fixes for ARM ASM with Thumb. Fix for AES ECB build with Thumb. Add alignment to thumb2 AES tables. Refactor alignment macros and expose generic alignment macro XALIGNED. The WOLFSSL_USE_ALIGN still controls alignment enablement in wolfSSL/wolfCrypt. ZD 17225 and ZD 17226 2024-01-05 08:16:02 -08:00
f84fa8dd8d Uninitialized variable
Warning 581199.5810097
2024-01-04 17:13:28 -05:00
77818d9c54 Merge pull request #6939 from danielinux/iotsafe_4B_ID
IoT-SAFE: allow for 4B ID fields
2024-01-04 13:57:26 -08:00
7f53bcc4d0 fixes for clang-tidy reported defects and misstylings --with-liboqs:
* readability-named-parameter (style)
* bugprone-sizeof-expression (true bugs)
* clang-analyzer-deadcode.DeadStores (true bugs)
* clang-analyzer-core.NonNullParamChecker (true bug)
* clang-diagnostic-newline-eof (style)
* clang-diagnostic-shorten-64-to-32 (true but benign in practice)

fixes for sanitizer reported defects --with-liboqs: null pointer memcpy()s in TLSX_KeyShare_GenPqcKey() and server_generate_pqc_ciphertext().

fixes for silent crypto-critical failure in wolfSSL_liboqsGetRandomData(): refactor to accommodate oversize numOfBytes, and abort() if wc_RNG_GenerateBlock() returns failure.
2024-01-04 15:57:09 -06:00
9e468a900b Merge pull request #7096 from julek-wolfssl/zd/17219
Add fencing to ClientSessionToSession()
2024-01-05 07:24:00 +10:00
a8c94cf22b Merge pull request #7102 from julek-wolfssl/gh/7093
server: allow reading 0-RTT data after writing 0.5-RTT data
2024-01-05 07:20:53 +10:00
32f3f7daab Merge pull request #7111 from Frauschi/fix_implicit_conversion
Fix implicit type conversion
2024-01-05 07:17:31 +10:00
bda44eda4a IoT-SAFE: allow for 4B ID fields 2024-01-04 19:18:40 +01:00
3fbbc7c1bb Fix implicit conversion.
Fix implicit type conversion from size_t to word32 in liboqs.c source
file to make it build with clang.

Fixes #7108.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2024-01-04 16:55:19 +01:00
0e1573accc Code review 2024-01-04 13:49:47 +01:00
14c812cdb7 Code review
Add server side check
2024-01-04 13:19:44 +01:00
5bdcfaa5d0 server: allow reading 0-RTT data after writing 0.5-RTT data 2024-01-04 13:19:44 +01:00
9db20774d8 Merge pull request #7099 from jpbland1/tls13-bounds-check
TLS13 padding bounds check
2024-01-04 01:09:36 -05:00
b37716f5ce refactor and remove word16 index 2024-01-03 19:19:13 -05:00
245c87fe8f clean up variable definitions 2024-01-03 17:39:20 -05:00
e1435e96d2 do bounds check on full word32 size to match
inputBuffer length
2024-01-03 17:21:08 -05:00
3f10496757 add weak source of entropy on microblaze to test with 2024-01-03 13:35:00 -08:00
bcfaf0372c Merge pull request #7026 from Frauschi/liboqs
Improve liboqs integration
2024-01-03 16:20:26 -05:00
52db533d9b Merge pull request #7106 from bandi13/20231114-codesonar-fixes
20231114 codesonar fixes
2024-01-04 07:16:33 +10:00
100c2ecd6a Merge pull request #7091 from JacobBarthelmeh/forcezero
SHA256 uses ForceZero now too
2024-01-04 07:06:44 +10:00
7e60b029c2 Merge branch 'master' into liboqs 2024-01-03 15:56:05 -05:00
e5d8ce9983 Fix memset size 2024-01-03 11:09:20 -05:00
d164a6c543 Buffer Overrun
Warning 545843.5806721
2024-01-03 10:00:31 -05:00
b206e074fc Uninitialized Variable
Warning 545067.3236517
2024-01-03 09:59:18 -05:00
f5c3fcfec4 Uninitialized variable
Warning 581107.3236416
2024-01-03 09:59:18 -05:00
c404df78b1 Uninitialized variable
Warning 581196.3236230
2024-01-03 09:59:18 -05:00
f00c5eb95d Fix double free
Warning 546055.3229451
2024-01-03 09:59:18 -05:00
461cf9ea71 Merge pull request #7103 from philljj/fix_infer_issues
Fix infer issues
2024-01-02 15:40:24 -05:00
e175004f85 Fix Infer Uninitialized Values. 2024-01-02 12:16:20 -06:00
3901fa6a96 fix check on non aad use 2024-01-02 08:50:59 -08:00
f8dbc7f15c use of device key with AES-GCM and add way to avoid malloc for tag 2024-01-02 08:50:59 -08:00
567243d257 touch up autoconf build with xilinx and sp macro guards 2024-01-02 08:50:59 -08:00
c8188eaabd Merge pull request #7100 from philljj/zd17237
Fix uninitialized keyUsage in DecodeKeyUsage.
2024-01-02 01:51:45 -05:00
6de275111b Merge pull request #7101 from miyazakh/ra_fsp3p5
fix include path for FSP 3.5 on Renesas RA6M4
2024-01-02 01:18:18 -05:00
faeae02030 Merge pull request #7104 from douzzer/20231227-cppcheck-2v13v0
20231227-cppcheck-2v13v0
2023-12-28 18:03:26 -08:00
b17ec3b4bc cppcheck-2.13.0 mitigations peer review:
* add explanation in DoSessionTicket() re autoVariables.
* re-refactor ECC_KEY_MAX_BITS() in ecc.c to use two separate macros, ECC_KEY_MAX_BITS() with same definition as before, and ECC_KEY_MAX_BITS_NONULLCHECK().
* in rsip_vprintf() use XVSNPRINTF() not vsnprintf().
* in types.h, fix fallthrough definition of WC_INLINE macro in !NO_INLINE cascade to be WC_MAYBE_UNUSED as it is when NO_INLINE.
2023-12-28 16:38:47 -06:00
44b18de704 fixes for cppcheck-2.13.0 --force:
* fix null pointer derefs in wc_InitRsaKey_Id() and wc_InitRsaKey_Label() (nullPointerRedundantCheck).
* fix use of wrong printf variant in rsip_vprintf() (wrongPrintfScanfArgNum).
* fix wrong printf format in bench_xmss_sign_verify() (invalidPrintfArgType_sint).
* add missing WOLFSSL_XFREE_NO_NULLNESS_CHECK variants of XFREE() (WOLFSSL_LINUXKM, FREESCALE_MQX, FREESCALE_KSDK_MQX).
* suppress false-positive uninitvar on "limit" in CheckTLS13AEADSendLimit().
* suppress true-but-benign-positive autoVariables in DoClientHello().
* in wolfcrypt/src/ecc.c, refactor ECC_KEY_MAX_BITS() as a local function to resolve true-but-benign-positive identicalInnerCondition.
* refactor flow in wc_ecc_sign_hash_ex() to resolve true-but-benign-positive identicalInnerCondition.
2023-12-28 15:06:21 -06:00
e3346fe3c4 fix include path for FSP 3.5 2023-12-28 16:00:05 +09:00
46bf30ca77 Fix uninitialized keyUsage in DecodeKeyUsage. 2023-12-27 22:58:52 -06:00
457188f55e Merge pull request #7070 from dgarske/cryptocb_moreinfo
Fixes for TLS with crypto callbacks
2023-12-27 18:55:56 -05:00
1c4d7285d3 Add documentation for HKDF functions. Improve param comments for devId. 2023-12-27 13:56:40 -08:00
fc3977fc77 Merge pull request #7098 from dgarske/stm32_pka
Fixes for STM32 PKA
2023-12-27 14:36:53 -07:00
e641c6b738 when removing the padding for the TLS13 verify message
step, check that the index doesn't wrap around due to a malformed packet
2023-12-27 16:06:40 -05:00
cca6cc0495 Make new HDFK _ex functions public. 2023-12-27 11:40:29 -08:00
c37edb09f7 Fix STM32 PKA V2 (STM32U5) point multiply missing order/coefB. 2023-12-27 11:37:16 -08:00
837452b1ca Remove user-crypto functionality and Intel IPP support 2023-12-27 12:24:19 -07:00
be8000d5f7 Add useful information about single precision math and document options for enabling additional curves/key sizes. 2023-12-27 10:27:56 -08:00
0d057099af Fix line lengths. 2023-12-27 10:12:52 -08:00
65ba8bd6ba Improve detection of FP_MAX_BITS for RSA or DH. 2023-12-27 10:11:06 -08:00
3a798e148b Fix STM32 PKA ECC cast warning. 2023-12-27 09:57:40 -08:00
b86dfffdbe Improve the TLS v1.3 expand key label warning for possible use of uninitialized "hash". 2023-12-27 09:52:56 -08:00
157753defe Detect if using C99 and use correct inline asm notation 2023-12-27 18:02:13 +01:00
4b21cf3efc Add fencing to ClientSessionToSession()
Prevent memory access before clientSession->serverRow and clientSession->serverIdx are sanitized.

Fixes ZD17219

Co-authored-by: Daniele Lacamera <dan@danielinux.net>
2023-12-27 16:23:52 +01:00
b8392ef659 Merge pull request #7092 from douzzer/20231224-clang-unreachable-code-aggressive
20231224-clang-unreachable-code-aggressive
2023-12-26 14:56:42 -08:00
e68facd889 src/ssl.c: in wolfSSL_curve_is_disabled(), fix shiftTooManyBitsSigned. 2023-12-25 00:27:49 -06:00
8a32e7f3f9 fixes for clang -Wunreachable-code-aggressive:
tests/suites.c: in SuiteTest(), swap order of (void)s and return.

wolfcrypt/src/chacha.c: gate out unreachable C wc_Chacha_encrypt_bytes() call in wc_Chacha_Process, and gate out unused implementations of wc_Chacha_wordtobyte() and wc_Chacha_encrypt_bytes(), when defined(USE_INTEL_CHACHA_SPEEDUP).

wolfcrypt/src/sha256.c and wolfcrypt/src/sha512.c: fix logic in Sha256_SetTransform() and Sha512_SetTransform() to make the AVX1_RORX implementations accessible.  also add a missing Transform_Sha512_Len_p = NULL in the C path of Sha512_SetTransform().

wolfssl/internal.h: for the fallback definition of wolfSSL_curve_is_disabled, use an inline function instead of a compound-clause macro, because clang isn't smart enough to treat the compound expression as a bare constant zero, producing a lame-positive -Wunreachable-code.
2023-12-25 00:23:37 -06:00
a97ee9d220 SHA256 uses ForceZero now too 2023-12-22 15:09:34 -08:00
d9ac8b5422 Peer review fixes. Fix issues with Tls13HKDFExpandKeyLabel. Fix crypto callback line lengths. 2023-12-22 14:16:59 -08:00
daf1d1728f Merge pull request #7090 from douzzer/20231222-clang-unreachable-code-aggressive
20231222-clang-unreachable-code-aggressive
2023-12-22 14:51:20 -07:00
e65e9f11c7 fixes for clang -Wunreachable-code-aggressive (-Wunreachable-code/clang-diagnostic-unreachable-code in src/ssl.c:wolfSSL_CTX_load_verify_buffer_ex() and -Wunreachable-code/clang-diagnostic-unreachable-code-return in api.c:myCEKwrapFunc()). 2023-12-22 14:12:13 -06:00
59cdd5c70f Merge pull request #7082 from bandi13/ARIA_Sign_fix
Aria sign fix
2023-12-21 19:01:54 -05:00
f77f7c70d3 Merge pull request #7018 from dgarske/ti_aes
Fixes for TI AES and SHA
2023-12-22 07:55:00 +10:00
f5ff72aa56 Merge pull request #7087 from dgarske/cryptocb_sha1
Allow crypto callbacks with SHA-1 HW
2023-12-22 07:54:50 +10:00
b5592c4571 Addressing PR comments 2023-12-21 16:48:15 -05:00
00c9625ab8 Merge pull request #7081 from gojimmypi/PR-Espressif-ESP32-C2
Add wolfcrypt SHA support for ESP32-C2/ESP8684, other minor updates
2023-12-22 07:23:51 +10:00
a5a2b3752d Merge pull request #7077 from gojimmypi/PR-Espressif-threads
wolfSSL_NewThread() type update for Espressif FreeRTOS
2023-12-22 07:22:33 +10:00
0d212d8055 Further cleanup for Hashes.sha when not required. Gate all TLS SHA-1 on either old TLS or WOLFSSL_ALLOW_TLS_SHA1. 2023-12-21 09:41:29 -08:00
5b3aaf8bbd Merge pull request #7086 from dgarske/rpm_spec
Remove obsolete mkdir call
2023-12-21 00:37:22 -05:00
9311a961a0 Allow crypto callbacks with SHA-1 HW. Resolves build error in test.c with trying to use HW SHA-1 with crypto cb enabled. Note: sha.h changes are very small if ignoring whitespace. 2023-12-20 15:48:21 -08:00
86f9171050 Remove obsolete mkdir call. 2023-12-20 14:52:08 -08:00
a5464a9b51 Merge pull request #7083 from douzzer/20231219-clang-analyzer-optin.core.EnumCastOutOfRange
20231219-clang-analyzer-optin.core.EnumCastOutOfRange
2023-12-20 14:18:06 -08:00
805c2d4487 Merge pull request #7085 from dgarske/async_v5.6.6
Fix for invalid `dh_ffdhe_test` test case using Intel QuickAssist
2023-12-20 15:31:58 -05:00
00f196d497 Fix for invalid dh_ffdhe_test test with even P when using Intel QuickAssist. 2023-12-20 11:30:17 -08:00
f2d573f01f wolfssl/wolfcrypt/asn.h, src/ssl.c: add "ANONk" to enum Key_Sum, and use the new value in wolfSSL_get_sigalg_info(), fixing clang-analyzer-optin.core.EnumCastOutOfRange.
add suppressions in tests for expected clang-analyzer-optin.core.EnumCastOutOfRange's.
2023-12-19 18:14:29 -06:00
77e8a66ca3 Not cryptocb's job to sanity check input
Don't need to check parameters at every level
2023-12-19 15:55:38 -05:00
12192b7683 Set result to invalid as first step 2023-12-19 15:54:25 -05:00
f45ffd8802 Rename variable to keep the names similar across functions 2023-12-19 15:37:58 -05:00
9e974027a8 Fix ARIA signing
Used the wrong function to extract key
2023-12-19 15:33:28 -05:00
41d4f4a972 Fix TLS v1.2 case where SHA-1 could be used uninitialized. Exclude the SHA1 struct from HS_Hashes when not needed. Fixes mix-match of the SHA-1 with NO_OLD_TLS and WOLFSSL_ALLOW_TLS_SHA1. 2023-12-19 12:30:53 -08:00
fb5eab8f79 Fix one shot hash routines to attempt offloading to crypto callbacks. Fix random.c health test to use devId. Fix FIPS unused "ssl". 2023-12-19 11:20:56 -08:00
2001d1c74b Fixes for TLS v1.3 with crypto callbacks not offloading DeriveKeyMsg, KDF HMAC and ECH. 2023-12-19 08:15:58 -08:00
66596ad9e1 Merge pull request #7075 from cconlon/v5.6.6-prep
5.6.6 version bump and README changes
2023-12-18 19:14:18 -08:00
07a5566c52 Add wolfcrypt SHA support for ESP32-C2, other minor updates 2023-12-18 17:35:43 -08:00
90748b5f61 Remove the SHA1-/SHA2-256 auto devId selection devId = wc_CryptoCb_GetDevIdAtIndex(0); 2023-12-18 17:14:58 -08:00
8b203719d3 Add support for using devId with one-shot hash functions. 2023-12-18 17:14:43 -08:00
d5e83310b6 Fix typo with HMAC determination of update/final. 2023-12-18 17:11:33 -08:00
205403ebb2 Add more information in the DEBUG_CRYPTOCB. 2023-12-18 17:11:16 -08:00
dd55cdbea8 Initialize variables to NULL 2023-12-18 16:51:51 -07:00
5046e577d3 update ChangeLog/README with 5.6.6 release information 2023-12-18 15:24:14 -07:00
a003338a88 bump version to 5.6.6 2023-12-18 12:16:34 -07:00
4e081960d3 Merge pull request #7078 from douzzer/20231218-AddSessionToClientCache-round-2
20231218-AddSessionToClientCache-round-2
2023-12-18 13:15:52 -06:00
7eed28fbe0 src/ssl.c: in AddSessionToClientCache(), remove benign frivolous assignment, and fix so that ret is assigned only if no error. 2023-12-18 11:15:28 -06:00
3e483f32a4 Merge pull request #7076 from douzzer/20231216-client_usage_msg-array-length
20231216-client_usage_msg-array-length
2023-12-18 09:30:49 -07:00
da644c7be3 wolfSSL_NewThread() type update for Espressif FreeRTOS 2023-12-17 11:59:42 -08:00
ff9fee758e examples/client/client.c: fix client_usage_msg undersized array dimension. 2023-12-16 13:22:22 -06:00
8a89470422 Fix for liboqs on zephyr
When using WolfSSL on zephyr, we need POSIX names for networking systems
calls. This can either be enabled with CONFIG_NET_SOCKETS_POSIX_NAMES or
with CONFIG_POSIX_API. This commit enables support for the latter.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-16 12:40:26 +01:00
0780fd9719 liboqs: add RNG support for sphincs
Added a RNG argument to the wc_sphincs_sign_msg method to properly
generate necessary random data using the desired WolfSSL RNG object.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-16 12:40:26 +01:00
85c40b1728 liboqs: add RNG support for falcon
Added a RNG argument to the wc_falcon_sign_msg method to properly
generate necessary random data using the desired WolfSSL RNG object.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-16 12:40:26 +01:00
ec86a86096 liboqs: add RNG support for dilithium
Added a RNG argument to the wc_dilithium_sign_msg method to properly
generate necessary random data using the desired WolfSSL RNG object.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-16 12:40:26 +01:00
755c385b1f Liboqs: use WolfSSL RNG
Improve the interface to liboqs by properly configuring and using the
RNG provided by WolfSSL from within liboqs.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-16 12:40:25 +01:00
d31e2c3581 Added PQC support for the Zephyr port using liboqs
Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-12-16 12:40:25 +01:00
64e48deb0e Merge pull request #7074 from douzzer/20231215-srtp-cleanup
20231215-srtp-cleanup
2023-12-15 14:31:32 -07:00
ef14176b7f SRTP fixes:
* in wolfssl/ssl.h, add missing arg names to wolfSSL_CTX_set_tlsext_use_srtp(), wolfSSL_set_tlsext_use_srtp(), and wolfSSL_export_dtls_srtp_keying_material();
* in wolfcrypt/src/kdf.c, call wc_AesFree if and only if wc_AesInit() succeeded;
* in src/ssl.c:DtlsSrtpSelProfiles(), fix bugprone-inc-dec-in-conditions;
* in tests/suites.c:execute_test_case(), fix several -Wdeclaration-after-statement and -Wmissing-field-initializers;
* in wolfcrypt/test/test.c, fix a shiftTooManyBitsSigned warning in srtpkdf_test(), and fix a typo (kaSz/ksSz).
2023-12-15 14:06:36 -06:00
8f2a48c676 Merge pull request #7073 from julek-wolfssl/move-mutex-init
Move the mutex initializer into the appropriate existing section
2023-12-15 12:17:37 -05:00
62b3ca5fb5 Merge pull request #7071 from douzzer/20231214-WOLF_CRYPTO_CB-not-WC_AESFREE_IS_MANDATORY
20231214-WOLF_CRYPTO_CB-not-WC_AESFREE_IS_MANDATORY
2023-12-15 09:25:48 -07:00
57355f357e Move the mutex initializer into the appropriate existing section 2023-12-15 10:03:06 +01:00
7ebbb927f3 wolfssl/wolfcrypt/aes.h: don't set WC_AESFREE_IS_MANDATORY for WOLF_CRYPTO_CB -- free is only needed when callbacks are both installed and used. 2023-12-14 18:09:39 -06:00
2ffc818c28 Merge pull request #7069 from douzzer/20231213-misc-fixes
20231213-misc-fixes
2023-12-14 15:18:12 -07:00
4b771a9b28 Document new macro and rename to: NO_TIME_SIGNEDNESS_CHECK 2023-12-14 13:58:29 -08:00
27c6ee4d05 Merge pull request #7068 from SparkiDev/srtp_kdf_label
SRTP/SRTCP KDF: add APIs that derives one key from a label
2023-12-14 14:54:58 -07:00
fb6b022f42 Merge pull request #7020 from SparkiDev/ecc_gen_k_by_reject
ECC: generate values in range of order by rejection
2023-12-14 14:54:39 -07:00
8b048bc246 Disable the old TI workarounds. Enable support for CCM. 2023-12-14 13:50:03 -08:00
f2e4360f8d Spelling fixes. 2023-12-14 12:15:32 -08:00
1cf87ce0c9 Spelling fix. 2023-12-14 12:14:30 -08:00
f6ef58dbc2 Merge pull request #7064 from philljj/fix_infer_issues
Fix issues from infer diff report.
2023-12-14 12:27:34 -07:00
64e4796ed6 wolfssl/wolfcrypt/wc_port.h: add definition for WOLFSSL_MUTEX_INITIALIZER, currently only #ifdef WOLFSSL_PTHREADS.
src/ssl.c: refactor dynamics of count_mutex, count_mutex_valid, and initRefCount, to be intrinsically race-free on pthreads builds, and to be always race-free for callers that call wolfSSL_Init() first, then wait for return before any other wolfSSL calls, and call wolfSSL_Cleanup() at most as many times as wolfSSL_Init().

also, in AddSessionToClientCache(), move final access to ClientCache inside the lock-protected span, to mollify Coverity.
2023-12-14 13:22:27 -06:00
16c6bd6846 examples/client/client.c and tests/api.c: add missing CloseSocket() calls. 2023-12-14 13:22:27 -06:00
1b76f6d56b Merge pull request #7065 from miyazakh/fix_ra6m3
fix benchmark compile error
2023-12-14 09:15:32 -07:00
659a245b27 SRTP/SRTCP KDF: add APIs that derives one key from a label
Added more generic APIs that derive a single key with a label.
Added defines for label values and index lengths.
2023-12-14 14:45:35 +10:00
3af91c265b remove tab 2023-12-14 11:16:36 +09:00
0bc244962a Fixes for TI AES GCM and GMAC. 2023-12-13 17:32:45 -08:00
c021e3e85d Merge pull request #7066 from cconlon/v5.6.6-fixes
Fixes from release prep testing, example certificate updates
2023-12-13 17:00:45 -08:00
d0aa80eb37 update example/test certs for end of year release 2023-12-13 16:41:59 -07:00
a14a1bf467 define WOLFSSL_AES_DIRECT in configure.ac with --enable-aes-bitsliced 2023-12-13 16:41:59 -07:00
f5d33cedeb add variable name in wolfSSL_BIO_new() prototype 2023-12-13 16:41:59 -07:00
255086b7c8 fix API test warning, comparison of unsigned expression < 0 is always false 2023-12-13 16:41:59 -07:00
d36538c40a Merge pull request #7063 from embhorn/13dec2023_cov_fixes
Fixes for release
2023-12-13 16:19:13 -07:00
a1b44b6214 Fix issues from infer diff report: init mp_digit to 0. 2023-12-13 17:17:49 -06:00
f209120218 fix benchmark compile error 2023-12-14 07:35:32 +09:00
f222adf4c2 Fix issues from infer diff report. 2023-12-13 15:59:03 -06:00
a66137d2fe Merge pull request #7062 from lealem47/leaks
Cleanup leaks in api.c and benchmark.c
2023-12-13 14:09:23 -07:00
1d7fd42aa8 Fixes for release 2023-12-13 14:47:02 -06:00
5fd0470f76 Cleanup leaks in api.c and benchmark.c 2023-12-13 13:00:52 -07:00
8acee813cb Merge pull request #7061 from gojimmypi/PR-Espressif-user_settings-fix
Fix missing closing comment on example Espressif user_settings.h
2023-12-13 10:44:20 -08:00
3d959b96c9 Merge pull request #7060 from dgarske/various_20231212
Fix for benchmark without filesystem unused globals
2023-12-13 11:29:28 -07:00
56c7e5c675 Merge pull request #7054 from cconlon/sslAlpnSelectCb
Add wolfSSL_set_alpn_select_cb() for setting ALPN select callback on WOLFSSL session
2023-12-13 09:24:07 -08:00
eeb024a30d fix missing closing comment on example user_settings.h 2023-12-13 09:19:39 -08:00
269542ed96 add wolfSSL_set_alpn_select_cb() for WOLFSSL-level ALPN select callbacks 2023-12-13 09:16:44 -07:00
b7b20ededd Merge pull request #7058 from lealem47/zd17174
Check buffer length before XMEMCMP in GetOID
2023-12-13 14:36:23 +10:00
cbd5341332 Merge pull request #7056 from douzzer/20231212-QUIC-WOLFSSL_CALLBACKS-error
20231212-QUIC-WOLFSSL_CALLBACKS-error
2023-12-13 14:34:19 +10:00
d455196955 Merge pull request #7055 from dgarske/fix_rpmspec
Fixes for RPM Spec: Move the .so to devel files
2023-12-13 14:33:09 +10:00
f12b61183b Merge pull request #7029 from julek-wolfssl/zd/17108-fix
Additional TLS checks
2023-12-13 14:31:11 +10:00
3b75a41006 Merge pull request #7057 from kaleb-himes/fix-fips-140-3-pr-failure
Address fips 140-3 failures with wolfEngine support enabled
2023-12-12 16:15:40 -08:00
ca5adfaecb Add comments per peer review 2023-12-12 15:21:28 -07:00
db7f08e12f Address fips 140-3 failures with wolfEngine support enabled 2023-12-12 15:14:51 -07:00
2724edc257 Check buffer length before XMEMCMP in GetOID 2023-12-12 15:13:42 -07:00
ce74a34154 Merge pull request #7019 from dgarske/armasm_mmcau
Patch to support NXP Kinetis MMCAU SHA2-256 with ARM ASM
2023-12-13 07:26:11 +10:00
6e953e4d53 Merge pull request #7044 from julek-wolfssl/zd/17137
ocsp: don't error out if we can't verify our certificate
2023-12-13 07:23:46 +10:00
3750ff5205 Fix for benchmark without filesystem and unused hash_input and cipher_input. 2023-12-12 13:22:17 -08:00
1cc45b57d7 wolfssl/wolfcrypt/settings.h: add #if defined(WOLFSSL_QUIC) && defined(WOLFSSL_CALLBACKS) #error ("ERROR - tests/quic.c line 1027 failed"). 2023-12-12 14:26:25 -06:00
493bb1760d Add option to remove early sanity checks 2023-12-12 17:31:48 +01:00
573093ddf3 Move the .so to devel files. The pure *.so file is considered a dev file. 2023-12-12 08:15:05 -08:00
51ba745214 ocsp: don't error out if we can't verify our certificate
We can omit either the CeritificateStatus message or the appropriate extension when we can not provide the OCSP staple that the peer is asking for. Let peer decide if it requires stapling and error out if we don't send it.
2023-12-12 14:49:52 +01:00
627310d26a Additional TLS checks
- double check which messages need to be encrypted
- check msgs that have to be last in a record

ZD17108
2023-12-12 13:57:12 +01:00
21f53f37a1 ECC: generate values in range of order by rejection
When generating private key and nonce for ECDSA, use rejection sampling.
Note: SP uses this algorithm
2023-12-12 14:55:56 +10:00
1aed438a21 Merge pull request #7053 from douzzer/20231208-asn-big-short-ints
20231208-asn-big-short-ints
2023-12-12 13:53:37 +10:00
043dde18be Merge pull request #7048 from anhu/PQ_uninit_key_free
Prevent freeing uninitialized keys
2023-12-12 13:47:30 +10:00
058ffad657 Fix cast warnings on test with -1. 2023-12-11 16:25:47 -08:00
8e44018baa Fix TI AES return codes. 2023-12-11 16:10:48 -08:00
68cfaa76fc Fix for TI-RTOS time. Cleanup forced settings.h for WOLFSSL_TIRTOS. Compiler warning cleanups. 2023-12-11 15:57:26 -08:00
00a1c68f97 Merge pull request #7052 from dgarske/stm32_fips
Fix to resolve collision between FIPS `RNG` in settings.h and STM32 HAL header
2023-12-11 16:12:07 -07:00
c1b5135918 wolfcrypt/src/evp.c and wolfcrypt/test/test.c: in FIPS builds <5.3, gate out AES-XTS functionality that depends on new APIs added in #7031 (b14aba48af and 931ac4e568) (AES-XTS is non-FIPS in FIPS <5.3). 2023-12-11 12:14:29 -06:00
9c17d5d2fa support ASN ShortInts up to 4 bytes (2^32-1):
* parameterize MAX_LENGTH_SZ using overrideable WOLFSSL_ASN_MAX_LENGTH_SZ, default value 5 (raised from 4).
* refactor other Misc_ASN constants to refer to MAX_LENGTH_SZ as appropriate.
* tweak BytePrecision() appropriately.
* refactor SetShortInt() to use BytePrecision() and include a length assert against MAX_SHORT_SZ to assure no buffer overruns with reduced WOLFSSL_ASN_MAX_LENGTH_SZ.
2023-12-11 12:14:29 -06:00
f068bebb94 Fix to resolve collision between RNG in settings.h and the STM32 Cube HAL (ex: stm32h7xx.h). In STM32 platforms we use NO_OLD_RNGNAME (see https://github.com/wolfSSL/wolfssl/blob/master/examples/configs/user_settings_stm32.h#L616) 2023-12-11 10:01:21 -08:00
540012844b Merge pull request #7049 from lealem47/ghIssue6983
Enable cURL and QUIC from CMake
2023-12-11 09:40:31 -08:00
cb6676fa27 Merge pull request #7030 from julek-wolfssl/gh/7000
Store ssl->options.dtlsStateful when exporting DTLS session
2023-12-11 09:39:54 -08:00
b5eb8995c9 Fix possible unused variable warning. 2023-12-11 09:22:47 -08:00
4ce4dd7479 Use correct size for memset 2023-12-11 14:30:54 +01:00
03a82711aa Merge pull request #7036 from anhu/SCSV
Make sure to send SCSV when application sets ciphersuites
2023-12-11 07:15:23 +10:00
ac447d1afb Merge pull request #7031 from douzzer/20231201-openssl-compat-fixes
20231201-openssl-compat-fixes
2023-12-08 17:25:53 -07:00
f708d42ef7 Merge pull request #7046 from dgarske/crl_cleanups
Various cleanups - CRL and comments - 20231207
2023-12-08 17:15:01 -07:00
38eddd7f89 Merge pull request #7043 from gojimmypi/PR-Espressif-README
Espressif README files
2023-12-08 17:11:59 -07:00
8a5a467543 Patch to support NXP Kinetis MMCAU SHA2-256 (FREESCALE_MMCAU_CLASSIC_SHA) with --enable-armasm. 2023-12-08 15:56:20 -08:00
de4bd42de0 Enable cURL and QUIC from CMake 2023-12-08 15:57:29 -07:00
b002c330c0 Fixes for TI AES and SHA. 2023-12-08 14:17:09 -08:00
df954568be Fix typos 2. 2023-12-08 14:17:09 -08:00
842a60465a Fix compiler error for missing Task_Handle. Fix typo. 2023-12-08 14:17:08 -08:00
d17955f2d0 Cleanups for the ti-aes.c code to conform with coding standards. 2023-12-08 14:17:08 -08:00
0c9555b29e Merge pull request #7045 from julek-wolfssl/memcached-retry
Retry memcached tests 3 times on error
2023-12-08 14:03:54 -07:00
0ba3646f32 Merge pull request #7037 from gojimmypi/PR-Expressif-Benchmark
Espressif benchmark update
2023-12-08 13:51:44 -07:00
1bf0d8c896 Use SIGKILL to actually kill the runner 2023-12-08 20:23:00 +01:00
40015a06c4 Prevent freeing uninitialized keys 2023-12-08 13:52:24 -05:00
62c0910e15 sync w/upstream; resolve merge conflict 2023-12-08 09:06:10 -08:00
448b83697a Merge pull request #7035 from gojimmypi/PR-Espressif-wolfcrypt
Espressif wolfcrypt updates
2023-12-08 09:07:46 -07:00
ae9632b14a Merge pull request #7025 from bandi13/universalScriptSimplify
Massively simplify apple-universal script
2023-12-08 09:03:30 -07:00
6c7b47e003 Store ssl->options.dtlsStateful when exporting DTLS session 2023-12-08 15:35:34 +01:00
21381b939b Retry memcached tests 3 times on error 2023-12-08 13:53:08 +01:00
17c663b257 Espressif README files 2023-12-07 16:21:50 -08:00
434526c345 Expand WOLFSSL_NO_CRL_DATE_CHECK to the process cert CRL next date check. Fix typo for DEBUG_CRYPTOCB. Add comments for wc_ValidateDate arguments. Improve linker script example for FIPS to put stdlib before FIPS and not force KEEP. 2023-12-07 14:45:16 -08:00
c4b77adf48 Merge pull request #7007 from night1rider/ardunio-wolfssl
Ardunio Fixes relating to internal Intel Galileo Tests
2023-12-07 14:48:58 -07:00
6c8bf7be55 Merge pull request #6963 from julek-wolfssl/dynamic-certs-n-ciphers
Add API to choose dynamic certs based on client ciphers/sigalgs
2023-12-08 07:45:36 +10:00
61b0efce4f Merge pull request #7039 from embhorn/zd17127
Check for neg size in fp_read_unsigned_bin
2023-12-08 07:44:09 +10:00
5e5286d30d Merge branch 'master' of https://github.com/wolfSSL/wolfssl into PR-Expressif-Benchmark 2023-12-07 13:26:20 -08:00
27e93276de Check for neg size in fp_read_unsigned_bin 2023-12-07 14:26:12 -06:00
9fda21748a for clients only 2023-12-07 14:05:33 -05:00
5caa71ec6a Merge pull request #7038 from SparkiDev/heapmath_mp_add_d
Heapmath mp_add_d: fix for when a and c same pointer
2023-12-07 10:04:13 -07:00
9d0bb4c2bf Merge pull request #7040 from dgarske/win_vs
Fixes for building wolfSSL in Visual Studio
2023-12-07 10:02:33 -07:00
3c5b402740 Make sure to send SCSV when application sets ciphersuites 2023-12-07 11:53:55 -05:00
fbe79d7317 Code review 2023-12-07 11:13:16 +01:00
803b17a8b3 src/ssl_crypto.c: in wolfSSL_CMAC_CTX_free(), gate wc_CmacFree() on !FIPS || FIPS>=5.3. 2023-12-06 23:04:52 -06:00
106e39bd76 tests/api.c: in test_wc_CmacFinal(), don't use wc_CmacFinalNoFree() if FIPS <5.3. 2023-12-06 21:58:55 -06:00
931ac4e568 add documentation for wc_AesXtsInit(), wc_AesXtsSetKeyNoInit(), wc_CmacFinalNoFree(), and wc_CmacFree();
rename wc_AesXtsSetKey_NoInit() to wc_AesXtsSetKeyNoInit() for morphological consistency;

refactor wc_AesXtsSetKey() to call wc_AesXtsSetKeyNoInit() and clean up on failure;

readability tweak in wolfSSL_EVP_CipherFinal().
2023-12-06 19:26:46 -06:00
b14aba48af wolfcrypt/src/cmac.c: add wc_CmacFree(), revert wc_CmacFinal(), rename wc_CmacFinal() as wc_CmacFinalNoFree() removing its deallocation clauses, and add new wc_CmacFinal() that calls wc_CmacFinalNoFree() then calls wc_CmacFree() unconditionally, for compatibility with legacy client code (some of which may have previously leaked).
tests/api.c: modify test_wc_CmacFinal() to use wc_CmacFinalNoFree() except for the final call.

wolfcrypt/src/aes.c:
* fix wc_AesEaxEncryptAuth() and wc_AesEaxDecryptAuth() to call wc_AesEaxFree() only if wc_AesEaxInit() succeeded.
* fix wc_AesEaxInit() to free all resources on failure.
* revert wc_AesEaxEncryptFinal() and wc_AesEaxDecryptFinal() changes, then change wc_CmacFinal() calls in them to wc_CmacFinalNoFree() calls.
* wc_AesEaxFree(): add wc_CmacFree() calls.
2023-12-06 16:55:57 -06:00
c6d6100136 Merge pull request #7010 from julek-wolfssl/dtls13-0.5-rtt
dtls13: Add support for 0.5-RTT data
2023-12-07 08:41:42 +10:00
0ffb586030 Merge pull request #7032 from SparkiDev/sp_int_neg_mont_red
SP int neg sp_mont_red_ex: disallow negative numbers
2023-12-06 15:04:46 -07:00
226c631feb Heapmath mp_add_d: fix for when a and c same pointer
When parameters a and c to mp_add_d are the same pointer, c->sign was
being set to zero/positive and then a->sign was being checked.
Set the c->sign at end as it will always be zero/positive through the
code and the sign of the result isn't otherwise used.
2023-12-07 07:51:43 +10:00
0ff02e59ba Fixes relating to issues with internal testing with the Intel Galileo,
along with updating the file structure construction for the library.
2023-12-06 14:38:32 -07:00
f3a9d4a56e Espressif Benchmark ESP-IDF 4.4 fixes 2023-12-06 13:23:14 -08:00
db14914951 Fixes for building wolfSSL in Visual Studio. Adds missing files. Fix for type cast warnings. 2023-12-06 13:20:27 -08:00
4bd78e5e31 Espressif benchmark update 2023-12-06 12:43:42 -08:00
7de5710a75 Espressif error not warning for legacy macros 2023-12-06 11:01:51 -08:00
ca1eba0919 Espressif wolfcrypt updates 2023-12-06 10:05:31 -08:00
2c9208b0c6 Merge pull request #6765 from kojo1/zd16462
Eliminate bad record mac alert
2023-12-06 09:15:41 -07:00
cf8a6efaa5 SP int neg sp_mont_red_ex: disallow negative numbers
Don't support negative a or m with sp_mont_red_ex().
2023-12-06 08:59:54 +10:00
689a82a622 fix AES-related code, in both crypto and TLS layers, for various uninitialized data and resource leak defects around wc_AesInit() and wc_AesFree():
* followup to https://github.com/wolfSSL/wolfssl/pull/7009 "20231128-misc-fixes" and  https://github.com/wolfSSL/wolfssl/pull/7011 "Add missing wc_AesInit calls."

* adds WC_DEBUG_CIPHER_LIFECYCLE, which embeds asserts in low-level AES implementations for proper usage of wc_AesInit() and wc_AesFree().

* fixes native CMAC, AES-EAX, and AES-XTS implementations to assure resource release.

* adds missing wc_AesXtsInit() API, and adds a new wc_AesXtsSetKey_NoInit().

* fixes misspellings in EVP that unconditionally gated out AES-OFB and AES-XTS.

* fixes misspellings in EVP that unconditionally gated out AES-CBC and AES-CFB code in wolfSSL_EVP_CIPHER_CTX_cleanup_cipher().

* openssl compat AES low level cipher API has no counterpart to wc_AesFree(), so these compat APIs will now be gated out in configurations where they would otherwise leak memory or file descriptors (WOLFSSL_AFALG, WOLFSSL_DEVCRYPTO, WOLF_CRYPTO_CB, etc.).  A new macro, WC_AESFREE_IS_MANDATORY, is defined in wolfcrypt/aes.h to streamline this dependency.

* fixes 40 missing EVP_CIPHER_CTX_cleanup()s and 11 wc_AesFree()s in src/ssl.c, src/ssl_crypto.c, tests/api.c, and wolfcrypt/test/test.c.
2023-12-05 15:58:09 -06:00
7753e3db8a Merge pull request #6844 from gojimmypi/Espressif-client-server-example
Espressif ESP32 Benchmark, Test, TLS 1.3 Client & Server Updates
2023-12-05 14:20:02 -07:00
223d8c9a10 Merge pull request #7004 from julek-wolfssl/zd/17033
x509 AIA: store the first OCSP and CA Issuer URI's
2023-12-05 14:08:43 -07:00
fb77319758 Espressif examples: polish & misc updates 2023-12-05 10:36:05 -08:00
4c85a5a146 Merge pull request #7028 from ejohnstown/ocsp-err-ret
OCSP Error Return
2023-12-05 11:00:51 -07:00
b92aa59bd8 Merge pull request #6692 from JacobBarthelmeh/tls13
fix setting ssl error with TLS 1.3 connect socket errors
2023-12-05 09:15:29 -08:00
ce2c256544 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into Espressif-client-server-example 2023-12-05 08:02:31 -08:00
1857648d7d Merge pull request #6976 from embhorn/gh6974
Fix build errors with dtls1.3 and no tls1.2
2023-12-04 14:53:35 -07:00
52658c51a9 OCSP Error Return
1. In CheckOcspResponse(), remove the existing check for UNKNOWN
   certificate status. Given the values of ret and ocsp->error, unknown
   won't get checked.
2. Separated checks for UKNOWN and REJECTED for logging purposes. Return
   that as an error.
3. Anything else should be a failure.
2023-12-04 11:31:04 -08:00
ef536f541f fix setting ssh error with TLS 1.3 connect socket errors 2023-12-04 09:09:09 -07:00
195c14ccaf Merge pull request #6919 from JacobBarthelmeh/cert_dates
add self-sm2-cert.pem to certificate regen script
2023-12-04 09:05:37 +10:00
5297cc74b4 Merge pull request #7016 from anhu/aes_init_docs
Add missing references to wc_AesInit in the API docs.
2023-12-01 16:59:49 -07:00
adcc21b538 Merge pull request #6997 from cconlon/jniAlwaysVerifyCb
Update --enable-jni with WOLFSSL_ALWAYS_VERIFY_CB
2023-12-01 16:58:08 -07:00
3ad0e1ef72 Merge pull request #7021 from res0nance/arm64-aes-gcm-clobber
AES GCM ARM64: Fix clobber lists
2023-12-01 16:52:14 -07:00
c4ab1e6d47 Merge pull request #7017 from SparkiDev/asn_tmpl_ecc_raw_to_sig_fix
ASN template: StoreECC_DSA_Sig_Bin
2023-12-01 16:11:15 -07:00
fa0362fd2b Merge pull request #7022 from julek-wolfssl/faster-memcached-tests
Parallelised memcached tests
2023-12-01 16:05:17 -07:00
44d52c599c Merge pull request #7023 from SparkiDev/test_dsa_fix
Test DSA: fix unused variables
2023-12-01 15:53:08 -07:00
883d1a25be add WOLFSSL_ALWAYS_VERIFY_CB to --enable-jni, used with JSSE X509ExtendedTrustManager hostname verification 2023-12-01 09:23:10 -07:00
822405a6d8 Massively simplify apple-universal script 2023-12-01 09:44:43 -05:00
02f8735abf Test DSA: fix unused variables
test.c: fix #if protection around unused variables
2023-12-01 11:04:53 +10:00
abab390dd4 Merge pull request #7015 from lealem47/zd17088
Reworking MinGW mutex/threading
2023-11-30 17:00:19 -07:00
a1e74d9974 Merge pull request #7014 from SparkiDev/ssl_free_tlsx_fixup
SSL_free, TLSX_Remove calls: fix #if protection
2023-11-30 16:56:46 -07:00
8097ed74c3 Merge pull request #7012 from philljj/spelling_cleanup
Used codespell and fixed obvious typos.
2023-12-01 07:24:21 +10:00
cfa1b589c6 minor fix again 2023-11-30 15:26:42 -05:00
e6bd8dce6e Minor fix. 2023-11-30 15:18:47 -05:00
9265142369 Used codespell and fixed obvious typos. 2023-11-30 13:09:55 -06:00
cbe8309b3b Merge pull request #7013 from SparkiDev/asm_arm_clobber_cc
ARM asm: add "cc" to all clobber lists
2023-11-30 11:05:03 -07:00
a7e5c6c721 Merge pull request #7011 from philljj/add_missing_aesinit
Add missing wc_AesInit calls.
2023-11-30 11:01:02 -07:00
cc65c3ec98 Merge pull request #7009 from douzzer/20231128-misc-fixes
20231128-misc-fixes
2023-11-30 10:59:42 -07:00
cb381a2336 src/tls.c: fix misspelling in TLSX_KeyShare_ProcessPqc(). 2023-11-30 10:12:17 -06:00
52d6073c9c Parallelised memcached tests 2023-11-30 16:02:13 +01:00
21f662c7d1 ASN template: StoreECC_DSA_Sig_Bin
Strip leading zeros from R and S before encoding in ASN.1.
2023-11-30 20:31:29 +10:00
14ba944f6c AES GCM ARM64: Fix clobber lists 2023-11-30 12:33:42 +08:00
44db4f3e5a wolfssl/wolfcrypt/settings.h: add needed (void)s for unused args to several XMALLOC/XFREE/XREALLOC macros that were missing them. 2023-11-29 18:34:47 -06:00
8c1ab783a1 Add missing wc_AesInit calls: small cleanup. 2023-11-29 18:02:45 -06:00
ad1f709455 Add missing references to wc_AesInit in the API docs. 2023-11-29 18:47:26 -05:00
e1ac56f2dd Reworking MINGW mutex/threading 2023-11-29 16:45:06 -07:00
7ebad05446 SSL_free, TLSX_Remove calls: fix #if protection
TLSX_Remove calls added to FreeHanshakeResources() for when TLSX_FreeAll
can't be called but TLSX still being used.
Fix #if protection to compile in TLSX_Remove calls when available.
2023-11-30 09:27:29 +10:00
6125e595bb Merge pull request #6989 from dgarske/stm32_bench
Updated STM32L4 (Cortex-M at 80MHz) benchmarks
2023-11-29 16:18:29 -07:00
11e5544032 ARM asm: add "cc" to all clobber lists
Carry flags are more often than not affected by assembly code.
Carry wasn't in any inline assembly clobber list.
Always clobber "cc" to be safe.
2023-11-30 08:40:37 +10:00
e891c721b8 fixup! dtls13: Add support for 0.5-RTT data 2023-11-29 23:22:38 +01:00
3edfcfe162 Jenkins fixes 2023-11-29 23:17:10 +01:00
9337cfbb16 Add wolfSSL_get_sigalg_info 2023-11-29 23:04:19 +01:00
7c2344c389 Add API to get information about ciphersuites 2023-11-29 23:04:19 +01:00
fbd8996949 Add API to choose dynamic certs based on client ciphers/sigalgs 2023-11-29 23:04:19 +01:00
73ca6daf2b wolfssl/wolfcrypt/types.h: add needed (void)s for unused args to several XMALLOC/XFREE/XREALLOC macros that were missing them.
src/quic.c: fix misspelled DYNAMIC_TYPE_TMP_BUFFER.
2023-11-29 16:02:39 -06:00
3158e04863 Add missing wc_AesInit calls. 2023-11-29 12:54:28 -06:00
93ab397c56 wolfcrypt/test/test.c: fix memory leak in dsa_test(). 2023-11-29 12:28:39 -06:00
a7dce98797 Don't touch processReply state in DoApplicationData 2023-11-29 19:11:49 +01:00
962bf88c9d wolfcrypt/src/ecc.c: add missing semicolon in SAVE_VECTOR_REGISTERS() args. 2023-11-29 11:59:35 -06:00
c87339e5c3 dtls13: Add support for 0.5-RTT data 2023-11-29 15:55:59 +01:00
4642077146 src/ssl.c: remove frivolous (void)heap to clear -Wdeclaration-after-statement.
wolfcrypt/src/aes.c: add NEED_AES_TABLES gate around AesSetKey_C() implementations (fixes WOLFSSL_KCAPI_AES builds, probably among others).

wolfcrypt/src/sp_int.c: add missing casts to clear -Wconversions.
2023-11-28 23:25:31 -06:00
12ee732fe2 Merge pull request #6981 from douzzer/20231102-vector-register-dynamic-fallback-aes
20231102-vector-register-dynamic-fallback-aes
2023-11-28 13:15:02 -07:00
61a2d2de3d Merge pull request #6955 from SparkiDev/rsa_dec_inv_blind_mul_mont
RSA private exponentiation: multiply blinding invert in Mont
2023-11-28 11:08:57 -07:00
a111c5b27f Merge pull request #6993 from SparkiDev/thumb2_iar_no_inline_fix_2
SP Thumb2: make function no-inline
2023-11-28 10:47:58 -07:00
373fc537f1 Merge pull request #7003 from SparkiDev/ssl_make_x25519_key_temp
SSL: make temp X25519/X448 key failure
2023-11-28 10:46:51 -07:00
0ac27eb039 Merge pull request #7005 from SparkiDev/memusage_fix_5
Memory usage fixes: nonce type and TLSX extension free
2023-11-28 10:42:04 -07:00
09d2ba8bc8 Memory usage fixes: nonce type and TLSX extension free
Nonce ciphers other than AES. Free uses DYNAMIC_TYPE_CIPHER.
AES allocation must use DYNAMIC_TYPE_CIPHER too.

If not all TLSX extensions can be freed, then free the ones that can.
Update TLSX_free() to have a message for each case.
2023-11-28 12:56:06 +10:00
4b74a2f006 Updated STM32L4 (Cortex-M at 80MHz) benchmarks with v5.6.4 using the new ARM ASM speedups. 2023-11-27 15:48:32 -08:00
602bd3b506 Merge pull request #6996 from SparkiDev/armv8_aes_gcm_init_stream_iv
ARMv8 AES-GCM streaming: check size of IV before storing
2023-11-27 09:39:46 -07:00
36015e9131 Merge pull request #6998 from SparkiDev/tls_pad_no_hash_raw_fix
TLS_hmac: when no raw hash, make sure maxSz is not neg
2023-11-27 09:37:57 -07:00
9f06d337e3 Merge pull request #6992 from SparkiDev/heapmath_addmod_ct
Heap math: mp_add/submod_ct make work when c == d
2023-11-27 09:28:49 -07:00
8ac891d902 x509 AIA: store the first OCSP and CA Issuer URI's
Solves ZD17033
2023-11-27 14:47:36 +01:00
f65f8be176 SSL: make temp X25519/X448 key failure
On failure to make the temporary X25519/X448 key, free it as the type is
stored in eccTempKeyPresent which also indicates a valid key is present.
Otherwise on SSL free, it will default to freeing the key with ECC APIs.
2023-11-27 08:50:22 +10:00
008d4958bf Merge pull request #7001 from dgarske/testnb
Fix for TLS v1.3 in non-blocking loosing return code from `SendBuffered`
2023-11-24 12:34:57 -07:00
09b6974ae9 Fix for TLS v1.3 in non-blocking loosing return code from SendBuffered. Example: SendBuffered returns WANT_WRITE (-327) and sets ssl->error, then below it was doing ssl->error = ret where ret = 0. 2023-11-24 09:30:09 -08:00
d83a5a955c SP Thumb2: make function no-inline
Lost changes that make function not inlined.
2023-11-24 15:38:11 +10:00
bc36202087 TLS_hmac: when no raw hash, make sure maxSz is not neg
When padding byte is invalid, the maxSz can be negative.
Make maxSz 0 in this case so that blocks doesn't get very large and
cause delays.
2023-11-23 09:51:44 +10:00
2e89e46c0b Merge pull request #6990 from gojimmypi/PR-Espressif-C3-C6-S2-HW
Espressif ESP32-C3 ESP32-C6 ESP32-S2 Hardware Acceleration
2023-11-22 16:21:41 -07:00
5b3f5496f8 Merge pull request #6430 from kareem-wolfssl/memcached
Add memcached support.
2023-11-22 16:20:28 -07:00
98e8ee65dd remove stray Espressif include.am entry 2023-11-22 15:10:09 -08:00
967a0c9625 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into Espressif-client-server-example 2023-11-22 15:04:15 -08:00
7036c8440b Merge pull request #6995 from gojimmypi/PR-var-init
Initialize variables to appease Espressif compiler
2023-11-22 15:54:40 -07:00
b242b44b2c ARMv8 AES-GCM streaming: check size of IV before storing
Only store IV in Init function if it will fit in reg field of Aes
object.
2023-11-23 08:01:20 +10:00
14e8ffcc18 remove locality from self-sm2-cert.pem 2023-11-22 14:30:27 -07:00
416ce54276 Heap math: mp_add/submod_ct make work when c == d
mp_addmod_ct and mp_submod_ct expected c and d to be different pointers.
Change code to support this use case.
Fix whitespace.
2023-11-23 07:28:55 +10:00
2da88115a6 Upstream merge + resolve conflict. 2023-11-22 13:17:14 -08:00
e197d5f8a3 add self-sm2-cert.pem to certificate regen script 2023-11-22 14:14:07 -07:00
6c41a6a374 Initialize variables to appease Espressif compiler 2023-11-22 13:02:51 -08:00
5b01270205 Update all Expressif examples, ready for PR #6990 2023-11-22 12:37:15 -08:00
0306d07c47 Merge pull request #6994 from embhorn/gh6988
Fix spelling warnings
2023-11-22 13:29:51 -07:00
e175410b00 memcached: Revert wolfSSL_in_connect_init changes 2023-11-22 11:55:16 -07:00
7223b5a708 Fix spelling warnings 2023-11-22 12:34:56 -06:00
2f920b5cc4 Merge pull request #6892 from embhorn/gh6890
Add error reporting to loadX509orX509REQFromBuffer
2023-11-22 11:18:45 -07:00
9810a8cd86 Merge pull request #6991 from lealem47/gh6983
Option to enable DTLS-SRTP in CMake
2023-11-22 11:09:30 -07:00
72cbd9a44e memcached: Code review feedback 2023-11-21 17:59:55 -07:00
9227020f8e code review updates for ESP32 C3/C6/S2 HW Acceleration 2023-11-21 16:22:49 -08:00
dda72dc19c Merge pull request #6979 from SparkiDev/sp_arm64_noinline
SP ARM64 P-256: mark functions as SP_NOINLINE
2023-11-21 09:48:08 -07:00
60909d5cba Merge pull request #6971 from SparkiDev/iar_thumb2_asm
IAR Thumb2 ASM: fixes
2023-11-21 09:46:31 -07:00
ebbeb6c69e Merge pull request #6984 from res0nance/pqc-crash-fix
tls: return immediately if kyber_id2type() fails
2023-11-21 09:35:22 -07:00
7e69030df1 Espressif ESP32-C3 ESP32-C6 ESP32-S2 Hardware Acceleration 2023-11-20 18:05:18 -08:00
9ac3083e5d Thumb2 ASM fixes
Make a separate AES for IAR that has AES_encrypt_block and
AES_decrypt_block inlined. Default code is relying on compiler to use
specific registers and not modify others.

Improve performance of small SP ASM code for RSA.
2023-11-21 11:58:10 +10:00
e97e1b5847 SP ARM64 P-256: mark functions as SP_NOINLINE
iOS device compilations are inlining functions and causing P-256 to
fail.
Add SP_NOINLINE to key P-256 functions.
Add "cc" to more clobber lists.
2023-11-21 10:43:38 +10:00
846b91ea1b Enable DTLS-SRTP in CMake 2023-11-20 15:58:59 -07:00
665469f02a Merge pull request #6986 from douzzer/20231119-all-cryptonly-opensslextra
20231119-all-cryptonly-opensslextra
2023-11-20 15:29:14 -07:00
538ce14c62 Merge pull request #6953 from SKlimaRA/SKlimaRA/enable-ca-false
Enable encoding CA:FALSE with build flag
2023-11-20 15:03:14 -07:00
14906df3ec Merge pull request #6970 from anhu/AES_with_FREESCALE_MMCAU
Fix build errors when defining FREESCALE_MMCAU
2023-11-20 09:32:49 -08:00
ca61034d22 Add memcached support.
memcached support: add required functions/defines.

Fix running unit test when defining DEBUG_WOLFSSL_VERBOSE without OPENSSL_EXTRA.

Break out session_id_context APIs into separate option WOLFSSL_SESSION_ID_CTX, so they can be used without OPENSSL_EXTRA.

Make wolfSSL_ERR_get_error and wolfSSL_CTX_set_mode available for memcached.

Add --enable-memcached.

Include required defines for memcached.

Revert unit test fix, no longer needed.

Add Github actions test for memcached.  Stop defining DEBUG_WOLFSSL_VERBOSE for memcached.

Add auto retry to writes.

Memcached CI: correct libevent package name.

Memcached CI: Add pkgconfig path for Github CI wolfSSL prefix.

memcached: Fix WOLFSSL_OP_NO_RENEGOTIATION going outside of int bounds, add LD_LIBRARY_PATH for memcached CI test.

memcached CI: Use correct path for wolfSSL

memcached: Add required perl dependency for SSL tests

memcached: Update to 1.6.22

memcached: actually test tls

memcached: Update wolfSSL_SSL_in_before to be side agnostic.
2023-11-20 10:10:34 -07:00
cbb270bc15 Merge pull request #6982 from julek-wolfssl/nginx-1.24.0-tests
Add nginx 1.24.0 testing
2023-11-20 10:08:06 -07:00
7566328610 Implement proper wc_AesSetKeyLocal for NXP/Freescale MMCAU and LTC. This is required for AES CTR and AES Direct. 2023-11-20 08:15:50 -08:00
3fa612f49f Fix build errors when defining FREESCALE_MMCAU 2023-11-20 08:15:45 -08:00
7dedfe08ef cryptonly and linuxkm fixes: fix --enable-all[-crypto] with --enable-opensslextra and --enable-cryptonly (build failures detected by multi-test linuxkm-all-asm-cryptonly-opensslextra-pie after merge of 54f2d56300 and e2bbacd548). 2023-11-19 17:22:46 -06:00
9ed0018954 Merge pull request #6980 from gojimmypi/SM-cipher-type-PR
Fix evp SM cipherType check
2023-11-20 07:22:54 +10:00
98789dc000 tls: return immediately if kyber_id2type() fails
This prevents a crash as ecc_key is not initialized but the
free function is still called.
2023-11-18 15:44:03 +08:00
06dcc114c1 Merge pull request #6868 from lealem47/microsecond
Run benchmarks at microsecond level and record advanced stats
2023-11-17 20:09:07 -05:00
64b98981de Fix for g++ 2023-11-17 16:44:24 -07:00
efa61ade89 wolfcrypt/src/aes.c: add fallthrough no-op definitions for VECTOR_REGISTERS_{PUSH,POP} to cover WOLFSSL_TI_CRYPT || WOLFSSL_ARMASM. 2023-11-17 16:55:40 -06:00
a95a7c7e08 One last missing cast 2023-11-17 13:55:49 -07:00
ca195445a3 Add proper casts 2023-11-17 13:33:34 -07:00
07d6d75d72 Fix for sanitizer finds 2023-11-17 13:28:30 -07:00
347a17f7cf wolfcrypt/src/aes_asm.asm: fix missed _AESNI suffixing. 2023-11-17 10:15:03 -06:00
16dba37ae6 fix wolfSSL_EVP_CIPHER_CTX_ctrl() SM GCM/CCM type 2023-11-17 07:56:56 -08:00
03f3e6c6af Add nginx 1.24.0 testing 2023-11-17 10:48:46 +01:00
a10260ca5f refactor AESNI implementations and *VECTOR_REGISTERS* macros to allow dynamic as-needed fallback to pure C, via WC_AES_C_DYNAMIC_FALLBACK.
wolfssl/wolfcrypt/aes.h: add key_C_fallback[] to struct Aes, and remove comment that "AESNI needs key first, rounds 2nd, not sure why yet" now that AES_128_Key_Expansion_AESNI no longer writes rounds after the expanded key.

wolfcrypt/src/aes.c:
* add _AESNI or _aesni suffixes/infixes to AESNI implementations that were missing them: AES_CBC_encrypt(), AES_CBC_decrypt_by*(), AES_ECB_encrypt(), AES_*_Key_Expansion(), AES_set_encrypt_key(), AES_set_decrypt_key(), AES_GCM_encrypt(), AES_GCM_decrypt(), AES_XTS_encrypt(), and AES_XTS_decrypt().
* move key size check from to start of wc_AesSetKeyLocal().
* refactor pure-C AES setkey and cipher implementations to use aes->key_C_fallback when defined(WC_AES_C_DYNAMIC_FALLBACK).
* refactor wc_AesSetKeyLocal() to set up both AESNI and pure-C expanded keys when defined(WC_AES_C_DYNAMIC_FALLBACK).
* refactor all (haveAESNI && aes->use_aesni) conditions to just (aes->use_aesni).
* add macros VECTOR_REGISTERS_PUSH and VECTOR_REGISTERS_POP, which do nothing but push a brace level when !defined(WC_AES_C_DYNAMIC_FALLBACK), but when defined(WC_AES_C_DYNAMIC_FALLBACK), they call SAVE_VECTOR_REGISTERS2() and on failure, temporarily clear aes->use_aesni and restore at _POP().
* refactor all invocations of SAVE_VECTOR_REGISTERS() and RESTORE_VECTOR_REGISTERS() to VECTOR_REGISTERS_PUSH and VECTOR_REGISTERS_POP, except in wc_AesSetKeyLocal(), wc_AesXtsEncrypt(), and wc_AesXtsDecrypt(), which are refactored to use SAVE_VECTOR_REGISTERS2(), with graceful failure concealment if defined(WC_AES_C_DYNAMIC_FALLBACK).
* orthogonalize cleanup code in wc_AesCbcEncrypt(),  wc_AesCcmEncrypt() and wc_AesCcmDecrypt().
* streamline fallthrough software definitions of wc_AesEncryptDirect() and wc_AesDecryptDirect(), and remove special-casing for defined(WOLFSSL_LINUXKM)&&defined(WOLFSSL_AESNI).

wolfcrypt/src/aes_asm.{S,asm}:
* remove errant "movl $10, 240(%rsi)" from AES_128_Key_Expansion_AESNI.
* add _AESNI suffixes/infixes to implementations that needed them.

wolfcrypt/src/{aes_gcm_asm.{S,asm},aes_xts_asm.S}: regenerate from revisions in scripts#357 -- adds _aesni suffixes to implementations that were missing them.

wolfssl/wolfcrypt/types.h: remove DEBUG_VECTOR_REGISTER_ACCESS macros, and add dummy fallthrough definitions for SAVE_VECTOR_REGISTERS2 and WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL.

wolfssl/wolfcrypt/memory.h: adopt DEBUG_VECTOR_REGISTER_ACCESS code from types.h, and add definitions for WC_DEBUG_VECTOR_REGISTERS_RETVAL_INITVAL and WC_DEBUG_SET_VECTOR_REGISTERS_RETVAL.

linuxkm/linuxkm_wc_port.h: add arch-specific macro definitions for SAVE_VECTOR_REGISTERS2().

wolfcrypt/benchmark/benchmark.c: add missing gates around calls to RESTORE_VECTOR_REGISTERS().

configure.ac:
* cover various interdependencies in enable-all/enable-all-crypto, for better behavior in combination with --disable-aesgcm, --disable-ecc, --disable-ocsp, --disable-hmac, --disable-chacha, --disable-ed25519, and --disable-ed448.
* inhibit aesgcm_stream in enable-all/enable-all-crypto when ENABLED_LINUXKM_DEFAULTS, because it is currently incompatible with WC_AES_C_DYNAMIC_FALLBACK.
* add -DWC_AES_C_DYNAMIC_FALLBACK when ENABLED_LINUXKM_DEFAULTS.
* add 3 new interdependency checks: "ECCSI requires ECC.", "SAKKE requires ECC.", "WOLFSSH requires HMAC."

wolfcrypt/src/asn.c: tweak gating to accommodate defined(NO_RSA) && !defined(HAVE_ECC).

wolfcrypt/src/evp.c: tweak gating to accommodate defined(NO_HMAC).

wolfcrypt/src/logging.c: remove DEBUG_VECTOR_REGISTER_ACCESS code (moved to memory.c).

wolfcrypt/src/memory.c: change #include of settings.h to types.h; adopt DEBUG_VECTOR_REGISTER_ACCESS code from logging.c; add implementation of SAVE_VECTOR_REGISTERS2_fuzzer().

wolfcrypt/src/pwdbased.c: add explanatory #error scrypt requires HMAC.

wolfcrypt/test/test.c:
* add DEBUG_VECTOR_REGISTER_ACCESS clauses to aes_xts_128_test(), aesecb_test(), aesctr_test(), aes_test() CBC section, aes256_test() CBC section, and aesgcm_default_test_helper()
* remove duplicate wc_AesEcbDecrypt() in aesecb_test().
* add gating for pbkdf2_test().
* fix cleanup code in dsa_test().
* fix gating in pkcs7authenveloped_run_vectors() to accommodate !defined(HAVE_AESGCM).
* fix gating in cryptocb_test() to accommodate defined(NO_HMAC).

wolfssl/wolfcrypt/cryptocb.h: remove gates around "pk" sub-struct of struct wc_CryptoInfo -- wc_CryptoInfo.pk.type (an int) is used unconditionally when --enable-debug, and is used with DH.

wolfssl/wolfcrypt/error-crypt.h: fix whitespace.
2023-11-17 01:15:28 -06:00
d3448e2c1a RSA private exponentiation: multiply blinding invert in Mont
When blinding, multiply result of exponentiation my blinding invert in
Montgomery form to make code more constant time.
2023-11-17 15:19:51 +10:00
e395aad84b Merge pull request #6958 from embhorn/zd16866
Add XGMTIME validation
2023-11-16 21:28:27 -05:00
957a0ce300 Merge pull request #6964 from lealem47/zd16470
Parse explicit parameters in StoreEccKey()
2023-11-16 15:59:21 -07:00
4c6c2942b1 Fix evp SM cipherType 2023-11-16 13:38:39 -08:00
6945093221 Merge pull request #6935 from SparkiDev/ssl_crypto_extract
ssl.c: Move out crypto compat APIs
2023-11-16 11:58:14 -07:00
8e05b5a9ab Merge pull request #6975 from lealem47/gh6969
Add STM32H725 to default_conf.ftl
2023-11-15 21:15:36 -08:00
8c61b2cc5f IAR Thumb2 ASM: fixes
Don't assign constants to registers with IAR.
Don't assume register usage in AES_set_encrypt_key.
2023-11-16 11:14:43 +10:00
bb73c233fc Merge pull request #6973 from douzzer/20231115-misc-fixits
20231115-misc-fixits
2023-11-15 15:27:25 -07:00
3576db8976 Merge pull request #6977 from JacobBarthelmeh/cmake
add wolfcrypt test and unit test to ctest
2023-11-15 14:47:49 -07:00
9fa5d8872c Merge pull request #6948 from SparkiDev/ecc_curve_koblitz
ECC double point: SECP112R2 and SEC128R2 are Koblitz curves
2023-11-15 14:23:42 -07:00
263973bde9 src/wolfio.c: fix stack allocations for cookie digests on NO_SHA builds;
configure.ac: fix dependencies for enable_dsa vs enable_sha in enable-all, enable-all-crypto, and ENABLED_DSA setup.
2023-11-15 14:43:23 -06:00
ada085390b add wolfcrypt test and unit test to ctest 2023-11-15 10:38:49 -07:00
cd1e9e9974 Add STM32H725 to default_conf.ftl 2023-11-15 10:30:01 -07:00
2c7248492f Rename macro 2023-11-15 10:27:24 -07:00
ac89c90afd Add RESET_MULTI_VALUE_STATS_VARS macro 2023-11-15 10:26:03 -07:00
7bbeadcf97 Fix build errors with dtls1.3 and no tls1.2 2023-11-15 10:37:09 -06:00
7daac20d24 Merge pull request #6952 from julek-wolfssl/dtls13-pqc-tests
Add dtls 1.3 PQC suites tests
2023-11-15 09:34:36 -07:00
eaa66dc117 configure.ac: in enable-all, enable QUIC only if !ENABLED_LINUXKM_DEFAULTS, and enable aesgcm_stream only if enable_aesgcm. 2023-11-15 01:47:46 -06:00
748b058dde wolfcrypt/src/aes.c: fix for -Wrestrict in wc_AesCbcDecrypt() when WOLFSSL_AESNI. 2023-11-15 00:51:21 -06:00
26a9435f5c ECC point double: when z ordinate is 0 point is infinity
Recognize z == 0 as infinity in result of double.
2023-11-15 16:43:06 +10:00
7569cfdff8 src/internal.c,src/wolfio.c: fallback to SHA256 when NO_SHA, in LoadCertByIssuer(), MicriumGenerateCookie(), uIPGenerateCookie(), and GNRC_GenerateCookie();
tests/api.c: when NO_SHA, omit test_wolfSSL_CertManagerCheckOCSPResponse() and test_wolfSSL_CheckOCSPResponse() (both use static artifacts with SHA1 name and key hashes).
2023-11-15 00:09:22 -06:00
6a3451ca54 wolfcrypt/test/test.c: add WC_MAYBE_UNUSED attribute to declaration of max_relative_stack, to accommodate compilation settings when subsumed within testsuite. 2023-11-15 00:09:22 -06:00
7e99ccc782 wolfcrypt/src/wc_port.c, wolfssl/wolfcrypt/wc_port.h: refactor WOLFSSL_GMTIME gmtime() into gmtime_r(), and always define HAVE_GMTIME_R when defined(WOLFSSL_GMTIME). 2023-11-15 00:09:22 -06:00
2213306386 ECC double point: SECP112R2 and SEC128R2 are Koblitz curves
SECP112r2 and SECP128R2 are Koblitz curves, so don't compile them in
unless HAVE_ECC_KOBLITZ is defined. This requires custom curves which
enables point doubling to support A != -3.
2023-11-15 13:30:45 +10:00
8f7adb2c16 Merge pull request #6967 from SparkiDev/aes_gcm_aarch64_hw_crypto
AES GCM ARM64: Replace hardware crypto assembly with generated code
2023-11-14 13:55:43 -07:00
c4677927bc AES GCM ARM64: Replace hardware crypto assembly with generated code
Optimized assembly of AES GCM for ARM64 using hardware crypto
instructions.
Code replaced between "START..." and "END...".
2023-11-14 09:24:05 +10:00
b464a277c1 Refactor logic to remove MAX_SAMPLE_RUNS 2023-11-13 13:40:07 -07:00
1b55e20d5a Merge pull request #6966 from SparkiDev/aes_bitsliced_armasm_fix
AES bitsliced, ARMASM: config needs WOLFSSL_AES_DIRECT defined
2023-11-13 10:09:08 -07:00
7eaff41e61 AES bitsliced, ARMASM: config needs WOLFSSL_AES_DIRECT defined
AES bitsliced needs WOLFSSL_AES_DIRECT defined when compiling for ARMASM
as there are different APIs used.
2023-11-13 07:40:40 +10:00
7c24b2d4bd Merge pull request #6965 from ejohnstown/uint128-cmake
uint128 and CMake
2023-11-10 20:57:46 -08:00
c903a8c4a6 Merge pull request #6854 from SparkiDev/aes_bit_sliced
AES bitsliced implementation added
2023-11-10 17:10:19 -07:00
a04eb81e95 Merge pull request #6959 from SparkiDev/sp_c_rsa_pub_e_64bits
SP C: support e up to 64-bits
2023-11-10 16:33:12 -07:00
12878fccae Merge pull request #6957 from lealem47/expandDistro
Add --enable-quic to --enable-all
2023-11-10 15:32:05 -08:00
d34d77681a uint128 and CMake
1. Add to the check for HAVE___UINT128_T adding it to the list of items
   that get dumped into the options.h file.
2023-11-10 14:59:41 -08:00
04ea4da6fd Parse explicit parameters in StoreEccKey() 2023-11-10 15:11:08 -07:00
63c27219a8 Merge pull request #6962 from julek-wolfssl/dtls13-no-hrr-docs
Add info on how to use WOLFSSL_DTLS13_NO_HRR_ON_RESUME
2023-11-10 14:26:46 -07:00
b8d5ac83eb Add info on how to use WOLFSSL_DTLS13_NO_HRR_ON_RESUME 2023-11-10 10:43:26 +01:00
3ab0fc1ba4 SP C: support e up to 64-bits
SP C code only supported one digit worth of e which is less than 64 or
32.
Change is to support up to 64 bit of e using sp_uint64 to hold value.
2023-11-10 09:58:51 +10:00
a4bf774e1c Add XGMTIME validation 2023-11-09 16:06:37 -06:00
e2bbacd548 Add QUIC to --enable-all 2023-11-09 14:44:02 -07:00
49a219e0d1 Merge pull request #6930 from Frauschi/zephyr_fix
Fixes for the Zephyr port
2023-11-09 12:56:34 -07:00
73d3277b74 Merge pull request #6947 from SparkiDev/sp_arm64_mont_red_4_fix
SP ARM64 asm: fix Montgomery reduction by 4
2023-11-09 08:39:52 -07:00
a666c39b65 zephyr 3.5 github action 2023-11-09 10:41:54 +01:00
081b34919c Zephyr: improve order of random seed sources
When using Zephyr, we also want to use the proper wc_GenerateSeed
method. However, if one of the defines is set (e.g., NO_STM32_RNG), the
Zephyr option is ignored, although it would work. Hence, we have to
change the order in which these settings for the source of a random seed
are evaluated.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-11-09 10:41:54 +01:00
182eaa0b63 Zephyr: add support for RTC time
For ASN date validation, the actual wall clock time is needed from an
RTC. This commit adds support to read the RTC time in case it is
available in the Zephyr system. If the RTC is not available or an error
occurs during the readout, we fallback to the old implementation which
only supports relative time since boot.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-11-09 10:41:54 +01:00
4d8bbd7091 Zephyr: fix POSIX time include
The sys/time.h header causes redefinition errors regarding the fd_set
type and the select call inside socket_select.h. We want to include the
regular time.h header anyway, as done in random.c.

Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>

tmp
2023-11-09 10:41:54 +01:00
9d880fe161 Zephyr: Fix deprecation warning for rand32.h
Signed-off-by: Tobias Frauenschläger <t.frauenschlaeger@me.com>
2023-11-09 10:41:54 +01:00
308346aa0d one less memcpy 2023-11-09 09:40:58 +01:00
2b1c61a013 Merge pull request #6949 from bigbrett/zd16925
fix WOLFSSL_CALLBACK memory error
2023-11-08 23:35:32 -07:00
3332b036d5 Merge pull request #6950 from SparkiDev/srtp_kdf_fix
SRTP KDF: Don't use i outside loop
2023-11-08 23:13:40 -07:00
04c1e94e29 Merge pull request #6954 from SparkiDev/sp_cortexm_iar_branch_long
SP Cortex-M: branch long explicitly for IAR
2023-11-08 23:01:45 -07:00
68b6bc87c7 Merge pull request #6916 from philljj/add_EXTENDED_KEY_USAGE_free
Add EXTENDED_KEY_USAGE_free to OpenSSL compat layer.
2023-11-08 22:07:40 -07:00
168747615c SP Cortex-M: branch long explicitly for IAR
GCC doesn't like explicit wide branch instruction but will use
appropriate instruction implicitly.
IAR won't widen branch instruction unless explicitly told.
2023-11-09 08:27:42 +10:00
be24d68e5d Add EXTENDED_KEY_USAGE_free to OpenSSL compat layer. 2023-11-08 15:26:24 -06:00
138d699cc7 Apply changes to new srtp-kdf code 2023-11-08 11:09:00 -07:00
c0f3fe4434 Benchmarks: use clock_gettime() for ns resolution 2023-11-08 10:45:51 -07:00
2cde843093 Measure max & min durations within the confines of MAX_SAMPLE_RUNS 2023-11-08 10:45:51 -07:00
1303c0512c Extract some code blocks into macros 2023-11-08 10:45:51 -07:00
46a5465c3f Remove redundant macro 2023-11-08 10:45:51 -07:00
16ecc9b5f8 Address feedback and don't print avg ms if mean is displayed 2023-11-08 10:45:51 -07:00
86a2b050fe Gate on NO_FILESYSTEM 2023-11-08 10:45:50 -07:00
a40de50be2 Add ADVANCED_STATS in benchmark.c 2023-11-08 10:45:50 -07:00
9006dd5edd Document new macro 2023-11-08 10:45:50 -07:00
2ea0c2cae8 Run benchmarks at microsecond level 2023-11-08 10:45:50 -07:00
a137847894 removed isCaSet from decoded cert 2023-11-08 12:24:29 +01:00
1562106899 micro fix 2023-11-08 11:18:58 +01:00
76d89a0c15 unused variable 2023-11-08 11:09:05 +01:00
f518a8f7d5 new build flag WOLFSSL_ALLOW_ENCODING_CA_FALSE 2023-11-08 10:51:25 +01:00
54f2d56300 ssl.c: Move out crypto compat APIs
ssl_crypto.c contains OpenSSL compatibility APIS for:
 - MD4, MD5, SHA/SHA-1, SHA2, SHA3
 - HMAC, CMAC
 - DES, DES3, AES, RC4
API implementations reworked.
Tests added for coverage.
TODOs for future enhancements.
2023-11-08 19:43:18 +10:00
8bc79a0b43 Add dtls 1.3 PQC suites tests 2023-11-08 10:29:35 +01:00
4bbb0e3876 drafted ca false 2023-11-08 10:23:46 +01:00
944c7e175b cmake: add WOLFSSL_X86_64_BUILD_ASM option 2023-11-08 09:18:07 +01:00
fca2f14f48 cmake: guard installation with WOLFSSL_INSTALL option 2023-11-08 09:18:07 +01:00
7adddc5fb8 cmake/functions: do not try to build x86_64 assembler on non-AMD64 platforms 2023-11-08 09:18:07 +01:00
703cfded28 cmake: introduce WOLFSSL_X86_64_BUILD variable 2023-11-08 09:18:06 +01:00
716cb450aa SRTP KDF: Don't use i outside loop
When shifting index down, first XOR outside loop isn't meant to use i.
2023-11-08 15:04:46 +10:00
1a3f3aa5f0 Merge pull request #6951 from douzzer/20231107-unit-test-regenerate-ocsp-reply
20231107-unit-test-regenerate-ocsp-reply
2023-11-07 20:09:32 -07:00
9cb6243357 wolfcrypt/test/test.c: add all initializers in wolfcrypt_test_main() for args for C++ legality (C-style initializer added in e58fafcf3d). 2023-11-07 19:33:18 -06:00
ca694938fd tests/api.c: update response vector in test_wolfSSL_CertManagerCheckOCSPResponse(), reflecting regenerated keys in certs/ocsp/. 2023-11-07 19:25:52 -06:00
0fa47e9e28 Merge pull request #6943 from SparkiDev/iar_inline_asm_no_register
Thumb2 inline ASM: IAR doesn't do register variables
2023-11-07 14:23:44 -08:00
b6e5b36f35 Merge pull request #6946 from dgarske/nooldtls_v1.1
Turn off old TLS v1.1 by default
2023-11-07 13:30:03 -07:00
ba37dc9933 Fixes bug where example server with WOLFSSL_CALLBACKS hangs when used with
-6 option (simulated WANT_WRITE errors) or with DTLS, causing make check
to fail
2023-11-07 11:44:20 -07:00
a46b6221b4 Turn off old TLS v1.1 by default (unless SSL v3.0 or TLS v1.0 enabled). 2023-11-07 09:23:59 -08:00
d751029c07 Merge pull request #6945 from gojimmypi/PR-goto-alternate
introduce WARNING_OUT, when goto is not a hard error during tests
2023-11-07 10:17:53 -07:00
8921a720a1 Merge pull request #6888 from SparkiDev/srtp_kdf
SRTP/SRTCP KDF: add implementation
2023-11-07 10:11:43 -07:00
a6de9cd06f Merge pull request #6942 from SparkiDev/sp_int_sqr_volatile
SP int: ARM64 optimization issue
2023-11-07 10:09:25 -07:00
e58fafcf3d introduce WARNING_OUT, optional WOLFSSL_ESPIDF_ERROR_PAUSE 2023-11-07 08:52:34 +01:00
cefe108cab Thumb2 inline ASM: IAR doesn't do register variables
IAR doesn't parse register variable declarations with specified
registers. IAR doesn't even honor the register keyword.
Can use small negative but IAR doesn't like it.
Specify the positive value instead.
Add a small code size version of mont_reduce_full using umlal and umaal.
Make 'asm' usage in variables use keyword '__asm__'.
Explicitly don't inline some functions when compiling with IAR.
2023-11-07 16:12:07 +10:00
01c3345c7a SP ARM64 asm: fix Montgomery reduction by 4
Handle add overflow properly in generic Montgomery reduction for 4
words. Used when reducing back to order of P-256 curve.
2023-11-07 11:39:03 +10:00
8c3e1dbf48 SRTP/SRTCP KDF: add implementation
Add implementation of SRTP KDF and SRTCP KDF.
One shot APIs compatible with SP 800-135 and ACVP testing.
Tests added to test.c.
Benchmarking added.
Doxygen added.
2023-11-07 10:33:14 +10:00
c852347dfb Merge pull request #6877 from gojimmypi/Espressif-cmake-update
Espressif Update wolfSSL component CMakeLists.txt
2023-11-06 13:43:07 -07:00
c5e2f414ea Merge pull request #6929 from julek-wolfssl/dtls13-early-data-server-side
dtls 1.3: allow to skip cookie exchange on resumption
2023-11-06 13:30:21 -07:00
8ac291bbe1 Merge pull request #6944 from miyazakh/fix_qt_jenkins_failure
skip DATE check if flags is set when calling AddTrustedPeer
2023-11-06 11:35:22 -07:00
c92d25816a Merge pull request #6887 from julek-wolfssl/zd/16849
Implement untrusted certs in wolfSSL_X509_STORE_CTX_init
2023-11-06 10:13:43 -07:00
8569e76a87 Merge pull request #6915 from bigbrett/typo-fix-DecodeBasicCAConstraint
fix typo in WOLFSSL_ENTER function name
2023-11-03 13:53:23 -06:00
190b51ae6f Merge pull request #6810 from bandi13/codeSonar_fixes
Fix 'negative character value'
2023-11-03 13:52:06 -06:00
8c87920903 Address code review 2023-11-03 11:02:41 +01:00
5b863dcb12 AES bitsliced implementation added
AES bitsliced implementation that is cache attack safe.
Configure with:
  --enable-aes-bitslice
or define:
  WC_AES_BITSLICE
  HAVE_AES_ECB
  HAVE_AES_DIRECT
Very slow for CBC, CFB, OFB and any mode that uses a previous encrypt
block to calculate current.
CTR, GCM, XTS can parallelize the data and be much faster.

Added AES-ECB test to test.c.
2023-11-03 14:19:58 +10:00
49121b5c47 move declaration to the top of func 2023-11-03 11:45:33 +09:00
8d9dc3d79f skip DATE if flags is set when calling AddTrustedPeer 2023-11-03 09:38:23 +09:00
b8ea978066 Merge pull request #6941 from douzzer/20231102-examples-asn1-double-fclose
20231102-examples-asn1-double-fclose
2023-11-03 08:50:13 +10:00
cfb6560468 SP int: ARM64 optimization issue
Make variables volatile to avoid compiler optimization issues.
2023-11-03 08:08:29 +10:00
c8af4edd74 Merge pull request #6940 from bandi13/takeInConstParameters
Can guarantee not to modify arguments of `mp_isodd` and `mp_iszero`
2023-11-02 15:45:51 -06:00
d6f37d48d6 examples/asn1/asn1.c: remove now-redundant fclose(fp) in asn1App_ReadFile() (which also was incorrectly closing stdin). see #6905. 2023-11-02 16:14:40 -05:00
49b9764c52 Can guarantee not to modify arguments of mp_isodd and mp_iszero 2023-11-02 16:00:57 -04:00
8fc754515a Merge pull request #6938 from SparkiDev/rsa_pss_salt_len_openssl_compat_fix
RSA PSS OpenSSL compatibility verification: support AUTO
2023-11-02 09:07:40 -07:00
96977d1480 Merge pull request #6900 from julek-wolfssl/zd/16868
EVP_EncodeBlock should not append a newline
2023-11-02 09:20:39 -06:00
4870435604 RSA PSS OpenSSL compatibility verification: support AUTO
When wolfSSL_RSA_verify_PKCS1_PSS() called with RSA_PSS_SALTLEN_AUTO
(RSA_PSS_SALTLEN_MAX_SIGN) it wasn't using RSA_PSS_SALT_LEN_DISCOVER
when available.
2023-11-02 11:24:18 +10:00
2ee94023f9 Merge pull request #6937 from dgarske/stm32wl
Support for the STM32WL55 and PKA improvements for ECC parameters
2023-11-01 17:44:22 -06:00
0dde07e282 Whitespace cleanups (appease multi-test "check-source-text"). 2023-11-01 15:03:12 -07:00
33e12e3537 Support for the STM32WL55 and PKA improvements for ECC parameters. Fixes #6386 and Fixes #6396. 2023-11-01 13:55:31 -07:00
9e34ed937e Merge pull request #6927 from dgarske/crl_no_date
Add build option for disabling CRL date check
2023-11-01 14:48:28 -06:00
21f34ef028 Merge pull request #6905 from bandi13/moreCodeSonarFixes
Don't nag about leaked resources
2023-11-01 14:46:02 -06:00
9d632ccaa6 apply lateRL offset to memcpy dest, not src 2023-11-01 14:32:11 -06:00
15fdf6eccc Merge pull request #6910 from bigbrett/ios-ca-api
exercise --sys-ca-certs optionin external.test
2023-11-01 14:09:24 -06:00
bb9031da6e Remove dead code 2023-11-01 13:30:40 -04:00
c920337f2f Merge pull request #6891 from julek-wolfssl/zd/16849-i2d_x509
Advance pointer in wolfSSL_i2d_X509
2023-11-01 11:02:44 -06:00
026c4bcbc7 Merge pull request #6902 from dgarske/various_20231020
Fixes for PKCS w/out RSA and Cert/CSR signing with unknown OID
2023-11-01 10:58:10 -06:00
a3ea84d8e8 Merge pull request #6917 from SparkiDev/sp_int_no_sp_digit
SP int: don't use sp_digit as the type is sp_int_digit
2023-11-01 10:57:07 -06:00
98843798c2 Merge pull request #6934 from SparkiDev/regression_fixes_8
Regression test fixes
2023-11-01 10:55:41 -06:00
59e947d3e6 Merge pull request #6936 from philljj/codespell_cleanup
Used codespell and fixed obvious typos.
2023-11-01 10:39:04 -06:00
34f349e510 Used codespell and fixed obvious typos. 2023-11-01 10:35:12 -05:00
0eab70f806 Regression test fixes
Fixes for different configurations and memory allocation failure
testing.
2023-11-01 14:10:49 +10:00
2e37ff4e45 SP int: don't use sp_digit as the type is sp_int_digit
Stop casting to the wrong type. SP int code use sp_int_digit and
sp_digit can be a different signedness.
2023-11-01 13:38:23 +10:00
7435d235a6 Merge pull request #6931 from dgarske/async_v5.6.4
Async v5.6.4
2023-10-31 14:52:13 -06:00
2ac0d47908 Fix for async edge case with Intel QuickAssist/Cavium Nitrox that was broken in PR #6783. Was causing re-entry and multiple calls for some operations like DH KeyGen that don't advance state on completion. https://github.com/wolfSSL/wolfAsyncCrypt/pull/71 2023-10-31 12:43:12 -07:00
aed715cb2c dtls 1.3: allow to skip cookie exchange on resumption
tls 1.3: do cookie exchange when asked too even when found a matching cipher
2023-10-31 14:29:04 +01:00
0455224439 Fix build errors in API unit test without IO dependencies. 2023-10-30 17:04:36 -07:00
cdef51f537 Add build option for disabling CRL date check (WOLFSSL_NO_CRL_DATE_CHECK). ZD 16675 2023-10-30 15:45:33 -07:00
37884f864d Merge pull request #6926 from JacobBarthelmeh/release
prepare for release 5.6.4
2023-10-30 08:28:37 -07:00
6cf75a7d42 prepare for release 5.6.4 2023-10-30 07:59:00 -06:00
2c91ecb466 Merge pull request #6924 from JacobBarthelmeh/srtp
sanity check on length before ato16 with SRTP
2023-10-28 16:13:06 -07:00
07c8c5c8ca sanity check on length before ato16 with SRTP 2023-10-28 16:13:45 -06:00
cc45b31470 Merge pull request #6922 from JacobBarthelmeh/coverity
clean up some coverity reports
2023-10-27 18:40:02 -07:00
c3ed45d331 additional case for CID 330392 and 330401 2023-10-27 16:34:04 -06:00
688b94cad2 fix typo and missing brackets 2023-10-27 16:11:18 -06:00
7d5491994e Fix for CID 299649 checking on if ctx is null 2023-10-27 15:28:42 -06:00
29782449ec Fix for CID 299637 make sure after free'ing pointer it is not re-used 2023-10-27 15:14:02 -06:00
247bc151d9 Fix for CID 299627 memory leak on error case 2023-10-27 15:10:32 -06:00
0ba406a52c Fix for CID 299536 possible null dereference 2023-10-27 15:02:10 -06:00
a2032dfb36 touch up negative value sanity check, fix CID 210741 sanity check 2023-10-27 14:50:13 -06:00
33c4054cbb Fix for CID 299748 memory leak in error case 2023-10-27 14:36:51 -06:00
ef50cb3f02 Fix for CID 299759 be explicit on compare 2023-10-27 14:33:33 -06:00
271fa83a15 Fix for CID 299778 memory leak on error case 2023-10-27 14:28:47 -06:00
8760ad9473 Fix for CID 299847 memory leak on error case 2023-10-27 14:17:31 -06:00
7b20a5597c Fix for CID 330399 memory leak on error case 2023-10-27 14:11:21 -06:00
c11176c276 Fixes CID 330401 and 330392 memory leak 2023-10-27 14:04:46 -06:00
42c241dbbf Avoid use of uninitialized array 2023-10-27 15:38:46 -04:00
8add411d9a fix for CID 330412 wrong sizeof argument 2023-10-27 13:35:08 -06:00
2877b7be50 Fix possible memory leak 2023-10-27 15:31:28 -04:00
21d465cf9a Fix possible double free 2023-10-27 15:31:28 -04:00
f8f080d7de Don't nag about leaked resources 2023-10-27 15:31:28 -04:00
16b842992d fix for CID 330416 memory leak 2023-10-27 13:27:30 -06:00
449fb9c581 Fix for report CID 330424 wrong sizeof argument 2023-10-27 13:20:50 -06:00
1dd6888288 Merge pull request #6920 from embhorn/zd16909
Fix mem leak in TLSX_CA_Names_Parse
2023-10-27 10:45:54 -06:00
6b0e28f840 Fix mem leak in TLSX_CA_Names_Parse 2023-10-27 07:58:50 -05:00
a17d6ef751 Merge pull request #6918 from JacobBarthelmeh/readme
remove packaging status badge
2023-10-26 16:19:06 -07:00
85fab2b4f7 remove packaging status badge 2023-10-26 15:15:36 -07:00
5277065c3c fix typo in WOLFSSL_ENTER function name 2023-10-26 13:01:05 -06:00
45ba778692 Merge pull request #6911 from douzzer/20231025-sp_to_unsigned_bin_len_ct-Wconversion-cast
20231025-sp_to_unsigned_bin_len_ct-Wconversion-cast
2023-10-26 10:33:50 -06:00
7821c48e65 wolfcrypt/src/sp_int.c: add cast in sp_to_unsigned_bin_len_ct() to mollify -Wconversion. 2023-10-25 23:40:21 -05:00
fc858ec33b Merge pull request #6908 from JacobBarthelmeh/static-analysis
minor warning fixes from static analysis tests
2023-10-25 17:28:54 -07:00
89d445a5a5 added --sys-ca-certs client connection to external test 2023-10-25 15:13:08 -06:00
60f75ea5a8 simplified apple header detection used in code 2023-10-25 15:13:06 -06:00
6538ed1c39 coverity fix for CID 327268 2023-10-25 09:52:35 -06:00
b46545315c fix for possible null dereference warning 2023-10-25 08:44:11 -06:00
d801dc1c85 Merge pull request #6906 from SparkiDev/pkcs8_info_free_fix
ProcessBuffer: fix free call
2023-10-25 08:38:56 -06:00
6d8136c63e Merge pull request #6896 from SparkiDev/rsa_to_bin_len_ct
RSA: convert to bin with length in constant time
2023-10-25 08:34:37 -06:00
d87cd2cc05 ProcessBuffer: fix free call
'info' was freed before use when OPENSSL_EXTRA is defined.
2023-10-25 17:23:04 +10:00
5da7efacc9 Merge pull request #6894 from julek-wolfssl/fix-possible-hang
Fix static analyzer possible leak
2023-10-24 09:13:58 -04:00
a74228b5b0 Merge pull request #6904 from julek-wolfssl/suites-allocation
Don't try to allocate 0 size suites copy. Fixes `--enable-trackmemory --enable-smallstack CFLAGS="-DALT_ECC_SIZE" --enable-opensslextra` errors.
2023-10-24 09:07:42 -04:00
dc5a246fdd Do NULL check in FreeCRL 2023-10-24 10:31:17 +02:00
8f60fb0053 Advance pointer in wolfSSL_i2d_X509 2023-10-24 10:25:06 +02:00
4aad7589d6 Don't try to allocate 0 size suites copy 2023-10-24 10:10:08 +02:00
13cadbbe55 Merge pull request #6903 from douzzer/20231021-fix-null-derefs
20231021-fix-null-derefs
2023-10-24 13:12:09 +10:00
1de048826e Merge pull request #6895 from bigbrett/ios-ca-api
Fix WOLFSSL_SYS_CA_CERTS bug on Apple devices
2023-10-23 07:57:08 -06:00
3c5d3c0fa9 bwrap ocsp renew script 2023-10-23 15:53:42 +02:00
1a113c5429 Espressif add TLS Client/Server local user_settings.h 2023-10-22 16:59:54 +02:00
8eaf09d7a0 Update Espressif TLS Client/Server CMakeLists.txt 2023-10-22 16:53:56 +02:00
9fe071fe73 Espressif remove pre-existing /include/user_settings.h during compile all. 2023-10-22 16:21:06 +02:00
501299bc31 fix null pointer derefs in examples/pem/pem.c:pemApp_ReadFile() and tests/api.c:LoadPKCS7SignedDataCerts() detected by clang-tidy. 2023-10-21 13:34:04 -05:00
cf1dcdf402 Fix for adding signature where OID is not found. Currently our AddSignature function will add without OID, which is invalid. For example RSA is disabled and CSR tries to use CTC_SHA256wRSA. The wc_SignCert_ex will succeed and report success, but the CSR/Cert will be invalid (missing sigType OID). 2023-10-20 16:29:59 -07:00
6887281361 Fix for ./configure --enable-pkcs7 --disable-rsa && make check. 2023-10-20 16:27:54 -07:00
9db828a099 Merge pull request #6898 from SparkiDev/ed25519_g++
Ed25519: add missing C++ directives for C functions
2023-10-20 15:52:12 -06:00
5018d6c2bb Merge pull request #6897 from SparkiDev/tls13_psk_one_id_var_decl
TLS 1.3: compiling with WOLFSSL_PSK_ONE_ID fix
2023-10-20 15:48:59 -06:00
ca2a6d7daa Merge pull request #6878 from SparkiDev/sha256_armv7a_vmov_fix
ARMv7a SHA256: explicit size on vmov
2023-10-20 15:46:58 -06:00
2387579880 added FIPS warning for Apple native cert validation 2023-10-20 15:40:49 -06:00
dd12e5a39e Fix WOLFSSL_SYS_CA_CERTS bug that accepted intermediate CA certs with invalid
signatures. Also adds --sys-ca-certs to client in unit.test to detect
regressions
2023-10-20 15:40:44 -06:00
0925f8ab18 Use 'unsigned char' 2023-10-20 16:16:48 -04:00
ec0a2f2683 Fix 'negative character value'
In a number of libc implementations, isalpha()/isalnum() is implemented using lookup tables (arrays): passing in a negative value can result in a read underrun.
2023-10-20 16:16:48 -04:00
8cd6cd175d EVP_EncodeBlock should not append a newline 2023-10-20 13:20:11 +02:00
fcf1406675 RSA: convert to bin with length in constant time
Add mp_to_unsigned_bin_len_ct() which puts a number into a buffer with
padding in constant time.
Call mp_to_unsigned_bin_len_ct() in RSA when encoding result of
exponentiation.
2023-10-20 14:04:36 +10:00
c88dcac80e Ed25519: add missing C++ directives for C functions
Assembly code has C function names.
Need to tell C++ that these are C function and not to mangle names.
2023-10-20 12:02:51 +10:00
ce1e44d5e8 TLS 1.3: compiling with WOLFSSL_PSK_ONE_ID fix
Move use of 'suites' into non-WOLFSSL_PSK_ONE_ID path as variable
declared and used only in that case.
2023-10-20 10:32:45 +10:00
4ac795961b ARMv7a SHA256: explicit size on vmov
For SHA256 using NEON on ARM32, change vmov instruction that is moving
from scalar to general-purpose register to have explicit size (32 bits).
May be needed by some compilers.
2023-10-20 10:21:57 +10:00
1abaa94120 Merge pull request #6889 from SparkiDev/sm2_priv_import_range
ECC SM2 import private key: check less than order-1
2023-10-19 17:12:07 -06:00
22be42a161 Merge pull request #6885 from bigbrett/aes-eax
Move AesEax definition to aes.h
2023-10-19 16:49:10 -06:00
d13d446c2e Add missing guard 2023-10-19 20:05:59 +02:00
2ccbdd3a7e Log correct message 2023-10-19 19:07:45 +02:00
cecc5f6b19 Call wc_UnLockRwLock only once 2023-10-19 17:04:41 +02:00
8a8acbd55f Add log about allocation failure 2023-10-19 17:00:49 +02:00
2dd8e713f2 Fix static analyzer possible leak
crl would never be null there but clean up code to make sure newcrl->crlLock gets free'd
2023-10-19 16:58:28 +02:00
962e35aa24 Add error reporting to loadX509orX509REQFromBuffer 2023-10-19 09:31:30 -05:00
abd7bb3ac3 ECC SM2 import private key: check less than order-1
SM2 curves must have private key less than order-1 instead of order.
2023-10-19 17:29:25 +10:00
1ae248018f Implement untrusted certs in wolfSSL_X509_STORE_CTX_init 2023-10-18 22:24:19 +02:00
a3bf7a66a4 Merge pull request #6886 from julek-wolfssl/openvpn-master-fix
Define SSL_get_peer_tmp_key
2023-10-18 13:17:15 -06:00
22ab21749c Merge pull request #6869 from bigbrett/ios-ca-api
Add support for new Apple trust APIs with WOLFSSL_SYS_CA_CERTS
2023-10-18 10:29:41 -07:00
f99c7cbb21 Define SSL_get_peer_tmp_key 2023-10-18 19:24:11 +02:00
269090353e Merge pull request #6884 from kareem-wolfssl/zd16824
Add explicit break to switch statement in GetHmacLength
2023-10-18 11:20:55 -06:00
b4724b515d Merge pull request #6880 from SparkiDev/sm2_named_group_val_fix
SM2 named curve disabled: value outside of supported values
2023-10-18 10:51:02 -06:00
d805e06469 add AesEax struct to header for public use 2023-10-18 09:23:39 -06:00
1e84d24c20 SM2 named curve disabled: value outside of supported values
SM2 named curve value is specified in specification.
Values 0-14 aren't used, so, those bits in disabledCurves are used for
values over 31.
Add range checks.
2023-10-18 10:51:37 +10:00
3943852b79 Merge pull request #6882 from douzzer/20231017-wolfsentry-wolfssl_test-h
20231017-wolfsentry-wolfssl_test-h
2023-10-17 16:03:41 -06:00
bc0643803d Merge pull request #6873 from JacobBarthelmeh/coverity
Coverity scan touch up
2023-10-17 14:44:33 -07:00
19870b2378 Merge pull request #6883 from bigbrett/cmake-aarch64-build-macro-fix
cmake aarch64 fix
2023-10-17 15:31:23 -06:00
f59b22d3a0 Add explicit break to switch statement in GetHmacLength 2023-10-17 14:14:05 -07:00
4f1b3fff73 Merge pull request #6879 from jpbland1/cmac-invalid-devId
correctly set invalid devId for when cryptoCb is on
2023-10-17 13:23:17 -06:00
a1d76849e6 added CMake support for new Apple native certificate verification 2023-10-17 13:17:42 -06:00
dc7e044157 Merge pull request #6881 from lealem47/mingw_pthreads
Fix for pthreads on MSYS2 & MINGW
2023-10-17 13:10:05 -06:00
e976a7faeb added CMake host processor check to appropriately set WOLFSSL_AARCH64_BUILD on M1 macs 2023-10-17 12:51:36 -06:00
f0db681550 wolfssl/test.h: move wolfsentry logic out of wolfssl project and into header file in wolfsentry project. 2023-10-17 13:05:23 -05:00
a810514f86 Get multi-test passing 2023-10-17 11:36:19 -06:00
76b770d4ee update comment based on PR advise 2023-10-17 13:01:00 -04:00
286d551ad0 Use same mingw macro in codebase for consistency 2023-10-17 10:22:17 -06:00
603b5bb573 Merge pull request #6875 from douzzer/20231016-sp-math-fix-redux
20231016-sp-math-fix-redux
2023-10-17 10:08:43 -06:00
5bc2edd5ad Allow override of XSNPRINTF for Windows 2023-10-17 09:37:50 -06:00
b73a440205 Fix for pthreads on MSYS2 & MINGW 2023-10-17 09:16:41 -06:00
92382602dd fix bad placement 2023-10-17 01:39:34 -04:00
53d80c0b7f correctly set invalid devId for when cryptoCb is on
but the user has opted to use software, or cmac is not available on for their
device. currently a devId of 0 is set which causes CRYPTOCB_UNAVAILABLE
2023-10-17 01:33:06 -04:00
f5d1cb5132 Update wolfSSL component CMakeLists.txt 2023-10-17 02:09:26 +02:00
f1725b4962 fix to 3e9f8bc649: (void)h was a typo for correct (void)n. 2023-10-16 18:23:45 -05:00
b7b0316ac9 free buffer on error case 2023-10-16 15:04:57 -06:00
0244c2a254 Add support for new Apple trust APIs with WOLFSSL_SYS_CA_CERTS 2023-10-16 14:37:21 -06:00
ae3fdbec47 add free in error case CID 327286 2023-10-16 13:59:05 -06:00
74b63b6409 fix for derefernce warning on debug message 2023-10-16 13:52:42 -06:00
8be0e14bd2 add unlock in error case CID 327294 2023-10-16 13:46:18 -06:00
bab01ca313 Merge pull request #6872 from douzzer/20231016-sp-math-aes-eax-fips-fixes
20231016-sp-math-aes-eax-fips-fixes
2023-10-16 13:43:26 -06:00
99d46d9a6d fix for derefernce warning CID 327296 & CID 327298 2023-10-16 13:36:24 -06:00
3c23f39437 fix for out of bounds edge case CID 327299 2023-10-16 13:34:05 -06:00
ed001829df Fix for dereference CID 327300 & CID 327301 2023-10-16 13:33:15 -06:00
3e9f8bc649 tests/api.c: gate test_wc_AesEaxVectors(), test_wc_AesEaxEncryptAuth(), and test_wc_AesEaxDecryptAuth(), on !FIPS || FIPS>=5.3.
wolfcrypt/src/eccsi.c: remove incorrect `(void)h` from eccsi_mulmod_base_add() in newly exposed WOLFSSL_SP_MATH code path.
2023-10-16 13:30:16 -05:00
d35112064b Merge pull request #6840 from philljj/xmss_hooks_support
Add XMSS/XMSSMT wolfCrypt hooks.
2023-10-16 10:58:12 -06:00
46b1a030a7 XMSS/XMSSMT hooks support: fix g++ warnings, and small cleanup for review. 2023-10-13 18:01:07 -05:00
c23559a91c Merge pull request #6866 from bigbrett/aes-eax
Add more extensive AES EAX tests to api.c
2023-10-13 16:09:30 -06:00
7afd9810de Merge pull request #6867 from cconlon/jniConfigExpand
Update "--enable-jni" to include additional defines
2023-10-13 15:13:32 -06:00
87cffc8229 Added more extensive AES EAX tests to api.c 2023-10-13 11:38:16 -06:00
79a6e1eb04 Merge pull request #6808 from SparkiDev/sp_sm2
SP updates for SM2
2023-10-13 10:17:17 -06:00
8cd89884ce update --enable-jni with KEEP_PEER_CERT, WOLFSSL_ALT_CERT_CHAINS, WOLFSSL_KEY_GEN 2023-10-13 10:07:04 -06:00
f247e6b6f0 Merge pull request #6865 from per-allansson/wolfio-getaddrinfo-hints-a
wolfio: request only IPv4 addresses unless IPv6 support is enabled
2023-10-13 09:53:38 -06:00
95137f91fa Merge pull request #6856 from dgarske/fips_win32
Fixes for wolfCrypt FIPS DLL win32
2023-10-13 09:49:26 -06:00
dd1459ec8e Merge pull request #6859 from julek-wolfssl/curl-releases
Test curl releases
2023-10-13 08:57:11 -06:00
4001734421 Merge pull request #6863 from lealem47/xcode_cyassl
Remove cyaSSL from XCODE proj and small fix in chacha.c
2023-10-13 08:54:11 -06:00
5f20f1171d wolfio: request only IPv4 addresses unless IPv6 support is enabled 2023-10-13 15:25:16 +02:00
962c315447 Test curl releases too 2023-10-13 11:52:02 +02:00
26cc785fbc Merge pull request #6861 from douzzer/20231012-keylog-export-warning-fix
20231012-keylog-export-warning-fix
2023-10-12 17:04:39 -06:00
0cc21a42f3 SP updates for SM2
Allow wolfSSL to build with SP implementations of SM2.
Updates to SP implementation of other code.
2023-10-13 08:14:15 +10:00
38df4e2bd5 Merge pull request #6857 from kareem-wolfssl/zd16815
Update documentation for wc_Shake256_Final to match function signature.
2023-10-12 15:08:58 -06:00
26ab3b109a Merge pull request #6858 from anhu/FASCN_OID
Support FASCN OID in wolfssl_dns_entry_othername_to_gn()
2023-10-12 14:47:09 -06:00
883fcfc11e Merge pull request #6860 from douzzer/20231012-aes-xts-fixes
20231012-aes-xts-fixes
2023-10-12 14:41:17 -06:00
0d53796284 Apply the same changes to FIPS project 2023-10-12 14:07:32 -06:00
20cab7afe3 Remove cyaSSL from XCODE proj and small fix in chacha.c 2023-10-12 13:58:43 -06:00
c05aea7c5a Improvements to the wolfCrypt FIPS Visual Studio project link settings to resolve ASLR (Randomized Base Address) issue on some platforms. ZD 16615 2023-10-12 12:05:14 -07:00
3cebf35b1b Cleanups for IDE/WIN10 user_settings.h to allow for FIPS 140-2 3389 cert. Fixed compiler warning with possible use of uninitialized data. 2023-10-12 12:04:51 -07:00
0549dba3db configure.ac and src/tls.c: fix --enable-keylog-export to warn at configure time, then build cleanly. 2023-10-12 13:09:43 -05:00
3a195563f7 wolfcrypt/src/aes.c: fix zerodivcond and -Wconversion in wc_AesXtsEncryptConsecutiveSectors() and wc_AesXtsDecryptConsecutiveSectors().
wolfcrypt/test/test.c: add missing FIPS gating around AES-XTS testing.
2023-10-12 12:08:16 -05:00
60fea5ee5c XMSS/XMSSMT hooks support: small update for requested changes. 2023-10-11 21:29:45 -05:00
f332995131 Support FASCN OID in wolfssl_dns_entry_othername_to_gn() 2023-10-11 20:33:13 -04:00
66f4101569 Update documentation for wc_Shake256_Final to match function signature. 2023-10-11 16:12:34 -07:00
0e35e9cbbe Merge pull request #6806 from lealem47/XTS
Add XTS API's required for VeraCrypt
2023-10-11 13:35:45 -06:00
653e5b01b1 Merge pull request #6646 from embhorn/gh5636_5637
Fix RFC references and add WOLFSSL_ALLOW_CRIT_AIA
2023-10-11 13:30:42 -06:00
e7eec645b0 Sanity checks and correct comment 2023-10-11 12:03:02 -06:00
f0bfcc50d7 Merge pull request #6748 from julek-wolfssl/dtls13-frag-ch2
DTLS 1.3: allow fragmenting the second ClientHello message
2023-10-11 11:13:57 -06:00
5e4baf898c Merge pull request #6786 from SparkiDev/aes_gcm_align_arm_fix
AES GCM ARM32 alignment fix
2023-10-11 10:18:11 -06:00
7f562f8259 Merge pull request #6851 from miyazakh/rnd_gen_updates_rx
Update random generation on RX TSIP
2023-10-11 09:10:34 -06:00
a4f9ae90d0 Merge pull request #6845 from kojo1/jp-doc
fix jp doc translations
2023-10-11 07:00:16 +09:00
f8604da8e3 change to use a cutom random generation func for PRNG 2023-10-11 06:50:26 +09:00
a27b49882d Add XTS API's required for VeraCrypt 2023-10-10 15:09:35 -06:00
ca73a311cf Don't use /dev/null 2023-10-10 17:31:45 +02:00
5372cd5026 Update openwrt script 2023-10-10 17:08:58 +02:00
210fff5569 Merge pull request #6849 from miyazakh/rnd_gen_updates
Update random generation on RZ RSIP
2023-10-10 08:52:22 -06:00
53f14206d1 Increase curl timeout 2023-10-10 14:36:00 +02:00
cb912219e4 Run only stable curl tests 2023-10-10 14:19:03 +02:00
365fae8ac0 Add curl test dep 2023-10-10 11:37:48 +02:00
f32c6a0d25 XMSS/XMSSMT hooks support: fix build. 2023-10-09 10:13:32 -05:00
d83f2fa126 Merge pull request #6850 from douzzer/20231008-Wconversion-and-Aes-Eax-FIPS-fixes
20231008-Wconversion-and-Aes-Eax-FIPS-fixes
2023-10-09 09:06:17 -06:00
64ed7d57eb Add comment 2023-10-09 12:54:11 +02:00
275c0a0838 Update window in one place only when stateful 2023-10-09 12:54:11 +02:00
8ac72750bc Fix linting issues 2023-10-09 12:54:11 +02:00
948d7ae761 keyLog_callback: flush the descriptor to make sure it is written out 2023-10-09 12:54:11 +02:00
c1a49fef99 Fix unreachable code error 2023-10-09 12:54:11 +02:00
bec87e525f PQC TLS 1.3: test setting pqc with wolfSSL_CTX_set_groups 2023-10-09 12:54:11 +02:00
3a881079d3 Fix async 2023-10-09 12:54:11 +02:00
2c6c52078a test_dtls13_frag_ch_pq: make sure kyber5 is used 2023-10-09 12:54:11 +02:00
37c0d52fa8 Dump manual memio stream with WOLFSSL_DUMP_MEMIO_STREAM 2023-10-09 12:54:11 +02:00
c802193119 Simplify the pqc keyshare handling 2023-10-09 12:54:11 +02:00
0dbf97c867 fixup! Clear the keyshare instead of storing it 2023-10-09 12:54:11 +02:00
230f81712c fixup! Clear the keyshare instead of storing it 2023-10-09 12:54:11 +02:00
f640fdf91f Adding a post-quantum DTLS 1.3 test.
This exercises the fragmenting of ClientHello via large post-quantum key share.

./configure --enable-dtls-mtu --enable-dtls-frag-ch --enable-dtls \
            --enable-dtls13 --with-liboqs
2023-10-09 12:54:11 +02:00
ada785e115 Address code review 2023-10-09 12:54:11 +02:00
8da863184c Force DTLS 1.3 when accepting fragmented CH 2023-10-09 12:54:11 +02:00
df8ee69075 Clear the keyshare instead of storing it 2023-10-09 12:54:11 +02:00
85a596e54a DTLS 1.3: allow fragmenting the second ClientHello message
- DTLS 1.3 pqc support
- Add --enable-dtls-frag-ch option to enable CH fragmenting
- Send an alert when we get an empty keyshare with a cookie present to not allow for multiple HRR in one connection
- Only update the DTLS window when we have successfully processed or stored a message
- Call ssl->chGoodCb as soon as we have processed a verified full or fragmented ClientHello cookie
2023-10-09 12:54:11 +02:00
61371d403a minor fixes for AES-EAX implementation and test routines. 2023-10-08 18:02:52 -05:00
832e0f3726 Merge pull request #6842 from kaleb-himes/fix-err-introduce-with-cm-move
Fix -4 return code when expected BAD_FUNC_ARG(-173)
2023-10-09 07:04:24 +10:00
8d5df6fec2 change to use custom random generation func 2023-10-08 16:42:36 +09:00
c082216661 Merge pull request #6836 from anhu/iar_ewarm_gitignore
Changes to what gets ignored by git for the IAR-EWARM IDE
2023-10-06 20:57:25 -06:00
5cb80ea898 Merge pull request #6847 from embhorn/zd16767
Fix wolfSSL_set_verify_result to use correct value
2023-10-06 16:52:32 -06:00
b329c0d5f4 Fix wolfSSL_set_verify_result to use correct value 2023-10-06 16:34:31 -05:00
52a9730f56 Changes to gitignore for IAR-EWARM IDE. 2023-10-06 17:02:22 -04:00
fd2d098566 Merge pull request #6821 from bigbrett/aes-eax
AES EAX mode
2023-10-06 14:14:28 -06:00
fafb9e81c0 Add support for AES EAX mode, as described in https://eprint.iacr.org/2003/069 2023-10-06 11:10:06 -06:00
a7950a3739 Merge pull request #6846 from SparkiDev/aes_xts_arm_hw_crypto
Aarch64 and ARM32 AES XTS with crypto instructions
2023-10-06 09:58:38 -06:00
a24d66939f Merge pull request #6843 from embhorn/gh6760_take2
Fix RNG with writedup
2023-10-06 09:11:33 -06:00
862a98abe0 Aarch64 and ARM32 AES XTS with crypto instructions
Optimised assembly of AES-XTS for Aarch64 and ARM32 using hardware
crypto instructions.
Aarch64 has loop unrolling.
Update aes.c to not have AES-XTS implementation when assembly
compilable.
Update test of AES-XTS to check expected cipher text of partial block
encryption.
2023-10-06 12:39:31 +10:00
5fdc3d8dd5 fix jp doc translations 2023-10-06 09:16:41 +09:00
97b6b00226 Merge branch 'master' of https://github.com/wolfssl/wolfssl 2023-10-06 09:15:10 +09:00
e51399ca0f Do the success checkout out front 2023-10-05 17:05:36 -06:00
5a5a8c9b47 Merge pull request #6841 from julek-wolfssl/fix-all-scr
Fixes for bugs exposed with SCR
2023-10-05 16:55:01 -06:00
c26ad8d19a Merge pull request #6828 from SparkiDev/mp_sqrtmod_prime_cust_curve
mp_sqrtmod_prime: bail early on the check for small values
2023-10-05 16:32:01 -06:00
22b838c22b Merge pull request #6799 from kojo1/no_malloc
fix NO_MALLOC guard in an error case
2023-10-05 16:23:54 -06:00
a494d04f10 Fix RNG with writedup 2023-10-05 16:03:42 -05:00
4bb6c51d2d Fix -4 return code when expected BAD_FUNC_ARG(-173) 2023-10-05 14:20:37 -06:00
2c4556c797 Merge pull request #6835 from julek-wolfssl/no-ossl-defs-in-release
Add option to disable OPENSSL_COMPATIBLE_DEFAULTS
2023-10-05 10:47:50 -06:00
1b4435d134 Merge pull request #6839 from julek-wolfssl/eol-repos
Remove unsupported distros from readme badge
2023-10-05 10:46:49 -06:00
a333e775c7 Merge pull request #6837 from anhu/doc_corr
Minor correction to documentation
2023-10-05 10:46:12 -06:00
6968105984 Merge pull request #6831 from miyazakh/renesas_tsip_fix
fix compile error due to rz port change
2023-10-05 09:43:34 -06:00
858c66de3c Add configs that exposed this bug 2023-10-05 16:58:45 +02:00
89946126f2 Remove dtls_expected_rx and use expected values directly
We should always read MTU + EXTRA so that we capture the entire message and are able to correctly decrypt the entire datagram. A smaller MTU also breaks larger handshake messages sent during a connection like secure renegotiation in DTLS 1.2 (confirmed) and post-handshake messages in DTLS 1.3 (suspected).
2023-10-05 16:58:45 +02:00
80c8c62fb2 Proper initial_ctx clean up
- Call wolfSSL_CTX_free on ssl->initial_ctx so that it decrements the counter and free's the object
- Clean up where ssl->initial_ctx is free'd. It only needs to be free'd when the ssl object is being free'd
2023-10-05 16:58:45 +02:00
33d4b331fb Add XMSS/XMSSMT wolfCrypt hooks. 2023-10-05 09:18:50 -05:00
9abc611550 Update dtls in readme 2023-10-05 13:32:58 +02:00
6b28a68e42 Add DTLS 1.3 to README 2023-10-05 13:26:35 +02:00
c88fec1534 Remove unsupported distros from readme badge 2023-10-05 13:22:34 +02:00
8ce8359bd7 Add option to disable OPENSSL_COMPATIBLE_DEFAULTS 2023-10-05 10:30:44 +02:00
630d75153f Minor correction to documentation 2023-10-04 16:51:55 -04:00
96205fc80d Merge pull request #6820 from julek-wolfssl/zd/16550-int-crl
CRL verify the entire chain including loaded CA's
2023-10-04 14:37:50 -06:00
4d81725438 Merge pull request #6832 from jpbland1/cryptocb-key-context
add devCtx to all keys for use in cryptoCb
2023-10-04 09:34:06 -07:00
94043723c9 Merge pull request #6833 from douzzer/20231003-options-h-flag-order-etc
20231003-options-h-flag-order-etc
2023-10-04 09:01:58 -06:00
45b613ee55 wolfcrypt/test/test.c: fix error codes in hpke_test_single(), hpke_test(), and ecc521_test_deterministic_k(). 2023-10-03 22:44:11 -05:00
71649388a0 configure.ac: in options.h generation, fix order of flags to match Makefile order. 2023-10-03 21:11:59 -05:00
f4acc8f33d add devCtx to all keys for use in cryptoCb 2023-10-03 19:29:36 -04:00
f9fb966bb4 fix compile error due to rz port change 2023-10-04 06:47:12 +09:00
88d25036a0 Merge pull request #6823 from rizlik/stale_suites_fix
fix: tls13: don't use stale suites pointers in CheckPreSharedKeys
2023-10-03 11:41:53 -06:00
7baf151c37 CRL verify the entire chain including loaded CA's
- Regen CRL's as most of them are expired
- certs/crl/extra-crls/ca-int-cert-revoked.pem: CRL that revokes certs/intermediate/ca-int-cert.pem signed by certs/ca-cert.pem
- Add CheckCertCRL_ex API to not depend on DecodedCert
- CheckCertCRLList: accept raw serial or hashed version to work with Signers
- Add XELEM_CNT to simplify pre-proc element counting
2023-10-03 11:45:43 +02:00
e55e6790dd mp_sqrtmod_prime: bail early on the check for small values
When using custom curves, only use the first 22 values with the prime to
calculate Legendre symbol. The known curves work and defeats long running
times when non-prime values are passed in.
2023-10-03 16:48:34 +10:00
5066771f10 Merge pull request #6824 from bandi13/PRB-fips-ready-config-issues
Fix issue created by 62c14e4d5b
2023-10-03 00:47:14 -04:00
1a3bf5e932 Merge pull request #6822 from douzzer/20230930-aes-xts-test-gate
20230930-aes-xts-test-gate
2023-10-02 17:57:17 -06:00
47f0d5a5d0 Fix issue created by 62c14e4d5b 2023-10-02 12:34:33 -04:00
ecf666a121 Merge pull request #6819 from miyazakh/renesas_rz_opt
Update usage of sha acceleration on RSIP
2023-10-02 09:22:06 -06:00
c70b3f297e fix: tls13: don't use stale suites pointers in CheckPreSharedKeys 2023-10-02 15:03:55 +00:00
3e7f4c5f2d wolfcrypt/test/test.c: in aes_xts_128_test(), fix gate on LARGE_XTS_SZ test added in 3ea0fb30dd (disable for AF_ALG and pre-5.3 FIPS). 2023-09-30 12:07:56 -05:00
369db531d2 Merge pull request #6817 from anhu/tls13_server_suppgroups
Allow the server to send supported groups extension in TLS 1.3
2023-09-29 13:53:37 -06:00
7c1cc5e8f9 Allow the server to send supported groups extension in TLS 1.3 2023-09-29 12:42:44 -04:00
8a57936d7e Merge pull request #6801 from julek-wolfssl/zephyr-fixes
Misc zephyr fixes
2023-09-29 09:50:19 -06:00
53f729f959 Merge pull request #6815 from SparkiDev/aes_xts_x64
AES XTS x64 ASM: add AVX1 and AESNI implementations
2023-09-29 09:42:58 -06:00
e092c57675 change sha h/w acceleration implementation 2023-09-29 16:22:16 +09:00
aedebac649 Merge pull request #6818 from bandi13/containerReadme
Container readme
2023-09-28 15:21:23 -06:00
3ea0fb30dd AES XTS x64 ASM: add AVX1 and AESNI implementations
Adding AES-XTS AVX1 and AESNI implementations.
Fix name in comment at top of x64 assembly files.
2023-09-28 14:44:23 -05:00
005346d9ec Fix entrypoint 2023-09-28 14:45:51 -04:00
93358f1402 Define WOLFSSL_DIR 2023-09-28 13:59:04 -04:00
5e1bd8174c Push multi-platform wolfCLU to DockerHub 2023-09-28 13:55:38 -04:00
2ef83e142f Update buildAndPush.sh and README.md 2023-09-28 13:27:07 -04:00
0571040e36 Merge pull request #6816 from bandi13/fixContainers
Fix containers
2023-09-28 10:37:20 -06:00
9fdb3cf17a Appease test scripts 2023-09-28 10:48:03 -04:00
b88754bb64 Add in clang-10 and clang-11 tests 2023-09-28 10:29:36 -04:00
5e3f00f6f7 Specify the OS version
'ubuntu-latest' doesn't have clang-12 in it anymore
2023-09-28 10:29:20 -04:00
0f4f677ea4 Show logs on test failure 2023-09-28 10:17:30 -04:00
20f992af5e Merge pull request #6809 from SparkiDev/static_rsa_len_check_fix
Static RSA length check
2023-09-27 15:09:08 -06:00
d95ce57eea Fix script errors 2023-09-27 15:31:01 -04:00
79a6cbc860 Merge pull request #6813 from anhu/elliptical
Fixup spelling: Elliptic
2023-09-26 17:11:12 -06:00
a97e13f823 Merge pull request #6798 from gojimmypi/autogen-update-wsl-pr
no WSL/Windows git hooks from autogen.sh
2023-09-26 16:59:41 -06:00
9acba6ee2d Static RSA length check
Better length check on decrypted pre-master secret length.
2023-09-27 07:55:53 +10:00
b22c2971e3 Fixup spelling: Elliptic
Fixes https://github.com/wolfSSL/wolfssl/issues/6767
2023-09-26 16:18:02 -04:00
60f30e994d Merge pull request #6811 from gojimmypi/esp32-sha-revert-verbosity
ESP32 debug only: Mode REVERT to ESP32_SHA_SW
2023-09-26 13:34:43 -06:00
f042863ddf Merge pull request #6807 from kareem-wolfssl/zd16715
Prevent current handshake counter from underflowing.
2023-09-26 10:55:52 -06:00
4ece466fca ESP32 debug only: Mode REVERT to ESP32_SHA_SW 2023-09-26 08:32:23 -07:00
237d10ab1e Merge pull request #6803 from gojimmypi/esp32-example-time
ESP32 examples: update interim set_time() fixed value
2023-09-25 13:34:22 -06:00
83117ae33f ESP32 examples: interim set_time() fixed value 2023-09-23 17:16:19 -07:00
df6a65e151 Prevent current handshake counter from underflowing. 2023-09-22 14:47:00 -07:00
f9082c54e3 Merge pull request #6800 from DimitriPapadopoulos/codespell
More typos found by codespell
2023-09-22 14:12:34 -06:00
717249c0cc Trust github.com in container, add in possible Jenkins userIDs 2023-09-22 16:01:54 -04:00
f0d0a87822 Add in working cross-compiler container and builder script 2023-09-22 14:55:30 -04:00
1141f9bee9 Use wolfssl/wolfssl-builder as the container name 2023-09-22 14:55:01 -04:00
470e839b26 Misc zephyr fixes
- Need to call fs_file_t_init() before calling fs_open()
- 0 is a valid POSIX socket number
- Include stdio.h when needed to simplify macro logic
- Define Zephyr specific macros in CMakeLists.txt to make for a better user experience
2023-09-22 12:19:06 +02:00
f7d7006e87 More typos found by codespell 2023-09-22 11:38:24 +02:00
a9548b2f11 fix NO_MALLOC guard in an error case 2023-09-22 10:05:21 +09:00
2fafa722c2 fix NO_MALLOC guard in an error case 2023-09-22 09:13:41 +09:00
d5b6aa318c no WSL/Windows git hooks copy for autogen.sh 2023-09-21 23:31:11 +02:00
9442ec4b06 Merge pull request #6793 from danielinux/no_umaal_for_cortexm
Enforce WOLFSSL_SP_NO_UMAAL with _CORTEX_M_ASM
2023-09-21 22:29:32 +10:00
4b1c29ce0c Merge pull request #6796 from miyazakh/doxygen_j_typo
Fix weird Japanese words in doxygen
2023-09-21 16:59:12 +09:00
88254d3709 fix weird Japanese words 2023-09-21 09:12:22 +09:00
347394cc6b Detect Cortex M3 (no UMAAL) and define WOLFSSL_SP_NO_UMAAL. 2023-09-20 17:10:27 -07:00
16e6a8c150 Merge pull request #6795 from jpbland1/ech-double-free-fix
Fix ECH double free on rejection
2023-09-20 14:25:11 -07:00
bc02006def Merge pull request #6794 from res0nance/fix-memory-type
pqc: fix memory type for shared secret storage server side
2023-09-20 14:24:42 -07:00
f71423d626 set ssl->hsHashesEch to NULL regardless of acceptance
to avoid double free, clean up style violations
2023-09-20 14:51:40 -04:00
f7ca923b4b Merge pull request #6783 from bandi13/more_async_cb
More async cb
2023-09-20 10:16:08 -07:00
9ed19cddfa Need to increment state after the async task completes 2023-09-20 12:23:14 -04:00
e91b6230a8 Merge pull request #6792 from miyazakh/renesas_ra6m4_r
Fix ra6m4 port
2023-09-20 09:10:10 -06:00
0983ea9a80 pqc: fix memory type for shared secret storage server side
This gets copied to preMasterSecret and freed in
TLSX_KeyShare_ProcessPqc with the SECRET type but is allocated
with the TLSX type.
2023-09-20 15:45:26 +08:00
8f9c3716ed fix ra6m4 port 2023-09-20 09:00:22 +09:00
5bc5b8a99b Merge pull request #6768 from miyazakh/renesas_rz
Renesas RZN2L support
2023-09-19 14:38:03 -06:00
1cda8430fd Merge pull request #6709 from embhorn/zd16316
misc.h declarations for user defined functions with NO_INLINE disabled
2023-09-19 11:19:23 -07:00
b72d02dd88 Merge pull request #6742 from embhorn/zd16187_2
Fixes for NO_FILESYSTEM and NO_BIO config
2023-09-19 11:19:07 -07:00
5830f921fa ARIA cipher cmake (#6600)
* ARIA Cipher CMake support
2023-09-19 10:57:02 -07:00
de3c9f19ef Merge pull request #6788 from bandi13/addCCacheDocker
Add CCache to the container to decrease compilation time
2023-09-19 10:39:51 -07:00
da39f66ff0 Remove accidental comment left in. 2023-09-19 13:10:16 -04:00
186d3c2eb4 Fixes to various Async issues 2023-09-19 13:10:16 -04:00
ad9779cdc1 Explicitly define code with WOLFCRYPT_ASYNC_CRYPT_SW 2023-09-19 13:10:16 -04:00
763de1a685 Merge pull request #6790 from bandi13/codesonar
Clean up memory leaks
2023-09-19 09:48:22 -07:00
eca28ea2f6 Merge pull request #6789 from bandi13/renameAsyncEnumPart2
Clean up double enum
2023-09-19 09:08:32 -07:00
ba74c83f73 Merge pull request #6785 from embhorn/gh6760
Fix writedup rng leak
2023-09-19 08:23:41 -07:00
9398fa0736 Espressif HW Improvements (#6624)
* Espressif HW Improvements
* revised AES HW/SW fallback logic for ESP32
2023-09-19 08:21:13 -07:00
2af5ae89a2 Rename enum to protect the innocent
WC_NO_PENDING_E indicates that there really isn't any asynchronous task that is pending.
2023-09-19 10:46:11 -04:00
c12bf79e56 Clean up double enum
This was necessary to have https://github.com/wolfSSL/wolfAsyncCrypt/pull/70 be able to merge
2023-09-19 10:30:04 -04:00
9472dd39e4 Add CCache to the container to decrease compilation time 2023-09-19 10:12:03 -04:00
af6386732c AES GCM ARM32 alignment fix
Don't use xorbufout in GMULT.
Force the table to be aligned.
2023-09-19 09:21:20 +10:00
911c4519ef Fix writedup rng leak 2023-09-18 16:19:22 -05:00
3bb0643cdd Clean up memory leaks 2023-09-18 16:53:48 -04:00
1149522357 Merge pull request #6784 from bandi13/renameAsyncEnum
Allow code to build during rename
2023-09-18 12:41:53 -07:00
164fc8c5cb Allow code to build during rename 2023-09-18 14:47:35 -04:00
1d7c6c94fe Merge pull request #6780 from SparkiDev/sp_x64_uninit
SP x64 ASM: Initialize pointers in RSA functions
2023-09-18 09:49:22 -07:00
623549ce90 Merge pull request #6781 from SparkiDev/sp_arm64_asm_fixup_1
SP ARM64 ASM: fix sp_256_mont_dbl_4
2023-09-18 09:49:06 -07:00
ea8bc82f85 SP ARM64 ASM: fix sp_256_mont_dbl_4
In sp_256_mont_dbl_4, not all used registers were in asm clobber list.
2023-09-18 15:17:39 +10:00
c0edb7b583 SP x64 ASM: Initialize pointers in RSA functions
Windows compiler complains about uninitialized variables in these
functions. Set the pointers to NULL to quiet the compiler.
2023-09-18 14:49:19 +10:00
7735ea0ff3 fix rx build failure 2023-09-16 11:48:49 +09:00
1f2ddb7554 Merge pull request #6778 from danielinux/writeable_pkcs11_tokens
Add compile-time option WOLFSSL_PKCS11_RW_TOKENS
2023-09-15 11:46:03 -06:00
5654691f05 Merge pull request #6775 from kareem-wolfssl/zd16652
Add a build flag ASN_TEMPLATE_SKIP_ISCA_CHECK to optionally skip the isCa != false check.
2023-09-15 11:43:04 -06:00
139fd5d208 Merge pull request #6776 from SparkiDev/sp_ecc_x64
SP ECC: x64 minor speed improvement
2023-09-15 08:23:51 -06:00
ca56b79209 Add compile-time option WOLFSSL_PKCS11_RW_TOKENS
By default, wolfcrypt PKCS11 interface accesses tokens in read-only
mode. In some cases, we might want to build the client with write
permissions, i.e. when initializing tokens via C_InitToken().

The WOLFSSL_PKCS11_RW_TOKENS option, if present, allows write access to
PKCS11 tokens.
2023-09-15 15:18:11 +02:00
5e97b9fde8 addressed review comments 2023-09-15 13:22:35 +09:00
e9f1489997 SP ECC: x64 minor speed improvement
ARM32/Thumb2: for safer code, do two reductions in mont triple after doing double part.
2023-09-15 09:48:32 +10:00
8e40130003 Add a build flag ASN_TEMPLATE_SKIP_ISCA_CHECK to optionally skip the isCa != false check. 2023-09-14 15:44:47 -07:00
7d85e390a9 Merge pull request #6769 from cconlon/pkcs7ContentType
Support PKCS#7 definition for ContentType content ANY
2023-09-14 15:44:35 -06:00
6b6c9f9ae0 Merge pull request #6772 from bandi13/zd16449_more_fixes
Zd16449 more fixes
2023-09-14 09:35:01 -06:00
6bf716bd26 Merge pull request #6743 from JacobBarthelmeh/unit_tests
add test case for ignoring cert path error
2023-09-14 11:04:35 -04:00
f23e2a62e6 Merge pull request #6773 from SparkiDev/sp_arm_arch
SP: WOLFSSL_SP_ARM_ARCH to WOLFSSL_ARM_ARCH
2023-09-14 08:57:02 -06:00
6a25cdeb28 SP: WOLFSSL_SP_ARM_ARCH to WOLFSSL_ARM_ARCH and fix SAKKE on Thumb2/ARM32
WOLFSSL_SP_ARM_ARCH no longer used.
Using WOLFSSL_ARM_ARCH instead.
Change umaal check to only available with WOLFSSL_ARM_ARCH > 6.
SAKKE mont_reduce with umaal not using correct registers at end.
2023-09-14 13:04:49 +10:00
3ae23ec926 Merge pull request #6745 from res0nance/windows-test
ci: run windows test
2023-09-13 16:16:13 -06:00
3697219244 Merge pull request #6747 from res0nance/multi-arch-ci
ci: Add CI for different archs
2023-09-13 16:12:35 -06:00
ba03677569 Merge pull request #6770 from SparkiDev/sp_asm_improvements_1
SP ASM: improve performance
2023-09-13 16:01:03 -06:00
624cb5e2bb Merge pull request #6744 from res0nance/windows-benchmark-config
windows: fix x64 benchmark release builds
2023-09-13 15:52:27 -06:00
f5b96e7bde Merge pull request #6735 from anhu/lteq_0
Propose to convert a less than 0 to less than or equal to 0
2023-09-14 07:08:22 +10:00
3d332a4fad Remove accidental code change 2023-09-13 14:41:21 -04:00
2f63eb070e Fix memory leak if the function is being called again because of a retry 2023-09-13 14:05:57 -04:00
f32f220919 Merge pull request #6752 from SparkiDev/aes_gmult_table_align_32bit
AES GMULT: add table implementation using 32-bit types
2023-09-13 11:38:03 -06:00
ff233ce3af Merge pull request #6771 from res0nance/pqc-curvename
Fix wolfSSL_get_curve_name() returning NULL when using PQC groups
2023-09-13 10:54:58 -06:00
114c8cc681 SP ASM: improve performance
Thumb2/ARM32: use umaal instruction to speed up mulitplication, squaring
and reduction. umaal not always available so use umlal instead.
Implementations for architectures less than 4 still kept - no umull.
Cleanup point arithmetic to not take shortcuts.
Make masking for constant time faster.
Add alternate asm for different compilers.
Get ARMv4 and ARMv6 compiling.
Remove whitespace at end of lines.
2023-09-13 21:13:53 +10:00
825db397d7 Set namedGroup when generating pqc ciphertext
This fixes an issue where wolfSSL_get_curve_name() will
return NULL when using PQC groups.
2023-09-13 13:29:31 +08:00
40c5048e38 AES GMULT: add table implementation using 32-bit types
32-bit ARM didn't load 64-bit pointers without alignment issues.
2023-09-13 13:44:17 +10:00
eda3cd6a37 Merge pull request #6762 from jpbland1/ocsp-chain-count-retry
stop DoCertificate from reseting the cert chain
2023-09-12 21:42:09 -04:00
1c9afb8b12 initial commit for RZN2L board Support 2023-09-13 09:22:55 +09:00
6c8eaf26f5 update based on pr comments 2023-09-12 19:43:28 -04:00
6e87fc7f90 switch to using ssl->error to check for previous error 2023-09-12 18:25:10 -04:00
971df19c5c Missing fix 2023-09-12 17:06:54 -04:00
14017bd67e remove NULL check on non-pointer array 2023-09-12 14:42:33 -04:00
86755dc7e4 Merge pull request #6766 from douzzer/20230911-linuxkm-my__show_free_areas-prototype
20230911-linuxkm-my__show_free_areas-prototype
2023-09-12 10:51:15 -06:00
e4b211bee9 Merge pull request #6764 from bandi13/zd16449_async
Zd16449 async
2023-09-12 08:38:16 -07:00
63e167e974 linuxkm/linuxkm_wc_port.h: add missing prototype for my__show_free_areas(). 2023-09-11 21:27:25 -05:00
937aa3415f set last missing lastErr section 2023-09-11 18:24:37 -04:00
1f7ccc4eff Eliminate bad record mac alert 2023-09-12 07:17:04 +09:00
61f48eb5a1 Merge pull request #6763 from DimitriPapadopoulos/codespell
Fix residual typos found by codespell
2023-09-11 15:55:34 -06:00
b99b1d4cfd fix bad error setting and instances where lastErr
wasn't set as it should have been
2023-09-11 17:52:07 -04:00
d25f4f06bf clang-tidy is being super picky 2023-09-11 16:30:29 -04:00
c7f5043774 Fixes for the sanitizer 2023-09-11 15:57:20 -04:00
42985ebdfa Revert "Add in ASYNC_CRYPTO_SW checks"
This reverts commit f5ef7b40db.
2023-09-11 15:10:32 -04:00
6cb1aef836 Clean up old comments 2023-09-11 14:54:42 -04:00
07e2f90fbb Reorder and add async_* sources 2023-09-11 14:48:17 -04:00
b34348680a New format 2023-09-11 14:33:19 -04:00
f5ef7b40db Add in ASYNC_CRYPTO_SW checks 2023-09-11 13:12:09 -04:00
57e870e0d4 Add Async examples 2023-09-11 12:05:11 -04:00
63477bcfdb Merge pull request #6733 from gojimmypi/windows-gettime_secs
implement gettime_secs for Windows (_MSC_VER) in tests/api.c
2023-09-11 09:31:30 -06:00
d532833af9 Fix residual typos found by codespell 2023-09-11 11:34:28 +02:00
d0c2609ebb stop ProcessPeerCerts from reseting the cert chain
count when an async error was returned
2023-09-11 01:56:58 -04:00
0bb9b85cd4 PKCS7: support PKCS#7 definition for ContentType eContent ANY, in addition to CMS OCTET_STRING definition 2023-09-08 16:32:15 -06:00
23ebace6b1 Fix event handling 2023-09-08 16:34:04 -04:00
f9c2a86456 Merge pull request #6759 from kaleb-himes/SP_CACHE_UPDATE
Remove references to WOLFSSL_SP_CACHE_RESISTANT as it is always on
2023-09-08 14:27:38 -06:00
f9e5e4d08a Clean up the 'async-check.sh' script
Far too many times I got burned by passing the wrong argument and things getting set up wrong.
2023-09-08 15:05:22 -04:00
f8f66191e3 Merge pull request #6750 from SparkiDev/curve25519_thumb2_2
Curve25519/Ed25519: align buffers
2023-09-08 10:36:25 -06:00
90467aa578 Curve25519/Ed25519: align buffers
Make data structures align buffers.
Align buffers in functions.
Add versions that don't use umaal
2023-09-08 15:23:15 +10:00
00a08374df Merge pull request #6707 from JacobBarthelmeh/xilinx
use flush instead of invalidate
2023-09-08 07:07:08 +10:00
0e1706c3c7 Merge pull request #6756 from JacobBarthelmeh/docs
fix parameter typo in dox documentation
2023-09-08 07:03:39 +10:00
0fb514fa41 Remove references to WOLFSSL_SP_CACHE_RESISTANT as it is always on 2023-09-07 14:24:51 -06:00
7ca6c129e5 Merge pull request #6755 from anhu/GetASNInt
Expose GetASNInt as part of WOLFSSL_ASN_API
2023-09-07 11:30:46 -07:00
bba9add3a5 Merge branch 'master' of https://github.com/wolfssl/wolfssl into windows-gettime_secs 2023-09-07 08:54:42 -07:00
fddda8f582 Expose GetASNHeader in both template and original. 2023-09-07 09:52:27 -04:00
fc4e4f1238 Merge pull request #6757 from julek-wolfssl/zephyr-ci
Tie zephyr tests to a release
2023-09-07 08:49:10 -04:00
ec7ecba0fe Tie zephyr tests to a release 2023-09-07 13:21:24 +02:00
e74b3ecdad revert to only original gettime_secs changes per code review 2023-09-06 17:55:15 -07:00
6e9c73eb12 fix parameter typo in dox documentation 2023-09-06 15:38:49 -07:00
6665f240e0 Expose GetASNInt as part of WOLFSSL_ASN_API 2023-09-06 18:17:42 -04:00
755c39b5fc Merge pull request #6751 from ejohnstown/merge-fips-builds
FIPS 140-3 Pilot Program Check-in
2023-09-06 16:07:41 -06:00
344e1661e1 wolfcrypt/src/{hmac.c,sha256.c,sha512.c,kdf.c}: ForceZero() smallstack buffers before freeing them, and ForceZero() the Hmac, wc_Sha512, wc_Sha384, wc_Sha256, and wc_Sha224 structures at the end of their respective freeing routines. also, remove superseded ForceZero() calls in wc_HKDF_Expand(), wc_SSH_KDF(), and wc_HKDF_Extract(). 2023-09-06 14:53:19 -05:00
51cb80b865 Merge pull request #6753 from bandi13/disableZephyrTests
Temporarily disable until we can figure out the issue
2023-09-06 11:18:01 -06:00
5540449315 wolfcrypt/src/port/arm/armv8-aes.c: add missing implementations of wc_AesCtrSetKey(), and add (void)dir in implementation to silence -Wunused. 2023-09-06 08:20:25 -07:00
f0743a70b4 Temporarily disable until we can figure out the issue 2023-09-06 09:24:34 -04:00
fb91f1c1fd Update the ARM asm files with a missing initialization for SHA2-256 and
the AesCtrSetKey function for AES-CTR.
2023-09-05 17:07:08 -07:00
d866144fb1 Merge branch 'master' into merge-fips-builds 2023-09-05 16:52:36 -07:00
db858fd052 Merge tag 'v5.2.1-stable' into merge-fips-builds
Check-in FIPS 140-3 PILOT
2023-09-05 13:50:29 -07:00
298b488bf1 Merge pull request #6749 from cconlon/jniCertReq
Add WOLFSSL_CERT_EXT to --enable-jni, minor CSR items
2023-09-01 16:15:10 -06:00
0352b384a5 Merge pull request #6731 from SparkiDev/aes_arm32_thumb2
AES ARM32 and Thumb2 ASM: fixup ARM32 and add Thumb2
2023-09-01 15:56:12 -06:00
cd02d5140f Merge pull request #6738 from philljj/wolfcrypt_lms_verify_only
Wolfcrypt LMS verify-only support
2023-09-01 13:25:31 -06:00
a2e2a3e994 add --enable-certreq to --enable-jni, support extKeyUsage in X509_REQ_sign, add missing X509_REQ_print fields 2023-09-01 11:59:21 -06:00
196f154c51 wolfcrypt/src/curve25519.c: use endian-conditional initializer for kCurve25519BasePoint. 2023-09-01 11:36:18 -05:00
cf32bc362b ci: Add CI for different archs 2023-09-01 16:40:37 +08:00
b36c312ef3 LMS verify-only support: fix clang warning, rename define. 2023-08-31 21:46:00 -05:00
136cb98412 Force 32-bit alignment on kCurve25519BasePoint 2023-09-01 12:14:55 +10:00
efd08eadb8 Merge pull request #6746 from douzzer/20230831-ge_p3_dbl
20230831-ge_p3_dbl
2023-08-31 15:06:17 -06:00
dc2905ce80 wolfssl/wolfcrypt/ge_operations.h: fix for bugprone-macro-parentheses in ge_p3_dbl() found by multi-test clang-tidy-all-intelasm. 2023-08-31 13:22:53 -05:00
ffd6c2b859 Merge pull request #6625 from TakayukiMatsuo/jp6352
Update Japanese API comments
2023-08-31 10:03:09 -06:00
3dec8279a0 windows: fix x64 benchmark release builds
The linker should use the x64 option for 64-bit builds
2023-08-31 20:02:37 +08:00
a99139574a ci: run windows test 2023-08-31 19:59:05 +08:00
03088b2946 LMS verify-only support: tiny correction to INSTALL. 2023-08-30 21:02:50 -05:00
927930c86e Merge pull request #6740 from SparkiDev/ecies_kdf
ECIES: add support for other KDFs
2023-08-30 16:27:39 -06:00
b546473495 Merge pull request #6739 from JacobBarthelmeh/fuzzing
additional sanity check with GetIntPositive
2023-08-31 07:11:05 +10:00
e748e1be32 add test case for ignoring cert path error 2023-08-30 12:45:29 -07:00
2aefdfe9d5 Merge pull request #6737 from anhu/ignoreBadPath
Add new feature macro WOLFSSL_IGNORE_BAD_CERT_PATH.
2023-08-30 13:37:56 -06:00
7262a30074 Fixes for NO_FILESYSTEM config 2023-08-30 13:54:49 -05:00
944db2c2e5 Merge pull request #6726 from julek-wolfssl/dropped-ccs
Server should not ignore plaintext packets as long as it has stuff to rtx
2023-08-30 09:40:14 -06:00
4e86523624 Fix NO_BIO build error 2023-08-30 10:24:25 -05:00
0638ec234b AES ARM32 and Thumb2 ASM: fixup ARM32 and add Thumb2
Fix which functions and data are compiled in depending on defines.
Better handing of constants.
Also fix Aarch64 ed25519 inline assembly.
2023-08-30 20:34:51 +10:00
41d6afcfa1 ECIES: add support for other KDFs 2023-08-30 10:37:57 +10:00
1ada2e6a43 additional sanity check with GetIntPositive 2023-08-29 15:43:01 -07:00
bbf105f8dc LMS verify-only support: update INSTALL. 2023-08-29 16:37:21 -05:00
8662312ecf LMS verify only support. 2023-08-29 15:46:18 -05:00
d7bb5aa367 Add new feature macro WOLFSSL_IGNORE_BAD_CERT_PATH. 2023-08-29 10:28:02 -04:00
70c362f680 Merge pull request #6736 from ejohnstown/fips-update
FIPS Update
2023-08-29 08:21:47 -06:00
c47600c52c update comment 2023-08-29 12:45:45 +02:00
a0fef66c3b Add test case for dropped ccs 2023-08-29 12:45:45 +02:00
357c9a68f2 Only drop plaintext msgs when we don't have stuff to rtx 2023-08-29 12:45:13 +02:00
6e3c3577f5 Refactor the crazy conditional in VerifyForDtlsMsgPoolSend 2023-08-29 12:45:13 +02:00
d8fe8b9140 gettime_secs() in api.c now uses TimeNowInMilliseconds() 2023-08-28 18:14:29 -07:00
e303f8709c move TimeNowInMilliseconds from tls13.c to internal,c; now WOLFSSL_API 2023-08-28 18:13:24 -07:00
b13294623b FIPS Update
1. Restore the linuxv5 option of fips-check.
2. Added option linuxv5.2.1 to fips-check.
2023-08-28 16:41:47 -07:00
2380086209 FIPS Update
1. Rename the error code for degraded mode so it matches what's in the
   fips repo.
2. Update the tag used for linuxv5 builds in the fips-check script.
2023-08-28 15:11:13 -07:00
3a5e171636 Check-in fips_test.h changes to master as well 2023-08-28 14:22:37 -07:00
354b28eea0 Propose to convert a less than 0 to less than or equal to 0 2023-08-28 17:16:34 -04:00
4058dbec7c Merge branch 'master' of https://github.com/wolfssl/wolfssl into windows-gettime_secs 2023-08-28 11:40:51 -07:00
c5c968aae3 Merge pull request #6722 from julek-wolfssl/zd/16550
ZD16550
2023-08-28 10:19:19 -06:00
872551a5fc Merge pull request #6734 from julek-wolfssl/curl-action-correct-name
Correct name in curl github action
2023-08-28 09:30:34 -06:00
9bea33b598 Correct name in curl github action 2023-08-28 11:55:42 +02:00
b02fe0853f CI fixes 2023-08-28 10:52:36 +02:00
57ce894393 CRL refactor
- CheckCertCRLList: check all entries in case a single issuer has multiple CRL's loaded
- test_multiple_crls_same_issuer: testing two different certificates forcing the client to check both CRL's from the same issuer
- CRL_Entry
  - use a lock instead of a mutex to allow multiple threads to access the same list simultaneously
  - add a verifyMutex when doing verification so that we don't have to release the crlLock
- Add allocation and free functions for CRL_Entry
- DupCRL_Entry: simplify copying by copying all static fields in one memcpy
2023-08-28 10:52:36 +02:00
abfcda8750 Decode the key usage extension as LE not BE 2023-08-28 10:52:36 +02:00
e85901c8e5 Only list supported sigalgs in certreq 2023-08-28 10:52:36 +02:00
321f74869a implement gettime_secs for Windows (_MSC_VER) in tests/api.c 2023-08-25 18:30:05 -07:00
5b5e66b55f Merge pull request #6732 from billphipps/correct_cryptocb_debug
Correct cryptocb cmd debug message
2023-08-25 13:57:32 -06:00
7a6e851a82 Corrected print format string. 2023-08-25 13:59:23 -04:00
2a5ed11f34 Merge pull request #6730 from gojimmypi/aria-no-openssl
ARIA no longer needs OpenSSL enabled
2023-08-25 11:48:11 -06:00
b20c6c54d1 Merge pull request #6729 from ejohnstown/degraded-mode
FIPS Degraded Mode
2023-08-25 10:10:22 -06:00
14deb7afda Merge pull request #6700 from julek-wolfssl/dtls13-downgrade-acks
DTLS 1.3: do not send ACKs until we negotiate 1.3 (through SH)
2023-08-25 09:34:53 -06:00
d7f8cc55d8 Update wolfcrypt/src/cryptocb.c
Correction
2023-08-25 11:24:47 -04:00
27bc7219e5 Correct cryptocb cmd debug message 2023-08-25 11:16:15 -04:00
0484f3e0f7 Update Japanese API comments to match PR6352 2023-08-25 10:32:10 +09:00
e48b7ef3d7 FIPS Degraded Mode
1. Add error code for entering FIPS degraded mode.
2. Add string for the error code.
2023-08-24 16:27:23 -07:00
8803510375 ARIA no longer needs OpenSSL enabled 2023-08-24 15:57:14 -07:00
c9e9e0fc72 Merge pull request #6704 from icing/session-copy-on-write
Updating a shared session objects needs to do copy on write
2023-08-24 16:52:17 -06:00
2f2dddde25 Merge pull request #6727 from bigbrett/tls13-sniffer-keylogfile
TLS 1.3 sniffer keylog file support
2023-08-24 16:52:00 -06:00
c98ce0d18c FIPS 140-3 Pilot Program Check-in 2023-08-24 14:29:32 -07:00
a6257ca635 Merge pull request #6724 from julek-wolfssl/zd/16445
ZD16445
2023-08-24 13:46:49 -06:00
f1027464e8 added tls13 keylog test, refactored diff test to only use app data output 2023-08-24 13:05:01 -06:00
15918d8ee6 First pass at TLS1.3 keylog file working 2023-08-24 13:04:59 -06:00
5f44a73f8e Merge pull request #6725 from julek-wolfssl/zd/16598
TLSX_CA_Names_Parse: Include header in length check
2023-08-24 10:30:07 -06:00
6b09b5c0cf Merge pull request #6690 from julek-wolfssl/packaging
Init deb packaging
2023-08-24 10:28:24 -06:00
88ad5ce6b0 Merge pull request #6607 from SparkiDev/curve25519_thumb2
Thumb2 ASM, Curve25519
2023-08-24 08:29:54 -07:00
82c5170659 TLSX_CA_Names_Parse: Include header in length check 2023-08-24 15:23:37 +02:00
8ce71cc19c Call HaveUniqueSessionObj when we need to have a unique session object 2023-08-24 15:01:22 +02:00
06d81f7f8f Add a test case that negotiates tickets during another handshake 2023-08-24 15:01:22 +02:00
b44d31df02 Jenkins fixes 2023-08-24 10:57:45 +02:00
b771b6ebf5 ZD16445
- Use unions for type punning in xor API
- Initialise potentially uninitialised variables
- Use `LL` suffix to specify a larger integer type
- Don't use `max` as it can shadow other definitions
2023-08-24 10:53:26 +02:00
36b92a4cef Thumb2 ASM, Curve25519
Add support for compiling ASM for Thumb2
Add Curve25519 ASM for Thumb2
Limit assembly code compiled when Ed25519 not required.
Rework all assembly implementations to replace ge_*() functions instead
of having fe_ge_*() versions that take many parameters.
Get ARM32 inline asm working.
2023-08-24 17:43:03 +10:00
a99954c0b0 Update dtls_expected_peer_handshake_number when downgrading 2023-08-23 23:20:51 +02:00
9ca1738b7a Fix newlines in async script 2023-08-23 23:20:51 +02:00
5624b6e9d2 Update comment 2023-08-23 23:20:51 +02:00
058dfca809 Use explicit field to signal that we received a unified hdr 2023-08-23 23:20:51 +02:00
3cc473b1ec Check that HVR and HRR don't appear in the same connection 2023-08-23 22:18:21 +02:00
9427bea275 DTLS 1.3: do not send ACKs until we negotiate 1.3 (through SH) 2023-08-23 22:18:21 +02:00
7b29362d90 Updating a shared session objects needs to do copy on write 2023-08-23 22:15:25 +02:00
32a07a7f5a Merge pull request #6723 from anhu/bench_sphincs_gating
More gating on HAVE_SPHINCS in benchmarks
2023-08-23 14:10:51 -06:00
24cf794342 Increase timeout as macos build time are very variable (due to homebrew) 2023-08-23 22:01:12 +02:00
7a12202675 Init deb packaging
- rpm: Simplify script and list wolfSSL as packager
- add packaging github action
2023-08-23 22:01:12 +02:00
1608cb8b45 More ating on HAVE_SPHINCS in benchmarks 2023-08-23 14:03:22 -04:00
827287000c Merge pull request #6720 from TakayukiMatsuo/jp6506
Apdate Japanese API comments to match them in PR6506
2023-08-23 09:48:05 +09:00
3033371abc Merge pull request #6717 from bigbrett/sniffer-keylogfile
sniffer keylog file support
2023-08-22 14:06:27 -06:00
fd9c78d93f Merge pull request #6721 from bandi13/udp_proxy-fixes
Udp proxy fixes
2023-08-22 13:13:57 -06:00
66c53b0996 Decoupled keylogfile registration and sniffer server creation APIs
fixed (very old) use-after-free found by ASAN

Updated documentation

review comments (spelling and housekeeping)
2023-08-22 11:29:58 -06:00
2ee6a01d91 Initial sniffer keylog file support for TLS 1.2 2023-08-22 11:23:46 -06:00
205cdb1809 Merge pull request #6719 from anhu/MBSTRING_ASC
Support MBSTRING_ASC for cert encoding
2023-08-22 09:29:50 -06:00
c4f91cdc8d Revert "Don't run script un-bwrapped"
This reverts commit d321ae2fd5.
2023-08-22 10:00:00 -04:00
d54aa0dabd Display test duration 2023-08-22 09:51:42 -04:00
d321ae2fd5 Don't run script un-bwrapped 2023-08-22 09:43:59 -04:00
c1821e9ed2 Decrease timeout to 1m. Most tests complete in seconds 2023-08-22 09:43:33 -04:00
79d831c712 Set customizable PCAP file name 2023-08-22 09:32:51 -04:00
88c32a510e Wrap script in a bwrap environment 2023-08-22 09:30:51 -04:00
e487b73809 Reduce likelihood of two tests running and saving to the PCAP dump 2023-08-21 13:37:34 -04:00
5339fe0d9f Merge pull request #6715 from anhu/WOLFSSL_NO_SPHINCS
Allow easily disabling of SPHINCS+.
2023-08-21 09:26:16 -06:00
307ce9d623 Only drop the first Nth packet, not every 2023-08-21 09:55:23 -04:00
bf438c85e1 Add in a marker to the PCAP file 2023-08-21 09:55:23 -04:00
174f0b2ebc Apdate Japanese API comments to match them in PR6506 2023-08-20 15:25:33 +09:00
928dd70213 Merge pull request #6716 from bandi13/dtls_test_cleanup
DTLS test cleanup
2023-08-18 16:48:21 -06:00
9cc8cdcc30 Merge pull request #6712 from philljj/spelling_cleanup
Used codespell and fixed obvious typos.
2023-08-18 16:29:36 -06:00
7669f966f3 Support MBSTRING_ASC for cert encoding 2023-08-18 17:50:25 -04:00
dbd5d713e7 Add in a marker to the PCAP file 2023-08-18 14:10:47 -04:00
9a007604e4 Usage documentation 2023-08-18 14:05:07 -04:00
65217cbc70 Merge pull request #6713 from ejohnstown/fips-check-exp-ver
FIPS Check Script with Explicit Versioning
2023-08-18 11:20:23 -06:00
bea1b6f89b Use unique temp file names 2023-08-18 13:11:31 -04:00
3df434930e Add in total test run count 2023-08-18 13:06:13 -04:00
883d4dc219 Clean up the script 2023-08-18 13:04:36 -04:00
033b0785e3 Merge pull request #6714 from julek-wolfssl/rename-utils.c
Rename utils.c to utils.h
2023-08-18 10:37:00 -06:00
b9dbd86fab FIPS Check Script with Explicit Versioning
1. Remove the case block deciding if to checkout the wolfcrypt files or
   not, it is redundant. Things are set up now where we don't need it.
2. Comment reflow.
Changes due to peer review:
3. Change the check for the temp mytag branches to use a git command
   that provides an exact match, rather than a foulable grep check.
4. Change the fips repo file checkout to work the same way as the
   wolfcrypt files. Each file in the copy list is tagged with its
   revision.
2023-08-18 09:27:53 -07:00
62bb434aa6 Remove debugging code 2023-08-18 11:14:50 -04:00
dfc4850e75 Add extra flags for DTLS1.3 2023-08-18 11:11:25 -04:00
e0b90a0463 Rename the script to be a bit more generic 2023-08-18 11:11:08 -04:00
8772d8b868 Able to adjust DTLS version globally 2023-08-18 11:05:36 -04:00
bad00ea9f7 Adding in tcpdump capture 2023-08-18 11:04:45 -04:00
f089b2c2f6 Clean up code 2023-08-18 10:21:44 -04:00
fea48e2505 Drop every i'th packet 2023-08-18 10:05:12 -04:00
49dc3a473b Run through all the tests and give a tally for failed 2023-08-18 10:03:58 -04:00
a24f99fbf6 Allow easily disabling of SPHINCS+. 2023-08-18 10:00:47 -04:00
bc7c8af5de Massively simplified the tests 2023-08-18 09:41:13 -04:00
b32ff0b0b8 Rename utils.c to utils.h
This better signals that this file is meant to be included directly in testing programs and also plays better with my IDE.
2023-08-18 15:05:23 +02:00
975047bd22 Merge pull request #6710 from JacobBarthelmeh/PKCS7
initialize kari decoded cert
2023-08-18 10:24:48 +10:00
3e93c5e253 FIPS Check Script with Explicit Versioning
1. Move the command line updatable variables to the beginning of the
   script.
2. Reorder the OE names in the usage list.
3. Add the missing asm files.
4. Correct the regex for the fipsv2-OE-ready version name.
2023-08-17 14:37:48 -07:00
6724a3d005 FIPS Check Script with Explicit Versioning
1. Remove the demo OE.
2. Update all OEs with the new file lists.
3. Merge OEs with same files and tags, and add a check for the
   difference to optionally update that. For example, solaris is the
   same file list and tags as linuxv2, but uses gmake instead of make.
2023-08-17 14:35:45 -07:00
87695adc82 FIPS Check Script with Explicit Versioning
1. Remove the demo variable presets. Actually use them in testing.
2. FIPS_REPO can be set to a local file path to speed up testing.
3. Add files missing from the demo OE checkout.
4. Add the fips-read OE files.
5. Add the quiet option to grep.
2023-08-17 14:32:40 -07:00
98c50e05a3 FIPS Check Script with Explicit Versioning
1. Add an optional initialized variable for the KEEP option and default
   it to 'yes' temporarily.
2. Comment out all the descriptions for all the OEs except the test OE.
3. Update the copy FIPS file list format to have the file path and add
   the tag to use for copying as the first item.
4. Merge the branch-creation and file checkout into one function. Remove
   the local path changing.
5. Update and simplify the FIPS file copying function.
6. Remove the old copying code.
7. When updating the fipsv2-OE-ready version string, also check that
   fips.c is non-zero.
8. Use explicit paths for files.
2023-08-17 14:25:48 -07:00
0fd96be7f8 FIPS Check Script with Explicit Versioning
1. Add a test OE for trying out the new methods.
2. Add a temporary way to trigger using the new methods.
3. Add a function to check out different versions of files in the repo,
   and only adding a new branch when needed.
4. Remove the old checkout code.
2023-08-17 14:23:13 -07:00
b156e83990 Merge pull request #6711 from bandi13/mp_sqrtmod_prime-static
Set mp_sqrtmod_prime as static
2023-08-18 07:13:55 +10:00
d4ba2e50d4 Used codespell and fixed obvious typos. 2023-08-17 15:20:10 -05:00
c917eee70e Set mp_sqrtmod_prime as static
This function is not in any header files, and wasn't meant to be exposed.
2023-08-17 13:52:17 -04:00
cc4e327316 Merge pull request #6544 from TakayukiMatsuo/rpk
Add support for raw-public-key
2023-08-17 09:23:18 -06:00
ba4842aded Merge pull request #6703 from anhu/guard_sphincs
Guard sphincs away properly.
2023-08-16 14:40:11 -06:00
d7b2626433 initialize kari decoded cert 2023-08-16 13:20:29 -07:00
7023f86e66 Remove unnecessary code
'bc' is not installed in VM images. Don't want to run 'killall' in Jenkins tests
2023-08-16 16:01:47 -04:00
a78694e5bf misc.h declarations for user defined functions with NO_INLINE disabled 2023-08-16 12:45:37 -05:00
afd0d07d9a Merge pull request #6706 from bandi13/ZD16551
Add in another clamp to prevent infinite loops
2023-08-16 11:03:44 -06:00
ac90fa8d60 Merge pull request #6701 from miyazakh/fspsm
generalize Renesas SCE Protected port
2023-08-16 09:38:18 -06:00
ec818e5dbd Merge pull request #6682 from gojimmypi/Espressif-template
Add Espressif ESP-IDF template project
2023-08-15 16:37:24 -06:00
c3ebfd133b use flush instead of invalidate 2023-08-15 15:05:47 -07:00
0d8f68ef03 address review comments 2023-08-16 06:30:13 +09:00
437c2020bd Add in another clamp to prevent infinite loops
M = i - 1 would make it 2^0. Anything above that would be negative powers which don't make sense.
2023-08-15 17:05:43 -04:00
45bcb65dc0 Merge pull request #6659 from gojimmypi/ESP32_Info_link_change
updated comment links for Espressif examples
2023-08-15 14:58:06 -06:00
a71114b4cb Merge pull request #6702 from bandi13/ZD16572
Check the return value
2023-08-15 14:57:26 -06:00
f1b4387eca Return a failure if the sizes don't match 2023-08-15 15:00:06 -04:00
9bb6c1b70e Guard away properly; don't build sphincs code. 2023-08-14 21:31:28 -04:00
24f60cc435 Merge pull request #6699 from JacobBarthelmeh/PKCS7
init mp_int before use
2023-08-14 16:11:33 -06:00
bbcd91b59a Merge pull request #6621 from bandi13/addPKIXSSH
Add in PKIXSSH
2023-08-14 16:08:29 -06:00
b3a1badecf Check the return value 2023-08-14 17:02:59 -04:00
300c183453 Update README 2023-08-14 11:21:12 -04:00
5002ef19b1 Give GDB permission to attach to processes as non-root 2023-08-14 11:21:00 -04:00
47caa9b06d generalize sce protect impl to fsp sm(secure module) 2023-08-13 09:23:03 +09:00
d3d131d08d Merge pull request #6663 from TakayukiMatsuo/jp6417
Update Japanese API comments
2023-08-12 08:05:41 +09:00
bd14be8553 init mp_int before use 2023-08-11 10:04:17 -07:00
4167a51fe9 Add in 'udp-proxy' 2023-08-11 11:23:09 -04:00
8bb8f64373 Merge pull request #6698 from anhu/compat_into_settings_h
Bring compat layer logic from configure.ac into settings.h
2023-08-11 09:23:03 -06:00
46229bb167 Merge pull request #6693 from bandi13/ZD16551
Add in clamp for mp_sqrtmod_prime
2023-08-11 09:22:53 -06:00
568bf35555 Reduce image size 2023-08-11 11:22:08 -04:00
a4152ab341 Merge pull request #6695 from philljj/fix_test_x509_guards
Fix define guards for X509 api tests.
2023-08-11 09:18:00 -06:00
61761143e7 Merge pull request #6696 from philljj/small_benchmark_cleanup
Tiny cleanup to benchmark print usage.
2023-08-11 09:16:48 -06:00
c29227dcbb Merge pull request #6694 from kareem-wolfssl/gh6689
Change enum ecc_curve_load_mask into defines
2023-08-11 09:13:03 -06:00
507ec9f7d2 Bring compat layer logic from configure.ac into settings.h 2023-08-11 00:11:36 -04:00
3a5739a8fa Add support for raw-public-key 2023-08-11 11:29:15 +09:00
6b1513a769 Clean up garbage characters 2023-08-10 16:41:11 -04:00
66c529e610 Add in PKIXSSH 2023-08-10 16:41:11 -04:00
65401cfd35 Merge pull request #6697 from julek-wolfssl/refactor-cond-again
Refactor conditional code again
2023-08-10 13:49:46 -06:00
26fcdbf348 Merge pull request #6688 from kareem-wolfssl/gh6684
Update set1_groups/_list prototype conditions to match the functions' conditions.  Fixes #6684.
2023-08-10 13:35:49 -06:00
c3fea8c930 fixup! client: resend data when didn't receive reply after timeout 2023-08-10 20:14:35 +02:00
e96837aa34 cond: Add start and end API for mutex handling 2023-08-10 18:07:51 +02:00
1b393199f4 client: resend data when didn't receive reply after timeout 2023-08-10 18:07:35 +02:00
779b87f03a Tiny cleanup to benchmark print usage. 2023-08-10 09:47:07 -05:00
5255b02fbb Fix define guards for X509 api tests. 2023-08-10 08:49:25 -05:00
1bb0199a2b Change enum ecc_curve_load_mask into defines 2023-08-09 17:35:01 -07:00
6ea1e7d824 Merge pull request #6683 from dgarske/tpm_ecc
Enable math API's for wolfTPM
2023-08-09 17:11:33 -06:00
12685d7713 Merge pull request #6686 from dgarske/fix_cond
Fixes for wolfSSL conditional porting
2023-08-09 12:08:05 -06:00
35f4a1a09d Merge pull request #6672 from anhu/cert_err_message
Add some OpenSSL compat error strings.
2023-08-09 09:28:51 -06:00
737e12a1bd fixup! Initialize BIO methods at compile time 2023-08-09 17:04:59 +02:00
b86d2a3bff Fix typo 2023-08-09 16:47:14 +02:00
bc4c0df315 Update multi-compiler timeout 2023-08-09 16:47:03 +02:00
9b81b0b505 Add in clamp for mp_sqrtmod_prime 2023-08-09 10:44:59 -04:00
d747df2ae4 Make sure no mutexes are held when cond API are called 2023-08-09 16:25:58 +02:00
7ba00f3b84 Initialize BIO methods at compile time 2023-08-09 16:23:46 +02:00
6fcdead112 Check error codes from pthread funcs 2023-08-09 14:20:29 +02:00
27feb9b9e9 Simplify mac cond type 2023-08-09 14:18:32 +02:00
9f577dc4d4 Update set1_groups/_list prototype conditions to match the functions' conditions. Fixes #6684. 2023-08-08 17:56:56 -07:00
e9e5d70aad Merge pull request #6674 from ejohnstown/fips-check-update
FIPS Check Update
2023-08-08 15:42:28 -06:00
c7b6fa2931 Return codes and missed srtp. 2023-08-08 13:58:38 -07:00
5daabe0801 Suggestion from Jacob to remove OPENSSL_EXTRA_X509_SMALL 2023-08-08 16:35:55 -04:00
39f632d096 Remove lockCount. 2023-08-08 12:51:27 -07:00
5b16586483 Fixes for wolfSSL conditional porting. Can cause deadlock in high usage situations. Added better signal support on MacOS. Issue created in PR #6437. 2023-08-08 12:46:42 -07:00
0dbc7d0b13 Merge pull request #6685 from anhu/sm4_disabled
SM4 disabled
2023-08-08 13:37:23 -06:00
958113c070 Correct configure defaults for SM4-GCM and SM4-CCM (disabled) 2023-08-08 13:06:00 -04:00
9f6d48891a Update Japanese API comments 2023-08-08 13:29:46 +09:00
a957f0e2c3 config.h not needed for Espressif example 2023-08-07 15:09:20 -07:00
75f81db084 New TPM ECC encrypt needs access to the mp_ math functions. 2023-08-07 15:06:58 -07:00
69eeedbac3 Add Espressif ESP-IDF template project 2023-08-07 15:03:21 -07:00
33e31ed41c Merge pull request #6675 from douzzer/20230805-clang-18-tidy-fixes
20230805-clang-18-tidy-fixes
2023-08-07 14:55:15 -06:00
e51ca7941f fixes for code warned by clang-tidy:18 and cppcheck-2.11:
bugprone-inc-dec-in-conditions: examples/server/server.c:server_test(), src/internal.c:MatchDomainName(), src/x509.c:wolfSSL_X509_set_ext(), wolfcrypt/src/asn.c:MatchBaseName()

missingReturn: wolfcrypt/src/wc_port.c:mystrnstr()

bugprone-unused-return-value: wolfcrypt/src/wc_port.c:wolfSSL_NewThreadNoJoin()

clang-analyzer-deadcode.DeadStores: wolfssl/test.h:udp_accept()
2023-08-05 12:28:41 -05:00
0654ed3549 Fixed style warning from shellcheck re x in comparisons. 2023-08-04 16:41:39 -07:00
f3af4542e7 FIPS Check Update
1. Whitespace changes.
2. Deleted the stm32l4 build. The fips-check-2.0.sh script handles it.
3. Removed the CAVP_SELFTEST_* variables, used the FIPS_OPTIONS for it.
4. Removed the v1 style code checkout. The current method works for all
   available cases.
5. Removed the FIPS_CONFLICTS case rename case.
2023-08-04 13:53:34 -07:00
c9b72d7b61 Merge pull request #6673 from anhu/readfile
Change ReadFile instances to app-specific naming.
2023-08-04 13:48:49 -06:00
65b515aec8 Merge pull request #6655 from julek-wolfssl/threading-testing
Port testing to wolfSSL threading interface
2023-08-04 13:46:14 -06:00
30fda7ad38 Change ReadFile instances to app-specific naming.
ReadFile conflicts with a windows API.
2023-08-04 13:50:46 -04:00
cec438a4e4 Add some OpenSSL compat error strings. 2023-08-04 13:26:28 -04:00
aa69b2fd62 Update the header comment. 2023-08-04 07:38:48 -07:00
90a6a14878 Merge pull request #6446 from JacobBarthelmeh/session 2023-08-04 11:34:59 +02:00
e04033ae3d Adjust timeout to account for longer brew install 2023-08-04 10:49:39 +02:00
decee67138 Use random port in crl test 2023-08-04 10:49:39 +02:00
67d6d438c5 Port testing to wolfSSL threading interface 2023-08-04 10:49:39 +02:00
ae90a9b2c0 Merge pull request #6665 from TakayukiMatsuo/jp6472
Update Japanese API comments
2023-08-04 14:37:33 +09:00
4e07ebf279 changes to the script fips-check.sh 2023-08-03 22:22:20 -07:00
83de744dcf Merge pull request #6671 from SparkiDev/sm_impl_redirect
SM Ciphers: Reference the GitHub repository to get implementation
2023-08-03 16:41:46 -06:00
7f0cfcb27d Merge pull request #6667 from bandi13/byebyeCyaSSL
Byebye cya ssl
2023-08-03 15:43:01 -06:00
e7ae80493b SM Ciphers: Reference the GitHub repository to get implementation
wolfsm is public and we can point people to repository.
2023-08-04 07:28:21 +10:00
71f9162b99 Merge pull request #6668 from julek-wolfssl/zd/16515
DTLS downgrade bug fixes
2023-08-04 07:20:01 +10:00
a60810cebe Merge pull request #6664 from joakim-strandberg/ada_windows_support
Ada windows support
2023-08-03 14:40:34 -06:00
0c39b8074e Merge pull request #6654 from lealem47/zd16475
Fix of buffer overflow in GenerateDNSEntryRIDString()
2023-08-03 14:12:47 -06:00
1da000b244 Merge pull request #6670 from anhu/080
Document that we integrate with liboqs 0.8.0
2023-08-03 13:29:32 -06:00
a6c850d7f9 Fix CAVP errors 2023-08-03 12:05:40 -04:00
54ab1b1113 Document that we integrate with liboqs 0.8.0 2023-08-03 10:23:12 -04:00
8a9a363621 DTLS 1.3: move state machine forward when HVR received 2023-08-03 15:00:14 +02:00
907a0201e7 Require HAVE_SECURE_RENEGOTIATION for API that perform SCR (not just indication) 2023-08-03 11:32:42 +02:00
5a94dc961d DtlsShouldDrop: don't ignore app data sent before a SCR handshake 2023-08-03 11:32:03 +02:00
158402ab03 Add logging prefixes to api.c client and server 2023-08-03 11:31:47 +02:00
f35173b1a6 Update Japanese API comments 2023-08-03 09:47:19 +09:00
b31e485dc9 Remove 'HAVE_FIPS_VERSION < 2' blocks 2023-08-02 17:08:03 -04:00
f5164d325b Remove weird control char + copy/paste errors 2023-08-02 16:14:25 -04:00
de0048e5b2 Put back netbsd- and marvell-linux-selftest modes 2023-08-02 14:23:29 -04:00
05b692d01c Merge pull request #6661 from julek-wolfssl/zd/16477
Recover when the client sends a 0-length session ID when using tickets
2023-08-02 11:37:21 -06:00
dee32247b9 Code review 2023-08-02 18:02:41 +02:00
bfe7bc0fcc Recover when the client sends a 0-length session ID when using tickets
Fixes ZD16477
2023-08-02 18:02:30 +02:00
fbc6ed4fe4 Merge pull request #6662 from julek-wolfssl/zd/16504
DoHelloVerifyRequest: only do DTLS 1.3 version check
2023-08-02 09:22:05 -06:00
a885a94b21 Merge pull request #6669 from douzzer/20230801-fips-nullcipher
20230801-fips-nullcipher
2023-08-02 08:59:46 -06:00
6f4fabaac9 Adjust DER size 2023-08-02 10:30:12 +02:00
724fe53379 DoHelloVerifyRequest: only do DTLS 1.3 version check 2023-08-02 10:30:12 +02:00
2a6956a954 Missing commit 2023-08-01 17:55:38 -04:00
8794e3f2f6 Updated the Ada wrapper README.md file and removed mention of the c_tls_client_main.c and c_tls_server_main.c files. 2023-08-01 23:08:52 +02:00
0e74213692 Fix display of SPARK tool output in README 2023-08-01 22:45:07 +02:00
a0668bd9ab Remove FIPS-check for v1 2023-08-01 15:46:40 -04:00
25f542adb4 Clean up compile errors 2023-08-01 15:46:18 -04:00
d250eb8327 configure.ac: in FIPS builds, remove nullcipher from enable-all and enable-all-crypto, and error on explicit --enable-nullcipher with FIPS unless fips=dev. 2023-08-01 12:24:50 -05:00
27a59761b9 Merge pull request #6520 from miyazakh/tsip_cryptonly
Support TSIP crypt only
2023-08-01 10:13:18 -06:00
6e33fe3b51 Remove cyassl reference 2023-08-01 10:57:19 -04:00
44b634a597 More cleanup 2023-08-01 10:29:03 -04:00
9eb339f9fd Remove cyassl from example code 2023-08-01 10:17:38 -04:00
70e1ab7f0c Remove cyassl from wolfcrypt 2023-08-01 10:17:11 -04:00
1468d77e50 Merge pull request #6644 from julek-wolfssl/zd/16441
TLSX_CA_Names_Parse: Verify the length of the extension
2023-07-31 16:03:23 -06:00
278f395542 Made sure the relative paths for finding the certificates is correct. 2023-07-31 23:48:44 +02:00
6893123edf Removed references to the c implementations of the client and server 2023-07-31 21:54:30 +02:00
ab953c3141 Update VS project files 2023-07-31 15:37:48 -04:00
2b2509c56c Drop code support 2023-07-31 15:36:38 -04:00
66f04f8db5 Remove cyassl 2023-07-31 15:17:17 -04:00
b6a11b8b01 Updated the README.md and updated client.gpr 2023-07-31 17:53:01 +02:00
c76b0a0237 removed the C examples only keeping Ada code in the Ada wrapper example directory 2023-07-31 17:31:23 +02:00
4b80dcf733 Merge pull request #6617 from SparkiDev/aes_gcm_win_asm_fix
AES-GCM x86_64 MSVC ASM: XMM6-15 are non-volatile
2023-07-31 09:15:42 -06:00
854ae0dcdb Code review 2023-07-31 15:16:59 +02:00
106a065a41 Merge pull request #6660 from DimitriPapadopoulos/codespell
Fix residual typos found by codespell
2023-07-28 11:52:47 -06:00
a495bb4e7f TLSX_CA_Names_Parse: make sure to do cleanup when smallstack is on 2023-07-28 16:34:35 +02:00
1b10fb5ca7 Fix typos(?) found by codespell
These typos could have been generated by some program, in which case
the program should be fixed instead. Yet the typos are inconcistent,
as if the output had been manually copied. Why is the output poorly
aligned?

Use seconds or s for seconds, consistently.

Use ops for operations, consistently. Unless you want the singular
op for operation, as the value is often < 2.
2023-07-28 10:03:27 +02:00
52f91e4ab9 Fix residual typos found by codespell 2023-07-28 09:29:28 +02:00
5043ecefc1 Merge pull request #6648 from DimitriPapadopoulos/codespell
Fix typos found by codespell
2023-07-27 17:07:30 -06:00
a785c39a12 Merge pull request #6657 from kojo1/multibyte
multi-byte code
2023-07-27 16:35:22 -06:00
6d9c85a762 Fix typos found by codespell 2023-07-27 23:38:44 +02:00
3e63589664 Merge pull request #6605 from dgarske/ada
Ada Bindings for wolfSSL
2023-07-27 15:21:52 -06:00
10adca1a45 Add CryptoCb features (#6636)
* Update to support invoking cryptocb during un/register.
2023-07-27 13:16:43 -07:00
f89892a3cd updated comment links 2023-07-27 09:44:57 -07:00
c529b2f3aa Merge pull request #6627 from jpbland1/ocsp-nonce-usage-fix
fix bad & statement that was setting ocspSendNonce
2023-07-27 09:22:08 -07:00
d0abfd7686 Merge pull request #6658 from julek-wolfssl/krb5-action-update
Point krb5 action to master branch of osp repo
2023-07-27 10:19:06 -06:00
ee9ecd9591 Point krb5 action to master branch of osp repo 2023-07-27 11:14:41 +02:00
136738fd33 Avoid mult-byte code error 2023-07-27 17:04:41 +09:00
daa54f3d31 adjust wait times so that test can happen before timed out 2023-07-26 16:14:24 -07:00
b16e7fd87b use Expect with test
fix for session expire check

better name for test function

rewrite test case

make new session also timeout in 1 second
2023-07-26 15:10:22 -07:00
9cd7e59e6a add another session expire test case 2023-07-26 15:10:22 -07:00
3510ea4fec Merge pull request #6656 from JacobBarthelmeh/sanitizer
conversion warning flagged on Windows test builds
2023-07-26 14:48:19 -07:00
67913b5800 Merge pull request #6603 from JacobBarthelmeh/xilinx
fix for AES-GCM use with petalinux
2023-07-27 07:38:03 +10:00
02ec92a3b9 Support TSIP crypt only
- Aes, sha,
  - rsa
     MakeRsaKey, sign/verify

fix compile error when not enabled TSIP
2023-07-27 06:23:34 +09:00
7c11c0f201 conversion warning flagged on Windows test builds 2023-07-26 13:48:33 -07:00
8d77090ad9 Merge pull request #6650 from DimitriPapadopoulos/spaces
Fix tab/space inconsistencies
2023-07-26 14:17:31 -06:00
3e5e16f1ff Merge pull request #6641 from julek-wolfssl/gh/6555
Dtls13GetRnMask: Correctly get chacha counter on BE systems
2023-07-26 11:29:39 -06:00
48434f7814 Merge pull request #6653 from julek-wolfssl/kerberos-update
Updates for Kerberos 5 1.21.1
2023-07-26 11:26:57 -06:00
4a175ba280 Updates for Kerberos 5 1.21.1
- wolfssl_ec_point_mul: fix parameters being passed into ec_mul2add
- Compile in compressed ecc key parsing for OPENSSLALL
- Improve debugging around compat layer ecc operations
- wolfSSL_BN_div: dv can be NULL
- Add spake like computation test
- Add CI krb5 testing
- Add timeouts to CI
2023-07-26 16:40:38 +02:00
5947c9ae8c TLSX_CA_Names_Parse: Verify the length of the extension 2023-07-26 13:32:37 +02:00
5cf42244f0 Add comment back in 2023-07-26 12:04:11 +02:00
681a75da24 fix for AES-GCM use with petalinux 2023-07-25 22:08:20 -06:00
d87bb14ac0 Merge pull request #6647 from gojimmypi/SM4_Hash_fix
WOLFSSL_NO_HASH_RAW Hmac_UpdateFinal() properties for SM3
2023-07-26 11:32:35 +10:00
31dfdf8360 TLS SM2, SM3, SM4-CBC: hash details for SM3 2023-07-25 17:25:11 -07:00
cfac603ee1 AES-GCM x86_64 MSVC ASM: XMM6-15 are non-volatile
Put XMM6-15, when used, on the stack at start of function and restore at
end of function.
2023-07-26 08:22:58 +10:00
746802be89 Merge pull request #6652 from douzzer/20230724-cppcheck-2v11
20230724-cppcheck-2v11
2023-07-25 14:59:50 -06:00
9cade8c9a4 Fix of buffer overflow in GenerateDNSEntryRIDString() 2023-07-25 14:33:05 -06:00
cebb4da307 fixes and workarounds for cppcheck 2.11 with uninitvar checks reactivated, and legacyUninitvar suppressed globally (as before):
src/internal.c:wolfSSL_DtlsUpdateWindow(): shiftTooManyBitsSigned and integerOverflowCond (true positive, fixed);

src/ssl.c:wolfSSL_GetSessionFromCache(): autoVariables (true positive, intentional and now suppressed);

wolfcrypt/src/asn.c: several uninitvars in EccSpecifiedECDomainDecode(), wc_EccPrivateKeyDecode(), DecodeSingleResponse(), and DecodeResponseData() (false positives due to bug in cppcheck short circuit eval analysis, mitigated by refactoring && expressions to nested-if constructs that are semantically identical);

src/ssl.c:wolfSSL_GetSessionFromCache(): nullPointer (false positive due to bug in cppcheck value flow analysis, workarounded).
2023-07-25 11:31:01 -05:00
c0b4cde6df Merge pull request #6632 from jpbland1/ocsp-want-read-error
OCSP_WANT_READ mishandled re-run
2023-07-25 08:23:46 -07:00
a9c9662124 fix bad & statement that was setting ocspSendNonce
to 1 when WOLFSSL_OCSP_NO_NONCE was selected
related to but doesn't solve zd 16377
2023-07-24 16:51:10 -04:00
4ff99a6780 Fix tab/space inconsistencies 2023-07-24 20:10:57 +02:00
1285ae7816 Merge pull request #6506 from DimitriPapadopoulos/codespell
Fix typos found by codespell
2023-07-24 10:34:29 -06:00
1812d32258 Merge pull request #6635 from julek-wolfssl/zd/16403
Fix ClientHello parsing when no extensions are present
2023-07-24 09:49:28 -06:00
a19a0537ee Fix RFC references and add WOLFSSL_ALLOW_CRIT_AIA 2023-07-24 09:20:30 -05:00
d3aa11bf87 Place manual memio helpers in utils.c and add macro for them 2023-07-24 09:14:21 +02:00
ab560aa6b8 Fix ClientHello parsing when no extensions are present 2023-07-24 09:14:21 +02:00
8ec2e23773 Rework curl action to use actions-build-autotools-project 2023-07-24 09:13:10 +02:00
72d99d0ae0 Add timeouts to action tests 2023-07-24 09:13:10 +02:00
56fc5bbf87 Dtls13GetRnMask: Correctly get chacha counter on BE systems
The issue was that BIG_ENDIAN is defined in endian.h (on linux). Our define is BIG_ENDIAN_ORDER.
2023-07-24 09:13:10 +02:00
d3202600a4 Merge pull request #6525 from lealem47/san
Improve subjectAltName extension parsing and printing
2023-07-22 08:19:54 -06:00
318c95a2c2 Remove leftover declaration in ssl.h 2023-07-21 17:13:28 -06:00
2acc4a6dd5 Merge pull request #6561 from lealem47/zd16348
Fix for adding pkcs9 contentType entry name
2023-07-21 17:04:47 -06:00
c2a3f5316d Merge pull request #6591 from embhorn/zd16296
Add CRL_REPORT_LOAD_ERRORS option
2023-07-21 17:00:23 -06:00
c09138cd3f Merge pull request #6642 from kareem-wolfssl/zd16073
Fix wolfSSL_SMIME_write_PKCS7 not removing NULL characters between sections.
2023-07-21 16:52:38 -06:00
2e4b651b87 update tls13 to handle an OCSP_WANT_READ, update
async client test to retry connect on OCSP_WANT_READ instead of timing out
2023-07-21 16:24:59 -04:00
acac3fe479 Add testing and make jenkins happy 2023-07-21 13:57:45 -06:00
0cd5a293ca Fix for parsing pkcs9_contentType 2023-07-21 13:57:45 -06:00
4821859bbc Fix for adding pkcs9 contentType entry name 2023-07-21 13:57:45 -06:00
4bb907522b Fix wolfSSL_SMIME_write_PKCS7 not removing NULL characters between sections. 2023-07-21 11:08:15 -07:00
1daaabf38a Merge pull request #6640 from SparkiDev/sm3_asm_s_protection
SM3 ASM file: protect with check for WOLFSSL_SM3
2023-07-21 09:20:30 -07:00
f9cb9560c4 Add CRL_REPORT_LOAD_ERRORS option 2023-07-21 10:06:35 -05:00
477e65e07a Merge pull request #6626 from TakayukiMatsuo/jp6414
Update Japanese API comments
2023-07-21 12:33:29 +09:00
452f6a8898 Merge pull request #6639 from JacobBarthelmeh/vcpkg
add include to wolfio.h and replace cmake NAMESPACE
2023-07-21 10:43:13 +10:00
9b2345dc8e SM3 ASM file: protect with check for WOLFSSL_SM3
Protect sm3_asm.S with check for WOLFSSL_SM3.
Change configure.ac to define WOLFSSL_SM3 in ASM flags when SM3 enabled
and enabling intelasm.
2023-07-21 09:57:53 +10:00
9bc6fc64de add include to wolfio.h and replace cmake NAMESPACE 2023-07-20 16:12:56 -07:00
ec49e6b44d Avoid clash b/n two surname entries 2023-07-19 17:10:23 -06:00
ec4527c789 address more feedback 2023-07-19 16:27:03 -06:00
b7b4be8822 Merge pull request #6610 from bigbrett/apple-universal-lib
Apple "universal binary framework" build script and project example
2023-07-19 15:39:24 -06:00
16058ce168 Address review comments 2023-07-19 12:01:01 -06:00
acd819caa1 Merge pull request #6633 from SparkiDev/sm2_not_with_sp_math
SM2 and SP_MATH: don't enable SM2 with SP_MATH
2023-07-19 10:09:58 -06:00
dceb7c0122 SM2 and SP_MATH: don't enable SM2 with SP_MATH
No implementation of SM2 with SP so can't use SM2 with SP MATH.
2023-07-19 12:39:59 +10:00
8065ba18f9 Merge pull request #6620 from douzzer/20230714-WC_DO_NOTHING
20230714-WC_DO_NOTHING
2023-07-18 17:04:02 -06:00
fd13d376a8 Merge pull request #6630 from JacobBarthelmeh/spelling
spelling fixes
2023-07-19 08:48:03 +10:00
9ea681030f change conditional compile to use WOLFSSL_NONBLOCK_OCSP
instead of HAVE_OCSP
2023-07-18 17:56:43 -04:00
e12f1f44b4 make OCSP error entry conditional to cut down on size 2023-07-18 14:55:16 -04:00
7ee38350c0 undo supressing the OCSP_WANT_READ error, instead
add it to the list of non-fatal errors so that a socket close alert wont be sent out but the caller still won't block and will instead get OCSP_WANT_READ as an error back from wolfSSL_connect
2023-07-18 14:05:16 -04:00
80bc547853 in the event of a OCSP_WANT_READ, set the ssl->error
so that the re-run of DoHandShakeMsgType knows not to hash the certificate twice and won't send an alert to the server as it was when OCSP_WANT_READ instead of setting ret to 0
2023-07-18 13:00:53 -04:00
58318f9528 Merge pull request #6628 from dgarske/stm32_date
Fix for STM32 `HAL_RTC_GetDate` year
2023-07-18 10:28:35 -06:00
9f2dd21a91 Merge pull request #6629 from night1rider/wolfssl-documentation-fixes
Wolfssl documentation fixes
2023-07-18 10:14:04 -06:00
425cd2c6dc added "-c" command line option to allow passing extra configure flags, removed curl and harden default options, updated documentation 2023-07-17 14:47:23 -06:00
67d35ea48e Merge pull request #6622 from philljj/zd16426
tfm fp_exptmod_nct: set result to zero when base is zero
2023-07-17 14:29:01 -06:00
b74a7f8e87 spelling fixes 2023-07-17 13:21:44 -07:00
56a34b0be2 Updated Documentation to Include support OS-dependant CA certfications stores it supports for the api: wolfSSL_CTX_load_system_CA_certs 2023-07-17 13:06:29 -06:00
58ac57861f Updated the README.md file and made sure that using default.gpr to build the Ada TLS server application does not try to build the Ada TCL client application that makes use of the secondary stack. 2023-07-17 19:50:05 +02:00
da9541551d Fix for STM32 HAL_RTC_GetDate year. Fixes #6618. 2023-07-17 10:30:47 -07:00
d1db78adb2 fixed typos in README 2023-07-17 11:10:02 -06:00
31aac92635 Merge pull request #6614 from dgarske/silabs_aes
Fix for SiLabs HW acceleration unused function in aes.c
2023-07-17 10:53:20 -06:00
37be7a4800 Merge pull request #6567 from JacobBarthelmeh/vcpkg
fix warning for build with vcpkg
2023-07-17 08:47:15 -07:00
c55c1dd0e4 Update Japanese API comments 2023-07-17 18:28:42 +09:00
00b90adc97 Updated README.md file. Added description of subprograms in the specification file of the WolfSSL package. Made it possible to get error codes through the WolfSSL API. 2023-07-17 01:22:06 +02:00
df58c4dea7 tfm fp_exptmod_nct: handle special cases better 2023-07-15 10:00:50 -05:00
a026d843cf Merge pull request #6564 from philljj/add_lms_hooks
Add LMS/HSS wolfCrypt hooks.
2023-07-14 14:33:25 -06:00
71b28caa09 Added Initialize and Finalize functions to initialize and cleanup resources of the WolfSSL library. Removed definitions of exceptions. 2023-07-14 22:20:39 +02:00
517138806a Merge pull request #6613 from anhu/GENERAL_NAME_set0_value
Adding wolfSSL_GENERAL_NAME_set0_value() compat layer API.
2023-07-14 14:18:58 -06:00
1fe8944363 Merge pull request #6545 from bigbrett/serverListening-include-guard
fix pthread macro protection in tls_bench
2023-07-14 14:14:18 -06:00
ff38d8f018 revert portion of cmake for vcpkg build 2023-07-14 13:27:38 -06:00
1afc0df83d tfm fp_exptmod_nct: set result to zero when base is zero 2023-07-14 13:57:29 -05:00
933dae393e Make PRBs happy 2023-07-14 14:33:43 -04:00
f49ffc0353 The implementations of the tls client and server applications can now be formally verified by the SPARK tools. 2023-07-14 20:30:34 +02:00
707c1a44bc added support for dist bundle 2023-07-14 12:27:10 -06:00
5d24d5114a removed Preview Assets and disabled swiftUI preview, as it is not required and adds unused files to a make dist install 2023-07-14 12:14:19 -06:00
3b773db728 Clean up after myself 2023-07-14 13:43:57 -04:00
a747e7773c LMS: comments, SMALL_STACK, cleanup, etc. 2023-07-14 11:27:59 -05:00
20115f0e23 Merge pull request #6619 from douzzer/20230714-asn-DecodeAuthKeyId-Wconversion-fix
20230714-asn-DecodeAuthKeyId-Wconversion-fix
2023-07-14 10:11:46 -06:00
31a02f194e Address review comments. 2023-07-14 12:09:14 -04:00
7361332c87 Merge pull request #6616 from SparkiDev/sm2_sp_not_avail
ECC and SM2: SP implementation not available yet
2023-07-14 09:58:43 -06:00
e2833f99a3 wolfcrypt/src/asn.c: fix merge conflict between 648f474d83 and 2c9609039d, re -Wconversion in DecodeAuthKeyId(). 2023-07-14 09:53:54 -05:00
f6f8d2eda3 add WC_DO_NOTHING macro to wolfssl/wolfcrypt/types.h, with default expansion "do {} while (0)", and globally refactor to use the macro where appropriate, annotating intended-null macros-with-args with "/* null expansion */";
tweak several #includes of settings.h to include types.h instead (all of these are for clarity, as types.h is indirectly included by later #includes), and add #include <wolfssl/wolfcrypt/types.h> where missing;

remove trailing semicolons from PRAGMA*() macro invocations as they are unneeded and can be harmful (inducing frivolous -Wdeclaration-after-statement etc.).
2023-07-14 09:50:01 -05:00
a96983e6d3 Merge pull request #6612 from dgarske/entropy_memuse_win32
Add support for MemUse Entropy on Windows.
2023-07-14 10:54:51 +10:00
40d0a14c09 Merge pull request #6615 from dgarske/various2
Fix for building ED25519 with no client auth
2023-07-14 10:52:24 +10:00
0d9252de9e review: max line length changes 2023-07-13 16:30:25 -06:00
698bf7b423 fixed typo and added xcode version to overview 2023-07-13 16:24:30 -06:00
377417e668 ECC and SM2: SP implementation not available yet
ecc.c: Keep code, but don't compile in until implementation for SM2
added to SP.
ssl.c: Fix warning for when ECC_MINSIZE is zero and sz is unsigned.
2023-07-14 08:04:00 +10:00
4862b57415 Simplify Windows Entropy_TimeHiRes, which just needs a precision timer to differentiate, not specific time. 2023-07-13 14:30:58 -07:00
4fd5d154a4 Merge pull request #6611 from bandi13/addLibLMS_Docker
Add dependency for liblms
2023-07-13 14:15:07 -07:00
9bed65ad57 split up error message
split #if into multiple lines
2023-07-13 15:14:02 -06:00
b02a22b5b3 added error reporting macro for invalid configuration 2023-07-13 15:14:02 -06:00
44faddac6c fix compiler error for targets that don't define HAVE_PTHREAD 2023-07-13 15:14:02 -06:00
e3e0b4505c Fix for building ED25519 with WOLFSSL_NO_CLIENT_AUTH or NO_ED25519_CLIENT_AUTH set:
```
/wolfssl/src/ssl.c:6744:33: error: 'Options' has no member named 'cacheMessages'
 6744 |                     ssl->options.cacheMessages = 1;
      |
```
2023-07-13 13:53:04 -07:00
00add89deb Fix for unused AesDecrypt in aes.c with SiLabs AES acceleration enabled (WOLFSSL_SILABS_SE_ACCEL). ZD15874 2023-07-13 13:50:15 -07:00
4ccd6dfbe1 Adding wolfSSL_GENERAL_NAME_set0_value() compat layer API. 2023-07-13 16:09:47 -04:00
761a976d0c Add support for MemUse Entropy on Windows. 2023-07-13 12:56:13 -07:00
4bf642283c Merge pull request #6597 from SparkiDev/mp_test_div_fix
test.c: fix protection around calling mp_test_div
2023-07-13 13:37:27 -06:00
11d26797d2 Merge pull request #6601 from SparkiDev/type_conversion_fixes_2
Type conversion fixes: make explicit
2023-07-13 13:33:58 -06:00
9379a8a094 added standard license headers, switched to C-style comments 2023-07-13 12:58:38 -06:00
8cd06c64b2 Add dependency for liblms
Usage: './configure --enable-lms=yes --with-liblms=/opt/sources/hash-sigs'
2023-07-13 14:22:55 -04:00
c8209068c2 added apple univeresal binary framework build script and example 2023-07-13 12:02:12 -06:00
90b32d7857 Merge pull request #6596 from bandi13/updateLibOQS
Use liboqs v0.8
2023-07-13 09:37:01 -07:00
45d8a5b04c Ada version of TLS v1.3 client application implemented 2023-07-13 16:49:22 +02:00
8c012b5df5 Merge pull request #6599 from SparkiDev/heapmath_mp_exptmod_fix
Heap Math exptmod: fixes for valid modulus checks
2023-07-12 16:57:51 -06:00
cf15789c7f Merge pull request #6598 from SparkiDev/sm_update_3
EVP SM3: fix cast
2023-07-12 16:56:35 -06:00
b889b27b8c Merge pull request #6585 from cconlon/x509Ext
Fixes for WOLFSSL_X509 cert gen, WOLFSSL_ALT_NAMES to --enable-jni
2023-07-12 16:55:08 -06:00
2c9609039d Type conversion fixes: make explicit
Changed to types and casting so that there are no implcit conversion
warnings (gcc -Wconversion) in these files.
2023-07-13 08:36:02 +10:00
62c14e4d5b Merge pull request #6604 from douzzer/20230711-linuxkm-fixes
20230711-linuxkm-fixes
2023-07-12 16:26:56 -06:00
a8ed78e012 define WOLFSSL_ALT_NAMES in --enable-jni build 2023-07-12 14:33:45 -06:00
ea7ea356a0 Fixes for WOLFSSL_X509 cert generation with key usage, extended key usage, and basic constraints 2023-07-12 14:33:42 -06:00
d20a096ffa Ada Bindings for wolfSSL. Credit Joakim Dahlgren Strandberg <joakimds@kth.se> 2023-07-12 12:37:52 -07:00
648f474d83 configure.ac:
if ENABLED_LINUXKM_PIE, add -DWOLFSSL_NO_OCSP_ISSUER_CHECK to gate out backward dependency in asn.c;

  if ENABLE_LINUXKM, don't error on FIPS without thread_ls_on;

  for --enable-curl, set ENABLED_MD4="yes", and move --enable-md4 AC_ARG_ENABLE() clause up to a position adjacent to des3 handling;

scripts/sniffer-gen.sh: fix illegal exit code (SC2242);

src/internal.c: fix clang-analyzer-core.NonNullParamChecker in CreateTicket();

src/ocsp.c: fix readability-redundant-preprocessor;

src/tls.c: fix empty-body in TLSX_PskKeModes_Parse() and clang-diagnostic-unreachable-code-break in ALPN_Select();

tests/api.c: fix several clang-analyzer-core.NullDereference related to Expect*() refactor;

wolfcrypt/src/asn.c:

  fix -Wconversions in DecodeAuthKeyId() and ParseCertRelative();

  fix readability-redundant-declaration re GetCA() and GetCAByName();

  gate inclusion of wolfssl/internal.h on !defined(WOLFCRYPT_ONLY);

wolfssl/internal.h: add macro-detection gating around GetCA() and GetCAByName() prototypes matching gates in wolfcrypt/src/asn.c;

tests/utils.c: in create_tmp_dir(), use one-arg variant of mkdir() if defined(__CYGWIN__) || defined(__MINGW32__).
2023-07-12 13:47:40 -05:00
8e89e31f70 test.c: fix protection around calling mp_test_div
Caller of mp_test_div() had different #ifdef protection declaration.
Made them the same.
2023-07-12 10:55:50 +10:00
b8119af455 Merge pull request #6594 from lealem47/curl
Fix for curl build
2023-07-11 17:13:59 -07:00
b18bc86ef8 Heap Math exptmod: fixes for valid modulus checks
mp_exptmod_base_2() uses Montogmery method and does not support even
modulus. Added check.
mp_exptmod_fast() uses Montogmery method when odd not when dr > 0.
Comment updated at call.
Reduce value of zero doesn't work for mp_reduece_2k. Changed setup of
use to check for zero and won't use it. Other methods won't work either.
2023-07-12 09:20:11 +10:00
96f745af6f EVP SM3: fix cast
wc_Sm3Update takes a word32 for the size.
Others cases are using the OpenSSL compatibility API but SM3 APIs don't
exist in OpenSSL.
2023-07-12 08:05:03 +10:00
d6a6cbb83e Merge pull request #6595 from dgarske/various
Fix for no malloc with SP and fix defaultdhparams typo
2023-07-12 07:19:52 +10:00
fd72b885b6 Merge pull request #6592 from embhorn/zd16415
Fix Micrium config and new examples with NO_FILESYSTEM
2023-07-11 15:01:18 -06:00
4c125ece77 LMS: cleanup INSTALL, and cap threads to 4. 2023-07-11 15:04:51 -05:00
6fa080642c Use liboqs v0.8 2023-07-11 15:36:44 -04:00
f30364a00d Fix test 2023-07-11 13:27:37 -06:00
e140a83fad Add curl gh actions test 2023-07-11 13:27:37 -06:00
5fbe319ce9 Remove references to config.h from test headers 2023-07-11 13:27:37 -06:00
1329543b62 Other miscellaneous fixes 2023-07-11 13:27:37 -06:00
bcbeef7647 Fix for curl build 2023-07-11 13:27:37 -06:00
0b18e250ed Merge pull request #6576 from iyanmv/liboqs-1.8
Rename sphincs algs to follow upstream
2023-07-11 14:56:49 -04:00
36c1d20bb2 If malloc is disabled make sure it is also disabled in SP math 2023-07-11 11:51:40 -07:00
3e9bdb7671 Fix defaultdhparams typo fix logic. 2023-07-11 10:26:40 -07:00
8f36f78e6c Merge pull request #6400 from bandi13/ARIA-cipher
Aria cipher
2023-07-11 09:50:42 -07:00
fd091a745c Include all post-quantum algorithm files in cmake
GH-5407 already included falcon.c, but now we also add sphincs.c,
dilithium.c and ext_kyber.c to avoid undefined reference errors.
2023-07-11 17:57:00 +02:00
ba4c96f727 Merge pull request #6593 from SparkiDev/sm_update_2
SM cipher suite: fix name
2023-07-11 09:28:24 -06:00
ecc138fc6e Fixed g++ shortcomings 2023-07-11 09:26:39 -04:00
d7c3a176e2 LMS cleanup. 2023-07-10 23:43:07 -05:00
9f61cb9f2a Merge pull request #6590 from dgarske/sp_math_only
Fix for SP math only case to ensure fast math and heap math are disabled
2023-07-11 10:33:46 +10:00
29edef1645 Fix for SP math only case to ensure fast math and heap math are disabled. Also fix build error for case where WOLFSSL_HAVE_SP_ECC is defined, but HAVE_ECC is not. ZD 16419 2023-07-10 15:12:38 -07:00
d84adce608 Fix Micrium config and new examples with NO_FILESYSTEM 2023-07-10 17:12:12 -05:00
f26b8bdf62 Merge pull request #6584 from julek-wolfssl/issue/6554
Always enable tls13MiddleBoxCompat with WOLFSSL_TLS13_MIDDLEBOX_COMPAT
2023-07-11 07:53:56 +10:00
ce02ad7347 SM cipher suite: fix name
Fix name of TLSv1.3 CCM cipher suite.
2023-07-11 07:30:44 +10:00
a317ac280c PR comments 2023-07-10 16:50:54 -04:00
27a95e7e82 CMake is on a TODO for later 2023-07-10 15:44:30 -04:00
2299282fdd Merge pull request #6235 from kareem-wolfssl/hitch
Hitch
2023-07-10 11:46:57 -07:00
e4c9a73296 Merge pull request #6587 from gojimmypi/ESP32WROOM-refactor
Espressif refactor WROOM32 ESP32
2023-07-10 11:46:10 -07:00
d64d73a13f Fix format keys 2023-07-10 19:43:59 +02:00
8906ee95fd Hitch code review feedback. 2023-07-10 10:06:12 -07:00
2d0cc65381 Fix hitch test make check. 2023-07-10 10:06:12 -07:00
56328d845a Hitch code review feedback. 2023-07-10 10:06:12 -07:00
3bfa189286 Fix hitch Github action. 2023-07-10 10:06:12 -07:00
e871b1c04d Add hitch support to wolfSSL.
Add support for cipher aliases DHE, EDH and EECDH.

Add define SSL_CTRL_GET_CHAIN_CERTS to help hitch and other programs detect SSL_CTX_get0_chain_certs is supported.

Add wolfSSL_get_locking_callback.

Allow using ECDHE+RSA cipher suites when ECDHE alias is used while in OpenSSL compatibility mode.

Add more alerts for hitch.

SSL_CM should use the CTX's x509_store_pt if available.

Add support for SSL_CERT_FILE and SSL_CERT_DIR.  Load default OpenSSL TLS 1.3 ciphers when using OPENSSL_COMPATIBLE_DEFAULTS.

Use wolfSSL_sk_X509_new_null to allocate WOLFSSL_STACK in wolfSSL_CTX_get_extra_chain_certs.  Previous approach of malloc'ing without setting type/memsetting was leading to a segfault.

Add --enable-hitch.

hitch: Add unit tests for new APIs, fix a couple of issues uncovered by unit testing.

Correct behavior of wolfSSL_BIO_set_mem_buf for BIO_CLOSE/NOCLOSE and update unit test accordingly.

Add Github action test for hitch.
2023-07-10 10:06:10 -07:00
9d18648dfb Merge pull request #6589 from SparkiDev/aarch64_aes_opensslextra_fix
AES GCM stream: arm asm fix when --enable-opensslextra
2023-07-10 10:55:50 -06:00
0a02218ba3 Clean up allocated memory on failure 2023-07-10 12:37:07 -04:00
7c14ea67ae Rename sphincs algs to follow upstream
This also adds new keys for SPHINCS+. The reason is that SPHINCS+
was updated to 3.1 in liboqs (open-quantum-safe/liboqs/pull/1420),
and old keys are incompatible with the new implementation.

Keys were generated using the oqs-provider for OpenSSL 3

openssl genpkey \
    -provider default -provider oqsprovider \
    -algorithm sphincsshake128fsimple \
    -outform der \
    -out bench_sphincs_fast_level1_key.der

And certs_test.h was updated using xxd

xxd -i -c 10 -u bench_sphincs_fast_level1_key.der

This was repeated for the 6 variants of SPHINCS+ that wolfSSL supports.
2023-07-10 18:31:07 +02:00
299b4d8552 Make wc_BuildEccKeyDer non-static 2023-07-10 11:32:17 -04:00
2426cf14ca Merge pull request #6583 from SparkiDev/certman_split
Moved CertManager APIs into own file
2023-07-10 09:20:09 -06:00
0efdf966d0 addressing PR comments 2023-07-10 11:14:07 -04:00
86fd570e8c Remove MyKeyLog.txt 2023-07-10 13:23:35 +02:00
d0b8b919df Always enable tls13MiddleBoxCompat with WOLFSSL_TLS13_MIDDLEBOX_COMPAT 2023-07-10 11:40:51 +02:00
9f6ef65e8f Merge pull request #6557 from julek-wolfssl/zd/16332
Don't allow a resumption handshake inside of a SCR
2023-07-10 13:51:29 +10:00
fa053be533 Merge pull request #6496 from JacobBarthelmeh/PKCS7
parse ASN1 only with SMIME_read_PKCS7
2023-07-10 10:16:20 +10:00
360b61aff2 AES GCM stream: arm asm fix when --enable-opensslextra
aadLen is now in gcm field of Aes.
2023-07-10 10:13:26 +10:00
52a3d591b5 Fix check of date to respect VERIFY_SKIP_DATE in ASN.1 template
DecodeCertInternal was not recognizing VERIFY_SKIP_DATE.
2023-07-10 10:05:59 +10:00
9d3a95a287 account for error return in test case when building without pkcs7 streaming 2023-07-09 12:42:29 -07:00
0e2749eeb4 adjust test case for asn=original 2023-07-08 07:37:26 -07:00
7866a40d06 resolve kari decode without recipient certificate 2023-07-08 07:37:26 -07:00
f0354b4cbe parse ASN1 only with SMIME_read_PKCS7 2023-07-08 07:36:10 -07:00
57546405c0 refactor WROOM32 ESP32 2023-07-07 15:47:00 -07:00
770590a3be Rebase fix to add back set_verify call in CertManagerLoadCA. Fix API tests for bad date check. Various spelling fixes. 2023-07-07 15:08:08 -07:00
3af87f6f93 Moved CertManager APIs into own file
Split out certificate manager APIs into ssl_certman.c.
ssl.c includes ssl_certman.c
Better test coverage.
Minor fixes.
wolfSSL_X509_chain_up_ref calls XFREE with name->heap but name may be
NULL. Check for NULL first.
2023-07-07 15:08:08 -07:00
f2809c5a24 Merge pull request #6586 from julek-wolfssl/zephyr-action
Add zephyr testing github action
2023-07-07 14:54:07 -07:00
55bbd5865c LMS/HSS: cleanup, and safer write/read callbacks 2023-07-07 15:30:50 -05:00
c4cbf0508b Add zephyr action 2023-07-07 20:18:19 +02:00
7213cb3cfb Merge pull request #6463 from dgarske/silabs_erf32
Updated support for Silicon Labs Simplicity Studio and the ERF32 Gecko SDK
2023-07-07 11:42:00 -06:00
91fb24161b Merge pull request #6515 from julek-wolfssl/nginx-1.25.0
Add support for nginx-1.25.0
2023-07-07 09:29:23 -07:00
9599ddd80a Merge pull request #6575 from julek-wolfssl/zd/15258
Properly enforce the pathLenConstraint of the BasicConstraints extension
2023-07-07 08:58:28 -07:00
abe1bce914 Fix silabs_ecc_export_public to set the signing only flag. Added tests cases for import of private and public only verify in the SiLabs example. 2023-07-07 08:25:46 -07:00
0abaa89787 Add support for nginx-1.25.0
- nginx: add necessary defines and function
- Implement Certificate Authorities for TLS 1.3
- Implement secret logging for TLS 1.3. Can be used for example with:
  ./configure CPPFLAGS="-DWOLFSSL_SSLKEYLOGFILE -DSHOW_SECRETS -DHAVE_SECRET_CALLBACK -DWOLFSSL_SSLKEYLOGFILE_OUTPUT='\"/tmp/secrets\"'"
- Implement session context checking for tickets
- Check for authorized responder in OCSP basic response
- Fix handling call to ocsp->statusCb
- compat: Translate SOCKET_PEER_CLOSED_E to WOLFSSL_ERROR_SYSCALL
- Fix wolfSSL_CTX_set_session_cache_mode
  - WOLFSSL_SESS_CACHE_OFF means nothing should be on
  - WOLFSSL_SESS_CACHE_NO_INTERNAL turns off only the internal cache
- Respect ssl->options.internalCacheOff
- Implement SSL_SESSION_set_time
- wolfSSL_SSL_in_init: fix detection for TLS 1.3
- Fix handling call to ssl->alpnSelect
- SendTls13NewSessionTicket: always generate new ID
  - When we send a new ticket for the same session (for example we resumed a connection and are sending a new ticket so that the client can resume in the future), we need to generate a new ID so that we don't overwrite the old session in the cache. Overwriting the session results in the `diff` calculation in `DoClientTicketCheck()` producing the wrong value and failing to resume.
Add nginx github action test
- Fix memory leaks
- wolfSSL_OCSP_basic_verify: implement OCSP_TRUSTOTHER flag
- AKID: implement matching on issuer name and serial number
- ocsp: check for a chain match for OCSP responder
- Split CreateTicket into CreateTicket and SetupTicket
- SendCertificateStatus: free response.buffer
- Use heap hint when allocating responseBuffer
- Remove responseBuffer from internal API's that don't use it anywhere
2023-07-07 11:22:58 +02:00
52b5adb54a Merge pull request #6581 from kareem-wolfssl/eccNullKCheck
Fixed crash in wc_ecc_free.
2023-07-07 10:54:18 +10:00
4d25faafe2 Merge pull request #6582 from SparkiDev/aes_gcm_arm_fix
AES-GCM ARM asm: fixes from GCM changes
2023-07-06 17:12:08 -07:00
f3bae3192a Merge pull request #6580 from dgarske/sig_verify
Fix for `wc_SignatureGenerate_ex` calling verify twice
2023-07-07 08:40:39 +10:00
af5b3b551a AES-GCM ARM asm: fixes from GCM changes
GCM is now its own structure.
GMULT, GHASH, GenerateM0 made public and fixed here too.
2023-07-07 08:35:14 +10:00
2248140bf3 Clear ssl->arrays->sessionIDSz at start of function 2023-07-06 15:13:56 -07:00
57e53d1a43 Don't allow a resumption handshake inside of a SCR 2023-07-06 15:13:56 -07:00
fb9e036d5b Add NULL check in TFM's fp_forcezero. 2023-07-06 14:47:18 -07:00
657679efda Only check for ALT_ECC_SIZE case, otherwise key->k is an array which will never be NULL. 2023-07-06 21:15:37 -07:00
e995568626 Fixed crash in wc_ecc_free. 2023-07-06 21:10:32 -07:00
4f9b5de802 File gating 2023-07-06 17:03:57 -04:00
8421b384fb Settable 'keyAsn1' max length 2023-07-06 17:02:44 -04:00
ef9206f73f Addressing PR comments 2023-07-06 16:42:12 -04:00
266307da6c Add in ARIA wrappers
Address PR comments + other cleanup


Addressing PR comments


Minor change


Make sure the last line gets output as well


Add in ARIA SHA256 session to internal structure


Add in ARIA SHA384 session to internal structure


Add necessary function for ARIA to extract key


Fix unit tests


Rename HAVE_ARIAGCM to HAVE_ARIA


Move aria.* to wolfcrypt/port/aria


Separate out aria-crypt init functions


Adding in ECC+SHA callbacks


Avoid using AC_CHECK_FILE


Rename Aria to wc_Aria


Don't need special cases


Addressing PR comments


Code cleanup


C89 support


Remove TODO


Add documentation about buffer size


Clean up header files


Use ARIA_DEVID by default if available


Dummy update call to make MagicCrypto happy


Fix for detecting what algo type to use


Documentation


Use the appropriate sign/verify


Collect MagicCrypto functions together (and avoid leaks)


Fall back on other implementations on failure


Fix issue when compiling without CRYPTOCB


Addressing PR comments


Better cleanup


Addressing PR comments


Cleaner exit in case of error
2023-07-06 16:09:23 -04:00
2cf916581d Jenkins fixes 2023-07-06 19:55:54 +02:00
c041863aaa Code review 2023-07-06 19:00:11 +02:00
d2642e329d Properly enforce the pathLenConstraint of the BasicConstraints extension
- move the testsuite file helps into a new tests/utils.c file so that they can be used across all tests
- dump the raw TLS stream when WOLFSSL_DUMP_MEMIO_STREAM is defined so that it can be examined in Wireshark
2023-07-06 19:00:11 +02:00
9ca53ac7f7 Fix for wc_SignatureGenerate_ex calling verify twice. 2023-07-06 09:34:03 -07:00
fb0c769d6c Merge pull request #6578 from douzzer/20230705-analyzer-fixes
20230705-analyzer-fixes
2023-07-06 09:04:39 -07:00
e8f3afc85b Merge pull request #6579 from julek-wolfssl/getsockopt-endianness
getsockopt needs to take in an int
2023-07-06 09:04:13 -07:00
caa0e5aabf Fix for silabs_ecc_export_public to set the type (curve). 2023-07-06 08:57:02 -07:00
67bef21185 Add LMS/HSS wolfCrypt hooks. 2023-07-06 10:55:53 -05:00
794425c431 Merge pull request #6577 from SparkiDev/sm_update_1
SM tests: void in function declaration that is its prototype
2023-07-06 06:04:14 -07:00
0b4e4287c9 getsockopt needs to take in an int
This caused an issue on big endian platforms

From the getsockopt man page:
       Most socket-level options utilize an int argument for optval.  For setsockopt(), the argument should be non‐
       zero to enable a boolean option, or zero if the option is to be disabled.
2023-07-06 11:40:36 +02:00
1912f1bc2a fixes for clang-analyzer-core.NullDereference, clang-analyzer-core.NonNullParamChecker, clang-analyzer-deadcode.DeadStores, readability-redundant-preprocessor, clang-diagnostic-unreachable-code-break, -Werror=sign-conversion, bugprone-macro-parentheses, "Call to 'malloc' has an allocation size of 0 bytes", clang-diagnostic-declaration-after-statement re tests/unit.h:ExpectPtr() pragmas. 2023-07-06 00:53:37 -05:00
7a73c9aac7 SM tests: void in function declaration that is its prototype
Need to have void in prototype of funtion.
2023-07-06 08:57:30 +10:00
652c5491fe Merge pull request #6571 from julek-wolfssl/dtls-mtu-interop
Always add DTLS_MTU_ADDITIONAL_READ_BUFFER for better MTU interop
2023-07-05 13:03:10 -07:00
b0c2e29a2e Always add DTLS_MTU_ADDITIONAL_READ_BUFFER for better MTU interop 2023-07-05 10:19:19 -07:00
856b5c3f1b Merge pull request #6566 from JacobBarthelmeh/soname
update soname to 40
2023-07-05 09:21:10 -07:00
f00b5c3a1e Merge pull request #6537 from SparkiDev/sm
SM2/SM3/SM4: Chinese cipher support
2023-07-04 10:03:37 -07:00
b682c2c4bb Merge pull request #6437 from julek-wolfssl/windows-crl-monitor
Implement CRL monitor for Windows
2023-07-04 10:03:14 -07:00
7af1f0cf05 Add additional windows logging for DoMonitor 2023-07-04 14:12:38 +02:00
f58539581d Fix DoMonitor for Mac/BSD 2023-07-04 13:24:00 +02:00
2feec88702 Add comment explaining threading usage 2023-07-04 11:18:44 +02:00
713670dcc7 Use smaller buffer for copying 2023-07-04 11:18:44 +02:00
3d2db844c1 Speed up waiting for file removal 2023-07-04 11:18:44 +02:00
50752f5a2b Fix typos found by codespell 2023-07-04 07:21:27 +02:00
e2424e6744 SM2/SM3/SM4: Chinese cipher support
Add support for:
 - SM2 elliptic curve and SM2 sign/verify
 - SM3 digest
 - SM4 cipher with modes ECB/CBC/CTR/GCM/CCM

Add APIs for SM3 and SM4.
Add SM2 sign and verify APIs.
Add support for SM3 in wc_Hash and wc_Hmac API.
Add support for SM3 and SM4 through EVP layer.
Add support for SM2-SM3 certificates. Support key ID and name hash being
with SHA-1/256 or SM3.
Add support for TLS 1.3 cipher suites: TLS-SM4-GCM-SM3, TLS-SM4-CCM-SM3
Add support for TLS 1.2 SM cipher suite: ECDHE-ECDSA-SM4-CBC-SM3
Add support for SM3 in wc_PRF_TLS.
Add SM2-SM3 certificates and keys. Generated with GmSSL-3.0.0 and
OpenSSL.
2023-07-04 13:36:28 +10:00
6028dfd394 Merge pull request #6523 from gojimmypi/wc-memory-test
Add wolfcrypt test: R/O filesystem const memory pointer
2023-07-03 11:58:13 -07:00
a921ab754d Merge pull request #6569 from SparkiDev/pem_der_example
PEM example: new example for convert between PEM and DER
2023-07-03 11:31:36 -07:00
573fedae2f add const_byte_ptr_test for Xtensa -mforce-l32 check 2023-07-03 10:44:01 -07:00
ad2621a7a0 Merge pull request #6572 from douzzer/20230703-clang-tidy-fixes
20230703-clang-tidy-fixes
2023-07-03 10:43:45 -07:00
f72a6b705f Minor spelling fixes. 2023-07-03 10:23:55 -07:00
214f9f55c4 fixes for bugprone-suspicious-missing-comma, clang-analyzer-core.NullDereference, and readability-redundant-preprocessor. 2023-07-03 11:30:08 -05:00
678a65822f Merge pull request #6556 from StMartin81/Fix_compilation_of_wc_RsaFunctionNonBlock_if_WOLFSSL_RSA_PUBLIC_ONLY_is_defined
Fix compilation of wc_RsaFunctionNonBlock if WOLFSSL_RSA_PUBLIC_ONLY …
2023-07-03 08:55:36 -07:00
732ef09da6 Merge pull request #6551 from SparkiDev/asn_no_certs
ASN: fix so that NO_CERTS configurations work
2023-07-03 08:55:14 -07:00
3d68bcd6f7 Jenkins fixes 2023-07-03 14:02:51 +02:00
ca77da92e5 Implement pthreads threading 2023-07-03 14:02:51 +02:00
bff2cf5690 Add crl monitor unit testing 2023-07-03 14:02:51 +02:00
8ab0050801 Init windows CRL monitor 2023-07-03 14:02:51 +02:00
a39a04fc88 PEM example: new example for convert between PEM and DER
PEM example converts PEM to DER and DER to PEM.
Supports encrypting DER and writing out as PEM.

Added better support for 40-bit RC2-CBC PBE.
Added AES-128-CBC encryption support with PKCS#5v2.
Fixed handling of iterations to support writing 24-bit values.
Declared enum types for pass to PKCS#8 encryption APIs.

Add more DER and PEM files to certs directory.
Add testing of 'pem' with pem.test script.
2023-07-03 17:20:35 +10:00
5be883a995 ASN: fix so that NO_CERTS configurations work
Moved code around and update #ifdefs so that --enable-cryptonly
CFLAGS=-DNO_CERTS compiles.
2023-07-03 09:16:44 +10:00
da4424cd0c Merge pull request #6559 from dgarske/sni_defaults
Turn on SNI by default on hosts with resources
2023-07-03 08:07:45 +10:00
e2a1bc6e6a fix warning for build with vcpkg 2023-06-30 15:53:46 -07:00
a4c058649b Merge pull request #6560 from dgarske/stm32_nuttx
Support for using the Nuttx STM RNG register definitions
2023-06-30 16:15:49 -06:00
877979c5c2 update soname to 40 2023-06-30 14:40:26 -07:00
052fba887c Merge pull request #6563 from SKlimaRA/SKlimaRA/fix-funky-ifdef
fixed bug in ifdef logic caused in pull req 6277
2023-06-30 14:30:47 -07:00
e1cb74f24a Merge pull request #6492 from night1rider/wolfssl-wolfcrypttest-statickeys
Added to cert buffer keys and updated testwolfcrypt
2023-06-30 14:21:40 -06:00
5ba579397d Make public wc_ api for EncodeObjectId 2023-06-30 14:14:27 -06:00
c2726b4cbe fixed bug in ifdef logic caused in pull req 6277 2023-06-30 13:08:07 -07:00
81484ef74b Fix compilation of wc_RsaFunctionNonBlock if WOLFSSL_RSA_PUBLIC_ONLY is defined 2023-06-30 13:05:21 -07:00
6052e01879 Fixes for SNI test with static memory enabled. Fixes for other minor static memory build combinations. 2023-06-30 13:04:05 -07:00
79a7d21932 Turn on SNI by default on hosts with resources. 2023-06-30 13:04:05 -07:00
53c30f44a0 Support for using the Nuttx STM RNG register definitions, enabled with STM32_NUTTX_RNG. ZD 16315 2023-06-30 13:00:52 -07:00
95675c7e34 Merge pull request #6455 from lealem47/INIT_SSL_NO_CTX_KEY
Allow option to create SSL without key/cert in ctx
2023-06-30 10:35:52 -07:00
9fc68f4a80 Merge pull request #6558 from anhu/wolfSSL_X509_NAME_heap
Allocate WOLFSSL_X509_NAME with heap hint.
2023-06-30 10:35:08 -07:00
1c33cefff7 Merge pull request #6562 from SparkiDev/wolfbot_fixes_1
wolfBot fixes
2023-06-29 19:13:17 -07:00
a1939d22b9 wolfBot fixes
Importing an EC point ordinate with one being zero will result in
different errors based on different implementations. Check both known
error codes.

Benchmark usage fixed.
2023-06-30 09:07:46 +10:00
7720dac545 Allow option to create SSL without key/cert in ctx 2023-06-29 13:57:40 -06:00
ed4774f606 Allocate WOLFSSL_X509_NAME with heap hint. 2023-06-29 12:04:32 -04:00
048083cfe3 Merge pull request #6329 from tmael/crl_off
Add support for enabling and disabling CRLs.
2023-06-28 16:03:25 -07:00
d029ba4d46 Merge pull request #6415 from julek-wolfssl/issue/6408
Ignore session ID's shorter than 32 bytes instead of erroring out
2023-06-29 08:20:48 +10:00
c45f7c87b0 Make DecodeObjectId available for OPENSSL_ALL 2023-06-28 13:46:45 -06:00
7251d564eb Use new RID function in asn=original 2023-06-28 13:04:47 -06:00
47350fa95c Remove manual encoding of OID in txt2oidBuf 2023-06-28 12:53:34 -06:00
ee63d73299 Restore nid2oid functionality to preserve expected behaviour 2023-06-28 12:53:34 -06:00
1d83448df7 memcpy instead of strcpy 2023-06-28 12:53:34 -06:00
48de458017 Add Obj_txt2oidBuf function 2023-06-28 12:53:34 -06:00
2a539fe028 Cleanup 2023-06-28 12:53:34 -06:00
fdc95f9ba6 Handle registeredID correctly 2023-06-28 12:53:34 -06:00
90f5665318 Improve subjectAltName extension parsing and printing 2023-06-28 12:53:34 -06:00
dcfa410540 Merge pull request #6289 from jpbland1/nuttx-hw-acel
Nuttx hw acel benchmark with STM32_HW_CLOCK_AUTO
2023-06-28 09:32:48 -07:00
e0651e4eb3 Merge pull request #6434 from TakayukiMatsuo/fixtypo
Fixed some typos in Japanese help in examples/client
2023-06-28 11:20:42 +09:00
8e3afbd6e3 Merge pull request #6547 from philljj/fix_cut_call
fix detection of cut tool in configure.ac
2023-06-27 16:19:52 -07:00
78107b0f88 Merge pull request #6540 from dgarske/bench_fix
Fix for benchmark always using 4KB of memory for `gStats`
2023-06-27 16:18:29 -06:00
c72d008a5c add STM32_HW_CLOCK_AUTO which turns the stm32 hw
accleration clock on and off automatically
2023-06-27 17:16:46 -04:00
fbadcf67da add the STM32 peripheral clock enable and disable
calls to the benchmark program so the benchmark program can use hardware accleration
2023-06-27 17:16:46 -04:00
d9d9c5cd3d Merge pull request #6549 from gojimmypi/pthread_gate
Revert #6536 types.h one line HAVE_PTHREAD
2023-06-27 13:42:16 -07:00
6b26b071e4 Merge pull request #6532 from embhorn/forum_topic2018
Fix WinCE XSEEK_SET
2023-06-27 13:26:18 -07:00
0d0d2cf50c Merge pull request #6531 from bandi13/extraCMakeOptions
Extra c make options
2023-06-27 13:26:03 -07:00
b1fe15dc70 Further refactor of the benchmark stats tracking. Always use the allocated list (avoids using a stack pointer for ECC descriptions). 2023-06-27 13:05:04 -07:00
e0fa25eedc Merge pull request #6548 from lealem47/gplusplus
Fix for g++ builds
2023-06-27 13:02:50 -07:00
8867f484e5 Revert #6536 types.h one line HAVE_PTHREAD 2023-06-27 12:36:53 -07:00
91962a1a78 Fix for g++ builds 2023-06-27 12:50:56 -06:00
41d248461b fix detection of cut tool in configure.ac 2023-06-27 13:18:25 -05:00
51ca7bb8e3 Fix to support using -print with WC_BENCH_TRACK_STATS. 2023-06-27 10:25:48 -07:00
9a4237ee88 Merge pull request #6457 from lealem47/gcc-arm-user-settings
Improve GCC-ARM user-settings.h FIPS configurability
2023-06-27 11:17:56 -06:00
145ca4ae9d Merge pull request #6542 from SparkiDev/api_fixes_1
Tests api.c: fixes
2023-06-27 10:00:07 -07:00
500b66eb36 Add API for exporting a SiLabs SE ECC key to a wolf ECC key (silabs_ecc_export_public). Add API for supporting export of a vault's public key. Add an ECC signature example for SiLabs. 2023-06-27 09:36:41 -07:00
26e6fd9a6f update wolfSSL_X509_STORE_set_flags 2023-06-27 08:29:13 -07:00
cb0e2c8b0f Maintain existing behavor when not using OPENSSL_COMPATIBLE_DEFAULTS 2023-06-27 08:29:13 -07:00
03e5d109c7 Add test_wolfSSL_dup_CA_list 2023-06-27 08:29:13 -07:00
481ae20fcb Maintain consistent behavior when activating CRL 2023-06-27 08:26:02 -07:00
fd17fa3e9c Implement the option to disable CRL check
Do leaf CRL check by default
Correct wolfSSL_sk_X509_NAME_push return check
Update OpenSSL compatibility errors for HAProxy
Change X509_V to literal constant values
Fix the compat layer with TLS session ticket reuse
Fix for tls1_2 session resume and cache miss
Save intitial wolfSSL ctx
Check for OpenSSL CRL error code 23
2023-06-27 08:26:02 -07:00
291c538e5f Ignore session ID's shorter than 32 bytes instead of erroring out 2023-06-27 14:51:46 +02:00
23c60b7b9c Merge pull request #6530 from SparkiDev/tests_api_expect_5
Test api.c: change more tests to use Expect instead of Assert
2023-06-26 16:10:52 -07:00
578f56e60c Test api.c: change more tests to use Expect instead of Assert
bio.c:
  wolfSSL_BIO_flush(): check allocation to bio->ip succeeded.

internal.c:
  InitSSL_Ctx(): set ctx->heap to heap if value passed in
ProcessPeerCerts(): check for error MEMORY_E too as a fatal parsing
error

ssl.c:
wolfSSL_shutdown(): SOCKET_ERROR_E is also an indication that the
socket is done, MEMORY_E is a fatal error
  wolfSSL_Cleanup(): move free of memory fail couting to wolfSSL API
  SessionTicketNoncePrealloc(): eror return must be non-zero
AddSessionToCache(): XFREE checks for NULL no need to do it before
call
wolfSSL_set_psk_use_session_callback(): ensure ssl is not NULL before
dereferencing
wolfSSL_SMIME_read_PKCS7(): check for error return from
wolfSSL_BIO_gets()

asn.c:
  wc_MIME_parse_headers(): check allocation succeeded into nextHdr

compress.c:
  wc_DeCompressDynamic(): free tmp on inflateInit2 failure

memory.c: rework where memory allocation failure counting code for when
WOFLSSL_STATIC_MEMORY is defined

wc_port.c:
wolfCrypt_Cleanup(): only call wc_MemFailCount_Free() when no
wolfSSL_Cleanup()
2023-06-27 08:01:33 +10:00
17bc833bd3 Merge pull request #6543 from embhorn/gh6506
Spelling fixes in script generated files
2023-06-27 07:28:35 +10:00
51ffe9691f Spelling fixes in script generated files 2023-06-26 09:48:15 -05:00
6b240fa41a Refactor HAVE_PTHREAD and _POSIX_THREADS (#6536)
* HAVE_PTHREAD gate in test.h
* add config.h and settings.h to test.h
* added config.h and settings.h to other test.h in wolfcrypt/test
* settings #ifdef _POSIX_THREADS HAVE_PTHREAD
* cyassl settings _POSIX_THREADS HAVE_PTHREAD
* undo cyassl _POSIX_THREADS HAVE_PTHREAD
* move settings.h #include in both test.h
* add !defined(SINGLE_THREADED) logic
* refactor  HAVE_PTHREAD, _POSIX_THREADS
2023-06-26 07:32:20 -07:00
b7332e33c7 Tests api.c: fixes
NULL dereference.
Uninitialized variable use.
2023-06-26 16:04:24 +10:00
18032cdc40 Merge pull request #6535 from dgarske/wpas_small
Fix for `--enable-wpas=small`
2023-06-23 16:19:31 -07:00
514ea2d0b1 Merge pull request #6510 from mitchcapper/win32_better_socket_error_msg_pr
Added For TranslateIoError in debug mode use FormatMessage to get a better error message
2023-06-23 15:33:34 -07:00
af0facad9f Fix for --enable-wpas=small. 2023-06-23 14:25:39 -07:00
48dc288b83 Fix for wc_ecc_import_raw_private using 0 for key size. Add check in silabs_ecc. 2023-06-23 14:22:46 -07:00
cde4e8e13d Fix for signing with vault to only use if private key is not supplied. Refactor the silabs ECC key import code. Added checks for all silabs_ecc return codes. 2023-06-23 14:22:45 -07:00
fc153ff273 Support for Silicon Labs Gecko SDK v4. Changes SE Hash to use multipart API's. Gecko SDK v3 auto-detected or manually forced using WOLFSSL_SILABS_SE_ACCEL_3. 2023-06-23 14:22:44 -07:00
83dca07421 Updated support for Silicon Labs Simplicity Studio and the ERF32 Gecko SDK. Fix ECC unused functions with HW crypto like SE. ZD 15874. 2023-06-23 14:20:40 -07:00
00719182d5 Fix for benchmark always using 4KB of memory for gStats, even when not required. Added new WC_BENCH_TRACK_STATS to enable feature is needed. Code cleanups for line length and headers. 2023-06-23 14:17:22 -07:00
6185d66b01 For TranslateIoError use FormatMessage to get a better error message on win32 2023-06-23 14:05:38 -07:00
033f56bfe9 Merge pull request #6534 from mitchcapper/basic_editorconfig_addition_pr
Basic editor config to avoid some whitespace issues
2023-06-23 11:49:27 -07:00
102cb1114a Merge pull request #6509 from douzzer/20230613-wc_test_ret_t
20230613-wc_test_ret_t
2023-06-23 11:47:20 -07:00
ea68920b8b Merge pull request #6539 from JacobBarthelmeh/caam
fix for keymod with rt1170 blobs
2023-06-23 11:47:04 -07:00
06c1dd171a Merge pull request #6466 from dgarske/keilmdk
Fixes and cleanups for Keil MDK examples
2023-06-23 08:41:04 -06:00
2d87037e4b fix for keymod with rt1170 blobs 2023-06-23 00:50:25 -07:00
746ac3c9a3 Merge pull request #6533 from anhu/no_data_junk
make sure that when TLSX_ALPN_GetRequest() returns, data and dataSz...
2023-06-22 22:11:02 -07:00
6f2831a252 Document inline build error & fix 2023-06-22 16:48:17 -06:00
255aa774f2 Updated Keil MDK documentation to note RTOS and TCP default dependency. Fix for inline error due to tracking code being available too broadly. Use current branch for makedistsmall.sh. 2023-06-22 16:48:17 -06:00
a56fe30c2c Fixes and cleanups for Keil MDK examples. Combine duplicate user_settings.h. Use SP math all by default. Disable old/deprecated algorithms. Add CMSIS RTOS timer support for TLS and benchmark. 2023-06-22 16:48:17 -06:00
2f44ece4d8 Merge pull request #6511 from JacobBarthelmeh/nightly
fix for nightly toolchain armv7 build warning
2023-06-22 15:25:57 -07:00
33808c75f2 Merge pull request #6527 from philljj/zd16310
Fix ThreadSanitizer unlock of an unlocked mutex warning
2023-06-22 14:26:44 -07:00
20d706aad8 Basic editor config to avoid some whitespace issues 2023-06-22 14:06:46 -07:00
3e821c6f2b make sure that when TLSX_ALPN_GetRequest() returns data and dataSz are not pointing to junk. 2023-06-22 15:01:11 -04:00
2be3bb4c56 Fix ThreadSanitizer unlock of an unlocked mutex warning 2023-06-22 13:23:08 -05:00
c933f780ca Fix WinCE XSEEK_SET 2023-06-22 11:14:34 -05:00
155ce9aecf HKDF already defined 2023-06-22 11:17:34 -04:00
0ee198437a Get around issue with 'uint8_t' undefined 2023-06-22 11:03:56 -04:00
f58ae30b50 Add in CMake flags 'HPKE', 'HKDF', 'ECH' 2023-06-22 11:03:36 -04:00
e1f2c0bb2e Add 'Keying_material' option 2023-06-22 10:12:37 -04:00
3cb0b4ab29 Merge pull request #6410 from embhorn/zd15856
Update EBSNET port
2023-06-21 21:35:19 -07:00
6697181081 Merge pull request #6500 from SparkiDev/tests_api_expect_4
Test api.c: change more tests to use Expect instead of Assert
2023-06-21 17:17:37 -07:00
fb35526b73 Merge pull request #6528 from kareem-wolfssl/trustedCaKeys
Fix trusted_ca_keys, refactor MAX_X509_SIZE
2023-06-21 17:07:55 -07:00
e6017dc546 Refactor MAX_X509_SIZE into a define so it can be overriden in build settings. 2023-06-21 15:35:29 -07:00
75c8d87353 Fix trusted_ca_keys extension allowed logic. 2023-06-21 15:35:29 -07:00
e467112a93 Test api.c: change more tests to use Expect instead of Assert
Changed EXPECT_DECL to start of as TEST_SKIPPED.
Modified other EXPECT macros appropriately.
Change test functions to not use 'res' when EXPECT_DECL is used.

memory.c:
  wc_MemFailCount_Init(): don't declare variable after a statement

conf.c:
wolfSSL_TXT_DB_read(): free the whole WOLFSSL_TXT_DB on failure
instead of just the memory
wolfSSL_CONF_add_string(): pop the value added into section->value
(sk) if it can't be pushed onto conf->data
  wolfSSL_NCONF_load(): free the new value if it wasn't able to be added

ocsp.c:
  wolfSSL_OCSP_cert_to_id():
free the decoded certificate if parsing failed (is freed after use
otherwise)
free the certificate id on failure and make it NULL and continue
freeing other variables

pk.c:
wolfSSL_RSA_set0_crt_params(): set dmp1, dmq1 and iqmp fields to NULL
if setting the internal failed - returns error and caller needs to free
the passed in BNs
wolfSSL_RSA_set0_factors(): set p and q fields to NULL if setting the
internal failed - returns error and caller needs to free the passed in
BNs
wolfSSL_RSA_set0_key(): set n, e abd d fields to NULL if setting the
internal failed - returns error and caller needs to free the passed in
BNs

x509.c:
wolfSSL_X509_set_serialNumber(): explicit NULL
checkwolfSSL_X509_REQ_add1_attr_by_NID(): check whether push succeeded
and on failure free attribute

asn.c:
ConfirmSignature(): for DSA, allocate separately to ensure no leak on
memory allocation failure.

dh.c:
wc_DhGenerateParams(): ensure tmp and tmp2 are able to be cleared on
error

evp.c:
wolfSSL_EVP_PKEY_CTX_add1_hkdf_info(): fix realloc use to no leak on
failure
  wolfSSL_EVP_CIPHER_CTX_iv_length(): handle ctx being NULL.
2023-06-22 08:21:17 +10:00
53fe93430e Update EBSNET port 2023-06-21 15:52:42 -05:00
8473275fc6 Merge pull request #6529 from kareem-wolfssl/openwrt21.02Fix
Workaround for removed kmods repo in OpenWRT 21.02.
2023-06-21 13:19:40 -07:00
2d28b492b0 Merge pull request #6501 from dgarske/ecc_comp
Fix for SP math all and ECC with compressed keys (missing sp_add_d)
2023-06-21 12:01:06 -07:00
9f24217e26 Workaround for removed kmods repo in OpenWRT 21.02. 2023-06-21 11:53:30 -07:00
1bff338e37 Merge pull request #6507 from bandi13/fix_certs_ocsp_renewcerts
Fix certs ocsp renewcerts
2023-06-21 11:26:59 -07:00
9204101e94 Merge pull request #6517 from douzzer/20230615-opensslextra-wolfSSL_ERR_reason_error_string
20230615-opensslextra-wolfSSL_ERR_reason_error_string
2023-06-21 11:06:51 -07:00
aaf2408851 Merge pull request #6504 from SparkiDev/bench_embedded_scrypt
test.c, scrypt: bench embedded reduce heap usage
2023-06-21 11:06:26 -07:00
0e2c32f726 Merge pull request #6505 from SparkiDev/alt_ecc_cryptocb
ECC, ALT_ECC_SIZE, CryptoCB: ensure err is 0 in _ecc_make_key_ex
2023-06-21 11:05:53 -07:00
70c3e84735 Merge pull request #6503 from SparkiDev/mp_test_tfm_mips
TFM: fix big endian reading a zero length buffer
2023-06-21 11:05:40 -07:00
3b3c175af0 Merge pull request #6521 from ejohnstown/readme
Update Readme
2023-06-18 21:16:56 -07:00
c322e1f7f8 update readme 2023-06-18 20:24:28 -07:00
d967aae501 Merge pull request #6518 from ejohnstown/release-5.6.3
Release 5.6.3
2023-06-16 12:08:23 -07:00
42e934b251 Update read-me and change-log for the release. 2023-06-16 09:47:35 -07:00
4741a0b696 Merge pull request #6508 from JacobBarthelmeh/fuzzing
sanity check on send fatal alert return
2023-06-15 20:13:49 -07:00
78b78428e7 Merge pull request #6512 from SparkiDev/math_enc_mem_exptmod
Math, Encrypted Memory: mod exp fix
2023-06-15 19:52:41 -07:00
e17f86d145 TFM: fix big endian reading a zero length buffer
Bail early as big endian implementation doesn't handle it.
2023-06-16 10:58:51 +10:00
beef8b0014 outputBuffer - use idx field
dtls13.c:
Change end of outputBuffer data calculations to use function
GetOutputBuffer().
  Use idx when calculating unused byte count of outputBuffer.

internal.c:
Change end of outputBuffer data calculations to use function
GetOutputBuffer().
  Use GetOutputBuffer() to calculate end of data in outputBuffer.
  GrowOutputBuffer():
Calculate new size to allocate to include already written data in
case of static buffer.
    Copy all data including already written count (idx).
  CheckAvailableSize():
    Don't subtract idx from length when checking MTU size.
Do subtract idx from bufferSize to determine count of unused bytes
in outputBuffer.
2023-06-16 10:29:52 +10:00
a1e8aa7269 test.c, scrypt: bench embedded reduce heap usage
Don't do scrypt test cases that allocate 1MB of memory when
BENCH_EMBEDDED is defined.
2023-06-16 10:16:34 +10:00
970663f8a1 in wolfSSL_ERR_reason_error_string(), unconditionally convert positive error codes to negative, and in switch(), match against negated values of OpenSSL positive codes like WOLFSSL_ERROR_WANT_READ. fixes #6514 2023-06-15 17:42:03 -05:00
7926ceb120 Updated Key gen to convert the keys located in /certs/statickeys to be used in buffers 2023-06-15 15:33:11 -06:00
7153dd70a6 Math, Encrypted Memory: mod exp fix
The modular exponentiation implementations in sp_int.c and tfm.c are not
safe when using Encrypted Memory.
Cannot have two pieces of memory where one changes and the other doesn't
based on private value.
Use extra variable to hold the two new values and assign them both back
at the same time in a safe manner.

Alternative implementations used when WC_PROTECT_ENCRYPTED_MEM is
defined.
2023-06-16 07:28:47 +10:00
5b81dc47d2 adjust location used for writing to output buffer 2023-06-14 21:01:12 -07:00
8f29111aac fix for nightly toolchain armv7 build warning 2023-06-14 14:13:59 -06:00
902d47aaa1 wolfcrypt/test/test.c: fix scoping of hkdf_test();
wolfcrypt/test/test.h: include <wolfssl/wolfcrypt/types.h> to be sure sword32 is available.
2023-06-14 15:06:13 -05:00
0a860c793f adjust test case to handle error of peer closing down 2023-06-14 12:21:52 -07:00
9e0c13bbdb sanity check on send fatal alert return 2023-06-14 11:08:56 -07:00
bb5e09c394 wolfssl/wolfcrypt/settings.h: refactor ssize_t setup to be more flexible, with NO_WC_SSIZE_TYPE and WC_SSIZE_TYPE override options, and no use of autotools-style HAVE_SSIZE_T. 2023-06-14 12:28:50 -05:00
e843a7bd1e wolfcrypt/test/test.{c,h}: add wc_test_ret_t, and 'L' long int suffixes on relevant numeric literals, to facilitate passing around 32 bit retvals in the WC_TEST_RET_*() system on 16 bit targets. 2023-06-14 12:28:50 -05:00
131b7c2bcf wolfcrypt/src/chacha20_poly1305.c: refactor ssize_t uses in wc_XChaCha20Poly1305_crypt_oneshot() as long int, for portability. 2023-06-14 12:28:50 -05:00
76cf3d61a0 Calling 'nc' makes the server unresponsive 2023-06-14 09:54:23 -04:00
20df12e5f7 This should add a check to make sure the server is up before connecting 2023-06-14 09:20:06 -04:00
82cc988226 Merge pull request #6495 from JacobBarthelmeh/build
update check for stdatomic header file
2023-06-14 14:00:04 +10:00
cdb3d6df40 Merge pull request #6502 from JacobBarthelmeh/release
prepare for 5.6.3
2023-06-14 13:59:41 +10:00
0db49ef83a ECC, ALT_ECC_SIZE, CryptoCB: ensure err is 0 in _ecc_make_key_ex
When CryptoCB is used and the key gen operation is not implemented, err
is CRYPTOCB_UNAVAILABLE and needs to be reset to 0.
2023-06-14 10:12:04 +10:00
72536e0e10 prepare for 5.6.3 2023-06-13 14:47:06 -06:00
fe7502a50e Fix for SP math all and ECC with compressed keys (missing sp_add_d). Reproduce using: ./configure --disable-rsa --disable-dh --enable-compkey --disable-pkcs12 && make. 2023-06-13 11:39:24 -07:00
58c1c0c31b Merge pull request #6499 from douzzer/20230612-windows-fixes
20230612-windows-fixes
2023-06-13 12:32:01 -05:00
03a6eed037 wolfcrypt/src/{aes.c,blake2b.c,siphash.c}: fix W64LIT() arguments to not have improper 'U' suffix;
wolfssl/wolfcrypt/types.h: add 'U' suffix to W64LIT() macro defs, and add SW64LIT() macro defs (not yet used anywhere);

wolfcrypt/src/asn.c: add !WOLFSSL_ECC_CURVE_STATIC gate around DataToHexStringAlloc() to resolve -Wunused;

wolfcrypt/src/ecc.c: guard against zero-valued "len" arg to wc_ecc_get_curve_id_from_oid();

wolfcrypt/src/wc_port.c: fix several argument implicit sign changes in USE_WINDOWS_API paths;

wolfssl/wolfcrypt/ecc.h: remove const attribute from inline buffers in WOLFSSL_ECC_CURVE_STATIC struct ecc_set_type.
2023-06-12 23:15:08 -05:00
47036d0166 update check for stdatomic header file 2023-06-12 13:48:24 -06:00
9ffa9faecd Merge pull request #6491 from ejohnstown/fix-imp-conv
Implicit Type Conversion Fix
2023-06-09 13:19:18 -06:00
7b0283fa04 Implicit Type Conversion Fix
1. Typecast the return of strlen() to int for the variable used.
2023-06-09 11:13:44 -07:00
a56070cd70 Merge pull request #6490 from JacobBarthelmeh/release
Prepare for release 5.6.2
2023-06-09 11:00:10 -07:00
353a2926b6 add check for stdatomic.h 2023-06-09 09:52:01 -07:00
032ac405db prepare for release 5.6.2 2023-06-09 05:51:18 -07:00
c59cc92379 Merge pull request #6488 from douzzer/20230608-linuxkm-__is_constexpr
20230608-linuxkm-__is_constexpr
2023-06-08 14:48:19 -06:00
e35cb5bc3d linuxkm/linuxkm_wc_port.h: override definition of __is_constexpr() from /usr/src/linux/include/linux/const.h with warning-free __builtin_constant_p(). 2023-06-08 14:43:05 -05:00
3f1dd32f4e Merge pull request #6487 from JacobBarthelmeh/fuzzing
sanity check on socket return value for timeout with DTLS13
2023-06-08 10:41:41 -07:00
0d591f1111 Merge pull request #6485 from SparkiDev/coverity_api_c_fixes
Coverity fixes: api.c
2023-06-08 09:25:08 -06:00
897a865090 Merge pull request #6477 from JacobBarthelmeh/stm32
add sanity check on hash size with STM32 port
2023-06-08 22:21:19 +10:00
e5bb09f281 Coverity fixes: api.c
Fixes from coverity scan in the file api.c.
2023-06-08 22:18:05 +10:00
938a48d9b1 sanity check on socket return value for timeout with DTLS13 2023-06-08 02:37:21 -06:00
66d222adfc Merge pull request #6484 from JacobBarthelmeh/cov
coverity scan fixes
2023-06-08 10:06:18 +10:00
4a4a769512 check on allocation of new node before dereferencing 2023-06-07 15:20:23 -06:00
84979900a7 avoid use after free in error case 2023-06-07 15:13:13 -06:00
14990ad92d set return bio to null after free on error 2023-06-07 15:05:52 -06:00
fb5413cea0 account for null terminator with SEP serail number 2023-06-07 14:59:07 -06:00
ebc62f8d17 clear extension string and avoid potential double free 2023-06-07 14:41:47 -06:00
d796aa12fc free up memory with othername object on error 2023-06-07 13:29:41 -06:00
c399fba4ce set ext pointer to null after free'ing it 2023-06-07 13:23:43 -06:00
327645ff2a add additional STM32 ECC sanity check to sign 2023-06-07 10:26:40 -07:00
2a0b244393 add sanity check on hash size with STM32 port 2023-06-07 10:26:40 -07:00
c040b4a339 Merge pull request #6478 from SparkiDev/kyber_fixes_1
Kyber: allow compilation with limited sizes with liboqs
2023-06-07 11:24:08 -06:00
8583cc65fa Merge pull request #6471 from SparkiDev/tests_api_expect_3
Test api.c: change more tests to use Expect instead of Assert
2023-06-07 11:22:23 -06:00
1445a6a832 Merge pull request #6482 from SparkiDev/regression_fixes_7
Regression testing fixes
2023-06-07 11:18:36 -06:00
2b054e223b Merge pull request #6483 from SparkiDev/cppcheck_fixes_10
cppcheck: fixes from scan
2023-06-07 11:13:53 -06:00
0752a9e4f4 Merge pull request #6481 from miyazakh/fix_androidb_2
fix un-initialized var
2023-06-07 09:39:00 -06:00
ed01b14356 cppcheck: fixes from scan
wolfssl_sce_unit_test.c:
  sce_crypt_Sha_AesCbcGcm_multitest(): duplicate condition
ssl_asn1.c:
  wolfSSL_i2t_ASN1_OBJECT(): done is not needed
  MonthStr(): fix bounds check on i
woolfcrypt_test.c, test_main.c, wolfssl_tsip_unit_test.c, devices.c,
aes.c, des3.c:
  Variable not used.
asn.c:
DecodeSubjKeyId(): sz is unsigned - check for less than zero does
nothing
kcapi_rsa.c:
  KcapiRsa_Decrypt(): fix ret check by using else
  KcapiRsa_Encrypt(): make same change for consistency
kcapi_hash.c:
  KcapiHashFinal(): move ret into #ifdef where it is needed
stm32.c:
wc_Stm32_Hash_GetDigest(): i redeclared with different type - use ii
instead
bio.c, conf.c:
  XFREE checks for NULL

Reduce scope of varialbes.
Condition same.
2023-06-07 17:27:51 +10:00
d67ce722ff Merge pull request #6476 from kareem-wolfssl/dtlsBlankCert
Send blank certificate message in DTLS when no client cert is loaded.
2023-06-06 22:43:01 -07:00
b07c5d7ce8 Regression testing fixes
Fix: ./configure --disable-shared  --enable-smallstack --enable-all
CFLAGS=-DNO_ASN_TIME

Don't compile mp_test when compiling for SP Math All and RSA
verification only - very few functions available.

ssl.c:
wolfSSL_Rehandshake(): wolfSSL_UseSessionTicket only available when
not NO_WOLFSSL_CLIENT
api.c:
  test_wolfSSL_ticket_keys(): meant to be tested on server
2023-06-07 14:26:45 +10:00
e542e51d9f Test api.c: change more tests to use Expect instead of Assert
bio.c:
  wolfSSL_BIO_push(): handles NULL for top and append.

crl.c:
InitCRL_Entry(): set toBeSigned to NULL after freeing when allocation
fails.
  AddCRL(): free CRL entry properly on error.
wolfSSL_X509_STORE_add_crl(): check for NULL after
wolfSSL_X509_crl_new call.

ssl.c:
wolfSSL_CertManagerGetCerts(): free the certificate if it didn't get
pushed onto stack
  wolfSSL_RAND_Init(): returns success if global already initialized.

ssl_asn1.c: wolfSSL_ASN1_TYPE_set now avaiable when OPENSSL_EXTRA
defined for function wolfssl_dns_entry_othername_to_gn().

x509.c:
Added support for creating a valid General Name of type GEN_OTHERNAME.
Extracted some code out into wolfssl_x509_alt_names_to_gn().
  wolfSSL_X509_set_ext(): free data correctly on errors
wolfSSL_X509_PUBKEY_set(): free str if DSA parameters cannot be
retrieved; wolfSSL_OBJ_nid2obj() called separately to handle when
returning NULL.
wolfSSL_X509_NAME_copy(): check for failure when
wolfSSL_X509_NAME_add_entry() is called.

x509_str.c:
wolfSSL_X509_STORE_CTX_new(): check for error from calling
wolfSSL_X509_STORE_CTX_init().
wolfSSL_X509_STORE_get0_objects(): don't double free x509; free memory
correctly on error
2023-06-07 14:10:42 +10:00
5624df95b5 fix uninit var 2023-06-07 07:43:02 +09:00
ee289fdf89 Merge pull request #6429 from embhorn/zd16184
Allow wolfSSL_RAND_Init to pass if already initialized
2023-06-06 16:23:42 -06:00
8390ab5847 Merge pull request #6480 from lealem47/xcode
XCODE project: install all headers
2023-06-06 16:19:21 -06:00
cac42db53c Merge pull request #6468 from philljj/zd16236
Fix fastmath and heapmath invmod to be consistent with sp-math.
2023-06-07 07:47:41 +10:00
f42d57df87 Merge pull request #6472 from kaleb-himes/ZD16185-Doc-Update-Request
Update error return(s) for wc_RsaPSS_Verify
2023-06-06 15:16:40 -06:00
9bb2ae4884 XCODE project: install all headers 2023-06-06 13:34:22 -06:00
3b48bc97ed Merge pull request #6381 from SparkiDev/type_conversion_fixes_1
Fix type conversion warnings by gcc
2023-06-06 11:25:31 -05:00
9ca9c2ba6f Kyber: allow compilation with limited sizes with liboqs 2023-06-06 14:26:06 +10:00
3230d27700 Merge pull request #6436 from lealem47/sanitizer
Miscellaneous fixes for sanitizer
2023-06-06 11:55:52 +10:00
32976d379f Fix formatting 2023-06-05 16:47:11 -06:00
c0e2752000 Merge pull request #6475 from rizlik/fix_dtls_nogroups_nocerts
fix: add guards to compile w !HAVE_SUPPORTED_CURVES && NO_CERTS
2023-06-06 07:55:08 +10:00
ebac138e77 Send blank certificate message in DTLS when no client cert is loaded. 2023-06-05 10:49:42 -07:00
e53453a7ed fix: add guards to compile w !HAVE_SUPPORTED_CURVES && NO_CERTS
This configuration can be used to build a static PSK only build
2023-06-05 16:13:11 +00:00
6d85d09b0b Update error return(s) for wc_RsaPSS_Verify 2023-06-05 09:22:08 -06:00
ccd404e13d Merge pull request #6470 from douzzer/20230603-unittest-maybe-uninited
20230603-unittest-maybe-uninited
2023-06-05 08:11:52 +10:00
6c4cc2a931 tests/api.c: fix a likely-spurious maybe-uninitialized from gcc-11 -m32 (all-sp-m32) in test_wolfSSL_PEM_PrivateKey(). 2023-06-03 10:41:15 -05:00
db28d38ea3 Fix fastmath and heapmath invmod to be consistent with sp-math. 2023-06-02 22:11:44 -05:00
37aada0313 Merge pull request #6465 from lealem47/zd162152
Read and assign err return val from _sp_mulmod_tmp
2023-06-02 11:45:27 -06:00
3ee31dca6b Merge pull request #6464 from douzzer/20230602-analyzer-guided-fixes
20230602-analyzer-guided-fixes
2023-06-02 11:31:26 -06:00
eaf27b1945 Read and assign err return val from _sp_mulmod_tmp 2023-06-02 10:09:12 -06:00
291be53524 tests/api.c: fixes for clang-diagnostic-embedded-directive (also warned by gcc), clang-analyzer-core.UndefinedBinaryOperatorResult, and clang-analyzer-deadcode.DeadStores. 2023-06-02 11:06:16 -05:00
bb78e1c7d8 Merge pull request #6462 from douzzer/20230601-fix-fips-XASM_LINK
20230601-fix-fips-XASM_LINK
2023-06-01 14:00:01 -06:00
35e59a3569 Merge pull request #6456 from SparkiDev/tests_api_expect_2
Test api.c: change more tests to use Expect instead of Assert
2023-06-01 10:29:52 -06:00
a435302415 wolfssl/wolfcrypt/types.h: conditionalize XASM_LINK() definition on !FIPS_VERSION_LT(5,3) and !WOLFSSL_NO_ASM. 2023-06-01 11:12:27 -05:00
806c75d28b Merge pull request #6450 from miyazakh/fix_jenkins_android
fix to cast diff type, int and uint
2023-06-01 08:33:02 -06:00
7259351a3f Test api.c: change more tests to use Expect instead of Assert
Added a new version of 'nofail' handshaking that doesn't use threads.
More tests can be run in single threaded.

Changed tests over to use test_wolfSSL_client_server_nofail() or
test_wolfSSL_client_server_nofail_memio() to simplfy test cases.

Changed tests to use Expect.

CRL:
BufferLoadCRL wasn't freeing allocated data when currentEntry
couldn't be allocated.

ssl.c:
DecodeToX509(): Needs to call FreeDecodedCert even if
ParseCertRelative fails.
wolfSSL_PEM_read_PUBKEY(): Need to check result of
wolfSSL_d2i_PUBKEY is NULL rather than the passed in WOLFSSL_EVP_PKEY.

X509:
wolfSSL_X509_set_ext(): Must free allocated WOLFSSL_X509_EXTENSION
if not pushed on to stack regardless of stack being NULL.
wolfSSL_X509V3_EXT_i2d(): Don't free asn1str on error as it is the
data passed in.
wolfSSL_i2d_X509_NAME_canon(): free names and cano_data when call to
wolfSSL_ASN1_STRING_canon() fails.

PKCS7:
    wc_PKCS7_InitWithCert(): Check memory allocation of cert for NULL.
2023-06-01 14:22:00 +10:00
b62e0b7ceb Fix type conversion warnings by gcc 2023-06-01 14:21:41 +10:00
5ffee2dbe1 Merge pull request #6459 from douzzer/20230531-analyzer-guided-fixes
20230531-analyzer-guided-fixes
2023-06-01 10:55:48 +10:00
c45efd79af api.c: fix 3 missed EXPECT_RESULT() == WOLFSSL_SUCCESSes to use the succincter EXPECT_SUCCESS(). 2023-05-31 18:26:27 -05:00
42a5d0320b Merge pull request #6445 from jpbland1/dsa_ex
add ex functions to use other digest algorithms with DSA
2023-05-31 14:50:05 -06:00
59a7c0d7e4 move definitions of XASM_LINK() from wolfcrypt/src/aes.c, wolfcrypt/src/asm.c, and wolfcrypt/src/cpuid.c, to wolfssl/wolfcrypt/types.h, and use __asm__() instead of asm() if __GNUC__, for compatibility with -std=c99. 2023-05-31 15:48:52 -05:00
64c9026c77 wolfssl/wolfcrypt/types.h: add PRAGMA_DIAG_PUSH, PRAGMA(), and PRAGMA_DIAG_POP(), using the gcc or clang variants as applicable, to facilitate pragmas to be used on both gcc and clang;
tests/unit.h: fix ExpectPtr() to inhibit pedantic warnings on both gcc and clang;

wolfssl/test.h: in myVerify(), explicitly check for nullness when printing issuer/subject, to avoid cppcheck null-deref warning;

tests/api.c: fixes for:

* myriad "embedding a directive within macro arguments is not portable"
* an "ISO C forbids conversion of object pointer to function pointer type"
* some "stringop-overflow"s
* a clang-analyzer-core.uninitialized.Assign
* a clang-analyzer-core.CallAndMessage "2nd function call argument is an uninitialized value"
* a nullPointerRedundantCheck
* several clang-diagnostic-declaration-after-statement
* a spurious gcc sanitizer maybe-uninitialized in test_wolfSSL_CheckOCSPResponse()
2023-05-31 15:19:15 -05:00
109a17f3bd wolfcrypt/src/memory.c: restore required linuxkm #define WOLFSSL_NEED_LINUX_CURRENT 2023-05-31 15:17:01 -05:00
80311975ce Merge pull request #6452 from anhu/no_rsa_sigalgs
For NO_RSA, don't advertise support for RSA.
2023-05-31 13:41:56 -06:00
88c3d9a529 More improvements for GCC-ARM FIPS build 2023-05-31 11:23:50 -06:00
c2e03689c0 Improve GCC-ARM user-settings.h FIPS configurability 2023-05-31 09:53:51 -06:00
554e6472b5 addressed review comments 2023-05-31 06:54:14 +09:00
5604033902 Merge pull request #6453 from kaleb-himes/OE52_OE54_CHECKIN
Checkin STARCORE project OE52_OE54_ACVP effort
2023-05-30 14:43:25 -06:00
ca2ca4f739 Merge pull request #6454 from philljj/spelling_cleanup
Used codespell and fixed obvious typos in src and wolfssl.
2023-05-30 14:42:04 -06:00
769c488d18 Merge pull request #6444 from night1rider/wolfssl-Onboarding
added test case for wolfSSL_configure_args
2023-05-30 13:03:05 -06:00
1bdd1cb157 Used codespell and fixed obvious typos in src and wolfssl. 2023-05-30 11:36:43 -05:00
f51d4c4c30 Checkin STARCORE project OE52_OE54_ACVP effort 2023-05-30 10:36:01 -06:00
ea6155c924 For NO_RSA, don't advertise support for RSA. 2023-05-30 12:34:23 -04:00
dbca65f028 Merge pull request #6447 from SparkiDev/tests_api_expect
Tests api.c: rework for malloc failure testing
2023-05-30 09:19:54 -06:00
63a5fe3229 fix to cast diff type, int and uint 2023-05-30 17:32:42 +09:00
541ea51ad5 Tests api.c: rework for malloc failure testing
Modified number of tests to not crash on failure and cleanup allocations
on failure.
Added memory fail count option to set which memory allocation to start
failing on.
Fix issues found from testing.

bio.c:
BIO_new() move ref count up so that calls to wolfSSL_BIO_free()
work.
internal.c:
ImportCipherSpecState wasn't checking SetKeySide for failure. Crash
when pointer is NULL and accessed directly.
ocsp.c:
wolfSSL_OCSP_response_get1_basic() doesn't need to free vs->source
as it is freed in WOLFSSL_OCSP_RESPONSE_free().
ssl.c:
ProcessBuffer() Don't strip PKCS#8 header if failed to create DER.
Crasged as directly accessing 'der' which was NULL.
ssl_asn.c:
wolfssl_asn1_integer_require_len was checking wrong variable to see
if allocation failed.
x509,c:
wolfSSL_X509_ALGOR_set0 needs to set aobj only when no failure
possible.
wolfSSL_X509_chain_up_ref needs to call cleanup to ensure everything
is freed.
2023-05-30 12:01:21 +10:00
37c03e3f11 Merge pull request #6442 from embedded-specialties/int-sequence
ASN.1 Integer sequence
2023-05-30 09:37:55 +10:00
4f8419c641 Merge pull request #6441 from SparkiDev/cryptocb_pkcs11_rsa_get_size
CryptoCb, PKCS#11: add RSA key size lookup
2023-05-29 16:09:33 -07:00
d340587035 Added valid ASN.1 integer value to test_asn1 2023-05-28 21:18:45 -04:00
8fb4e7813b Added braces to support older compilers 2023-05-28 18:59:16 -04:00
c0116d6026 added test case for wolfSSL_configure_args and added fix
new fix

removing redundant () in code
2023-05-26 16:45:13 -06:00
5a49b8c436 Merge pull request #6449 from anhu/syn_err
Fix a syntax error.
2023-05-26 15:55:36 -06:00
87bbcbb96a Fix a syntax error.
Tested with:
    ./configure --enable-debug --enable-all CFLAGS=-DDEBUG_WOLFSSL_VERBOSE
2023-05-26 16:12:14 -04:00
569a498015 Merge pull request #6443 from SparkiDev/wolfssl_x509_name_entry_leak_2
X509 NAME Entry: fix get object to not leak
2023-05-25 16:15:12 -06:00
566fa1179f add ex functions to use other digest algorithms 2023-05-25 12:50:23 -04:00
a05f4f4dd9 Merge pull request #6432 from SparkiDev/wolfssl_x509_name_entry_leak
X509 NAME ENTRY create: ensure existing object is not lost
2023-05-25 09:28:45 -06:00
6b2fe61d95 Merge pull request #6439 from lealem47/asio_cmake
CMake: add option to enable asio
2023-05-25 09:26:06 -06:00
cff8e8e6f7 X509 NAME Entry: fix get object to not leak
wolfSSL_X509_NAME_ENTRY_get_object
 - object field was being reused if it existed but lost on error
 - store object only on success, ie object is not NULL
 - moved function into x509.c
2023-05-25 09:26:22 +10:00
e3be76b238 Merge pull request #6435 from SparkiDev/sp_int_count_bits_cleanup
SP int: cleanup sp_count_bits
2023-05-24 15:11:12 -07:00
2c59bec72c Fixed typo in comment 2023-05-24 17:37:51 -04:00
8bd3850e58 Added ASN.1 Integer sequencing 2023-05-24 17:28:53 -04:00
98522fa39d Only clear last ASN_PEM_NO_HEADER error 2023-05-24 14:17:46 -06:00
1218cfb7f2 Merge pull request #6087 from rizlik/embed_recv_from_fix_peer
dtls: improve different peer recvfrom and better error reporting on ipv6
2023-05-24 13:54:40 -06:00
34c12789c9 CMake: add option to enable asio 2023-05-24 12:46:11 -06:00
188a99bd5a Merge pull request #6438 from anhu/ext_cache
Without HAVE_EXT_CACHE session dup is not compiled in
2023-05-24 11:15:00 -06:00
87a7af05dd Without HAVE_EXT_CACHE session dup is not compiled in 2023-05-24 12:14:02 -04:00
e954110cc5 CryptoCb, PKCS#11: add RSA key size lookup
wc_RsaEncryptSize(): assumed a key size of 2048 when using hardware key.
Added callback to do lookup and implemented for PKCS#11.
If lookup not supported then assumes 2048 bits.
2023-05-24 11:42:52 +10:00
5613109fae Miscellaneous fixes for sanitizer 2023-05-23 13:51:46 -06:00
9d01411857 Merge pull request #6433 from SparkiDev/memusage_7
Memory usage: reduce stack usage
2023-05-22 16:35:04 -07:00
622375b47e SP int: clenaup sp_count_bits
More explicitly handle used == 0 for static code analyser.
Make sp_count_bits clearer.
2023-05-23 09:20:22 +10:00
c2c97c2b57 Fix typos in Japanese help. 2023-05-23 07:11:53 +09:00
5a59807733 Merge pull request #6431 from douzzer/20230521-wolfsentry-mt-usage-fixes
20230521-wolfsentry-mt-usage-fixes
2023-05-22 10:05:52 -07:00
5182fe3f7d wolfio: cleaning: use WOLFSSL_IP6 define instead of AF_INET6 2023-05-22 15:33:06 +00:00
f21c34b08d tests: EmbedRecvFrom/EmbedSendTo error if ipv6 w/o ipv6 compiled in 2023-05-22 15:33:06 +00:00
640f9cf967 wolfio: EmbedRecvFrom: check ipv6 peer on non-ipv6 version 2023-05-22 15:33:05 +00:00
b4542ed270 tests: add dtls ignoring different peer test 2023-05-22 15:32:57 +00:00
73f502e189 wolfio: dtls: retry instead of returning WANT_READ on different peer
If EmbedReceiveFrom() returns WANT_READ, a blocking socket will not know how to
deal with the error. Retry the recvfrom instead adjusting the timeout.
2023-05-22 15:31:58 +00:00
5f293bf736 tests: add test_wolfssl_client_server_no_fail(_ex) to set client cb 2023-05-22 15:31:58 +00:00
cff580b4f0 tests: api: error out on read error in test_server_nofail 2023-05-22 15:31:58 +00:00
98a717e1d5 Memory usage: reduce stack usage
AES C impl: don't align to 32 bytes, align to 16 as buffer is 16 bytes
long.
SP int: Don't call _sp_mulmod but call sp_mul and _sp_div to do mod
operation. For RSA, fewer calls for mod operation means less stack used
at deepest point.
2023-05-22 16:57:07 +10:00
403acadf1a X509 NAME ENTRY create: ensure existing object is not lost
wolfSSL_X509_NAME_ENTRY_create_by_txt and
wolfSSL_X509_NAME_ENTRY_create_by_NID:
 - object field was being reused if it existed but lost on error
 - extracted common code
 - store object only on success, ie object is not NULL
2023-05-22 10:52:51 +10:00
d8e4c78960 Merge pull request #6426 from jpbland1/invariant-mp-size
add check to sp_invmod_mont_ct to make sure the
2023-05-22 08:14:39 +10:00
3e14b34bdc wolfssl/test.h: in wolfsentry_setup(), add lock-unlock wrap before wolfsentry_route_get_main_table() (enforced by wolfSentry 1.3+, and was always required for thread safety). 2023-05-21 10:51:24 -05:00
3e95ad9549 Allow wolfSSL_RAND_Init to pass if already initialized 2023-05-19 17:08:44 -05:00
a06bd777c0 Merge pull request #6423 from cconlon/pkcs7NoStream
Fix PKCS#7 build with NO_PKCS7_STREAM
2023-05-19 10:32:49 -06:00
235dc95b27 Merge pull request #6420 from julek-wolfssl/atomic-use-macro
Implement atomic operations interface
2023-05-19 10:29:04 -06:00
8b9e13865a Merge pull request #6383 from philljj/zd16072
Fix session ticket leak in wolfSSL_Cleanup
2023-05-19 09:14:07 -07:00
8f4524efa0 Merge pull request #6298 from rizlik/dtls13-null-cipher
dtls13: support Authentication and Integrity-Only Cipher Suites
2023-05-19 10:13:44 -06:00
10b6105505 Merge pull request #6424 from SparkiDev/coverity_2
Coverity scan fixes
2023-05-19 09:13:26 -07:00
7e3aafb60c Fix for FIPS ECC integrity check with crypto callback set (#6425)
Skip ECC private key check when the TPM is used to generate the key, since it doesn't release the private part. this option needs to be used with a FIPS approved TPM for the end result to be FIPS approved
2023-05-19 09:12:44 -07:00
344c3338a9 add check to sp_invmod_mont_ct to make sure the
result integer can hold the range of the modulus
2023-05-19 10:49:42 -04:00
f3b66a3e26 Merge pull request #6427 from SparkiDev/scan-build_fixes_1
scan-build fixes
2023-05-19 10:46:00 -04:00
35185e1a59 tests: add dtls13 null cipher test 2023-05-19 08:10:26 +00:00
45503972f8 scan-build fixes
sp_mulmod
 - scan-build getting confused with size of result
 - don't check result size as checked already
 - split out implementation of sp_mulmod from check

StoreEccKey
 - ensure pubKey is not NULL even though all uses will not be

GetCertKey
 - ensure source is not NULL
 - cert->source may be NULL in incorrect usages of APIs
2023-05-19 12:17:41 +10:00
2c34210efb Coverity scan fixes
DecodeRsaPssParams() assumed params is never NULL. Should never be
called with NULL but check saves a NULL dereference.

PrintObjectIdText() didn't check return of call to GetObjectId. 'oid'
will retain -1 value on error and work as normal on error return.
Cleaner to check for ASN_PARSE_E and handle - other error,
ASN_UNKNOWN_OID_E, is OK for printing.
2023-05-19 09:15:16 +10:00
6ef580ca59 fix PKCS#7 build when using NO_PKCS7_STREAM 2023-05-18 14:50:03 -06:00
a595f10549 Merge pull request #6421 from ejohnstown/bp-conf-desc-fix
Configure Typo
2023-05-18 14:07:58 -06:00
f9dcab956e Configure Typo
1. The description text for the brainpool enable option in configure was
   using a shell variable that ended up in the output. Switched to the
   description pattern used in other options.
2023-05-18 10:51:04 -07:00
466636214f Add MSVC atomics 2023-05-18 12:06:54 +02:00
31ed2a2bbb dtls13: support Authentication and Integrity-Only Cipher Suites
See RFC 9150. To enable the feature use HAVE_NULL_CIPHER compilation flag.
2023-05-18 10:03:03 +00:00
5f1ce09dce Merge pull request #6412 from JacobBarthelmeh/tls13
add tls extension sanity check
2023-05-18 09:33:49 +10:00
0530ee774f Merge pull request #6418 from douzzer/20230517-linuxkm-benchmarks
20230517-linuxkm-benchmarks
2023-05-17 15:00:49 -07:00
90b858492f CMake: improve build scripts (#6331)
* make wolfssl compile with Mingw-w64

* cmake: CMAKE_SYSTEM_PROCESSOR is AMD64 on Windows

* cmake: use target_compile_definitions instead of add_definitions

* cmake: change default value of WOLFSSL_BUILD_OUT_OF_TREE_DEFAULT to ON

* cmake: link crypt32.lib on Windows

* cmake: export wolfssl

* move Config.cmake.in to cmake directory

* revert changes to .gitignore

* add Config.cmake.in to include.am
2023-05-17 15:26:46 -06:00
9d05a4f2ed Don't orphan ticBuff pointer in wolfSSL_DupSessionEx 2023-05-17 16:25:27 -04:00
2bb3ade4ac Merge pull request #6416 from embhorn/gh6413
Fix valgrind issue with memcpy
2023-05-17 13:46:49 -06:00
a5106ecda0 Merge pull request #6417 from kareem-wolfssl/docUpdates
Update AES and Chacha documentation.
2023-05-17 13:43:15 -06:00
fffff657de cleanups: line length, WOLFSSL_SMALL_STACK_STATIC, and SAVE_VECTOR_REGISTERS() failure trap in benchmark.c, proper path to benchmark.c in linuxkm/module_hooks.c, and proper casting in aes.c. also harmonized semantics and prototype of bench_ripemd(). 2023-05-17 13:00:46 -05:00
dd9edfee24 Implement atomic operations interface 2023-05-17 16:33:11 +02:00
37b716192b wolfcrypt/benchmark/benchmark.c: fix typo in bench_stats_start(). 2023-05-17 02:27:04 -05:00
4f4842fce6 linuxkm/linuxkm_memory.c: refactor SAVE/RESTORE_VECTOR_REGISTERS() to be per-process rather than per-CPU, and add migrate_disable/enable() to kernel_fpu_begin/end() because preempt_disable() is just a barrier on _PREEMPT_VOLUNTARY kernels;
linuxkm/linuxkm_wc_port.h: activate SAVE/RESTORE_VECTOR_REGISTERS() whenever defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) for benchmark.c support, independent of vector crypto features;

fix and optimize various alignment issues with stack and heap allocations;

fix macro definitions for XMALLOC/XREALLOC/XFREE to correctly use kvmalloc and friends when defined(HAVE_KVMALLOC), and to use wolfSSL_Malloc() and friends when defined(WOLFSSL_TRACK_MEMORY);

purge stale LINUXKM_SIMD_IRQ code.
2023-05-17 01:44:36 -05:00
fc589d664e wolfssl/wolfcrypt/mem_track.h: refactor for linuxkm compatibility, mainly by supporting NO_STDIO_FILESYSTEM. 2023-05-17 01:13:36 -05:00
cc1ec8ace5 wolfssl/wolfcrypt/types.h: add missing do-while-0 nonstatments to WC_FREE_VAR() and WC_FREE_ARRAY() for pedantic semicolon swallowing. 2023-05-17 01:11:01 -05:00
a18dc7f10a wolfcrypt/src/aes.c: in wc_AesSetKeyLocal(), add an alignment check in the haveAESNI path for WOLFSSL_LINUXKM, because the failure mode is module crash. 2023-05-17 01:07:47 -05:00
40b598289f src/ssl_asn1.c: in wolfssl_asn1_time_to_tm(), initialize localTm with memset, not the zero initializer, for C++ compatibility. 2023-05-17 01:06:17 -05:00
85e0bf337b fix for benign sign clash in wc_RNG_GenerateBlock(). 2023-05-17 01:05:33 -05:00
5aceae1d1c src/internal.c: fix for typo (identicalInnerCondition) in DoClientHello(). 2023-05-17 01:05:14 -05:00
3ad7e39dc4 refactor benchmark.c for linux kernel compatibility -- WOLFSSL_SMALL_STACK and WOLFSSL_NO_FLOAT_FMT codepaths, SAVE/RESTORE_VECTOR_REGISTERS, refactor of several stack array initializations that broke in the kernel, and replacement of an fputs() call with printf(). 2023-05-17 01:04:40 -05:00
42cce9d8e5 add --enable-linuxkm-benchmarks; add check for async.{c,h} when --enable-asynccrypt; update failure message for the opensslextra AC_CHECK_HEADER() test. 2023-05-17 01:03:26 -05:00
6cb2c84f12 Update AES documentation to clarify block size requirement. Fix parameter ordering in wc_ChaCha20Poly1305_Decrypt documentation. 2023-05-16 14:31:51 -07:00
0a5a5a65a2 Fix valgrind issue with memcpy 2023-05-16 14:38:51 -05:00
5194a296e0 Merge pull request #6414 from embhorn/zd16166
Documentation for wolfSSL_CertManagerFreeCRL
2023-05-16 10:08:51 -06:00
53ef26bf3a Merge pull request #6392 from rizlik/dtls13-fix-ch-epoch
DTLS v1.3: fix epoch 0 check on plaintext message
2023-05-16 10:07:14 -06:00
ae37fee134 Merge pull request #6411 from lealem47/6397
Fixes for wolfcrypt test without ECC SECP
2023-05-16 09:59:55 -06:00
494febb3fb Documentation for wolfSSL_CertManagerFreeCRL 2023-05-16 09:44:00 -05:00
00f1eddee4 add tls extension sanity check 2023-05-15 15:49:44 -07:00
1c3fa38821 Fix for conflicting types for HAL timer 2023-05-15 14:12:53 -06:00
3f795f2f47 Fixes for wolfcrypt test without ECC SECP 2023-05-15 14:12:24 -06:00
c2a7397425 Merge pull request #6406 from JacobBarthelmeh/fuzzing
check for socket errors on SendAlert
2023-05-15 09:16:20 -07:00
c17cff7265 Merge pull request #6403 from kareem-wolfssl/gh6387
Fix wolfssl_asn1_time_to_tm setting unexpected fields in tm struct.
2023-05-12 16:37:17 -06:00
a474179cdf Merge pull request #6301 from miyazakh/ra_cryptonly
Add Renesas SCE RSA Crypt Only support
2023-05-12 16:32:15 -06:00
f1ad37919d Add test case for ASN1_TIME_to_tm fix. 2023-05-12 14:30:55 -07:00
1b6ab01d0b Merge pull request #6407 from dgarske/stm32_cleanup
Remove STM AES always true check
2023-05-12 13:54:24 -06:00
9cca571c1d Merge pull request #6399 from bigbrett/zd16083-ocsp-double-free
fix double free in InitOCSPRequest
2023-05-12 13:50:54 -06:00
bebf4f6e8b Merge pull request #6405 from julek-wolfssl/zephyr-misc
Small fixes to build wolfSSL on zephyr without warnings
2023-05-12 12:33:01 -07:00
79a5c49e47 Skip Async_DevCtxInit when using init rsa/ecc label/id api's (#6393)
* Skip Async_DevCtxInit when using init rsa/ecc label/id api's

---------

Co-authored-by: Lealem Amedie <lealem47@github.com>
2023-05-12 11:54:03 -07:00
ea40176bee check for socket errors on SendAlert 2023-05-12 09:52:01 -07:00
56cd8c3dc1 Merge pull request #6401 from anhu/doc_ptr_fix
Doc Fix: TI no longer maintains the documentation; we do.
2023-05-12 09:20:37 -06:00
62db14e676 Small fixes to build wolfSSL without warnings 2023-05-12 13:24:21 +02:00
a68b0d8ecf Merge pull request #6402 from lealem47/no_ecc_secp
Don't test SECP vectors when disabled in test.c
2023-05-11 17:25:42 -07:00
6930179b8e Fix wolfssl_asn1_time_to_tm setting unexpected fields in tm struct. 2023-05-11 15:15:46 -07:00
9a2dc120c4 Don't test SECP vectors when disabled in test.c 2023-05-11 14:21:39 -06:00
ced8198737 Doc Fix: TI no longer maintains the documentation; we do. 2023-05-11 15:23:35 -04:00
46dce4b33f set pointer to null after freeing in InitOcspRequest() to prevent a subsequent double-free in FreeOcspRequest() 2023-05-11 12:59:25 -06:00
dbb5ee3b1e Merge pull request #6389 from JacobBarthelmeh/devid
always call crypto cb when compiled in
2023-05-11 11:48:30 -07:00
6a48539309 Merge pull request #6398 from douzzer/20230511-analyzer-carps
20230511-analyzer-carps
2023-05-11 11:47:23 -07:00
dfbd61cad9 Remove always true check. 2023-05-11 11:38:12 -07:00
3c06638115 wolfcrypt/src/aes.c: fixes for bugprone-macro-parentheses;
wolfcrypt/src/ecc.c: fix for nullPointerRedundantCheck ("possible null pointer dereference").
2023-05-11 11:51:27 -05:00
07c41c5498 add macro guard on test case 2023-05-10 15:51:39 -07:00
bab35c4de2 add WOLF_CRYPTO_CB_FIND macro to guard find device ID callback 2023-05-10 15:28:19 -07:00
870f7cc95b Merge pull request #6394 from douzzer/20230509-THIS_MODULE-mem-and-more-Wconversion
20230509-THIS_MODULE-mem-and-more-Wconversion
2023-05-10 10:19:25 -07:00
04e831fa63 Merge pull request #6309 from SparkiDev/aes_cache_touch_lines
AES: touch each cache line when getting offset from table
2023-05-10 09:56:27 -06:00
c953716367 Merge pull request #6391 from rizlik/dtls13-label-fix
dtls13: fix: use correct label to derive resumption key
2023-05-10 08:06:27 -06:00
c26a5f7514 Merge pull request #6390 from lealem47/no_asn_time
Fix for compiling with NO_ASN_TIME + doc fix
2023-05-10 08:02:45 -06:00
5773252e33 test: add check that CH with epoch != 0 are ignored 2023-05-10 13:54:25 +00:00
6c8811a737 dtls13: fix: check plaintext record header epoch is 0
In DTLS v1.3 the normal (plaintext) record header can be used only with
unprotected message (epoch == 0). Protected messages use the unified header.

Check this invariant using `IsAtLeastTLSv1_3` instead of `ssl->options.tls1_3`
because the latter is false before version negotiation.

In DTLSv1.2 the DTLS normal header is used for all the epoch, this check doesn't
interfere because:
1. the first CH's epoch must be zero in all DTLS versions
2. In case of downgrade after version negotiation `IsAtLeastTLSv1_3` is false
2023-05-10 13:54:25 +00:00
a2776ad35e addressed review comments 2023-05-10 13:55:34 +09:00
f2c97d5d35 fixes for various wolfcrypt -Wconversions visible only on compilers that promote byte and word16 to signed int, then warn of a sign conflict when an intrinsically safe result is assigned back to the original type. 2023-05-09 23:55:08 -05:00
ec9beaab41 linuxkm: add coverage for Linux 6.4+ module memory layout refactor; also, refactor WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS to make it settable independent of WOLFSSL_AESNI etc. 2023-05-09 23:53:49 -05:00
158c0362e7 Merge pull request #6372 from rizlik/send_alert_fix
tls13: correctly propagatae SendAlert err message
2023-05-10 10:25:15 +10:00
03f5ce03ff Remove inaccurate STM32 documentation 2023-05-09 13:28:20 -06:00
86064f9a04 Fix for compiling with NO_ASN_TIME 2023-05-09 13:26:19 -06:00
71ca447b6b resolve CB_ONLY cases 2023-05-09 09:08:32 -07:00
e9303a5e77 dtls13: fix: use dtls label to derive ExportKey/Resumption secrets 2023-05-09 10:04:29 +00:00
cdeba4e1b0 Merge pull request #6364 from anhu/compat_unknown_oid
Allow for unknown OIDs in extensions in wolfSSL_X509_set_ext()
2023-05-08 14:51:35 -06:00
11512c7e89 Merge pull request #6388 from philljj/zd16114
Fix memory leak in TLSX_KeyShare_Setup
2023-05-08 14:47:00 -06:00
03a566791e fix for recursive issue in test case 2023-05-08 12:51:22 -07:00
730db6a841 Address Jacob's comment 2023-05-08 14:47:22 -04:00
71cbc019d7 always call crypto cb when compiled in 2023-05-08 09:49:50 -07:00
8c792b836c Fix memory leak in TLSX_KeyShare_Setup 2023-05-08 10:46:33 -05:00
62a4329f8e Merge pull request #6379 from SparkiDev/sp_int_gcd_fix
SP int; fix sp_gcd error checking
2023-05-07 12:11:29 -07:00
979b92deb8 Fix session ticket leak in wolfSSL_Cleanup 2023-05-04 22:21:55 -05:00
ae844b4a0f Merge pull request #6378 from SparkiDev/minor_fixes_2
Minor fixes
2023-05-04 20:20:33 -05:00
d342e341d8 SP int; fix sp_gcd error checking
r can be as large as the smaller of a and b.
Fix sign check.
Add comments as to what GCD does.
2023-05-05 09:11:47 +10:00
55a91c2b55 Minor fixes
configure.ac: Don't use == in test.
client.c: Merge string to one line.
asn.c/asn_public.h:
  fix conversion warnings/errors.
  wc_Asn1_Print no longer public and doesn't need to check for NULL.
  wc_Asn1_PrintAll check all pointer parameters for NULL.
2023-05-05 08:43:50 +10:00
c3e4da9f66 Merge pull request #6376 from lealem47/freeRTOS_thread
Define WOLFSSL_THREAD for FREERTOS case
2023-05-04 14:53:24 -07:00
0af4e8d10a Define WOLFSSL_THREAD for FREERTOS case 2023-05-04 14:26:12 -06:00
6e572cc91d Merge pull request #6352 from SparkiDev/asn1_print
ASN.1 print utility: asn1
2023-05-04 10:55:47 -07:00
75390937bc tls13: correctly propagatae SendAlert err message 2023-05-04 16:30:50 +00:00
4cdf32e497 Merge pull request #6333 from SparkiDev/memusage_6
Memory usage improvements
2023-05-04 09:14:24 -07:00
82e502d8a2 WOLFSSL_SP_INT_NEGATIVE declaration for all Espressif chipsets (#6374)
* WOLFSSL_SP_INT_NEGATIVE declaration for all Espressif chipsets
* correct naming for WOLFSSL_SHA384 on ESP32-C3
2023-05-04 08:04:25 -07:00
9b404fcc5b AES touch cache lines
Change implementation to get from each line of a table once for each 4
variables.
Only enable WOLFSSL_AES_TOUCH_LINES, by default, when RISC-V.
2023-05-04 16:34:42 +10:00
d2afe9e5e0 Memory usage improvements
ECC: make private key field 'k' able to be smaller when ALT_ECC_SIZE is
defined.
WOLFSSL_SMALL_STACK_CACHE: allocate temps using new macros.
2023-05-04 10:26:57 +10:00
9cdee20a7d ASN.1 print: implementation to parse and print added
New API to parse and print DER/BER data from a buffer.
Add an example to parse DER, Base64 and PEM files and print out ASN.1 items.
2023-05-04 09:57:44 +10:00
6369b1e9ec Merge pull request #6371 from dgarske/lowres
Fixes and improvements for building with low footprint
2023-05-03 19:33:53 -04:00
714ec82e91 Merge pull request #6369 from rizlik/dh-async-fix
async fixes: dh and tests
2023-05-03 07:50:23 -07:00
f05543c9e5 Merge pull request #6370 from SparkiDev/sp_int_copy_change
SP int: _sp_copy don't check a == b, change calls to _sp_copy
2023-05-03 08:30:55 -06:00
4b90afa37b Provide way to disable ASN but have wc_RsaPublicKeyDecodeRaw, which doesn't need ASN.1 parsing. 2023-05-02 18:10:25 -07:00
61dfbf5ef2 Fixes and improvements for building with low footprint. Fix for ASN template with RSA verify only (was missing mp_leading_bit). Fix to allow disabling DRBG with crypto callbacks enabled. Updated the wolfTPM user_settings.h template with low resource option. 2023-05-02 16:51:41 -07:00
1a8f09d013 Merge pull request #6320 from JacobBarthelmeh/curl
smaller sized build with curl
2023-05-03 07:46:29 +10:00
c3a8476b95 SP int: _sp_copy don't check a == b, change calls to _sp_copy
Simplify code to make it easier for software analysers.
Reduce work done by using _sp_copy instead of sp_copy where possible.
2023-05-03 07:44:28 +10:00
11a77f7078 Merge pull request #6363 from dgarske/threadlocal
Add option to support disabling thread local storage
2023-05-02 15:12:13 -06:00
58b996353b Merge pull request #6266 from dgarske/zd15938_async_ecc
Fix for async ECC shared secret state
2023-05-02 12:01:31 -06:00
0ebe5819d0 Allow for unknown OIDs in extensions in wolfSSL_X509_set_ext()
...and add some testing to show we properly inserted the extensions.
2023-05-02 12:43:14 -04:00
a5a2316aa4 async: fix overwrite of keylen params between calls
The `kse->pubKeyLen` parameter is used as an input parameter to `DhGenKeyPair`
to provide the size of the `pubKey` buffer (the same size as the prime p). After
that, `kse->pubKeyLen` is used to check that the public key generated is of the
same length as the prime p. If this is not the case, the public key is
padded. If the key generation is asynchronous, then `TLSX_KeyShare_GenDhKey` may
be invoked twice. The second time, the `kse->pubKeyLen` value, updated
asynchronously by the async code, is overwritten with the prime size at the
beginning of the function. When this happens, a wrong public key value is used,
and the shared secret computed is incorrect.

Similar reasoning can be applied to `kse->keyLen`
2023-05-02 16:34:15 +00:00
3e4b95eb4b test: fix test AEAD limit server set fds as nonblock 2023-05-02 16:34:01 +00:00
bdd45350c5 Merge pull request #6361 from bandi13/minorContainerUpdates
Minor container updates
2023-05-01 17:05:36 -06:00
ceeda82906 Add option to support disabling thread local --disable-threadlocal. Useful for cross-compile situation where thread local storage is not desired. ZD 16062 2023-05-01 15:51:22 -07:00
06d5897233 Merge pull request #6362 from dgarske/stm32_hash
Improved fix for STM32 hashing on U5
2023-05-01 16:30:57 -06:00
72ffa743a0 Fix for async ECC shared secret. ZD 15938 2023-05-01 15:30:03 -07:00
ef955c620f refactor evp.c to group all MD digest functions togther 2023-05-01 13:23:48 -07:00
7576380635 Improved fix for STM32 hashing on U5 2023-05-01 13:13:00 -07:00
c84abaf5b6 Merge pull request #6357 from kareem-wolfssl/gh6348
Fix wc_PeekErrorNodeLineData not unlocking error queue on error.
2023-05-01 13:59:35 -06:00
45c8796f7c Merge pull request #6355 from bandi13/minorBugfix
Should only move the index by the amount we wrote
2023-05-01 13:56:22 -06:00
931f665a9a Missing 'tcpdump' utility 2023-05-01 15:30:12 -04:00
00fa00f875 Changes to make it possible to use a different base container 2023-05-01 15:28:39 -04:00
73b3f9c01a Merge pull request #6356 from lealem47/init_values
Fix uninitialized variable compiler warning
2023-05-01 09:18:48 -06:00
f6cdcfcf9f Fix wc_PeekErrorNodeLineData not unlocking error queue on error. 2023-04-28 16:35:49 -07:00
99b4ee50ba Fix uninitialized variable compiler warning 2023-04-28 13:58:29 -06:00
1522155892 Should only move the index by the amount we wrote 2023-04-28 14:08:15 -04:00
52a20fc2b5 Merge pull request #6328 from julek-wolfssl/zd/16000
Allow cert callback to override skipAddCA
2023-04-28 10:25:13 -07:00
13f4e178e5 Zephyr misc fixes for TLS (#6353)
* zephyr wolfssl_tls_sock: fix project name

* zephyr tls_sock.c: don't include options.h when using user settings

* zephyr: define XSTAT_TYPE for use with XSTAT
2023-04-28 10:00:24 -07:00
6b2aca1418 Merge pull request #6347 from SparkiDev/sp_int_armv6_clz
SP int ARMv6: clz not available, correct #if
2023-04-28 09:43:58 -06:00
36ac816cd1 Merge pull request #6342 from TakayukiMatsuo/unittest 2023-04-28 10:06:04 +02:00
f8559b745e Merge pull request #6351 from douzzer/20230427-linuxkm-simd-fixes
20230427-linuxkm-simd-fixes
2023-04-28 11:20:20 +10:00
e4bf1a7c0b Merge pull request #6350 from kareem-wolfssl/zd15670
Fix PowerPC inline assembly on old GNU toolchain.
2023-04-28 11:19:42 +10:00
448f1ec9e7 linuxkm: in {save,restore}_vector_registers_x86(), check if vector register file has already been saved and invalidated, and if so, inhibit the kernel_fpu_{begin,end}() wrap and instead just use preempt_{disable,enable}() wraps. 2023-04-27 17:48:32 -05:00
8a89303b49 wolfcrypt/test/test.c: add TEST_FAIL() macro (counterpart to incumbent TEST_PASS()), by default same as incumbent functionality, but #ifdef TEST_ALWAYS_RUN_TO_END, print errors as they occur but continue to end. 2023-04-27 17:46:56 -05:00
3f60fa8c3b configure.ac: escape backslashes when generating preprocessor directives for .build_params; delete backslashes and process parenthesized arguments correctly when generating options.h. 2023-04-27 17:38:29 -05:00
dcd1428b7d Merge pull request #6304 from TakayukiMatsuo/jpupdate
Update Japanese comments
2023-04-28 07:06:38 +09:00
1172354664 Fix PowerPC inline assembly on old GNU as. It does not like an empty clobbered register line, so simply omit the line. 2023-04-27 14:54:51 -07:00
7b52913451 Merge pull request #6345 from kareem-wolfssl/zd16035
Fix getting key size in stm32_ecc_sign_hash_ex.
2023-04-27 13:32:47 -06:00
bbad64649b Merge pull request #6340 from SparkiDev/minor_fixes_1
Minor fixes
2023-04-27 10:02:06 -06:00
59472312a5 Fix example code in wolfSSL_get_chain_X509 2023-04-27 17:51:10 +09:00
bf2c66a1cb Allow cert callback to override skipAddCA 2023-04-27 10:07:04 +02:00
4c47934562 Fix issues in test_wolfSSL_dtls_fragments 2023-04-27 17:00:29 +09:00
d901433999 SP int ARMv6: clz not available, correct #if
Checking for architecture less than 7 to use clz instruction when clz is
only guaranteed to be available in 7 or more. Reverse logic.
2023-04-27 09:41:31 +10:00
ca4a17ebf6 Merge pull request #6339 from SparkiDev/asn_orig_ocsp_fix
ASN original, OCSP: fix maximum size calc to GetDateInfo
2023-04-26 16:36:55 -06:00
e7e2713bba Fix getting key size in stm32_ecc_sign_hash_ex. 2023-04-26 15:00:59 -07:00
ccb9bdd903 set dev ID with signature check (#6318)
* set dev ID with signature check

* refactor devId use and add API to set devId in WOLFSSL_CERT_MANAGER structure

* add api.c call to set devid with WOLFSSL_CERT_MANAGER

* resolving devID CRL issue and CM pointer

* add device find callback

* add simple test case
2023-04-26 11:19:00 -07:00
3556b7adb7 Merge pull request #6338 from JacobBarthelmeh/certs
revert WOLFSSL_NO_ASN_STRICT macro guard
2023-04-26 11:16:04 -07:00
b42d3566ab Merge pull request #6336 from lealem47/useAfterFree
Remove XMEMSET after XFREE in sniffer.c
2023-04-26 10:50:00 -07:00
32c6a66a4e Merge pull request #6341 from douzzer/20230425-analyzer-coddling
20230425-analyzer-coddling
2023-04-26 11:22:23 -06:00
4526df6d78 Merge pull request #6199 from JacobBarthelmeh/PKCS7
add messageDigest attribute if adding any custom signed attributes
2023-04-26 09:23:22 -06:00
ead8d9784b Update Japanese comments 2023-04-26 18:20:51 +09:00
5538d65a79 wolfcrypt/src/asn.c: add to DecodeCertInternal() a workaround for an apparent clang-tidy bug, gated on WOLFSSL_CLANG_TIDY, and add a missing cast to mollify -Wconversion;
wolfssl/wolfcrypt/sp_int.h: refactor MP_INT_SIZEOF() using sizeof(sp_int_minimal) and addition, rather than sizeof(sp_int) and subtraction, for clarity and analyzer mollification.
2023-04-26 00:05:37 -05:00
5b0c017a94 ASN original, OCSP: fix maximum size calc to GetDateInfo
GetDateInfo called with a local index (reset to 0) but size is of
original buffer. Subtract the index into original buffer from size to
get size available for parsing.
2023-04-26 11:18:29 +10:00
a5a4c71121 Minor fixes
EncryptContent() - id not initialized
sp_int.c: cast count to int to ensure same type comparison with i.
2023-04-26 11:05:07 +10:00
c4233e7aec Merge pull request #6288 from JacobBarthelmeh/Testing
avoid callback buffer overwrite with sha512_224 and remove min from w…
2023-04-26 08:36:20 +10:00
7fb9540176 Merge pull request #6337 from JacobBarthelmeh/fuzzing
add sanity check on PKCS7 index value
2023-04-26 08:33:25 +10:00
5c97dfbb4c Merge pull request #6334 from SparkiDev/openssl_ec_set_priv_key_check
OpenSSL EC API: fix setting private key
2023-04-25 16:32:53 -06:00
2641c493b3 Merge pull request #6335 from JacobBarthelmeh/RT1170
add guard for random with CAAM + MQX
2023-04-26 08:32:20 +10:00
71f71074f8 revert WOLFSSL_NO_ASN_STRICT macro guard 2023-04-25 13:32:19 -07:00
bbe9c694a6 more specific naming for attribute types 2023-04-25 13:56:29 -06:00
d701a0a06e add sanity check on PKCS7 index value 2023-04-25 08:30:33 -07:00
84ea15039f Remove XMEMSET after XFREE in sniffer.c 2023-04-25 09:16:39 -06:00
57de292d19 add guard for random with CAAM + MQX 2023-04-24 16:29:22 -07:00
3e5c8af571 Merge pull request #6322 from lealem47/remove_shellscript
Fix for CMake with USER_SETTINGS on Windows
2023-04-24 17:01:57 -06:00
a991ce1a6b Merge pull request #6327 from SparkiDev/memusage_5
Memory usage improvements
2023-04-24 16:42:56 -06:00
a10526d5f9 Async sniffer: don't retry if seeing non-pending error (#6220)
* Async sniffer: don't retry if seeing non-pending error

* Print error messages when decrypting from queue

* Zeroize the SessionTable in ssl_FreeSniffer()

---------

Co-authored-by: Lealem Amedie <lealem47@github.com>
2023-04-24 13:51:55 -07:00
9b7ca65608 Merge pull request #6330 from douzzer/20230421-configure-fixes
20230421-configure-fixes
2023-04-24 09:35:48 -07:00
e1d1bef085 Merge pull request #6321 from SparkiDev/sp_int_missing_brace
SP int: missing brace
2023-04-24 10:00:39 -06:00
cfeb8b9aee Merge pull request #6332 from SparkiDev/bn_to_asn1_fix
BN_to_ASN1_INTEGER: fix handling of padding
2023-04-24 09:58:12 -06:00
673d72a2dc OpenSSL EC API: fix setting private key
wolfSSL_EC_KEY_set_private_key() should fail on obvious bad private key
values.
2023-04-24 17:59:32 +10:00
2d06718857 Memory usage improvements
TLS 1.3 Server: don't cache the messages for Ed25519/Ed448 when doing
TLS 1.3.

ASN DecodeCertInternal: Call GetCertName for issuer and subject after
freeing the dataASN.
2023-04-24 11:12:00 +10:00
6634ec198e BN_to_ASN1_INTEGER: fix handling of padding
Incorrect calculation of when padding byte needed and consequently
adding byte manually when properly handled by SetASNInt().
2023-04-24 09:30:38 +10:00
865581704e Merge pull request #6312 from philljj/zd15961
Fix out-of-bounds write in fp_mod_2d.
2023-04-24 08:03:02 +10:00
800f4df7a3 fix typos in configure.ac (from shellcheck --severity=warning). 2023-04-21 16:05:43 -05:00
32ff165d8b remove buggy+bug-prone WOLFSSL_NO_XOR_OPS setup in settings.h. 2023-04-21 16:05:20 -05:00
60d059fc9e Merge pull request #6305 from SparkiDev/sp_radix_size_stack_fix
SP int: sp_radix_size when radix 10 fix temp size
2023-04-21 09:59:56 -06:00
e194c90b3e Merge pull request #6326 from SparkiDev/ecc_key_max_bits_fix
ECC: max bits for a key must handle order as well
2023-04-21 09:47:42 -06:00
12cec5ec61 Merge pull request #6325 from SparkiDev/memusage_fix_4
Memory Usage fixes
2023-04-21 09:37:11 -06:00
1106e5ff0e TLS v1.3: Support a stateful ticket and test HAVE_EXT_CACHE (#5960)
* Add TLSv1.3 stateful support
Fix internal and external session cache

* session cache fixes

* Refactor

- implement wolfSSL_CTX_flush_sessions
- use wolfSSL_CTX_flush_sessions to make test_wolfSSL_CTX_add_session_ext deterministic
- add dtls to test_wolfSSL_CTX_add_session_ext
- DoClientTicket_ex does not modify ssl object
- only call session remove callback on:
  - timeout
  - session is being overwritten/removed from the cache

* Session fixes

- restore bogus ID on session duplicate
- don't evict on overwrite
- use memmove instead on memcpy as `ssl->session == session` is possible
- ignore ClientSession parameter in AddSessionToCache on NO_SESSION_CACHE_REF
- use sessionID when altSessionID not present

* Session fixes

- DoClientTicketFinalize: always copy in the ID as teh altSessionID
- don't overwrite ex_data when overwriting cacheSession and cacheSession owns it

* Callback wants to retain a copy

* wolfSSL_GetSessionClient: ssl->ctx->get_sess_cb does not apply here

* test_wolfSSL_CTX_add_session_ext 

gate expected results on WOLFSSL_DTLS_NO_HVR_ON_RESUME

* TlsSessionIdIsValid: copy return can't be ignored

* Silence unused parameter

* test_wolfSSL_CTX_add_session_ext: handle async case

* Gate wolfSSL_SSL_CTX_remove_session on NO_SESSION_CACHE

* ssl.c: style fixes

* Add twcase_get_sessionCb_cleanup to free external cache

* Remove hard tab

* Correct build error in wolfSSL_CTX_flush_sessions

* Jenkins fixes:

- altSessionID only available with WOLFSSL_TICKET_HAVE_ID
- slim out psk_sess_free_cb_ctx

* Stateful dtls case has 2 accesses. Stateless just one.

* Add version numbering to hostap logs

* Import internal.h for test_wolfSSL_SESSION_get_ex_new_index

* wolfSSL_SetSession: don't check SslSessionCacheOff for session setting

* wolfSSL_SetSession: fully set expired session for OpenSSL compatibility

* wolfSSL_SetSession: check if setting same object

* AddSession: always populate the session object to allow re-use

* Add logging to wolfSSL_NewSession and wolfSSL_FreeSession

* Always setup session object

* Check if session has been setup before setting it

* Print errors in async test

* Make SetupSession available outside NO_SESSION_CACHE

* Review comments

* Fix ticBuf leak and TlsSessionIdIsValid logic

* Fix unmatched curly brackets

* TlsSessionIdIsValid: always need to check copy var

* TlsResumptionIsValid: set resume to FALSE default

* wolfSSL_SetSession: remove now variable since only used in one place

* Move internalCacheLookupOff into HAVE_EXT_CACHE block

---------

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2023-04-21 06:46:08 -07:00
9230d9cfe3 Merge pull request #6185 from lealem47/time_check
Adding NO_ASN_TIME_CHECK build option
2023-04-21 11:55:52 +10:00
0cc50521b6 ECC: max bits for a key must handle order as well
The order may be 1 bit larger than prime for some curves.
Handle this in calculation of maximum size of curve.

SP int _sp_mont_red(): ensure m->used is never 0 when doing default
implementaion.
2023-04-21 11:23:47 +10:00
d414ae9492 Memory Usage fixes
Ed25519CheckPubKey/Ed448CheckPubKey: get the public key from certificate
in a new function, wc_CertGetPubKey, that uses less memory.
Set the ENCRYPT_BASE_BITS to minimal values when Curve448/Curve25519 are
the largest public key algorithms.
2023-04-21 09:59:38 +10:00
0bae919a9c SP int: ensure declaration of sp_ints are with valid values
Move declaration of sp_ints until after checks of valid parameters.
In particular, whether used field of input/s are valid.
Pull implementations of algorithms out into separate functions as a
pattern to fix.
2023-04-21 08:48:38 +10:00
8994aab0ed SP int: sp_radix_size when radix 10 fix temp size
SP int should be able to calculate size of encoded number for a radix of
10 when mp_int has all digits used.
sp_radix_size declared a temporary mp_int of 1 greater than input. Don't
need it 1 greater. Stack declaration of maximum plus one caused address
sanitizer error.
Changed temporary mp_int to be same size as input mp_int.
2023-04-21 08:46:46 +10:00
42be04f323 Remove duplicate line 2023-04-20 16:45:53 -06:00
a963adc33d Add more comments for alternatives and security risk 2023-04-20 14:36:22 -06:00
b0c6a3ec75 Adding NO_ASN_TIME_CHECK build option 2023-04-20 14:16:00 -06:00
d099fe34b5 Merge pull request #6324 from SparkiDev/sp_int_thumb_asm_r7
SP int: ARM Thumb ASM don't use r7 on debug
2023-04-20 10:51:19 -06:00
ebff7f46b7 Merge pull request #6323 from SparkiDev/sp_c_to_bin_mp_fix
SP C: fix handling of oversized arrays
2023-04-20 09:24:06 -06:00
c761f587f6 Merge pull request #6278 from julek-wolfssl/fix-zephyr
Zephyr port update
2023-04-20 06:48:02 -07:00
4fd629d4e7 fix white spaces and overlong lines 2023-04-20 16:07:51 +09:00
1d94521abe SP int: ARM Thumb ASM don't use r7 on debug
When DEBUG is defined, use versions of assembly code that don't use
register r7.
2023-04-20 15:13:54 +10:00
574d8c3f63 Merge pull request #6319 from douzzer/20230418-more-Wconversion-fixes
20230418-more-Wconversion-fixes
2023-04-20 13:19:07 +10:00
32e2775d34 SP C: fix handling of oversized arrays
For mul and sqr implementation efficiency the fixed array has extra
digits beyond what is needed. When encoding, only put in the useful
digits.
2023-04-20 12:42:51 +10:00
da9cda7eae wolfcrypt/src/pkcs12.c: fix non-portable casts;
wolfcrypt/src/sp_int.c: use unsigned int, not word32, for sign variables, to match type in header file.
2023-04-19 21:22:34 -05:00
fa914a0054 Let hashbang decide which shell to run with instead of default shell 2023-04-19 18:13:57 -06:00
cc8b789545 Remove shellscript dependency from CMake with WOLFSSL_USER_SETTINGS 2023-04-19 17:20:33 -06:00
4ec23571c6 SP int: missing brace
Missing a brace in sp_exptmod_ex().
2023-04-20 08:27:44 +10:00
2a00b67056 revert change in wc_ShaFinal() capturing InitSha() retval, introduced in 510038022f, to (void)ed result. 2023-04-19 17:25:33 -05:00
dc8f348bdf smaller sized build with curl 2023-04-19 15:12:15 -07:00
8f610bb156 fix for retval overwrite (warned by clang-analyzer-deadcode.DeadStores) in sha.c:wc_ShaFinal();
fix for benign clang-analyzer-deadcode.DeadStores in aes.c:wc_AesFeedbackEncrypt();

fix for cppcheck:selfAssignment in chacha.c:wc_Chacha_wordtobyte().
2023-04-19 15:53:48 -05:00
f396989d20 more -Wconversion fixes, now covering everything inside the 140-3 boundary with default build options, everything in wolfcrypt with default build options, all modes of AES, builds with/without intelasm, all permutations of c89/c99 32/64 bit, and much of the crypto-all-cryptonly boundary;
also a gating fix for asn.c:SetShortInt().
2023-04-19 15:26:05 -05:00
3865f943c3 Merge pull request #6203 from julek-wolfssl/xor-optim
Try to XOR as many words as possible in xorbuf APIs
2023-04-19 11:59:33 -06:00
0e64972c86 Merge pull request #6316 from SparkiDev/memusage_fix_3
ASN.1 template: CheckCertSignature memory usage fix
2023-04-19 10:37:11 -06:00
0186fb7114 Merge pull request #6313 from anhu/empty_stack
Should not be an error to call wolfSSL_X509_REQ_add_extensions with...
2023-04-19 10:32:06 -06:00
c9d91c5e79 Zephyr port update
- Add CONFIG_PTHREAD_IPC when using threads
- Add logging config suggestions
- test.c: fix undefined `ret` error
- Increase stack size for samples
- Ignore ASN_BEFORE_DATE_E in examples
- wc_port.h: add missing posix thread includes
- wc_port.h: move definitions to relevant section
- benchmark.c: fix missing `arc` and `argv` errors
- benchmark.c: fflush does not work on stdout in Zephyr
- Update z_fs_open implementation to support flags
2023-04-19 18:18:00 +02:00
81c9062973 sakke.c: use xorbuf 2023-04-19 17:06:25 +02:00
bed99401a0 hpke.c: use xorbufout in wc_HpkeContextComputeNonce 2023-04-19 17:06:25 +02:00
3c57228197 aes.c: Use xorbufout when possible 2023-04-19 17:06:25 +02:00
6079b92e26 xorbuf: fix alignment when possible 2023-04-19 17:06:25 +02:00
82e8eb2f70 rsa.c: Use xorbuf when possible 2023-04-19 17:06:25 +02:00
e7ae64d9b5 pkcs12.c: Ignore param when heap not used 2023-04-19 17:05:03 +02:00
7a0d6487b7 Simplify ctMaskCopy 2023-04-19 17:05:03 +02:00
b91f3063ea Use xorbuf in 3des for FREESCALE_MMCAU 2023-04-19 17:05:03 +02:00
aeb4338085 Use xorbufout in chacha 2023-04-19 17:05:03 +02:00
8fe321d5be Try to XOR as many words as possible in xorbuf APIs 2023-04-19 17:05:03 +02:00
81ab16b105 Merge pull request #6314 from TakayukiMatsuo/vla2 2023-04-19 08:11:40 -06:00
510038022f Various Espressif HW crypto, SHA2, AES, MP updates. (#6287)
* various Espressif HW crypto, SHA2, AES, MP updates.

* code review updates & cleanup

* clean trailing whitespace

* cleanup per code review

* removed additional unused WOLFSSL_USE_ESP32C3_CRYPT_HASH_HW

* Code review updates; pack & order WC_ESP32SHA

* clean up TAG text for Espressif ESP_LOG()
2023-04-19 06:10:22 -07:00
436c647acc Memory Usage: reduce maximum in use
CheckCertSignature
Free the dataASN before calling ConfirmSignature.
dataASN not needed at this point and ConfirmSignature uses lots of
memory.

DecodeCertInternal:
Free the dataASN before calling DecodeCertExtensions,
dataASN not needed at this point and DecodeCertExtensions uses more
memory.

ecc_verify_hash:
v doesn't need to be a new allocated variable - reuse w.
v is the modular reduction of x-ordinate to prime calculated at end.
2023-04-19 16:44:34 +10:00
70322f620d Merge pull request #6303 from douzzer/20230414-yet-more-c89
20230414-yet-more-c89
2023-04-18 16:00:12 -07:00
3a2bcf080b Merge pull request #6276 from anhu/zephyr_stm32
Add in instructions for compiling with zephyr on STM32.
2023-04-18 14:50:53 -07:00
243665fe37 Merge pull request #6315 from anhu/stm32_gpdma
Instructions for GPDMA configuration
2023-04-18 14:50:25 -07:00
c67de7f914 Merge pull request #6308 from SparkiDev/sp_mod_err_check
SP int: sp_mod check sp_div error before adding and replacing error
2023-04-18 15:44:50 -06:00
8b79248eab Merge pull request #6307 from SparkiDev/decode_ecdsa_sig_inited
ECC, ASN.1: DecodeECC_DSA_Sig didn't handle r and s being initialized
2023-04-18 15:43:42 -06:00
a525fa19f4 Merge pull request #6306 from SparkiDev/wc_ecc_is_point_check_args
ECC: wc_ecc_is_point - validate parameters
2023-04-18 15:37:22 -06:00
d59724a0f3 Instructions for GPDMA configuration 2023-04-18 16:52:57 -04:00
b3b26dd266 Add in instructions for compiling with zephyr on STM32. 2023-04-18 16:19:32 -04:00
fe3099b08e wolfssl/wolfcrypt/settings.h: add #ifdef _MSC_VER clause to define ssize_t, #ifndef HAVE_SSIZE_T. 2023-04-18 14:43:41 -05:00
cc747f0094 Add WOLFSSL_SP_NO_DYN_STACK macro to avoid compilation error in CC-RX compiler 2023-04-19 04:39:49 +09:00
f1a674eec9 wolfcrypt/src/wc_port.c: in wc_FileLoad(), use ssize_t for fileSz, not long int, for portability. 2023-04-18 14:30:38 -05:00
b87c2fc621 fix null pointer deref (found by cppcheck:nullPointerRedundantCheck) in src/x509.c:wolfSSL_X509_EXTENSION_create_by_OBJ(). 2023-04-18 14:29:13 -05:00
4180a650c8 fix clang-analyzer-deadcode.DeadStores in wolfcrypt/src/asn.c:SetOthername(). 2023-04-18 14:27:52 -05:00
a4aef0e55d refinements from peer review for #6303. 2023-04-18 12:23:24 -05:00
193919a276 add wc_strcasecmp() and wc_strncasecmp() to wc_port.c, and set up (USE_WOLF_STR[N]CASECMP) in types.h for targets lacking native implementations (including WOLF_C89);
define USE_WOLF_STRSEP if defined(WOLF_C89).
2023-04-18 12:23:24 -05:00
4b9302cdb3 another batch of -Wconversion fixes. 2023-04-18 12:23:24 -05:00
42bea705d9 fix several more C89 "comma at end of enumerator list" spots in 64-bit-only headers, missed in earlier passes; in tests/unit.h, add a WOLF_C89 definition of AssertPtr() without pragmas, to avoid a -Wdeclaration-after-statement. 2023-04-18 12:23:24 -05:00
730890b8cc wolfssl/wolfcrypt/sp_int.h: fix a missed bugprone-macro-parentheses in the C89 path. 2023-04-18 12:23:24 -05:00
d91f0f82d8 wolfssl/wolfcrypt/misc.h: add missing argument names in NO_INLINE path. 2023-04-18 12:23:24 -05:00
3d16ec8dc1 wolfssl/wolfcrypt/asn_public.h: fix version threshold for wc_RsaPrivateKeyValidate() prototype. 2023-04-18 12:23:24 -05:00
98b718f91b wolfcrypt polish: init, checks, corrections (#6249)
* wolfcrypt polish: init, checks, corrections
2023-04-18 09:41:42 -07:00
b0e90b6ffe Should not be an error to call wolfSSL_X509_REQ_add_extensions with empty stack. 2023-04-18 12:27:54 -04:00
f7d7e4f30a Merge pull request #6285 from gojimmypi/Espressif_VisualGDB
platform-specific VisualGDB test & benchmark projects
2023-04-18 11:52:29 -04:00
8254112c9b Fix out-of-bounds write in fp_mod_2d. 2023-04-18 10:51:38 -05:00
ca71907142 add function to control default pkcs7 signer attributes 2023-04-18 08:35:02 -07:00
ad13717644 add messageDigest attribute if adding any custom signed attributes 2023-04-18 08:35:02 -07:00
ff13a7cdc8 Merge pull request #6250 from julek-wolfssl/fix-wolfSSL_DES_ede3_cbc_encrypt
Write next IV in wolfSSL_DES_ede3_cbc_encrypt
2023-04-18 09:33:10 -06:00
a5c220d034 AES: touch each cache line when getting offset from table 2023-04-18 12:46:56 +10:00
59c113d358 SP int: sp_mod check sp_div error before adding and replacing error
Fix to not overwrite error when sp_div fails in sp_mod.
2023-04-18 09:38:13 +10:00
eddcf0c0ee ECC, ASN.1: DecodeECC_DSA_Sig didn't handle r and s being initialized
New creation of mp_ints r and s to be minimal size must not be
re-initialized.
Changes to ASN.1 code to handle r and s being initialized and to not
initialize again.
2023-04-18 09:37:23 +10:00
04ae676629 ECC: wc_ecc_is_point - validate parameters
Public API wc_ecc_is_point() needs to validate the parameters.
Ensure that the x and y are in range [0, p-1] and z is one (affine
ordinates).

Made the API a wrapper around existing calculation code.
When x-ordinate is a large negative, then it will spend large amounts of
time adding the prime to a large negative intermediate value.
2023-04-18 09:35:22 +10:00
42b73ee326 Merge pull request #6277 from anhu/upnsid
Support UPN and SID.
2023-04-17 17:03:55 -06:00
120d1f0d1a Support in the compatibility layer for UPN and SID. 2023-04-17 14:42:27 -04:00
91a2c9f18e Merge pull request #6310 from julek-wolfssl/hostap-certs-update-2023
hostap/hwsim: use a custom commit to update the expired certs
2023-04-17 11:36:59 -07:00
aa47a38a9e hostap/hwsim: use a custom commit to update the expired certs
- use 'theirs' merge strategy
2023-04-17 18:43:47 +02:00
5938a40def Merge pull request #6297 from JacobBarthelmeh/math
clean up NO_BIG_INT build, removing WOLFSSL_SP_MATH macro and heapmath compile
2023-04-17 07:44:20 -07:00
ec78d1a4b8 Merge pull request #6293 from tim-weller-wolfssl/mynewt-updates
Update wolfCrypt porting layer for Mynewt OS to remove build warning.
2023-04-17 08:07:39 -06:00
50e15dbb36 Merge pull request #6283 from cconlon/tls13resume12
In SendTls13ClientHello() only send Session ID for sessions being resumed (< TLS 1.3)
2023-04-17 12:21:11 +10:00
6b12831dfb Merge pull request #6302 from douzzer/20230413-more-wolfcrypt-c89
20230413-more-wolfcrypt-c89
2023-04-14 14:08:03 -07:00
cb9a121bd7 fix configure, compatibility layer needed big int. for BN use 2023-04-14 14:52:05 -06:00
1bed740710 address peer review: make C89-compatible refactors in sakke_pairing() and sakke_modexp_loop(); add explanatory comment for WOLF_ENUM_DUMMY_LAST_ELEMENT() in types.h. 2023-04-14 15:07:05 -05:00
39b81ce338 Merge pull request #6282 from dgarske/fix_heapmath
Fix for including integer.h when heap math is not used
2023-04-14 14:28:38 -05:00
ac85cfa3d5 fix "comma at end of enumerator list" warnings in wolfcrypt for C89 compatibility, mostly by just snipping out unneeded comma, but several using WOLF_ENUM_DUMMY_LAST_ELEMENT() to preserve gated enum values as-is. 2023-04-14 13:48:03 -05:00
2bcf6bd3ca wolfssl/wolfcrypt/types.h: add WOLF_ENUM_DUMMY_LAST_ELEMENT() macro, and disable HAVE_ANONYMOUS_INLINE_AGGREGATES ifdef WOLF_C89. 2023-04-14 13:47:47 -05:00
d5588af0a2 wolfcrypt/src/sakke.c: fixes for C89 "initializer element is not computable at load time". 2023-04-14 13:29:26 -05:00
105714460c wolfcrypt/src/fe_448.c: fix declaration-after-statement in fe448_mul_8(). 2023-04-14 13:29:26 -05:00
edf95dbcbd add WOLF_C89 clauses to the W64LIT() definitions in wolfssl/wolfcrypt/types.h, and wrap several long long numeric literals with W64LIT() in wolfcrypt/src/{aes.c,blake2b.c,siphash.c};
add WOLF_C89 handling to SP_ULONG_BITS and SP_ULLONG_BITS setup in wolfssl/wolfcrypt/sp_int.h.
2023-04-14 13:29:26 -05:00
bc3d070629 Merge pull request #6290 from embhorn/zd15969
Allow Micrium to use STM32_RNG
2023-04-14 10:59:50 -07:00
deae28b9a3 Fix for building with heap math and including integer.h only. Fixes https://github.com/wolfSSL/wolfssl/issues/6280
```
./configure --enable-heapmath CFLAGS="-DWOLFSSL_PUBLIC_MP" && make && sudo make install
cd ../wolfssl-examples/ecc
make clean && make
```
2023-04-14 10:37:40 -07:00
36a9b9944c fix guard on ECC export 2023-04-13 16:12:08 -07:00
00aa061d77 Merge pull request #6300 from douzzer/20230413-fixes
20230413-fixes
2023-04-13 15:41:51 -06:00
35f6099d7c Add SCE RSA Crypt Only feature
- RSA SSA 1024/2048 Sign/verify
  - RSA ES 1024/2048 Enc/Dec
  - Unit test for these RSA operation
2023-04-14 06:41:24 +09:00
04ee247389 do not default to heapmath if no other math libraries found, add NO_BIG_INT as a math option in settings.h 2023-04-13 14:38:35 -07:00
6040a6b5da Merge pull request #6299 from JacobBarthelmeh/build
fix for wpas build with x509 small
2023-04-13 13:54:50 -07:00
358af4ef05 fix for cppcheck/zerodivcond in wolfcrypt/src/pkcs7.c:wc_PKCS7_DecodeAuthEnvelopedData();
fixes for clang-tidy/bugprone-macro-parentheses in wolfssl/wolfcrypt/sp_int.{c,h} and wolfcrypt/src/ecc.c;

fix for clang-analyzer-deadcode.DeadStores in olfcrypt/src/asn.c.
2023-04-13 14:51:29 -05:00
2307b36a65 Merge pull request #6296 from JacobBarthelmeh/RT1170
fix for creating options.h with cmake and WOLFSSL_USER_SETTINGS
2023-04-13 11:24:53 -07:00
9a0934161d fix for wpas build with x509 small 2023-04-13 10:38:12 -07:00
419a1f0a01 Merge pull request #6294 from douzzer/20230412-WC_ASN_NAME_MAX-bump-for-MULTI_ATTRIB
20230412-WC_ASN_NAME_MAX-bump-for-MULTI_ATTRIB
2023-04-12 16:21:33 -07:00
441b78e5a2 Merge pull request #6284 from douzzer/20230410-Wconversion-fixes
20230410-Wconversion-fixes
2023-04-12 17:07:24 -06:00
d4b92cb65c Merge pull request #6295 from dgarske/stm32_20230412
Fixes for STM32 U5/H5/H7 hash and PKA sign build error
2023-04-12 16:36:43 -06:00
26a0142f51 add nomath option for builds without a math library 2023-04-12 15:33:59 -07:00
c41030663e wolfcrypt/src/pkcs7.c: correct fix for clang-analyzer-core.DivideZero in wc_PKCS7_DecodeAuthEnvelopedData(). 2023-04-12 16:37:20 -05:00
b7ff375ac6 Fix PKA build error with SP sign. Fix U5/H5/H7 hashing, which require a workaround to write an extra 32-bit to flush FIFO before save/restore. 2023-04-12 13:45:29 -07:00
e1ca478356 Added STM32G0 benchmarks. 2023-04-12 13:45:28 -07:00
2c26b068b2 Merge pull request #6239 from dgarske/stm32h5
Support for STM32H5
2023-04-12 14:33:25 -06:00
97ffdfa9b8 wolfssl/wolfcrypt/asn.h: if defined(WOLFSSL_MULTI_ATTRIB), bump predefined WC_ASN_NAME_MAX, to fix rsa_certgen_test() with config --enable-testcert --enable-asn=original CPPFLAGS='-DWOLFSSL_CERT_GEN -DWOLFSSL_MULTI_ATTRIB'. 2023-04-12 13:48:03 -05:00
72fc023d38 Update wolfCrypt porting layer for Mynewt OS to provide declarations needed to remove build warning for time API used for XTIME 2023-04-12 12:30:42 -05:00
4b59588cf3 more fixes for implicit casts, mostly asn=original. 2023-04-12 02:17:18 -05:00
fe2acb53af wolfcrypt/src/ecc.c:fix overstringent arg check in wc_ecc_gen_k(). 2023-04-12 01:37:09 -05:00
7155c5748e fix overlong lines. 2023-04-12 01:37:09 -05:00
99ffd7726f wolfcrypt/src/pkcs7.c:wc_PKCS7_DecodeAuthEnvelopedData(): fix clang-analyzer-core.DivideZero (expBlockSz not properly set before use as a denominator in a mod op). 2023-04-12 01:37:09 -05:00
bd8f97f315 Revert "Resolve issue with C89 compliance with "commas at the end of enumerator lists"."
This reverts commit 68acfd51dca1e0e11e2e7bd0e6ab956b8def6473.
2023-04-12 01:37:09 -05:00
41818bf6f8 Revert "Fix enum KeyWrap_Sum impossible combinations (note: ugly code)."
This reverts commit 2bac48a290e5243337f661c70eb582e55ceb2c39.
2023-04-12 01:37:09 -05:00
ed11669f3c more fixes for implicit casts, including asn=template. 2023-04-12 01:37:09 -05:00
ee50d95b0b Fix enum KeyWrap_Sum impossible combinations (note: ugly code). 2023-04-12 01:37:09 -05:00
72c6429276 Better fixes for pedantic to resolve (error: comparison of unsigned expression >= 0 is always true). Also overlong lines. 2023-04-12 01:37:09 -05:00
f3eee4bc99 Resolve issue with C89 compliance with "commas at the end of enumerator lists".
Tested with `./configure --disable-asm --enable-32bit --enable-asn --enable-cryptonly CFLAGS="-Wall -ansi -pedantic-errors -Wshadow -g" && make`
2023-04-12 01:37:09 -05:00
6418e3cbfe Fixes for implicit casts.
Tested with `./configure --disable-asm --enable-32bit --enable-asn=original --enable-cryptonly CFLAGS="-Wconversion -pedantic" && make`. Some progress with ASN template, but not complete.
2023-04-12 01:37:09 -05:00
1889549828 fix for creating options.h with cmake and WOLFSSL_USER_SETTINGS 2023-04-11 13:30:04 -07:00
9465d32aea Allow Micrium to use STM32_RNG 2023-04-11 15:12:58 -05:00
edad8d1da8 avoid callback buffer overwrite with sha512_224 and remove min from wolfcaam_cmac 2023-04-11 09:06:39 -07:00
6a89464176 Merge pull request #6231 from billphipps/15785-CorrectFreeDuringEarlyConnectFail
Track SetDigest usage to avoid invalid free under error conditions.
2023-04-11 09:49:51 -06:00
9f257af989 platform-specific VisualGDB test & benchmark projects 2023-04-11 09:41:53 +02:00
18e0c28487 Only send session ID in resumed ClientHello from SendTls13ClientHello() if ssl->options.resuming 2023-04-10 15:43:31 -06:00
0013be9027 15451 correct padding for pkcs7 (#6260)
* Update to ensure full blocks for crypto in En/DecodeAuthEnvelopedData.

* Corrected spacing and comments

* Set plain to NULL after free on non-error path.
2023-04-10 14:08:52 -07:00
f2ae066797 Merge pull request #6281 from JacobBarthelmeh/ECC
- fix ECC performance regression
2023-04-10 14:08:43 -07:00
8bb0b2ef3f fix for ECC sign with nonblocking only 2023-04-10 12:53:40 -07:00
6b862a1440 Merge pull request #6272 from gojimmypi/wolfcrypt-mpi-fix
mp_setneg(Z), not mpi
2023-04-10 11:58:04 -07:00
2430f2377f Corrected spacing and comments 2023-04-10 17:15:22 +00:00
582d8a70f5 fix ECC performance regression 2023-04-09 00:08:01 -06:00
12e285434b Merge pull request #6275 from douzzer/20230406-XREWIND-fixes-contd
20230406-XREWIND-fixes-contd
2023-04-06 15:22:48 -06:00
7c15131db5 wolfcrypt/src/asn.c: in wc_PemCertToDer_ex() and wc_PemPubKeyToDer_ex(), work around false positive -Wmaybe-uninitialized from scan-build. 2023-04-06 15:15:26 -05:00
012f0e0779 Merge pull request #6262 from SparkiDev/mp_int_mem_usage
SP int: improve use of stack
2023-04-06 14:06:08 -06:00
3468750bae wolfcrypt/src/asn.c:
* refactor error-checking cascade in wc_PemCertToDer_ex() as in wc_PemPubKeyToDer_ex(),
 * refactor staticBuffer gating/dynamics in wc_PemPubKeyToDer_ex() as in wc_PemCertToDer_ex(),
 * and use IO_FAILED_E, not BUFFER_E, for I/O errors on the file handles, in both routines;

fix smallstack null pointer dereferences in src/pk.c:wolfSSL_RSA_GenAdd() and src/ssl.c:set_curves_list().
2023-04-06 14:31:53 -05:00
bd02b9c29c Merge pull request #6254 from miyazakh/fix_favouriteDrink 2023-04-06 09:39:23 -06:00
67624628c2 Merge pull request #6274 from douzzer/20230405-fixes
20230405-fixes
2023-04-06 14:27:37 +10:00
dcc8b5d7d5 eliminate XREWIND() macro, add XSEEK_SET definitions, and refactor all XREWIND()s to XFSEEK()s, to fix clang-tidy-17 bugprone-unsafe-functions warning on rewind();
add BENCH_DEVID_COLUMN_HEADER in wolfcrypt/benchmark/benchmark.c:bench_stats_sym_finish() to resolve clang-diagnostic-embedded-directive.
2023-04-05 20:28:51 -05:00
8065139050 SP int: improve use of stack
Minimize use of stack.
Make very large stack allocations dynamic memory allocations unless
WOLFSSL_SP_NO_MALLOC.

ProcessBufferTryDecode() split up into a function for each type.
ProcessBufferTryDecodeRsa() decodes the data and gets key size rather
than having or allocating an RsaKey.
Added wc_RsaPrivateKeyValidate() that only validates the encoding is an
RSA key and returns the key size in bytes.

For SP int, only create sp_ints of required size in RSA and ECC
implementation. For WOLFSSL_SMALL_STACK, memory is allocated to have
just enough bytes and size is set to maximum supported. Otherwise,
relies on dynamic stack variables.
For ECC, MAX_ECC_BITS_USE used when dynamic stack variables not
supported. Significantly reduces memory usage when RSA/DH is also built.

Add macros to sp_int.h, tfm.h and integer.h to support declaring,
allocating, initializing and freeing mp_ints.
For integer.h, mp_int is always static as size is no more than 32 bytes.
For tfm.h, WOLFSSL_SMALL_STACK has a full mp_int allocated, otherwise
the full mp_int is put on the stack.
For sp_int.h  with new macros, dynamically allocate sp_int to minimal
size when WOLFSSL_SMALL_STACK, or when dynamic stack variables, declare
them to be of minimal size or otherwise declare with a fixed max.
Added mp_bitsused(), for all implementations, to get the number of bits
available based on used. Included for RSA to get the size of the
modulus.

SP int now always uses dynamic stack variables if possible rather than
for builds with WOLFSSL_SP_SMALL.
Moved code out into separate functions so that stack allocations don't
happen when not going down code path.
2023-04-06 10:04:39 +10:00
8c0a20fc32 Merge pull request #6212 from embhorn/gh6211
RIOT-OS does support writev
2023-04-05 15:26:07 -06:00
caf2749c8a Merge pull request #6269 from julek-wolfssl/fix-test_wolfSSL_CTX_add_session
Fix intermittent failures in test_wolfSSL_CTX_add_session
2023-04-05 15:19:36 -06:00
1bef3ec745 Merge pull request #6233 from embhorn/gh6209
Support HAVE_SESSION_TICKET without realloc
2023-04-05 15:17:58 -06:00
3c90eb25c8 Merge pull request #6271 from anhu/XSTAT
Allow user to override XSTAT
2023-04-05 14:44:09 -06:00
9c368d0a0e Merge pull request #6273 from anhu/wolfSSL_get_chain_cert
Documentation fixup for wolfSSL_get_chain_cert();
2023-04-05 14:33:29 -06:00
599cf9356f Merge branch 'wolfSSL:master' into 15785-CorrectFreeDuringEarlyConnectFail 2023-04-05 15:24:30 -04:00
3e58e47856 Documentation fixup for wolfSSL_get_chain_cert(); 2023-04-05 15:12:43 -04:00
cf173e7b7d Merge pull request #6270 from julek-wolfssl/fix-test_wolfSSL_dtls_stateless_HashWOLFSSL
Ignore staticBuffer in test_wolfSSL_dtls_stateless_HashWOLFSSL
2023-04-05 12:53:11 -05:00
d9bf93b49f Support HAVE_SESSION_TICKET without realloc 2023-04-05 11:33:06 -05:00
3b934b858e Merge pull request #6268 from SparkiDev/asn1_test_0_len
ASN.1 testing: restore 0 length BIO failure tests
2023-04-05 11:14:50 -04:00
bb32b6a927 mp_setneg(Z), not mpi 2023-04-05 17:10:37 +02:00
6a52c727f6 Merge pull request #6267 from SparkiDev/openssl_cryptonly
OpenSSL API and cryptonly: fix to compile
2023-04-05 09:08:32 -06:00
c9e467b734 Allow user to override XSTAT 2023-04-05 10:39:16 -04:00
171c217ae5 Add in-place support for DES_ede3_cbc_encrypt 2023-04-05 15:50:51 +02:00
c5f03e43cf Ignore staticBuffer in test_wolfSSL_dtls_stateless_HashWOLFSSL 2023-04-05 14:23:19 +02:00
a51daf1bfa Fix intermittent failures in test_wolfSSL_CTX_add_session 2023-04-05 13:57:10 +02:00
9eac521521 ASN.1 testing: restore 0 length BIO failure tests
Create a fixed buffer BIO of length 1 and then write one byte into it so
that there is 0 length to write into.
Test cases removed as setting fixed buffer BIO to length 0 allocated 0
length buffer that is sometimes returning NULL.
2023-04-05 10:29:46 +10:00
10c1009bbd Merge pull request #6127 from JacobBarthelmeh/qnx
IMX6Q CAAM Port
2023-04-05 08:44:00 +10:00
9eb3c4d31a fix unitest failure 2023-04-05 07:25:25 +09:00
b30c8b1fca OpenSSL API and cryptonly: fix to compile
OBJ_nid2sn not available when compiling for cryptonly - don't compile in
call to it in test.h.
2023-04-05 08:02:20 +10:00
b8e61a241b Merge pull request #6257 from kareem-wolfssl/micriumFixes
Micrium settings fixes
2023-04-04 11:09:49 -06:00
539c562ecd Merge pull request #6263 from julek-wolfssl/fix-docs-wolfSSL_set_dtls_fd_connected
Add missing semicolon
2023-04-04 10:49:02 -06:00
cb422bfaf7 Merge pull request #6242 from julek-wolfssl/harden-tls
Implement TLS recommendations from RFC 9325
2023-04-04 10:13:27 -06:00
027c8ed926 Add missing semicolon 2023-04-04 16:59:28 +02:00
a4a6a05f06 Merge pull request #6251 from PrinceOfPuppers/master
updated zephyr includes
2023-04-03 16:25:32 -07:00
e4f75afe5f update README 2023-04-03 16:41:09 -06:00
f9f1347e8d third optimization pass with aes-ctr 2023-04-03 16:41:09 -06:00
14b0f422c8 optimization pass through 2 2023-04-03 16:41:08 -06:00
5882b8f68a cleanup user_settings example file 2023-04-03 16:41:08 -06:00
30adcd58d8 IMX6Q CAAM Port 2023-04-03 16:41:08 -06:00
b1e4d4922e Merge pull request #6259 from SparkiDev/cppcheck_fixes_9
cppcheck fixes
2023-04-03 15:35:35 -07:00
b6ab7a9d56 Merge pull request #6261 from douzzer/20230331-fixes
20230331-fixes
2023-04-03 14:56:16 -07:00
c08878ac94 configure.ac: include both -I. and -I$srcdir for "circular dependency" test, so that ${build_pwd}/wolfssl/options.h is found in out-of-tree builds; streamline scripting that dynamically sets $TRIM;
linuxkm/module_exports.c.template: include wolfssl/wolfcrypt/wolfmath.h, to bring in wc_GetMathInfo() prototype;

src/ssl.c: move "Global pointer to constant BN on" to src/ssl_bn.c; and in wolfSSL_Cleanup(), call the new wolfSSL_BN_free_one() rather than using ad hoc cleanup logic;

src/ssl_bn.c: add bn_one and wolfSSL_BN_free_one();

src/ssl_asn1.c: fix bugprone-macro-parentheses in bufLenOrNull(); refactor wolfSSL_ASN1_TIME_diff() to avoid floating point math; use intermediate tm_year variable in wolfssl_asn1_time_to_tm() to avoid target-specific type conflicts on tm->tm_year; use "FALL_THROUGH", not "/* fall-through */", in wolfSSL_ASN1_TYPE_set (clang-diagnostic-implicit-fallthrough);

wolfcrypt/src/ecc.c: fix identicalInnerCondition in ecc_mul2add();

wolfcrypt/src/integer.c: refactor OPT_CAST()s in mp_grow() to unconditional casts as elsewhere, to mollify a confused cppcheck-all-intmath;

tests/api.c: reformat some overlong lines.
2023-04-03 15:49:39 -05:00
505ab746c6 Tabs -> spaces 2023-04-03 18:24:01 +02:00
8851065848 cppcheck fixes
Fix checking of negative with unsigned variables.
Check digestSz for 0 in wc_SSH_KDF() so that no possibility of dividing
by zero.
Change XMEMCPY to XMEMSET in renesas_sce_util.c.
Fix test.c to free prvTmp and pubTmp on read error.
Remove unused variables.
XFREE checks for NULL so don't check before call.
Move variable declarations to reduce scope.
2023-04-03 16:59:58 +10:00
a64fba93cb Micrium: Add missing XATOI/XSTRTOK definitions, update XMEMMOVE function. 2023-03-31 17:33:33 -07:00
2ad0659fa4 Merge pull request #6255 from julek-wolfssl/fix-ssl_asn1
Add missing guards
2023-03-31 13:54:25 -07:00
c56e58db5b Remove TODO+bad tests 2023-03-31 15:51:28 -04:00
18f4b45129 Fix object size 2023-03-31 15:44:25 -04:00
80a0fb548a Zero buffer size test should be implemented another way 2023-03-31 15:44:13 -04:00
753ad4c4c1 Merge pull request #6253 from JacobBarthelmeh/CAAM
resolve warning about uninitialized variable
2023-03-31 10:50:28 -07:00
35611cad96 Merge pull request #6252 from julek-wolfssl/async-test-action
Initial async test with gh action
2023-03-31 11:33:32 -06:00
c8e1731cb7 Fix dependency issues 2023-03-31 13:21:13 -04:00
74e6f0d337 Merge pull request #6243 from julek-wolfssl/reuse-wolfssl-builds
actions: Build wolfSSL in seperate job
2023-03-31 09:26:43 -06:00
7138b66b5e Compiler error 2023-03-31 11:22:58 -04:00
9f41ed8c72 Add missing guards 2023-03-31 16:11:58 +02:00
8f8153220b Remove trailing whitespace 2023-03-31 13:29:42 +02:00
f1a93f524d Tabs -> spaces 2023-03-31 11:51:49 +02:00
ffcc66bb53 Add explicit casts 2023-03-31 11:48:18 +02:00
4ddc975aca Expand asyn-check script 2023-03-31 11:25:46 +02:00
27f5f3a3e8 fix overwriting serialnum by favouriteDrink 2023-03-31 15:56:31 +09:00
00e3dcfab5 Merge pull request #6226 from SparkiDev/asn1_move
Move ASN.1 APIs out to separate file: ssl_asn1.c
2023-03-30 18:22:13 -07:00
8489095057 Move ASN.1 APIs out to separate file: ssl_asn1.c
Implementations of ASN.1 APIs reworked.

Added tests.

Added wolfssl_bn_set_neg for ASN.1 code.
Added wolfssl_sk_new_type() and wolfssl_sk_pop_type() to generically
handle creating and popping a stack of elements of a type.

No longer freeing pathlen field of ASN1 OBJECT in
wolfSSL_X509_EXTENSION_free(). This is happening in
wolfSSL_ASN1_OBJECT_free().
Stop wolfSSL_i2d_X509_NAME_canon from double freeing ASN.1 STRING's data
field.

Fixed up GetFormattedTime() to be better code.
Added ASN_CLASS_MASK to mask off the class part of an ASN.1 tag.
NO_ASN_TIME means no implementation to get the current time. Disable
features that won'r work without time.
2023-03-31 09:36:01 +10:00
6bed0c5757 Merge pull request #6123 from dgarske/math_info
Add introspection for math build and math cleanups
2023-03-31 09:15:48 +10:00
7fae945ee6 Merge pull request #6214 from miyazakh/altname_next_reset 2023-03-30 16:58:09 -06:00
22a5a5c45e Add introspection for math build and math cleanups:
* Add introspection for math build.
* Raise build error if more than one multi-precision math library used.
* Fix ESP32 to support using any multi-precision math option.
* Refactor math headers to use `wolfmath.h`
* Refactor of the opaque math variable type `MATH_INT_T` used by crypto hardware (QuickAssist, SE050, ESP32 and STM32).
* Cleanups for building with `WOLFCRYPT_ONLY` and `NO_BIG_INT`.
* Stop forcing use of fast math by default for platforms in settings.h. Note: For users that still want to use fast math (tfm.c) they will need to add USE_FAST_MATH to their build settings.

Applies To:
```
WOLFSSL_ESPWROOM32
WOLFSSL_ESPWROOM32SE
MICROCHIP_PIC32
WOLFSSL_PICOTCP_DEMO
WOLFSSL_UTASKER
WOLFSSL_NRF5x
FREERTOS_TCP
WOLFSSL_TIRTOS
EBSNET
FREESCALE_COMMON
FREESCALE_KSDK_BM
WOLFSSL_DEOS
MICRIUM
WOLFSSL_SGX
```
2023-03-30 14:42:55 -07:00
c7a76365f0 Fixes to support larger H5 save/restore and larger digest result (for SHA2-512). 2023-03-30 14:42:20 -07:00
d99514a41c Added benchmarks for STM32H563ZI. 2023-03-30 14:42:20 -07:00
0201662094 Support for STM32H5 2023-03-30 14:42:20 -07:00
f7d3ce7843 resolve warning about uninitialized variable 2023-03-30 11:44:08 -06:00
27794c4b7e Initial async test with gh action 2023-03-30 19:33:54 +02:00
de2f878781 Write next IV in wolfSSL_DES_ede3_cbc_encrypt 2023-03-30 18:47:53 +02:00
9120712438 Address code review 2023-03-30 15:35:52 +02:00
4338ed9b7b Add missing define 2023-03-30 14:56:31 +02:00
0210dcd98d Merge pull request #6240 from kaleb-himes/wolfEntropy-work
Fix a typo in PP macro and add a ceiling to guard against implementation bugs
2023-03-30 12:33:01 +10:00
9b1aed0c82 updated zephyr includes 2023-03-29 22:22:31 -04:00
a8ca958855 Merge pull request #6248 from JacobBarthelmeh/fips
visibility is dependent on macros that could be set in user_settings.h
2023-03-29 16:32:29 -07:00
5d1a914ebd Merge pull request #6247 from JacobBarthelmeh/config
check if colrm is available for options.h creation
2023-03-29 15:19:14 -07:00
951b5bc77c visibility is dependent on macros that could be set in user_settings.h 2023-03-29 16:14:54 -06:00
e1730c760c check if colrm is available for options.h creation 2023-03-29 14:11:56 -07:00
68d6ce647d Merge pull request #6227 from julek-wolfssl/hwsim-retry
Retry hwsim tests 3 times on fail
2023-03-29 12:34:19 -07:00
8b34ad7c4d Merge pull request #6245 from lealem47/asyncRelease
Fixes for the async release
2023-03-29 12:33:57 -07:00
8e730534d5 Free in drbg test when appropriate 2023-03-29 10:26:59 -06:00
3841b559ec Merge pull request #6246 from SparkiDev/siphash_asm_fix
siphash: fix assembly so that no register is left behind
2023-03-29 09:23:38 -07:00
047db19956 Disable SHA512/224 & SHA512/256 on QAT 2023-03-29 10:17:06 -06:00
65f97482f3 Missed free's in api.c 2023-03-29 10:16:29 -06:00
6a71c7d71a Merge pull request #6228 from SparkiDev/sp_math_dh_test_param
SP math: 2048-bit DH parameters
2023-03-29 08:25:54 -07:00
689b0f803a Merge pull request #6237 from SparkiDev/benchmark_base10
Benchmark: fix reporting of base10
2023-03-29 08:25:29 -07:00
4a75d78682 Add flags to disable certain checks 2023-03-29 14:22:31 +02:00
43ca374cad actions: Fix openwrt patch 2023-03-29 11:32:32 +02:00
ca11b4e560 siphash: fix assembly so that no register is left behind
Change all assembly so that no register is used explicitly - all
variables.
2023-03-29 09:38:04 +10:00
35111b29c1 Merge pull request #6244 from bandi13/consolidateVMdeps
Fix dependencies
2023-03-28 13:30:08 -07:00
6824166cf9 Add QAT flags to logic checking for dependencies 2023-03-28 12:44:22 -06:00
ba47562d18 Merge pull request #6238 from bandi13/fixRenewcerts.sh
Remove expectation for an argument to be passed
2023-03-28 11:24:51 -06:00
415d6151ff Use unique name in openwrt action 2023-03-28 18:10:01 +02:00
103f6e7520 Fix dependencies 2023-03-28 11:56:29 -04:00
f5b0c406c0 use unique artifact names 2023-03-28 17:17:18 +02:00
f1aa43dc48 Merge pull request #6230 from bandi13/zd15855
Fix for variable server startup time
2023-03-28 09:13:52 -06:00
ba2b7af84a Merge pull request #6241 from lealem47/strncmp
Fixes for sniffer with enable all
2023-03-28 09:13:11 -06:00
1766a69152 actions: Build wolfSSL in seperate job 2023-03-28 17:00:51 +02:00
0a2201700d Put the .rnd file in a local folder 2023-03-28 10:43:17 -04:00
1cf2d9ece3 Create files that the script depends on 2023-03-28 10:16:24 -04:00
610c45afb6 Don't need to store state anymore 2023-03-28 10:15:58 -04:00
60501236cf Add counter 2023-03-28 14:15:57 +02:00
e73ae077dc Retry hwsim tests 3 times on fail 2023-03-28 14:15:57 +02:00
7116f1e005 Add comment. 2023-03-28 14:14:40 +02:00
f0ad01f552 Send secure renegotiation extension by default
- Add test for terminating the connection
- Add ProcessReplyEx(ssl, 1) to wolfSSL_accept
2023-03-28 12:43:53 +02:00
69199a30f9 SP math: 2048-bit DH parameters
Add 2048-bit DH parameters for testing when SP math with SP.
2023-03-28 09:24:56 +10:00
591089664d Fixes for sniffer with enable all 2023-03-27 16:37:14 -06:00
59107aeaa8 Fix a typo in PP macro and add a ceiling to guard against implementation bugs 2023-03-27 16:02:34 -06:00
1f6071df33 PR suggestions 2023-03-27 13:59:01 -04:00
496a15037b Merge pull request #6166 from TakayukiMatsuo/tsip117 2023-03-27 11:49:18 -06:00
cadd2d9ab6 Remove expectation for an argument to be passed
Added in a failing return value to flush out tests/scripts that may be calling this script multiple times with various arguments
2023-03-27 13:30:12 -04:00
85e82746c3 Merge pull request #6210 from rizlik/realloc_on_espressif
wolfcrypt/settings.h: use default realloc on EspressIf
2023-03-27 09:28:42 -07:00
28fd14621a Add harden config to testing 2023-03-27 17:20:16 +02:00
c0b0c14a15 Allow user to choose between 112 and 128 bits of security 2023-03-27 15:42:19 +02:00
3b759580b2 Require 128 bits of security for public keys 2023-03-27 10:27:57 +02:00
5f2208e71d Benchmark: fix reporting of base10 2023-03-27 16:29:47 +10:00
979707380c Merge pull request #6232 from JacobBarthelmeh/release
prepare for release 5.6.0
2023-03-24 10:14:19 -07:00
40cbb32b23 Ciphersuite check
https://www.rfc-editor.org/rfc/rfc9325#section-4.1
2023-03-24 16:44:33 +01:00
e465089798 No old TLS check 2023-03-24 16:44:01 +01:00
94cf845c05 Truncated hmac check 2023-03-24 16:43:34 +01:00
7791b8ff4d Add config option 2023-03-24 16:42:56 +01:00
877e026da4 prepare for release 5.6.0 2023-03-23 21:44:18 -07:00
9f6388d272 Track SetDigest usage to avoid invalid free under error conditions. 2023-03-23 15:46:38 -04:00
d57d6d2b78 Fix for variable server startup time 2023-03-23 15:03:26 -04:00
e0e590f126 Merge pull request #6223 from lealem47/misc_fixes
Async build typos and miscellaneous fixes
2023-03-23 23:55:20 +07:00
aeffe6cfa7 Merge pull request #6222 from JacobBarthelmeh/alerts
don't try to send an alert to a disconnected peer
2023-03-23 09:49:15 -07:00
3ef7db8e1b Merge pull request #6229 from JacobBarthelmeh/Testing
fix for check on ecc public key size with FIPS and compressed keys
2023-03-23 08:25:31 -07:00
e9214e07cf Merge pull request #6219 from RSmatRA/RSmatRA/zeroing-input-buffer
Do not ForceZero the part of the buffer that has not been used.
2023-03-23 21:13:37 +07:00
a121a5c270 Merge pull request #6225 from SparkiDev/memzero_check_fixes_1
MemZero check fixes
2023-03-23 21:04:39 +07:00
25577ab96c fix for check on ecc public key size with FIPS and compressed keys 2023-03-23 06:58:03 -07:00
d1e4349661 MemZero check fixes
ForceZero the client and server secret regardless of whether TLS 1.3 as
it may change but have been copied in.
ForceZero the input buffer in wolfSSL_Clear() when encryption was on.

Changed wc_PRF_TLS to only check the parts of data used.
Changed where scatch is added for checking in wc_AesCtrEncrypt.
Change wc_MakeRsaKey to memset p, q, tmp1, tmp2 and tmp3 to all zeros so
that MemZero check works. Memset not needed otherwise.
Changes for new compiler - thinks uninitialized.
2023-03-23 12:27:38 +10:00
6ad786abe4 Merge pull request #6224 from SparkiDev/quic_aes_gcm_stream
AES-GCM streaming: EVP needs to set IV with wc_AesGcmInit
2023-03-23 08:25:31 +07:00
a31ca24bb0 Fix for async build with enable all 2023-03-22 17:30:38 -06:00
c83e899b78 Fix for overlong string warning 2023-03-22 17:29:53 -06:00
a5e7a20c93 Fix for logic gating strerror_r() 2023-03-22 17:29:13 -06:00
1fa75a5503 AES-GCM streaming: EVP needs to set IV with wc_AesGcmInit
Store IV if it is small enough to fit in aes->reg - was a copy of the
aes->reg in the first place.
2023-03-23 09:28:22 +10:00
df4081ea5a Merge pull request #6215 from JacobBarthelmeh/static_analysis
fixes for static analysis reports
2023-03-23 08:37:08 +10:00
7734588669 don't try to send an alert to a disconnected peer 2023-03-22 14:20:07 -07:00
835e8a18c7 Merge pull request #6216 from JacobBarthelmeh/fuzzing
adjust sanity check for index into URI
2023-03-22 12:52:04 -07:00
c11f5d0ee5 fixes for static analysis reports 2023-03-22 12:34:37 -07:00
7c122cda6d Merge pull request #6197 from JacobBarthelmeh/Testing
adjust location of Options typdef
2023-03-22 12:31:00 -07:00
edca6b9d03 adjust location of Options typedef 2023-03-22 09:27:26 -07:00
7e8d027a17 Merge pull request #6217 from douzzer/20230321-fixes
20230321-fixes
2023-03-22 10:23:07 -06:00
e618bb9686 Do not ForceZero the part of the buffer that has not been used. 2023-03-22 14:48:18 +01:00
49cd3ff872 wolfssl/internal.h: fixes for -Wpedantic "redefinition of typedef" around typedef ... TLSX and Options;
src/internal.c: fix for -Wdeclaration-after-statement and clang-diagnostic-unreachable-code-break;

tests/api.c: fix for -Wunused-variable and clang-analyzer-deadcode.DeadStores;

olfcrypt/src/pkcs12.c: fixes for cppcheck uselessAssignmentPtrArg and arrayIndexThenCheck, and clang-tidy clang-analyzer-deadcode.DeadStores and clang-analyzer-core.NonNullParamChecker;

wolfssl/src/tls.c: fix for clang-analyzer-deadcode.DeadStores;

wolfcrypt/src/tfm.c: fix for clang-diagnostic-newline-eof;

src/tls13.c: fix for clang-analyzer-core.NonNullParamChecker.
2023-03-21 22:52:56 -05:00
180a20d535 adjust sanity check for index into URI 2023-03-21 20:19:08 -07:00
147395476f Merge pull request #6213 from SparkiDev/regression_fixes_6
Regression testing fixes
2023-03-21 20:17:30 -06:00
51040b1f07 reset alt name list to head 2023-03-22 10:31:58 +09:00
9ec742b11f Regression testing fixes
HAVE_ECH only used by TLS 1.3 add protection around all code.
ssl->options.onlyPskDheKe only available when HAVE_SUPPORTED_CURVES.
CleanupClientTickets() defined when HAVE_SUPPORTED_CURVES.
TLSX_KeyShare_DeriveSecret only defined when HAVE_SUPPORTED_CURVES.
DecodeResponseData - initialize variable single.
New OpenSSL compatibility BN code requires mp_read_radix - turn on in
integer.c, sp_int.c when OPENSSL_EXTRA defined.
rsa.c:_CheckProbablePrime - make sure tmp1 and tmp2 are initialized
before error handling jumps to freeing them.

test_remove_hs_message uses 1024-bit DH key which is not supported when
using SP math with SP.
2023-03-22 08:57:20 +10:00
1eeb54e981 Merge pull request #6208 from JacobBarthelmeh/fuzzing
handle failing RNG init when creating PKEY
2023-03-22 08:55:38 +10:00
2af55903c5 Merge pull request #6187 from SparkiDev/tls13_server_id
Server ID - long id, TLS 1.3 - cache client session for tickets
2023-03-21 16:48:05 -06:00
265a6c824f Merge pull request #6164 from wolfSSL/gojimmypi-patch-zephyr-link
Update README link
2023-03-21 09:10:52 -06:00
17e20b8c36 Server ID - long id, TLS 1.3 - cache client session for tickets
Long server IDs were being truncated. Hash long IDs instead.
TLS 1.3 session ticket on client side no longer added session to client
cache. Explicit call added.
2023-03-21 15:29:07 +10:00
74f549a0b4 Merge pull request #6206 from SparkiDev/aesgcm_armv6_asm
AES ARMASM <ARMV7: fix load order
2023-03-20 21:21:01 -07:00
7d2a9136b6 Add support for TSIP v1.17 2023-03-21 11:28:07 +09:00
4eeb792a05 AES ARMASM <ARMV7: fix load order
Loading from memory based on register that is overwritten in ldrd.
When ldrd split out for older processors, register overwritten before
second load.
Switch order of loads in this case.
2023-03-21 10:53:47 +10:00
09dd9a0ca3 Merge pull request #6207 from rizlik/move_alerts_from_get_record_header
Move alerts from get record header
2023-03-21 08:20:22 +10:00
cc4f6221e1 RIOT-OS does support writev 2023-03-20 16:07:29 -05:00
5c7be2fa98 Merge pull request #6202 from philljj/zd15807
Fix out-of-bounds read in CRL parsing
2023-03-20 14:19:01 -06:00
e281ef9ea9 wolfcrypt/settings.h: use default realloc on EspressIf 2023-03-20 17:26:46 +00:00
72e53ca1a4 handle failing RNG init when creating PKEY 2023-03-20 07:17:25 -07:00
84d8245e58 internal: move SendAlerts outside of GetRecordHeader
This will give a chance to DTLS logic to ignore an error.
2023-03-20 10:50:00 +00:00
aabd665e73 SendAlert: propagate return error in non-fatal SendAlert 2023-03-20 10:50:00 +00:00
c3b51af6cd Merge pull request #6204 from JacobBarthelmeh/name
Fix for value of givenName and name
2023-03-20 10:59:47 +10:00
2fe473cf9f Fix out-of-bounds read in CRL parsing 2023-03-17 22:33:35 -05:00
327692b09f Merge pull request #6200 from kareem-wolfssl/zd15324_2
Fix IAR warnings.
2023-03-17 15:04:35 -06:00
9e331aa6d5 Merge pull request #6195 from embhorn/zd15836
Fix type conv error in logging
2023-03-17 14:46:54 -06:00
9c3cfab328 Merge pull request #6196 from bandi13/zd15783
OCSP_CERT_UNKNOWN
2023-03-17 14:33:57 -06:00
0e431c3eaa add given name test case 2023-03-17 13:07:15 -07:00
a917f380bb fix values for givenName and name 2023-03-17 12:56:27 -07:00
011385d4d4 Revert logging return code fixes, already fixed in another PR. 2023-03-17 12:39:04 -07:00
06d970c999 Merge pull request #6181 from kareem-wolfssl/zd15767
Fix not ignoring date errors when VERIFY_SKIP_DATE is set
2023-03-17 10:53:41 -06:00
042ceff08e Merge pull request #6160 from lealem47/indefPKCS12
Adding support for indefinite length PKCS12
2023-03-17 10:45:46 -06:00
5b08b016af Add client-absolute-urn.pem to renewcerts.sh 2023-03-16 16:14:08 -07:00
5126dc87e6 Fix IAR warnings. 2023-03-16 15:46:41 -07:00
459058a645 Merge pull request #6194 from JacobBarthelmeh/string
cast on input of XISALNUM
2023-03-17 08:39:21 +10:00
21c5ecc371 Merge pull request #6179 from tim-weller-wolfssl/zd14527-pemtoder-return-size
zd14527 - Update `PubKey` and `Key` PEM-to-DER APIs to support return of needed DER size
2023-03-17 08:37:51 +10:00
db166e5e5a Merge pull request #6198 from kaleb-himes/140-3-iOS-early-stage
Add a base-line user_settings.h for use with FIPS 140-3 in xCode example app
2023-03-16 15:20:15 -07:00
cc51b2d52e Add additional fix for absolute URN issue from PR #5964 and add test. 2023-03-16 14:56:44 -07:00
4c12c334cf Allow alternative absolute URI syntax in certificate general name. 2023-03-16 14:25:42 -07:00
28f39f6b3d Fix unit test failure when building OPENSSL_EXTRA without HAVE_EXT_CACHE. 2023-03-16 14:25:42 -07:00
2bb8eeae85 Fix not ignoring date errors when VERIFY_SKIP_DATE is set 2023-03-16 14:25:41 -07:00
e1d1f0790e Fixup uninitialized warnings detected by xCode 2023-03-16 15:18:00 -06:00
75149f71d2 Implement peer suggestions 2023-03-16 12:59:49 -06:00
8ec339d11c Merge pull request #6175 from tim-weller-wolfssl/zd15722-mem-leak
zd15722 - Prevent out-of-bound read in ASN parsing logic by erroring out.
2023-03-16 07:29:26 -06:00
5659bd6036 Prevent out-of-bound read in ASN parsing logic by erroring out. 2023-03-16 06:11:34 -05:00
7f6811a731 Merge pull request #6146 from kareem-wolfssl/zd15324
Fixes various warnings
2023-03-15 16:59:00 -06:00
fb6f2d1790 cast on input of XISALNUM 2023-03-15 15:43:28 -07:00
aaad3980a0 Various warning fixes. ESP32S3 include and build fixes. Added optional slot support for STSAFE shared secret using WOLFSSL_STSAFE_TAKES_SLOT. 2023-03-15 13:34:02 -07:00
ea06d064b0 Add a base-line user_settings.h for use with FIPS 140-3 in xCode example app 2023-03-15 14:08:32 -06:00
0486db8a2e Merge pull request #6188 from SparkiDev/aes_gcm_streaming_long_nonce
AES-GCM streaming: fix IV caching
2023-03-15 11:39:37 -06:00
8ba35a5f16 Merge pull request #6180 from julek-wolfssl/openvpn-test
Add libnl-genl-3-200 as dependency to openvpn test
2023-03-15 10:11:20 -06:00
69024d121f Revert change 2023-03-15 10:16:34 -04:00
682354628b Better return value 2023-03-15 09:58:39 -04:00
7c918255b9 Fix type conv error in logging 2023-03-15 07:46:22 -05:00
1967375ea5 Pass up the error 2023-03-14 18:11:00 -04:00
c6e7ea685e Add in CERT_UNKNOWN detection 2023-03-14 18:09:45 -04:00
3b5310d186 AES-GCM streaming: fix IV caching
AES-GCM stremaing was caching IV even when larger than buffer copying
into.
Instead, require calls to wc_AesGcmSetIV() or wc_AesGcmSetExtIV() to
cache IV.
wc_AesGcmInit() now uses passed in IV or retrieves from cache.
2023-03-15 07:52:06 +10:00
a268222167 Merge pull request #6169 from rizlik/wssl-alerts
Wssl alerts
2023-03-15 07:48:57 +10:00
0355187f51 Merge pull request #6184 from bandi13/fixCRLTest
Fix possible timing issue with other tests copying the certs folder
2023-03-14 09:29:03 -06:00
caad42291b Merge pull request #6193 from JacobBarthelmeh/tls13 2023-03-14 14:54:00 +01:00
94d983f94a tests: add WOLFSSL_EXTRA_ALERTS tests 2023-03-14 13:27:40 +00:00
c61d079905 Merge pull request #6186 from SparkiDev/asn_template_leading_zero
ASN template: compile option to allow leading zeros
2023-03-14 06:37:06 -06:00
52105a10c9 Add means to get size of DER buffer size needed for PEM-to-DER conversion to Key and PubKey APis 2023-03-14 06:33:12 -05:00
898fed9a8b tests: memio: allow NULL client and/or server ctx 2023-03-14 09:27:19 +00:00
4227f763a8 ssl: send alert on bad psk 2023-03-14 09:27:19 +00:00
7b53baea62 refactor: more centralized extra alerts
on handshake messages' errors:

- don't send alerts on WANT_READ, WANT_WRITE and WC_PENDING_E "errors"
- use return error code to decide which alert description
  to send
- use alert description handshake_failure in the general case
- if a fatal alert was already sent, do not send any new alerts. This allow
  a more specific alert description in case the exact description can't be
  derived from the return code
2023-03-14 09:27:18 +00:00
f666a7d4b7 internal.c: fix fall_through compilation issues
src/internal.c: In function 'SendCertificateVerify':
./wolfssl/wolfcrypt/types.h:345:40: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
  345 |                 #define FALL_THROUGH ; __attribute__ ((fallthrough))

In file included from ./wolfssl/internal.h:27,
                 from src/internal.c:92:
src/internal.c: In function 'SendCertificateVerify':
./wolfssl/wolfcrypt/types.h:345:40: error: attribute 'fallthrough' not preceding a case label or default label [-Werror]
  345 |                 #define FALL_THROUGH ; __attribute__ ((fallthrough))
2023-03-14 09:27:18 +00:00
1d0b04bfb3 ASN template: compile option to allow leading zeros
DER/BER encoding requires positive numbers to not have leading zeros.

Sometimes customer's have examples that break the rules.
In those cases define: WOLFSSL_ASN_INT_LEAD_0_ANY
Define used in original ASN.1 implementation.
2023-03-14 09:23:15 +10:00
19a1ec8c98 Merge pull request #6192 from kaleb-himes/aes-free-dox
Document use of wc_AesFree()
2023-03-13 16:03:13 -06:00
d7cd7bc256 adjust guards around PreSharedKey structure for non tls13 builds 2023-03-13 14:47:25 -07:00
9c1adbd83b Fix typo's in the code sample(s) 2023-03-13 14:56:46 -06:00
5bbdda6895 Document use of wc_AesFree() 2023-03-13 11:50:28 -06:00
e8828574ea Merge pull request #6190 from bandi13/ghActions
Let tests run to completion
2023-03-13 09:24:09 -06:00
694b527e67 Merge pull request #5910 from julek-wolfssl/dtls13-stateless
DTLS 1.3 stateless server ClientHello parsing
2023-03-13 09:22:58 -06:00
c56c4ef7ce Hacky workaround to be able to put/remove files in certs folder 2023-03-13 10:37:21 -04:00
f3e785b4c7 Let tests run to completion 2023-03-13 09:48:37 -04:00
bcd6bce040 Merge pull request #6183 from ejohnstown/rng-tweak
RNG Tweak
2023-03-10 15:16:54 -07:00
f2a955d5eb Merge pull request #6182 from julek-wolfssl/hostap-testing
Add initial testing for wpa_supplicant
2023-03-10 15:44:07 -05:00
1c9fa5c5ae Set some freed data to NULL 2023-03-10 13:40:25 -07:00
e2a1ab9e49 Fix possible timing issue with other tests copying the certs folder 2023-03-10 15:35:03 -05:00
907a29ab9e RNG Tweak
1. Remove a redundant test. The duplicate data test is not required and
   is checking for something that potentially can happen normally,
   albeit rarely.
2023-03-10 11:08:35 -08:00
a47cf08273 Add initial testing for wpa_supplicant 2023-03-10 17:12:56 +01:00
90f1c26211 Merge pull request #6162 from gojimmypi/Espressif_fix_6148
compiler appeasement initialization
2023-03-09 20:08:24 -08:00
9628eb0159 Add libnl-genl-3-200 as dependency to openvpn test
Looks like github actions removed libnl-genl-3-200 from the default image. Need to install manually.
2023-03-09 21:47:10 +01:00
4c7aa5c8dd Address code review 2023-03-09 19:00:25 +01:00
2a15363033 Merge pull request #6176 from bandi13/addWolfCLUDocker
Add in wolfCLU Dockerfile
2023-03-09 10:39:56 -07:00
4fe3cc60b0 Merge pull request #6177 from cconlon/asnTimeString
Fix GetAsnTimeString() to correctly increment internal data pointer
2023-03-09 09:36:59 -07:00
a640418832 Merge pull request #6170 from julek-wolfssl/openvpn-test
Add fsanitize testing for openvpn
2023-03-09 09:25:43 -07:00
30106d82ea replace fp_init_copy to appease some compilers 2023-03-08 20:37:19 -08:00
d03347d79c fix GetAsnTimeString() to correctly increment data_ptr, fixes PKCS#7 signedData signingTime attribute 2023-03-08 16:39:49 -07:00
ebf7fa585a First attempt 2023-03-08 15:27:16 -05:00
13867dab12 Fix leak and address more feedback 2023-03-08 13:14:16 -07:00
e04a01dc4c Add fsanitize testing for openvpn 2023-03-08 11:23:41 +01:00
6e58ca3bc4 Merge pull request #6171 from JacobBarthelmeh/Testing
build checks on mp_read_radix
2023-03-08 10:36:19 +10:00
07a1725635 remove redundent check on mp_read_radix available 2023-03-07 16:08:37 -07:00
842b22858b Merge pull request #6168 from anhu/WOLFSSL_RELAXED_ASN_PARSING
Relaxed parsing of explicit ECC public key
2023-03-08 08:20:04 +10:00
eb0bf7cd03 build checks on mp_read_radix 2023-03-07 13:55:10 -07:00
f1757b1bae WOLFSSL_NO_ASN_STRICT 2023-03-07 07:24:25 -05:00
335722c586 Async fixes 2023-03-07 12:04:54 +01:00
f5f67f43d7 Reset DTLS sequence number 2023-03-07 12:04:54 +01:00
a432502a98 Refactor sequence number reset for DTLS into one function 2023-03-07 12:04:54 +01:00
db1f199a11 Add comment about keyshare negotiation 2023-03-07 12:04:54 +01:00
cbedae2f55 This path in TLSX_KeyShare_Choose should not be taken normally 2023-03-07 12:04:54 +01:00
06749144d5 Add RFC link to help understand constraints 2023-03-07 12:04:54 +01:00
f2032e8744 Clear decrypted ticket that failed checks in DoClientTicket_ex 2023-03-07 12:04:54 +01:00
b0d7656ad2 Rebase fixes 2023-03-07 12:04:54 +01:00
885cca67fe Check for shared ctx in all configs 2023-03-07 12:04:54 +01:00
61c2059cd9 Differentiate between empty and missing extension 2023-03-07 12:04:54 +01:00
5f39c594aa TLS 1.3: hold decrypted ticket to check which ciphersuite matches
DTLS 1.3: Move stateless ticket decoding to FindPskSuiteFromExt
2023-03-07 12:04:54 +01:00
8c08dbb6ce Adding checks for SigAlgs, KeyShare, and Supported Groups 2023-03-07 12:04:54 +01:00
2bbdf6979a Reuse ReadVector16 2023-03-07 12:04:54 +01:00
de6ed96feb CopyExtensions -> CopySupportedGroup 2023-03-07 12:04:54 +01:00
5f65752414 Refactor alerts into one location
Remove previous stateless code. Now all DTLS 1.3 stateless handling is done in dtls.c
2023-03-07 12:04:54 +01:00
51a384eba5 Read cookie extension into separate field 2023-03-07 12:04:54 +01:00
5b0903a82d Missing casts 2023-03-07 12:04:54 +01:00
b5e7761e58 For DTLS 1.3 use PSK for ticket
Resumption info is also necessary when WOLFSSL_DTLS_NO_HVR_ON_RESUME is not defined.
2023-03-07 12:04:54 +01:00
0264df1546 Definition was defined out in some configs 2023-03-07 12:04:54 +01:00
969c610ef7 Fix unused variable 2023-03-07 12:04:54 +01:00
57dccc4cf4 Calculate cookie in SendStatelessReplyDtls13()
Not touching ssl->hsHashes while in stateless mode
2023-03-07 12:04:54 +01:00
c15043b191 Refactor SendStatelessReply 1.3 branch into new function 2023-03-07 12:04:54 +01:00
2f31cdef69 Re-create hs header for hash 2023-03-07 12:04:54 +01:00
aa9dcca624 Rebase and Jenkins fixes 2023-03-07 12:02:54 +01:00
a999909969 Use PSK callback to get the ciphersuite to use
- Allocate additional byte in TLSX_PreSharedKey_New for null terminator
2023-03-07 12:02:54 +01:00
6160f93f94 Fix Jenkins errors 2023-03-07 12:02:54 +01:00
7dfa96a729 Define usePSK when ext is present 2023-03-07 12:02:54 +01:00
984d709db0 dtls 1.3: Stateless ClientHello parsing 2023-03-07 12:02:54 +01:00
109063e427 Relaxed parsing of explicit ECC public key 2023-03-06 20:11:36 -05:00
9bc3b867e0 Merge pull request #6157 from miyazakh/add_favouriteDrinkNID 2023-03-06 16:45:14 -07:00
fa8b253657 Merge pull request #6167 from douzzer/20230306-fix-header-loop-test
20230306-fix-header-loop-test
2023-03-07 08:47:41 +10:00
3c107da2a9 wolfssl/openssl/bn.h: fix bugprone-macro-parentheses. 2023-03-06 15:23:14 -06:00
0a90b2d354 configure.ac: further fix for header loop check -- construct header list while in $srcdir, so that -I${srcdir} works as expected. see earlier commits 7baddb04f8 a7d9ea7550 b3a1ac80dc . 2023-03-06 15:21:23 -06:00
d9429185d8 Addressing some review feedback 2023-03-06 10:42:23 -07:00
86e1b0d8ab Merge pull request #6165 from SparkiDev/bn_move
BN compatibility API: move implementation out to separate API
2023-03-06 09:27:24 -08:00
9f66a58afd Merge pull request #6159 from philljj/zd15693
Fix ASN1_STRING leak in create_by_NID and create_by_txt
2023-03-06 09:25:37 -08:00
e4c2386b61 BN compatibility API: move implementation out to separate API
BN APIs from ssl.c have been moved out to ssl_bn.c that is included in
ssl.c.
Added defines for BN_rand() and BN_pseudo_rand() to indicate which bits
are to be set.
'internal' field now always maps to the ;mpi' field that is a MP
integer.
SetIndividualInternal/External renamed to wolfssl_bn_get/set_value.
Fixed BN APIs to work as closely to OpenSSL as possible.
Added tests.
Moved wolfssl_make_rng out to ssl.c as BN APIs are using it now.
SP int and TFM now check trials are in a valid range for
mp_prime_is_prime_ex().
2023-03-06 14:32:10 +10:00
9363b96947 Update README link
fix link that's currently 404
2023-03-05 15:26:48 -08:00
487d46fd28 Merge pull request #6161 from douzzer/20230303-fix-c89-etc
20230303-fix-c89-etc
2023-03-05 14:24:33 -08:00
b3a1ac80dc configure.ac: don't check for opensslextra circular header dependencies if ENABLED_LINUXKM (handcrafted linuxkm/Makefile and linuxkm/Kbuild set up paths to correctly find dependencies like linux/mutex.h). 2023-03-04 12:12:08 -06:00
05b0796361 add favourite drink pilot attibute type to get it from the encoding 2023-03-04 14:20:48 +09:00
ab71f6fd4c extend C89 build to whole codebase including examples:
configure.ac: remove implied --disable-examples when --disable-inline;

tests/api.c: always include wolfcrypt/src/misc.c;

wolfcrypt/src/misc.c: use WC_MISC_STATIC to designate staticness of the misc functions;

wolfssl/wolfcrypt/misc.h: define WC_MISC_STATIC to empty or static depending on #ifdef NO_INLINE or not (respectively);

wolfssl/wolfcrypt/types.h: #ifdef NO_INLINE, #define WC_INLINE WC_MAYBE_UNUSED, and move the definitions of WARN_UNUSED_RESULT and WC_MAYBE_UNUSED above the definition of WC_INLINE for clarity;

wolfssl/wolfcrypt/mem_track.h: always declare TrackMalloc() et al static (no functional change, because the state and callback bindings were and remain unconditionally static, but previously #ifdef NO_INLINE the functions were globals, leading to multiple definitions.
2023-03-03 22:30:08 -06:00
e76d12f932 src/ssl.c: fix a couple suppressions to use C comment syntax, for C89 goodness. 2023-03-03 22:01:52 -06:00
aecb37c032 linuxkm/module_hooks.c: wc_SetSeed_Cb(wc_GenerateSeed) in wolfssl_init() #ifdef WC_RNG_SEED, regardless of whether wolfcrypt_test() will be called. 2023-03-03 22:00:24 -06:00
a7d9ea7550 configure.ac: fix openssl header circular dependency detector to work on out-of-tree builds. 2023-03-03 21:56:42 -06:00
bb9c1bb253 Adding support for indefinite length PKCS12 2023-03-03 15:58:17 -07:00
35b68fb23d Merge pull request #5597 from Tathorack/add-renesas-rx64-rx72-sha-support
Add RX64/RX71 SHA hardware support
2023-03-03 13:14:32 -08:00
4d81a06557 Update comment format and other minor changes 2023-03-03 13:57:44 -06:00
d955ec8d54 Merge pull request #6156 from jpbland1/revert-zephyr-relocation
move the zephyr folder back to it's correct location
2023-03-03 11:19:35 -08:00
9a597a098b Merge pull request #6158 from miyazakh/initial_dec
fix init var in for-loop
2023-03-03 08:40:55 -08:00
51dbb44799 Fix ASN1_STRING leak in create_by_NID and create_by_txt 2023-03-03 08:22:35 -06:00
0693b66c44 fix init var in for-loop 2023-03-03 17:51:34 +09:00
b146830fe8 move the zephyr folder back to it's correct location 2023-03-02 23:40:12 -05:00
4ebc896231 Merge pull request #6095 from SparkiDev/aes_gcm_win_asm
Aes gcm win asm
2023-03-02 15:02:55 -08:00
a8723f71cb Merge pull request #6154 from kaleb-himes/wolfmikey-w-fips-140-3
Allow building of sakke as external non-FIPS algorithm with wolfmikey product
2023-03-03 08:18:40 +10:00
03948fd3ae Merge pull request #6140 from JacobBarthelmeh/seco
Fix AES-ECB with SECO
2023-03-02 13:43:15 -08:00
41a9b1148f Merge pull request #6152 from philljj/spelling_cleanup
Used codespell and fixed obvious typos in src and wolfssl.
2023-03-02 11:39:45 -08:00
871754b97c Merge pull request #6153 from bandi13/fixZD15705
Fix memory leak
2023-03-02 11:39:03 -08:00
7ca4b1bc66 Allow building of sakke as external non-FIPS algorithm with wolfmikey product 2023-03-02 11:30:56 -07:00
7baddb04f8 Check for circular dependencies in compatibility headers (#6091)
* Check for circular dependencies in compatibility headers

* Run header check only when ENABLED_OPENSSLEXTRA

* Add missing include

* Pedantic compilers don't like empty translation units

* Fix macro guards
2023-03-02 08:51:13 -08:00
406d8753be Fix memory leak 2023-03-02 11:15:32 -05:00
409ed6232a Used codespell and fixed obvious typos in src and wolfssl. 2023-03-02 09:52:07 -06:00
9a54cea78b Fix AES-ECB with SECO 2023-03-02 07:55:05 -07:00
3f7109c18b Merge pull request #6147 from dgarske/cpp17
Fixes for building with C++17
2023-03-02 07:46:35 -07:00
126805183c Merge pull request #6150 from douzzer/20230301-fix-async-and-mips-and-kcapi
20230301-fix-async-and-mips-and-kcapi
2023-03-02 13:10:26 +10:00
98c1b152a0 wolfssl/openssl/sha.h: fix undersized WOLFSSL_SHA384_CTX to have same size as WOLFSSL_SHA512_CTX (fixes failed assert in fips-140-3-dev-kcapi-opensslextra-build). 2023-03-01 17:55:02 -06:00
24a1c171ea wolfssl/wolfcrypt/settings.h: define WOLFSSL_SP_INT_DIGIT_ALIGN when target is MIPS, to fix a crash in sp_read_unsigned_bin(). 2023-03-01 17:52:46 -06:00
51339edf47 wolfcrypt/src/asn.c: fix WOLFSSL_ASYNC_CRYPT codepath in SignCert() -- fall through to non-async certSignCtx_lcl for algs without async support. 2023-03-01 17:51:25 -06:00
6a7674a146 wolfcrypt/test/test.c: improve strerror_r() flavor sensing (simpler gate randomly provoked cppcheck-all-async-quic). 2023-03-01 17:50:00 -06:00
63b049814b Merge pull request #6136 from SparkiDev/armv7_aes_no_reloc_text
ARMv7a AES asm: don't have relocatable text
2023-03-01 14:36:41 -08:00
5de15fedee Merge pull request #6132 from bandi13/moreContainerSupport
More container support
2023-03-01 13:57:04 -08:00
17ad27c350 Fixes for building with C++17. Adds new USE_CPLUSPLUS_BYTE build option to use std::byte as byte to avoid redefinition issues when customer application sets default namespace to "std" or wants to use "byte".
Tested using `./configure CC="g++ -std=c++17" --enable-all && make check`.
2023-03-01 12:49:47 -08:00
7d049aa90a Merge pull request #6141 from SparkiDev/cert_name_enc_fix
Cert name encoding fix
2023-02-28 17:36:22 -08:00
3aa1ef5907 ARMv7a AES asm: don't have relocatable text
For FIPS hash, don't have relocatable text in ARMv7's AES assembly code.
2023-03-01 11:32:00 +10:00
91d77393b9 Merge pull request #6110 from SparkiDev/sp_small_stack
SP: WOLFSSL_SP_SMALL_STACK
2023-02-28 17:17:58 -08:00
aa8d3df8dd Merge pull request #6137 from SparkiDev/rsa_enc_no_pad
RSA padding - no pad length check fix
2023-02-28 17:17:05 -08:00
d1b8386d36 Cert name encoding fix
Only include extra name entries once when encoding.
Fix certDefaultName to not have \0 on strings of extra names.
2023-03-01 10:01:54 +10:00
2a33f24dc9 RSA padding - no pad length check fix
Perform correct length check of input bytes based on bits in key in
wc_RsaPad_ex when no padding to be done.
2023-03-01 09:42:39 +10:00
cc8493668b SP: WOLFSSL_SP_SMALL_STACK
Defined when WOLFSSL_SMALL_STACK and !WOLFSSL_SP_NO_MALLOC or on
configuration line as an option to --enable-sp: smallstack.
2023-03-01 09:35:05 +10:00
47aad3fedb Merge pull request #6138 from dgarske/pkcs7_async
Fix for PKCS7 with asynchronous crypto enabled
2023-02-28 17:24:56 -06:00
2420d5d3b6 Merge pull request #6144 from kareem-wolfssl/zd15741Gh6142
Fix for PIC32 crypto HW and unused `TLSX_SetResponse`
2023-02-28 15:10:37 -08:00
be6fb0c26f Merge pull request #6145 from bandi13/x509_sign_test_fix
Fix `test_wolfSSL_X509_sign` expected size
2023-02-28 15:10:21 -08:00
aff4d4a7d3 The size of the packet could vary by up to 5 bytes 2023-02-28 17:04:40 -05:00
08a3e2cb6e Avoid building TLSX_SetResponse unless it is being used. Initialize PIC32 UPDPTR register in all cases. 2023-02-28 14:37:45 -07:00
58236632ca Fix for PKCS7 with asynchronous crypto enabled. The addition of the devId field will attempt to leverage crypto callbacks and async hardware, so convert WC_PENDING_E to blocking. 2023-02-28 13:22:39 -08:00
b133f6bbf7 20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 13:02:37 -08:00
41ce9afef4 Better dependency list
Need 32bit compilation support as well as ARM/AARCH64
2023-02-28 11:19:09 -05:00
7b96cd2220 Switch out gcc-multilib for more modern multiarch 2023-02-28 09:29:23 -05:00
397537e691 AES-GCM: MSVC use generated assembly instead of inline
AES-GCM for MSVC was using inline assembly.
Add MSVC version of AES-GCM assembly and use it instead.
Removed inline assembly.
2023-02-28 14:56:29 +10:00
79eaf10041 Merge pull request #6139 from bandi13/fixOpenVpn
Attempt to fix build error
2023-02-27 17:56:26 -08:00
c7b4bb1b27 Merge pull request #6128 from tim-weller-wolfssl/zd15454-benchmark-windows-update
Update wolfCrypt benchmark windows build files to support x64 Platform
2023-02-28 08:28:20 +10:00
2cbf5435c6 Attempt to fix build error 2023-02-27 17:07:13 -05:00
950e0d100a Merge pull request #6133 from philljj/zd15662
Fix malloc of zero size in fast_s_mp_sqr and fast_s_mp_mul_digs.
2023-02-27 10:47:29 -08:00
12ccd01127 Merge pull request #6131 from anhu/STM32_kyber
Changes that make kyber work on STM32
2023-02-27 08:14:02 -08:00
49ae7d4845 Make old compilers happy. 2023-02-24 17:13:47 -05:00
041d9c4510 Merge pull request #6130 from gojimmypi/Espressif_OpenSSL_interim
fix WOLFSSL_SHA_CTX for OpenSSL w/Espressif HW hash
2023-02-24 14:58:08 -07:00
f3f2f6ccb9 Merge pull request #6126 from tmael/rpm_fix
Fix RPM build
2023-02-24 13:35:52 -08:00
fd3d8c407d Update wolfCrypt benchmark Windows / Visual Studio build files to include x64 Configuration/Platform combinations (e.g. Debug-x64) and fixed compilation errors in benchmark.c related to conditional-compilation. 2023-02-24 11:53:01 -06:00
469226f214 Merge pull request #6107 from anhu/ecc_pub
Fixes for encoding/decoding ecc public keys.
2023-02-24 08:36:15 -08:00
22b1857bee Fix malloc of zero size in fast_s_mp_sqr and fast_s_mp_mul_digs. 2023-02-24 10:18:36 -06:00
392ddd1b4a Remove conflicts 2023-02-24 10:38:35 -05:00
b1f421d0a6 Improve the "adder" for compatibility layer SHA context when hardware acceleration is used. 2023-02-24 07:28:15 -08:00
aef44ff029 fix WOLFSSL_SHA_CTX for OpenSSL w/Espressif HW hash 2023-02-24 07:20:55 -08:00
d98dd53f55 Add one more utility 2023-02-24 09:48:15 -05:00
62748ba451 One more liboqs flag 2023-02-24 09:47:47 -05:00
559db5f314 Build liboqs for distribution
This makes it possible to use the library on same architecture but different processor type.
2023-02-24 09:47:47 -05:00
2b96f4bd16 Add in liboqs 2023-02-24 09:47:47 -05:00
87b7988643 Add cross compilers 2023-02-24 09:47:24 -05:00
1fcff5b30d Changes that make kyber work on STM32
(wolfcrypttest and benchmark)
2023-02-24 04:08:07 -05:00
b2a6203ec0 Merge pull request #6129 from SparkiDev/ed25519_doc_fix
Ed25519 doxygen update
2023-02-23 19:53:41 -08:00
695aa2e6a0 Ed25519 doxygen update
Fix return comments to match code.
2023-02-24 08:54:16 +10:00
c2daca1393 Fixes for encoding/decoding ecc public keys. 2023-02-23 13:56:48 -05:00
d85ee5c87f Merge pull request #6124 from embhorn/zd15573
Fix NID conflict NID_givenName and NID_md5WithRSAEncryption
2023-02-23 18:15:28 +00:00
69ceedbcff Merge pull request #5938 from JacobBarthelmeh/RT1170
Port to RT1170 and expand CAAM driver
2023-02-22 20:11:58 -08:00
ffa392cdb5 Merge pull request #6125 from embhorn/gh6007
Include sys/time.h for WOLFSSL_RIOT_OS
2023-02-22 16:06:10 -08:00
434e869b1d Merge pull request #6109 from nunojpg/master
Fix out of bound memset to 0
2023-02-22 15:43:09 -08:00
a8b8092ff8 Merge pull request #6122 from anhu/WOLFSSL_HAVE_KYBER
HAVE_KYBER --> WOLFSSL_HAVE_KYBER
2023-02-22 14:55:29 -08:00
121ee7a6df fix spelling, refactor openssl extra struct, remove magic number, use static mutex 2023-02-22 14:31:16 -08:00
2e7713f4c2 Merge pull request #6120 from embhorn/zd15698
Fix NULL dereference in TLSX_CSR_Parse
2023-02-22 13:43:43 -08:00
3d71d3c388 Include sys/time.h for WOLFSSL_RIOT_OS 2023-02-22 15:36:50 -06:00
b32036258d Fix NID conflict NID_givenName and NID_md5WithRSAEncryption 2023-02-22 15:02:52 -06:00
bd3ae97603 HAVE_KYBER --> WOLFSSL_HAVE_KYBER 2023-02-22 15:05:47 -05:00
b801a96f8c Port to RT1170 and expand CAAM driver 2023-02-22 08:26:25 -08:00
0a928208f2 Fix NULL dereference in TLSX_CSR_Parse 2023-02-22 08:19:11 -06:00
b81759173a Merge pull request #5840 from kareem-wolfssl/dynSessCache2
Add dynamic session cache which allocates sessions from the heap.
2023-02-22 15:14:38 +10:00
74bad76707 Merge pull request #6117 from SparkiDev/priv_key_id_fix
Private Key ID: change to always set priv key type and size
2023-02-21 19:23:51 -08:00
05365f6052 Merge pull request #6116 from dgarske/various2
Cleanup function logging
2023-02-22 12:27:26 +10:00
bfcc615e44 Fix rpm build 2023-02-21 15:02:10 -08:00
39cfd8e566 Private Key ID: change to always set priv key type and size
When a certificate is loaded then the private key type and size is set
based on the public key.
Always set, even if previously set.
Use case is setting an RSA certificate against ctx and then setting EC
certificate against ssl.
2023-02-22 08:07:27 +10:00
fa41754b83 RX64/RX71 SHA hardware support updates
Made the following updates based on review feedback
Fixed mixed variable declaration and simplified cases by typedefing
wolfssl_RX64_HW_Hash to wc_Sha, wc_Sha224, & wc_Sha256
Added files to include.am so they are built when using make
Add WOLFSSL_RENESAS_RX64_HASH to settings.h and set WOLFSSL_NO_HASH_RAW
in settings.h based on value of WOLFSSL_RENESAS_RX64_HASH
Add and handle return value for rx64_hw_Open
Fix some minor formatting and comments
2023-02-21 15:46:25 -06:00
e47633ad83 Add RX64/RX71 SHA hardware support
Adding support for SHA1, SHA224, and SHA256 hardware acceleration on
Renesas RX64 and RX71 microcontrollers.
This follows the a similar pattern as the Renesas TSIP support.

Speed comparison for hashing 64KB of data on a RX64M
| Hash Speed | SHA1 | SHA256 |
|:----------:|:----:|:------:|
| Hardware   | 4ms  | 4ms    |
| Software   | 11ms | 89ms   |

Update define for RX64/RX71 SHA hardware support

This will allow for different hardware acceleration modules to be
enabled individually.

Init & Close for the RX64/RX71 SHA subsystem for WolfCrypt

This ensures that the SHA subsystem is ready for use when WolfCrypt
needs access to it.

Shorten the max line length, clean up comments

This wraps code and comments at 80 characters and adds some  comments
2023-02-21 15:46:17 -06:00
fc6d693dae Update logging enter, exit, msg to match function names. Fix some typos and improper use of "enter". Fix internal uses of SSL_SUCCESS and SSL_FAILURE. Add WOLFSSL_DEBUG_NONBLOCK option to allow printing iterations without debug enabled. 2023-02-21 12:02:15 -08:00
da04e0fb4c Merge pull request #6115 from SKlimaRA/SKlimaRA/fix-decompress-dynamic
fixed heap corruption
2023-02-21 11:58:11 -07:00
a6114afb84 Merge pull request #6114 from dgarske/stm32_hash
Fix for STM32 hashing hardware
2023-02-21 18:37:03 +00:00
821120e31c Add SHA512/224 and SHA512/256 benchmarks (#6113) 2023-02-21 09:27:03 -08:00
208056b2da fixed heaap corruptions 2023-02-21 11:01:50 +01:00
e0abb0e306 Merge pull request #6097 from gojimmypi/New_SHA512_Tests
Add new SHA-512/224 and SHA-512/256 tests
2023-02-21 01:39:38 -06:00
6820fea5d3 Merge pull request #6111 from SparkiDev/sp_point_add_fix
SP: fix point_add_qz1
2023-02-20 17:05:21 -08:00
136267d29c Add new SHA-512/224 and SHA-512/256 tests 2023-02-20 16:55:38 -08:00
5ec62c8d48 Merge pull request #6096 from SparkiDev/armv7a_neon_config
ARMv7a neon configure.ac
2023-02-20 15:22:20 -08:00
39e72630ce Proper fix for STM32 hashing. FIFO is always 32 bytes. The original U5/H7 proper fix is to make sure the hash is "done" before saving state. 2023-02-20 15:14:44 -08:00
c055740e6a Merge pull request #6100 from julek-wolfssl/stunnel-github-action-test
Add OSP github action
2023-02-20 15:41:58 -05:00
261054896c Actions fix
Fix for `workflows must be defined at the top level of the .github/workflows/ directory` error.
2023-02-20 18:42:47 +01:00
8b7ea9e820 Refactor os-check.yml 2023-02-20 18:42:47 +01:00
04cc85b31e Separate out into different files 2023-02-20 18:29:41 +01:00
d3551acc2b Code review 2023-02-20 18:29:41 +01:00
36df1e1ae9 Add OSP github action 2023-02-20 18:29:41 +01:00
9a7cd7367a SP: fix point_add_qz1
Better detection of when add won't work and double needed.
Minor reorg of point operations.
2023-02-20 21:53:52 +10:00
4e6bad1225 Fix out of bound memset to 0
In case buf size sz is too small it will get updated to the larger required value
and can't be used anymore to clear the buffer.

As the buffer is untouched don't need to clear it anyway.

Signed-off-by: Nuno Gonçalves <nunojpg@gmail.com>
2023-02-18 10:40:21 +00:00
6cc5c1a428 Merge pull request #6102 from dgarske/non_const
Fix for "expression must have a constant value" in tls13.c
2023-02-17 21:07:27 -06:00
1bae1ef63e Merge pull request #6101 from kaleb-himes/invalid-pp-macro
Fix invalid PP macro logic, guard under same conditions as internal.h
2023-02-17 17:05:50 -08:00
588b694c7d Merge pull request #5709 from TakayukiMatsuo/ccv 2023-02-17 17:02:04 -07:00
8de2eba9ab Fix allocating new sessions using the dynamic session cache. 2023-02-17 15:25:12 -07:00
c476dd6e28 Merge pull request #6103 from SparkiDev/sp_ecdsa_sig_r0
SP ECC sign: reject random k when r is 0
2023-02-17 13:58:53 -08:00
8a6483f13a Merge pull request #6080 from tim-weller-wolfssl/zd15632-oob-in-cert-parsing
zd15632 - OSS-Fuzz #55810: Out-of-bounds read in certificate parsing
2023-02-17 12:08:11 -08:00
4edb7e26b9 Merge pull request #6104 from douzzer/20230216-readability-redundant-preprocessor
20230216-readability-redundant-preprocessor
2023-02-17 10:31:27 -08:00
24fd561bf8 Merge pull request #6099 from bandi13/ocsp-cleanup
Be more aggressive in killing processes
2023-02-17 09:28:14 -08:00
21645460cd src/tls13.c: fix a readability-redundant-preprocessor in CheckPreSharedKeys(). 2023-02-16 23:37:43 -06:00
26b7052b3f SP ECC sign: reject random k when r is 0
SP ECC signing code was generating signatures with r of 0.
This is not allowed by the algorithm description.
Retry sig gen when r is 0 like when s is 0.
2023-02-17 08:55:59 +10:00
d488693f15 Allow #define HAVE_LIBZ support in user_settings.h. 2023-02-16 14:20:57 -08:00
82d65481bb Fix for "expression must have a constant value" in tls13.c with GreenHills compiler. 2023-02-16 13:58:48 -08:00
b2caa5c5ae Fix invalid PP macro logic, guard under same conditions as internal.h 2023-02-16 14:40:43 -07:00
0b31d5577c Merge pull request #6098 from bandi13/moreDockerprograms
Some tests need these utilities
2023-02-16 13:28:02 -08:00
fdb0338473 Be more aggressive in killing processes 2023-02-16 09:55:52 -05:00
ff96150404 Some tests need these utilities 2023-02-16 09:51:46 -05:00
dea123f88e Minimal changes to avoid Out-of-Bounds write in ASN.1 parsing logic. Add unit tests for ParseCert() API passing badly formed ASN data (should error out gracefully). 2023-02-16 07:49:08 -06:00
0a6dedab03 Merge pull request #6094 from SparkiDev/aes_gcm_stream_bench
AES GCM benchmark: separate aes-gcm streaming runs
2023-02-15 21:10:48 -08:00
464c2d19dc Merge pull request #6006 from SparkiDev/tls13_only_psk_dhe_ke
TLS 1.3 PSK: add option to require only PSK with DHE
2023-02-15 21:10:27 -08:00
859b1ff398 Merge pull request #6093 from dgarske/fix_async
Fix issue with async and `WOLFSSL_CHECK_ALERT_ON_ERR`
2023-02-15 19:49:56 -06:00
aaed553311 Merge pull request #6092 from dgarske/various
Various cleanups (STM docs, include case, make dist small script)
2023-02-16 11:23:51 +10:00
1167ad623b Dynamic session cache: code review feedback 2023-02-15 17:38:14 -07:00
85314e6ba5 ARMv7a neon configure.ac
Support other CPUs that start with armv7a.
2023-02-16 10:36:38 +10:00
195ca1a20a AES GCM benchmark: separate aes-gcm streaming runs
Always to AES-GCM one-shot benchmark.
When WOLFSSL_AESGCM_STREAM, always perform AES-GCM streaming benchmark.
2023-02-16 09:37:00 +10:00
b624fc8377 TLS 1.3 PSK: add option to require only PSK with DHE
Can specify only PSK without DHE.
Add only PSK with DHE.
2023-02-16 09:21:29 +10:00
18bee3142d Fix to use the right cert/key in the API unit test if overridden. 2023-02-15 14:57:43 -08:00
e8a26c673a Fix for async with WOLFSSL_CHECK_ALERT_ON_ERR. 2023-02-15 14:57:34 -08:00
47801107da Fix to make sure API unit test always calls init/cleanup when not running all tests. 2023-02-15 14:24:22 -08:00
5481a059c4 Fix wincrypt.h include header case when used with case sensitive file system. 2023-02-15 11:44:34 -08:00
6ea3fe2f7a Merge pull request #6089 from kaleb-himes/stunnel-5_67_support_fix
Fix unused variable warning when configuring with --enable-apachehttpd
2023-02-15 08:39:30 -08:00
089ef86587 Merge pull request #6090 from douzzer/20230214-mollify-iso-c-pedantic
20230214-mollify-iso-c-pedantic
2023-02-15 17:04:07 +10:00
ca87a99646 src/ssl.c and src/x509.c: use the customary function pointers (WOLFSSL_CRYPTO_EX_*()), not void *, in the arg lists of wolfSSL_CTX_get_ex_new_index() and wolfSSL_X509_get_ex_new_index(), to avoid "ISO C forbids passing argument ... between function pointer and ‘void *’";
move typedefs for WOLFSSL_CRYPTO_EX_*() from wolfssl/openssl/compat_types.h to wolfssl/wolfcrypt/types.h, grouped with the other EX_DATA-related typedefs, as they are needed whenever defined(HAVE_EX_DATA) regardless of openssl compatness;

properly gate wolfSSL_CTX_get_ex_new_index() and wolfSSL_X509_get_ex_new_index() prototypes on defined(HAVE_EX_DATA).
2023-02-14 19:28:40 -06:00
7e582932f3 Improve documentation for STM32 PKA support. 2023-02-14 14:27:05 -08:00
100ec1e7e6 Fix ./scripts/makedistsmall.sh for Docker and RTOS. 2023-02-14 14:25:40 -08:00
dead56b3cb Merge pull request #6086 from julek-wolfssl/explicit-rwlock
Make rwlock an explicit enable option
2023-02-14 15:04:13 -07:00
2719943ffd Fix unused variable warning when configuring with --enable-apachehttpd 2023-02-14 14:25:57 -07:00
0cedc4e1ac stunnel 5.67 support (#6020)
* stunnel 5.67 support

- ssl->session->ticketAdd may be set when parsing a ticket before PSK
- PSK binders should be calculated based on ciphersuite associated with PSK
- Add option to prioritise PSK order instead of ciphersuite order
- Update ctx->method->version when using Set_CTX_max_proto_version API
- Simplify wolfSSL_parse_cipher_list
  - Keep copy of old list and then add in the previous ciphersuites depending on whether we are doing only TLS 1.3 ciphersuites or not
- Specify CRL revocation in alert
  - Match reason string to match OpenSSL
- Add support for external data callbacks for WOLFSSL_SESSION

* Upref the session for stunnel instead of duplicating it

* Add small stack option for wolfSSL_parse_cipher_list
2023-02-14 09:38:28 -08:00
c4fa013800 Fix for BIO_reset() (#5887)
* Fix for BIO_reset
* Introduced BIO_FLAGS_MEM_RDONLY
2023-02-14 08:54:25 -08:00
bcfd5fb66b Make rwlock an explicit enable option 2023-02-14 13:55:59 +01:00
2fe34facba Merge pull request #6084 from philljj/zd15607
Check keyLen matches cipher in wolfSSL_CMAC_Init.
2023-02-14 12:51:20 +10:00
6e21b8c907 Merge pull request #6085 from anhu/env_shell
Invoke shell for shell scripts.
2023-02-13 14:53:47 -08:00
ed79545a27 Espressif examples run with local wolfSSL (no setup!) (#6018)
* Espressif examples run with local wolfSSL (no setup!)
* include.am Espressif local no-setup component files
* cleanup Espressif Example CMakeLists.txt, use function
* multiple wolfSSL installs is now a fatal Espressif build error
* Examples no longer need setup
* CompileAll builds local examples, not IDF_PATH ones
* Espressif compileAllExamples both local & ESP-IDF components
* add wolfssl_test_idf test project
* move VisualGDB projects to subdirectories
* move VisualGDB wolfssl_server to subdirectory
* update include.am for moved VisualGDB project files
2023-02-13 14:37:56 -08:00
6877c98d82 Merge pull request #6081 from douzzer/20230211-wolfcrypttest-fixes
20230211-wolfcrypttest-fixes
2023-02-13 14:28:43 -08:00
eedc8fa0b3 Invoke shell for shell scripts. 2023-02-13 15:58:15 -05:00
a945017a88 wolfcrypt/test/test.c: around ecc_ctx_kdf_salt_test(): fix fips gating, fix length handling for "message", fix memory leaks;
in crypto_ecc_verify(), crypto_ecc_sign(), ecc_test_nonblock_dhe(), and ecc_test_nonblock_ecdsa(), add codepoint-specific retvals.
2023-02-13 14:21:50 -06:00
405b98aaa4 Merge pull request #6078 from SparkiDev/rsapss_openssl_compat
X509 RSA PSS: fixes for OpenSSL compat layer
2023-02-13 08:43:10 -08:00
295da3232a Merge pull request #6082 from SparkiDev/asn_dsa_mp_int_leak
ASN template, DSA: Clear the mp_int before re-reading data
2023-02-12 22:28:11 -06:00
0a8753d2b2 ASN template, DSA: Clear the mp_int before re-reading data
Make sure the mp_int is cleared so that any exisiting bigint is freed.
Tidy up api.c code.
2023-02-13 11:08:18 +10:00
909aa86d2d Check keyLen matches cipher in wolfSSL_CMAC_Init.
Fixes ZD15607.
2023-02-12 18:26:40 -06:00
5a77db3f20 Add dynamic session cache which allocates sessions from the heap. 2023-02-10 14:18:03 -07:00
55a7e24cfe Support pthread_rwlock (#5952)
* Support rwlock

* Fix typo, ENABLE_SESSION_CACHE_ROW_LOCK with TITAN_SESSION_CACHE

* Implement read lock

- Use read lock for the SessionCache
- Don't copy the

* TLS 1.3: Don't push ticket to cache if we don't retrieve from it

* Detect rwlock support with PTHREAD_RWLOCK_INITIALIZER

* Implement explicit rwlocks

- Mutex's still necessary for signals. Implement explicit rwlocks and we can migrate critical mutexs to rwlocks when necessary.

* Remove WOLFSSL_USE_RWLOCK guard around mutex condLock

* condLock not necessary after all

* Use configure.ac to check for pthread_rwlock_destroy support

* Can't include config.h in wc_port.h as that breaks make distcheck

* Check for pthread_rwlock_t to determine if rwlock is available

* Code review

---------

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2023-02-10 10:42:38 -08:00
338d8db274 Ecc ctx state fix (#6077)
* set the client state correctly when wc_ecc_ctx_set_kdf_salt is called
* add test that covers wc_ecc_ctx_set_kdf_salt
* use shared key and smallstack to reduce test stack usage
2023-02-10 10:05:52 -08:00
5b8fda1ac6 Fix overflow in fp_to_unsigned_bin_len length check. (#6075)
* Fix overflow in fp_to_unsigned_bin_len length check.
* Add a second check when i == a->used - 1.
2023-02-10 08:46:37 -08:00
0c771a93dc Improve TLS1.2 client authentication to use TSIP 2023-02-10 16:16:25 +09:00
c2384674d8 Merge pull request #6079 from SparkiDev/aes-ecb-len-aesni
AES ECB/CTR/XTS: enable AES-NI usage
2023-02-09 21:17:50 -06:00
b359dd27e4 AES ECB/CTR/XTS: enable AES-NI usage
Perform multiple blocks of encryption/decryption in assembly call with
ECB.
This improves performance of ECB, CTR and XTS on Intel x64.
2023-02-10 11:14:06 +10:00
9750fc4485 X509 RSA PSS: fixes for OpenSSL compat layer
Add NIDs for RSA-PSS to OpenSSL compat layer.
Have wc_RsaPublicKeyDecode call wc_RsaPublicKeyDecode_ex where logic for
RSA-PSS handling is already done.
2023-02-10 10:25:49 +10:00
d336e22b85 Allow reading ENC EC PRIVATE KEY as well via wolfSSL_PEM_read_bio_ECPrivateKey (#6055)
* fix qt qsslkey unit test
2023-02-09 14:48:52 -08:00
7a6f7ff6b7 Merge pull request #6076 from dgarske/fix_async
Fix for possible uses of NULL with heap hint in pk.c
2023-02-10 08:26:44 +10:00
8929b31b84 Fix for possible uses of NULL in heap hint. The api.c has expected "bad" test cases where the key is passed in as NULL and the XFREE tries to use it. Tested with: ./configure --enable-asynccrypt --with-intelqa=../QAT1.8 --enable-all && make && sudo ./tests/unit.test 2023-02-09 10:18:37 -08:00
05f8abd524 Merge pull request #6064 from embhorn/gh6063
Add WOLFSSL_IP_ALT_NAME to --enable-curl; fix unused error in FindPsk
2023-02-09 08:38:38 -08:00
644d92f28c Merge pull request #6074 from douzzer/20230208-fixes
20230208-fixes
2023-02-09 16:18:35 +10:00
9dd23fca25 wolfcrypt/src/pwdbased.c: refactor copy in scryptSalsa() as a memcpy(), for efficiency and to work around a bug in clang-17; also fix scratch buffer x in scryptBlockMix() to have correct alignment. 2023-02-08 21:31:56 -06:00
63fdc4e843 src/ssl.c: fix PK object on stack in wolfSSL_i2d_PublicKey(). 2023-02-08 21:30:50 -06:00
ef0eda4091 cleaner fix for bugprone-signed-char-misuse first addressed in 38c057a084. 2023-02-08 21:28:34 -06:00
49a500c2af Merge pull request #6070 from bandi13/coverityFixes
Coverity fixes
2023-02-09 10:21:12 +10:00
008d2962d7 Merge pull request #6072 from bandi13/dsaNoInit
Fix for calling 'mp_clear(tmp)' without having called 'mp_init(tmp)'
2023-02-09 10:18:51 +10:00
e9aeb1a857 Add nuttx integration (#6043) 2023-02-08 16:04:53 -08:00
619a587a7b Merge pull request #6071 from bandi13/extraPackagesForDocker
Add in a few more utilities that we need
2023-02-08 14:53:20 -08:00
7f9b764eb5 Merge pull request #6054 from anhu/d2i_publickey_fix
Ensure that i2d APIs for public keys gives appropriate data.
2023-02-08 14:44:29 -08:00
1da392c297 Merge pull request #6069 from philljj/spelling_cleanup
Spelling cleanup: configure.ac, ssl.c, ssl.h
2023-02-08 14:40:03 -08:00
7a30617b26 Merge pull request #6073 from dgarske/shake_bench
Fix for benchmarking shake with custom block size
2023-02-09 08:06:24 +10:00
767c282c1d Addressing PR comments 2023-02-08 16:35:03 -05:00
6a24cdaa42 Merge pull request #6067 from SparkiDev/sp_int_fixup_5
SP int: tidy up ifdef
2023-02-08 13:50:50 -06:00
cefd55eb74 Fix for benchmarking shake with custom block size. Using ./benchmark -shake 1024 caused seg fault. 2023-02-08 11:25:53 -08:00
08c63d55dc Addressing PR comments 2023-02-08 13:18:13 -05:00
38f2f43705 Fix for calling 'mp_clear(tmp)' without having called 'mp_init(tmp)' 2023-02-08 13:08:12 -05:00
06d6f2d4b6 One more app for debugging 2023-02-08 11:25:11 -05:00
94c01d9f4e Add in a few more utilities that we need 2023-02-08 10:52:00 -05:00
7a6ed68f2d Ensure that i2d APIs for public keys gives appropriate data. 2023-02-08 09:54:28 -05:00
cc791a7a53 Spelling cleanup: configure.ac, ssl.c, ssl.h 2023-02-07 21:45:06 -06:00
3e82abd002 SP int: tidy up ifdef 2023-02-08 10:45:00 +10:00
62cfd8725a Disable latest OpenWrt test 2023-02-07 18:17:39 -05:00
1912aaf91b EC OpenSSL compat: validate point after setting
wolfSSL_EC_POINT_set_affine_coordinates_GFp wasn't checking the point is
valid for the curve. Added call to check point when setting.
Made check available for opensslextra.
Fixed test to have valid ordinates to set.
2023-02-07 18:17:39 -05:00
3e445b5ba0 SP int: sp_invmod_mont_ct check err before setting
Two places in sp_invmod_mont_ct were not checking err is set before
performing a new operation and setting err. Change to check error before
performing operation.
2023-02-07 18:17:39 -05:00
ee12a5f0c6 Merge pull request #6048 from SparkiDev/asn1_template_def
ASN: make template default for configure
2023-02-07 14:15:57 -08:00
299bee96d2 Merge pull request #6060 from SparkiDev/sp_int_fixes_4
SP int: fix sp_div_2 to use signed integer
2023-02-07 14:13:02 -08:00
9f5ffe6bd7 Merge pull request #6066 from SparkiDev/int_fast_mont_red_oob
integer.c: fast mod reduce fix
2023-02-07 14:12:13 -08:00
2539ba3f3d Add WOLFSSL_IP_ALT_NAME to --enable-curl; fix unused error in FindPsk 2023-02-07 15:51:09 -06:00
3ae8bac3b2 Merge pull request #6065 from SparkiDev/ec_point_cmp_jacobian
wolfSSL_EC_POINT_cmp: handle Jacobian ordinates
2023-02-07 10:04:37 -08:00
20ae076b80 integer.c: fast mod reduce fix
When using small stack, not enough memory uas being allocated in
fast_mp_montgomery_reduce().
Allocate the required space and memset all used memory.
2023-02-07 11:29:53 +10:00
92065b61b3 wolfSSL_EC_POINT_cmp: handle Jacobian ordinates
API support doesn't allow for a point to be in Jacobian ordinates.
wolfSSL_EC_POINT_add() has ordinates in Montgomery form.
When needed, compile with WOLFSSL_EC_POINT_CMP_JACOBIAN.
2023-02-07 11:02:50 +10:00
ca0731616f SP int: fix sp_div_2 to use signed integer
sp_div_2 no longer handled a->used of 0 and 1.
Rework to have have internal APIs that don't return errors and use them
where no error is expected.
2023-02-07 08:51:15 +10:00
bd155389e2 ASN: make template default for configure
When loading DH private key, create the public key if not found.
Failures fixed.
2023-02-07 08:49:46 +10:00
2448adf68b Merge pull request #6051 from philljj/zd15531
Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
2023-02-06 12:46:21 -08:00
cc037447dd Merge pull request #6062 from bandi13/disableOpenWrtSnapshot
Disable latest OpenWrt test
2023-02-06 08:06:31 -08:00
dc08ecf287 Disable latest OpenWrt test 2023-02-06 11:03:41 -05:00
8a212ec351 Merge pull request #6042 from SparkiDev/ec_point_set
EC OpenSSL compat: validate point after setting
2023-02-06 07:14:19 -08:00
c9fefe660f EC OpenSSL compat: validate point after setting
wolfSSL_EC_POINT_set_affine_coordinates_GFp wasn't checking the point is
valid for the curve. Added call to check point when setting.
Made check available for opensslextra.
Fixed test to have valid ordinates to set.
2023-02-06 12:22:17 +10:00
a8c2a9aeab Merge pull request #6040 from SparkiDev/sp_invmod_mont_ct_err
SP int: sp_invmod_mont_ct check err before setting
2023-02-05 14:17:51 -08:00
3cdda2adf0 Merge pull request #6056 from ejohnstown/ssh-kdf-inlines
Build Fixes
2023-02-04 10:37:16 -08:00
a4ffe085a0 Merge pull request #6052 from rizlik/fix_ret_create
fix: propagate WOLFSSL_TICKET_RET_CREATE from DoDecryptTicket()
2023-02-03 17:32:26 -08:00
8e57ff08ab Build Fixes
./configure --enable-wolfssh --enable-cryptonly \
        --disable-asn --disable-rsa --disable-ecc
./configure --disable-asn --disable-rsa --disable-ecc --enable-psk
./configure --enable-cryptonly --disable-asn --disable-rsa --disable-ecc

1. Fails compiling the KDF file, can't find c32toa inline function.
2. In configure, move the check for ECC when ASN is disabled up to the
   other ASN checks. It also needs to be checked with cryptonly is
   disabled.
2023-02-03 16:09:27 -08:00
a9ffbae7af test: add test to check new ticket is created when resuming 2023-02-03 22:16:06 +00:00
646b363e49 Merge pull request #6053 from JacobBarthelmeh/freebsd
fix DTLS test case for when able to read peers close notify alert
2023-02-03 14:10:33 -08:00
c6018b837d Merge pull request #6050 from JacobBarthelmeh/time
fix warning if ltime is unsigned
2023-02-03 11:06:17 -08:00
f55f9bfd36 fix DTLS test case for when able to read peers close notify alert 2023-02-03 11:05:56 -08:00
29c884eafd Merge pull request #6045 from JacobBarthelmeh/PKCS7
add sequence around algo parameters with authenvelop
2023-02-03 10:29:19 -08:00
1027c0667a Merge pull request #6049 from SparkiDev/sp_int_used_size
SP int: make used and size fields unsigned
2023-02-03 09:38:40 -08:00
a2bf82397a fix: propagate WOLFSSL_TICKET_RET_CREATE from DoDecryptTicket() 2023-02-03 17:33:24 +00:00
f61dce8746 Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
Added mp_setneg for ZD#15531.
2023-02-03 08:51:46 -06:00
d184a17644 fix warning if ltime is unsigned 2023-02-03 07:43:08 -07:00
3455e726f9 SP int: make used and size fields unsigned
used and size have no reason to be negative - change type.
Change code to match unsigned change. Mostly change variables to be
unsigned where possible.
integer.c: Only have mp_rand_prime available when needed and
mp_prime_is_prime_ex is available.
Fixes from regression testing.
2023-02-03 17:09:56 +10:00
ef266d7e0b Merge pull request #6047 from SparkiDev/refinc_ret_check
Ref counting: rework for static analysers
2023-02-02 18:46:34 -08:00
8ecf6f3381 Merge pull request #6046 from ejohnstown/srtp-marshal
SRTP Marshaling
2023-02-02 18:03:31 -08:00
f6da3a26ac Ref counting: rework for static analysers
When always reference counting APIs always return 0 don't check return
value for error.
Reference decrement set isZero to false on error.
2023-02-03 10:13:32 +10:00
ca999f932c SRTP Marshaling
1. Changed the loop over the SRTP setting bitfield when it is encoded
   for the TLS extension.
2023-02-02 14:51:12 -08:00
9e9315f480 add sequence around algo parameters with authenvelop 2023-02-02 10:54:38 -08:00
a4f55b01d6 Merge pull request #6041 from JacobBarthelmeh/seco
Fix to mask the argument for enc/dec flag used with GCM/CCM in CAAM+SECO build
2023-02-02 08:32:48 -08:00
447991a9c2 Merge pull request #5949 from JacobBarthelmeh/Testing
add pragram around sanity check for vcpkg build warning
2023-02-02 10:34:14 +10:00
55d43a46b8 SP int: sp_invmod_mont_ct check err before setting
Two places in sp_invmod_mont_ct were not checking err is set before
performing a new operation and setting err. Change to check error before
performing operation.
2023-02-02 08:45:45 +10:00
d76195c52a add fix GCM use with CAAM SECO 2023-02-01 14:42:39 -08:00
087e2dc22a Merge pull request #6037 from douzzer/20230131-fixes-evp-af-alg
20230131-fixes-evp-af-alg
2023-02-01 07:09:02 -08:00
a8a61fe6b7 evp.c: fix gating in wolfSSL_EVP_CIPHER_CTX_cleanup() to avoid switch-unreachable; also fix indentation. 2023-02-01 01:29:36 -06:00
38c057a084 fix resource leak (missing calls to wc_AesFree()) in wolfSSL_EVP_CIPHER_CTX_cleanup();
fix file descriptor leaks in AF_ALG code, and fix return codes (WC_AFALG_SOCK_E, not -1) in afalg_aes.c;

fixes for sanitizer-detected forbidden null pointer args in AfalgHashUpdate() and AfalgHashCopy();

fixes for resource leaks in api.c test_wolfSSL_AES_cbc_encrypt() (missing wc_AesFree()s);

fixes for resource leaks in test.c openssl_test() (missing wolfSSL_EVP_CIPHER_CTX_cleanup());

also some local fixes for bugprone-signed-char-misuse, readability-redundant-preprocessor, and clang-diagnostic-strict-prototypes, in src/pk.c and src/ssl.c.
2023-02-01 00:49:34 -06:00
462f76c1ff Merge pull request #6033 from dgarske/stm32_fixes
Fixes and cleanups for STM32
2023-01-31 12:13:13 -05:00
9defb9a356 Merge pull request #6035 from gojimmypi/PK_SSL_init_vars
Initialize `OPENSSL_ALL` local size / length / type vars
2023-01-31 09:09:18 -08:00
9b6e787071 Merge pull request #6034 from gojimmypi/Espressif_fix_6024
ESP32 SHA384 fixes
2023-01-31 09:08:54 -08:00
934d8e274f Merge pull request #5926 from SparkiDev/openssl_ec_api_rework
EC OpenSSL compat: rework EC API
2023-01-31 09:08:26 -08:00
b10adae48f Initialize OPENSSL_ALL local size / length / type vars 2023-01-30 17:30:56 -08:00
53d6e79f89 ESP32 SHA384 fixes 2023-01-30 16:58:57 -08:00
2d03a052e1 Fixes and cleanups for STM32:
* Fix for STM32 Hash peripherals (like on F437) with FIFO depth = 1.
* Cleanups for `XREALLOC` and new `WOLFSSL_NO_REALLOC` to force undef of `XREALLOC`.
* Change STM32 Cube to default to `NO_TLS_UART_TEST`.
2023-01-30 16:44:47 -08:00
7691cd4b45 EC OpenSSL compat: rework EC API
Reworked the implementations of the EC APIs including:
wolfSSL_EC_curve, wolfSSL_EC_METHOD, wolfSSL_EC_GROUP,
wolfSSL_EC_POINT, wolfSSL_EC_KEY, wolfSSL_ECDSA_SIG, wolfSSL_ECDSA and
wolfSSL_ECDH.

Added support for EC parameters to PEM decoding.

EccEnumToNID() moved out of wolfCrypt - it maps NIDs defined in
wolfssl/openssl/ec.h to those in wolfssl/wolfcrypt/ecc.h.
Moved wc_OBJ_sn2nid() out of wolfCrypt - implementation uses
EccEnumToNID().

Changed reference counding to use wolfSSL_Ref.

Added tests to api.c that increase coverage of EC APIs.
2023-01-31 10:19:57 +10:00
08538b69f3 Merge pull request #6016 from SparkiDev/sp_dh_agree_uinit
DH and SP: sp_DhExp_* called with uninitialized outLen
2023-01-30 15:56:46 -08:00
66532ed052 Merge pull request #6032 from anhu/braces
Closing and opening scope around case statement.
2023-01-30 15:08:02 -08:00
daa82e4653 Merge pull request #6030 from SparkiDev/sp_ecc_p256_arm64
SP Aarch64 ECC P256: mont reduce fix
2023-01-30 15:07:29 -08:00
7cdf5c7956 SP Aarch64 ECC P256: mont reduce fix
For Montgomery Reduction of P256: Don't set x10 and x11 to words of mu
<< 32. x11 is needed later and there are plenty of registers.
2023-01-30 11:14:12 -08:00
420f2f45c1 Merge pull request #6019 from SparkiDev/sp_arm64_cc
SP Aarch64: conditional changed in asm needs "cc"
2023-01-30 11:06:53 -08:00
242dcb0141 Closing and opening scope around case statement.
Related: ZD 15451
2023-01-30 13:45:03 -05:00
414c72adbc Fix workflow concurrency (#6031)
* First test of the consolidated workflows
Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-30 10:10:54 -08:00
d72ea6101f Merge pull request #6027 from SparkiDev/sp_int_div_small
SP int: div small static code analysis change
2023-01-30 10:34:05 -05:00
0e16d2919f Merge pull request #6022 from douzzer/20230127-fixes
20230127-fixes
2023-01-30 08:46:42 +10:00
08afe6a404 SP int: div small static code analysis change
_sp_div_small: Make it explicit as possible that we only want the bottom
digit of the product subtracted from the bottom word of t. Top digit is
unnecessary and more cycles used if calculated.
2023-01-30 08:40:45 +10:00
6e9d956a49 Merge pull request #6021 from kareem-wolfssl/zd15544
Fix for building with ASN template and `NO_ASN_TIME`
2023-01-27 18:19:19 -08:00
ef8afa98a4 Merge pull request #6017 from cconlon/se050_tls_fixes
Fix SE050 RSA public key loading and RSA/ECC SE050 TLS Compatibility
2023-01-27 15:29:21 -08:00
c70ca25282 Fix building NO_ASN_TIME with cert gen and OpenSSL Extra enabled. 2023-01-27 16:09:04 -07:00
d077c39f42 wolfcrypt/test/test.c: in aes_xts_128_test(), gate in-place test on !HAVE_FIPS || FIPS_VERSION_GE(5,3); in hpke_test(), gate tests on availability of relevant ECC curve, not just on relevant digest. 2023-01-27 16:49:46 -06:00
687bbeb712 wolfcrypt/src/port/arm/armv8-aes.c: harmonize arg validation in aarch64-armasm wc_AesCcm{En,De}crypt() with aes.c -- tolerate null in/out iff inSz==0. 2023-01-27 16:32:13 -06:00
f14c27f644 Fix SE050 RSA public key loading and RSA/ECC SE050 usage from TLS with WOLF_PRIVATE_KEY_ID 2023-01-27 14:28:47 -07:00
4542eb0df1 Fix NO_ASN_TIME support for ASN template, also fix expired certificate unit tests with NO_ASN_TIME defined. 2023-01-27 12:39:53 -07:00
f61938a882 SP Aarch64: conditional changed in asm needs "cc"
Add "cc" to asm that changes the conditional flags.
2023-01-27 16:33:06 +10:00
134d4cca67 DH and SP: sp_DhExp_* called with uninitialized outLen
Fix for GeneratePublicDh was not right in #6002.
sp_DhExp_* are called from multiple functions.
Sometimes outLen contains a value and sometimes not.
Check public key output size in GeneratePublicDh before calling SP.
2023-01-27 10:13:56 +10:00
06509021ff Merge pull request #6013 from douzzer/20230125-various-fixes
20230125-various-fixes
2023-01-26 15:10:18 -08:00
58c2fe1c40 Merge pull request #6011 from SparkiDev/xts_in_place_enc_fix
AES XTS: encrypt not handling in-place properly
2023-01-26 14:04:58 -08:00
5b36d5235c Always check to make sure 'sigCheckBuf' is within range 2023-01-26 16:23:39 -05:00
eaeff1e7c2 Avoid "use after free" error 2023-01-26 16:23:39 -05:00
3cfaa4c1ff Handle return value 2023-01-26 16:23:39 -05:00
f776371874 wolfcrypt/src/hpke.c: add PRIVATE_KEY_{UNLOCK,LOCK}() wrappers in wc_HpkeSealBase() and wc_HpkeOpenBase();
wolfcrypt/test/test.c: remove PRIVATE_KEY_{UNLOCK,LOCK}() wrappers from hpke_test_single(), and do a smallstack refactor.
2023-01-26 15:00:56 -06:00
84a5bb67f2 tests/api.c: in test_tls13_apis(), conditionalize expected return value of wolfSSL_CTX_set_max_early_data() on WOLFSSL_ERROR_CODE_OPENSSL (only affects !OPENSSL_EXTRA paths). 2023-01-26 14:56:50 -06:00
4b0e0b88fb configure.ac: restore CPPFLAGS and CFLAGS to list of iterated options rendered into options.h; delete stale .build_params when ENABLED_REPRODUCIBLE_BUILD. 2023-01-26 14:53:56 -06:00
8eacd3acc9 Merge pull request #6015 from dgarske/wolf_products
Add user_settings.h template for wolfTPM
2023-01-26 15:33:54 -05:00
10529e6199 Add user_settings.h template for wolfTPM 2023-01-26 10:40:59 -08:00
c3a5698799 configure.ac/Makefile.am:
add support for EXTRA_CPPFLAGS, EXTRA_CCASFLAGS, and EXTRA_LDFLAGS;

fix typo in setup for CFLAG_VISIBILITY;

lightly refactor handling of CPPFLAGS/AM_CPPFLAGS in handlers for --with-liboqs, --with-wnr, and --with-cavium;

refactor+enhance options.h generation to handle -U directives.
2023-01-25 23:45:21 -06:00
022d0e7c89 linuxkm/module_exports.c.template: include hpke.h if HAVE_HPKE. 2023-01-25 23:36:55 -06:00
78cc2c5c3e wolfcrypt/src/port/af_alg/afalg_aes.c: in wc_AesCbc{En,De}crypt(), handle WOLFSSL_AES_CBC_LENGTH_CHECKS as in wolfcrypt/aes.c; in wc_AesGcm{En,De}crypt(), truncate ivSz to WC_SYSTEM_AESGCM_IV if necessary. 2023-01-25 23:36:01 -06:00
8f2ae77513 wolfcrypt/test/test.c: add missing PRIVATE_KEY_UNLOCK()/PRIVATE_KEY_LOCK() in hpke_test_single(). 2023-01-25 23:32:55 -06:00
584411f21a Merge pull request #6012 from kareem-wolfssl/zd15524
Fix building FIPSv2 with WOLFSSL_ECDSA_SET_K defined.
2023-01-25 18:59:38 -08:00
8ecd906c23 Update open wrt test (#6010)
Adding in tests of various versions of OpenWrt. Also simplified the way to reproduce potential issues and added in breadcrumbs for debugging.

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-25 13:58:52 -08:00
c9125f9685 Fix building FIPSv2 with WOLFSSL_ECDSA_SET_K defined. 2023-01-25 14:49:05 -07:00
7e1aecfe4c Merge pull request #6001 from SparkiDev/dsa_sign_sig_size
DSA sign: use mp_to_unsigned_bin_len
2023-01-25 11:59:27 -08:00
becedd41c9 Merge pull request #6000 from SparkiDev/dsa_force_zero
DSA: Don't force zero MPs on memory allocation failure
2023-01-25 11:59:13 -08:00
214a6bd216 Merge pull request #6009 from douzzer/20230124-fix-HAVE_C___ATOMIC
20230124-fix-HAVE_C___ATOMIC
2023-01-25 15:34:30 +10:00
e9af0136b9 AES XTS: encrypt not handling in-place properly
Fix AES XTS in-place encrypt to work when ciphertext stealing.
2023-01-25 09:32:37 +10:00
b2c751a9ca wolfcrypt/src/asn.c: fix a maybe-uninitialized found by clang --enable-asn=template. 2023-01-24 14:00:22 -06:00
5e6005a1a3 m4/ax_atomic.m4: fix conflicting macro definition for HAVE_C___ATOMIC. 2023-01-24 12:08:35 -06:00
a21c3a3c89 Merge pull request #6005 from SparkiDev/ecc_fp_alloc_fail_oob_1
ECC FP_ECC: zeroize when value set
2023-01-24 07:57:53 -08:00
c9e1039a54 Merge pull request #6003 from SparkiDev/sp_math_ec_smul
EC scalar mult with SP Math: fix scalar length check
2023-01-24 07:54:02 -08:00
a5adfcd5ca ECC FP_ECC: zeroize when value set
accel_fp_mul was zeroizing an uninitialized MP - tk.
Add boolean, indicating to zeroize, that is set when a value is set.
2023-01-24 10:28:49 +10:00
e34027ec76 SP EC ASM: mod_mul_norm fix
Handle corner case of overflow in last 32-bit word.
2023-01-24 10:12:32 +10:00
4592f1a5b4 EC scalar mult with SP Math: fix scalar length check
The support curves in SP all have an order length the same as modulus
length. The scalar cannot be larger than the order and so fix the check.
2023-01-24 09:23:19 +10:00
4b8ab2550d Merge pull request #6004 from jpbland1/hpke-disable-harden
update hpke to not use rng with ecc when hardening is off
2023-01-23 15:09:30 -08:00
44ca98f5b3 add missing NULL checks and remove rng pointer when not needed 2023-01-23 16:03:58 -05:00
a24a1c8530 Merge pull request #5924 from SparkiDev/ref_cnt_update
Ref count: change to use wolfSSL_Ref
2023-01-23 08:33:37 -08:00
9c1d214a61 Merge pull request #6002 from SparkiDev/sp_dh_exp_check_outlen
SP DH Exp: check output length for minimum
2023-01-23 08:32:12 -08:00
a36276ca3a update hpke to not use rng with ecc when hardening is off 2023-01-23 11:27:23 -05:00
53dfcd00e2 Ref count: change to use wolfSSL_Ref
Data structures changed:
WOLFSSL_CERT_MANAGER, WOLFSSL_CTX, WOLFSSL_SESSION, WOLFSSL_X509,
WOLFSSL_X509, WOLFSSL_EVP_PKEY, WOLFSSL_BIO, WOLFSSL_X509_STORE
2023-01-23 16:29:12 +10:00
1c4e1f8871 SP DH Exp: check output length for minimum
For DH Exp function in SP, don't assume output length has the minimum
length.
2023-01-23 09:43:58 +10:00
90e24d8ba5 DSA sign: use mp_to_unsigned_bin_len
mp_to_unsigned_len checks length and front pads with zeros.

Return MP_VAL when length is too small in all implemenations.
Make TFM implementation check length.
Add test case.
2023-01-23 09:14:24 +10:00
ffe302025e DSA: Don't force zero MPs on memory allocation failure
When memory allocation fails, the MPs are not initialized and force zero
is using invalid values.
2023-01-23 08:33:09 +10:00
a40da56f11 Merge pull request #5996 from douzzer/20230120-fixes
20230120-fixes
2023-01-21 08:32:14 -08:00
aa776057ff fixes: shellcheck gripes on Docker/OpenWrt/runTests.sh; null pointer derefs and duplicate tests and assigns in src/tls.c and wolfcrypt/src/hpke.c found by cppcheck (nullPointerRedundantCheck, identicalInnerCondition, duplicateAssignExpression). 2023-01-21 00:51:57 -06:00
d711e4b9f8 Merge pull request #5995 from jpbland1/ech-no-recursion
stop ech from using a recursive function call
2023-01-20 23:47:22 -06:00
9d73c197e6 Move X509_V errors from enums to defines for HAProxy CLI (#5901)
* Move X509_V errors to openssl/ssl.h

* Have X509_V define errors in wolfssl/ssl.h

* Refactor X509_V errors

* Add wolfSSL_SESSION_set1_id_*

* Fix overlong line
2023-01-20 17:50:26 -08:00
b9a544920d Add open wrt test (#5985)
* First test

* Don't forget to run autogen.sh!

* Add tools needed by automake

* Try additional platforms

* Add in qemu for other platforms

* No real support for arm containers

* Fix indentation

* Simplify container build with a testing script

* Simpler names for actions

* No need to distribute OpenWRT test files

* Better list to put ignore files onto

* Create an 'ignore_files' list after all

* Add in some documentation of how OpenWRT tests work

* Fix up naming of OpenWrt

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-20 16:59:36 -08:00
6206ad320c Merge pull request #5992 from tim-weller-wolfssl/zd15423-accepts-large-ivs
Update AES-GCM stream decryption to allow long IVs (ZenDesk #15423)
2023-01-20 16:10:13 -08:00
d28bd08093 Merge pull request #5994 from bandi13/noAutoCancelActions
Don't auto-cancel GitHub Workflows
2023-01-20 16:09:56 -08:00
d14d29e32a stop ech from using a recursive function call
update bad return value for when retry_configs is returned, add locks around hkdf functions for private key use
2023-01-20 18:37:19 -05:00
7e87623973 Don't auto-cancel GitHub Workflows 2023-01-20 16:17:20 -05:00
cf9b865e33 Update AES-GCM stream decryption setup to allow long IV values (already allowed by encryption APIs) 2023-01-20 20:35:39 +00:00
8c3cad3e95 Merge pull request #5984 from embhorn/zd15493
Fix Cmake to exclude libm when DH is not enabled
2023-01-20 11:21:09 -08:00
8d89d4a168 Merge pull request #5927 from SparkiDev/sp_math_clz
SP math: use count leading zero instruction
2023-01-20 10:33:18 -08:00
c1e0115092 Merge pull request #5993 from anhu/quic_doc_switcharoo
Move the wolfSSL Configuration section higher in QUIC.md
2023-01-20 09:32:40 -08:00
9be01633d1 Move the wolfSSL Configuration section higher in QUIC.md because it is the first step. 2023-01-20 09:49:18 -05:00
9f7e82a081 Add WOLFSSL_DH_CONST option to Cmake 2023-01-20 08:42:48 -06:00
9adea94274 SP math: use count leading zero instruction
To speed up counting bits, use the instruction that counts leading zeros
in a word.

Fix _sp_div_3 to use registers with 0 in them for multiplication result.
2023-01-20 11:56:07 +10:00
cfe92aa330 Merge pull request #5983 from SparkiDev/sp_int_read_radix_neg
SP int negative: handle negative character properly with read radix
2023-01-19 17:51:07 -08:00
e72ec4e876 Merge pull request #5976 from SparkiDev/eccsi_hash_check
ECCSI: hash function must have output size as curve size
2023-01-19 17:50:44 -08:00
f0c9f5f9f0 Multi compiler test (#5991)
* First attempt with GCC only

* Make the test run on every push temporarily

Also clean up the description of the workflow

* Fix invalid job name

* Missing hunks added

* Try out matrix actions

* Fix missing 'runs-on'

* Only needs to run on Ubuntu

* Use local installations of gcc/clang instead of containers

* Explicitly list out compilers to test

* Clean up names and concurrency group

* Only need to run on PRs and important branches

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-19 14:56:16 -08:00
f6ecc6ce4c Merge pull request #5990 from philljj/gcmstream_kcapi_errmsg
Don't allow aesgcm-stream option with kcapi
2023-01-19 12:00:36 -08:00
02178b9013 Merge pull request #5988 from bandi13/parallelOSBuilds
Parallel os builds
2023-01-19 09:59:07 -08:00
fc19aed8c8 Merge pull request #5623 from dgarske/hpke
Adds support for TLS v1.3 Encrypted Client Hello (ECH) and HPKE (Hybrid Public Key Encryption)
2023-01-19 10:03:28 -07:00
04383bfb34 Don't allow aesgcm-stream option with kcapi 2023-01-19 10:54:48 -06:00
f0212fef3e Merge pull request #5986 from bandi13/fixNonStandarBaseImages
Fix when a base image leaves non-root user
2023-01-19 07:55:19 -08:00
2276fca0f4 Cancel runs on subsequent push to PR but not to branches 2023-01-19 10:12:08 -05:00
d955768744 Only run on important branches 2023-01-19 10:03:26 -05:00
ac8951c4e2 Fix typo 2023-01-19 09:54:20 -05:00
4d5dbe9b90 Give a better name to the workflow 2023-01-19 09:44:38 -05:00
b1f423be38 Kill off previous run if another commit happens 2023-01-19 09:41:18 -05:00
cb601bdf64 Combine ubuntu and macos tests to ensure the same thing is run 2023-01-19 09:33:26 -05:00
e1d9b37f84 Merge pull request #5932 from julek-wolfssl/zd15346
ssl->suites: use ssl->ctx->suites when possible
2023-01-18 15:20:21 -08:00
283ebd5afe Remove base job 2023-01-18 17:17:15 -05:00
bb88c8fbfa Add in 'runs-on' 2023-01-18 17:13:08 -05:00
caa7c9e8b5 One more missing keyword 2023-01-18 17:07:36 -05:00
0d73074718 Missing keyword 2023-01-18 17:00:47 -05:00
ffee4edcf5 Fix dependency command 2023-01-18 16:22:06 -05:00
6ac09b5c66 Fix spacing 2023-01-18 16:12:54 -05:00
cd0b3b4eb9 Separate out steps to individual jobs 2023-01-18 16:10:58 -05:00
6b6ad38e4f Adds support for TLS v1.3 Encrypted Client Hello (ECH) draft-ietf-tls-esni) and HPKE (Hybrid Public Key Encryption) RFC9180. 2023-01-18 11:37:27 -08:00
41c35b1249 Fix line length and whitespace issues. Fix macro argument missing parentheses. 2023-01-18 11:10:19 -08:00
50cb3a7b8c Address code review 2023-01-18 09:55:33 -08:00
0e662dea6e TLSX_SetSignatureAlgorithms: free sa when TLSX_Push fails 2023-01-18 09:55:33 -08:00
281bb32edf DtlsMsgCreateFragBucket: heap param might be unused 2023-01-18 09:55:33 -08:00
a58e83847e Don't allocate Suites object on renegotiation 2023-01-18 09:55:33 -08:00
2f63fdc6ce Allocate CTX->suites in InitSSL when not already allocated 2023-01-18 09:55:33 -08:00
1cb4615435 Add SCR reconnect test 2023-01-18 09:55:32 -08:00
5b8026899b Refactor SigAlgs to use a custom struct that can override ssl->suites 2023-01-18 09:55:32 -08:00
e431688ca6 ssl->suites: use ssl->ctx->suites when possible
- Allocate ssl->suites when necessary for the WOLFSSL object to have its own instance. Use AllocateSuites() to allocate the object.
- Move cipher negotiation options from Suites into Options

ZD15346
2023-01-18 09:55:32 -08:00
68520e3f0b Fix Cmake to exclude libm when DH is not enabled 2023-01-17 16:28:36 -06:00
11ea6a10e8 ECCSI: hash function must have output size as curve size 2023-01-18 03:54:17 +10:00
7120ae1961 Merge pull request #5978 from gojimmypi/Visual_Studio_Line_Endings
CRLF line endings, trailing spaces for C# Wrapper Projects  (no code change)
2023-01-17 10:38:38 -07:00
cdf2036454 SP int negative: handle negative character properly with read radix
SP int when compiled with negative was setting sign too early.
Get sign and set after absolute value read in.
2023-01-18 03:38:23 +10:00
ea80e9e0ea Add documentation for the CSharp wrapper. 2023-01-16 11:13:25 -08:00
e90ba67a4c Fix when a base image leaves non-root user 2023-01-16 13:32:10 -05:00
b15bc3d236 Merge pull request #5977 from dgarske/kcapi_opensslextra
Fixes for building KCAPI with opensslextra enabled
2023-01-17 02:13:50 +10:00
b01e42a96c Merge pull request #5970 from ejohnstown/dtls-seq
DTLS Handshake Sequence
2023-01-16 07:39:53 -08:00
08a988f557 Merge pull request #5973 from philljj/zd15445
EVP_EncryptUpdate should update outl on empty input
2023-01-15 13:45:19 -08:00
4c35a22e0a Cleanup input checks. 2023-01-14 23:04:29 -06:00
acf761ea07 Merge pull request #5979 from SparkiDev/sp_int_arm_asm_cc
SP int ARM: Fix div word asm to indicate flags changed
2023-01-14 11:13:23 -08:00
bf3673c0b2 Merge pull request #5974 from SparkiDev/aessiv_uninit_aes
AES SIV: Allocate memory for AES as late as possbile
2023-01-14 11:13:09 -08:00
e6ef66a777 SP int ARM: Fix div word asm to indicate flags changed
"cc" needs to be set in assembly code as a modified register for div
word for ARM64 and ARM32.
2023-01-15 02:05:34 +10:00
2d8c19ac42 Merge pull request #5972 from SparkiDev/sp_int_8bit_to_bin_len
SP int: fix 8-bit words and to binary length
2023-01-13 16:55:53 -08:00
fec4fe6095 Fixes for building KCAPI with opensslextra enabled. 2023-01-13 16:33:55 -08:00
91d2ff1fe9 no code change; CRLF line endings, trailing spaces 2023-01-13 16:29:19 -08:00
46ace19111 Merge pull request #5975 from bandi13/cleanupContainers
No need to leave container artifacts around
2023-01-13 15:03:43 -08:00
e6ed44322a Merge pull request #5967 from dgarske/bench_help
Fixes for benchmark help `-alg` list and block format
2023-01-14 05:55:04 +10:00
0a2ee6c530 AES SIV: Allocate memory for AES as late as possbile
AES will be initialized if memory allocation succeeded.
2023-01-14 05:41:24 +10:00
4f4819bd19 EVP_EncryptUpdate should update outl on empty input 2023-01-13 11:32:15 -06:00
658d647339 SP int: fix 8-bit words and to binary length 2023-01-14 03:10:50 +10:00
af379f0a0f DTLS Handshake Sequence
The DTLS server needs to save the message_seq number of the client
hello for use in both the hello verify request in the stateless start
and for the server hello. Move the stashing of the value earlier in
DoClientHello(). (Issue #5224)
2023-01-12 20:43:05 -08:00
5311a8e673 Merge pull request #5969 from SparkiDev/sp_int_to_bin_len
SP int: fail when buffer writing to is too small for number
2023-01-12 13:44:39 -08:00
3151a5b12a Merge pull request #5956 from gojimmypi/Espressif_S3_wolfcrypt_random
interim ESP32-S3 changes & diagnostics
2023-01-12 11:34:38 -08:00
48a136a932 Fix for MB vs MiB printing. The base2 option was printing type backwards (base2=1 = 1024 bytes and base2=0 or -base10 means 1000 bytes). 2023-01-12 11:09:20 -08:00
c22b89e935 SP int: fail when buffer writing to is too small for number 2023-01-13 02:12:03 +10:00
24f89337f6 Espressif examples default partition params: large app 2023-01-11 17:46:44 -08:00
5e1c7c3db2 Fix for benchmark help broken in PR #5871 2023-01-11 15:05:07 -08:00
50820b64fb update Espressif include.am, add sdkconfig.defaults 2023-01-11 12:26:19 -08:00
0c263a4098 tidy up ESP32S3 detection. known-good sdkconfig defaults 2023-01-09 19:59:15 -08:00
b2d8b1c2fd Merge pull request #5954 from JacobBarthelmeh/Compatibility-Layer
very basic support for public key types in cipher list string with '+'
2023-01-09 15:46:50 -08:00
369c565368 No need to leave container artifacts around 2023-01-06 15:06:30 -05:00
86aa3cc836 Merge pull request #5942 from bandi13/evpaesccm
Evpaesccm
2023-01-06 11:25:37 -08:00
9c2bbc2080 Merge pull request #5959 from douzzer/20230105-wolfsentry-fixes
20230105-wolfsentry-fixes
2023-01-06 11:04:16 -07:00
26f9047079 Merge pull request #5958 from tatowicz/siphash-fix
Add fix for siphash cache and tests
2023-01-06 11:02:38 -07:00
99a489dec3 improve test and handling of public key type cipher suite string 2023-01-06 09:53:51 -08:00
8436f82540 Adding in @ejohnstown's suggested patch for line lengths 2023-01-06 12:23:30 -05:00
d44130d807 src/ssl.c: revert 2c2740d0dc, as it duplicates optimizer functionality, and produces bugprone-sizeof-expression on clang-tidy and sizeofwithnumericparameter on cppcheck. 2023-01-05 18:40:51 -06:00
0b0b980784 fix an oversight in wolfSentry integration in examples/{client,server}. 2023-01-05 17:59:10 -06:00
a08c853799 Add fix for siphash cache and tests 2023-01-05 16:56:07 -06:00
10c324e9ad Merge pull request #5953 from anhu/wolfSSL_CertManagerLoadCABuffer_ex
Add wolfSSL_CertManagerLoadCABuffer_ex()
2023-01-05 15:20:58 -07:00
ab33788cdb treat ECDHE,RSA cipher suite list as mixed TLS 1.3 and pre TLS 1.3 2023-01-05 13:48:34 -08:00
636f4fc929 Merge pull request #5957 from douzzer/20230104-fixes
20230104-fixes
2023-01-05 13:58:21 -07:00
5de817b0c1 Add wolfSSL_CertManagerLoadCABuffer_ex()
Also add unit tests.
2023-01-05 15:34:13 -05:00
404930036c Merge pull request #5951 from tim-weller-wolfssl/zd14935-pointless-comparison
Avoid pointless-comparison warnings (Pa084) with IAR for ARM tools
2023-01-05 08:20:02 -08:00
43265669c6 fix warnings around clang-diagnostic-embedded-directive and readability-uppercase-literal-suffix; update wolfSentry integration for upcoming release 0.8.0. 2023-01-05 00:13:17 -06:00
124c04b01a A bit more consistent naming for structure variables 2023-01-04 21:04:58 -05:00
25ce553e8f Shorten some line lengths 2023-01-04 20:32:04 -05:00
51f3386d60 Shorten variable names 2023-01-04 20:29:14 -05:00
d5a7b56332 sp pragram around sanity check for vcpkg build warning 2023-01-04 16:19:27 -08:00
b04d6ed56b interim ESP32-S3 changes & diagnostics 2023-01-04 15:49:35 -08:00
2c2740d0dc Update comparison of WOLFSSL_BN_ULONG value to MP_MASK to include check for potential type size differences which can lead to pointless-comparison warnings with IAR tools 2023-01-04 17:35:46 -06:00
af2c5cf18b Remove the existence of WOLFSSL_AESCCM_STREAM 2023-01-04 14:17:36 -05:00
a3e085f204 very basic support for public key types in cipher list string with '+' 2023-01-04 10:49:18 -08:00
adb406e1ee Adding some developer utilities (#5941)
* Adding some developer utilities for Docker.
* Add support for `make test`
* Don't need to run the testsuite specifically
* Share .gitconfig and ssh keys with the container

Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-04 08:48:24 -08:00
e42f6dbe4b Merge pull request #5939 from dgarske/20221228_cleanups
Fixes for some build configuration variations
2023-01-04 08:32:20 -07:00
0ec0c05eda Change variable names to protect the innocent 2023-01-04 10:23:42 -05:00
c21f5f3757 Fix unused variable error 2023-01-04 09:48:28 -05:00
8d59f61b9b Fix test_wolfSSL_dtls_stateless_resume test case 2023-01-04 13:04:45 +01:00
114471d6cf add pragram around sanity check for vcpkg build warning 2023-01-03 15:23:43 -08:00
914d3114de Addressing PR comments
TODO should not have been in the changes
indentation of #ifdef moved in line with the 'if' conditional
2023-01-03 14:55:07 -05:00
023db01aca * Fixed some build configuration variations.
* Fixed `PEM_BUFSIZE` macro redefined when building with coexist.
* Updated the `user_settings_all.h` and `user_settings_wolfboot_keytools.h` to include latest options.
* Improved API unit test error case checking where `TEST_RES_CHECK` is not used.
* Changed `TEST_SKIPPED` to unique value.
* Added CI tests for enable-all, small stack, and user setting templates.
2023-01-03 10:59:59 -08:00
4f8edb312b Add compilation to espressif (#5947)
* Refactor GitHub actions and add ESP tests.
* Add script for building all examples for ESP.
* Fixes for ESP-IDF v5.0
* Consolidating Espressif files into a single include.am
Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-03 09:50:38 -08:00
bdcf6928a2 Merge pull request #5945 from JacobBarthelmeh/copyright
update copyright to 2023
2023-01-03 09:29:39 -08:00
4edae51095 Fix StartTLS_Init (#5907)
* Fix StartTLS_Init (contribution by Yota Nagaya)
2023-01-03 09:28:23 -08:00
dc6ffc790d Need declaration of 'tmp' variable 2023-01-02 14:36:50 -05:00
ec9697999e Use minimum size for NONCE 2023-01-02 08:51:13 -05:00
9dcc48c8f7 update copyright to 2023 2022-12-30 17:12:11 -07:00
df3c11ad82 Don't define a new default NONCE size, instead use existing MAX 2022-12-30 16:02:30 -05:00
f734f5037d Add similar trick to GCM routines so our code is more uniform 2022-12-30 13:11:26 -05:00
a00abb0f88 Fix compilation issue when AESCCM is not enabled 2022-12-30 13:10:24 -05:00
c925223822 Merge pull request #5943 from JacobBarthelmeh/sessionExport 2022-12-30 09:58:47 -08:00
b43852363e Merge pull request #5944 from JacobBarthelmeh/Testing
fix for older selftest that returns bad padding instead of salt len e…
2022-12-30 08:37:02 -08:00
4a23edd5fb fix for older selftest that returns bad padding instead of salt len error 2022-12-30 06:31:09 -08:00
aab12fc14b check DTLS method for test case 2022-12-29 15:49:46 -07:00
1132579dd1 Add in zero length test 2022-12-29 17:02:43 -05:00
1192d41f0e First successful implementation of EVP_aes_*_ccm 2022-12-29 17:02:43 -05:00
27b5ac421e Use the actual size of the structure 2022-12-29 17:02:43 -05:00
251b89631e Merge pull request #5940 from anhu/bench_ext_kyber
don't call external implemenation of kyber from benchmark anymore.
2022-12-29 11:00:59 -08:00
0787ab1131 don't call external implemenation of kyber from benchmark anymore. 2022-12-29 11:48:54 -05:00
5e11fb19a4 Merge pull request #5937 from anhu/blinding_on
Change comment to reflect that RSA blind is enabled by default
2022-12-28 12:56:58 -08:00
5c0abfd7ad Merge pull request #5936 from embhorn/zd15400
Fix unguarded XFPRINTF calls
2022-12-28 12:47:19 -08:00
004705b38f Fix unguarded XFPRINTF calls 2022-12-28 12:23:40 -06:00
f9ccdd7ffc Change comment to reflect that RSA blind is enabled by default 2022-12-28 13:09:59 -05:00
aadce3af9c Merge pull request #5930 from miyazakh/subscript_has_char 2022-12-28 10:18:43 -07:00
9b513fd6bf Merge pull request #5934 from cconlon/jpdocfix
Remove incomplete doxygen in JP asn_public.h
2022-12-28 08:07:20 -07:00
67fe575896 Merge pull request #5933 from anhu/purge_dilithium_aes
Purge the AES variant of Dilithium
2022-12-27 16:44:52 -08:00
a2b6c5dd1e remove incomplete doxygen in JP asn_public.h 2022-12-27 14:46:38 -07:00
b3e99348cd Purge the AES variant of Dilithium 2022-12-27 14:37:47 -05:00
19033d82fe Merge pull request #5931 from douzzer/20221226-minor-fixes
20221226-minor-fixes
2022-12-27 08:40:17 -08:00
43f0830ad7 Merge pull request #5923 from JacobBarthelmeh/release
add quality of release statement
2022-12-27 08:39:41 -08:00
11e44e746b Merge pull request #5928 from dgarske/zd15388
Fixes SP math all build issue with small-stack and no hardening
2022-12-27 09:23:53 -07:00
cb1b20dc8e linuxkm/: accomodate refactoring in kernel 6.2+ of cpu_number to be an element of the pcpu_hot`structure. 2022-12-26 21:03:04 -06:00
425d0b72c3 wolfcrypt/benchmark/benchmark.c: fix bench_stats_sym_finish() in GENERATE_MACHINE_PARSEABLE_REPORT mode to properly render "bytes_total" column in bytes, not the unit selected by WOLFSSL_BENCHMARK_FIXED_UNITS_*. 2022-12-26 20:25:05 -06:00
9ac790a8ce Docker/run.sh: mollify shellcheck, and prevent splitting on whitespace passing args through to configure. 2022-12-26 20:18:43 -06:00
684646c8b9 fix shadows min and subscript by i486-netbsd-gcc 2022-12-25 07:20:04 +09:00
dee01cfe9b Fixes SP math all build issue with small-stack and no hardening. Fixes ZD15388 2022-12-23 13:22:40 -08:00
d686f0a5de Merge pull request #5925 from SparkiDev/sp_mod_3_perf
SP math: rework mod 3
2022-12-22 17:55:28 -08:00
18e04d184e Merge pull request #5895 from bandi13/addDocker
Add docker
2022-12-22 17:19:43 -08:00
60037ead70 Merge pull request #5871 from gojimmypi/BenchmarkEnhancements
Benchmark Enhancements and Code Cleanup
2022-12-22 17:18:47 -08:00
49d23cf60a Merge pull request #5913 from douzzer/20221219-no-sha-1-all-crypto
20221219-no-sha-1-all-crypto
2022-12-22 17:02:58 -08:00
1b18da7e87 Merge pull request #5920 from jpbland1/unrecognized-http-header
remove http header length check for CRL verification
2022-12-22 17:01:54 -08:00
5c89719c51 Merge pull request #5916 from julek-wolfssl/dtls-srtp-keying-material
DTLS-SRTP: use wolfSSL_export_keying_material instead of wc_PRF_TLS
2022-12-22 17:01:37 -08:00
135b9f0566 Merge pull request #5915 from julek-wolfssl/dtls-remove-realloc-dep
DtlsMsgCombineFragBuckets: Remove realloc dependency
2022-12-22 17:01:31 -08:00
62e3835b0e Merge pull request #5911 from julek-wolfssl/DtlsMsgPoolSend-sendSz
DtlsMsgPoolSend: Use correct sendSz
2022-12-22 17:01:19 -08:00
29c46ce867 Merge pull request #5902 from bandi13/ESP-IDF_fixes
Esp idf v5 fixes
2022-12-22 17:01:09 -08:00
b7a28cc704 compatibility for EVP_CipherUpdate with AES-GCM 2022-12-23 09:09:20 +09:00
162dca87c3 SP math: rework mod 3
Simplification when only calculating mod and modulus is 3.
2^(2*n) * x mod 3 = x mod 3.
Add all digits and calculate mod 3 of sum.
2022-12-23 09:21:13 +10:00
8e0f0d611f Merge pull request #5914 from kojo1/ja
add Doxygen cmac.h, quic.h
2022-12-22 15:20:26 -07:00
9ce79c4de8 Merge pull request #5921 from cconlon/libsuffix 2022-12-22 11:37:28 -08:00
50aeb2f79e add quality of release statement 2022-12-22 10:42:18 -07:00
a20426b2b0 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into BenchmarkEnhancements 2022-12-22 08:47:25 -08:00
709461e4aa Merge pull request #5922 from JacobBarthelmeh/Testing
add crl test file to dist
2022-12-21 16:30:33 -08:00
db03994899 add crl test file to dist 2022-12-21 15:05:30 -07:00
9a7ff8773b add --with-libsuffix support, append suffix to library artifact name 2022-12-21 13:31:07 -07:00
b36d585335 remove http header length check for CRL verification 2022-12-21 13:01:58 -05:00
4fbd4fd36a Merge pull request #5917 from JacobBarthelmeh/release
prepare for release 5.5.4
2022-12-20 16:15:51 -08:00
509ad07dbd Merge pull request #5918 from kareem-wolfssl/zd15369
Fix length being passed into GetFormattedTime.
2022-12-20 17:12:13 -07:00
eebe04b181 Fix length being passed into GetFormattedTime. 2022-12-20 15:42:02 -07:00
cca63a465d prepare for release 5.5.4 2022-12-20 14:19:59 -07:00
455e76873c peer review fixes re: minor fixes to accommodate --disable-sha in combination with --enable-all-crypto. 2022-12-20 10:43:33 -06:00
6a8be960ba DTLS-SRTP: use wolfSSL_export_keying_material instead of wc_PRF_TLS 2022-12-20 16:42:28 +01:00
2fe6555fcf DtlsMsgCombineFragBuckets: Remove realloc dependency 2022-12-20 13:53:03 +01:00
5ff8bec975 add Doxygen cmac.h, quic.h 2022-12-20 17:44:52 +09:00
91869f6028 minor fixes to accommodate --disable-sha in combination with --enable-all-crypto. 2022-12-20 00:42:05 -06:00
6f7d8d287d Merge pull request #5905 from JacobBarthelmeh/cert_update
end of year certificate update
2022-12-19 09:52:53 -08:00
bc15f67d8d Fixing indentation on preprocessor commands 2022-12-19 11:13:58 -05:00
11fcb790b1 Merge branch 'wolfSSL:master' into ESP-IDF_fixes 2022-12-19 11:11:55 -05:00
53b2be06d3 DtlsMsgPoolSend: Use correct sendSz
pool->sz is the size without the record header. The handshake header is present already.

Reproducible with
  ./udp_proxy -p 12345 -s 127.0.0.1:11111 -x 1:3 -S server
or
  ./udp_proxy -p 12345 -s 127.0.0.1:11111 -x 1:3 -S server
and
  ./examples/server/server -l ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305 -u -i
  ./examples/client/client -l ECDHE-RSA-AES256-GCM-SHA384 -u -R -p 12345 -i
2022-12-19 17:07:37 +01:00
64a7d511b8 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into BenchmarkEnhancements 2022-12-16 14:00:16 -08:00
3d1775320b Merge pull request #5900 from icing/tls12-no-tickets
WOLFSSL_OP_NO_TICKET fix for TLSv1.2
2022-12-16 14:42:50 -07:00
91f8b5e58e Merge pull request #5903 from douzzer/20221216-fix-benchmark
20221216-fix-benchmark
2022-12-16 14:35:12 -07:00
c6aaa1310e end of year certificate update 2022-12-16 13:32:37 -08:00
b90c07900b Merge pull request #5904 from anhu/FIPS_fix
ENABLED_FIPS doesn't hold the version; FIPS_VERSION does.
2022-12-16 14:16:47 -07:00
8d372b2c6f Start an FAQ in the README.md 2022-12-16 15:45:29 -05:00
c370529975 manual merge with upstream 2022-12-16 11:28:04 -08:00
24d7f85016 ENABLED_FIPS doesn't hold the version; FIPS_VERSION does.
Found with:

./configure --enable-engine=fips=v2
2022-12-16 14:06:43 -05:00
04b31518ba wolfcrypt/benchmark/benchmark.c: fix calculation of outer iteration constant in bench_aesecb_internal(); fix .c.h clash in argument name ("useDevId" vs "useDeviceID"). 2022-12-16 12:55:37 -06:00
d0f0d66b80 Add in changes to wolfssl_server 2022-12-16 11:55:53 -05:00
814ad9fc38 Better fixes 2022-12-16 11:55:28 -05:00
b9e69f1795 Fixes for wolfssl_client example 2022-12-16 10:23:09 -05:00
5c21e40bce Merge pull request #5899 from SparkiDev/regression_fixes_5
Fixes from regression testing.
2022-12-16 06:54:26 -08:00
07dcd5270e Merge pull request #5898 from cconlon/androidSystemCa
Add Android CA certs path for wolfSSL_CTX_load_system_CA_certs()
2022-12-16 06:12:24 -08:00
9d0b16097e Fix builds without session tickets. 2022-12-16 09:40:51 +01:00
dccabc60a5 Disabling TLSv1.2 session tickets when WOLFSSL_OP_NO_TICKET is being set.
There seems to have been a misunderstanding that WOLFSSL_OP_NO_TICKET would only disable tickets
for TLS version lower than 1.2. But it includes 1.2 as well.
2022-12-16 09:29:44 +01:00
45e3c721b3 Fixes from regression testing.
Fix random prime generation for big endian to set low bits after
shifting top word.
Allow SP_MATH to be built without RSA, DH and ECC - needed for PKCS#12.
Add DH 2048 bit parameters to cert_test.c for test.c when NO_ASN and
WOLFSSL_SP_MATH.
2022-12-16 14:43:29 +10:00
502fd843ec Merge pull request #5897 from gojimmypi/gojimmypi-initialize-resp_length
initialize resp_length = 0 in tls.c
2022-12-15 17:23:48 -08:00
f9bd8f76de add Android system CA certs path for to wolfSSL_CTX_load_system_CA_certs() usage 2022-12-15 16:39:48 -07:00
4434d898a1 Merge pull request #5894 from kaleb-himes/fix-leak
Fix a quick leak in the test apps
2022-12-16 08:04:50 +10:00
aa784397b0 Merge pull request #5896 from cconlon/atexitOSX
AC_CHECK_DECLS for atexit needs stdlib.h on OSX
2022-12-15 15:00:29 -07:00
b823da9bb9 Fix build issues with the latest ESP-IDF 2022-12-15 16:11:39 -05:00
e0c9586b79 initialize resp_length = 0 in tls.c 2022-12-15 12:51:33 -08:00
3ba8c918f2 Use standard naming 2022-12-15 15:30:22 -05:00
6a2673f5f7 Adding Docker files to distribution 2022-12-15 15:11:14 -05:00
995e3bd009 Allow for existing group 2022-12-15 14:30:13 -05:00
b23db16ff8 Refactor the double-free fix 2022-12-15 12:21:08 -07:00
668efea464 Merge pull request #5884 from icing/ssl-set-ssl-ctx
Fix wolfSSL_set_SSL_CTX() to be usable during handshake.
2022-12-15 10:59:54 -08:00
8c54bd0fb1 check for atexit needs stdlib.h on OSX, fixes configure sed error 2022-12-15 11:23:37 -07:00
908744dc0f Merge pull request #5646 from JacobBarthelmeh/caam
benchmark devid changes, CCM with SECO fix, set IV on AES import into SECO
2022-12-15 10:01:01 -08:00
c1cf8a8f34 Add in README.md 2022-12-15 12:54:21 -05:00
d9ca5f6d3a Merge pull request #5893 from kaleb-himes/mtu-with-static-mem
Add alt case for unsupported static memory API
2022-12-15 09:22:21 -08:00
9c135e59dc Script can run from an arbitrary folder 2022-12-15 12:22:05 -05:00
d46813953d Merge pull request #5892 from tatowicz/decodealtnames-fuzz-fix
Add Overflow check to DecodeAltNames input buffer access
2022-12-15 09:21:37 -08:00
64d39dbd74 Cleaner base image 2022-12-15 12:10:48 -05:00
c1ad3457f3 Run as non-root local user 2022-12-15 12:10:25 -05:00
be1b3ec007 Fix issue with multiple command arguments 2022-12-15 11:25:43 -05:00
46c47e4adc Fix a quick leak in the test apps
Fix a double-free scenario also
2022-12-15 09:13:45 -07:00
78fd5d7dbc Fix wolfSSL_set_SSL_CTX() to be usable during handshake.
This method requires some explanation. Its sibling is
  int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
which re-inits the WOLFSSL* with all settings in the new CTX.
That one is the right one to use *before* a handshake is started.

This method was added by OpenSSL to be used *during* the handshake, e.g.
when a server inspects the SNI in a ClientHello callback and
decides which set of certificates to use.

Since, at the time the SNI callback is run, some decisions on
Extensions or the ServerHello might already have been taken, this
method is very restricted in what it does:
 - changing the server certificate(s)
 - changing the server id for session handling
and everything else in WOLFSSL* needs to remain untouched.
2022-12-15 09:33:01 +01:00
d8c9a5aa17 return benchmark to auto-scale units by default 2022-12-14 20:45:44 -08:00
8831fbd22e fix csv math, units/sec, PQ cycle header 2022-12-14 20:27:15 -08:00
8924487f27 fix warning for builds using cmac and not devID 2022-12-14 15:38:08 -08:00
89c993eff3 fix AES-CCM enc/dec for SECO (passes nonce directly) 2022-12-14 15:20:03 -08:00
b79879d106 fix setting IV when importing AES key into SECO 2022-12-14 15:20:03 -08:00
9f77210b0b update benchmark for devID builds 2022-12-14 15:20:03 -08:00
ed17524793 Add alt case for unsupported static memory API 2022-12-14 16:02:35 -07:00
a3f3c76faa Merge pull request #5890 from anhu/fix_iv_size
Fix the wrong IV size.
2022-12-15 08:43:25 +10:00
3d8f25ab7d Merge pull request #5430 from dgarske/sniffer_multithread
Support for multi-threaded sniffer
2022-12-15 08:18:49 +10:00
3fd2292d11 Merge pull request #5889 from anhu/dtls13_pqtests
Kyber with DTLS 1.3 tests
2022-12-14 13:20:32 -08:00
370e0ce0f4 Add formatting fixes 2022-12-14 13:54:03 -06:00
c5ca20fe43 New files so add them to include.am 2022-12-14 13:28:20 -05:00
d55ef14cc7 First crack at creating a common Docker environment 2022-12-14 13:17:22 -05:00
8580ac0377 Add Overflow check to DecodeAltNames input buffer access 2022-12-14 12:08:19 -06:00
472a31a801 Fix the wrong IV size. 2022-12-14 13:04:38 -05:00
ad6d6be620 Kyber with DTLS 1.3 tests 2022-12-14 12:46:24 -05:00
6be0512728 Peer review cleanups. 2022-12-14 09:25:04 -08:00
b2d25ece98 Merge pull request #5885 from anhu/pq_session_ticket
Allow session tickets to properly resume when using PQ KEMs.
2022-12-13 16:32:07 -08:00
e33d59cd76 Review cleanups. 2022-12-13 10:55:22 -08:00
364835dc9e Allow session tickets to properly resume when using PQ KEMs.
Found with:

```
./configure --with-liboqs --enable-session-ticket
./examples/server/server -v 4 -r --pqc P521_KYBER_LEVEL5
./examples/client/client -v 4 -r --pqc P521_KYBER_LEVEL5
```
2022-12-13 11:36:00 -05:00
64ef6aedd6 Merge pull request #5882 from SparkiDev/sp_aarch64_be
SP: support aarch64 big endian
2022-12-12 22:06:38 -06:00
a7a6d5b297 Merge pull request #5874 from JacobBarthelmeh/tls13
adjust post auth support with TLS 1.3
2022-12-13 09:39:31 +10:00
bc3b723609 SP: support aarch64 big endian 2022-12-13 09:33:16 +10:00
d0c9ec6681 Merge pull request #5854 from JacobBarthelmeh/Certs
fix other name san parsing and add RID cert to test parsing
2022-12-12 14:44:07 -08:00
a1e883b43d Merge pull request #5875 from JacobBarthelmeh/Compatibility-Layer
fix for handling DEFAULT:... cipher suite list
2022-12-12 14:43:50 -08:00
334042d7f5 Merge pull request #5881 from anhu/warn_session_ticket
Warn that renegotiation in TLS 1.3 requires session ticket.
2022-12-12 13:51:28 -08:00
36413a2c11 Merge pull request #5879 from SparkiDev/api_test_timing
API test: Report time taken to perform test
2022-12-12 12:31:06 -08:00
f87859a00e Whitespace cleanups. Use const for test_tls_ext_duplicate. 2022-12-12 08:59:53 -08:00
78f495cdae Merge pull request #5877 from SparkiDev/x509v3_d2i_aia
X509v3 EXT d2i: fix freeing of aia
2022-12-12 08:59:15 -08:00
2a97862d26 Merge pull request #5878 from SparkiDev/benchmark_aesofb_fix
Benchmark AES-OFB: initialize and free AES object
2022-12-12 08:57:44 -08:00
b017795413 Remove changes around wolfSSL_set_session() as it breaks tests. 2022-12-12 11:44:27 -05:00
de22dbe61d Support for multi-threaded sniffer. Add support for atomic operations instead of mutex in wc_port.h. 2022-12-12 08:39:42 -08:00
fffd3adc30 Warn that renegotiation in TLS 1.3 requires session ticket. 2022-12-12 11:30:01 -05:00
b871829833 Merge pull request #5811 from lealem47/zd15184
Async Sniffer: Fix for decryption after second handshake
2022-12-12 08:21:35 -08:00
b4b1739783 API test: Report time taken to perform test
API test now displays timing taken to perform a test case to help
identify ones that are doing too much work.
2022-12-12 12:24:38 +10:00
50c5d61998 Merge pull request #5872 from SparkiDev/tls_ext_no_dup
TLS: detect duplicate known extensions
2022-12-11 16:53:38 -08:00
819d40a76f Benchmark AES-OFB: initialize and free AES object
Device ID is not initialized unless wc_AesInit() is called.
Call wc_AesFree() for possible hardware implementations.
2022-12-12 10:45:21 +10:00
7f3de91e25 X509v3 EXT d2i: fix freeing of aia
aia is a stack and must be pop freed rather than freed with XFREE.
Extract function that creates Authority Info Access stack.

Fix spelling issue raised by codespell.
2022-12-12 10:13:13 +10:00
9ab8867b42 TLS: detect duplicate known extensions
TLS specification requires that there not be more than one extension of
the same type in a given extension block. E.g. ClientHello
2022-12-12 08:35:04 +10:00
f974bd4ad6 move test function call into macro guard 2022-12-10 15:45:14 -08:00
8b296877ab fix for handling DEFAULT:... cipher suite list 2022-12-10 14:53:43 -08:00
389cf6ed0a adjust post auth support with TLS 1.3 2022-12-10 06:49:51 -08:00
5e434e62fb Support for WOLFSSL_BENCHMARK_FIXED_CSV, minor changes per #5871 feedback 2022-12-09 12:39:51 -08:00
11c4a0e228 Merge pull request #5866 from dgarske/ecc_pub_import
Fix API test `test_wc_ecc_import_raw` with SP math
2022-12-09 14:00:57 -06:00
793bd6620b Fix unicode char in logging.c. 2022-12-09 10:36:35 -08:00
52c6710783 Fix test_wc_ecc_import_raw to handle ECC_INF_E or MP_VAL on point failures. SP math returns MP_VAL in sp_256_ecc_is_point_4. 2022-12-09 10:32:46 -08:00
9d98cd6e50 Merge branch 'BenchmarkEnhancements' of https://github.com/gojimmypi/wolfssl into BenchmarkEnhancements 2022-12-09 10:10:04 -08:00
6c3e301006 Benchmark Consolidated Enhancements and Code Cleanup 2022-12-09 10:09:56 -08:00
85dc7a61c5 Detect SIZEOF_LONG in armclang and diab 2022-12-09 09:29:25 +01:00
c959d22b98 Merge pull request #5868 from dgarske/ecc_pub_math
Expose more ECC math functions and improve async shared secret
2022-12-09 08:37:26 +10:00
f8484fb5f3 Merge pull request #5869 from anhu/NO_SERVER_fix
Add proper gating on !NO_WOLFSSL_SERVER
2022-12-08 14:30:23 -08:00
5d9532b0ee Merge pull request #5865 from dgarske/fix_-5864
Fix for implicit conversion with 32-bit in SP math
2022-12-09 08:24:04 +10:00
ab6233a01b Merge pull request #5870 from anhu/fix_sgx_stdout
stdout is undeclared
2022-12-08 15:22:30 -07:00
374d6d368e Benchmark Consolidated Enhancements and Code Cleanup 2022-12-08 13:38:06 -08:00
3aa74e3c8c stdout is undeclared 2022-12-08 15:29:48 -05:00
cdaa4d8aa0 Add proper gating on !NO_WOLFSSL_SERVER
Found with the following configuration:

--enable-dtls --enable-dtls13 --enable-dtls-mtu CFLAGS="-DNO_WOLFSSL_SERVER"
2022-12-08 14:20:17 -05:00
9cb19e36fe Merge pull request #5867 from anhu/dont_make_broken_key
For compatibility `EC_KEY_new_by_curve_name` check that we found curve
2022-12-08 11:09:56 -08:00
9ad4e3f9ba Expose the safe version of point double/add and mulmod_ex with WOLFSSL_PUBLIC_ECC_ADD_DBL. Eliminate int wc_ecc_shared_secret_gen used by async/nb and improve async use of curve spec allocations. 2022-12-08 10:43:03 -08:00
937d247c7d Don't create a key if we don't support the curve.
Found with the following configuration:

./configure --enable-tls13 --disable-oldtls --enable-static --enable-singlethreaded --enable-dtls --enable-dtls13 --enable-dtls-mtu --enable-sp=yes,4096 --disable-shared --disable-sha3 --disable-dh --enable-curve25519 --enable-secure-renegotiation --enable-debug --enable-opensslextra 'CFLAGS=-DWOLFSSL_DTLS_ALLOW_FUTURE -DWOLFSSL_MIN_RSA_BITS=2048 -DWOLFSSL_MIN_ECC_BITS=256 -DFP_MAX_BITS=8192 -fomit-frame-pointer'
2022-12-08 12:13:12 -05:00
d264cbc899 Fix for implicit conversion with 32-bit in SP math.
Fixes `error: implicit conversion loses integer precision: sp_int64' (aka long long) to sp_digit (aka int)` building with `./configure CC="clang -m32" --enable-sp && make`
2022-12-08 08:31:02 -08:00
eb69ccb22c Merge pull request #5856 from icing/errq-improvements
Improvements in OpenSSL Compat ERR Queue handling.
2022-12-08 09:28:05 -07:00
02094ebb2e Updates after review by JacobBarthelmeh.
- fix err/ret rename leftover for python builds
- add documenetation to thread-local functions
- move generic queue functions up
2022-12-08 09:53:05 +01:00
bdadbefb4c Merge pull request #5862 from JacobBarthelmeh/Compatibility-Layer
map SSL_CTX_get_session_cache_mode compat API
2022-12-07 14:50:31 -08:00
1f607ee560 Merge pull request #5860 from tmael/entropy_memuse
Increase RNG_SECURITY_STRENGTH for FIPS
2022-12-08 08:26:07 +10:00
099135b2f9 Merge pull request #5861 from kosmas-valianos/FixTypo
Fix wrong function name in wolfSSL_X509_get_name_oneline()
2022-12-07 13:03:54 -08:00
94212e68e5 map SSL_CTX_get_session_cache_mode compat API 2022-12-07 11:35:48 -07:00
45f9ef5dd9 Improvements in OpenSSL Compat ERR Queue handling.
Configuration
- thread-local storaoge is selected when available
- '--enable-error-queue-per-thread' and '--disable-error-queue-per-thread' can
  be used as before to explicitly en-/disable the feature.

Implementation:
- with thread-local-storage, error queue is realized in one struct without
  allocations. Queue size is restricted to 16 entries (per thread), which
  is the same limit in OpenSSL 1.1.x.
- without thread-local-storage, all error queue operations are mutex locked
- wc_PeekErrorNodeLineData() and wc_GetErrorNodeErr() added for use by SSL
  functions to allow locked queue iterations/manipulations.
2022-12-07 18:14:45 +01:00
11f9bd85ee Fix wrong function name in wolfSSL_X509_get_name_oneline() 2022-12-07 16:00:05 +01:00
1e0886180b Adjust ENTROPY_SCALE_FACTOR for FIPS 2022-12-06 23:01:13 -08:00
f6cb13b11b Merge pull request #5851 from SparkiDev/sp_enable_asm_fix
SP: --enable-sp-asm now enables SP if not set
2022-12-06 17:37:15 -08:00
1de30c6b67 SP: --enable-sp-asm now enables SP if not set
Enabling SP with ASM didn't enable SP or error out when SP wasn't
configured. Now enables SP when '' and errors when 'no'.

SAKKE modinv used large amounts of stack. Change to have more temporary
memory allocated increased to cover the usage.
ECC, SAKKE: sp_<bits>_ecc_mulmod_<cpu><words>() used large amounts of
stack. Allocate when WOLFSSL_SMALL_STACK.

wc_DhCheckKeyPair() not available when HAVE_SELFTEST.
Wasn't compiled in before as WOLFSSL_HAVE_SP_DH wasn't defined.
2022-12-07 09:01:53 +10:00
e5d03cf5ad Merge pull request #5848 from philljj/fix_mingw64_build
Fix mingw-w64 build issues on windows.
2022-12-07 08:57:07 +10:00
5c020c6ad4 Increase RNG_SECURITY_STRENGTH for FIPS 2022-12-06 14:16:29 -08:00
ec11c22fb7 Merge pull request #5859 from anhu/ws
whitespace
2022-12-06 14:08:10 -08:00
246ce8dbe1 Cleanup spaces. 2022-12-06 15:24:34 -06:00
754440e0f2 whitespace 2022-12-06 15:12:44 -05:00
6bde6af973 Merge pull request #5858 from anhu/dtls13_fixups
Fixups for problems discovered while testing for DTLS 1.3
2022-12-06 10:44:26 -08:00
9e181e8ecb Merge pull request #5857 from gojimmypi/GitIgnore
gitignore old cmake, VisualGDB working & Espressif sdkconfig files
2022-12-06 10:44:05 -08:00
824c280d12 Merge pull request #5807 from lealem47/sniffer_error
Improvement for sniffer error messages
2022-12-06 09:40:07 -08:00
44a1ffa56e Merge pull request #5855 from ejohnstown/rdrand-ok
DRBG OK
2022-12-06 08:53:07 -08:00
a5f9e5c3c8 Merge pull request #5820 from SparkiDev/entropy_memuse
MemUse Entropy: enabled with HAVE_ENTROPY_MEMUSE
2022-12-06 08:52:45 -08:00
7935a11b3e Fixups for problems discovered while testing for DTLS 1.3 2022-12-06 11:30:23 -05:00
ef63a5287a Ignore old cmake, VisualGDB working & Espressif sdkconfig files 2022-12-06 08:10:14 -08:00
a6c98a11d9 Merge pull request #5845 from anhu/re-sign
Don't regenerate in wolfSSL_PEM_write_bio_X509().
2022-12-06 06:35:13 -08:00
1f6a9d442b MemUse Entropy: enabled with HAVE_ENTROPY_MEMUSE
--enable-entropy-memuse enables the software base entropy gatherer.

The entropy source uses difference in timing to read/write cache lines.
Random indeces into a buffer are updated with the high resolution timer
value which is fed into a hash to produce further random indeces.

The current time is added to the entropy samples at time of
conditioning.
2022-12-06 14:01:16 +10:00
47b8caa0b7 Merge pull request #5849 from SparkiDev/sp_int_sp_ecc_fix
SP int: fix when ECC specific size code included
2022-12-05 17:15:04 -08:00
3891cd65d8 DRBG OK
When initializing the RNG and are using RDRAND, or one of the other
replacement random number generators that could fall back to the
Hash_DRBG if unavailable, set the status to DRBG_OK. This would fix a
problem if someone assumes the DRBG status is meaningful.
2022-12-05 16:09:45 -08:00
f1daa2d356 fix other name san parsing and add RID cert to test parsing 2022-12-05 15:51:33 -08:00
6db2ea0672 SP int: fix when ECC specific size code included
Was enabled when !SP and HAVE_ECC
Now enabled when !WOLFSSL_SP_MATH and HAVE_ECC
2022-12-06 09:44:05 +10:00
f38c7303eb Merge pull request #5853 from douzzer/20221205-sp-int-bugprone-macro-parentheses
20221205-sp-int-bugprone-macro-parentheses
2022-12-06 09:18:40 +10:00
595f8a30d6 wolfcrypt/src/sp_int.c: fix bugprone-macro-parentheses in ALLOC_SP_INT() and ALLOC_SP_INT_ARRAY() introduced in aeca8cb17a. 2022-12-05 15:21:17 -06:00
9d9549fbd3 Merge pull request #5836 from anhu/kyber_cleanup
Remove kyber-90s and route all kyber through wolfcrypt.
2022-12-05 13:18:44 -08:00
312b488582 Remove double free 2022-12-05 15:39:14 -05:00
d3441545ef Merge pull request #5852 from SparkiDev/sp_c_perf_2
SP C, SP int: improve performance
2022-12-05 11:51:28 -08:00
5dee15d074 Merge pull request #5850 from SparkiDev/sp_exptmod_nct_err_fix
SP int: fix check of err in _sp_exptmod_nct
2022-12-05 11:24:12 -08:00
304f287a7e Merge pull request #5828 from SparkiDev/sp_int_static_size
SP int: check size required when using sp_int on stack
2022-12-05 11:23:25 -08:00
65a5ea7cae Make sure certs are identical in tests. 2022-12-05 13:57:53 -05:00
22141faf16 SP C, SP int: improve performance
In SP C: Improve performance of large digit mul and sqr.
In SP int: include optimized 16 digit mul and sqr when compiling SAKKE.
2022-12-05 14:17:09 +10:00
4601a57ff2 SP int: fix check of err in _sp_exptmod_nct 2022-12-05 09:36:28 +10:00
87113cc88d Fix mingw-w64 build issues on windows. 2022-12-03 17:00:44 -06:00
b99f5e5041 Merge pull request #5847 from douzzer/20221203-sp-int-missing-const
20221203-sp-int-missing-const
2022-12-03 12:39:33 -08:00
cd1a61288b wolfcrypt/src/sp_int.c: in _sp_mont_red(), add missing const in SP_WORD_SIZE == 32 codepath. 2022-12-03 10:14:15 -06:00
ea2d79338c Merge pull request #5846 from douzzer/20221202-dtls-crypt-only-gating
20221202-dtls-crypt-only-gating
2022-12-03 07:21:55 -08:00
57a5c9701d Missed a free of der 2022-12-02 17:23:47 -05:00
42c37b6831 eliminate need for --enable-kyber 2022-12-02 17:16:41 -05:00
f58f3bd986 Don't regenerate in test_wolfSSL_PEM_write_bio_X509(). We don't have the private key. 2022-12-02 16:41:24 -05:00
c506812cf0 Improvement for some sniffer error messages 2022-12-02 13:27:29 -08:00
3ea8dd2f67 src/dtls.c: add WOLFCRYPT_ONLY gating. 2022-12-02 15:13:31 -06:00
dd89fe269e Fix logic in GetSnifferServer 2022-12-02 13:13:16 -08:00
ed69bb33a6 Async Sniffer: Fix for decryption after second handshake 2022-12-02 13:11:23 -08:00
efd194ea74 Merge pull request #5842 from SparkiDev/sp_int_clang_tidy
SP int: fixes for static analyser clang-tidy
2022-12-02 07:42:00 -08:00
3239ff5b0e SP int: fixes for static analyser clang-tidy
Const poison sp_int.c to allow static analysers to work better.
sp_prime_is_prime_ex() checks whether a->used is negative to avoid bad
behavior.
2022-12-02 13:57:32 +10:00
c079455d3e Merge pull request #5839 from SparkiDev/sp_int_pub_apis
SP int: fix which APIs are public available wiht WOLFSSL_SP_MATH
2022-12-01 19:33:11 -08:00
39716737c1 SP int: fix which APIs are public available wiht WOLFSSL_SP_MATH
Make sp_rshd not available when WOLFSSL_SP_MATH in header.
sp_rshd is not required by any wolfCrypt code.
Fix sp_rshd comment on #endif
Make sp_div publicly available in some WOLFSSL_SP_MATH builds.
Delare sp_div for some WOLFSSL_SP_MATH builds.
Fix test.c to compile with WOLFSL_SP_MATH and HAVE_VALGRIND.
2022-12-02 09:11:35 +10:00
5f410b47b7 Merge pull request #5829 from SparkiDev/sp_invmod_fixes
SP int: fix error checks when modulus even
2022-12-01 15:05:22 -08:00
c59d6c36e4 Merge pull request #5838 from douzzer/20221201-fix-kcapi
20221201-fix-kcapi
2022-12-02 08:24:14 +10:00
8fb92a283a Merge pull request #5716 from rizlik/dtls_cookie_stateless
dtls: allow for stateless client hello parsing
2022-12-01 13:47:33 -08:00
1c7826b199 wolfcrypt/src/port/kcapi/kcapi_aes.c: fix error checking on KCAPI wc_AesGcmEncrypt() and wc_AesGcmDecrypt(). 2022-12-01 12:54:57 -06:00
d1e6ce064f Merge pull request #5832 from JacobBarthelmeh/fuzzing
free signer if malloc cases fail
2022-12-01 10:35:15 -08:00
1e8ecd3d71 Merge pull request #5830 from SparkiDev/sp_int_no64bit
SP int: check NO_64BIT before speculative using long long
2022-12-01 11:10:33 -07:00
fc4b008912 dtls: fix heap hint in XFREE 2022-12-01 16:47:37 +00:00
abbba4815e tests: add tests for stateless dtls v1.2 cookie 2022-12-01 16:47:37 +00:00
af00c89f18 dtls v1.2: stateless support WOLFSSL_DTLS_NO_HVR_ON_RESUME 2022-12-01 16:30:54 +00:00
cc7dad3ee6 dtls v1.2: support stateless client hello processing 2022-12-01 16:30:54 +00:00
5bc86b8c2c fix: dtls: always use version DTLS 1.0 in HelloVerifyRequest
see rfc6347 section 4.2.1
2022-12-01 16:30:54 +00:00
4fa1b9dd0a fix: AddRecordHeader: use correct minor when using DTLS 2022-12-01 16:30:54 +00:00
aff01121a2 fix: dtls v1.2: reset window when invoking DtlsResetState 2022-12-01 16:30:54 +00:00
173208728a fix: tls13: hash using right version when downgrading 2022-12-01 16:30:54 +00:00
2c35d7f9d2 fix: formatting and typos
dtls: fix debug message when downgrading

internal.c: fix typo
2022-12-01 16:30:53 +00:00
1388e66059 Merge pull request #5706 from icing/ha-quic
Set of QUIC related changes for HAProxy integration.
2022-12-01 06:11:14 -08:00
e5cfd96609 QUIC API support in OpenSSL compat layer, as needed by HAProxy integration.
- adding patch for HAProxy, see dod/QUIC.md, based on current master.
      For documentaton purposes, since HAProxy does not accept PRs. To be
      removed once forwarded to the project.
2022-12-01 10:12:35 +01:00
aeca8cb17a SP int: check size required when using sp_int on stack
SP int can be configured to declare temporary sp_ints.
Check that the requested number of digits is not larger than the max
supported (SP_INT_DIGITS).
Also check arrays of sp_ints too.
2022-12-01 12:53:52 +10:00
2d88fd3b75 Merge pull request #5835 from lealem47/zd15262
Making CTC_MAX_CRLINFO_SZ a compile-time option
2022-11-30 17:35:11 -08:00
e83e0693b9 SP int: check NO_64BIT before speculative using long long
ULLONG_MAX is not defined for old versions of C compiler.
An unsigned long long type may still be available though.
Don't use unsigned long long for a 64-bit type when NO_64BIT is defined.
2022-12-01 10:25:13 +10:00
c6a7afee74 Merge pull request #5834 from anhu/http
Correction to a webpage link.
2022-11-30 15:14:35 -08:00
eba6a6d9f6 Making CTC_MAX_CRLINFO_SZ a compile-time option 2022-11-30 14:24:23 -08:00
a2fb4c0788 Remove kyber-90s and route all kyber through wolfcrypt. 2022-11-30 17:17:28 -05:00
3b00c9abee Correction to a webpage link. 2022-11-30 16:27:50 -05:00
01833a369e free signer if malloc cases fail 2022-11-30 10:02:33 -08:00
fec7469c19 Tidy up Espressif ESP32 test and benchmark examples (#5800)
Tidy up Espressif ESP32 test and benchmark examples:
* add VisualGDB project and solution files for server and client
* "hardware in use revert to software" is now verbose level message
* Remove (void) TAG;  - not needed to appease compiler
* include esp_log.h lib with defined(WOLFSSL_ESPIDF)
* large ESP32 default stack size
* check for max number of arguments assembled into array
* cleanup & comments per code review
* wolfssl_test VisualGDB updates
* Espressif wolfssl_test default stack 55,000 bytes
2022-11-30 10:01:46 -08:00
c7c80be15e SP int: sp_invmod_div check div result before proceeding 2022-11-30 18:33:35 +10:00
faf848a915 SP int: fix error checks when modulus even 2022-11-30 18:15:30 +10:00
973de0e954 Merge pull request #5831 from SparkiDev/sp_int_div_clear_fix
SP int: don't call sp_clear unless no longer using sp_int
2022-11-30 02:15:19 -06:00
61c2fd9a2b SP int: don't call sp_clear unless no longer using sp_int
Put in casts to be sure no compiler complains.
Tidy up other parts of the code.
2022-11-30 16:36:48 +10:00
24cc8e7145 Merge pull request #5827 from douzzer/20221129-ecb-benchmark-throughput
20221129-ecb-benchmark-throughput
2022-11-29 18:12:23 -08:00
63051f3826 Merge pull request #5825 from SparkiDev/api_test_sep
Unit test: rework to be able to run API tests individually
2022-11-29 18:11:57 -08:00
fed3f53969 Merge pull request #5826 from kaleb-himes/gcc-11-12-fixes
Initialize variable causing failures with gcc-11 and gcc-12
2022-11-30 10:40:17 +10:00
4bacc25e22 examples/benchmark/tls_bench.c: fix for clang-analyzer-deadcode.DeadStores in bench_tls(). 2022-11-29 17:09:05 -06:00
b2f9838af4 Fix DSA public decode to allow extra buffer (in case private key is passed in). Fixes for clang-tidy "value stored never read". Allow showing line number and conditional with DEBUG_WOLFSSL_VERBOSE on TEST_RES_CHECK. 2022-11-29 14:58:52 -08:00
4d2b893fb3 Initialize variable causing failures with gcc-11 and gcc-12 2022-11-29 14:59:53 -07:00
a9b28c1562 wolfcrypt/benchmark/benchmark.c: make iteration increment in bench_aesecb_internal() even lumpier (by a factor of 10) to further reduce false positives from iteration overhead. 2022-11-29 14:39:44 -06:00
7310eb102f Whitespace and line length cleanups. 2022-11-29 09:52:11 -08:00
e4e53ab7ca Unit test: rework to be able to run API tests individually
Change API test cases to return a result.
Test success is now TEST_SUCCESS (1).
Test result can be returned with use of macro TEST_RES_CHECK().
Always print the id, name of the test and the result (skipped or
otherwise) before and after running the test case.

Changed test case output to go to stderr.
Fixed some formatting.

Add option to take index and/or name of test case to run.
Added option to list all API tests.
Added option to only run API tests.
Added options to show usage.
2022-11-29 12:37:20 +10:00
7aa796bdbd Merge pull request #5824 from SparkiDev/pkcs11_init_rv
PKCS#11: add initialization API that returns PKCS#11 return value
2022-11-28 14:31:03 -08:00
3046899966 Merge pull request #5821 from anhu/ntru_saber_purge
Purge NTRU and SABER. Not going to be standardized.
2022-11-28 08:28:11 -08:00
7697337703 Merge pull request #5816 from SparkiDev/sp_int_rework
SP int: Comment and rework some code
2022-11-28 08:26:58 -08:00
0c2f713ca3 Merge pull request #5823 from SparkiDev/arm32-ldrd-fixes
ARM32 ASM: don't use ldrd on user data
2022-11-28 08:25:23 -08:00
7005d416ce SP int: Comment and rework some code
Improvements to sp_int.c that make it slightly quicker and documented.
2022-11-28 18:06:09 +10:00
2d424f7d06 PKCS#11: add initialization API that returns PKCS#11 return value 2022-11-28 16:40:29 +10:00
847c478c45 ARM32 ASM: don't use ldrd on user data
Alignment fixes.
Regeneration of ARM32 has config.h included.
2022-11-28 12:59:58 +10:00
7c576de914 Fixes from testing 2022-11-25 16:00:09 -05:00
0bfa5c9836 Purge NTRU and SABER. Not going to be standardized. 2022-11-25 14:54:08 -05:00
ee91f4415d Merge pull request #5819 from miyazakh/enable_sp_math_conf
must have SP enabled with SP math
2022-11-25 21:16:29 +10:00
3597034a42 must have SP enabled with SP math 2022-11-25 08:41:11 +09:00
ba3022c32a Merge pull request #5818 from anhu/remove_WOLFSSL_HAVE_KYBER
Remove some unnecessary guarding. Preventing build on STM32.
2022-11-25 08:00:31 +10:00
558343dd2b Merge pull request #5817 from douzzer/20221124-wc_GetCurrentIdx-prototype
20221124-wc_GetCurrentIdx-prototype
2022-11-25 07:58:26 +10:00
5e191b7218 Remove some unnecessary guarding. Preventing build on STM32. 2022-11-24 11:49:12 -05:00
466b625b5d wolfcrypt/src/logging.c: add missing void arg list to definition of wc_GetCurrentIdx(). 2022-11-24 09:32:58 -06:00
d0fb9a0b30 Merge pull request #5809 from tmael/sp_static_mem
Support static memory with sp-math
2022-11-24 12:42:42 +10:00
cf8ea5c606 Merge pull request #5812 from ejohnstown/crl-ocsp
OCSP/CRL
2022-11-24 12:42:17 +10:00
88f3570fe4 OCSP/CRL
Added comments for the usage of OCSP_WANT_READ used with the CRL I/O
callback.
2022-11-23 16:35:10 -08:00
0a38553909 Merge pull request #5798 from JacobBarthelmeh/python
account for 'pulled' error nodes
2022-11-23 14:57:03 -08:00
a482ab367a Merge pull request #5781 from anhu/maxq10xx
Support for Analog Devices MAXQ1080 and MAXQ1065
2022-11-23 13:31:22 -08:00
909fd726cd OCSP/CRL
Fixing issue #3070. When the OCSP responder returns an unknown exception,
continue through to checking the CRL. Before, it was setting the flag
to check CRL, then clearing it because of the exception.
2022-11-23 10:50:12 -08:00
f3546b50fd Conform to pre-existing pattern. 2022-11-23 17:58:12 +00:00
6190666108 Support for Analog Devices MAXQ1080 and MAXQ1065 2022-11-23 11:57:31 -05:00
54466b670a Merge pull request #5810 from Uriah-wolfSSL/haproxy-integration
Added required config option and return value for HaProxy
2022-11-23 10:01:17 +10:00
4c95f64b77 Check NO_BIG_INT with static memory 2022-11-22 15:32:34 -08:00
b6ae17804a update comments and check error case 2022-11-22 11:22:38 -07:00
d373c0856a Added required config option and return value for HaProxy 2022-11-22 10:42:05 -06:00
5c7127ff24 Support static memory with sp-math 2022-11-22 08:17:27 -08:00
50f19ec225 Merge pull request #5806 from embhorn/zd15177
Fix X509_get1_ocsp to set num of elements in stack
2022-11-22 12:00:08 +01:00
55718d214c Merge pull request #5801 from philljj/zd15172
Fix leak in wolfSSL_X509_NAME_ENTRY_get_object.
2022-11-22 15:11:18 +10:00
dee73887b8 Fix X509_get1_ocsp to set num of elements in stack 2022-11-21 08:25:46 -06:00
73ecd604bd Merge pull request #5803 from douzzer/20221120-enable-brainpool
20221120-enable-brainpool
2022-11-21 10:08:50 +10:00
0da2a0a524 configure.ac: add --enable-brainpool, default on unless disable-ecccustcurves, and use it to enable brainpool in enable-all and enable-all-crypto, subject to override. 2022-11-20 11:00:50 -06:00
ba8731dc69 Merge pull request #5802 from douzzer/20221118-minor-fixes
20221118-minor-fixes
2022-11-19 08:11:53 -08:00
2fa206dec0 wolfcrypt/src/siphash.c: fix bugprone-macro-parentheses, and in wc_SipHash(), fix clang-diagnostic-overlength-strings around inline asm. 2022-11-18 22:43:13 -06:00
6f98a5b271 src/internal.c: in VerifyServerSuite(), narrow condition and fix return value in error check added in 647ce794dd. 2022-11-18 22:21:08 -06:00
39ee267a31 configure.ac: mutually harmonize --enable-all and --enable-all-crypto: add enable-siphash to enable-all, and add Brainpool to enable-all-crypto. 2022-11-18 22:13:22 -06:00
9f36d9e530 Merge pull request #5799 from tim-weller-wolfssl/gh5754-mips64-abi32
Add check for 64-bit ABI on MIPS64 before declaring a 64-bit CPU
2022-11-18 13:19:39 -07:00
153ab82ad8 Fix leak in wolfSSL_X509_NAME_ENTRY_get_object. 2022-11-18 11:23:15 -06:00
f586183d1e Add check for 64-bit ABI on MIPS64 before declaring a 64-bit CPU 2022-11-18 07:12:04 -06:00
34f8fa797e Merge pull request #5695 from embhorn/gh5693
Fix --enable-devcrypto build error for sys without u_int8_t type
2022-11-17 16:01:35 -07:00
143dac64a3 account for 'pulled' error nodes 2022-11-17 14:51:37 -08:00
bd7b442df3 Merge pull request #5796 from tmael/mem_err
Propagate malloc returning NULL up the call stack
2022-11-16 12:45:42 -08:00
2a2cf5671e Move error check in CompareSuites 2022-11-16 09:29:24 -08:00
647ce794dd unmask malloc returning NULL 2022-11-16 09:25:25 -08:00
38b511f297 Merge pull request #5651 from haydenroche5/engine_pss_fips_v5
Add RSA PSS salt defines to engine builds if not FIPS v2.
2022-11-15 16:30:45 -07:00
7d046e0eb8 Merge pull request #5793 from philljj/zd15041
Support ASN1/DER CRLs in LoadCertByIssuer.
2022-11-15 14:05:10 -08:00
17105606b1 Cleanup format and typos, and use WOLFSSL_FILETYPE. 2022-11-15 11:45:11 -06:00
dc9f46a3be Fix --enable-devcrypto build error for sys without u_int8_t type 2022-11-11 15:40:12 -06:00
9036c098b0 Merge pull request #5760 from cconlon/se050
NXP SE050: feature expansion and fixes
2022-11-11 13:31:05 -08:00
81ed2a60b4 Support ASN1/DER CRLs in LoadCertByIssuer.
This fixes hash based dir lookup of ASN1/DER CRLs in OpenSSL
compatible API. The function wolfSSL_X509_load_crl_file is
called with entry->dir_type, rather than hardcoded filetype.

A new test crl was added, and existing crl 0fdb2da4.r0 was
reorganized to a new dir.

Also, completes the stub wolfSSL_X509_LOOKUP_add_dir. A new
test function test_X509_LOOKUP_add_dir was added to tests/api.c
2022-11-11 15:13:00 -06:00
cb7f73d0a3 Merge pull request #5792 from JacobBarthelmeh/Testing
allow for cpuid public functions with non-intel build
2022-11-11 12:28:06 -08:00
45bf793b5a SE050 expansion: add RSA support, allow for larger key IDs, get/set key ID from ecc_key/RsaKey, fixes for SE050 hashing, remove XREALLOC dependency, API to store/get binary object, API to erase object, test.c compatibility 2022-11-11 12:14:14 -07:00
9c569b950a Merge pull request #5791 from douzzer/20221110-wc_DhAgree_Sync-uninited-use
20221110-wc_DhAgree_Sync-uninited-use
2022-11-11 09:01:52 -08:00
c78b669b42 allow for cpuid public functions with non-intel build 2022-11-11 09:42:02 -07:00
3bfff3bfc5 wolfcrypt/src/dh.c: fix benign uses of uninited var in wc_DhAgree_Sync(), introduced in #5782 -- see oss-fuzz #53177. 2022-11-11 08:51:17 -06:00
7887576032 Merge pull request #5788 from dgarske/small_build
Fix for misc `HashObject` to be excluded for `WOLFCRYPT_ONLY`
2022-11-10 16:03:25 -07:00
f4621a6807 Merge pull request #5786 from philljj/zd15125
Fix incorrect self signed error return.
2022-11-10 14:13:38 -08:00
5ad6ff23d5 Use local int lastErr instead of args->lastErr. 2022-11-10 13:46:51 -06:00
77ffacf6d1 Fix for build error with SHA2-256 disabled. 2022-11-10 11:38:08 -08:00
95a3fea947 Merge pull request #5789 from dgarske/aesccm256
Added AES CCM 256-bit test
2022-11-10 10:54:00 -07:00
154378220d Merge pull request #5790 from per-allansson/xcode-project-fixes
Xcode project fixes
2022-11-10 10:46:31 -07:00
3b23a49a5f Merge pull request #5761 from tim-weller-wolfssl/zd15084-x509-crl-fail
Link newly created x509 store's certificate manager to self by default
2022-11-10 06:10:18 -08:00
0e4621a794 IDE/XCODE: include armv8-xxx in projects 2022-11-10 09:44:56 +01:00
364b2ddc8f IDE/XCODE: include dtls.c/dtls13.c/tls13.c/quic.c/kdf.c in projects 2022-11-10 09:44:01 +01:00
c573ba9864 Merge pull request #5758 from per-allansson/dtls13-fips
Allow DTLS 1.3 to compile when FIPS is enabled
2022-11-09 18:18:06 -08:00
90d37f9786 Add AES CCM 256-bit test. 2022-11-09 17:46:07 -08:00
5d2124e70d Merge pull request #5787 from dgarske/fixes_minor
Fix for `test_wolfSSL_sk_CIPHER_description` incorrectly failing
2022-11-10 09:22:08 +10:00
3bc3ec25b8 Add link of newly created x509 store's certificate manager to self by default 2022-11-09 17:17:30 -06:00
35ccd880ed Fix for misc HashObject to be excluded for WOLFCRYPT_ONLY. 2022-11-09 15:07:36 -08:00
922771bf05 Merge pull request #5785 from miyazakh/undef_gcc4p8
fix compile error due to Werro=undef on gcc-4.8
2022-11-10 08:05:56 +10:00
57ae840f39 Fix for test_wolfSSL_sk_CIPHER_description incorrectly failing with TLS v1.3 NULL cipher. 2022-11-09 12:05:16 -08:00
961c696436 Fix incorrect self signed error return.
ASN_SELF_SIGNED_E was being overwritten with ASN_NO_SIGNER_E when
compiled with certreq and certgen.
2022-11-09 10:27:31 -06:00
231a4098fa Merge pull request #5783 from SparkiDev/sp_small_p521_fix
SP P521 small HAVE_COMP_KEY: sp_521_mont_sqr_n*
2022-11-09 06:07:12 -08:00
454cd02627 fix compile error due to Werro=undef on gcc-4.8 2022-11-09 14:00:50 +09:00
1938b117c2 Merge pull request #5782 from SparkiDev/dh_sp_agree_0_1_fix
DH: fix when using SP
2022-11-08 22:41:08 -06:00
3e58c63647 SP P521 small HAVE_COMP_KEY: sp_521_mont_sqr_n*
Specific compress key code for P521 doesn't need a n square function.

Fixing generation of x86_64 ASM scripts resulted in adding carriage
return to chacha_asm.S.
2022-11-09 11:43:13 +10:00
2d757eadd0 DH: fix when using SP
The agreed secret must not be 0 or 1 by SP800-56A, 5.7.1.1.
Check done when not using SP.
Add check to SP calling code.
2022-11-09 09:55:16 +10:00
eac3b4e189 Merge pull request #5752 from julek-wolfssl/alt-name-str-type
Set alt name type to V_ASN1_IA5STRING
2022-11-08 15:42:39 -08:00
dfa997a6fd Merge pull request #5780 from douzzer/20221105-benchmark-determinism-fixes
20221105-benchmark-determinism-fixes
2022-11-09 08:44:08 +10:00
72a4a8a377 Merge pull request #5599 from embhorn/gh5580
Fix casts in evp.c and build issue in ParseCRL
2022-11-09 08:40:31 +10:00
48ba365fd6 fixes for defects:
clang-analyzer-deadcode.DeadStores in examples/server/server.c;

-Werror=use-after-free and LeakSanitizer Direct leak in tests/api.c;

nullPointerRedundantCheck in src/pk.c which identified a semantically consequential flub.
2022-11-08 14:04:16 -06:00
ca1ca24bc9 wolfcrypt/benchmark/benchmark.c: fix formatting (column alignment) in asym tests; fix typo in asym_pq section. 2022-11-08 12:31:04 -06:00
4b30f47e9b Fix casts in evp.c and build issue in ParseCRL 2022-11-08 10:59:18 -06:00
bd83345c02 Merge pull request #5773 from dgarske/async_v5.5.3
Fixes for various tests that do not properly handle `WC_PENDING_E`
2022-11-08 14:47:23 +10:00
3d228415f4 Merge pull request #5734 from dgarske/zd15017
Fixes for async sniffer handling of packets with multiple TLS messages
2022-11-08 14:46:40 +10:00
d42f8e0834 Merge pull request #5600 from embhorn/zd14858
Add reference to wc_AesInit in Gmac API doc
2022-11-07 17:44:35 -08:00
826dfd8a23 Merge pull request #5766 from SparkiDev/x509_subj_dir_attr_fix
ASN X509 subject directory attribute: fix ASN template parsing
2022-11-07 17:41:27 -08:00
44e66fd7c7 Merge pull request #5762 from SparkiDev/pkcs11_find_no_class_type
PKCS#11: compile time check in finding keys
2022-11-07 17:40:50 -08:00
9c645cf5ce Merge pull request #5747 from SparkiDev/pkcs11_nullptr_user_pin
PKCS#11: User PIN can be NULL_PTR
2022-11-07 17:40:38 -08:00
2e362a193e Merge pull request #5742 from SparkiDev/sp_int_64bit_type
SP int: guess 64-bit type
2022-11-07 17:40:14 -08:00
20913a4201 Fix for sniffer with async to not terminate processing until all pending items have been processed. 2022-11-07 15:45:50 -08:00
887b4bd9f0 Merge pull request #5767 from haydenroche5/load_system_root_certs
Improve logic for enabling system CA certs on Apple devices.
2022-11-07 15:15:13 -08:00
829fd71714 Merge pull request #5779 from dgarske/compat_heap
Fixes for compatibility layer building with heap hint and OSSL callbacks
2022-11-08 08:59:26 +10:00
6ca8336c52 Fix for asynchronous sniffer edge case for back to back sessions where new session was created while still pending. 2022-11-07 13:52:40 -08:00
0fc303e1fc Do not throw warning when disabling feature automatically. 2022-11-07 13:10:19 -08:00
d2fe30349a Merge pull request #5778 from kaleb-himes/fix-azsphere-nightly-test
Update azsphere support to prevent compilation of file included inline
2022-11-07 12:48:31 -08:00
583940ee30 Merge pull request #5776 from SparkiDev/sp_int_mingw64_fix
SP int: support mingw64 again
2022-11-07 11:39:12 -08:00
59774ae576 Fixes for building with use of heap hint and compatibility layer. Fix for invalid OSSL callback function errors. 2022-11-07 11:33:39 -08:00
b052ef46ba Add new setting per peer review feedback 2022-11-07 11:25:01 -07:00
0a97aa83b6 Update azsphere support to prevent compilation of file included inline 2022-11-07 10:36:24 -07:00
b845c8bfc8 SP int: support mingw64 again
Check for _MSC_VER to determine that we are compiling for MSVC.
2022-11-07 16:34:26 +10:00
1ee3a78e4a Fixes for various tests that do not properly handle WC_PENDING_E. 2022-11-04 14:56:40 -07:00
d0f33f62f4 Fix missing config.h include in some ARMv8 files. 2022-11-04 13:53:22 -07:00
d7cbd8cd17 Improve logic for enabling system CA certs on Apple devices.
In configure.ac and CMakeLists.txt, check for the header
Security/SecTrustSettings.h. If this header is found, enable the feature. If
it isn't, disable it. For non-configure/non-CMake builds, require the user to
explicitly define HAVE_SECURITY_SECTRUSTSETTINGS_H if they want to use system
CA certs (handled in settings.h).
2022-11-04 13:52:45 -07:00
5d70f3efce Merge pull request #5730 from philljj/zd15040 2022-11-04 13:32:48 -07:00
4a917219f7 Merge pull request #5608 from SparkiDev/pk_c_rework_2 2022-11-04 13:32:36 -07:00
1ce5951f0d Merge pull request #5722 from dgarske/stm32 2022-11-04 13:32:11 -07:00
7cc2336af7 Merge pull request #5737 from SparkiDev/ecc_cofactor 2022-11-04 13:31:24 -07:00
e3621d5bb1 Merge pull request #5771 from dgarske/revert-5622-sniffer_sequence 2022-11-04 13:25:48 -07:00
dce1fc4766 Merge pull request #5703 from miyazakh/renesas_rx72n_simple 2022-11-04 11:43:08 -06:00
5f4cf53d87 Merge pull request #5772 from JacobBarthelmeh/OCSP 2022-11-04 09:46:42 -07:00
8225d3642b save next status with OCSP response verify 2022-11-03 22:39:47 -07:00
cbbe6fec94 Merge pull request #5763 from douzzer/20221031-benchmark-determinism 2022-11-03 14:52:59 -07:00
f610df59a9 Whitespace cleanups. 2022-11-03 14:38:43 -07:00
fbc4af8701 Merge pull request #5739 from anhu/no_WOLFSSL_DYN_CERT 2022-11-03 14:24:34 -07:00
7414dd7ea5 Merge pull request #5768 from kareem-wolfssl/maxCertpolSz 2022-11-03 14:23:17 -07:00
48bddc6d07 Update max Cert Policy size based on RFC 5280. 2022-11-03 11:49:15 -07:00
b140abd1fd wolfcrypt/benchmark/benchmark.c: add check_for_excessive_stime() and remove double declaration of base_rusage and cur_rusage. 2022-11-03 13:48:51 -05:00
1adc06d181 Fix for Intel QAT handling of sign R when cofactor is not 1. ZD 15017 2022-11-03 10:00:07 -07:00
4766a978cf ECC cofactor: fix check scalar bits
For shared secrets, when a curve has a cofactor, the private key (in
range of order) is multiplied by the cofactor before use.

If there is a cofactor involved, check bit size of scalar against
modulus instead of order.
2022-11-03 10:00:07 -07:00
1ec2b14922 Revert "Fix for sniffer to decode out of order packets" 2022-11-03 09:50:15 -07:00
336bef666a ASN X509 subject directory attribute: fix ASN template parsing
Support multiple attributes.
When Country of Citizenship, pull out PRINTABLE_STRING explicitly.
Each type of attribute has a different format.
2022-11-03 09:24:59 +10:00
a7635da9e6 Merge pull request #5765 from JacobBarthelmeh/release
update for version 5.5.3
2022-11-02 15:46:10 -07:00
9b895b74bf update for version 5.5.3 2022-11-02 13:58:37 -07:00
ae22babf8b PKCS#11: compile time check in finding keys
When WC_PKCS11_FIND_WITH_ID_ONLY defined, don't add key class and
type to attributes of search for by Id.
2022-11-01 17:38:46 +10:00
4ab41caf40 make static flags sym_header_printed, asym_header_printed, and pqasym_header_printed, local to the routines that use them (fixes an -Wunused-variable in -UBENCH_ASYM builds). 2022-11-01 01:12:17 -05:00
89182b829f wolfcrypt/benchmark/benchmark.c: add GENERATE_MACHINE_PARSEABLE_REPORT and LINUX_RUSAGE_UTIME codepaths;
fflush stdout after each scenario for line-buffered pipelining;

refactor csv_header_count into sym_header_printed, asym_header_printed, and pqasym_header_printed;

move SAKKE tests to precede PQ tests;

rename bench_stats_sym_check() to bench_stats_check();

add bench_stats_asym_finish_ex() accepting a "desc_extra" arg, and use it to disambiguate otherwise-homonymous SAKKE runs;

fix bench_aesecb_internal() to not check time (syscall) for every 3 blocks processed.
2022-11-01 00:15:37 -05:00
502a395723 Merge pull request #5757 from SparkiDev/enc_err_forcezero_fix
ForceZero fix: encryption fail and not EtM
2022-10-31 11:43:48 -06:00
0a88bb9779 Allow DTLS 1.3 to compile when FIPS is enabled 2022-10-31 08:42:13 +01:00
4efba8f437 ForceZero fix: encryption fail and not EtM
Zeroizing of plaintext on encryption failure will use wrong size when
not using Encrypt-then-MAC. Size may go negative and cast to unsigned.
2022-10-31 09:14:16 +10:00
8bbbdfa3f9 Set alt name type to V_ASN1_IA5STRING 2022-10-28 19:58:01 +02:00
0158c82487 Keep WOLFSSL_DYN_CERT 2022-10-28 13:37:55 -04:00
0ea0b887a5 Merge pull request #5749 from JacobBarthelmeh/release
update version to 5.5.2
2022-10-28 09:22:50 -07:00
8fd5a4061c Merge pull request #5748 from SparkiDev/arm32_asm_lr_fixup
ARM32 ASM: fix asm saving and restoring of registers
2022-10-28 07:37:02 -06:00
eb52083afd update version to 5.5.2 2022-10-28 06:25:33 -07:00
c4e758dda5 Fix X509 subject and issuer name_hash mismatch
Fix logging message and g++ invalid conversion error.
2022-10-27 19:31:30 -05:00
7bd8ced7af ARM32 ASM: fix asm saving and restoring of registers
Fix push and pop generated at beginning and end of function.
2022-10-28 09:51:32 +10:00
4b648e7e08 PKCS#11: User PIN can be NULL_PTR
Allow TokenInit to store NULL for User Pin.
New APIs to handle not setting User PIN.
2022-10-28 08:52:18 +10:00
822f11d1a1 Fix X509 subject and issuer name_hash mismatch
Refactor duplicate code a bit more.
2022-10-27 15:15:55 -05:00
319901a85c Merge pull request #5743 from SparkiDev/tls_perf_fix_forcezero
TLS performance fix: ForceZero minimization
2022-10-27 13:43:17 -06:00
7366a9edbd Merge pull request #5744 from SparkiDev/regression_fixes_4
Regresssion testing fixes
2022-10-27 11:49:52 -06:00
e9d37b9bd1 addressed code review 2022-10-27 16:52:04 +09:00
fd7544ca19 Regresssion testing fixes
Ed25519 and Ed448 need to enable certs.

If no system CA certs can't be parsed,
wolfSSL_CTX_load_system_CA_certs() will fail. Don't try test if RSA and
ECC are not enabled.

Fix benchmark.c so that e is defined when WOLFSSL_BENCHMARK_ALL defined.

MAX_LENGTH_SZ is 4 and supports lengths up to 2^24 - one byte for length
and 3 bytes of length.
(new gcc compiler fix)
2022-10-27 17:47:48 +10:00
b1e37377a1 TLS performance fix: ForceZero minimization
Don't ForceZero the output buffer before free.
ForceZero it when encryption fails.

ShrinkInputBuffer needs to zeroize input buffer even if not currently
encrypting as it may be using the buffer on wolfSSL object reuse.

Fix SP to zeroize the whole buffer.

Fix DH to check cBuf when WOLFSSL_CHECK_MEM_ZERO defined.
2022-10-27 17:00:42 +10:00
1c09a67f6a Merge pull request #5735 from SparkiDev/aes_gcm_c_dec_auth
AES GCM decrypt C: don't decrypt when auth tag invalid
2022-10-26 22:41:25 -06:00
7a4657c881 Fixes from review 3 2022-10-27 11:25:27 +10:00
8519988d57 SP int: guess 64-bit type
When ULLONG_MAX not defined and long is the 32-bit type, speculatively
use long long as the 64-bit type.
2022-10-27 10:19:21 +10:00
294a26ba0c Merge pull request #5708 from JacobBarthelmeh/OCSP 2022-10-26 15:43:15 -07:00
fe28702891 Fixes for async sniffer handling of packets with multiple TLS messages. Other minor cleanups for spelling and CheckPreRecord SnifferSession deference. 2022-10-26 15:28:02 -07:00
e26d4f84fc Improvements for AES GCM on STM32. Cleanups for STM32 example. 2022-10-26 14:10:19 -07:00
8f2d35bb84 Merge pull request #5741 from douzzer/20221026-fixes-QUIC-and-ALPN
20221026-fixes-QUIC-and-ALPN
2022-10-26 15:03:28 -06:00
b477804462 Merge pull request #5725 from julek-wolfssl/rpm-pkg 2022-10-26 13:33:16 -07:00
b31567e752 Fix X509 subject and issuer name_hash mismatch
Refactor duplicate code, and better error messages.
2022-10-26 15:27:15 -05:00
d08c204466 remove extra memset 2022-10-26 12:54:17 -07:00
1608037c6b Merge pull request #5740 from JacobBarthelmeh/release
minor warning fixes
2022-10-26 14:09:01 -05:00
4d36d494b2 Merge pull request #5738 from SKlimaRA/SKlimaRA/fix-backslash-random-c
removed backslash
2022-10-26 12:42:49 -05:00
33617588fc fix setting dynamic flag with ocsp and asn template 2022-10-26 10:31:50 -07:00
8d6ee0b26a minor warning fixes 2022-10-26 10:48:51 -06:00
0c79ca1de1 Fix for STM32 PKA with coefSign for non 256-bit curves. Don't check point for STM PKA. ZD14928 2022-10-26 09:44:58 -07:00
dfa603e502 fixes for warnings and defects around QUIC and ALPN -- fixes for clang-diagnostic-gnu-zero-variadic-macro-arguments, clang-analyzer-deadcode.DeadStores, clang-analyzer-core.UndefinedBinaryOperatorResult, clang-analyzer-security.insecureAPI.strcpy, and an overrun prevention assert in wolfSSL_ALPN_GetPeerProtocol(). 2022-10-26 11:32:06 -05:00
a26b89f66b fix leak with multiple entries 2022-10-26 09:29:06 -07:00
9486721bb8 Prevent WOLFSSL_NO_MALLOC from breaking RSA certificate verfication 2022-10-26 12:11:55 -04:00
be07401856 Fix X509 subject and issuer name_hash mismatch
Use WOLFSSL_ERROR_MSG for errors, don't leak canonName, and better
error handling and comments.
2022-10-26 10:25:05 -05:00
6fa43a3d84 removed backslash 2022-10-26 15:03:31 +02:00
5db2d53d54 Fixes from review part 2 2022-10-26 16:04:05 +10:00
2d19f00dd5 Merge pull request #5736 from douzzer/20221025-fixes-wolfsentry-and-armv7a
20221025-fixes-wolfsentry-and-armv7a
2022-10-26 12:38:01 +10:00
e68c7bb74d Move file and BIO reading out to ssl_misc.c 2022-10-26 10:28:20 +10:00
e477571168 Fixes from review part 1 2022-10-26 10:28:20 +10:00
dad62fc182 pk.c: rework DH API and improve PEM read/write
Reorganized the DH APIs into groups.
Reworked all DH APIs.
Improved testing of DH API.

Implemented wolfSSL_PEM_read_RSAPublicKey() and
wolfSSL_PEM_write_RSA_PUBKEY().
Fix public key PEM write implementations to use the correct
header/footer names.
Added support for "RSA PUBLIC KEY" in header and footer in DerToPemEx().

Reworked PEM read/write APIs to be independent. No longer create an EVP
to use common function - common functionality refectored out.
Similarly file APIs don't create a BIO and call the partner APIs.

Improved testing of PEM read/write APIs.

Generic read BIO from memory BIO now returns the buffer instead of
allocating memory and reading.
No longer reading chunks when a file BIO.

Added wolfssl_make_rng() to create or get get global random. All RSA and
DH APIs now use this. DH_generate_parameters() creates a random object
and use global on error rather than just using global random.

Changed implementations to use BIO_new_fp() instead of create a new BIO
and setting file pointer.
2022-10-26 10:28:20 +10:00
8d8371ac5a Merge pull request #5717 from icing/sni-alpn-order
Changing ALPN selection to a deterministic point in the handshake.
2022-10-26 09:47:23 +10:00
0f9279ce52 Merge pull request #5684 from SparkiDev/ssl_sess_version_check
SSL session retrieval: check protocol version
2022-10-25 17:29:54 -06:00
55ab33a4a4 AES GCM decrypt C: don't decrypt when auth tag invalid 2022-10-26 09:25:28 +10:00
baa19c1092 tests/api.c: fix 3 clang-analyzer-deadcode.DeadStores. 2022-10-25 18:17:22 -05:00
29a5c04c2e add test case 2022-10-25 15:35:37 -07:00
7381846edb fix case of copying over status to existing struct 2022-10-25 15:33:17 -07:00
2575047ea2 wolfcrypt/src/port/arm/armv8-aes.c: define FIPS_NO_WRAPPERS, rather than undefine HAVE_FIPS, to fix FIPS builds. 2022-10-25 17:24:34 -05:00
e464d374c0 fix whitespace. 2022-10-25 17:24:34 -05:00
263123e7b4 wolfssl/test.h: add unsigned attribute to type of buffer passed to wolfsentry_config_json_feed() (sync with wolfsentry e22878b666). 2022-10-25 17:24:34 -05:00
084fabc733 Merge pull request #5731 from SparkiDev/armv7a_aes_fixup
AES-CBC decrypt ARMv8 no hw crypto: fixes
2022-10-25 17:23:45 -05:00
5c3b3e6ede Merge pull request #5733 from ejohnstown/assert-whitespace 2022-10-25 13:45:54 -07:00
e803e5916c Assert Consistency
1. Make whitespace in asserts consistent.
2. Added typecasting of the string inputs for AssertStr.
2022-10-25 11:42:51 -07:00
8b7668f771 Fix X509 subject and issuer name_hash mismatch
Fix api test and cleanup.
2022-10-25 13:00:22 -05:00
e7a121325b Merge pull request #5720 from julek-wolfssl/nid-defines 2022-10-25 10:34:59 -07:00
d052feeff2 Merge pull request #5675 from embhorn/zd14968
Fix coverity issues
2022-10-25 10:08:40 -07:00
2b72a50688 Merge pull request #5662 from Uriah-wolfSSL/haproxy-update-2.6.0 2022-10-25 07:47:54 -07:00
2ae815e2ee Use WOLFSSL_ERROR_MSG for error logs 2022-10-25 13:13:44 +02:00
55091c6464 Add small test 2022-10-25 13:13:14 +02:00
370b9f4d40 Merge pull request #5729 from JacobBarthelmeh/Benchmark
fix for define guards in benchmark app
2022-10-24 19:54:35 -07:00
e9a7c36c7b AES-CBC decrypt ARMv8 no hw crypto: fixes
Handle in and out buffer being the same.
2022-10-25 11:32:47 +10:00
9d1ed9c5d1 Merge pull request #5728 from douzzer/20221024-armv7a-enable-all
20221024-armv7a-enable-all
2022-10-25 11:28:31 +10:00
e3153f3997 Fix X509 subject and issuer name_hash mismatch 2022-10-24 18:09:44 -05:00
65d7d43497 use a check for if defined rather than value of macro 2022-10-24 16:32:19 -06:00
3677253b55 fixes and comments for buildability, warnings, and clarity, re WOLFSSL_ARMASM_NO_HW_CRYPTO, in configure.ac, wolfcrypt/src/port/arm/armv8-aes.c, and wolfcrypt/test/test.c. 2022-10-24 17:31:48 -05:00
eb4c3e06eb revert NO_MAIN_DRIVER behavior in benchmark app 2022-10-24 16:27:23 -06:00
19e30b081f Resolved sanitizer issue. 2022-10-24 16:27:18 -05:00
010fb64f74 Merge pull request #5718 from kareem-wolfssl/fpMaxBits 2022-10-24 12:27:59 -07:00
879f788bb9 Setting ssl->alpn_peer_requested_length to 0 when freeing ssl->alpn_peer_requested. 2022-10-24 10:27:16 +02:00
a1203917c5 Update after review by haydenroche5. 2022-10-24 10:17:29 +02:00
53bc10eb76 Merge pull request #5723 from Anthony-Tatowicz/ECC384-benchmark
Add SECP384 and SECP521 to bench
2022-10-22 11:03:26 -07:00
3aec9a15ce Merge pull request #5726 from ejohnstown/nucleus-thread
Nucleus Thread Types
2022-10-21 20:22:39 -07:00
1f82e90dbf Add SECP384 and SECP521 to bench 2022-10-21 18:50:59 -05:00
4859a00c2a Merge pull request #5698 from SparkiDev/aes_arm32_no_hw 2022-10-21 12:34:22 -07:00
a60a15d544 Merge pull request #5721 from philljj/zd15011 2022-10-21 12:32:03 -07:00
7c8dafab2f Nucleus Thread Types
Add a type block for Nucleus RTOS's thread types.
2022-10-21 11:40:59 -07:00
6aff27c5c8 Resolved valgrind issue. Updated ASN1_TIME usage per feedback.
Refactored wolfSSL_d2i_OCSP_CERTID per feedback.
2022-10-21 13:16:32 -05:00
e409acc0f7 cite RFC 5280 in DIST_POINT_NAME comment 2022-10-21 12:38:04 -05:00
378d475c5f Merge pull request #5724 from Anthony-Tatowicz/doc-fixes
Doc Example Typo Fix
2022-10-21 09:27:01 -07:00
3ddc766b38 rpmbuild: update with fixes
- Pass in the build configuration to the output rpm package
- Compiler test fails in %configure step in %prep due to missing linker script (injected by rpmbuild). Moving to %build section.
- .la files not wanted in rpm package and delete .la file after install step
- Compiler test fails due to missing linker script (injected by rpmbuild)
https://fedoraproject.org/wiki/Changes/RemoveLaFiles#Upgrade.2Fcompatibility_impact
- Conditional include sp_int.h
- FIPS header and hash update
2022-10-21 14:22:08 +02:00
92c7faafb7 Doc typo fix 2022-10-20 17:17:24 -05:00
1bde7b3d47 Merge pull request #5665 from SparkiDev/sp_msvc_x64_asm_fix 2022-10-20 15:09:29 -07:00
fdffdd241f Merge pull request #5711 from philljj/add_SSL_set1_host 2022-10-20 15:02:24 -07:00
bfe8b9b76c correct DIST_POINT_NAME type value 2022-10-20 15:10:36 -05:00
3591ce773c Merge pull request #5719 from ejohnstown/dh-test-key2 2022-10-20 10:29:26 -07:00
3339443260 Change NID_* from enum to #define 2022-10-20 17:07:32 +02:00
02d37f08fc Do not direclty return but goto exit label for cleanup of allocated resources in case ALPN selection or SNI callback fails. 2022-10-20 12:33:08 +02:00
057fdd30d3 Properly check the defined() combinations that make ALPN and SNI available for testing. 2022-10-20 09:21:36 +02:00
31222618b9 DH Test Keys
1. Add a flag to the DH test to indicate that the second key is initted.
2. Add a flag to the DH test to indicate that the RNG is initted.

Fixes an issue where the DH wolfCrypt test can crash or lock up when
the DH parameters file is missing. Localized to the test only.
2022-10-19 16:15:53 -07:00
5892655ab0 Don't override user-set FP_MAX_BITS when building FIPSv2. 2022-10-19 11:51:07 -07:00
86605c92ce Merge pull request #5714 from ejohnstown/inline-guard 2022-10-19 08:33:07 -07:00
f1cf96846a Changing ALPN selection to a deterministic point in the handshake. 2022-10-19 15:25:52 +02:00
90eefc2824 fix unit test when RSA disabled 2022-10-18 21:03:41 -05:00
930604f195 Merge pull request #5712 from haydenroche5/user_settings_asm
Make some improvements to user_settings_asm.h.
2022-10-18 17:10:39 -06:00
7399f72fb3 Merge pull request #5715 from douzzer/20221018-linux6v1-and-WOLFSSL_CALLBACKS-fixes
20221018-linux6v1-and-WOLFSSL_CALLBACKS-fixes
2022-10-18 15:30:05 -06:00
44eb6e447e Merge pull request #5713 from kaleb-himes/fix-fipsv2-win10 2022-10-18 13:02:59 -07:00
895a2e1ac5 WOLFSSL_CALLBACKS codepaths: fixes for bugprone-unused-return-value, bugprone-macro-parentheses, readability-named-parameter, and clang-analyzer-deadcode.DeadStores 2022-10-18 13:34:42 -05:00
c8c107a09e linuxkm/: fixes to deal with kernel 6.1+ show_free_areas() mess. 2022-10-18 13:34:24 -05:00
353a8a0275 Inline Function Guard
Fixed an inline function aes.c that was included, but never used. Added
similar preprocessor guard around it as when it is used.
2022-10-18 10:51:51 -07:00
c25e9d9994 FIPSv2 builds on win10 adjust for new fastmath default in settings.h 2022-10-18 10:50:01 -06:00
e3ced9f9ae Make some improvements to user_settings_asm.h.
For the CMake and autotools flows, enabling user_settings.h will define the
macro WOLFSSL_USER_SETTINGS_ASM. This will cause the generated
user_settings_asm.h to be included in the .S assembly files. If the user is
building without autotools or CMake, these files will include user_settings.h
directly, unless WOLFSSL_USER_SETTINGS_ASM is defined.
2022-10-18 09:20:06 -07:00
af518f8c86 adjust saving new OCSP cert 2022-10-18 08:33:13 -07:00
b7c4ddba72 Merge pull request #5663 from lealem47/scan_build 2022-10-18 08:10:33 -07:00
c5df62e647 Merge pull request #5705 from icing/earlydata-client 2022-10-18 07:26:46 -07:00
9726d1f6eb Allowing use of SSL/CTX_set_max_early_data() for client side.
- updating english doc and test cases
2022-10-18 10:40:18 +02:00
591101fd8b AES for ARM32 without using crypto hardware instructions
AES-ECB, AES-CBC, AES-CTR, AES-GCM, AES-CCM
Fix ldrd and strd to use even first first register and have
second register be next after first.
2022-10-18 08:31:53 +10:00
327b66d3ed Miscellaneous fixes from scan-build and KDF refactor & small build fixes 2022-10-17 14:34:08 -07:00
7e35919cc0 Add SSL_set1_host 2022-10-17 16:23:38 -05:00
a272731d45 Merge pull request #5707 from JacobBarthelmeh/Testing
free PKCS7 in test case
2022-10-17 11:21:48 -07:00
bc1c087701 free PKCS7 in test case 2022-10-17 08:24:38 -07:00
60aac9039d remove aesccm 2022-10-15 11:05:25 +09:00
60a8f6dff9 Add simple example working on Rx72n
Use T4-Tiny IP stack
2022-10-15 10:01:21 +09:00
f48b736ec3 Changed some WOLFSSL_ASN1_TIME handling and other fixes. 2022-10-14 17:09:35 -05:00
6f1db6c03a Merge pull request #5697 from cconlon/pkcs7SignedCertSet
PKCS#7: Fix SignedData verification when signer cert is not first in SET
2022-10-14 16:05:40 -06:00
2c503a5b34 Merge pull request #5682 from JacobBarthelmeh/Testing
additional sanity checks on debug callback
2022-10-14 09:25:14 -07:00
a1de8655da Merge pull request #5699 from SparkiDev/sp_cortexm_iccarm 2022-10-14 09:00:50 -07:00
b54eca4cfe Merge pull request #5700 from kaleb-himes/macOS-C++-proj-settings-rev2 2022-10-14 08:06:22 -07:00
6685ce7a10 Merge pull request #5702 from haydenroche5/ecc_nb_shared_secret_fix
Fix output length bug in SP non-blocking ECC shared secret gen.
2022-10-13 18:15:54 -07:00
40f1ba7e33 Fix output length bug in SP non-blocking ECC shared secret gen.
This was incorrectly being set to 32 for P-384/521 due to a bug in the SP gen
script.
2022-10-13 16:18:20 -07:00
6829c956b7 Merge pull request #5701 from dgarske/20221013_fixes 2022-10-13 14:59:41 -07:00
757549dd1b Merge pull request #5674 from rizlik/hrr_size_fix 2022-10-13 12:57:35 -07:00
843ea32dc7 Merge pull request #5694 from philljj/fix_enable-fastmath_disable-rsa_build 2022-10-13 12:49:25 -07:00
e2566bab21 Various build fixes:
* Fix api.c build error with `NO_FILESYSTEM` and `WOLFSSL_CERT_EXT`.
* Fix for building tests/suites.c with static memory (missing `LARGEST_MEM_BUCKET`).
* Always expose `wc_ecc_set_rng` for compatibility.
2022-10-13 12:49:06 -07:00
1b0171fe3e fix PKCS7 SignedData verification when signer cert is not first in SET 2022-10-13 11:03:13 -06:00
2fa2f8e88d fix: wrong size using DTLSv1.3 in RestartHandshakeHashWithCookie
HRR_MAX_HS_HEADER_SZ does not consider DTLS handshake extra fields.
2022-10-13 17:42:58 +02:00
656ad8959d Fix enable-fastmath with disable-rsa build.
Consistently guard WOLFSSL_MAX_RSA_BITS with both defines.
2022-10-13 10:10:10 -05:00
e47a213ea3 Fix settings following testing 2022-10-13 08:32:29 -04:00
47e3ffade6 SP Cortex-M: suport for ICCARM
Change ifdefs to use GNUC form for conditional branch for ICCARM.
2022-10-13 14:26:43 +10:00
4fa0deadda Merge pull request #5696 from ejohnstown/wc_only 2022-10-12 17:11:06 -07:00
b838d65a72 wincrypt.h requires windows.h, which isn't included in internal.h when WOLFCRYPT_ONLY set 2022-10-12 15:33:23 -07:00
dc8997d4b6 Added more APIs for HaProxy integration. 2022-10-12 15:45:09 -05:00
478b0cd4aa Added more APIs for HaProxy integration. 2022-10-12 15:27:31 -05:00
248952648d Fix enable-fastmath with disable-rsa build.
WOLFSSL_MAX_RSA_BITS was being checked against ENCRYPT_BASE_BITS
even though RSA is disabled.
2022-10-12 15:26:05 -05:00
3c7f01d853 Added WOLFSSL_ASN1_TIME to CRL 2022-10-12 15:10:29 -05:00
0f0496ae8f Added WOLFSSL_ASN1_TIME to CRL 2022-10-12 14:30:26 -05:00
5cbb099dc9 Updated per PR comments. 2022-10-12 14:06:57 -05:00
9117f8b51b Added more APIs for HaProxy integration. 2022-10-12 14:06:57 -05:00
b798c5f3a0 Added wolfSSL_X509_REVOKED_get_revocationDate() 2022-10-12 14:06:56 -05:00
72839d05f5 Merge pull request #5692 from douzzer/20221012-fix-file-modes-and-tweak-user_settings_asm.sh 2022-10-12 11:39:17 -07:00
46ecd909e9 Merge pull request #5691 from philljj/fix_lowresource_build 2022-10-12 09:35:48 -07:00
67c194edf8 scripts/user_settings_asm.sh: give priority to user_settings.h found via the supplied search path arguments, and fall back to current directory; use POSIX sh variable expansions for prefix trimming and variable existence testing; trim trailing slash from supplied search path arguments; direct error messages to stderr. 2022-10-12 11:20:56 -05:00
e05d044cf9 fix file modes. 2022-10-12 11:16:20 -05:00
06511a0f2e tiny fix for broken lowresource build option 2022-10-11 17:54:42 -05:00
927f4c445d additional sanity checks on debug callback 2022-10-11 13:14:59 -07:00
4d37e8d687 Merge pull request #5680 from embhorn/gh5679
Fix tirtos build
2022-10-11 11:31:41 -07:00
0a36091afd Merge pull request #5687 from danielinux/forcezero-fastmath
ForceZero enabled with USE_FAST_MATH
2022-10-11 11:23:05 -07:00
c9336865d0 ForceZero enabled with USE_FAST_MATH 2022-10-11 17:38:58 +02:00
3b33c962c4 Merge pull request #5660 from haydenroche5/load_system_root_certs
Add support for wolfSSL_CTX_load_system_CA_certs on Windows and Mac.
2022-10-11 08:38:57 -07:00
80b826b510 Merge pull request #5647 from kaleb-himes/macOS-C++-proj-settings 2022-10-11 08:00:52 -07:00
5f0d85adb5 Merge pull request #5666 from per-allansson/windows-wolfio-connect-timeout-bug 2022-10-11 07:42:46 -07:00
43809b5f97 SSL session retrieval: check protocol version
When looking up the session by ID on the server, check that the protocol
version of the SSL and session match on TLS 1.3 or not.
TLS 1.3 sessions don't work with TLS 1.2 handshakes and vice-versa.
2022-10-11 11:07:05 +10:00
b7f74962ad Merge pull request #5683 from douzzer/20221010-fixes-missing-field-initializers-etc
20221010-fixes-missing-field-initializers-etc
2022-10-10 16:29:27 -07:00
4d9aacbe87 Merge pull request #5678 from SparkiDev/curve448_32bit_fix
Curve448 32-bit C code: handle corner case
2022-10-10 16:28:43 -07:00
af4987628f wolfssl/test.h: fix bugprone-macro-parentheses. 2022-10-10 17:08:51 -05:00
1bca5d80a1 configure.ac: fix hard tab. 2022-10-10 16:51:19 -05:00
e48e406def CMakeLists.txt: add handling for WARNING_C_FLAGS in setup for CMAKE_C_FLAGS, to allow override warning config, e.g. without -Werror. 2022-10-10 16:48:49 -05:00
02863d2e81 configure.ac: when FIPS 140-3, disable AES-GCM streaming API, unless "dev". 2022-10-10 16:37:38 -05:00
6456b244d3 tests/api.c: refactor struct initializer using XMEMCPY() to mollify -Werror=missing-field-initializers in C++ builds. 2022-10-10 16:18:33 -05:00
ea5e814dfa Fix tirtos build 2022-10-10 11:36:40 -05:00
b1f97c6bc0 Merge pull request #5652 from rizlik/send_alert_on_version_mismatch 2022-10-10 11:16:11 +02:00
46091b7c7d Curve448 32-bit C code: handle corner case
For sqr and mul (28/32 bits) the sums of products can exceed maximum
64-bit signed value. Handle last sum value, that may cause overflow,
separately.
Fix formatting of overflow last line.
2022-10-10 11:33:46 +10:00
12bfa24ecc Merge pull request #5559 from tmael/crl_bs_p 2022-10-09 09:45:49 -07:00
47ccd924c2 Merge pull request #5657 from julek-wolfssl/dtls-1.2-stateless 2022-10-09 09:31:07 -07:00
018204f904 Merge pull request #5677 from kaleb-himes/small-stack-refactor-fix
Fix: test.c not printing out status of tests
2022-10-08 11:26:36 -07:00
65c872e910 Merge pull request #5670 from dgarske/smallstack_fixes2
Fix for Linux kernel module and stdio.h
2022-10-08 09:08:13 -06:00
7a265dcd2f Fix: test.c not printing out status of tests 2022-10-08 08:34:34 -06:00
b4e0137d37 Fix coverity issues 2022-10-07 14:49:05 -05:00
98ac4a6f9c Add ability to toggle system CA certs support. 2022-10-07 12:34:00 -07:00
5704c83f78 Unused param 2022-10-07 12:24:52 -07:00
e4da4f60d9 Implemented suggested changes 2022-10-07 11:24:09 -07:00
a738927846 Add CRL binary search, CRL_STATIC_REVOKED_LIST 2022-10-07 11:24:09 -07:00
82fbb7920a Merge pull request #5624 from julek-wolfssl/dtlscid-prb 2022-10-07 09:48:19 -07:00
b4e5ee3f6b Merge pull request #5672 from SparkiDev/kyber_inc_fix
Kyber: only include source when not FIPS
2022-10-07 08:39:54 -07:00
aaea77bce3 Merge pull request #5669 from JacobBarthelmeh/Docs
update changelog notes
2022-10-07 08:29:19 -05:00
b45ab0ae15 Add dtlscid.test to make check testing 2022-10-07 10:44:42 +02:00
5c85c8e128 Merge pull request #5658 from philljj/fix_wolfSSL_sk_X509_new 2022-10-06 17:18:03 -07:00
82bee5d6f1 Merge pull request #5671 from SparkiDev/aes_x86_asm_fix 2022-10-06 17:14:28 -07:00
b50a786cb2 Add support for wolfSSL_CTX_load_system_CA_certs on Windows and Mac.
Additionally, fix CMake build to add WOLFSSL_X86_64_BUILD when building for
x86_64.
2022-10-06 17:12:21 -07:00
be41af6527 Kyber: only include source when not FIPS 2022-10-07 08:33:05 +10:00
34a03f6646 AES-GCM x86: fix for AESNI implementation
Jump to non-inplace decrypt update when pointers are different.
2022-10-07 08:16:08 +10:00
bc78ecfa6c Fix for linuxkm and stdio.h. 2022-10-06 14:36:09 -07:00
af7c0e9b74 Merge pull request #5668 from dgarske/smallstack_fixes 2022-10-06 14:29:41 -07:00
e720d4ab3b update changelog notes 2022-10-06 14:31:25 -06:00
8ff6dc2a9a clean up wolfSSL_sk_X509_new 2022-10-06 14:13:30 -05:00
0eb4a7807b Fixes from small stack refactor (#5631). Resolves these multi-test errors:
```
wolfssl/wolfcrypt/mem_track.h:700:9: error: Memory leak: shim_args [memleak]
        return ret;
        ^

wolfssl/wolfssl/wolfcrypt/types.h:1248:17: error: unknown type name ‘pthread_t’
 1248 |         typedef pthread_t     THREAD_TYPE;
```
2022-10-06 11:32:27 -07:00
4962134ff5 Merge pull request #5667 from tim-weller-wolfssl/wolfssl-strongswan-update 2022-10-06 09:56:01 -07:00
7f42792616 DTLS 1.2: Test stateless server connection 2022-10-06 18:53:13 +02:00
d2f672db96 Merge pull request #5661 from kaleb-himes/aes_asm_FIPS_checkouts 2022-10-06 08:52:41 -07:00
474bc6ee1a Remove unused ASN1_GENERALIZEDTIME enum value (conflicts with strongSwan ASN enum and wolfSSL OpenSSL compatibility layer) 2022-10-06 09:23:56 -05:00
68dc01e7b7 fix bug with wolfIO_TcpConnect not working with timeout
- non-blocking connect() on Windows returns SOCKET_ERROR + WSAEWOULDBLOCK
- the check for fd against FD_SETSIZE is wrong (and not needed) on Windows
2022-10-06 14:14:33 +02:00
800830187b Fixes for SP and x86_64 with MSVC
Add inline implementations of assembly snippets for MSVC.
Missing multiplier when index memory address.
2022-10-06 15:35:50 +10:00
18b54f2ae7 Merge pull request #5664 from kaleb-himes/SGX_FIXUP 2022-10-05 15:18:55 -07:00
2bd3814953 fix failed Visual Studio Build Test 2022-10-05 15:08:08 -05:00
6178b3e365 Fixup builds using WOLFSSL_LOG_PRINTF (SGX test exposed) 2022-10-05 13:54:22 -06:00
ebb378096a test: DTLSv1.2: send alert when version negotiation fails 2022-10-05 20:29:23 +02:00
84748757b0 tests: refactor ticket-nonce-test callbacks to re-use code 2022-10-05 20:29:23 +02:00
a7a7a25ab0 ssl: move wolfSSL_GetSide outside ATOMIC_USER guard 2022-10-05 20:29:23 +02:00
de6187f599 tls: send protocol_version fatal alert on version mismatch
see rfc5246 Appendix E
2022-10-05 20:29:23 +02:00
1e2397aa5a Implement peer review feedback and enhance PAA settings 2022-10-05 10:52:12 -06:00
a2b48aac53 Update v5 checkout for sha256_asm and sha512_asm 2022-10-05 10:00:47 -06:00
df5fd87f0b Modify checkout of aes_asm.S (and .asm) given commit 6f4af15 2022-10-05 09:12:47 -06:00
cb5828235b Merge pull request #5653 from haydenroche5/load_system_root_certs
Add --sys-ca-certs option to example client.
2022-10-04 18:25:50 -07:00
6f4af1581b Merge pull request #5650 from SparkiDev/aes_x86_asm 2022-10-04 16:40:02 -07:00
c989dd9590 Merge pull request #5641 from haydenroche5/user_settings_asm
Generate an assembler-safe user_settings.h in configure.ac and CMakeLists.txt.
2022-10-05 07:51:56 +10:00
79d9bc376f Merge pull request #5631 from dgarske/smallstack 2022-10-04 14:39:17 -07:00
66ce7635b9 AES x86 ASM: new assembly
Added new x86 assembly for AES.
AES-CBC decrypt only 4 blocks at a time (not 6 or 8) due to reduces
register count.
GCM implementation for AVX2, AVX1 and AESNI only.
Disabled looking for other assembly files for x86.
2022-10-05 07:34:42 +10:00
984649eeac Correct wolfSSL_sk_X509_new in OpenSSL compatible API 2022-10-04 15:20:32 -05:00
0006d1f91c Fix benchmark with small stack and WOLFSSL_RSA_VERIFY_ONLY. 2022-10-04 08:39:42 -07:00
354cd2ed50 DTLS 1.2: Reset state when sending HelloVerifyRequest 2022-10-04 16:22:59 +02:00
3bcd4b45df Generate an assembler-safe user_settings.h in configure.ac and CMakeLists.txt.
For user_settings.h builds, .S assembly files need to include user_settings.h
in order to get the defines used by the build. However, a user_settings.h may
contain code only understood by a C compiler and not the assembler (e.g. a
typedef). This commit makes it so our autotools and CMake builds produce a file
user_settings_asm.h when doing a user_settings.h build. This generated header
contains only the preprocessor directives from the user_settings.h. As a result,
it can be safely included by our assembly code files.
2022-10-03 16:00:32 -07:00
58d482428e Merge pull request #5649 from philljj/zd14898 2022-10-03 14:00:45 -07:00
bfa13376fa Merge pull request #5642 from lealem47/WIN_snifftest 2022-10-03 13:49:06 -07:00
09f4a94b24 Fixes for small stack in TLS v1.3, HKDF and SHA2. Add new WC_ASN_HASH_SHA256 build option to allow forcing SHA2-256 for the internal certificate calculations. Fixes for integer.c with small stack (allocate only the size needed, not the max). 2022-10-03 12:52:11 -07:00
b91e48d770 Add snifftest vcxproj file and documentation 2022-10-03 10:22:53 -07:00
8101800cd9 Merge pull request #5656 from douzzer/20220930-wolfsentry-API-update
20220930-wolfsentry-API-update
2022-10-03 09:12:16 -07:00
898ddac159 Add --sys-ca-certs option to example client.
Using this option will call wolfSSL_CTX_load_system_CA_certs on the client ctx.
2022-10-03 09:05:23 -07:00
d0540adac2 wolfssl/test.h: update wolfSentry calls for API changes in wolfSentry-0.6.0. 2022-09-30 22:28:21 -05:00
db6ffae376 Merge pull request #5655 from lealem47/api_test_leak
Fix for EVP_PKEY_DH memory leak
2022-09-30 17:26:30 -07:00
e77c3849a0 Fix for evp key leak in unit tests 2022-09-30 16:02:07 -07:00
f9506dc05a Add small stack to DoClientHello Suites (360 bytes). Add small stack for DRBG health test. Refactor of the small stack into its own header, to allow easier use in other files. Minor build fixes. 2022-09-30 14:06:31 -07:00
f02fe73eb4 Correct default setting 2022-09-30 14:02:07 -06:00
6506c45918 Merge pull request #5654 from douzzer/20220930-fixes-smallstack-shellcheck-etc
20220930-fixes-smallstack-shellcheck-etc
2022-09-30 12:13:00 -07:00
acb35029a0 wolfssl/ssl.h: remove redundant prototype for wolfSSL_CTX_set_default_verify_paths(). 2022-09-30 12:06:31 -05:00
548d432df3 wolfcrypt/test/test.c: fix gating, and smallstack refactors, for ecc_test_deterministic_k(), ecc384_test_deterministic_k(), and ecc521_test_deterministic_k(). 2022-09-30 12:06:15 -05:00
ddad526e64 wolfcrypt/benchmark/benchmark.c: fix clang-tidy complaints around ungrouped string continuation and unparenthesized macro args. 2022-09-30 12:05:57 -05:00
e9520fe131 shellcheck-guided fixes in IDE/XilinxSDK/bench.sh, IDE/XilinxSDK/combine.sh, IDE/XilinxSDK/graph.sh, and scripts/bench/bench_functions.sh. 2022-09-30 12:05:40 -05:00
eccba1401f fix valgrind leak in new unit test 2022-09-30 11:24:54 -05:00
08009e73fc Add RSA PSS salt defines to engine builds if not FIPS v2.
WOLFSSL_PSS_LONG_SALT and WOLFSSL_PSS_SALT_LEN_DISCOVER are supported in our
latest FIPS module (v5). These should be defined for engine builds as long as
the FIPS version isn't v2.
2022-09-30 08:21:15 -07:00
5070994ae2 Merge pull request #5644 from tim-weller-wolfssl/crossworks-test-update 2022-09-30 08:00:01 -07:00
0f66c90b54 implement sk_X509_shift for zd 14898 2022-09-29 23:04:31 -05:00
8ae08d594e Add user_settings.h for Intel/M1 FIPSv2 macOS C++ projects 2022-09-29 16:06:08 -06:00
bba3193f9c Merge pull request #5595 from haydenroche5/async_ticket_dec_fix
Handle WC_PENDING_E from ticketEncCb in DoClientTicket properly.
2022-09-29 14:41:35 -07:00
591d1ada94 Merge pull request #5615 from JacobBarthelmeh/RSAPSS 2022-09-29 14:39:05 -07:00
5524500e85 Merge pull request #5166 from sjaeckel/versal-bringup
Versal bringup
2022-09-29 13:27:13 -07:00
26f01168b5 Merge pull request #5645 from rizlik/fix_bad_heap_hint
fix: tls13: fix wrong heap hint argument of XFREE
2022-09-29 13:06:31 -07:00
ab44c89ab4 Merge pull request #5626 from haydenroche5/load_system_root_certs
Add a function to load system CA certs into a WOLFSSL_CTX.
2022-09-29 11:03:26 -07:00
a5a9ab96e6 Merge pull request #5524 from rizlik/protocol_version_alerts
Dtls13: improvements
2022-09-29 10:59:06 -07:00
d0bf083050 Merge pull request #5643 from SparkiDev/gen_arm32_fixup
ARM32 assembly code: fixed scripts
2022-09-29 10:20:06 -07:00
e971bd7315 add FreeRTOS example to include.am 2022-09-29 09:57:23 -06:00
32eca32c97 fix: tls13: fix wrong heap hint argument of XFREE 2022-09-29 17:56:59 +02:00
0e57e9858f Integrate Xilinx Versal
* add Versal specific glue
   The same structure of an "XSecure client" is used throughout the API's,
   therefor define it once and re-use in all clients.
* integrate Versal AES-GCM engine
* integrate Versal SHA3-384 engine
* add versal support to tests
  - There's no intermediate-hash API for Versal.
* add specific test with large AAD
   Test only with `n*16 byte` wide chunks of AAD, so it gets processed in the
   hardware engine.
* add specific test with misaligned AES-GCM arguments
* integrate Versal RSA engine
* disable failing RSA test-case when Xilinx Crypto is enabled
* introduce define `WOLFSSL_XILINX_CRYPT_VERSAL`
* integrate Versal TRNG engine
* allow using Versal TRNG w/o wolfcrypt DRBG
   Versal TRNG already provides a HRNG mode which does the same as the
   wolfcrypt DRBG implementation.
* add support for user-supplied nonce to Versal TRNG
* add `wc_XsecureErrorToString()` to map PLM error codes to messages.
* integrate Versal EcDSA engine
* update tests to work with Versal EcDSA
   If deterministic K is enabled, the tests failed here since the Versal
   EcDSA engine doesn't support the SECP256R1 curve yet.
* Xilinx crypto engines like aligned memory very much
   Make this a default choice, not via the user configuration.
* add Xilinx-specific `WOLFSSL_MSG()` equivalent
   `WOLFSSL_XIL_MSG()` does the same as `WOLFSSL_MSG()` besides waiting for
   1 second before printing to stdout, since the PLM maybe prints to same and
   outputs would be mixed up.
   This waiting can be disabled by defining `WOLFSSL_XIL_MSG_NO_SLEEP`.
* add option to enable DPA CounterMeasures in AES-GCM crypto engine
* add "command mode" to Xilinx bare-metal example
* update Xilinx default user settings
* add script to execute benchmarks
* add scripts to create graphics
* add Vitis 2022.1 example projects

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
f24cf38f01 Update benchmarks
* add option to run benchmarks with and w/o AAD
   This adds the possibility to benchmark AES-GCM and AES-CCM both with and
   w/o AAD, with the option to also run both.
   The default behavior when wolfSSL provides the `main()` function is
   unchanged.
   The default behavior when wolfSSL doesn't provide the `main()` function has
   been changed to "run both benchmarks - with and w/o ADD".
* add option to run benchmarks against 4096bit RSA&DH keys
* remove `BENCH_SIZE` macro from benchmark.c
* pre-define benchmark sizes in a single place, before it had to be done in two places
* improve `benchmark_static_init()`
   - static variable doesn't need to be in global scope
   - add option to force re-init
   - add more static variables to be reset
* add `-blocks` option to benchmarks
* expose benchmark `main()` as `wolfcrypt_benchmark_main()`
* fix benchmark `-?` output
* use correct SI/Binary prefix in benchmarks
* use a separate column per detail in CSV output of benchmark
* add `-aad_size` option to benchmark
* don't always print symmetric CSV headers
* always use M[i]B/s when output format is CSV
* Versal specific patches for benchmarks
   This also removes the default define for `COUNTS_PER_SECOND` for Xilinx
   targets, since I prefer to have a build failure over wrongly calculated
   output.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
f4e258d196 Generic changes
* fix compilation warning
* adjust SHA3-384 test error-codes
   The way the codes were constructed before, they were not unique.
* unify code
   Instead of having `ifdef`'s in the code, define our own wrapper around
   the keysource as required.
* add CMake option for help-text in wolfCrypt tests
* expose test `main()` as `wolfcrypt_test_main()`
* Don't overwrite previously set errors
* add FreeRTOS support for Xilinx demo
* move `fp_reverse` from `tfm.c` to `wolfmath.c` and rename to
  `mp_reverse`.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
14b776c9a4 Adding C library support furnction to write a buffer (always to UART) 2022-09-29 10:34:16 -05:00
5a55ec6968 ARM32 assembly code: fixed scripts
Generation scripts fixed for ARM32.
Regenerated output inlcudes:
  - support for ARM32 architectures less than 7
  - SP code also ensures parameters are in specific registers
2022-09-29 09:04:05 +10:00
754d274d8c Merge pull request #5593 from rizlik/ticket_nonce_size
tls13: support ticketNonce with size bigger than MAX_TICKET_NONCE_SZ
2022-09-29 08:11:22 +10:00
cec6341e23 Merge pull request #5640 from kaleb-himes/ARMv8-FIPSv2-MOD-TEST
Do not perform IV Wrap test when using cert3389 inlined armasm
2022-09-29 08:01:54 +10:00
ae4228f928 tests: add WOLFSSL_TICKE_NONCE_MALLOC tests 2022-09-28 19:54:14 +02:00
c508ff3da9 internal.h: allow customization of MAX_TICKET_NONCE_STATIC_SZ 2022-09-28 19:54:14 +02:00
56d6087749 tls13: support ticketNonce bigger than MAX_TICKET_NONCE_SZ
to enable it, use WOLFSSL_TICKET_NONCE_MALLOC define
2022-09-28 19:54:14 +02:00
aa5d074d23 dtls13: abide g++ compiler errors
```
src/tls13.c:5330:72: error: invalid conversion from 'void*' to 'const byte*' {aka 'const unsigned char*'} [-fpermissive]
 5330 |             ret = wc_HmacUpdate(&cookieHmac, ssl->buffers.dtlsCtx.peer.sa,
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                                        |
      |                                                                        void*
./wolfssl/wolfcrypt/hmac.h:191:55: note:   initializing argument 2 of 'int wc_HmacUpdate(Hmac*, const byte*, word32)'
  191 | WOLFSSL_API int wc_HmacUpdate(Hmac* hmac, const byte* in, word32 sz);
```
2022-09-28 18:42:39 +02:00
d8e10d8ef4 DTLS 1.3: Always reset state on HRR 2022-09-28 18:42:39 +02:00
c72d315325 DTLS 1.3: Don't add HRR to ssl->dtls13Rtx
Signed-off-by: Marco Oliverio <marco@wolfssl.com>
2022-09-28 18:42:38 +02:00
145086f776 DTLS 1.3: Clear ssl->dtls13SendingAckOrRtx in ssl.c 2022-09-28 18:42:38 +02:00
3c60926bfa tests: silently dropping bad records after handshake in DTLS 2022-09-28 18:42:38 +02:00
6e4a3ecdbd tests: add negative version negotation tests 2022-09-28 18:42:38 +02:00
b3ecdd2ecb dtls13: support stateless cookie exchange on blocking socket 2022-09-28 18:42:38 +02:00
0b525a52c4 tls13: send protocol_version alert on failed version negotiation 2022-09-28 18:42:38 +02:00
88ec118e89 dtls13: drop unencrypted messages after epoch 1 2022-09-28 18:42:38 +02:00
400671dc7c dtls: drop non-handshake messages before cookie exchange 2022-09-28 18:42:38 +02:00
8cae05348c Add a function to load system CA certs into a WOLFSSL_CTX.
This new function, wolfSSL_CTX_load_system_CA_certs, currently only supports
Linux-based OS's. It searches through conventional CA directories and once it
finds one, attempts to load CA certs from it. After the first directory is
found, we don't check the others.

This commit also adds a function wolfSSL_get_system_CA_dirs, which returns a
pointer to an array of directories where wolfSSL_CTX_load_system_CA_certs will
look for CA certs. This is used in a unit test, where we only want to expect
success if one of these directories actually exists on the test system.

Finally, this commit adds support for SSL_CTX_set_default_verify_paths to the
compatibility layer. It doesn't model the exact behavior of its OpenSSL
counterpart; it's mostly a wrapper around wolfSSL_CTX_load_system_CA_certs,
manipulating the return value of that function to conform to OpenSSL's
conventions.
2022-09-28 08:50:46 -07:00
2d1f22c35a Merge pull request #5639 from Anthony-Tatowicz/master
Add Irq install for Aruix example
2022-09-28 06:55:56 -04:00
d61656d5e7 Do not perform IV Wrap test when using cert3389 inlined armasm 2022-09-27 17:15:19 -06:00
f1e2165c59 Merge pull request #5638 from JacobBarthelmeh/release 2022-09-27 14:21:19 -07:00
eb5076bb89 update changelog for release 5.5.1 2022-09-27 13:40:00 -06:00
ffe052e845 Merge pull request #5634 from douzzer/20220926-fixes
20220926-fixes
2022-09-27 11:49:20 -06:00
13d53b5297 Add Irq install for Aruix example 2022-09-27 12:04:27 -05:00
dde5ef558b Merge pull request #5633 from SparkiDev/sp_mod_fix
SP int all: sp_mod
2022-09-27 10:23:03 -06:00
cc03e3fdab wolfcrypt/src/misc.c ByteReverseWords(): mollify MSVC re C4311. 2022-09-27 10:05:07 -05:00
cfe0278d35 wolfcrypt/src/misc.c ByteReverseWords(): fix misaligned word accesses under armv7a-asm. 2022-09-27 02:02:31 -05:00
1ffe4275ae fix whitespace 2022-09-26 23:32:59 -05:00
34fd412fd6 SP int all: sp_mod
sp_mod wasn't checking return of sp_init_size.
Add _sp_init_size change and change calls.
2022-09-27 10:05:13 +10:00
8617de86c1 Merge pull request #5632 from JacobBarthelmeh/Testing
Misc. testing items
2022-09-27 08:25:18 +10:00
1e348eb7bd sanity check on return value 2022-09-26 10:40:41 -07:00
cc4e8df56d cast to fix warning in test case 2022-09-26 10:13:06 -07:00
9d9fa0132e Merge pull request #5622 from lealem47/sniffer_sequence
Fix for sniffer to decode out of order packets
2022-09-26 07:53:00 -07:00
b4077d80c9 Merge pull request #5620 from JacobBarthelmeh/Certs
fix for return value of x509 print
2022-09-25 19:32:52 -07:00
b1a69f6469 Merge pull request #5630 from dgarske/deos_cleanups
Support for DEOS RTEMS and minor build fixes
2022-09-26 09:06:49 +10:00
55a0f6d97b Support for RTEMS in the DEOS user_settings.h template and time. Fix for bio.c and OPENSSL_EXTRA which needs XATOI. Fix for SP math ECC with 384-bit and 521-bit curves enabled. 2022-09-25 10:41:05 -07:00
f80fb7f1aa Merge pull request #5625 from dgarske/esp32_cleanups
Fixes for various build configurations
2022-09-23 20:46:44 -05:00
221fd275fd Fixes for building without SHAKE. 2022-09-23 14:50:16 -07:00
2421727b1c Merge pull request #5441 from kareem-wolfssl/quietShutdown
Make wolfSSL quiet_shutdown functions available when using OPENSSL_EXTRA_X509_SMALL.
2022-09-23 14:40:29 -07:00
606f58a851 Spelling and whitespace cleanups. 2022-09-23 13:58:58 -07:00
b42631c721 Fix for ESP32 wolfcrypt_test entry point. 2022-09-23 13:58:49 -07:00
792eac9484 Fixes for building the API unit test without filesystem NO_FILESYSTEM. 2022-09-23 13:58:17 -07:00
7a69415e79 Fix for possible memory leak on failure in RSA/DH public key decode with heap based math. 2022-09-23 13:53:16 -07:00
c29e602ea5 Fix for building with WOLFSSL_ASN_TEMPLATE and IGNORE_NAME_CONSTRAINTS. 2022-09-23 13:52:55 -07:00
7970d5d794 Merge pull request #5152 from SparkiDev/armv7a_neon_asm
ARM ASM: ARMv7a with NEON instructions
2022-09-23 08:46:03 -07:00
62670d9263 Merge pull request #5619 from kaleb-himes/AZURE-fix2
Fix undesirable kyber dependencies when not building kyber (#2)
2022-09-22 19:55:50 -07:00
1b9656f72d ARM ASM: add fpu directive to assembly files 2022-09-23 12:31:39 +10:00
aa1a95e70b Merge pull request #5621 from tmael/sp_1024_sakke
Wrap 1024 single precision math with WOLFCRYPT_HAVE_SAKKE
2022-09-23 08:52:05 +10:00
a322e09150 Fix for sniffer to decode out of order packets 2022-09-22 15:12:51 -07:00
7805ffeee0 Fix enable-sp=1024 2022-09-22 14:03:40 -07:00
f113e92495 Merge pull request #5612 from kareem-wolfssl/base16Ending
Update Base16_Encode so the ending null terminator is optional.
2022-09-22 13:24:19 -07:00
938ab16907 Also address assembly file 2022-09-22 14:15:46 -06:00
39815a53fa fix for return value of x509 print 2022-09-22 14:09:50 -06:00
77676537f6 Fix undesirable kyber dependencies when not building kyber (#2) 2022-09-22 10:43:03 -06:00
7ca9e4f084 Merge pull request #5616 from julek-wolfssl/dtls13.test-proxy-path
dtls13.test: Allow setting UDP_PROXY_PATH in env
2022-09-22 09:15:32 -07:00
13555bebcd Merge pull request #5617 from kaleb-himes/FIX-AZURE-TEST
Fix undesirable kyber dependencies when not building kyber
2022-09-22 09:04:35 -07:00
f271bef7b5 Merge pull request #5618 from lealem47/dc
Fix for incorrect DN NID and confusion with DC
2022-09-21 15:00:25 -07:00
216d4afaad Merge pull request #5611 from tim-weller-wolfssl/zd14815-updates
Updates to remove build warnings and test/example code update to avoid memory leak
2022-09-21 14:33:37 -07:00
f177d9364a Fix for incorrect DN NID and confusion with DC 2022-09-21 13:11:12 -07:00
62766b0758 Updates to remove warnings and build issues found with IAR tools. Update test function / example to avoid memory leak. Update to pass error codes along rather than mask them at lower levels.
Make logic to avoid masking return error conditionally compiled based on STSAFE configuration

Update logic at second crypto-callback location to return error code rather than mask it
2022-09-21 14:16:49 -05:00
913bbc8f79 Merge pull request #5613 from kareem-wolfssl/staticEccFix
Fix bad casts in wc_EccPublicKeyDecode when using WOLFSSL_ECC_CURVE_STATIC with custom curves.
2022-09-21 11:38:06 -07:00
38d4df0c0f Merge pull request #5610 from kareem-wolfssl/v5Fips
Restore v5-dev/v5-ready configure options.
2022-09-21 12:56:27 -05:00
680182cab5 Merge pull request #5614 from rizlik/oobread
Fix: parsing oob read in dtls1.3
2022-09-21 10:08:32 -07:00
d672f10f7e Fix undesirable kyber dependencies when not building kyber 2022-09-21 09:58:38 -06:00
2bf583aa57 Merge pull request #5526 from miyazakh/qt_jenkins_fix
Fix qt nightly test failure
2022-09-21 09:38:45 -06:00
f9b2ef47c9 dtls13.test: Allow setting UDP_PROXY_PATH in env 2022-09-21 16:49:53 +02:00
dc0b2553fc handle certificates with RSA-PSS signature that have RSAk public keys 2022-09-21 08:24:09 -06:00
400d3c6963 dtls13: Dtls13ParseUnifiedRecordLayer: add overflow check 2022-09-21 16:01:35 +02:00
804081e7c2 fix: GetDtls13RecordHeader:requires correct minimum size 2022-09-21 16:01:35 +02:00
a36604079b Merge pull request #5609 from philljj/master
Fixes DTLS 1.3 client use-after-free error
2022-09-21 06:38:09 -07:00
1a983b4a8f session: use plain buffer to store ticket nonce in ticket 2022-09-21 14:51:07 +02:00
2578f2c8f2 ARMv8 32 Inline ASM: fixes
Force parameters to use specific registers.
Shift/rotate amount must have '#' prepended.
2022-09-21 10:45:50 +10:00
ca392fb200 ARM32 ASM Inline: fix SHA-256 inline asm to compile 2022-09-21 09:58:16 +10:00
c6bd297bd2 Fix bad casts in wc_EccPublicKeyDecode when using WOLFSSL_ECC_CURVE_STATIC with custom curves. 2022-09-20 15:37:12 -07:00
c146fcf581 Update Base16_Encode so the ending null terminator is optional. 2022-09-20 14:44:01 -07:00
76afcc1da4 Restore v5-dev/v5-ready configure options as customers are currently using them. 2022-09-20 14:26:15 -07:00
90c9363af8 Merge pull request #5538 from satoshiyamaguchi/trial5
Add wolfSSL_EVP_PKEY_new_CMAC_key to OpenSSL compatible API
2022-09-20 13:01:52 -07:00
427383233d Fix formatting, add check to not support plain HTTP requests in DTLS 2022-09-20 14:41:11 -05:00
624aca80dc Merge pull request #5606 from julek-wolfssl/zd14813-cont
0 len sz is allowed
2022-09-20 09:49:17 -07:00
8336dbf366 Fixes DTLS 1.3 client use-after-free error 2022-09-20 09:17:08 -05:00
c6ea68a118 Fix two not freed WOLFSSL_CMAC_CTX. 2022-09-20 23:10:22 +09:00
05b6cb5279 internal: drops bad DTLS records on established connection 2022-09-20 11:18:30 +02:00
655ac3e822 refactor: new define to remove some preprocessor directives 2022-09-20 11:18:26 +02:00
43715d1bb5 Merge pull request #5607 from haydenroche5/140_3_version_fixes
Clean up some FIPS versioning logic in configure.ac and WIN10 user_settings.h.
2022-09-19 20:48:25 -06:00
d212974d5e Clean up some FIPS versioning logic in configure.ac and WIN10 user_settings.h.
configure.ac: Get rid of v5-RC8, v5-RC9, v5-RC10, v5-RC11, v5-ready, and v5-dev.
v5-ready is now just ready and v5-dev just dev.
IDE/WIN10/user_settings.h: Make the FIPS blocks define HAVE_FIPS. Change WCv5.0
block to WCv5.0-RC12. Change FIPS Ready block to use HAVE_FIPS_VERSION_MINOR 3
instead of HAVE_FIPS_VERSION_MINOR 2.
2022-09-19 15:26:06 -07:00
73dbc873bd Merge pull request #5586 from julek-wolfssl/dtls-misc-security
Add missing minor security checks
2022-09-19 09:47:00 -07:00
cf3d9df443 Merge pull request #5605 from julek-wolfssl/gitignore
Add async and fips test folders to gitignore
2022-09-19 09:36:06 -07:00
0b81a584cc Merge pull request #5604 from SparkiDev/mp_init_size_fizes_2
SP int: mp_init_size fixes when SP_WORD_SIZE == 8
2022-09-19 06:50:26 -07:00
8ca4a6086e 0 len sz is allowed
In async mode, we always store all handshake messages before processing them. The server hello done message has a length of 0 but we still need to store it to process it.
2022-09-19 14:00:13 +02:00
9eac8bf5a9 Add async and fips test folders to gitignore 2022-09-19 11:42:45 +02:00
23e9cf2dc1 Test AEAD limits only without WOLFSSL_TLS13_IGNORE_AEAD_LIMITS 2022-09-19 10:30:29 +02:00
dd32f30306 Merge pull request #5601 from douzzer/20220917-fixes
20220917-fixes
2022-09-19 13:50:25 +10:00
e7dba670d6 SP int: mp_init_size fix for sp_mont_norm
sp_mont_norm should check wrong parameter when determining whether the
calculation values will fit.
2022-09-19 10:04:30 +10:00
02e51953fd SP int: mp_init_size fixes when SP_WORD_SIZE == 8
Setting an integer may have a value larger than one word being set.
Check size of SP int in this case.
2022-09-19 09:26:47 +10:00
e43a7843b6 Merge pull request #5603 from kaleb-himes/scripts-update
Address Issue pointed out in (now deleted) comment on an old merge
2022-09-19 09:06:39 +10:00
9a193a3e02 Address Issue pointed out in (now deleted) comment on an old merge 2022-09-18 08:45:18 -06:00
001592a8a3 fix qt nightly test 2022-09-18 13:56:55 +09:00
ac0d7f4d84 src/internal.c:
in DtlsMsgNew(), iff WOLFSSL_ASYNC_CRYPT, allow sz==0 allocation, to fix infinite loop in ProcessReplyEx() around DoDtlsHandShakeMsg();

in DtlsMsgAssembleCompleteMessage() restore fix from 0603031362 for pointerOutOfBounds (undefined behavior) construct;

in ProcessReplyEx(), in WOLFSSL_DTLS13 case ack, check and propagate error from DoDtls13Ack() (fix from @guidovranken).
2022-09-17 13:02:51 -05:00
0fc80f5f85 wolfcrypt/src/sp_int.c: catch and propagate errors from sp_init_size() in sp_invmod() and sp_gcd() to fix clang-analyzer-core.UndefinedBinaryOperatorResult. 2022-09-17 12:55:48 -05:00
02cc7bf82e fix whitespace/linelength/indentation. 2022-09-17 12:53:37 -05:00
64f2a0cafe Extend wolfSSL_EVP_PKEY_free for freing EVP_PKEY of CMAC.
Fix EVP_PKEY not freed in unit test (test_wolfSSL_EVP_PKEY_new_CMAC_key).
2022-09-17 14:44:45 +09:00
e6bd6a94a0 Merge pull request #5521 from TakayukiMatsuo/clientverify 2022-09-16 16:55:38 -06:00
7a728c0c48 Merge pull request #5569 from SparkiDev/kyber
Kyber: Add option to build Kyber API
2022-09-16 14:56:02 -06:00
fa30ab37b3 Add reference to wc_AesInit in Gmac API doc 2022-09-16 15:54:32 -05:00
c6f6086b15 Merge pull request #5576 from julek-wolfssl/dtls-windows
Fix build errors and warnings for MSVC with DTLS 1.3
2022-09-16 11:11:46 -06:00
b780ad6da0 Merge pull request #5594 from julek-wolfssl/zd14813
Do not allow 0 size DtlsMsg
2022-09-16 10:21:54 -06:00
43b16f67b9 Merge pull request #5596 from SparkiDev/mac_m1_arm_sha256_fix
Aarch64 SHA-256 Mac M1 fix
2022-09-16 09:13:23 -07:00
24d0112d2c Merge pull request #5581 from SparkiDev/sp_int_size_fix
SP int: mp_init_size() fix
2022-09-16 08:29:06 -07:00
a948c78ac7 addressed review comments. remove Qt case guard 2022-09-16 21:25:42 +09:00
9ef10b5435 Check return of DtlsMsgCreateFragBucket() 2022-09-16 12:13:12 +02:00
bf4be901e4 Add prototypes for w64wrapper functions 2022-09-16 11:28:29 +02:00
4b3718543e Aarch64 SHA-256 Mac M1 fix
Inline assembly is told K when finished is not important but K is
changing. Take a local copy of K and mark as a changing value.
2022-09-16 13:20:48 +10:00
7062ed0a2c ChaCha ARM 32-bit: get debug working
r7 is needed for debug.
Needed to use stack explicitly rather than let compiler use r7.
2022-09-16 11:29:30 +10:00
e52730d008 SP int: mp_init_size() and check size fixes
Check size passed to mp_init_size() 1..SP_INT_DIGITS.
More checks of parameters to SP int functions to ensure result is big
enough to hold value calculated.
2022-09-16 10:13:33 +10:00
a98cda3516 fix qsscertificate test failure 2022-09-16 07:48:05 +09:00
523c16130d Merge pull request #5579 from douzzer/20220911-fixes-re-multi-test
20220911-fixes-re-multi-test
2022-09-16 08:29:41 +10:00
d18a654f74 wolfcrypt/src/sp_int.c: address peer review around _sp_zero(), sp_init(), and sp_init_size(), re sp_int_minimal. 2022-09-15 14:33:45 -05:00
4591e5635b Handle WC_PENDING_E from ticketEncCb in DoClientTicket properly.
ticketEncCb can return WC_PENDING_E. If it does in DoClientTicket, we need to
propagate this up to the calling function (e.g. DoPreSharedKeys), rather than
treating it as a failure.

I tested this by running the following experiment

./examples/server/server -v 4 -r &
./examples/client/client -v 4 -r

and adding the following async simulation code to wc_ChaCha20Poly1305_Decrypt:

#ifdef WOLFSSL_ASYNC_CRYPT
    static int testAsync = 0;
    if ((testAsync++ % 2) == 0) {
        return WC_PENDING_E;
    }
#endif

Prior to these changes, you can see that the WC_PENDING_E will not be handled
properly in DoClientTicket (using gdb). A full TLS handshake proceeds from
there. With this commit, running the same experiment shows the pending error
being handled properly.
2022-09-15 11:35:51 -07:00
5d2610c96d wolfssl/wolfcrypt/sp_int.h and wolfcrypt/src/sp_int.c: add struct sp_int_minimal, with same structure as struct sp_int but only one digit, to allow error-free access to sp_ints allocated with ALLOC_SP_INT() with fewer than SP_INT_DIGITS digits, and use the new type in _sp_zero() and sp_init_size() to eliminate -Werror=array-bounds on _sp_zero() under gcc-13. 2022-09-15 13:16:27 -05:00
23b16c09d7 linuxkm/Makefile: add support for $KBUILD_EXTRA_FLAGS. 2022-09-15 13:16:27 -05:00
2a96d62e43 Merge pull request #5573 from embhorn/zd14802
Add WOLFSSL_ATECC_TFLXTLS for Atmel port
2022-09-15 08:59:40 -07:00
4b3f6ada8a Do not allow 0 size DtlsMsg 2022-09-15 16:18:24 +02:00
1941fb2b35 Keep a separate drop counter for each epoch 2022-09-15 15:49:05 +02:00
67473bac28 Code review fixes
- Mark old epochs as invalid so we don't attempt to decrypt with them
- Return a non-zero value if possible in unit tests
- Move Dtls13CheckAEADFailLimit to dtls13.c
- Reset state in processreply
2022-09-15 14:39:33 +02:00
63ba2f7b8f TLS 1.3: Check maximum records encrypted with one key set 2022-09-15 12:17:46 +02:00
4e9106c355 Enforce maximum amount of failed decryptions in DTLS 1.3 2022-09-15 12:17:46 +02:00
c7de58ebaf Add code to fallback to S/W if TSIP cannot handle 2022-09-15 11:16:37 +09:00
ad39e8f77d Kyber: fix OQS memory leak 2022-09-15 09:18:47 +10:00
37adf0ff06 Merge pull request #5592 from douzzer/20220914-fix-quic-test-default-build
20220914-fix-quic-test-default-build
2022-09-14 14:15:46 -06:00
f21b021bb6 Merge pull request #5590 from SparkiDev/tlsx_symbol_fix
TLSX: function not used
2022-09-14 09:10:56 -06:00
8b641df116 Merge pull request #5588 from SparkiDev/tls13_cs_fixes
TLSv1.3 cipher suites: fixes
2022-09-14 09:06:31 -06:00
eef67478e9 tests/quic.c: gate QuicConversation_fail() definition to avoid -Wunused-function. 2022-09-14 09:46:07 -05:00
17df33cef8 Fix TLS 1.3 testsuite for wolfssl64.sln solution 2022-09-14 11:39:27 +02:00
e8d5cf9662 TLSX: function not used 2022-09-14 09:52:26 +10:00
79d85f6c13 TLS cipher suite: improvements
wolfSSL_clear: check return from InitSSL_Suites() call.
TLS13: check ClientHello cipher suite length is even.
Silently remove duplicate cipher suites from user input.
Add tests of duplicate cipher suite removal.
2022-09-14 09:26:00 +10:00
3cafde2519 Merge pull request #5589 from SparkiDev/sp_mac_m1_asm
SP; Mac M1 failure fix
2022-09-13 16:35:57 -06:00
fa8c158f3c Merge pull request #5587 from tim-weller-wolfssl/dev-win-build-fips-update
Remove FIPS preprocessor defines from Windows build options
2022-09-13 13:47:51 -07:00
12ec2272d6 Merge pull request #5585 from icing/groups-key-share
wolfSSL_set1_curves_list(), wolfSSL_CTX_set1_curves_list() improvements.
2022-09-13 10:36:25 -06:00
1a0073b558 Add WOLFSSL_ATECC_TFLXTLS for Atmel port 2022-09-13 11:04:58 -05:00
7f2659bb9b add test-tls13-pq-2.conf to include.am 2022-09-13 10:51:07 -04:00
62c415fd50 Kyber: fixes
Don't define WOLFSSL_HAVE_KYBER unless configured.
Only compile code in ext_kyber.c when WOLFSSL_HAVE_KYBER defined.
Include config.h and settings in ext_kyber.c. This allowed
HAVE_VISIBILITY to be defined.
Cleanup kyber.h.
2022-09-13 10:07:28 -04:00
bcf4dbe697 Changes inspired by Feedback from Sean.
Define WOLFSSL_HAVE_KYBER when HAVE_LIBOQS is defined.
Fix some misleading debug output.
Fix benchmarking logic.
2022-09-13 10:07:28 -04:00
a2635be9e6 wolfCrypt support for external Kyber implementations (liboqs and pqm4) 2022-09-13 10:07:28 -04:00
8c1e2c52e7 Kyber: Add option to build Kyber API
wolfSSL Kyber implementation not included.
Added tests and benchmarking.
2022-09-13 10:07:27 -04:00
531f125925 Fix build without TLS13. 2022-09-13 11:18:27 +02:00
bebb686217 Fixes for different build scenarios:
- fix the type cast in SMALL_STACK builds
- only use new behviour when wolfSSL_set_groups() is available
2022-09-13 11:10:59 +02:00
112fc540bb Fix build errors and warnings for MSVC with DTLS 1.3 2022-09-13 10:13:44 +02:00
5e945f94b4 TLSv1.3 cipher suites: fixes
Handle multiple instances of the same cipher suite being in the server's
list.
Fix client order negotiation of cipher suite when doing pre-shared keys.
2022-09-13 17:25:11 +10:00
38418b31f1 Merge pull request #5197 from JacobBarthelmeh/OCSP
RSA-PSS with OCSP and add simple OCSP response der verify test case
2022-09-13 15:10:00 +10:00
99d60a0781 SP; Mac M1 failure fix
Give the compiler a hint that mask needs special attention.
2022-09-13 13:54:06 +10:00
e867f0d312 Merge pull request #5574 from haydenroche5/ecc_nb_tls
Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
2022-09-12 16:24:00 -06:00
ba12d72e7a Remove FIPS preprocessor defines from Windows build command-line options (values specified via user_settings.h) 2022-09-12 15:54:36 -05:00
2eee35ef8f Merge pull request #5582 from SparkiDev/small_stack_cache_fix
Small Stack Cache: make work again
2022-09-12 09:53:10 -06:00
ba5aeb3501 Merge pull request #5583 from SparkiDev/psk_only_tls_fix
PSK only TLS: fix ENCRYPT_LEN
2022-09-12 09:26:28 -06:00
be72549388 Merge pull request #5584 from SparkiDev/tls13_midbox_fix
TLS 1.3 Middle-Box compat: fix missing brace
2022-09-12 09:15:10 -06:00
c6c4134542 wolfSSL_set1_curves_list(), wolfSSL_CTX_set1_curves_list() improvements.
- Use wolfSSL API wolfSSL_set_groups() and wolfSSL_CTX_set_groups()
  to configure curves list
- This sets ssl->groups and ctx->groups accordingly and makes
  TLSX_KEY_SHARE generation respect the selection and precedence.
- Add tests in quic to assert the order of selections.
2022-09-12 14:31:58 +02:00
375b9c1a59 TLS 1.3 Middle-Box compat: fix missing brace 2022-09-12 13:11:49 +10:00
005f77180b PSK only TLS: fix ENCRYPT_LEN
Allow no PK algorithms and TLS to build and test.
Use PSK cipher suite with GCM if AES-CBC not available.
2022-09-12 11:21:01 +10:00
e0a47ca6c1 Small Stack Cache: make work again
Fix Small Stack Cache option so that it works with various options
including ALT_ECC_SIZE.
Allow ALT_ECC_SIZE when SP math all or SP math is compiled in.
2022-09-12 10:52:34 +10:00
2c4c7ba6da ARM v7a ASM: 128-bit registers not supported
Cortex-A5 - Cortex-A9 only support 64-bit wide NEON.
Remove use of WOLFSSL_ARM_ARCH_NO_VREV.
Use WOLFSSL_ARM_ARCH_NEON_64BIT to indicate to use 64-bit NEON registers
and not 128-bit NEON registers.
2022-09-12 10:00:18 +10:00
fa6bc79f8b Merge pull request #5578 from douzzer/20220909-fixes
20220909-fixes
2022-09-09 16:37:35 -06:00
460b6f1ecc Merge pull request #5577 from tmael/vx_entropy
Improves entropy with VxWorks
2022-09-09 15:51:24 -06:00
6c71777ca6 no verify on renewing ocsp response 2022-09-09 13:58:43 -07:00
0603031362 fix whitespace in wolfssl/wolfcrypt/settings.h;
fix bugprone-macro-parentheses in wolfssl/ssl.h;

fix pointerOutOfBounds and declaration-after-statement in src/internal.c DtlsMsgAssembleCompleteMessage().
2022-09-09 15:25:06 -05:00
82781043c4 Add entropy to VxWorks 2022-09-09 12:44:56 -07:00
757a18ab7e Merge pull request #5496 from SKlimaRA/SKlimaRA/SetCipherListBytes
Support for setting cipher list with bytes
2022-09-09 13:42:51 -06:00
23ba1e7e98 Minor cleanups. Gate these API's on OPENSSL_EXTRA or WOLFSSL_SET_CIPHER_BYTES to keep code size reduced. 2022-09-09 10:49:49 -07:00
6526ffc5f8 Merge pull request #5567 from haydenroche5/hmac_sha1_fix
Fix HMAC compat layer function for SHA-1.
2022-09-09 09:45:21 -06:00
3bd91c6ab8 wolfcrypt/src/pkcs7.c: revert 57a7430b6a, which broke SCEP use case, and redo using a simple stack variable initialization approach. 2022-09-09 10:09:14 -05:00
7418ddcae6 Refactor nofail tests into test_wolfSSL_client_server_nofail 2022-09-09 16:04:30 +02:00
0a1332c4df Additional checks for secure renegotiation 2022-09-09 15:33:27 +02:00
f7c31dbf64 Merge pull request #5575 from SparkiDev/sp_int_no_64
SP int: default to 16 bit word size when NO_64BIT defined
2022-09-08 18:30:30 -07:00
0db0032b31 ARM32 ASM: vrev not always available
Provide alternative assembly instructions to vrev when
WOLFSSL_ARM_ARCH_NO_VREV is defined.
2022-09-09 10:19:17 +10:00
3b8f3a0897 SP int: default to 16 bit word size when NO_64BIT defined 2022-09-09 08:33:30 +10:00
14a521ca25 Make --enable-asynccrypt-sw imply --enable-asynccrypt.
Simplifies configuration.
2022-09-08 15:23:22 -07:00
200ca9db4b Merge pull request #5572 from tim-weller-wolfssl/zd14615-config-updates
Configuration consistency fixes for RSA keys and way to force disable of private keys
2022-09-08 13:19:11 -06:00
226a8b676d Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
This requires the async code.
2022-09-08 11:34:59 -07:00
e49efbc101 Merge pull request #5544 from haydenroche5/async_sw
Migrate async names from "test" to "software."
2022-09-08 10:18:26 -07:00
f49d84e17a fix typo and pipe ocsp response creation to /dev/null 2022-09-08 09:02:31 -07:00
52653c654d Merge pull request #5571 from julek-wolfssl/sk-cmp-param-fix
Set correct types in wolfSSL_sk_*_new functions
2022-09-08 08:47:20 -07:00
7c153a49ec Merge pull request #5570 from SparkiDev/sp_noasm
SP: config option to force no asm
2022-09-08 07:49:24 -07:00
64376d4d9e Merge pull request #5555 from julek-wolfssl/dtls-fragment-buckets
Don't over-allocate memory for DTLS fragments
2022-09-08 07:46:04 -07:00
1b90d4fad2 Configuration consistency fixes and addition of new config option to disable private key
Add way to disable private keys in wolfcrypt (settings). Make RSA integer usage match structure configuration.
2022-09-08 09:36:18 -05:00
28af88788a Set correct types in wolfSSL_sk_*_new functions
- Use WOLF_SK_COMPARE_CB() to generate the correct types instead of using void* for the callback parameters.
- Remove WOLFSSL_STACK.comp entirely since it is not used anywhere. Ignore input parameters that used to set this member.
2022-09-08 11:55:32 +02:00
81321fc10e SP: config option to force no asm
Added to configure.ac the option to specify SP to be built with ASM as
x64 defaults to with asm.
2022-09-08 16:20:15 +10:00
4deae6dcc6 Remove duplicate defines for EVP_get_cipherbyname and EVP_get_digestbyname. 2022-09-07 16:32:25 -07:00
9d6e157fc5 add asn template version 2022-09-07 16:15:19 -07:00
4066568315 Merge pull request #5564 from douzzer/20220907-fixes
20220907-fixes
2022-09-07 16:03:37 -07:00
5dc1732036 Fix define name
WOLFSSL_ARMASM_NO_CRYPTO -> WOLFSSL_ARMASM_NO_HW_CRYPTO
2022-09-08 08:39:00 +10:00
18450eb94b Fix HMAC compat layer function for SHA-1.
This function would only accept the string "SHA" for SHA-1-based HMAC, but it
should also accept "SHA1." This is similar to how wolfSSL_EVP_get_digestbyname
allows both "SHA" and "SHA1." We didn't have a test for this in api.c. I added
one, and it failed before my fix here.
2022-09-07 15:25:31 -07:00
d1ffe30f13 Merge pull request #5566 from kaleb-himes/OE40-45-support
Proposed changes based on customer report(s) under consideration by t…
2022-09-07 13:45:06 -07:00
ac1a0293e2 Merge pull request #5565 from tmael/workbench_doc
Improve Workbench docs
2022-09-07 13:41:37 -07:00
ef7377d64c fix whitespace and line length. 2022-09-07 15:30:32 -05:00
57a7430b6a wolfcrypt/src/pkcs7.c: in wc_PKCS7_DecryptKtri(), refactor handling of OAEP keys to fix uninited value access detected by clang-analyzer-core.UndefinedBinaryOperatorResult; fix whitespace. 2022-09-07 15:14:26 -05:00
28a82237d9 RSA-PSS signed OCSP responses 2022-09-07 13:12:43 -07:00
9c88d8ac2c Merge pull request #5547 from JacobBarthelmeh/mcux
Port to RT685 with FreeRTOS
2022-09-07 12:54:54 -07:00
b2a80cbe65 Disable warning for MSVC 2022-09-07 12:05:29 -07:00
3ac985c2f1 Proposed changes based on customer report(s) under consideration by the team 2022-09-07 11:34:27 -06:00
0f0aae72c2 Improve Workbench docs 2022-09-07 09:58:23 -07:00
22bad7b06b fix spelling 2022-09-07 09:57:34 -06:00
d75bb2de62 Merge pull request #5561 from SparkiDev/sp_math_openssl_fix
SP math: fix build configuration with opensslall
2022-09-07 07:12:13 -07:00
bc1fca8c85 Merge pull request #5562 from SparkiDev/sp_int_521_fix
SP int: fix for SP_INT_DIGITS calc
2022-09-07 07:12:01 -07:00
1d2cd7af0f Expose API for src/api.c 2022-09-07 13:04:33 +02:00
28895ed0cd Use a union and struct for padding in DtlsFragBucket
Zero length arrays are not allowed so `byte padding[0]` is not a valid member. Changed to use a union and struct instead.
2022-09-07 13:04:26 +02:00
8bf3e0829e Don't over-allocate memory for DTLS fragments
Don't reserve the full message length of memory. Instead we only allocate memory for the fragments that we have already received. We also dynamically combine memory fragments when we receive overlap.
2022-09-07 13:04:06 +02:00
1fe9f2d894 SP int: fix for SP_INT_DIGITS calc
Implementation of sp_mont_red needs words * 2 + 1.
2022-09-07 17:22:22 +10:00
05634e286d SP math: fix build configuration with opensslall
./configure '--disable-shared' '--enable-keygen' '--enable-certgen'
'--enable-certreq' '--enable-certext' '--enable-ocsp' '--enable-crl'
'--enable-pwdbased' '--enable-opensslall' '--enable-pkcs7'
'--enable-pkcs12' '--enable-sp' '--enable-sp-math' '--disable-rsa'
'--disable-dh' '--enable-ecc'
2022-09-07 15:42:33 +10:00
12680a967a Merge pull request #5560 from douzzer/20220906-fixes
20220906-fixes
2022-09-06 17:56:33 -07:00
7d67ffac69 Fixup assembly to compile with ARMv7a 2022-09-07 09:30:06 +10:00
805b0eb606 ARM ASM: ARMv7a with NEON instructions
Change to build assembly code for ARMv7a with NEON instruction set.
./configure -host=armv7a --enable-armasm
Added ARM32 SHA-256 NEON only implementation.
2022-09-07 09:29:56 +10:00
602116c3f2 Merge pull request #5558 from embhorn/zd14776
Fix warning in DecodeAltNames
2022-09-06 16:00:02 -07:00
761fde31ad Merge pull request #5478 from miyazakh/rsaesoaep 2022-09-06 15:45:40 -06:00
bf29d6b2c7 wolfcrypt/test/test.c: refactor shake256_absorb_test() and shake256_test() to use a single buffer for "large_input", malloc()ed when WOLFSSL_SMALL_STACK, to stay within stack limits of all-max-func-stack-2k; move a couple declarations in openssl_test() to resolve declaration-after-statement. 2022-09-06 13:28:57 -05:00
14082ceeb9 CMakeLists.txt: add SHAKE128 coverage. 2022-09-06 13:28:45 -05:00
d72b401e8e Merge pull request #5545 from icing/evp_chacha
Add ChaCha20 as available cipher in the EVP API.
2022-09-06 10:42:54 -07:00
dcf215d52c Fix warning in DecodeAltNames 2022-09-06 11:33:30 -05:00
e2de8f3b6c Merge pull request #5554 from rizlik/dtls_cid_fix
fix: dtls13: do not negotiate ConnectionID in HelloRetryRequest
2022-09-06 09:28:25 -07:00
7b0128f9ac Merge pull request #5541 from SparkiDev/ecc_sign_k_nondyn
ECC sign_k: don't have it dynamically allocated
2022-09-06 07:52:45 -07:00
1a3c34ea99 Merge pull request #5557 from SparkiDev/sp_rsa_max_fix
RSA max and SP_INT_BITS: disabled RSA fix
2022-09-06 07:52:18 -07:00
a33368f314 Merge pull request #5516 from embhorn/zd14732 2022-09-06 13:51:58 +02:00
5927c4063a Removing FIXME comments after the fixing has been done. doh. 2022-09-06 10:06:02 +02:00
9b319b3782 Remove dependency on POLY1305 on testing CHACHA20 only. 2022-09-06 10:06:02 +02:00
9f47999002 Add ChaCha20 as available cipher in the EVP API.
- wire the wc_ChaCha_* implementation into the EVP API
  as `wolfSSL_EVP_chacha20`
- follow IV conversions of OpenSSL
- add test case
- have QUIC support use this for header protection when
  CHACHA20_POLY1305 has been negotiated in the handshake.
2022-09-06 10:06:02 +02:00
4b12d2f4ec RSA max and SP_INT_BITS: disabled RSA fix
Checking WOLFSSL_MAX_RSA_BITS against SP_INT_BITS even though RSA is
disabled.

/configure --disable-shared --enable-sp --enable-sp-math --disable-rsa
--disable-dh --enable-ecc
2022-09-06 17:15:22 +10:00
483d7189c7 Merge pull request #5512 from SparkiDev/tls13_64bit_milli
Make time in milliseconds 64-bits
2022-09-05 16:19:03 -07:00
31b8edd192 Merge pull request #5552 from SparkiDev/ed_make_key_fixes
Ed make public key wasn't checking whether private key set
2022-09-05 16:13:41 -07:00
e7dbb5b375 Merge pull request #5548 from dgarske/whitespace
Whitespace cleanup
2022-09-06 07:54:29 +10:00
aee81764f2 fix: dtls13: do not negotiate ConnectionID in HelloRetryRequest 2022-09-05 17:00:09 +02:00
38781bd7cf added testing for wolfSSL_set_cipher_list_bytes() 2022-09-05 16:57:07 +02:00
e76361d544 Merge pull request #5551 from SparkiDev/sha3_asm_fix
SHA-3: check BMI1 availablity for ASM
2022-09-05 05:03:52 -06:00
f153e65102 SHA-3: check BMI1 availablity for ASM
Added benchmarking of SHAKE128 and SHAK256.
2022-09-05 14:11:02 +10:00
f807c70637 Ed make public key wasn't checking whether private key set
Ed25519 and Ed448 make public key APIs now check whether the private key
was set.
The private key and public key flags setting and clearing also updated.
Testing of unset private key and calling make public key added for
Ed25519 and Ed448.
2022-09-05 12:21:51 +10:00
49065373aa Merge branch 'fix_sha256_debug' of github.com:gojimmypi/wolfssl 2022-09-04 19:26:38 -06:00
4ac113d135 ECDSA sign_k allocated when not WOLFSSL_NO_MALLOC
Fix up other WOLFSSL_NO_MALLOC issues.
2022-09-05 10:56:17 +10:00
b95df7529c Improve usage of 64-bit implementation of TimeNowInMilli
Change to use 64-bits for types stored - use WOLFSSL_32BIT_MILLI_TIME if
a 64-bit type is not available.
TimeNowInMill() returns 0 on error instead of GETTIME_ERROR.
2022-09-05 10:47:25 +10:00
69ed2b56d4 Replace a variable of AES-128 key size to the constant AES_128_KEY_SIZE 2022-09-04 13:31:24 +09:00
b52d193ee3 Fix an implicit type conversion 2022-09-03 23:56:54 +09:00
aa036b6ea4 Merge pull request #5532 from anhu/sphincs
Add sphincs to wolfCrypt.
2022-09-02 11:56:11 -07:00
232a750cc2 Whitespace cleanup. 2022-09-02 09:54:17 -07:00
4a8a11315b Merge pull request #5536 from SparkiDev/sha3_x64
SHA-3 improvements
2022-09-02 09:46:14 -07:00
8ca63b93a4 Merge pull request #5539 from dgarske/ocsp_async
Fix for async with OCSP non-blocking in `ProcessPeerCerts`
2022-09-02 10:42:09 -06:00
11bb8b3dc4 Merge pull request #5543 from SparkiDev/rsa_max_size_fix
RSA max key size checks
2022-09-02 09:26:19 -07:00
10ce703d71 Add sphincs to wolfCrypt.
Note that we will not support sphincs in TLS so nothing above wolfcrypt changes.
2022-09-02 11:53:55 -04:00
daadd4a1b7 Merge pull request #5540 from dgarske/socksz
Fixes for building with 32-bit and socket size sign/unsigned mismatch
2022-09-02 16:33:41 +10:00
959386422e Migrate async names from "test" to "software."
See async PR 52.
2022-09-01 17:53:18 -07:00
3bf6baf596 RSA max key size checks
Detect when certificate's RSA public key size is too big and fail on
loading of certificate.
Fix unit test to only attempt to use 3072 bit RSA-PSS keys when
RSA_MAX_SIZE supports it.
2022-09-02 10:37:12 +10:00
cef590131a ECC sign_k: don't have it dynamically allocated 2022-09-02 09:18:42 +10:00
23fd6456c2 Merge pull request #5534 from dgarske/zd14420
Fix for async session tickets
2022-09-02 08:50:35 +10:00
ef451d316c Make time in milliseconds 64-bits
Allow for longer session ticket lives.
2022-09-02 08:45:07 +10:00
f530101ef1 Fix for async with OCSP non-blocking in ProcessPeerCerts. ZD 14754. 2022-09-01 14:39:52 -07:00
65ca72c5a2 Improve EVP support for CHACHA20_POLY1305 (#5527)
* Add test case for OpenSSLs capability to init a evp context partially in several calls.
* EVP handling of CHACHA20_POLY1305 improvment
- save key at ctx for Init()s without IV
- reuse stored key for Init()s with new IV, reusing ctx
- free and zero key on ctx clenaup
* Adding type cast to XMALLOC to force compiler compatibility.
* EVP: using same DYNAMIC_TYPE in alloc and free of chacha20_poly1305 key.
Co-authored-by: Stefan Eissing <stefan.eissing@greenbytes.de>
2022-09-01 13:23:42 -07:00
2695f36642 Fixes for building with 32-bit and socket size sign/unsigned mismatch.
Tested with: `./configure --enable-all CFLAGS="-m32 -DXSOCKLENT=int" LDFLAGS="-m32" && make`
2022-09-01 11:39:34 -07:00
ba8ffc765d Merge pull request #5513 from rizlik/hrr_default
DTLSv1.3: Do HRR Cookie exchange by default
2022-09-01 07:45:18 -07:00
0222833f7e Merge pull request #5535 from douzzer/20220831-analyzer-coddling
20220831-analyzer-coddling
2022-09-01 07:40:11 -07:00
8ccef9f0d3 Merge pull request #5531 from embhorn/zd14665
Check return from call to wc_Time
2022-09-01 09:35:49 -05:00
85776f0069 Add wolfSSL_EVP_PKEY_new_CMAC_key to OpenSSL compatible API 2022-09-01 18:00:43 +09:00
08b89fbef9 server: add optional argument to -J disable hrr cookie 2022-09-01 09:37:35 +02:00
401cfbd8e4 dtls13: enable hrr cookie by default 2022-09-01 09:37:35 +02:00
edd723cc84 ssl: add new wolfSSL_disable_hrr_cookie() API to disable hrr cookie
Add a way to disable hrr cookie so it can be enabled by default for DTLS
connections.
2022-09-01 09:37:34 +02:00
ce8959ea77 SHA-3 improvements
Add x86_64 assembly code:
  - BMI2
  - AVX2 (using ymm, slower than BMI2)
  - AVX2 of 4 similtaneous hashes
Add SHAKE128 functions and tests.
Add Absorb and Squeeze functions for SHAKE128 and SHAK256 and tests.
Add doxygen for SHA-3 and SHAKE functions.
Update other generated x86_64 assembly files to include settings.h.
2022-09-01 17:11:58 +10:00
ea3959f2f6 analyzer coddling:
in api.c test_wolfSSL_dtls12_fragments_spammer(), inhibit clang-analyzer-deadcode.DeadStores;

in asn.c ParseCRL_Extensions() old (!WOLFSSL_ASN_TEMPLATE) version, fix bounds check to prevent overshift;

in misc.c ctMaskCopy(), use `*(x + i)`, not x[i], to tiptoe around cppcheck-2.9 objectIndex bug.
2022-08-31 22:56:08 -05:00
db6d69143e Merge pull request #5533 from lealem47/crlPrintFix
Add missing DN nid to work with PrintName()
2022-08-31 18:32:55 -07:00
fe583faf32 Merge pull request #5501 from haydenroche5/ecc_non_block
Add support for non-blocking ECC key gen and shared secret gen for P-256/384/521.
2022-08-31 18:31:28 -07:00
96ab26e6e9 Fix for async session tickets. ZD14420
```
./configure --enable-all --enable-asynccrypt CFLAGS="-DWOLFSSL_NO_DEF_TICKET_ENC_CB" && make
./examples/server/server -v 4 -r &
./examples/client/client -v 4 -r
```
2022-08-31 15:28:49 -07:00
2df1c25263 Add missing DN nid to work with PrintName() 2022-08-31 15:18:12 -07:00
41207f5d9b Add support for non-blocking ECC key gen and shared secret gen for
P-256/384/521.

New functions:

- sp_ecc_make_key_256_nb
- sp_ecc_make_key_384_nb
- sp_ecc_make_key_521_nb
- sp_ecc_secret_gen_256_nb
- sp_ecc_secret_gen_384_nb
- sp_ecc_secret_gen_521_nb

This commit also tweaks the testing for ECDSA testing in test.c. Instead of
testing with one of P-256/384/521, we test with all that are available.
2022-08-31 14:34:26 -07:00
38e4ecc27c Merge pull request #5529 from anhu/wextra
Fix Windows CMakeList compiler options
2022-08-31 14:04:24 -07:00
5a25525b2e Check return from call to wc_Time 2022-08-31 15:20:07 -05:00
9531552795 Merge pull request #5522 from tim-weller-wolfssl/update-ide-win10-build
Update ide win10 build files to add missing sp source files
2022-08-31 12:45:17 -07:00
b1301d9dc4 Merge pull request #5518 from CallumMcLoughlin/master
Allow Post Quantum Keyshare for DTLS 1.3
2022-08-31 12:29:08 -07:00
f0812fa21f Added vcpkg instructions to the INSTALL file. 2022-08-31 11:41:43 -07:00
8722a46d52 Merge pull request #5503 from julek-wolfssl/dtls-fragments
DTLS limit fragments
2022-08-31 09:53:09 -07:00
3b8d230223 Merge pull request #5515 from anhu/custExtDoc
Improve `wc_SetCustomExtension` documentation
2022-08-31 08:35:04 -07:00
f7482d96e6 Windows cl.exe does not support -Wextra other flags 2022-08-31 10:32:55 -04:00
1d9d8bdefb Removed sp_c64.c due to reliance on 128-bit type, replaced with sp_x86_64.c and _asm.asm. 2022-08-31 07:15:05 -07:00
71b1aca373 Merge branch 'master' into update-ide-win10-build 2022-08-31 06:32:20 -07:00
54bd786707 DTLS limit fragments
- Limit the amount of fragments we store per a DTLS connection
- Error out when we reach the DTLS fragment connection limit
2022-08-31 14:24:20 +02:00
44f81f8bc0 Merge pull request #5525 from JacobBarthelmeh/release
Release version 5.5.0
2022-08-30 10:35:13 -07:00
4ce1cf1d7c update RPM build 2022-08-30 08:50:41 -07:00
d75ce08d75 update readme for release 5.5.0 2022-08-30 09:31:28 -06:00
43388186bb Tidy up TLS 1.3 and DTLS 1.3 check 2022-08-30 19:59:36 +12:00
565d1b33e5 Update examples to allow post quantum KEM within DTLS 1.3 2022-08-30 18:39:57 +12:00
1afc92dd7b internal.c: WC_SHA256_DIGEST_SIZE for wc_Sha256GetHash when WOLFSSL_DEBUG_TLS 2022-08-29 17:06:52 -07:00
29f2dee991 handeling DER to internal of an OCSP response with no optional certificates 2022-08-29 15:25:50 -07:00
ac3cdb42b7 free structure in test case and return 0 from ocsp renew script 2022-08-29 15:25:50 -07:00
5b5f673c51 add simple ocsp response der verify test case 2022-08-29 15:25:50 -07:00
69d60f5099 Merge branch 'master' into update-ide-win10-build 2022-08-29 09:13:51 -07:00
a7f86f9473 Merge pull request #5517 from JacobBarthelmeh/Testing
misc. testing items from static analysis tools
2022-08-29 08:48:51 -07:00
11c553ea1d Merge pull request #5520 from julek-wolfssl/sni-tls-1.2
SNI can appear in ServerHello for TLS 1.2
2022-08-29 09:36:53 -06:00
88deaf9b5c SNI can appear in ServerHello for TLS 1.2
Co-authored-by: Eric Blankenhorn <eric@wolfssl.com>
2022-08-29 14:22:10 +02:00
91d3cd7111 Allow Post Quantum Keyshare for DTLS 1.3 2022-08-28 17:35:28 +12:00
1e673aee3b scan-build warning fix 2022-08-26 16:29:11 -07:00
ad0fd15a0d static analysis fix from infer 2022-08-26 14:55:42 -07:00
ce2cf3439d subject info. acc. should contain a CA repo entry not OCSP 2022-08-26 14:39:20 -07:00
1c83438eb3 Add compatibility layer macros 2022-08-26 14:56:35 -05:00
b1e9cc320b Add documentation telling the user not to modify a buffer. 2022-08-26 14:27:27 -04:00
e88bd66501 Merge pull request #5514 from julek-wolfssl/wolfSSL_EVP_MD_CTX_copy_ex-leak
Cleanup output object in wolfSSL_EVP_MD_CTX_copy_ex before copy
2022-08-26 11:08:17 -07:00
1bf441de4d add MCUXpresso IDE projects 2022-08-26 10:51:10 -07:00
b3fa6f654e no realloc, adjustable static test size, fsl RTC 2022-08-26 09:15:33 -06:00
d84bfd511d Merge pull request #5511 from SparkiDev/sp_submod_neg_fix
SP math: don't modify sign in sp_div
2022-08-26 08:07:37 -07:00
2fb3f58c03 Cleanup output object in wolfSSL_EVP_MD_CTX_copy_ex before copy 2022-08-26 13:07:45 +02:00
8b2719cc83 SP math: don't modify sign in sp_div
Not need to modify sign of a and d in sp_div().
Signs cached at start and used to calculate sign result.
2022-08-26 08:47:49 +10:00
1976601811 Merge pull request #5505 from julek-wolfssl/dtls-plaintext
Ignore plaintext on established connections
2022-08-25 07:25:03 -07:00
b9cee17b01 Merge pull request #5508 from SparkiDev/aes_ctr_arm32_neon_fix2
AES-CTR ARM32 ASM: Fix 128-bit counter increment
2022-08-25 07:04:48 -07:00
bd13fcc92a AES-CTR ARM32 ASM: Fix 128-bit counter increment
Include hash.h to sp_int.h for when no public key algorithms compiled in
- need WC_MAX_DIGEST_SIZE.
2022-08-25 14:54:00 +10:00
842d415de0 Merge pull request #5507 from haydenroche5/general_names_leak
Fix wolfSSL_GENERAL_NAMES_free memory leak.
2022-08-24 21:05:53 -07:00
2c829f19d3 Merge pull request #5506 from dgarske/dtlscid
Fixes for build warnings and string macros for DTLS CID
2022-08-25 13:52:55 +10:00
9f39ffdba7 Fix wolfSSL_GENERAL_NAMES_free memory leak.
This function was just freeing the stack object itself of GENERAL_NAMES with
wolfSSL_sk_free, but this doesn't free the data in the items of the stack. The
fix is to replace wolfSSL_sk_free with wolfSSL_sk_GENERAL_NAME_free.
2022-08-24 18:42:30 -07:00
a0448155d5 Fix for type warnings in example for DTLS CID ./configure --enable-dtls --enable-dtlscid --enable-dtls13. 2022-08-24 16:02:05 -07:00
8268214297 Merge pull request #5504 from ejohnstown/ppc-warn
API Test Fixes for GCC/PowerPC Warnings
2022-08-24 15:19:53 -07:00
159a3c8b03 Ignore plaintext on established connections 2022-08-24 21:40:19 +02:00
c4a61af311 drafted test case 2022-08-24 20:45:54 +02:00
a668953f70 cr fix 2022-08-24 20:35:56 +02:00
9b65f5819c API Test Fixes for GCC/PowerPC Warnings
1. In api.c, change the name of the devId global to testDevId.
2. In api.c, for the SNI test, some of the pointers were multiply
   typecast eventually to `void **`. An older compiler didn't like
   that. Just use void pointer.
2022-08-24 11:30:56 -07:00
7ea904c873 Added CertNew() and CertFree() info. (#5502)
* Updated wc_CertNew() dox for the return value listings, small changes to
description and add some detail to the example per peer review.
2022-08-24 13:09:50 -04:00
9b12011d71 Merge pull request #5499 from SparkiDev/aes_ctr_arm32_asm
AES-CTR ARM32 crypto ASM fix
2022-08-24 09:59:49 -07:00
53b74e2d32 Merge pull request #5498 from SparkiDev/tls_ecc_sig_fault
Check ECC signature in TLS
2022-08-24 09:59:06 -07:00
124cff60f1 Merge pull request #5500 from SparkiDev/sp_int_div_ss_rework
Rework sp_div to work around static analysis error
2022-08-24 09:58:13 -07:00
d087cbea1b Rework sp_div to work around static analysis error
Fix _sp_exptmod_mont_ext() to handle when number of bits in exponent is
a multiple of the window size.
2022-08-24 12:31:21 +10:00
9228354d29 AES-CTR ARM32 crypto ASM fix
Fix handling of counter to support incrementing across all bytes in
ARM32 crypto asm.
Added test cases for wrapping of counter when 2 blocks are being
encrypted to check assembly alternative path.
2022-08-24 10:51:56 +10:00
2571f65e85 Check ECC signature in TLS
Verifying gnerated ECC signature in TLS handshake code to mitigate when
an attacker can gain knowledge of the private key through fault
injection in the signing process.
Requires WOLFSSL_CHECK_SIG_FAULTS to be defined.
2022-08-24 09:01:18 +10:00
3b6124cf34 Merge pull request #5497 from douzzer/20220823-fixits
20220823-fixits
2022-08-23 13:45:02 -07:00
8f70f98640 wolfcrypt/src/asn.c: refactor _SMALL_STACK code path in ParseCRL_Extensions() to fix memory leaks and heap-use-after-free. 2022-08-23 13:52:42 -05:00
dcebd0d349 wolfssl/wolfcrypt/logging.h: when !WOLFSSL_VERBOSE_ERRORS, define WOLFSSL_ERROR_VERBOSE(e) as (void)(e) to avert clang-analyzer-deadcode.DeadStores, and avert bare semicolons. 2022-08-23 13:50:56 -05:00
769fb7cbee Merge pull request #5453 from rizlik/dtls_cid
Support ConnectionID Extension DTLS Negotiation
2022-08-23 11:29:25 -07:00
cab6ecd130 Merge pull request #5404 from JacobBarthelmeh/PKCS7
fix for not having default pkcs7 signed attributes
2022-08-23 11:04:17 -07:00
5c65974170 Fix for dynamic type macro typo. 2022-08-23 09:32:11 -07:00
9d5305ad07 Merge pull request #5495 from julek-wolfssl/ticket-alignment
Remove WOLFSSL_GENERAL_ALIGNMENT from WOLFSSL_TICKET_ENC_SZ calculation
2022-08-23 08:13:42 -07:00
3a8e6f2280 fix: add explicit cast to abide g++ compiler 2022-08-23 16:58:24 +02:00
f3262005e4 add basic ConnectionID DTLS tests 2022-08-23 16:58:24 +02:00
90fcd95f9b server/client: add --cid option to use ConnectionID extension 2022-08-23 16:58:24 +02:00
cfbd061625 add initial support for ConnectionID DTLS extension 2022-08-23 16:58:24 +02:00
83fad7bb45 drafted setting cipher list with bytes api 2022-08-23 14:16:43 +02:00
ae049706c6 Remove WOLFSSL_GENERAL_ALIGNMENT from WOLFSSL_TICKET_ENC_SZ calculation 2022-08-23 11:57:41 +02:00
171af05e96 tlsx: expose TLSX_Push
To be able to implement extension in separate compilation unit
2022-08-23 10:00:06 +02:00
bf9f4b88e4 Merge pull request #5494 from douzzer/20220822-bugprone-macro-parentheses
20220822-bugprone-macro-parentheses
2022-08-22 17:16:48 -07:00
48463f6d54 Merge pull request #5388 from lealem47/crlPrint
Adding X509_CRL_print() function
2022-08-22 17:16:19 -07:00
f9ca944106 Addressing some more feedback 2022-08-22 14:47:11 -07:00
1063090e38 fix bugprone-macro-parentheses in WOLFSSL_CRYPTO_EX_DATA_IGNORE_PARAMS() added in 8b2fcd0643. 2022-08-22 16:34:28 -05:00
bd49d37aaf Merge pull request #5492 from embhorn/zd14694
Fix for AddPacketInfo with WOLFSSL_CALLBACKS
2022-08-22 14:59:29 -06:00
91a7b8067c Addressing some PR feedback 2022-08-22 12:04:15 -07:00
c7c6fd98d7 Merge pull request #5491 from icing/quic-doc-update
Update of the QUIC documentation
2022-08-22 12:00:12 -07:00
b9d9dc02bb Merge pull request #5476 from julek-wolfssl/session-buffers
Remove WOLFSSL_SESSION_TYPE_REF buffers from WOLFSSL_SESSION
2022-08-22 11:59:39 -07:00
c0815b3bc6 Merge pull request #5493 from kaleb-himes/openssl3_0_testing_supplemental
Supplemental fix in addition to #5470
2022-08-22 11:14:49 -07:00
36facf52c9 Merge pull request #5490 from TakayukiMatsuo/no_rsa
Fixed build errors raised when NO_RSA is defined
2022-08-22 10:07:39 -07:00
d50e740c97 Merge pull request #5488 from julek-wolfssl/get_ex_new_index-docs
Add documentation explaining get_ex_new_index API limitations
2022-08-22 09:51:36 -07:00
a7e318a7ad Merge pull request #5484 from lealem47/allocators
Adding allocator funcs for dtls peer (for wrappers)
2022-08-22 09:29:54 -07:00
ce5a749fcb Merge pull request #5489 from SparkiDev/aes_ctr_arm_asm
AES-CTR ARM crypto ASM fix
2022-08-22 09:28:22 -07:00
1e5de8255e Merge pull request #5472 from satoshiyamaguchi/trial3
Add/Extend PEM_read compatibility API's
2022-08-22 09:24:39 -07:00
8f4b467f47 Fixing line lengths and SMALL_STACK code path 2022-08-22 09:17:23 -07:00
689d45eb59 Merge pull request #5425 from SparkiDev/ecc_sp_uncomp_ret
ECC SP uncompress: use error return
2022-08-22 09:00:52 -07:00
f98d8c5024 Update Windows 10 Visual Studio FIPS build file to include single-precision (sp) files to resolve missing symbols during link 2022-08-22 08:40:45 -07:00
77dec16b3b Supplemental fix in addition to #5470 2022-08-22 08:00:40 -06:00
22c44bd762 Fix for AddPacketInfo with WOLFSSL_CALLBACKS 2022-08-22 08:01:21 -05:00
240c261772 Update of the QUIC documentation
- explain what the QUIC support is
- examples of ngtcp2 use
- what is needed for HTTP/3
2022-08-22 14:36:14 +02:00
0dbd0ffb4e Merge pull request #5483 from embhorn/zd14659 2022-08-22 14:28:29 +02:00
e565d0d7de Refactor and code review
- Refactor object hashing into one function
- Allow multiple WOLFSSL_ASSERT_SIZEOF_GE in one function
2022-08-22 14:19:48 +02:00
8b2fcd0643 Add documentation explaining get_ex_new_index API limitations 2022-08-22 12:16:51 +02:00
c7d28e3bb9 ECC SP uncompress: use error return 2022-08-22 16:21:30 +10:00
48e7035af8 Fix build error when NO_RSA is defined 2022-08-22 14:03:19 +09:00
f7a8d4a44a AES-CTR ARM crypto ASM fix
Fix handling of counter to support incrementing across all bytes in ARM
crypto asm.
Added test cases for wrapping of counter.

Extracted ARM ASM for AES-CTR.
Use ASM to created encrypted temporary block.
2022-08-22 10:36:48 +10:00
26c61f8e0f Merge pull request #5473 from icing/quic-hello-retry
Respect disabled curves on HelloRetryRequests
2022-08-22 08:32:30 +10:00
2059d05b7a checking some ret values, fix trailing whitespace 2022-08-19 12:40:42 -07:00
2a65220527 Adding X509_CRL_print() function 2022-08-19 12:21:35 -07:00
da136e0c49 Adding allocator funcs for dtls peer (for wrappers) 2022-08-19 10:59:55 -07:00
b417f94435 Merge pull request #5485 from SparkiDev/tls13_state_string_long
wolfSSL_state_string_long - update for TLS 1.3 and DTLS 1.3
2022-08-19 10:09:09 -07:00
f3b9cfa71c Merge pull request #5487 from icing/tls13_early_nr
Improved EarlyData Indicator reply fix based on PR #5486
2022-08-19 09:54:17 -07:00
a7c0c4649e Fixing Handshake Hash update when Preshared Keys offered by client,
but none of them was accepted.

- This applies to TLSv1.3 and QUIC
- QUIC test case to trigger the bug enabled
2022-08-19 15:56:20 +02:00
1d0e83bd1a Merge pull request #5474 from julek-wolfssl/zd14644-2
Match OpenSSL self signed error return.
2022-08-19 06:46:26 -07:00
3d8562f07b Fixes for build and runtime issues 2022-08-19 08:12:04 -05:00
6cb0caa0a0 Adding disabledCurves as a member of WOLFSSL in the OPENSSL_EXTRA case.
- inheriting from WOLFSSL_CTX on creation
- enabling on WOLFSSL only when wolfSSL_set1_curves_list() is called
2022-08-19 11:03:23 +02:00
7a5170b6e1 Improved EarlyData Indicator reply fix based on PR #5486
- PR #5486 had test failures in tls13.test and quit unit.test
- the extension was no longer added in SessionTicket messages
- added extra parameter to clarify how the TLSX is used
2022-08-19 10:07:06 +02:00
a66516d3a5 Extending quic resumption tests. 2022-08-19 09:02:28 +02:00
61c7003520 Fix whitespace 2022-08-19 12:38:07 +09:00
4b8cd6c62b wolfSSL_state_string_long - update for TLS 1.3 and DTLS 1.3 2022-08-19 09:41:01 +10:00
06022e85a3 Fix avoidSysCalls logic 2022-08-18 19:43:40 +02:00
969ad96dee examples/{client,server}/{client,server}.c: remove spurious commas in --pqc help strings, and mollify clang-tidy bugprone-suspicious-missing-comma re --force-curve help strings. (#5480) 2022-08-18 13:32:58 -04:00
4d0ea62857 Refactor ticket size to not accidentally go over WOLFSSL_TICKET_ENC_SZ
- Optimize memory usage. Write directly to ssl->session->ticket in CreateTicket() and use a hash to make sure the InternalTicket was encrypted.
- DoClientTicket does not fatally error out anymore. Errors in the ticket result in the ticket being rejected instead.
2022-08-18 19:08:43 +02:00
6316e26bdc Adding the forgotten wolfSSL_CTX_free() at the end of the new test_quic_key_share case. 2022-08-18 10:24:18 +02:00
e830a0f613 Merge pull request #5434 from satoshiyamaguchi/trial4 2022-08-17 17:04:36 -06:00
aa812c8aa9 Added support for P384 pre-share in server (#5442)
Added support for new server `--force-curve` option.
2022-08-17 15:30:48 -07:00
91a49da4b8 Merge pull request #5468 from SparkiDev/wolfssl_clear 2022-08-17 15:51:25 -06:00
d494894268 Add to parse RSA ES OAEP Oid 2022-08-18 06:43:31 +09:00
91d1bbbd44 Merge pull request #5477 from douzzer/20220817-make-quic-optional
20220817-make-quic-optional
2022-08-17 14:34:12 -07:00
5b260ac52e configure.ac: remove enable-quic from enable-all feature set;
remove ENABLED_QUIC="yes" from "$ENABLED_CURL" = "yes" setup section;
add ENABLED_CURVE25519=yes if $ENABLED_QUIC = yes;

tests/unit.c: move QuicTest() and SrpTest() before SuiteTest().
2022-08-17 14:25:38 -05:00
68f71d0d96 Remove WOLFSSL_SESSION_TYPE_REF buffers from WOLFSSL_SESSION 2022-08-17 19:29:07 +02:00
be378a346e Merge pull request #5475 from dgarske/rsa_pss_async
Fixes for RSA PSS with `--enable-asynccrypt` in `ConfirmSignature`
2022-08-17 12:04:05 -05:00
b9c9ad0339 Fixes for RSA PSS with --enable-asynccrypt in ConfirmSignature. 2022-08-17 08:20:06 -07:00
3918a2e29a Renaming the named_curve parameter to curve_id to avoid shadowing. 2022-08-17 17:01:18 +02:00
008e947fec Match OpenSSL self signed error return.
OpenSSL compat expects ASN_SELF_SIGNED_E when a self signed cert can't be verified. This is useful when translating the error with GetX509Error into a X509_V_ERR_* error.
2022-08-17 12:40:16 +02:00
d6548b6b88 Small refactoring of named group handling for readability and de-duplicating of code.
- add wolfSSL_CTX_curve_is_disabled() and wolfSSL_curve_is_disabled()
  to have common checks on wether a curve has been disabled by user
- add macros returning 0 for above function when OPENSSL_EXTRA is not
  defined, enabling use without #fidef check
- add macros for checking if named groups are in a certain range
  WOLFSSL_NAMED_GROUP_IS_FFHDE()
  WOLFSSL_NAMED_GROUP_IS_PQC()

Fixed QuicTransportParam_free() use without case when compiling
with c++.
2022-08-17 11:46:48 +02:00
f5a257c383 Add WOLFSSL_LEAVE to wolfSSL_PEM_read_RSA_PUBKEY and wolfSSL_PEM_read_PUBKEY 2022-08-17 14:23:50 +09:00
7435402c30 Fixes to better handle re-use of a WOLFSSL object via wolfSSL_clear. 2022-08-16 15:44:05 -07:00
3f7d56d957 Merge pull request #5471 from icing/quic-mem-leak
Fix memory leak in QUIC transport parameters extension
2022-08-16 13:22:20 -07:00
be2a6cbeb9 Merge pull request #5420 from Uriah-wolfSSL/ms_abi
Ms abi
2022-08-16 09:21:14 -07:00
3434210b13 Fix memory leak in QUIC transport parameters extension 2022-08-16 18:13:25 +02:00
091fc71c74 Fix EVP_PKEY not freed and FILE pointer not closed 2022-08-17 01:03:09 +09:00
e1b3f14d35 Fix FILE pointer not closed in tests/api.c 2022-08-17 00:11:29 +09:00
524f9ebd32 Add argument check and error message to wolfSSL_PEM_read_RSA_PUBKEY 2022-08-16 17:35:51 +09:00
55eb460d1a Merge pull request #5403 from SparkiDev/ecc_import_priv_order
ECC import priv: validate priv is less than order
2022-08-15 21:36:46 -07:00
a954cf82e3 Merge pull request #5469 from anhu/init_CertName
Initialize the Enc memberss of CertName struct.
2022-08-15 20:42:26 -07:00
8aa2bde3c2 Merge pull request #5470 from kaleb-himes/openssl3_0_testing
Allow for renegotiation testing with openssl 3.0 installed on jenkins…
2022-08-16 11:02:22 +10:00
1dd318741d Allow for renegotiation testing with openssl 3.0 installed on jenkins slaves (also tested with openssl 1.1) 2022-08-15 16:33:06 -06:00
52ed047a44 Fix a mismatched decl and impl 2022-08-15 12:13:05 -04:00
23a01b3276 SP: CT from_mp when sp_digit bits equal mp_digit bits.
Made constant time copy of values from an mp_int int array of sp_digit.
Stops OOB writes when mp_int is bigger than it should be.
2022-08-15 09:02:24 -07:00
5e7cff71fd Initialize the Enc memberss of CertName struct.
Tested by reproducing the problem in an example and confirming fix makes problem
go away.
2022-08-15 11:43:33 -04:00
e56a2355ca Merge pull request #5464 from julek-wolfssl/zd14644
Translate the verify callback error to an X509_V_ERR_* value when OPENSSL_COMPATIBLE_DEFAULTS is defined
2022-08-15 06:30:36 -07:00
7e00b32c71 Corrected line spacing incorrect arg passings. 2022-08-14 20:16:42 -05:00
28f22859bb Merge pull request #5451 from embhorn/zd14428
Fix TSIP ret value in TLSX_KeyShare_ProcessEcc
2022-08-14 11:27:20 -07:00
dfb3616d50 Merge pull request #5465 from douzzer/20220812-fixes
20220812-fixes
2022-08-14 08:03:40 -07:00
fba534dce0 Add wolfSSL_PEM_read_RSA_PUBKEY to OpenSSL compatible API 2022-08-14 16:08:22 +09:00
f515916f68 Add liboqs integration to CMake build system (#5407)
* Add liboqs integration to CMake build system

* Rephrase WOLFSSL_OQS option

* Add new FindOQS.cmake file to cmake/include.am

Co-authored-by: Disyer <denialmc1@gmail.com>
2022-08-12 16:23:24 -04:00
e382905311 CMakeLists.txt: synchronize CMAKE_C_FLAGS with diagnostic flags set in autotools-generated Makefile (-Wall -Wextra -Wno-unused -Werror), and fix WOLFSSL_RSA_PSS to add -DWOLFSSL_PSS_LONG_SALT as needed by changes to test_wolfSSL_CertRsaPss() in fb531dacc2 (gating of those changes is also added in this commit). 2022-08-12 15:18:41 -05:00
b4f1b6d04d fix whitespace and C++-style comments. 2022-08-12 15:18:27 -05:00
60437bba6e Merge pull request #5378 from anhu/dilithium
Initial commit to add Dilithium NIST PQC winner.
2022-08-12 09:29:42 -07:00
0d78bd2127 Merge pull request #5459 from dgarske/docs
Improve documentation for CMAC
2022-08-12 10:37:07 -04:00
551acd2b19 Translate verify callback error with compat layer 2022-08-12 16:27:31 +02:00
126a570a37 Add HAVE_WOLFSSL_MSG_EX define when WOLFSSL_MSG_EX is available 2022-08-12 16:27:31 +02:00
90c65bd50b Merge pull request #5458 from icing/quic-earlydata
QUIC fixes for handling of early data
2022-08-11 17:52:29 -07:00
c66a21c40a Add Zephyr support for nRF5340 with CryptoCell-312, PSA Crypto fixes (#5418)
* PSA: set AES key bits, define PSA_ALG_NONE/PSA_KEY_ID_NULL if needed
* Zephyr: add TimeNowInMilliseconds() for tls13.c, clock_settime() for test.c, update CMakeLists.txt
* Skip including unistd.h for Zephyr in benchmark.c
* Zephyr: update README, add nRF5340dk support to wolfssl_test sample app
* Zephyr: add wolfCrypt benchmark sample app
* Zephyr: add nRF5340 support to tls_thread sample app
* PSA: use specific hash algo with psa_sign/verify_hash()
* Zephyr: add support for PSA Crypto API with PK callbacks to wolfssl_tls_threaded sample app
* Zephyr: add new files to zephyr/include.am
2022-08-11 17:42:05 -07:00
3f4b3605a6 Merge pull request #5460 from douzzer/20220811-quic-fixes-and-OLD-TLS-gating
20220811-quic-fixes-and-OLD-TLS-gating
2022-08-11 17:36:06 -07:00
d4646696ed Merge pull request #5448 from julek-wolfssl/ext-msg-check
Validate that extensions appear in correct messages
2022-08-12 08:39:42 +10:00
2b38ba0300 Merge pull request #5455 from dgarske/zd14420
Fix for handling `WC_PENDING_E` from decrypt session ticket callback
2022-08-12 08:20:57 +10:00
017c4e7a41 fix gating and unused-variable warnings in src/quic.c wolfSSL_quic_aead_is_{gcm,ccm,chacha20}();
fix TLS version gating in tests/quic.c;

fix gating in src/ssl.c for wolfSSLv2_client_method() and wolfSSLv2_server_method();

reorganize prototypes in wolfssl/ssl.h for wolf*_method*() to group systematically by protocol version and gate correctly on support for that version in the build.
2022-08-11 14:58:59 -05:00
5445b183ed Adding CMAC documentation. Fixes ZD14601. 2022-08-11 12:00:19 -07:00
b3de591c6f Rename of buffer to tmpbuffer to avoid collision with customer setup test. 2022-08-11 20:06:46 +02:00
499b9c4f35 Merge pull request #5456 from SparkiDev/ssl_set1_curve_fix
wolfSSL_CTX_set1_curves_list: X25519 and X448 defines
2022-08-11 09:19:25 -07:00
53fd4b37f2 QUIC fixes for handling of early data
- new internal field for keeping early data enabled status,
  as QUIC does not call SSL_write_early_data() itself.
- using read_/write_early_data() methods in QUIC handshake
  when early data is enabled. This triggers the internals
  that emit the proper early data indication handlings.
2022-08-11 18:08:37 +02:00
fef84e2c4c Fixes for asn_public.h documentation. Fix spelling error. 2022-08-11 08:58:32 -07:00
82a900b438 Initial commit to add Dilithium NIST PQC winner.
Also:

* added HAVE_FALCON guards as needed.
* corrected minor falcon bugs as I found them.
* handling OID sum collision between DILITHIUM_LEVEL5 and DILITHIUM_AES_LEVEL3

Tested with the following commands:

examples/server/server -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

examples/client/client -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

with permutations of SHAKE,AES variants and levels 2,3,5
2022-08-11 11:38:31 -04:00
5e6c45a6fb Merge pull request #5397 from SparkiDev/cert_rsa_pss
Certs with RSA-PSS sig
2022-08-11 08:19:12 -07:00
66644c2e31 Merge pull request #5457 from kaleb-himes/openssl-test-stuck-fix
Fix a very frequent stuck scenario with the openssl.test script
2022-08-11 07:43:23 -07:00
8efc8b0819 Fix up other test scripts using the same logic 2022-08-11 06:26:43 -06:00
a317126509 Validate that extensions appear in correct messages 2022-08-11 10:53:10 +02:00
dd2a6410d1 Merge pull request #5454 from dgarske/docs_hashtype
Improve the documentation for HMAC hash types
2022-08-11 16:50:55 +10:00
87d96c9c96 Merge pull request #5452 from icing/quic-resume
QUIC session resumption and early data handshake handling.
2022-08-10 22:33:13 -07:00
995100eed1 Fix for handling WC_PENDING_E from decrypt session ticket callback. ZD14420 2022-08-10 22:20:49 -07:00
9ec61d4ce4 Merge pull request #5449 from douzzer/20220809-quic-fixes
20220809-quic-fixes
2022-08-10 21:56:45 -07:00
4d8a713783 wolfSSL_CTX_set1_curves_list: X25519 and X448 defines
Support wolfSSL_CTX_set1_curves_list being available when X25519 and/or
X448 only defined.
Don't recognize X25519 or X448 if corresponding define is not set.
Enable test in api.c.
2022-08-11 14:13:04 +10:00
fb531dacc2 Certs with RSA-PSS sig
Add support for parsing and verifying certificates with RSA-PSS
signatures. Including check PSS parameters in key with those in
signature algorithm.
Add support for parsing private RSA PSS key.
Add support for parsing public RSA PSS key.
2022-08-11 09:43:01 +10:00
a0e1c2567e Fix a very frequent stuck scenario with the openssl.test script 2022-08-10 17:41:54 -06:00
5ef47cc86f Addressed code review. 2022-08-10 17:18:38 -05:00
8197f958a9 address peer review on PR #5449. 2022-08-10 13:33:57 -05:00
f771181e1a fixes for issues introduced in #5384:
added numerous missing _SMALL_STACK code paths (PK objects on the stack);

in settings.h, enable WOLFSSL_SMALL_STACK_STATIC by default when WOLFSSL_SMALL_STACK is defined (NO_WOLFSSL_SMALL_STACK_STATIC to override);

fixes for unsafe strcat()s in tests/quic.c;

fix for unsafe macro WOLFSSL_IS_QUIC();

fix to exclude quic from enable-all when enable-linuxkm (quic needs opensslextra, and opensslextra currently only works in-kernel in cryptonly builds);

fix for signed/unsigned clash in wolfSSL_quic_receive().
2022-08-10 13:33:56 -05:00
c707186b9f Improve the documentation for HMAC hash types. 2022-08-10 09:23:01 -07:00
b46693f8c8 Merge pull request #5445 from douzzer/20220808-fixes
20220808-fixes (unchecked snprintf() retvals)
2022-08-10 10:21:07 -06:00
ea04ffc99f QUIC session resumption and early data handshake handling.
In test with ngtcp2 example client using openssl, session resumption
against a QUIC wolfssl server failed. The error was tracked down to
wolfSSL believing EaryData needs to be handled and returning SUCCESS
from wolfSSL_SSL_do_handshake() after the server Finished had been
sent.

However the handshake was not complete and ngtcp2 invoked the
post_handshake processing for new data arriving from the client.
This failed a check in post processing that the ssl->handShakeState
actually was HANDSHAKE_DONE.

The workaround in this PR repeats do_handshake until the ssl
state acually says it is complete. This way, session resumption works.

Either this alternative do_handshake() is merged for QUIC protocol
hanlders. Or we need to fix the 'normal' do_handshake() to no return
SUCCESS when early data is expected on a QUIC WOLFSSL.
2022-08-10 15:17:30 +02:00
bcb9f3f70d Fix TSIP ret value in TLSX_KeyShare_ProcessEcc 2022-08-10 08:15:24 -05:00
c07d0fe4b4 address peer review:
use camel case not underscores in variable names;

restore use of const int variables for buffer sizes in several spots (for ease of smallstack code paths should they be needed);

use more MISRAish flow control in X509PrintSignature().

also, capture the retval from several more snprintf()s to pass directly to wolfSSL_BIO_write(), avoiding frivolous strlen()s.
2022-08-09 23:23:11 -05:00
eceee6ac95 Merge pull request #5444 from anhu/PQ_get_curve_name
Bugfix: wolfSSL_get_curve_name() will now print post-quantum group names.
2022-08-09 16:53:55 -07:00
57dc263d05 Make clang happy. 2022-08-09 14:35:59 -04:00
fa97923005 Merge pull request #5384 from icing/quic
QUIC support for wolfSSL
2022-08-09 10:13:29 -07:00
5049b16325 Param correction. 2022-08-08 19:43:54 -05:00
371fbc698c src/x509.c: mollify bugprone-unused-return-value warnings around XSNPRINTF();
fix various possible buffer overruns;

fix various runtime-error-driven memory leaks;

various refactors for efficiency, clarity, and safety, including refactors to eliminate unsafe XSTRNCAT() calls.
2022-08-08 18:55:38 -05:00
f8c9393235 Added ABI tags for certs, wc_CertNew(), wc_CertFree()
wc_CertNew() and wc_CertFree() is for use by ABI type aplications, and
others, for having wolfCrypt perform the new/free of the certification
structure w/o the application needing too, and more importantly, needing
to contain knowledge of the structure.
2022-08-08 18:12:06 -05:00
ae0faa40cf Bugfix: wolfSSL_get_curve_name() will now print post-quantum group names. 2022-08-08 17:51:45 -04:00
e3310984b6 Merge pull request #5443 from TakayukiMatsuo/doalert 2022-08-08 15:22:18 -06:00
039bf721c4 Merge pull request #5440 from miyazakh/sce_compile_failure 2022-08-08 10:36:15 -06:00
b0aaf4a23d Minor ABI updates. 2022-08-08 10:16:05 -05:00
c9c19c82b3 Added next set of ABI for ECC APIs 2022-08-08 09:08:24 -05:00
65d402d8d7 Revert "Revert "Removed duplicate WOLFSSL_ABI tag.""
This reverts commit e5c51b2638a374aa987c30be8598a78e3f370c7a.
2022-08-08 09:08:24 -05:00
d283510aa9 Revert "Removed duplicate WOLFSSL_ABI tag."
This reverts commit d17021bc4e8e3f12b0c0406f7fe400ed4c0bc2cd.
2022-08-08 09:08:23 -05:00
f2677c29ec Removed duplicate WOLFSSL_ABI tag. 2022-08-08 09:08:23 -05:00
cc8fb1f978 git push origin ms_abi 2022-08-08 09:08:23 -05:00
b200d65a6a Added new ABI reference hooks. This is round two, more to come. 2022-08-08 09:08:23 -05:00
46f423b8b9 Added ABI macros for managing interface changes 2022-08-08 09:08:23 -05:00
4431438fb2 add QUIC support. 2022-08-08 13:24:00 +02:00
7004157869 Merge pull request #5387 from TakayukiMatsuo/tk14445
Suppress build errors when defining some disable macros
2022-08-07 20:09:41 -07:00
9fd56c9c5c Changes in response to other PRs 2022-08-08 02:10:14 +09:00
79fb1783c4 Suppress build errors when defining some disable macros 2022-08-07 17:11:22 +09:00
2d2c55f1c1 Merge pull request #5431 from haydenroche5/wolfssl_error
Expand error queue usage with new macro WOLFSSL_ERROR_VERBOSE.
2022-08-05 15:14:44 -07:00
96fcc129ec Merge pull request #5213 from JacobBarthelmeh/req
expand functions included in opensslextra and add REQ print out
2022-08-05 13:20:21 -07:00
2288082d9a Make wolfSSL quiet_shutdown functions available when using OPENSSL_EXTRA_X509_SMALL. 2022-08-05 11:51:34 -07:00
3bf21b5a05 Expand error queue usage with new macro WOLFSSL_ERROR_VERBOSE.
We have users who need to debug errors coming out of libwolfssl in production,
where --enable-debug isn't an option. Our error queue implementation is the
solution, but our usage of WOLFSSL_ERROR isn't consistent. This commit greatly
expands our usage of WOLFSSL_ERROR. There are too many error cases to tackle
all at once, and not all error cases are particularly meaningful or likely to be
hit in regular operation of the library. I've tried to focus on errors that
users are likely to hit, and I've chosen to ignore things like the mountain of
BUFFER_E and BAD_FUNC_ARG cases (for the most part). I've also tried to expand
WOLFSSL_ERROR usage in files where we haven't been using it historically
(e.g. aes.c), so the pattern is now there for other developers to follow. In
order to prevent these additions from exploding the size of libwolfssl, they're
all behind a new macro, WOLFSSL_ERROR_VERBOSE. If WOLFSSL_VERBOSE_ERRORS is
defined, WOLFSSL_ERROR_VERBOSE just maps to WOLFSSL_ERROR.
2022-08-05 10:32:18 -07:00
d6c895d19d use or with all/extra macro guard 2022-08-05 09:31:42 -07:00
83f1ade1fc use extension free function with opensslextra and remove debug printf 2022-08-05 09:15:35 -07:00
cedfe9938a Fix the comment about the argument of wolfSSL_PEM_read_RSAPrivateKey. 2022-08-06 00:15:49 +09:00
4f181576ef Fix the position of wolfSSL_PEM_read_RSAPrivateKey definition in pem.h 2022-08-06 00:14:30 +09:00
192f081833 Merge pull request #5439 from SparkiDev/tls13_ext_msgs 2022-08-05 10:49:13 +02:00
f30b3f1163 fix compile error 2022-08-05 16:00:09 +09:00
c35b47f265 TLS !.3: restrict extension validity by message
Extensions ServerName, SupportedGroups and ALPN must not appear in
server_hello.
Removed server_hello from the valid checks.
2022-08-05 08:26:09 +10:00
56be09005f Merge pull request #5427 from julek-wolfssl/dtls-timeout-and-closed-socket
DTLS socket and timeout fixes
2022-08-05 08:13:14 +10:00
ff512a34c6 adjust temporary buffer size and memory free'ing 2022-08-04 15:11:24 -07:00
7465691c70 Merge pull request #5437 from douzzer/20220804-fixes
20220804 fixes
2022-08-04 13:55:03 -07:00
9d5e633a96 wolfcrypt/src/pkcs12.c: add WOLFSSL_SMALL_STACK path in freeDecCertList(). 2022-08-04 11:16:47 -05:00
d7e33b3293 wolfcrypt/src/asn.c: fix null pointer deref in SetReqAttribSingle() (clang-analyzer-core.NonNullParamChecker). 2022-08-04 11:12:09 -05:00
99dad91344 Merge pull request #5435 from douzzer/20220803-gcc-12-ASAN
20220803-gcc-12-ASAN
2022-08-04 08:41:26 -07:00
6d4f0146ca Refactor sending alert on decryption failure
Take sending of the alert outside of DecryptTls() and DecryptTls13(). The alert is now sent in ProcessReplyEx().
2022-08-04 12:06:26 +02:00
ebcfa31993 Refactor checking socket type into a function 2022-08-04 11:35:27 +02:00
3278210e1c Silently discard DTLS msgs that fail decryption
Don't send alerts when decryption fails inside a DTLS connection.
TLS should always send a bad_record_mac when decryption fails.
2022-08-04 11:27:45 +02:00
fd1e8c49eb Reset timeout when reading a valid DTLS message
- Increment the DTLS 1.3 timeout on a long timeout
2022-08-04 11:27:45 +02:00
67d518544b EmbedReceiveFrom: fix when using a TCP socket
- recvfrom() returns 0 on a closed TCP socket
- TCP sockets set WOLFSSL_CBIO_ERR_ISR on a timeout
2022-08-04 11:27:45 +02:00
9ea3e173d0 Merge pull request #5277 from JacobBarthelmeh/req_attr
expand subject name and req attribute support
2022-08-04 14:32:14 +10:00
2c2a7750a4 Merge pull request #5414 from darktohka/feature/chacha20-poly1305-evp
Integrate chacha20-poly1305 into the EVP interface
2022-08-03 18:21:17 -07:00
1dc848d8e3 Merge pull request #5429 from dgarske/sniffer_async2
Fix for sniffer to ensure the session was polled before trying to reprocess it
2022-08-04 08:18:55 +10:00
e32cfb79e5 Merge pull request #5419 from dgarske/aurix
Support for Infineon AURIX IDE and minor compiler warnings.
2022-08-04 08:01:57 +10:00
3f07900c1b Merge pull request #5432 from embhorn/zd14172
Fix dead code warnings and build error
2022-08-03 15:01:20 -07:00
791250c6c0 Merge pull request #5428 from TakayukiMatsuo/rx65n_fix
Fix build error and update manuals for Renesas RX boards
2022-08-03 11:04:25 -07:00
6e8417e631 wolfssl/wolfcrypt/blake2-int.h: remove alignment specs on __blake2s_state and __blake2b_state, as they are unneeded, and are not honored by gcc-12+ in stack allocations, leading to (true positive) misaligned-access errors from ASAN. 2022-08-03 12:30:45 -05:00
a7f0c92c0d src/internal.c: in GetCipherKeaStr(), when gcc-12 or higher and __SANITIZE_ADDRESS__, wrap in a pragma to ignore -Wstringop-overread, due to false positives. 2022-08-03 12:30:29 -05:00
664fe390d6 Merge pull request #5382 from icing/announce-pskkem-plain
Announce TLSX_PSK_KEY_EXCHANGE_MODES in non-resuming ClientHello
2022-08-03 07:40:24 -07:00
0c1add08e3 Merge pull request #5416 from darktohka/feature/chacha20-outl-bytes
Ensure ChaCha20 updates out length during cipher update
2022-08-03 07:26:02 -07:00
4937557ddc Merge pull request #5422 from julek-wolfssl/dtls-async-fix
Fix dtls + async multi-test misc errors
2022-08-03 07:24:58 -07:00
ecdccb6180 Fix build error with WOLFSSL_AES_DIRECT 2022-08-03 09:09:28 -05:00
f713c75a73 Fix dead code warnings in evpCipherBlock and wc_CryptKey 2022-08-03 08:08:00 -05:00
53e0483e47 Support for Infineon AURIX IDE. Fixes for Aurix compiler warnings. 2022-08-02 16:53:47 -07:00
72b0f15075 Merge pull request #5424 from anhu/curl_ftps_fix 2022-08-02 23:22:11 +02:00
9d2ed67a5c Fix for sniffer to ensure the session was polled before trying to reprocess it. 2022-08-02 08:11:21 -07:00
013ad0d564 Add wolfSSL_PEM_read_RSAPrivateKey to OpenSSL compatible API 2022-08-03 00:02:40 +09:00
fd412ed298 Fix so curl can do FTPS on TLS 1.3 with session resumption. 2022-08-02 10:51:14 -04:00
3c51d872ea Fix build error and update manuals 2022-08-02 16:45:37 +09:00
9db4ae64b9 Merge pull request #5423 from douzzer/20220729-fixes
20220729-fixes
2022-08-02 08:03:53 +10:00
99ed727179 add WOLFSSL_CERT_NAME_ALL macro guard and new values to set subject 2022-08-01 10:52:09 -07:00
52b80ea52a expand functions included in opensslextra and add REQ print out 2022-08-01 09:21:43 -07:00
4602e6d892 Merge pull request #5426 from rizlik/epoch_bits_fix
fix: dtls13: use correct buffer index to get epoch bits
2022-08-01 07:41:44 -07:00
8878922f95 fix: dtls13: use correct buffer index to get epoch bits
Fixes: d079662765
2022-08-01 14:24:20 +02:00
791508220f wolfssl/internal.h: fix spurious assert failure on jumbo RSA key configurations (> 8192 bits); mollify bugprone-macro-parentheses. 2022-07-29 09:33:14 -05:00
fb2feee9b6 Fix dtls + async multi-test misc errors
DTLS uses DtlsMsgStore() to process messages when using async crypto. A check was skipping the storing straight to DtlsMsgDrain().
2022-07-29 15:49:49 +02:00
a943de7969 Changes after PR review.
- removed additions to REAME.md
- changed coding style of conditional PSKKEM announce
  as requested.
2022-07-29 11:26:08 +02:00
1db8013566 Update README with note about change in TLSX_PSK_KEY_EXCHANGE_MODES use. 2022-07-29 11:18:56 +02:00
c8008e29b9 Announce TLSX_PSK_KEY_EXCHANGE_MODES in non-resuming ClientHello.
- can be reverted to previous style by defining NO_TLSX_PSKKEM_PLAIN_ANNOUNCE
- QUIC interop testing reveals that at least QUIC stacks refrain from
  issuing session tickets unless the ClientHello shows this extension.
2022-07-29 11:18:56 +02:00
da422eb422 Merge pull request #5406 from SparkiDev/mp_int_size
Maths bit size: ensure size is right
2022-07-28 15:36:58 -07:00
d568e8c893 Merge pull request #5413 from SparkiDev/x509_san_crit
ASN template: allow SAN to be critical
2022-07-28 15:14:23 -07:00
ac85000a02 Merge pull request #5415 from douzzer/20220728-fixes
20220728-fixes
2022-07-28 12:48:40 -07:00
fde2097503 Merge pull request #5405 from SparkiDev/clang-x86
TFM: change inline x86 asm code to compile with clang
2022-07-28 08:42:17 -07:00
e599bb5048 Mark chacha20-poly1305 as an AEAD cipher 2022-07-28 18:36:52 +03:00
e3dd7677c8 Add tests for chacha20-poly1305 EVP integration 2022-07-28 18:21:12 +03:00
e8febaf414 Ensure ChaCha20 updates out length during cipher update 2022-07-28 18:06:41 +03:00
545ba58cc0 sp_int.c sp_div(): add missing (err == MP_OKAY) clause to fix null ptr deref. 2022-07-28 09:28:36 -05:00
3ac04fa3ee wolfcrypt/benchmark/benchmark.c: fix gating for #include <unistd.h>. 2022-07-28 09:28:36 -05:00
52cc73a6a4 Integrate chacha20-poly1305 into the EVP interface 2022-07-28 13:01:35 +03:00
70c38f2183 Cert: SAN extension critical
Add field to Cert to indicate SAN extension is critical.
Handle the field being set when encoding.
2022-07-28 14:16:56 +10:00
824d44b705 Merge pull request #5412 from douzzer/20220726-multi-test-fixes
20220726-multi-test-fixes
2022-07-27 20:44:46 -07:00
7b65a1f1c2 Merge pull request #5411 from anhu/selfsigned_template
Fix ASN template to use the subject as issuer if cert is selfsigned
2022-07-27 16:02:14 -07:00
6ecf2c0a5e Merge pull request #5399 from SparkiDev/sp_exptmod_reduce
SP int: exptmod ensure base is less than modulus
2022-07-27 15:43:16 -07:00
58cc326621 Calcuate ---> Calculate 2022-07-27 16:56:45 -04:00
33579045f2 Fix ASN template code to use the subject as issuer if cert is selfsigned. 2022-07-27 16:38:17 -04:00
9256d6aa7c src/internal.c: fixes for redundant assignments and preprocessor typo. 2022-07-27 14:42:00 -05:00
c63e22701f src/pk.c: fix type mismatch in return value. 2022-07-27 14:42:00 -05:00
ed449d5b20 wolfsentry integration: avoid redundant and frivolous dispatches (ssl.c wolfSSL_connect(), wolfSSL_negotiate(), wolfSSL_accept(); tls13.c wolfSSL_connect_TLSv13(), wolfSSL_accept_TLSv13()). 2022-07-27 14:42:00 -05:00
feb911c612 Merge pull request #5398 from dgarske/make_dist_small
Script to produce a small source/header only package
2022-07-27 14:33:59 -05:00
a56d25d58e Merge pull request #5408 from julek-wolfssl/FreeAsyncCtx-location
FreeAsyncCtx should only be called when advancing state
2022-07-27 09:59:28 -07:00
0f0b7c553c Keep .i files needed for fast math. Use test_paths.h from .in to remove user path info. 2022-07-27 08:33:27 -07:00
6f282c2c57 Merge pull request #5402 from rizlik/dke_rsa
doClientKeyExchange improvements
2022-07-27 08:01:16 -07:00
e9b3b5936f FreeAsyncCtx should only be called when advancing state
The call to FreeAsyncCtx after SendBuffered was added to clean up state when we are ready to advance state. If we do not advance state, then clean up should be handled in the relevant state.
2022-07-27 14:14:22 +02:00
460845ba49 Maths bit size: ensure size is right
Ensure WOLFSSL_MAX_RSA_BITS works.
Fix SP math size defines.
Regression testing maths implementations.
2022-07-27 18:58:30 +10:00
788348dce2 TFM: change inline x86 asm code to compile with clang 2022-07-27 14:05:37 +10:00
01aad13c38 Rework 2022-07-27 12:02:15 +10:00
f31c8223f2 fix for not having default pkcs7 signed attributes 2022-07-26 16:45:44 -07:00
9ac3c9ec05 ECC import priv: validate priv is less than order
Valid private key must be less than order.
Check on import when WOLFSSL_VALIDATE_ECC_IMPORT defined.
2022-07-27 09:29:07 +10:00
9c480ece66 Fix to use the new outTmp. 2022-07-26 15:48:58 -07:00
c2476e3858 SP int: exptmod ensure base is less than modulus
Ensure sp_div uses rem only when rem is big enough.
2022-07-27 08:48:28 +10:00
5f47adba3c Merge pull request #5401 from dgarske/cmake_install_spmathall 2022-07-26 15:02:42 -07:00
856ea2ffc8 internal.c: RsaDec improvements 2022-07-26 20:59:01 +02:00
1727efbc2c internal.c: rsa decription buffer handling 2022-07-26 20:59:01 +02:00
2e1e8d2789 misc.c: introduce ctMaskCopy() 2022-07-26 20:59:01 +02:00
344ad48f03 Fix for CMake not installing sp_int.h for SP math all. 2022-07-26 11:29:21 -07:00
1003dfeefc Merge pull request #5392 from JacobBarthelmeh/caam
more macro guards with CAAM builds
2022-07-26 09:41:21 -07:00
9e213cab19 Fixes for the script (from Douzzer). 2022-07-26 08:50:27 -07:00
a5b1838d8f Merge pull request #5393 from TakayukiMatsuo/leakfix 2022-07-26 09:44:19 -06:00
a05b38059e Merge pull request #5385 from miyazakh/sce_jenkins_fail 2022-07-26 09:41:46 -06:00
48016adf52 Script to produce a small source/header only package (with CMake support) 2022-07-25 17:08:13 -07:00
a98642ba61 Merge pull request #5383 from julek-wolfssl/negating-ciphersuites
Expand SetCipherList()
2022-07-25 08:26:47 -07:00
97970d87a5 Merge pull request #5350 from SparkiDev/sp_math_fixes_1
SP math
2022-07-25 08:18:55 -07:00
7174e6766b Merge pull request #5391 from embhorn/gh5366
Fix to copy TLS version with wolfSSL_write_dup
2022-07-25 07:56:14 -07:00
cceb35abe2 Merge pull request #5394 from SparkiDev/pathlen_set_0
Cert path length: add flag to indicate path length set
2022-07-25 07:54:30 -07:00
ec565250ed Merge pull request #5395 from SparkiDev/encrypt_len_fix
ENCRYPT_LEN fix
2022-07-25 07:53:50 -07:00
5a0afc512e Fix memory leak in ECDHE with TSIP 2022-07-25 19:43:32 +09:00
e7cd1562b4 Expand SetCipherList()
- support disabling ciphersuites starting from the default list
2022-07-25 11:14:16 +02:00
8e20a5900c ENCRYPT_LEN fix
Fix check for WOLFSSL_SP_MATH_ALL and WOLFSSL_SP_MATH instead of
WOLFSSL_SP_MATH twice.
2022-07-25 09:35:43 +10:00
8fa2449a63 Cert path length: add flag to indicate path length set
A path length is allowed to be 0.
Can't check path len for 0 to determine when value is set.
Added flag to indicate path length is set.
2022-07-25 09:07:14 +10:00
56bec875b4 Merge pull request #5390 from kareem-wolfssl/bnGenPrimeRsa
Update sp_rand_prime's preprocessor gating to match wolfSSL_BN_generate_prime_ex's.
2022-07-25 08:10:06 +10:00
35d40f263e more macro guards with CAAM builds 2022-07-22 16:19:55 -07:00
4369873540 Fix to copy TLS version with wolfSSL_write_dup 2022-07-22 15:09:35 -05:00
dc92ec2aa9 Update sp_rand_prime's preprocessor gating to match wolfSSL_BN_generate_prime_ex's. 2022-07-22 11:07:46 -07:00
6f2889c07d BIO_eof returns 1 when no more data remains in the BIO 2022-07-22 13:24:32 +02:00
491ebb7a3d fixed compile error due to degression
fixed memory leak in wc_SCE_EccVerify
2022-07-22 08:29:05 +09:00
dc8b796d1d Merge pull request #5347 from dgarske/async_sess_tick
Support for asynchronous session ticket callback
2022-07-22 08:04:48 +10:00
02e512142c Merge pull request #5359 from haydenroche5/unit_test_refactor
Begin refactor of api.c.
2022-07-21 15:52:40 -05:00
281825db20 Merge pull request #5353 from rizlik/dtls13_async_fixes
Dtls13 async fixes
2022-07-21 13:24:35 -07:00
69e2f5243c Merge pull request #5326 from gojimmypi/ESP32_HW_Update_PR
Espressif ESP32 Hardware Acceleration Update and Cleanup
2022-07-21 12:09:09 -07:00
163acb89af dtls13: consider certificate_request processed on WC_PENDING_E
The error is due to the message triggered by the processing of the
message (Connect()->SendTls13Certificate/SendTls13CertificateVerify/SendTls13Verify). Consider
the message processed to avoid double processing.
2022-07-21 12:00:18 -07:00
aca83b42d7 fix: dtls13: send immediately post-handshake certificate request 2022-07-21 12:00:18 -07:00
53dde1dafe dtls12: async: store the message only if async is really used 2022-07-21 12:00:18 -07:00
964ea85d3d Fix typos for dynamic types in dtls13.c. 2022-07-21 12:00:18 -07:00
dce63fdfb3 async: fix issue with DTLSv1.3 2022-07-21 12:00:16 -07:00
07afc594a8 dtls13: aesthetic only changes 2022-07-21 11:55:50 -07:00
b5ce0b021e Merge pull request #5381 from rizlik/async_fix
fix: async: don't rewind index if post-handshake connect() fails
2022-07-21 11:53:15 -07:00
c5e7ccca2c Merge pull request #5380 from danielinux/typo-doc
Fixed typo in dox_comments
2022-07-21 11:52:56 -07:00
daf5135642 Begin refactor of api.c.
- Modify all existing tests to return an int. This moves us in the direction of
being able to return error/success from a test rather than just calling abort
when something fails. Also, all tests now have the same signature, so they can
easily be members of an array of test cases.
- Wrap each test in a TEST_CASE struct, which just stores a pointer to the test
function and the name of the test, for now. In the future, other metadata can
be added (e.g. should this test be run/skipped) to TEST_CASE, if desired.
- Modify all tests to return 0 on success. Right now, this doesn't do us much
good because the failure mechanism isn't returning some value != 0, it's
abort.
- Add TestSetup and TestCleanup functions that run before and after each test,
respectively. The former does nothing right now, and the latter clears the
error queue, if the error queue is compiled in.
2022-07-21 10:12:26 -07:00
1281d97b1e Merge pull request #5373 from haydenroche5/error_queue_fix
Fix backwards behavior for various wolfSSL_ERR* functions.
2022-07-21 09:35:21 -06:00
a235de25fe fix: async: don't rewind index if post-handshake connect() fails
During post-handshake authentication async code mistakes connect() error code
with the error code of DoTls13CertificateRequest and wrongly rewinds the buffer.

The bug was never triggered because of side effects of ShrinkBuffer (removed in
40cb6e0853)
2022-07-21 16:35:43 +02:00
a18b1939ac Fixed typo in dox_comments 2022-07-21 10:19:51 +02:00
c60fae8731 wc_Sha256Free checks lockDepth for Espressif RTOS 2022-07-21 09:08:10 +02:00
bd28b52aaa #include "wolfssl/wolfcrypt/settings.h" 2022-07-21 09:06:01 +02:00
9da0ff0f31 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into ESP32_HW_Update_PR 2022-07-21 08:21:17 +02:00
58aec606c6 wolfSSL license, not wolfSSH 2022-07-21 08:12:54 +02:00
6937062b9a wolfSSL license, not wolfSSH 2022-07-21 08:09:19 +02:00
a4e3dc9638 Merge pull request #5379 from douzzer/20220720-fixes
20220720-fixes
2022-07-20 21:34:08 -06:00
8605195709 Support for asynchronous session ticket callback (can return WC_PENDING_E). Requires wolfAsyncCrypt support. ZD 14420. 2022-07-20 16:43:17 -07:00
542c53f3ac snip out errant "#/" strings added to various text files by copyright boilerplate update in 8eaa85e412. 2022-07-20 18:23:28 -05:00
a3fd714501 configure.ac: allow --enable-opensslextra with --enable-linuxkm if --enable-cryptonly is also given. 2022-07-20 18:21:29 -05:00
3842889649 src/tls13.c: in SendTls13ClientHello(), move nullness check on WOLFSSL* ssl back to the start of the function. 2022-07-20 18:19:58 -05:00
706ab6aac0 Merge pull request #5377 from kareem-wolfssl/rsaKeyEncipher
Don't require digital signature bit for static RSA cipher suites.  Make wolfSSL_CTX_clear_options available without OPENSSL_EXTRA.
2022-07-20 15:28:55 -07:00
bd2b510487 Merge pull request #5376 from dgarske/sniff_tlsv12_sessticket
Fixes for sniffer session ticket resumption with TLS v1.2
2022-07-21 08:22:33 +10:00
9450fa1412 Merge pull request #5375 from LinuxJedi/se050-private-key-add
Add ECC private key insertion for SE050
2022-07-20 12:42:13 -07:00
741d61574b Make wolfSSL_CTX_clear_options available without OPENSSL_EXTRA. 2022-07-20 12:24:47 -07:00
873890316c Don't require digital signature bit for static RSA cipher suites. 2022-07-20 12:08:20 -07:00
564f79c91a Merge pull request #5371 from douzzer/20220719-linuxkm-get_thread_size-no-thunks
linuxkm: inhibit thunk generation in get_thread_size.
2022-07-20 11:48:48 -07:00
1c7f64cce9 Fixes for sniffer session ticket resumption with TLS v1.2. ZD14531. 2022-07-20 11:18:19 -07:00
b46a308544 Merge pull request #5361 from embhorn/zd14491
Fix for build with NO_TLS
2022-07-20 09:28:23 -07:00
e6da540fb3 Fix backwards behavior for various wolfSSL_ERR* functions.
wolfSSL_ERR_get_error and wolfSSL_ERR_peek_error_line_data should return the
earliest error in the queue (i.e. the error at the front), but prior to this
commit, they returned the latest/most recent one instead.

In DoAlert, we were adding an error to the queue for all alerts. However, a
close_notify isn't really an error. This commit makes it so DoAlert only adds
errors to the queue for non-close_notify alerts. In ReceiveData, similarly, we
were adding an error to the queue when the peer sent a close_notify, as
determined by ssl->error == ZERO_RETURN. Now, we don't add an error in this
case.
2022-07-20 08:56:48 -07:00
07d2940757 Fix issue caused by undo in IDE 2022-07-20 16:42:09 +01:00
ab60865178 Merge pull request #5374 from julek-wolfssl/dtls-multiple-msgs
ShrinkInputBuffer should not be called in the middle of ProcessReply
2022-07-20 08:27:56 -07:00
d7b4abfa0b Fixups to the SE050 ECC pkey insert function 2022-07-20 16:25:39 +01:00
719e814841 Merge pull request #5370 from rizlik/dtls13_partial_read_fixes
dtlsv1.3 fixes
2022-07-20 08:03:29 -07:00
e4c1e71b38 Merge pull request #5364 from embhorn/zd14519
Fix wolfSSL_Init error handling
2022-07-20 08:03:08 -07:00
f4191a102b Merge pull request #5304 from SKlimaRA/SKlimaRA/cert-pathlen
drafted pathlen for cert struct
2022-07-20 07:54:13 -07:00
aab2459d1f Merge pull request #5372 from JacobBarthelmeh/copyright
update copyright year to 2022
2022-07-20 07:52:05 -07:00
c029b23043 Merge pull request #5308 from SparkiDev/ecies_gen_iv
ECIES: Google Pay generates IV and places it before msg
2022-07-20 06:46:14 -07:00
2e0d53a07d fix: dtls13: use correct handshaketype on hello retry request 2022-07-20 15:25:50 +02:00
3850e6b554 fix: dtls13: use aes for record numbers encryption if using aes-ccm 2022-07-20 15:25:50 +02:00
066f17faad fix: dtls13: hello_retry_request type isn't an encrypted message 2022-07-20 15:25:50 +02:00
c0fc87342c tls13: avoid spurious state advances in connect/accept state machine 2022-07-20 15:25:50 +02:00
11dfb713e9 openssl_compatible_default: use DTLSv1.0 as minDowngrade in DTLS 2022-07-20 15:25:46 +02:00
6711756b03 dtls13: support stream-based medium
Don't assume that the underlying medium of DTLS provides the full message in a
single operation. This is usually true for message-based socket (eg. using UDP)
and false for stream-based socket (eg. using TCP).

Commit changes:

- Do not error out if we don't have the full message while parsing the header.
- Do not assume that the record header is still in the buffer when decrypting
  the message.
- Try to get more data if we didn't read the full DTLS header.
2022-07-20 14:53:07 +02:00
40cb6e0853 ShrinkInputBuffer should not be called in the middle of ProcessReply 2022-07-20 11:57:48 +02:00
ea34fb1643 Add ECC private key insertion for SE050
This adds a utility function which allows an ECC private key to be
inserted into the SE050's permanent storage.
2022-07-20 10:45:26 +01:00
66c5a947fd XSTRNCPY, fixed typos 2022-07-20 08:56:59 +02:00
09bba3510f ECIES: Google Pay ECIES
Generates IV and places it before msg
Uses 12 byte IV with AES-CTR
Add API to explicitly set KDF salt.
2022-07-20 09:30:47 +10:00
8eaa85e412 update copyright year to 2022 2022-07-19 10:44:31 -06:00
8b904e9082 Fix for build with NO_TLS 2022-07-19 11:12:18 -05:00
0dac3ec022 linuxkm: inhibit thunk generation in get_thread_size. 2022-07-19 10:20:04 -05:00
1a44bad8cc drafted test case for path len 2022-07-19 15:34:20 +02:00
3d721bd533 more WOLFSSL_CERT_EXT 2022-07-19 11:00:36 +02:00
6ce5f645f3 added ASN template code and WOLFSSL_CERT_EXT, still missing testcase 2022-07-19 10:38:47 +02:00
9a3efb67b8 Merge pull request #5368 from lealem47/disableAes
Fix for --disable-aes without --disable-aesgcm
2022-07-18 15:05:59 -07:00
feb3f889af Merge pull request #5369 from embhorn/zd14522
Fix var init in wc_ecc_shared_secret
2022-07-18 14:17:53 -07:00
cee9f9a871 Fix for --disable-aes without --disable-aesgcm 2022-07-18 10:26:20 -07:00
c63abe398f Merge pull request #5321 from miyazakh/tsip_add_usecase 2022-07-18 09:35:43 -06:00
f55fe7fccd Fix var init in wc_ecc_shared_secret 2022-07-18 09:13:07 -05:00
218ab7e396 Merge pull request #5362 from haydenroche5/ssl_set_options_public
Make wolfSSL_(get|set)_options available outside compat layer.
2022-07-15 10:36:29 -07:00
e7303d697b Fix wolfSSL_Init error handling 2022-07-15 09:30:30 -05:00
8a757ef7cf Merge pull request #5363 from dgarske/se050_curve25519
Fixes for SE050 Curve25519 endianness
2022-07-15 08:49:27 +01:00
15725400a7 addressed review comments 5 2022-07-15 13:46:30 +09:00
a1b7c29309 Make wolfSSL_(get|set)_options available outside compat layer.
Also make wolfSSL_CTX_get_options available.
2022-07-14 16:03:58 -07:00
dec8a7fd93 Fixes for SE050 Curve25519 endianness (SDK assumes little endian). Fix for ECC se050_ecc_shared_secret use of wrong pointer on error handle free. 2022-07-14 15:34:50 -07:00
6cc2665a81 Merge pull request #5358 from SparkiDev/sp_int_armv6
SP int ARM32: replace clz instruction when not supported
2022-07-14 15:32:00 -07:00
350ff552c4 Merge pull request #5351 from kojo1/renesas-csp 2022-07-14 16:10:34 -06:00
abba59f735 order of array of names for asn template build 2022-07-14 13:15:59 -07:00
8862e1f8cf resolve name conflict 2022-07-14 09:41:36 -07:00
e3c65d86d6 Merge pull request #5360 from LinuxJedi/se050-sign-fix-b
Missed a small part of my original SE050 sign fix
2022-07-14 06:39:11 -07:00
fd885d89eb Added multi thread use case
Improve not to use forward declaration struct definition

 - include ssl.h rather than forward declaration struct to resolve struct name
 - to include ssl.h, it needs to avoid cyclic reference for crypt structure. therefore, Sha and Aes definitions are moved to another header file
2022-07-14 17:25:21 +09:00
3f390efb24 Missed a small part of my original SE050 sign fix
Empty keyId handling now exists so we shouldn't return `BAD_FUNC_ARG`.
2022-07-14 07:47:33 +01:00
c211b90aab Merge pull request #5357 from dgarske/se050_fixes
Fixes for SE050 ED25519 private key loading and Curve25519/ECC handle leak
2022-07-14 07:14:54 +01:00
5098cdcd76 Merge pull request #5356 from dgarske/asn_rfc8410
Fixes for ED25519/ED448 private key with public key export (RFC8410)
2022-07-14 07:11:03 +01:00
f6c4e295b1 add more subject name support and expande REQ attributes creation support 2022-07-13 22:02:49 -07:00
5dcb1ba21f remove carriage return from CONF strings 2022-07-13 22:02:49 -07:00
b69af856de Ed ASN template: change for IMPLICIT public key in private key
Fix KATs in test.c to match new expected format.
2022-07-14 10:19:43 +10:00
33b3ebb1e9 SP int ARM32: replace clz instruction when not supported 2022-07-14 09:37:28 +10:00
2d5bc72c9b Fixes for ED25519/ED448 private key with public key export (RFC8410). Added length only support. 2022-07-13 16:17:08 -07:00
586ae71dac Fixes for SE050 ECC and Curve25519 with TLS. 2022-07-13 10:50:10 -07:00
a2b7b44163 Merge pull request #5342 from Uriah-wolfSSL/dtls_for_win
Example DTLS v1.3 build settings for Windows Visual Studio
2022-07-13 09:27:46 -07:00
065991bab5 Merge pull request #5348 from douzzer/20220707-attend-return-values
20220707-attend-return-values
2022-07-13 08:50:29 -07:00
1b6ce6150e unsigned pathlen 2022-07-13 09:07:02 +02:00
96fe356dd8 SP math
Enable ForceZero for SP math and all RSA.
Disable use of 128-bit type in SP unless WOLFSSL_UINT128_T_DEFINED is
defined.
2022-07-13 14:54:34 +10:00
69bf0345c4 Renesas cs+ project. Remove depreciated algorithms 2022-07-13 10:24:44 +09:00
dc231dc099 peer review: add explanatory comment for printf() macro in test.c; rearrange test.h to avoid awkward forward declaration and add some topical grouping. 2022-07-12 18:19:52 -05:00
a4e452ec6a New file for adding needed configuration options to enable DTLS including DTLS version 1.3. This is an example file to be used for testing, eval, demos, etc. 2022-07-12 15:53:21 -05:00
357ace8408 * Updated README.txt w/ how to use user_settings_dtls.h.
* Added dtls13.c to build project files.
* Added user_settiings.dtls.h to include.am.
2022-07-12 15:53:21 -05:00
b64949d564 wolfcrypt/benchmark/benchmark.c: fix gating for #include <errno.h>, and add #include <unistd.h> for _exit(). 2022-07-11 23:15:43 -05:00
ccc5952369 global fixup to check or explicitly ignore return values from failable library/system calls that weren't already being checked;
add wolfCrypt error codes IO_FAILED_E "Input/output failure" and SYSLIB_FAILED_E "System/library call failed";

tests/api.c and tests/unit.c: flush stdout for error message in Fail() macro, add fflush(stdout) after printf()s, print success message at end of unit_test(), and send several error messages to stderr instead of stdout;

wolfcrypt/test/test.c: add fallthrough macro definition of printf() that pairs it with fflush(stdout);

unit.h: in definition of macro AssertPtr(), add PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\"");

sp_int.c: refactor several lingering instances of "if (0) { ... }" code pattern to #if 0 ... #endif.
2022-07-11 22:28:09 -05:00
e30899b676 Merge pull request #5334 from LinuxJedi/se050-fixes
Fixes to SE050 port
2022-07-11 16:15:08 -07:00
22c3a1fc6f Merge pull request #5346 from dgarske/async_rel_v5.4.0
Async release v5.4.0 patches
2022-07-11 17:11:06 -06:00
34c576d2a7 Fixes for possible NULL dereference for heap hint in pk.c Fix typo in api.c test for dynamic type. 2022-07-11 14:41:11 -07:00
57aac1c50b Merge pull request #5345 from JacobBarthelmeh/release
Release version 5.4.0
2022-07-11 11:10:10 -07:00
a48129eb99 update README for release 2022-07-11 07:28:15 -07:00
032d59b077 adjust sizeof type for getsockopt argument 2022-07-11 07:10:11 -07:00
86662bca2f update library version to 5.4.0 2022-07-08 16:04:26 -07:00
7379e377ab cast for g++ warning 2022-07-08 15:11:29 -07:00
983b9fc5fb Merge pull request #5343 from dgarske/ecc_oid_coding
Fixes for ECC OID encoding/decoding
2022-07-08 15:38:47 -06:00
4892435004 Fix for wc_ecc_get_curve_id_from_oid with combinations of HAVE_OID_ENCODING and HAVE_OID_DECODING. Fix in SetCurve for unused outSz with HAVE_OID_ENCODING. 2022-07-08 13:00:09 -07:00
66aed8193a Merge pull request #5341 from dgarske/various_20220708
Various fixes and cleanups
2022-07-08 13:56:51 -06:00
56325143f1 Merge pull request #5340 from anhu/micrium_alt_ecc_size
Gate ALT_ECC_SIZE on NO_MALLOC and STATIC_MEMORY since they conflict.
2022-07-08 09:53:07 -07:00
720030b5a9 Improvements to error handling for AddSessionToClientCache. 2022-07-08 09:06:51 -07:00
03a32250da Fix for KCAPI HMAC forcing use of software for HKDF. 2022-07-08 09:06:30 -07:00
3d124c093e Fix PK function name in log. Remove the ECC logging (spams benchmark with --enable-debug). 2022-07-08 09:06:08 -07:00
905f71d80d Fix with macro redefinition error if building with NO_WOLFSSL_ALLOC_ALIGN. 2022-07-08 09:05:29 -07:00
f7595cc77d Merge pull request #5338 from julek-wolfssl/tcp-sendto
sendto can't specify addr on a TCP socket
2022-07-08 09:39:39 -06:00
2d6b6d62b2 Gate ALT_ECC_SIZE on NO_MALLOC and STATIC_MEMORY since they conflict. 2022-07-08 10:52:01 -04:00
a2b75e313a Merge pull request #5339 from douzzer/20220708-DUW_TEST-bugprone-macro-parentheses
tests/api.c: fix bugprone-macro-parentheses in DUW_TEST().
2022-07-08 07:46:20 -07:00
48d3cf593e tests/api.c: fix bugprone-macro-parentheses in DUW_TEST(). 2022-07-08 07:57:29 -05:00
251642a44a sendto can't specify addr on a TCP socket
From the man page
       If  sendto()  is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET) socket, the arguments dest_addr and
       addrlen are ignored (and the error EISCONN may be returned when they are not NULL  and  0),  and  the  error
       ENOTCONN  is  returned  when the socket was not actually connected.
2022-07-08 12:14:23 +02:00
58cb91602d Merge pull request #5337 from douzzer/20220707-DtlsUpdateWindowGTSeq-overshift
20220707-DtlsUpdateWindowGTSeq-overshift
2022-07-07 21:53:26 -07:00
c9e9a421e9 Merge pull request #5336 from SparkiDev/aes_ctr_opt
AES-CTR: improve performance when multiple blocks
2022-07-07 21:51:08 -07:00
91438c1087 wolfssl/wolfcrypt/settings.h: refactor Math Library Selection for clarity, and to include WOLFSSL_SP_MATH as an available math back end. 2022-07-07 21:02:16 -05:00
49d292ec4f Merge pull request #5335 from SparkiDev/ecc_imp_exp_fix
ECC import and export fixes
2022-07-07 17:52:20 -07:00
b952c2f777 src/internal.c: add codepath in _DtlsUpdateWindowGTSeq() to avoid a word32 overshift. 2022-07-07 19:36:20 -05:00
2bfac42d65 AES-CTR: improve performance when multiple blocks
When in and out aren't the same pointer, for multiples of block size
input:
  - generate the counters into the output buffer
  - encrypt output buffer
  - XOR in the input
Faster than encrypting a block at a time.
2022-07-08 09:56:20 +10:00
70b9833e98 ECC import and export fixes
On raw import, don't import ordinates that are larger than the curve
size.
On export of compressed point, don't export ordinate if it is larger
than the curve size.
2022-07-08 08:54:53 +10:00
4e1e1e922a Merge pull request #5278 from ejohnstown/dtls-seq
Refactor DTLS Window Update (Fix #5211)
2022-07-07 10:22:21 -07:00
5e453ad932 Merge pull request #5323 from SparkiDev/sha512_arm32_asm_align 2022-07-07 09:47:37 -06:00
e295328436 Fix window handling around word32 boundary 2022-07-07 17:37:10 +02:00
34d897e433 Fixes to SE050 port
This fixes the following things:

* Memory leaks in SE050 SHA messages
* Add key to SE050 for ECC sign hash function
* Remove circular include
* Correct prototype for `se050_hash_final`
* A few defined check fixes
2022-07-07 16:11:54 +01:00
a771baf551 Merge pull request #5332 from SparkiDev/memusage_fix_2
SP math: fix configure.ac to allow its use
2022-07-07 07:40:13 -07:00
738d79c5d5 Merge pull request #5330 from SparkiDev/aesni_no_sse4
AESNI: fix configure to use minimal compiler flags
2022-07-06 20:44:40 -07:00
2111d6b179 Merge pull request #5322 from SparkiDev/sp_math_all_arm32_div_word_fix
SP math all: fix div word for ARM32
2022-07-06 22:18:07 -05:00
74baa0dafa SP math: fix configure.ac to allow its use
Choosing SP and SP math was resulting in only integer.c being used.
Fixed now.
Reorder realloc calls for memory logging to ensure scripts can match
allocate and free calls.
2022-07-07 12:16:12 +10:00
644050a736 Merge pull request #5329 from douzzer/20220706-fips-and-aarch64-fixes
20220706-fips-and-aarch64-fixes
2022-07-06 18:39:38 -07:00
cb6fa921a4 Merge pull request #5328 from haydenroche5/cmake_sp_math_all_default
Make changes to CMake to support SP math default.
2022-07-06 18:39:30 -07:00
8f3449ffea Refactor DTLS Window Update (Fix #5211)
1. Rename _DtlsUpdateWindow() as wolfSSL_Dtls_UpdateWindow() and make
   it public so it may be tested.
2. Rename the internal functions DtlsWindowUpdate(), DtlsWindowCheck(),
   and DtlsUpdateWindowGTSeq() as _DtlsWindowUpdate() and
   _DtlsWindowCheck(), and _DtlsUpdateWindowGTSeq().
3. When updating the DTLS sequence window, and the next sequence
   number (lo) wraps to zero, increment the next sequence number (hi)
   by 1.
4. Fix an off-by-one error that wrapped around when saving the
   packet sequence number in the bit-field window.
5. Adding a test for wolfSSL_DtlsUpdateWindow() function. With many test
   cases. It is set up in a table format with running check values.
6. Change location of incrementing the difference when calculating the
   location for setting the bit.
7. Updated the check of the sequence difference in the GT scenario.
8. In the DTLS window update functions remove newDiff and just use diff.
9. Handle the cases where the DTLS window crosses the high order word
   sequence number change.
10. Add a debug option to print out the state of the DTLS sequence number
   window.
2022-07-06 18:20:06 -07:00
90c2f4ad00 Merge pull request #5327 from kareem-wolfssl/connectRetFix
Fix storage of SendBuffered's return code in wolfSSL_Connect.
2022-07-06 17:53:04 -07:00
9ba77300f9 AESNI: fix configure to use minimal compiler flags 2022-07-07 09:30:48 +10:00
992c7b3b6f SP math all: fix div word for ARM32
Fixup sp_mulmod NULL access.
2022-07-07 08:56:31 +10:00
82b1dc0cd0 wolfcrypt/src/asn.c: move final return in DecodeECC_DSA_Sig() outside the NO_STRICT_ECDSA_LEN gate, to avoid no-return-from-non-void. 2022-07-06 17:39:59 -05:00
eff4fe398b src/include.am: fix gating around sha* and BUILD_ARMASM, to avoid empty-translation-unit warnings for sha{256,512}.c on armasm builds. 2022-07-06 17:37:43 -05:00
7c49449a79 wolfcrypt/src/port/arm/armv8-sha512.c: gate out Sha512_Family_GetHash() in builds that have 224 and 256 bit hashes gated out, to fix unused function warning. 2022-07-06 17:35:15 -05:00
6b6abfac54 examples/client/client.c: remove break after err_sys() to mollify clang-tidy unreachable-break sensor. 2022-07-06 17:32:26 -05:00
19106a9510 configure.ac and tests/api.c: lock out compkey on FIPS 140-3 RC12 and ready, and add backward-compat code in test_wc_ecc_export_x963_ex() to allow RC12 compkey builds to pass unit.test. 2022-07-06 17:31:56 -05:00
d9bf39ffaa Make changes to CMake to support SP math default.
We recently made SP math the default big integer math library. Some changes to
the CMake code are needed for this to work.
2022-07-06 14:14:12 -07:00
44a49aeefa Fix potentially uninitialized variables in Dtls13SetRecordNumberKeys. 2022-07-06 13:45:15 -07:00
c8f5bd3d61 Fix storage of SendBuffered's return code in wolfSSL_Connect. Store in ret initially, only store in ssl->error if there's an error. This matches the logic in wolfSSL_accept. 2022-07-06 12:09:47 -07:00
b2d1bf96ed Merge pull request #5276 from rizlik/dtls13_client_downgrade
Dtls: improve version negotiation
2022-07-06 11:57:53 -07:00
a7fa7875e4 Merge pull request #5244 from julek-wolfssl/wpas-dpp
Support for new DPP and EAP-TEAP/EAP-FAST in wpa_supplicant
2022-07-06 11:35:52 -07:00
e92034cf6f Merge pull request #5274 from JacobBarthelmeh/Certs
remove subject/issuer email from altEmailNames list
2022-07-06 10:48:21 -07:00
e2484a97f2 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into ESP32_HW_Update_PR 2022-07-06 09:32:07 -07:00
8bb6ff8dbb Espressif HW acceleration update & cleanup 2022-07-06 09:30:49 -07:00
711b2bb17a add a test case 2022-07-06 09:39:03 -06:00
a171bebba4 Fix the wc_EccPublicKeyToDer_ex doxy. 2022-07-06 07:58:18 -07:00
3abffc3a3c doc: add documentation for wolfDTLS[v1_3]_*_method() 2022-07-06 16:18:44 +02:00
683adb5917 tests: add dtls downgrade tests 2022-07-06 16:18:44 +02:00
fd4836772b examples: support DTLS version downgrading 2022-07-06 16:18:44 +02:00
df7e81d187 dtls: support version negotiation 2022-07-06 16:18:44 +02:00
8fe3f51ecb dtls13: client: recompute transcript hash on downgrade
If a lower version is negotiated, the transcript hash must be recomputed using
the <= v1.2 rules.
2022-07-06 16:18:44 +02:00
5d74c49ecb dtls13: allow processing of HelloVerifyRequest to support downgrade
HelloVerifyRequest is used in DTLSv1.2 to perform a return routability check, so
it can be the legitim reply from a DTLSv1.2 server to a ClientHello.
2022-07-06 16:18:44 +02:00
ec8149cd69 Merge pull request #5324 from julek-wolfssl/dtls13-hrr-fix
TLSX_COOKIE is only defined with WOLFSSL_SEND_HRR_COOKIE
2022-07-06 06:56:25 -07:00
9b085a44be sessionSecretCb should only be called when a ticket is present 2022-07-06 15:08:57 +02:00
63b4c475d4 wolfSSL_set_session_secret_cb: fix for NULL input 2022-07-06 14:23:08 +02:00
39e53c2b7c Add wc_EccPublicKeyToDer_ex doxygen entry 2022-07-06 11:59:29 +02:00
ef73409fd4 TLSX_COOKIE is only defined with WOLFSSL_SEND_HRR_COOKIE 2022-07-06 10:04:15 +02:00
8b73feb8ef SHA-512 ARM NEON: ensure data being hashed is 64-bit aligned 2022-07-06 16:18:18 +10:00
ff6edbff94 refactor name constraint checks 2022-07-05 17:20:50 -06:00
9a256ca002 Merge pull request #5288 from haydenroche5/openldap
Add --enable-openldap option to configure.ac.
2022-07-05 16:04:51 -07:00
4376ade9c8 Merge pull request #5123 from fabiankeil/configure-amd64-support
configure: Improve defaults for 64-bit BSDs
2022-07-05 13:52:02 -07:00
08488b0fae Merge pull request #5318 from embhorn/gh5314
Fix typos and bad macro names
2022-07-05 12:34:35 -07:00
f5a5d4ada5 Enhance OpenLDAP support.
- Add --enable-openldap to configure.ac
- Fix some issues around subject alt names and the WOLFSSL_GENERAL_NAME struct.
2022-07-05 10:40:07 -07:00
eb9a9ceef8 configure: Improve defaults for 64-bit BSDs
... by consistently treating host cpu "amd64" like host cpu "x86_64".

Tested on ElectroBSD amd64.
2022-07-05 19:37:31 +02:00
ded3f4e9b6 Merge pull request #5284 from julek-wolfssl/dtls-good-ch-cb
DTLS 1.3: additions for event driven server in wolfssl-examples
2022-07-05 10:14:59 -07:00
1c009e8f91 Merge pull request #5311 from SparkiDev/ed_check_pubkey
Ed25519/Ed448: assume public key is not trusted
2022-07-05 09:25:50 -07:00
394f36a0d7 Fix typos and bad macro names 2022-07-05 10:31:11 -05:00
4caffee590 ForceZero the private key on import error 2022-07-05 13:44:31 +02:00
20e5c98b2c Error out when server indicates resumption but does full handshake 2022-07-05 09:42:39 +02:00
fd7bf8d04d Do resuming check as soon as we get a non-resumption msg 2022-07-05 08:49:00 +02:00
144f2612e4 wc_ecc_export_x963_ex returns LENGTH_ONLY_E on a NULL output 2022-07-05 08:49:00 +02:00
8e84560f71 CSR: confirm the signature when verify == VERIFY 2022-07-05 08:49:00 +02:00
afaf41823c wpa_supplicant uses larger challenge passwords for x509 requests 2022-07-05 08:49:00 +02:00
5179741ddb wpas: validate ecc points are on the curve 2022-07-05 08:48:37 +02:00
ee3636f2e7 wc_EccPublicKeyToDer_ex: exporting the public key in compressed form 2022-07-05 08:48:18 +02:00
448cde5a4b Support for new DPP in wpa_supplicant
- Add null check to asn template code in MakeCertReq and test
- ENABLED_ECCCUSTCURVES can also be "all"
2022-07-05 08:48:18 +02:00
4a962b7fb2 Ed25519/448: improvements
Check lengths of buffers in import functions.
priv/pub key set flag set on success only.
2022-07-05 09:02:05 +10:00
1b64b82a6f Merge pull request #5316 from LinuxJedi/fix-embos-mutex
Use the correct mutex type for embOS
2022-07-04 11:51:20 -07:00
07b8f45d35 Merge pull request #5315 from rizlik/dtls_doDtls_fix
fix: examples/server: dtls mode checking
2022-07-04 10:20:20 -07:00
f8c67345d6 Use the correct mutex type for embOS
OS_MUTEX_Lock() is acutally a non-blocking mutex lock, for
wc_LockMutex() we need a blocking mutex. Switch to this.
2022-07-04 15:59:36 +01:00
9dc2c27e3d Expand wolfDTLS_SetChGoodCb() docs 2022-07-04 14:31:24 +02:00
10c8a1668e Reset cookie when resetting DTLS 1.3 state 2022-07-04 12:52:25 +02:00
a8adde66c8 Use wc_HmacInit and wc_HmacFree in cookie logic 2022-07-04 12:51:50 +02:00
00391a5ace Rename callback to wolfDTLS_SetChGoodCb and add doxygen for it. Clarify DTLS_CTX.connected. Fix build errors for ./configure --enable-dtls --enable-dtls13 --disable-examples CFLAGS="-DNO_WOLFSSL_SERVER". 2022-07-04 11:08:39 +02:00
7ea13bf5bf Apply connected to sendto and address code review 2022-07-04 11:08:39 +02:00
dd7073740b DTLS 1.3: tie cookie to peer address 2022-07-04 11:08:39 +02:00
e605cfeccb Add docs for new features 2022-07-04 11:08:39 +02:00
afdd5648aa Address code review 2022-07-04 11:08:39 +02:00
d72edd03b8 dtls: wolfSSL_set_dtls_fd_connected
wolfSSL_set_dtls_fd_connected sets the connected socket file descriptor. This descriptor should be called without addr and addr_len.
2022-07-04 11:08:39 +02:00
c6aa4fc526 DTLS 1.3: allow the server to operate without maintaining state 2022-07-04 11:08:39 +02:00
8fb48464e3 Add callback when we parse a verified ClientHello 2022-07-04 11:08:39 +02:00
80f3db6e1d fix: examples/server: dtls mode checking
This fixes using ssl to check if we are using dtls or not, when ssl is not yet
valid.

Fix: 060dfe1a69
2022-07-04 10:21:11 +02:00
1077829f9d Merge pull request #5313 from douzzer/20220701-sp_div-deadstore
fix clang-analyzer-deadcode.DeadStores in sp_div().
2022-07-04 08:32:50 +10:00
7b9c214b3c Merge pull request #4985 from kareem-wolfssl/iarWarningsFix
Fix compilation warnings from IAR.
2022-07-04 08:23:26 +10:00
b16c2a2aef fix clang-analyzer-deadcode.DeadStores in sp_div(). 2022-07-01 23:49:58 -05:00
5819332f89 Merge pull request #5312 from dgarske/fips_v5dev
FIPS in core hash using SHA2-256 and SHA2-384
2022-07-01 23:25:52 -05:00
6c7db7318e Merge pull request #5309 from kareem-wolfssl/arrayBoundFix
Pass in and check output length in SetCurve.
2022-07-01 18:58:42 -07:00
b9be5c2c24 Update to FIPS v5-ready will use latest master. Support for FIPS in core hash using SHA2-256 and SHA2-384 in fips_test.h. Fixes for MATH_INT_T. Fix error: ‘tls13_kdf_test’ declared ‘static’ but never defined. 2022-07-01 15:40:21 -07:00
bb68766bda For ED255219 and ED448 if importing private only and public key is already set then check it. 2022-07-01 14:13:45 -07:00
90749b7f88 Don't declare tls13_kdf_test if TLS 1.3 is not enabled, to avoid unused function warning. 2022-07-01 13:22:16 -07:00
96aedc2f47 Fix SetCurve max sizes. Add fix for potentially uninitialized type in ProcessReplyEx. 2022-07-01 13:18:33 -07:00
7a7d8d170d Pass in and check output length in SetCurve. 2022-07-01 13:18:33 -07:00
bd75e1d6a4 Merge pull request #5307 from kareem-wolfssl/miscfixes2
Fix a couple of STM32 bugs, and add some missing mutex frees.
2022-07-01 09:46:22 -07:00
0459e83a59 Merge pull request #5310 from SparkiDev/memusage_fix_1
TLS memusage: reduce usage
2022-07-01 09:13:05 -07:00
2c943282f0 Ed25519/Ed448: assume public key is not trusted
In defense against attack, assume the imported public key is not trusted
and check it matches the private key if set.
Added APIs that allow application to explicitly trust public key.
Original APIs default to not trusting public key.
2022-07-01 09:05:43 -07:00
b9a8f18a97 Merge pull request #5300 from douzzer/20220629-multi-test-fixes
20220629-multi-test-fixes
2022-07-01 16:22:05 +10:00
7d58dc5678 TLS memusage: reduce usage
Reduce the amount allocated to reduce maximum overall dynamic memory
usage.
Rework ServerKeyExchange by extracting the handling of the signed data.
2022-07-01 14:24:59 +10:00
b2e7f4a8eb Fix cast spacing. Don't cast in wolfSSL_X509_set_version, check is valid as is. 2022-06-30 16:26:43 -07:00
7555cd0685 Fix a couple of STM32 bugs, and add some missing mutex frees. 2022-06-30 16:11:16 -07:00
402a4dafd4 Merge pull request #5306 from kareem-wolfssl/ltc_ed235519
Fix missing return checks in KSDK ED25519 code.
2022-06-30 16:06:45 -07:00
fc5f1f5eca Merge pull request #5305 from dgarske/cryptonly
Improvements to configure.ac cryptonly and math selection
2022-06-30 17:55:27 -05:00
2bdcbcc8be src/tls13.c: fix whitespace. 2022-06-30 17:17:50 -05:00
4f6527353b src/{pk.c,x509.c}: style/clarity cleanups from dgarske. 2022-06-30 17:07:35 -05:00
1a9388b935 src/pk.c: fix misuses around snprintf(). 2022-06-30 17:07:35 -05:00
28213ad198 src/x509.c: fix wolfSSL_X509_signature_print() to print raw signature algorithm as hex digits, not as an (unprintable) string; fix printed-null bug in wolfSSL_X509_NAME_print_ex() (relates particularly to calls from wolfSSL_X509_NAME_print_ex_fp()). 2022-06-30 17:07:35 -05:00
5bd8288b37 fix printed-null bug in wolfssl_print_number(). 2022-06-30 17:07:35 -05:00
b7ec529f61 wolfcrypt/src/siphash.c: in wc_SipHash(), use FALL_THROUGH macro, not /* fall-through */. 2022-06-30 17:07:35 -05:00
867a1f7afa Merge pull request #5289 from TakayukiMatsuo/tls13 2022-06-30 15:49:53 -06:00
e09bbb1989 Fix compilation warnings from IAR. 2022-06-30 14:30:06 -07:00
13beadbfc3 Fix missing return checks in KSDK ED25519 code. 2022-06-30 13:35:00 -07:00
2f1e236305 Improvements to --enable-cryptonly in configure.ac output. Improvement to math select order in configure.ac and stray heap math=yes. 2022-06-30 12:42:55 -07:00
ed1fdc410e Merge pull request #5303 from SparkiDev/match_dyn_type_fix_1
Fix mismatched dynamic types
2022-06-30 08:56:43 -07:00
26a62b4b9e drafted pathlen for cert struct 2022-06-30 17:16:10 +02:00
ba19737627 Add support for TLS1.3 2022-06-30 23:00:05 +09:00
e8e35c9a92 Merge pull request #5301 from SparkiDev/aes_gcm_word_ct
AES-GCM: make word implementation of GMULT constant time
2022-06-29 20:26:33 -07:00
1ba9ea9759 Fix mismatched dynamic types 2022-06-30 13:00:57 +10:00
9cc928cb29 Merge pull request #5299 from SparkiDev/sp_submod_fix
SP int math; submod fix
2022-06-29 18:52:15 -07:00
8b93d4510d AES-GCM: make word implementation of GMULT constant time
If performance is impacted then define: AES_GCM_GMULT_NCT
2022-06-30 09:29:04 +10:00
0159f17692 SP int math; submod fix
Fix for sp_submod() to reduce by modulus when a or b are equal to
modulus as well as when greater.
2022-06-30 08:53:25 +10:00
f2acaa8ee9 Merge pull request #5242 from SKlimaRA/SKlimaRA/strict-verification
zd14249
2022-06-30 08:19:42 +10:00
28d149a103 Merge pull request #5297 from ejohnstown/esp-build
ESP-IDF Build Cleanup
2022-06-29 14:03:02 -07:00
e941a729a7 Merge pull request #5290 from embhorn/gh5270
Add support for aligned data with clang llvm
2022-06-29 12:14:42 -05:00
2257030792 Merge pull request #5296 from dgarske/sniffer
Sniffer fixes (async TLS v1.3, async removal of `WC_HW_WAIT_E` and sanitize leak)
2022-06-29 09:16:54 -07:00
999d3b3ab7 Merge pull request #5298 from douzzer/20220628-multi-test-and-crossbuild-fixes
20220628-multi-test-and-crossbuild-fixes
2022-06-29 09:14:59 -07:00
5adf7e4eb7 wolfcrypt/src/asn.c wc_BuildEccKeyDer(): fix for clang-analyzer-deadcode.DeadStores. 2022-06-28 19:14:58 -05:00
90aaeb283e wolfcrypt/src/siphash.c: add missing !WOLFSSL_NO_ASM clause in gate around inline asm. 2022-06-28 18:19:58 -05:00
ce61653a9a wolfcrypt/src/asn.c: fixes for ARM portability (GetASN_Items()), unintended fallthrough (OidFromId()), and uninitialized variable (DecodeSubjInfoAcc()). 2022-06-28 18:18:42 -05:00
17659ed48c configure.ac: when --enable-fips=disabled, don't touch DEF_SP_MATH/DEF_FAST_MATH;
don't enable sp-math-all asm gates when !ENABLED_ASM;

add --with-arm-target to allow selecting thumb or cortex in conjunction with a full --host tuple (e.g. --host=armv6zk-softfloat-linux-gnueabi --with-arm-target=thumb).
2022-06-28 18:15:28 -05:00
d76c46a96f Fix for sniffer async issue with TLS v1.3. 2022-06-28 16:01:06 -07:00
f51c29d3ca Merge pull request #5293 from SparkiDev/asnt_setecc
ASN template: Handle HAVE_OID_ENCODING
2022-06-28 15:45:13 -07:00
e56394a2ab ESP-IDF Build Cleanup
1. Update the list of files to leave out of the build. They are ones
   that are included into ssl.c automatically.
2022-06-28 15:38:58 -07:00
092b37f709 Merge pull request #5287 from haydenroche5/aes_ctr_clear_left_on_iv_set
Clear the leftover byte count in Aes struct when setting IV.
2022-06-29 08:30:01 +10:00
28df62921a Merge pull request #5292 from dgarske/freertos_memtrack
Fix for using track memory feature with FreeRTOS.
2022-06-29 08:00:36 +10:00
e49f07694e Fix for sniffer possible malloc of zero size causing a -fsanitize=address leak report. 2022-06-28 12:54:25 -07:00
5ade360d9e Fix to avoid using WC_HW_WAIT_E for sniffer. ZD14398 2022-06-28 12:38:57 -07:00
b87b255d52 Merge pull request #5295 from rizlik/dtls13_bugfix
server: fix wrong minVersion setting when non in dtls
2022-06-28 09:35:23 -07:00
741393e84f Merge pull request #5291 from kaleb-himes/FRDM-K64-Fixes
Add necessary includes for cross-builds
2022-06-28 09:35:06 -07:00
14c65e0117 Merge pull request #5281 from miyazakh/example_japanese_translate 2022-06-28 10:08:06 -06:00
cb80ffc1b5 Merge pull request #5251 from kojo1/ja 2022-06-28 09:51:21 -06:00
d4d7e2e5f2 Merge pull request #5294 from SparkiDev/sp_math_all_no_128bit
SP math all: don't use sp_int_word when SQR_MUL_ASM available
2022-06-28 07:38:42 -07:00
060dfe1a69 server: fix wrong minVersion setting when non in dtls 2022-06-28 12:10:18 +02:00
22336d30e5 SP math all: don't use sp_int_word when SQR_MUL_ASM available
1. _WIN64 doesn't have 128-bit type but now can use 64-bit sp_int_digit
when assembly code snippets are being used.
2. Fix sp_div() to support values closer to maximum size.
3. Fix builds to work for more configurations.
4. Have ECC uncompressed code keep intermediate values in range of
maximum (x^3 calculation fixed).
5. Fix configuation.ac's check of FIPS for using signed SP Math All.
Default now not signed as intended.
2022-06-28 15:51:53 +10:00
3c3a90c988 ASN template: Handle HAVE_OID_ENCODING
When HAVE_OID_ENCODING is defined, the named curve OID is encoded rather
than the full OID.
Use SetCurve to get the OID encoding in ASN template implemenation.
2022-06-28 09:04:42 +10:00
31498de7a9 Fix for using track memory feature with FreeRTOS. 2022-06-27 14:08:45 -07:00
9d11e9092f Add necessary includes for cross-builds 2022-06-27 13:50:27 -06:00
94e7eacc5f Merge pull request #5072 from JacobBarthelmeh/Compatibility-Layer
add support for importing private only EC key to a WOLFSSL_EVP_PKEY s…
2022-06-27 12:34:00 -07:00
456e463640 Merge pull request #5283 from SparkiDev/sp_arm32_asm_rework
SP ASM ARM32: reworked generation using common asm ruby code
2022-06-27 09:17:20 -07:00
b84b808b1b Merge pull request #5167 from ejohnstown/cac-ext
Add support for some FPKI certificate cases, UUID, FASC-N, PIV extension
2022-06-27 09:06:15 -07:00
999fa8394e SP ASM ARM32: reworked generation using common asm ruby code
Add support for ARMv6 and ARMv3.
2022-06-27 11:19:50 +10:00
10dfd8d129 Clear the leftover byte count in Aes struct when setting IV.
Setting the key already does this. The same needs to be done when setting the
IV.
2022-06-26 15:56:05 +04:00
55414290df Merge pull request #5286 from douzzer/20220624-multi-test-fixes-sp-math-default
20220624-multi-test-fixes-sp-math-default
2022-06-24 19:26:49 -07:00
9211825121 sp_int.c: fix refactor of undefined-semantics shift in _sp_mul(). 2022-06-24 18:04:51 -05:00
790584113f configure.ac: WOLFSSL_WPAS[_SMALL] requires OPENSSL_EXTRA. 2022-06-24 16:38:56 -05:00
49740c5543 initialize variables 2022-06-24 15:21:20 -06:00
9a29dfc8cb fix whitespace. 2022-06-24 16:08:38 -05:00
047c662af8 fix math errors unmasked by change to sp-math-all as default math back end. 2022-06-24 15:56:54 -05:00
940d0140f9 configure.ac fixes related to change in default math back end (to sp-math-all): wolfRand doesn't use fastmath;
FIPS v5-dev follows the non-FIPS default (now sp-math-all);

add -DWC_NO_CACHE_RESISTANT to AM_CFLAGS when $ENABLED_HARDEN != yes;

add ENABLED_BIGNUM sensor and use it in linuxkm math back end assert;

add configuration callout for "Side-channel Hardening" reporting value of $ENABLED_HARDEN.
2022-06-24 15:55:08 -05:00
1977a13754 improve comment for FPKI additions 2022-06-24 12:04:26 -06:00
8dfcc76f50 Merge pull request #5279 from embhorn/gh5273
Fix config with WOLFSSL_WPAS_SMALL
2022-06-24 11:22:58 -06:00
5ef507c78d Merge pull request #5280 from douzzer/20220623-enable-dh-const
--enable-dh=const
2022-06-24 08:29:35 -07:00
ce977e8c0b requested review changes 2 2022-06-24 15:37:10 +02:00
00b82888bc Merge pull request #4759 from dgarske/sp_math_default
Enable wolfSSL SP Math all (sp_int.c) by default
2022-06-23 16:14:54 -07:00
c34c32f621 translated Japanese messages 2022-06-24 08:09:28 +09:00
43e11ec756 improve comments for subject name email matching 2022-06-23 15:52:28 -06:00
4de90efbe2 clear out PKEY when setting new key 2022-06-23 14:21:53 -07:00
a5250482ce examples/: refactor a couple help strings to avoid hitting clang-tidy bugprone-suspicious-missing-comma. 2022-06-23 15:25:23 -05:00
768737d21e configure.ac: support --enable-dh=const, and link with libm ("LT_LIB_M") only if ENABLED_DH = yes. 2022-06-23 15:00:59 -05:00
79ea30a957 memory free on failure, spelling, better function name 2022-06-23 13:40:45 -06:00
02dde373d1 Add support for aligned data with clang llvm 2022-06-23 13:26:11 -05:00
78d3284c3c Fix for FIPS 140-2 and older ACVP math selection. Fix for building with "--disable-sp-math-all --disable-fastmath". Fix for building SAKKE with HAVE_WOLF_BIGINT. 2022-06-23 11:10:44 -07:00
e2ad62b3d1 Merge pull request #5266 from rizlik/udp_help
examples: update usage() with DTLSv1.3 version
2022-06-23 09:27:53 -07:00
7fb17e0584 Fix build error with --enable-opensslextra=x509small --enable-debug 2022-06-23 11:26:57 -05:00
1cdc81546d Fix config with WOLFSSL_WPAS_SMALL 2022-06-23 09:19:14 -05:00
ee12c12e98 Fixes required to make SP Math default
fasthugemath means turn on fastmath
Use sp_int_digit and not sp_digit in sp_int.c.
test.c needs to use large static buffer when SP Math used like fastmath.
When building static memroy, SP math all without WOLFSSL_SP_NO_MALLOC is
a valid configuration.
Fix freeing of bigint in sp_int.c.
Cast x to a signed value to negate and then back to unsigned. (For
Windows builds.)
Remove warning about empty file on Windows about integer.obj.
Allow RSA verify only and RSA public only to be used with other public
key algorithms.
If building for FIPS, then older versions of RSA and ECC require SP Math
to support negative numbers.
Get old FIPS files building with SP int.
Disallow --enable-sp-math and --enable-sp-math-all.
When just --enable-sp-math on configuration line then disable SP Math
all.
2022-06-23 14:15:54 +10:00
8d804f6378 Merge pull request #5260 from dgarske/sp_ecc_nb_hash
Fix for SP math ECC non-blocking to always check `hashLen`
2022-06-23 07:59:28 +10:00
fdc4cdf5ec examples: update usage() with DTLSv1.3 version 2022-06-22 18:50:18 +02:00
acc9f3701a Merge pull request #5261 from dgarske/sha3_shake_flags
Configure fixes for SHA3 and SHAKE256
2022-06-22 11:50:28 +10:00
40dda7e80f fix XMALLOC in test and add filesystem macro guard 2022-06-21 17:24:14 -06:00
deb0c3e6fa Merge pull request #5272 from lealem47/skip
Display SKIP instead of PASS when tests skipped for make check
2022-06-21 16:06:58 -07:00
4db7732d78 Fixes for --enable-sha3 reproducibility with small. Fixes for shake256 typo and making sure WOLFSSL_NO_SHAKE256 gets set when disabled. Replaces PR #4225. 2022-06-21 16:02:42 -07:00
7d62fd09e4 remove subject/issuer email from altEmailNames list 2022-06-21 16:59:36 -06:00
74d692d6d5 Fix for SP math ECC non-blocking to always check hashLen. ZD14141 2022-06-21 15:54:01 -07:00
9e1ecf3fb5 Merge pull request #5194 from TakayukiMatsuo/heaphint 2022-06-21 16:39:07 -06:00
7dbf1a5154 Merge pull request #5262 from miyazakh/qt_unit_failure 2022-06-21 16:35:37 -06:00
bd536d3c9d Merge pull request #5229 from miyazakh/sce_example_update 2022-06-21 16:33:54 -06:00
40d9473e6a Display SKIP instead of PASS when tests skipped for make check 2022-06-21 13:11:08 -07:00
b8cff49044 Merge pull request #5268 from anhu/micrium_dtls_guard
Fix missing WOLFSSL_DTLS guard in Micrium build
2022-06-21 12:01:47 -07:00
099afe4419 errant if 2022-06-21 11:33:08 -04:00
beddc777d4 milliseconds not only for DTLS13 2022-06-21 11:07:19 -04:00
f05bcb30e0 div by 4 in milliseconds 2022-06-21 10:48:48 -04:00
ff4eabb17f same fix to MicriumReceive 2022-06-21 10:42:20 -04:00
1e84d1eb67 Change inspired by Rizlik review comments. 2022-06-21 10:22:44 -04:00
d41745cd28 Merge pull request #5269 from anhu/micrium_xstr
Fixup XSTR processing for MICRIUM
2022-06-20 16:23:06 -07:00
0b0518bd55 Fixup XSTR processing for MICRIUM 2022-06-20 17:00:24 -04:00
73435389ed Fix missing WOLFSSL_DTLS in Micrium build 2022-06-20 16:33:04 -04:00
38ac96aefb Merge pull request #5267 from douzzer/20220620-multi-test-fixes
20220620-multi-test-fixes
2022-06-20 12:13:39 -07:00
69ca1d37c0 fixes for defects identified by wolfssl-multi-test: whitespace, missing void in arg lists, and -Wunused-but-set-variable found by clang-15 (prerelease). 2022-06-20 10:54:55 -05:00
7c827d3a82 requested review changes 2022-06-20 11:27:09 +02:00
db6c14e7f9 Merge pull request #5265 from SparkiDev/dh_api_names
DH: Fix names wolSSL_* -> wolfSSL_*
2022-06-19 20:24:12 -07:00
fab05f2527 DH: Fix names wolSSL_* -> wolfSSL_* 2022-06-20 08:58:35 +10:00
59e19cfd6c Merge pull request #5258 from dgarske/stm32u5_bench
Fixes for STM32 Hash/PKA and additional benchmark
2022-06-20 08:33:25 +10:00
b5cac49be9 fix qt_unit_test_failure
add/remove spaces and line-feed to be the same as before
2022-06-18 10:04:10 +09:00
390908bccc Merge pull request #5236 from SparkiDev/mem_zero
Check memory is zeroized
2022-06-17 12:01:34 -07:00
92fcea39db Fix for DES3 with STM32 and STM32_CRYPTO_AES_ONLY (broken in #5223) . Add U5 PKA support and benchmarks. Fix MD5 with OPENSSL_EXTRA and HAVE_MD5_CUST_API. 2022-06-17 11:50:29 -07:00
9c5821569f For STM32 hashing to wait for hash done on block size + 1 word. Updated the STM32U5 benchmarks. Added note about new GCM_TABLE_4BIT. 2022-06-17 09:07:45 -07:00
2f6b5a97a4 Merge pull request #5257 from SparkiDev/i2d_RSA_fix
i2d AIPs move pointer on when a pointer to a buffer is passed in
2022-06-16 21:44:23 -07:00
6a0682d422 i2d AIPs move pointer on when a pointer to a buffer is passed in
Restore behaviour to be compatible with OpenSSL.
Replace comparison of DER data using AsserStrEQ to use memcmp.
2022-06-17 12:36:06 +10:00
66775d90d4 Merge pull request #5250 from dgarske/rsa_public
Fix to expose the RSA public DER export functions with certgen
2022-06-17 12:25:19 +10:00
4fc709d2af Merge pull request #5256 from dgarske/cert_chain_der
Fixes for loading a DER/ASN.1 certificate chain
2022-06-17 11:55:49 +10:00
6795e1bf21 Attempt to fix issue with duplicate prototype wc_RsaKeyToPublicDer with FIPS v2 selftest. 2022-06-16 16:51:51 -07:00
e34dda9383 Fix to expose the RSA public DER export function with certgen. The core function SetRsaPublicKey was being compiled, but the wrappers wc_RsaKeyToPublicDer and wc_RsaKeyToPublicDer_ex were not included. 2022-06-16 16:36:17 -07:00
128ebf54e9 Fix for loading certificate DER chain longer than 2 deep. Fix to properly trap BUFFER_E in ProcessUserChain. ZD14048. 2022-06-16 16:19:37 -07:00
fe8169c830 Add multi thread use case for RA6M4
fix devId conflict while using multi threads

update README

Fix TSIP examples bcause of updating user context
2022-06-17 07:44:12 +09:00
2834c22ce0 Merge pull request #5204 from lealem47/basicConst
Encoding the X509 Basic Constraint when CA:FALSE
2022-06-17 08:33:57 +10:00
f2abf1892c Merge pull request #5255 from lealem47/i2d_RSA
Call RSA_To_Der instead of RSA_To_Der_ex in i2dd_RSA key funcs
2022-06-16 14:43:58 -07:00
1322c1a0b2 Merge pull request #5248 from lealem47/no_aes
Fix build failure caused by missing NO_AES macro guard
2022-06-16 13:18:09 -07:00
911f361285 Call RSA_To_Der instead of RSA_To_Der_ex in i2d_RSA key funcs 2022-06-16 12:26:47 -07:00
8c0157c035 Merge pull request #5253 from rizlik/clang_uninit
kdf: fix clang uninitialized.Assign
2022-06-16 11:06:43 -07:00
8f7db87f01 Merge pull request #5249 from dgarske/rsa_ifc
Cleanup the RSA consistency check
2022-06-16 09:14:08 -07:00
5e63740c6c Ensuring that X509 Basic Constraint is set when CA:FALSE 2022-06-16 08:46:52 -07:00
7560199f18 Merge pull request #5254 from rizlik/nigthly_fixes
dtls: abide deadstore static analyzer warnings
2022-06-16 07:42:38 -07:00
8f0da12824 Merge pull request #5252 from SparkiDev/mod_zero
TFM: mp_exptmod_ex didn't handle exceptional cases
2022-06-16 07:42:17 -07:00
6a0c6049ce dtls: abide deadstore static analyzer warnings 2022-06-16 14:02:09 +02:00
621f4f14af kdf: fix clang uninitialized.Assign
commit f1ce0cc95d tigger static analyzer warnings
about unitialized assign.
2022-06-16 13:55:46 +02:00
6d2a41b9fd Enable wolfSSL SP Math all (sp_int.c) by default. If --enable-fastmath or USE_FAST_MATH is set the older tfm.c fast math will be used. To use the old integer.c heap math use --enable-heapmath or USE_INTEGER_HEAP_MATH. 2022-06-16 10:57:30 +10:00
8145ee6cef TFM: mp_exptmod_ex didn't handle exceptional cases
fp_exptmod_ex() changed to match execptional case handling in
fp_exptmod().
2022-06-16 10:47:00 +10:00
1b29f7353a Check memory is zeroized
Add a define WOLFSSL_CHECK_MEM_ZERO to turn on code that checks that
memory that must be zeroized before going out of use is zero.
Everytime sensitive data is put into a allocated buffer or stack buffer;
the address, its length and a name is stored to be checked later.
Where the stack buffer is about to go out of use, a call is added to
check that the required parts are zero.

wc_MemZero_Add() adds an address with length and name to a table of
addressed to be checked later.
wc_MemZero_Check() checks that the memory associated with the address is
zeroized where required.
mp_memzero_add() adds mp_int's data pointer with length and name to
table.
mp_memzero_check() checks that the data pointer is zeroized where
required.

Freeing memory will check the address. The length was prepended on
allocation.
Realloction was changed for WOLFSSL_CHECK_MEM_ZERO to perform an
allocate, check, copy, free.
2022-06-16 10:22:32 +10:00
8f68e32ef1 initial tranlation of API headers in JA 2022-06-16 08:24:18 +09:00
7e1549c684 Cleanup the RSA consistency check. Should only be enabled for FIPS v2 (3389), FIPS v5 or later. Can be forcefully enabled for non-FIPS using WOLFSSL_RSA_KEY_CHECK. The existing WOLFSSL_NO_RSA_KEY_CHECK macro will also disable it. This change was introduced in PR #4359. 2022-06-15 14:46:23 -07:00
fb704774a0 Merge pull request #4907 from rizlik/dtls13
DTLSv1.3 support
2022-06-15 13:57:02 -07:00
9bcbd645d6 Fix build failure caused by missing NO_AES macro guard 2022-06-15 13:30:56 -07:00
dab0d5a7b0 Merge pull request #5240 from SparkiDev/sp_armv6
SP ARM32: support for arch with no ldrd/strd and clz
2022-06-15 11:28:30 -07:00
d9d8b7e2d8 Merge pull request #5245 from SparkiDev/force_zero
Memory zeroization fixes
2022-06-15 11:16:04 -07:00
aa8df1af78 Fixes for building without DTLS v1.2 and TLS v1.2. Fixes for explicit cast warnings. 2022-06-15 10:49:18 -07:00
3a9176bcc9 scripts: test for dtls13 retransmission
Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-06-15 10:46:43 -07:00
25cf98a417 test: add DTLSv1.3 test suites 2022-06-15 10:46:43 -07:00
12a3efeca8 client/server: tolerate WANT_WRITE errors 2022-06-15 10:46:43 -07:00
4e112419f5 examples: client/server: support DTLSv1.3 (-u -v4)
This commits add some new options to examples/[server,client] to support testing
of DTLS v1.3.

client: add waitTicket option

If this option is used, the client will wait until it receives a sessionTicket
from the server. This is useful when testing DTLS retransmission.

client: add waitKeyUpdate option

When this option is set, the client waits until the UpdateKey message is
acknowledged by the server. This is useful to test DTLS retransmission logic
2022-06-15 10:46:43 -07:00
c1dc90d9b0 server: request cert only once if doing post-handshake auth 2022-06-15 10:46:43 -07:00
ca05ad2dc0 dtls13: introduce wolfSSL_dtls_13_has_pending_msg() API 2022-06-15 10:46:43 -07:00
e2abdf23a7 internal: return from wolfSSL_Peek() with sz 0 if we don't have data
This way we can use wolfSSL_Peek() invoked with sz == 0 to process pending
records and, if none of this records is an application data record, we will not
block.
2022-06-15 10:46:43 -07:00
dfc9873c0f dtls13: support KeyUpdate messages 2022-06-15 10:46:43 -07:00
d1924928c0 dtls13: support retransmission
Introduce ACK and retransmission logic, encapsulated in a Dtls13RtxFsm
object. The retransmission or the sending of an ACK is scheduled by setting the
appropriate flag inside the Dtls13RtxFSM object but the actual writing on the
socket is deferred and done in wolfSSL_Accept/Connect.

* Retransmission

Each sent message is encapsulated in a Dtl13RtxRecord and saved on a list. If we
receive an ACK for at record, we remove it from the list so it will be not
retransmitted further, then we will retransmit the remaining
ones. Retransmission is throttled: beside link congestion, this also avoid too
many sequence numbers bounded with a record.

* ACK

For each received record we save the record sequence number, so we can send an
ACK if needed. We send an ACK either if explicitly needed by the flight or if we
detect a disruption.

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-06-15 10:46:43 -07:00
d079662765 dtls13: support fragmentation, sending and receiving
This commit implements the core of the header parsing, building, and the sending
and receiving routines that handle fragmentation and defragmentation.

* In DTLSv1.3 the header used for protected messages is a variable-length header,
and it is described RFC9147 Section 4.

* Fragmentation happens after building the full message, if necessary. If the
underlying I/O can't send a fragment because of a WANT_WRITE error, the sending
of fragments will continue in the next invocation of
wolfSSL_connect/wolfSSL_accept/wolfSSL_write. In this case the message is saved
in a buffer inside the WolfSSL object.

* Defragmentation works like DTLSv1.2 defragmentation, and re-use
most of the same code.

* The Dtls13AddHeaders() function does not add the record layer header, but it
lefts space for it. It is eventually placed by BuildTls13Message() to allow
easier management of sequence numbers.
2022-06-15 10:46:43 -07:00
173077b142 dtls: refactor DtlsUpdateWindow() window
split the DtlsUpdateWindow() function, so part of the code can be reused by
DTLSv1.3 code.
2022-06-15 10:46:43 -07:00
30fb664163 internal.c: add runProcessingOneRecord section
DTLSv1.3 needs to do some operation per-record, this commit adds an appropriate
section to ProcessReplyEx.
2022-06-15 10:46:43 -07:00
2696c3cdd3 dtls13: change encryption keys dynamically based on the epoch
In DTLSv1.3, because of retransmission and reordering, we may need to encrypt or
decrypt records with older keys. As an example, if the server finished message
is lost, the server will need to retransmit that message using handshake traffic
keys, even if he already used the traffic0 ones (as, for example, to send
NewSessionTicket just after the finished message).

This commit implements a way to save the key bound to a DTLS epoch and setting
the right key/epoch when needed.
2022-06-15 10:46:43 -07:00
de04973051 dtls13: record number encryption and decryption 2022-06-15 10:46:43 -07:00
60834ba516 dtls13: new methods and version negotiation 2022-06-15 10:46:42 -07:00
9d22e11776 misc.c: introduce w64wrapper to handle 64bit numbers
as word64 is not always available, introduce an abstract type and companion
operations. They use a word64 if available and fallback on word32[2] otherwise.
2022-06-15 10:46:42 -07:00
7586851734 dtls13: export functions
They will be used by DTLSv1.3 code
2022-06-15 10:46:42 -07:00
d8ac35579c dtls13: add autotools, cmake build options and vstudio paths 2022-06-15 10:46:42 -07:00
d51ba35ff9 Merge pull request #5246 from rizlik/dtls_header_fixes
dtls: handshake header parsing fixes
2022-06-15 09:33:41 -07:00
6630a83182 dtls: handshake header parsing fixes 2022-06-15 12:00:26 +02:00
e073500e8e SP ARM32 ASM: Improve performance of P-256 mont mul/sqr 2022-06-15 16:39:13 +10:00
af4fff80db SP ARM32: support for arch with no ldrd/strd and clz
Defined WOLFSSL_SP_ARM_ARCH to be less than 7 to use alternative
instructions.
2022-06-15 12:07:49 +10:00
f1ce0cc95d Memory zeroization fixes
Zeroize secrets in stack buffers and allocated memory.
mp_forcezero to ensure private MP integers are zeroized.
Fix whitespace and add some comments.
2022-06-15 11:26:11 +10:00
9656963f61 Merge pull request #5231 from dgarske/glitch_harden
Added sanity check on TLS encrypt to trap against glitching
2022-06-15 09:48:18 +10:00
ed5470c991 Merge pull request #5239 from dgarske/asn_decode_ext
Fix for ASN template parsing of extended key usage
2022-06-15 09:29:44 +10:00
0cac6cef39 Merge pull request #5237 from anhu/bench_psk
Support psk ciphersuites in benchmarks.
2022-06-14 16:12:15 -07:00
ed6c9639d6 Merge pull request #5243 from douzzer/20220614-multi-test-fixups
20220614-multi-test-fixups
2022-06-14 16:11:44 -07:00
f414e65d4b linuxkm: eliminate duplicative WOLFSSL_KTHREADS macro (just use WOLFSSL_LINUXKM). 2022-06-14 12:45:30 -05:00
2f4864cab2 Added sanity check on TLS encrypt to trap against glitching. 2022-06-14 09:37:44 -07:00
7a25b9cd85 Merge pull request #5241 from SparkiDev/wycheproof_sp_arm64_asm
SP ASM: fixes for Wycheproof tests
2022-06-14 09:08:15 -07:00
22eee3206d Fixups from review by dgarske 2022-06-14 11:13:28 -04:00
a22da10956 linuxkm: tweak setup of wolfSSL_Mutex to assure complete type availability in applications (client modules). 2022-06-14 09:45:33 -05:00
5a8c130040 fix whitespace 2022-06-14 09:43:05 -05:00
a0dd92234b draft 2022-06-14 13:37:49 +02:00
fb10c90935 Fix for Cube HAL v2 back-to-back DES/DES3. Whitespace. Enable the new FIFO 16 block logic for all hardware that supports it. 2022-06-14 11:48:51 +02:00
c52c2e5dfb Fixes for STM32H7 hash and crypto. 2022-06-14 11:48:51 +02:00
ad3f7e1de2 The STM32U5 does not support DES3 or AES 192-bit (only 128/256 bit) 2022-06-14 11:48:51 +02:00
502cbc3847 Fix for STM32U5 hash/crypto support. ZD 14305. 2022-06-14 11:48:51 +02:00
013066ca06 SP ASM: fixes for Wycheproof tests
ARM64 ASM: Fix P256 Montogomery Reduce.
Fix div to handle large dividend word.
2022-06-14 16:11:46 +10:00
c0f49b57e1 Fix for ASN template parsing of DecodeExtKeyUsage. ZD 14344. 2022-06-13 16:50:20 -07:00
af3a55a94c Merge pull request #5220 from kaleb-himes/ZD14318
Resolves inter-library API conflict reported in ZD14318
2022-06-13 14:28:13 -07:00
f401a3b53d Merge pull request #5232 from cconlon/june10
test/benchmark.c: rename Android tag, reset vars in memcb_test()
2022-06-13 14:24:17 -07:00
4d4ee3b2db Support psk ciphersuites in benchmarks.
Also fixed some small errors during shutdown in benchmarks.

Tested with:

./configure --enable-psk CFLAGS=-DWOLFSSL_STATIC_PSK
make all check
./examples/benchmark/tls_bench
2022-06-13 13:33:51 -04:00
364bf482eb adjust wolfCrypt test/benchmark Android log TAG name, reset malloc/free counts in memcb_test() 2022-06-13 09:42:02 -06:00
0b78961111 Merge pull request #5186 from SparkiDev/pk_c_rework_1
pk.c: rework
2022-06-13 08:35:09 -07:00
5018da7f9f Merge pull request #5234 from gojimmypi/PR_Espressif_Version_README
Add note regarding ESP-IDF Version
2022-06-13 08:34:25 -07:00
9ee1833bd2 Merge pull request #5235 from SparkiDev/sess_sec_cb_fixup
Improve SessionSecret_callback code.
2022-06-13 08:21:45 -07:00
1de54ed8d7 Improve SessionSecret_callback code. 2022-06-13 10:43:09 +10:00
8899112456 Merge pull request #5230 from dgarske/tls_bench
Fix for TLS v1.1 length sanity check for large messages
2022-06-13 09:38:03 +10:00
f35eb20954 Add note regarding ESP-IDF Version 2022-06-12 12:39:04 -07:00
d5791d5c74 Fixes for TLS benchmarking app (tls_bench) for shutdown and formatting brace cleanups. 2022-06-10 13:48:46 -07:00
cafe5646b6 Fix for TLS v1.1 length sanity check for large messages. 2022-06-10 13:35:06 -07:00
afc63a3bfa Merge pull request #5199 from embhorn/zd12999
Add doc for wolfSSL_dtls_retransmit
2022-06-10 10:57:17 -07:00
d600a4b887 Spelling and Whitespace cleanups. Fix issue with trying to build pk.c directly and always getting warn even with WOLFSSL_IGNORE_FILE_WARN. 2022-06-10 09:06:55 -07:00
ba3991af5e Merge pull request #5228 from haydenroche5/strongswan
Add an --enable-strongswan option to configure.ac.
2022-06-10 08:19:32 -07:00
49008b169c Merge pull request #5087 from haydenroche5/x509_print
Add support for more extensions to wolfSSL_X509_print_ex.
2022-06-10 08:19:23 -07:00
c59ec54713 initialize variable to fix warning 2022-06-10 06:22:54 -06:00
ba20f54b5b add UPN other name parsing and updating skip 2022-06-09 21:32:55 -06:00
890abfbefc pk.c: rework
Re-order RSA functions.
Add comments to RSA functions.
Rework RSA function implementations.
2022-06-10 09:54:32 +10:00
df673b987e Merge pull request #5227 from LinuxJedi/embOS-emNET
Support for SEGGER embOS and emNET
2022-06-09 08:04:29 -07:00
9954afa538 Merge pull request #5222 from tmael/rsa_sanity
Add a sanity check in RsaPad_OAEP
2022-06-09 08:04:16 -07:00
f479600066 Add support for more extensions to wolfSSL_X509_print_ex.
- Key usage
- Extended key usage
- Subject alt name

Additionally, print out the criticality of the extensions.
2022-06-09 16:50:10 +02:00
df87eb5508 Add an --enable-strongswan option to configure.ac.
Also, clean up some repetition around adding `-DHAVE_OCSP`.
2022-06-09 16:24:41 +02:00
190476dafe Support for SEGGER embOS and emNET
Adds support for embOS memory and mutex functions. Also adds support for
emNET's error codes, it uses a BSD compatible TCP/IP stack for network
functions.

There is no easy native way to detect that you are compiling with emNET
or embOS so these require the user to define WOLFSSL_EMBOS /
WOLFSSL_EMNET.
2022-06-09 11:34:55 +01:00
2748bfc737 Add a check in RsaPad_OAEP 2022-06-08 10:07:26 -07:00
9fb1143eba Merge pull request #5218 from gojimmypi/PR_zepher_legacy_link
add link to new location for old zephyr references
2022-06-07 16:40:14 -07:00
37ee5e2540 Resolves inter-library API conflict reported in ZD14318 2022-06-07 14:48:27 -06:00
85e18b2f06 Merge pull request #5219 from douzzer/20220607-strlcpy
use XSTRLCPY() and XSTRLCAT() in EncryptDerKey()
2022-06-07 09:34:40 -07:00
088d378ba4 ssl.c:EncryptDerKey(): use XSTRLCPY() and XSTRLCAT() to build up cipherInfo, and remove XSTRCPY() macro from wolfssl/wolfcrypt/types.h (clang-tidy hates on it, albeit frivolously). 2022-06-07 08:22:48 -05:00
047ed8ef61 minor change for commit author update 2022-06-06 16:47:40 -07:00
fbb6faaa2f Merge pull request #5191 from SparkiDev/sp_win_asm_xmm_nv
SP Winx64 ASM: XMM6-15 are non-volatile
2022-06-06 15:58:10 -07:00
3c634e1f59 Merge pull request #5217 from SparkiDev/pk_enc_mem_2
ECC, DH: improve encrypted memory implementations
2022-06-06 15:27:10 -07:00
711a900ff7 Merge pull request #5214 from lealem47/ghostFunc
Removing ghosts and updating defines in openssl/buffer.h
2022-06-06 17:05:33 -05:00
4ffa63c938 Merge pull request #5216 from kojo1/static-mem
wc_MakeRsKey  with Static memory pool
2022-06-06 14:42:32 -07:00
86023378f8 free decoded cert in test case and x509 2022-06-06 14:31:41 -07:00
8e69b1fa0e add include.am 2022-06-06 13:10:37 -07:00
07e0a6fa8e Removing ghost functions and fixing overflow warning in ssl.c 2022-06-06 11:33:26 -07:00
86312be79e Merge pull request #5210 from kaleb-himes/new-azsphere-rev3
New azsphere example for CI testing
2022-06-06 10:00:43 -07:00
2cd9ca0c8f add support for asn template build 2022-06-06 09:42:03 -07:00
927ee21752 add link to new location for old references 2022-06-06 08:39:40 -07:00
0bcd38f7d8 ECC, DH: improve encrypted memory implementations 2022-06-06 08:40:09 +10:00
7bfe6aa127 Extend HEAP_HINT to all InitRsaKey in api.c 2022-06-05 09:12:49 +09:00
eb28d38fa8 Merge pull request #5212 from kaleb-himes/various-warnings
Fix various warnings and an uninitialized XFILE
2022-06-04 17:10:17 -07:00
1b9f922ec3 wc_MakeRsKey with static mem pool 2022-06-05 09:04:42 +09:00
dbfa207344 Merge pull request #5116 from embhorn/zd14172
Fix TSIP build with NO_AES_CBC
2022-06-04 17:51:16 +09:00
802e3127c0 Merge pull request #5145 from JacobBarthelmeh/caam
CAAM support with QNX i.MX8, add AES-CTR crypto callback
2022-06-03 15:24:10 -07:00
873b2169f9 Add readme to include.am 2022-06-03 13:33:12 -06:00
2af09a7151 Merge pull request #5205 from haydenroche5/evp_cipher_aes_gcm
Fix another AES-GCM EVP control command issue.
2022-06-03 11:47:57 -07:00
30d836dc90 Implement peer review feedback 2022-06-03 11:34:02 -06:00
96d5814bfe Implement peer review feedback 2022-06-03 11:06:46 -06:00
debb598499 Merge pull request #5008 from tmael/vx_6x
Add support for VxWorks 6.x
2022-06-03 09:40:39 -07:00
1bb2a35164 Merge pull request #5207 from anhu/longer_sigalg_list
For inter-op with OQS's OpenSSL fork, support longer sigalg list.
2022-06-03 09:24:38 -07:00
fdaf418fe0 fix spelling and remove dead else statement 2022-06-03 09:21:27 -07:00
3bcdef1972 Fix various warnings and an uninitialized XFILE 2022-06-03 09:52:53 -06:00
8fbd4d70e6 Merge pull request #5209 from TakayukiMatsuo/fix14172 2022-06-03 09:07:01 -06:00
e30ae359a4 Fix build err missing XSTRNCASECMP 2022-06-03 08:17:39 -06:00
55f3b7c277 New azsphere example for CI testing 2022-06-03 08:04:50 -06:00
42754ce98b Exclude calling some funcs when WOLFSSL_AEAD_ONLY is defined 2022-06-03 14:47:41 +09:00
64eaf74e83 Merge pull request #5206 from dgarske/user_settings
Fixes for user settings with SP ASM and ED/Curve25519 small
2022-06-03 09:25:17 +10:00
ee78e63b87 Merge pull request #5203 from dgarske/zd14289
Fix the supported version extension to always check minDowngrade
2022-06-03 08:31:36 +10:00
8307a55429 Fixes --enable-usersettings with SP ASM and ED/Curve25519 small CURVED25519_SMALL. 2022-06-02 14:17:25 -07:00
a6465c2bd0 Merge pull request #5202 from julek-wolfssl/wolfssl-multi-test/send-alert-refactor
wolfssl-multi-test fixes
2022-06-02 14:08:46 -07:00
0cda12d446 For inter-op with OQS's OpenSSL fork, support longer sigalg list. 2022-06-02 16:52:35 -04:00
fb3c611275 Fix another AES-GCM EVP control command issue.
With PR 5170, I added logic that requires a EVP_CTRL_GCM_SET_IV_FIXED command be
issued before a EVP_CTRL_GCM_IV_GEN command. This matches OpenSSL's behavior.
However, OpenSSL also clears the flag enabling EVP_CTRL_GCM_IV_GEN after
EVP_CTRL_GCM_SET_IV_FIXED if EVP_CipherInit is called with a NULL key.
Otherwise, the flag retains its value. We didn't mirror this logic, and that
caused problems in OpenSSH unit testing. This commit aligns our logic with
OpenSSL's and adds a regression test to test_evp_cipher_aes_gcm for this case.
2022-06-02 12:32:59 -07:00
2dd27c8d4a Fix the supported version extension to check the ssl->options.minDowngrade always. 2022-06-02 11:17:25 -07:00
cd008aac6a Add support for VxWorks 6.x
Use rand_r and define SEM_ID_NULL
Fix redefinition of typedef 'SOCKADDR'
2022-06-02 09:54:27 -07:00
56c48b31ad Merge pull request #5105 from tmael/rsa_oaep_nomalloc
Support RSA OAEP with nomalloc
2022-06-02 08:45:01 -07:00
2e307e1cd3 tls13.c: fix null pointer deref in FreeDcv13Args(). 2022-06-02 10:32:05 -05:00
3d71956b48 wolfssl-multi-test fixes:
- Remove RetrySendAlert and SendAlert recursion
- args possible NULL dereference
2022-06-02 16:08:25 +02:00
fb9f90b98b Merge pull request #5200 from dgarske/qat_fsanitize
Fixes for buffers when testing with Intel QAT hardware
2022-06-02 08:35:24 +10:00
9f2e3a2405 Merge pull request #5198 from dgarske/qat_ecc_marker 2022-06-01 21:35:47 +02:00
5672e2a885 Fixes for buffers when testing with Intel QAT hardware and fsanitize=address:
* PKCS7 should use allocated buffer for RSA.
* PKCS7 small stack typo for `keyAlgArray` size in `wc_PKCS7_AddRecipient_KTRI`.
* Fix for use of `free`, which should be `XFREE` in api.c.
* Cleanup old RSA benchmarking MDK5/WINCE code no longer needed with `WC_DECLARE_ARRAY_DYNAMIC_DEC` and `WC_DECLARE_ARRAY_DYNAMIC_EXE`.
2022-06-01 12:07:57 -07:00
8b9d2ad657 Merge pull request #5196 from douzzer/20220601-multi-test-fixes 2022-06-01 11:41:26 -07:00
9cfcdfc7aa Merge pull request #5149 from julek-wolfssl/store-frags-v2
Re-use async to support WANT_WRITE while sending fragments
2022-06-01 10:52:54 -07:00
2543970419 Add doc for wolfSSL_dtls_retransmit 2022-06-01 12:03:36 -05:00
cced5bd700 Merge pull request #5195 from LinuxJedi/ULL-fix
Fix 64bit postfix for constants
2022-06-01 09:40:26 -07:00
19c51dac45 Fix for QAT ECC to gate use of HW based on marker. Introduced in PR #4997. 2022-06-01 09:36:21 -07:00
494a9fe41a Merge pull request #5193 from SparkiDev/tls13_send_ticket
TLS 1.3: send ticket
2022-06-01 08:37:52 -07:00
b212853bce evp.c: in EvpCipherAesGCM(), make sure ctx->gcmAuthIn is non-null before clearing it; fix whitespace. 2022-06-01 10:29:40 -05:00
d29c656d4f SendAlert: clear output buffer to try and send the alert now 2022-06-01 16:48:57 +02:00
11a7756527 Fix 64bit postfix for constants
GCC 4.0.4 PowerPC 32bit cross-compiler complains when `UL` is used
instead of `ULL` for 64bit constants.
2022-06-01 15:04:29 +01:00
df10e1fad2 Store RetrySendAlert error in ssl->error 2022-06-01 14:59:10 +02:00
13135e72db Add a global variable for heap-hint, mainly in case heap info cannot be referenced by TSIP 2022-06-01 10:24:03 +09:00
be743b2204 TLS 1.3: send ticket
Can send a new session ticket any time after handshake is complete with
TLS v1.3.
Added API for server application to do this.
Added tests.
2022-06-01 10:36:01 +10:00
3944a8737a WIN64: compiling with __clang__ _udiv128 not defined 2022-06-01 08:54:57 +10:00
dd0b9fb871 SP Winx64 ASM: XMM6-15 are non-volatile
Put the used non-volatile XMM registers on the stack at the start and
get them off again at the end.
2022-06-01 08:46:27 +10:00
81cd1e652e Merge pull request #5170 from haydenroche5/evp_cipher_aes_gcm
Fix EVP_CTRL_GCM_IV_GEN with AES-GCM.
2022-06-01 08:20:33 +10:00
c74315f1ef Save pending alerts when using async io
- Don't overwrite ssl->error
- Clear the error in ssl->error because the return of SendBuffered is now stored in ret instead
2022-05-31 18:17:11 +02:00
0554b02215 Merge pull request #5177 from JacobBarthelmeh/PKCS7 2022-05-31 09:46:14 -06:00
da91578bc7 Merge pull request #5180 from miyazakh/tsipv_up 2022-05-31 09:41:47 -06:00
2ed85926d5 Merge pull request #5187 from kareem-wolfssl/hsHashesNull
Confirm ssl->hsHashes is not NULL before attempting to dereference it.
2022-05-30 10:41:35 -07:00
8aa2da532c Combine preproc check into one statement 2022-05-30 15:27:36 +02:00
c83120d8c8 Merge pull request #5097 from tmael/c89_fixes
Fix for c89, use WOLF_C89
2022-05-28 08:29:42 -05:00
baaff96045 Merge pull request #5188 from kaleb-himes/PR5174-SUPPLEMENT
Supplement to @julek-wolfssl's fantastic find, just allow for proper expansion
2022-05-27 20:36:20 -07:00
6245395f34 Simulate WANT_WRITE only with async I/O support 2022-05-27 23:23:18 +02:00
a91a2482e7 Merge pull request #5158 from anhu/ECDHE_PSK
Add TLS 1.2 ciphersuite ECDHE_PSK_WITH_AES_128_GCM_SHA256 from RFC 8442
2022-05-27 13:25:48 -07:00
e061bc23f4 Fix asn1.h NOLINT comments. 2022-05-27 13:05:56 -07:00
f5bbad185f Supplement to @julek-wolfssl's fantastic find, just allow for proper expansion 2022-05-27 13:52:26 -06:00
8cb4819b53 Fix curve group matching on secure renegotiation 2022-05-27 21:26:55 +02:00
84bca63b2e Add WOLFSSL_NO_ASYNC_IO to low resource build 2022-05-27 21:26:55 +02:00
50c0b3d2a2 Add testing/docs for blocking write
- Fix case where message grouping can make CheckAvailableSize return a WANT_WRITE
- CheckAvailableSize in tls13.c will not return a WANT_WRITE since it only does so for DTLS <=1.2
2022-05-27 21:26:55 +02:00
decf9972bb fix whitespace. 2022-05-27 14:22:22 -05:00
8c10c3776d wolfcrypt/src/asn.c: in C89 codepath of GetFormattedTime(), add buffer size checks before calls to sprintf(). 2022-05-27 14:20:38 -05:00
aca199cb05 Fix to compile with c89
strncasecmp and snprintf are unavailable in C89
use // static analyzer suppressions
2022-05-27 14:20:37 -05:00
6e6c4500d6 Fix comments in asn1.h to use ANSI C style. 2022-05-27 11:01:29 -07:00
98ec442b37 Confirm ssl->hsHashes is not NULL before attempting to dereference it. 2022-05-27 10:57:23 -07:00
df06db114d Add TLS 1.2 ciphersuite ECDHE_PSK_WITH_AES_128_GCM_SHA256 from RFC 8442
Testing:

./autogen.sh
./configure --enable-psk
make all check

$ ./examples/server/server  -j -l ECDHE-PSK-AES128-GCM-SHA256
SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256
SSL curve name is SECP256R1
Client message: hello wolfssl!

$ ./examples/client/client  -s -l ECDHE-PSK-AES128-GCM-SHA256
SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256
SSL curve name is SECP256R1
I hear you fa shizzle!
2022-05-27 11:05:55 -04:00
81ad463026 fix a compile error by clang 2022-05-27 11:37:26 +09:00
4e8c362152 Allocate ssl->async seperately to the SSL object 2022-05-26 23:08:48 +02:00
733fe1a8d3 Use WOLFSSL_ASYNC_IO for WOLFSSL_NONBLOCK_OCSP
- Enable ssl->async to store function arguments for non-blocking OCSP
- Remove ssl->nonblockarg
2022-05-26 23:08:48 +02:00
c151dcec50 Re-use async to support WANT_WRITE while sending fragments
- Async I/O can be turned off with WOLFSSL_NO_ASYNC_IO
- WOLFSSL_ASYNC_IO functionality enabled in SendCertificateVerify() and SendServerKeyExchange() to allow safe re-entry into SendHandshakeMsg()
- Testing size of structs is refactored int WOLFSSL_ASSERT_SIZEOF_GE()
2022-05-26 23:08:48 +02:00
f93b23b524 Merge pull request #5169 from kareem-wolfssl/miscFixes
Misc. fixes
2022-05-26 12:52:39 -07:00
0b6f7c1533 Merge pull request #5176 from embhorn/zd14227
Fix to move wolfSSL_ERR_clear_error outside gate for OPENSSL_EXTRA
2022-05-26 08:33:52 -07:00
ea895e99b7 Merge pull request #5184 from SparkiDev/asn_templ_make_cert_ext
ASN template: properly handle WOLFSSL_CERT_EXT
2022-05-26 06:53:10 -07:00
2800d00bb4 Fix to move wolfSSL_ERR_clear_error outside gate for OPENSSL_EXTRA 2022-05-26 06:11:45 -05:00
cacf5aeb7e ASN template: properly handle WOLFSSL_CERT_EXT
Encoding extensions didn't properly handle WOLFSSL_CERT_EXT not being
defined.
2022-05-26 10:01:59 +10:00
a5fa98e5f0 addressed code review
update Copyright year
2022-05-26 08:50:02 +09:00
ad49aea17d fix for setting AES-CCM decrypt nonce with crypto callback 2022-05-25 13:59:56 -07:00
fa80aa6505 Merge pull request #5132 from JacobBarthelmeh/req
Add support for additional CSR attributes
2022-05-25 13:35:46 -07:00
e8d779ab78 Merge pull request #5077 from gojimmypi/ESP8266_Development
Add ESP-IDF WOLFSSL_ESP8266 setting for ESP8266 devices
2022-05-25 12:46:10 -07:00
17d7098bf6 Merge pull request #5168 from rizlik/dtls_resume
internal.c: dtls:  HelloVerifyRequest on resumption
2022-05-25 11:23:08 -07:00
2d8cc055f0 Merge pull request #5179 from SparkiDev/sp_armv6_fix_1
SP ARM32 ASM: moving large immediate value
2022-05-25 09:59:47 -07:00
da1cbfda46 Merge pull request #5178 from cconlon/nounaligned
Add define to skip SHA-512 unaligned memory test in test.c
2022-05-25 09:55:29 -07:00
3cf636163b Fix EVP_CTRL_GCM_IV_GEN with AES-GCM.
Discovered the AES-GCM flow using this command didn't work in our OpenSSH port.
This commit makes the behavior match OpenSSL and adds testing using known
OpenSSL-generated test vectors to prevent regressions. This was one of those
problems where two ends of a connection would work fine if they were both using
wolfSSL but not if one was using OpenSSL (i.e. OpenSSH interop with AES-GCM
was broken).
2022-05-25 07:00:15 -07:00
c3e4c6b6bc Merge pull request #5174 from julek-wolfssl/ocsp-typo
Typo in testing script
2022-05-25 08:16:58 -05:00
b664cea735 Typo in testing script 2022-05-25 12:10:27 +02:00
0d59d36a80 update TSIP VER to 1.15 for RX65N and RX72N
fix -140 error when enabling -O2

fix no_crypto_hash
2022-05-25 18:31:23 +09:00
6c0b65d655 internal.c: dtls: HelloVerifyRequest on resumption 2022-05-25 10:38:32 +02:00
d2cb0278f6 SP ARM32 ASM: moving large immediate value
ARMv6 and early doesn't support moving an immediate value larger than 8
bits. Compiler doesn't have enough spare registers to handle it.
2022-05-25 10:58:32 +10:00
a1fb385450 free recipent list in error cases 2022-05-24 15:12:39 -07:00
5aea58d1e8 Merge pull request #5175 from douzzer/20220524-shellcheck-warnings
20220524-shellcheck-warnings
2022-05-24 14:21:49 -07:00
a5225af1c7 Merge pull request #4973 from JacobBarthelmeh/CSharp
add example C# PSK client
2022-05-24 13:37:14 -07:00
bcb5ff5ed9 Increase MAX_ECC_STRING to include the trailing \0 for longer order strings (in eg. SECP160R1). Note that this now matches the check in wc_EccPublicKeyDecode. 2022-05-24 13:20:52 -07:00
03e086a139 Code review feedback. 2022-05-24 13:12:59 -07:00
74cbd08ff5 Merge pull request #5164 from cconlon/x509date
Remove WOLFSSL_ALT_NAMES restriction on notBefore/notAfter use in Cert struct
2022-05-24 12:41:00 -07:00
321d404d6b add define to skip unaligned memory tests in test.c 2022-05-24 11:55:21 -06:00
5c14bef6a8 global fixes for shellcheck warnings SC2027, SC2069, SC2154, SC2141, SC3014, SC3037 (all true positives). note, does not fix SC2057 in ocsp-stapling.test, which is addressed by PR #5174 . 2022-05-24 12:13:14 -05:00
b66fa1680a fix whitespace. 2022-05-24 12:13:14 -05:00
6a26dab73a X.509 cert validity for CertFromX509() and EncodeCert() shouldn't be protected by WOLFSSL_ALT_NAMES 2022-05-24 10:28:46 -06:00
5f148c3dcc Merge pull request #5172 from SparkiDev/jenkins_fixes_5
benchmark.c: fix Jenkins failure where byte, word32 not defined
2022-05-24 08:09:47 -07:00
fab9e29513 benchmark.c: fix Jenkins failure where byte, word32 not defined 2022-05-24 12:10:01 +10:00
350f1d6496 Only use __builtin_offsetof on GCC 4+. It is not supported in GCC 3 or earlier. 2022-05-23 14:44:56 -07:00
26a92977f0 Remove MCAPI project's dependency on zlib version. 2022-05-23 14:29:44 -07:00
b329a16832 Update Zephyr fs.h path. 2022-05-23 13:45:30 -07:00
465a6ceb64 Merge pull request #4920 from SparkiDev/old_timing_pad_verify
Make old less secure TimingPadVerify implementation available
2022-05-23 13:43:59 -07:00
6424af120c Merge pull request #5161 from SparkiDev/sp_armv7a
SP ARM 32: Fixes to get building for armv7-a
2022-05-23 10:01:49 -07:00
36db5ef929 add test case for UUID and FASC-N 2022-05-23 09:17:42 -07:00
cdfdefe9af improve checking on UUID getter function 2022-05-22 17:18:20 -07:00
9e4de4bfc8 add FASC-N and UUID alt. name support 2022-05-22 17:18:20 -07:00
62cb2b4ca9 ASN.1 Additions for FPKI/CAC
1. Add some OIDs used in the Federal PKI Policy Authority standard.
2. Added the SubjectDirectoryAttributes extension to certificate
   parsing. (limited to country of citizenship)
3. Rename constant label SUBJECT_INFO_ACCESS to SUBJ_INFO_ACC_OID
4. Added the SubjectInfoAccess extension to certificate parsing.
   (limited to one URL)
5. Add the SSH extended key usage flags.
6. Use some of the template changes on the new certificate items.
2022-05-22 17:18:20 -07:00
b5d65b9579 Merge pull request #5159 from kareem-wolfssl/fipsv3HmacMd5
Allow using 3DES and MD5 with FIPS 140-3, as they fall outside of the FIPS boundary.
2022-05-20 18:40:29 -07:00
9a74745246 Merge pull request #5163 from haydenroche5/evp_pkey_derive_guard
Remove unneeded FIPS guard on wolfSSL_EVP_PKEY_derive.
2022-05-20 17:12:24 -07:00
ec39ee2cb6 Merge pull request #5070 from miyazakh/crypto_only_flwup 2022-05-20 17:08:29 -06:00
d80b282fdd Merge pull request #5156 from anhu/HAVE_AES_GCM
Rename HAVE_AES_GCM guard to HAVE_AESGCM in the tests.
2022-05-20 15:03:57 -07:00
04ddd0abe4 Merge pull request #5095 from haydenroche5/decoded_cert_crit_fields
Make the critical extension flags in DecodedCert always available.
2022-05-20 15:03:39 -07:00
2fc129e236 Merge pull request #5162 from rliebscher/master
Remove unused warning in ecc.c
2022-05-20 11:42:39 -07:00
a6b948ae59 Remove unneeded FIPS guard on wolfSSL_EVP_PKEY_derive. 2022-05-20 11:29:01 -07:00
f19b426a3f fix for files included in make dist 2022-05-20 09:26:53 -06:00
a8024a32c5 Remove unused warning in ecc.c
When WOLFSSL_ECIES_OLD is defined you get an unused warning
in ecc.c / wc_ecc_encrypt_ex().
Just suppress it by "using" the parameter.
2022-05-20 16:05:10 +02:00
9427ebc5be Merge pull request #5160 from haydenroche5/tls_unique
Provide access to "Finished" messages outside the compat layer.
2022-05-19 21:30:30 -07:00
b6290f1590 Merge pull request #5157 from douzzer/20220519-multi-test-fixes
20220519-multi-test-fixes
2022-05-20 13:47:09 +10:00
bc5262a5d0 SP ARM 32: Fixes to get building for armv7-a
Change ldrd to either have even first register or change over to ldm
with even first register.
Ensure shift value in ORR instruction has a hash before it.
Don't index loads and stores by 256 or more - make them post-index.
div2 for P521 simplified.
2022-05-20 12:15:58 +10:00
6d9fbf7ab3 Provide access to "Finished" messages outside the compat layer.
Prior to this commit, if you wanted access to the Finished messages from a
handshake, you needed to turn on the compatibility layer, via one of
OPENSSL_ALL, WOLFSSL_HAPROXY, or WOLFSSL_WPAS. With this commit, defining any
of these causes WOLFSSL_HAVE_TLS_UNIQUE to be defined (a reference to the
tls-unique channel binding which these messages are used for) in settings.h.
This allows a user to define WOLFSSL_HAVE_TLS_UNIQUE to access the Finished
messages without bringing in the whole compat layer.
2022-05-19 16:34:13 -07:00
efc8d36aa5 configure.ac: add whitespace separators to "((" groupings to mollify shellcheck SC1105 "Shells disambiguate (( differently or not at all. For subshell, add spaces around ( . For ((, fix parsing errors." 2022-05-19 18:19:11 -05:00
6984cf83b2 scripts/ocsp-stapling.test: fix whitespace. 2022-05-19 16:45:50 -05:00
e35c1e5a61 setup of default build config 2022-05-19 14:54:22 -06:00
8de3765af9 clean up namespace and remove settings files 2022-05-19 14:28:23 -06:00
d8817266be trim down sln 2022-05-19 13:54:07 -06:00
6dc47580ce fixing dependency for new project 2022-05-19 13:45:09 -06:00
832a7a40a6 Allow using 3DES and MD5 with FIPS 140-3, as they fall outside of the FIPS boundary. 2022-05-19 12:06:20 -07:00
249afbbfc9 update output directory and add psk client example 2022-05-19 12:11:00 -06:00
5988f35593 src/wolfio.c: in EmbedReceiveFrom((), clear peer before recvfrom() to fix clang-analyzer-core.UndefinedBinaryOperatorResult; add DTLS_ prefix to macros SENDTO_FUNCTION and RECVFROM_FUNCTION, and gate their definitions on their being undefined to allow overrides. 2022-05-19 11:31:24 -05:00
f2e9f5349f wolfcrypt/src/asn.c: refactor DecodeBasicOcspResponse() to keep DecodedCert off the stack in WOLFSSL_SMALL_STACK builds. 2022-05-19 11:28:34 -05:00
368854b243 scripts/: refactor TLS version support tests to use -V, rather than -v (which makes frivolous connection attempts). 2022-05-19 11:18:34 -05:00
cf81ae79e4 HAVE_AESGCM 2022-05-19 11:30:58 -04:00
9c2903c176 Remove HAVE_AES_GCM guard as it is never defined. 2022-05-19 01:20:55 -04:00
4a3ff40eb3 Merge pull request #5138 from haydenroche5/issuer_names
Add ability to store issuer name components when parsing a certificate.
2022-05-18 16:56:55 -07:00
cd41c8beaf Merge pull request #5147 from rizlik/do_alert_reset
internal.c:reset input/processReply state if exiting after DoAlert()
2022-05-19 09:36:44 +10:00
b53484be10 Merge pull request #5155 from cconlon/configFix
Fix --enable-openssh FIPS detection syntax in configure.ac
2022-05-18 17:34:43 -05:00
628a34a43d fix --enable-openssh FIPS detection syntax in configure.ac 2022-05-18 12:52:07 -06:00
1026c7141e Merge pull request #5148 from JacobBarthelmeh/PKCS7 2022-05-18 11:44:20 -06:00
be172af3cd internal.c: check that we have data before processing messages
We should never encounter this bug under normal circumstances. But if we enter
processReplyEx with a wrongly `ssl->options.processReply` set to
`runProcessingOneMessage` we check that we have some data.
2022-05-18 18:49:33 +02:00
6940a5eaae internal.c:reset input/processReply state if exiting after DoAlert() 2022-05-18 18:35:29 +02:00
40063f7487 Merge pull request #5109 from rizlik/dtls_peer_matching_fix
wolfio: dtls: fix incorrect peer matching check
2022-05-18 09:12:26 -07:00
5de9c45161 resolve merge and conflict 2022-05-18 11:37:22 +09:00
ac3fc89df9 Merge pull request #5151 from SparkiDev/tls13_premaster
TLS 1.3:  pre-master secret zeroizing
2022-05-17 19:18:43 -07:00
54a96cef06 add test case 2022-05-18 11:16:10 +09:00
88abc9f3c1 addressed review comments
add to call wc_ecc_rs_to_sig and wc_ecc_verify_has
2022-05-18 11:16:07 +09:00
c1f117413f get crypto only compiled with openssl extra 2022-05-18 11:16:03 +09:00
1765e2c482 Merge pull request #5150 from haydenroche5/benchmark_main_void
Fix main signature in benchmark.c.
2022-05-18 10:10:07 +10:00
04ff6afbad Add ability to store issuer name components when parsing a certificate.
This is turned on when `WOLFSSL_HAVE_ISSUER_NAMES` is defined. This allows the
user to inspect various issuer name components (e.g. locality, organization,
etc.) by using these new fields in a `DecodedCert`.
2022-05-17 16:29:52 -07:00
2f91028f2d TLS 1.3: pre-master secret zeroizing 2022-05-18 08:52:38 +10:00
fd535242a0 Fix main signature in benchmark.c.
If `NO_CRYPT_BENCHMARK` is defined, the main function is `int main()`, but it
should be `int main(void)`.
2022-05-17 14:28:43 -07:00
8b46c95f06 macro guard for build with disable ecc 2022-05-17 11:36:09 -06:00
d6935ed3be Review comments 2022-05-17 09:21:20 -07:00
c9ae021427 Merge pull request #5143 from julek-wolfssl/x509-ret-empty-name
Return subject and issuer X509_NAME obj even when not set
2022-05-17 09:16:54 -07:00
50cc6d0422 Merge pull request #5139 from cconlon/opensshfips
Modify --enable-openssh to not enable non-FIPS algos for FIPS builds
2022-05-17 09:16:21 -07:00
6df65c0162 wolfio: dtls: fix incorrect peer matching check
Ignore packet if coming from a peer of a different size *or* from a different
peer. Avoid whole memcmp of sockaddr_in[6] struct because is not portable (there
are optional fields in struct sockaddr_in).
2022-05-17 11:01:55 +02:00
fc12c68601 Merge pull request #5146 from dgarske/kcapi_keywrap
Fix to allow enabling AES key wrap (direct) with KCAPI
2022-05-17 08:16:00 +10:00
1dc5e4cee5 add padding for variable ecc signature size 2022-05-16 15:26:29 -06:00
ec619e3f35 Merge pull request #5107 from julek-wolfssl/wpas-ex-data-leak
Call ctx->rem_sess_cb when a session is about to be invalid
2022-05-16 13:27:08 -07:00
579a37bdf0 Merge pull request #5117 from cconlon/getrandom
add support for Linux getrandom() with WOLFSSL_GETRANDOM
2022-05-16 12:36:30 -07:00
0ef4707859 Merge pull request #5137 from JacobBarthelmeh/docs 2022-05-16 12:18:14 -06:00
7f8f0dcffe Refactor cache ex_data update/retrieve into one function
- Add explicit pointer cast
2022-05-16 13:01:05 +02:00
d996086a6d Return subject and issuer X509_NAME obj even when not set
This allows the user to set the attributes of the subject and issuer name by calling X509_REQ_get_subject_name and adding attributes to it.
2022-05-16 12:49:34 +02:00
fb9b96d498 fix for index increment and change test case expected return values 2022-05-13 14:07:29 -07:00
6b1e3003fb Merge pull request #5142 from SparkiDev/ssl_move_pk
ssl.c rework
2022-05-13 12:56:14 -07:00
3a4feddf75 update code for continued support with i.MX6 2022-05-13 13:21:45 -06:00
643cd78ea2 Fix to allow enabling AES key wrap (direct) with KCAPI. 2022-05-13 11:15:32 -07:00
1a57e3065a Small cleanups. Missing (void), spelling and formatting. Also fixes for variations of 25519/448 build. 2022-05-13 09:24:59 -07:00
7305616452 Merge pull request #5080 from JacobBarthelmeh/DH
with WOLFSSL_NO_DH186 restriction allow odd DH param size generations
2022-05-13 08:57:33 -07:00
50f53f9576 Merge pull request #5129 from LinuxJedi/remove-python-wrappers
Remove the Python wrappers from wolfSSL source
2022-05-13 08:36:33 -07:00
630c5ef364 Merge pull request #5140 from SparkiDev/sp_fixes_7
SP fixes
2022-05-12 21:57:48 -07:00
852d5169d4 ssl.c rework
Move the public key APIs out of ssl.c and into pk.c.
(RSA, DSA, DH and EC)
2022-05-13 11:12:44 +10:00
eea537e5ea Merge pull request #5124 from kaleb-himes/WIN_MULTICONFIG
Address issues ID'd by new windows multi-config test
2022-05-13 09:39:15 +10:00
e8160f049e SP fixes
Fix div_word without using div.
Fix ARM32 and Cortex-M builds to work for 4096 again.
2022-05-13 09:37:24 +10:00
c3a79f50d8 modify --enable-openssh to not enable non-FIPS algos for FIPS builds 2022-05-12 16:53:57 -06:00
e6ce735ed8 add support for Linux getrandom() with WOLFSSL_GETRANDOM 2022-05-12 16:51:38 -06:00
6aaee73585 Merge pull request #5133 from rizlik/cookie_keyshare_fix
tls13: fix cookie has keyShare information check
2022-05-13 08:01:59 +10:00
d1308fcdfc Merge pull request #5122 from rizlik/tls13_pad_calc
internal.c: fix pad-size when more records are received at once
2022-05-13 07:59:36 +10:00
52fc3844a6 Merge pull request #5127 from rizlik/wolfss_msg_fix
wolfcrypt: logging: use do{}while(0) to disable WOLFSSL_MSG* macro
2022-05-13 07:55:18 +10:00
988236ca70 remove port print out 2022-05-12 13:07:04 -07:00
8124368319 Merge pull request #5136 from douzzer/20220512-stderr
print errors to stderr, not stdout
2022-05-12 13:59:41 -06:00
c4920021d8 print errors to stderr, not stdout;
fix whitespace in internal.c;

add missing error handling in examples/server/server.c around recvfrom().
2022-05-12 13:07:32 -05:00
60864f19da Merge pull request #5130 from JacobBarthelmeh/examples
print out test errors to stderr instead of stdout
2022-05-12 12:44:45 -05:00
2cf87a8049 Merge pull request #5084 from julek-wolfssl/zd14101-dtls-want-write
DTLS fixes with WANT_WRITE simulations
2022-05-12 09:36:40 -07:00
7316a275ae Add EXTRA_DIST entry for include.am 2022-05-12 17:00:02 +01:00
c3d4c3086e Add README to point to the new Python locations 2022-05-12 16:55:26 +01:00
05ce8329c9 Merge pull request #5067 from miyazakh/compat_altcertchain
"veify ok" if alternate cert chain mode is used
2022-05-12 08:54:51 -07:00
7a95be1a97 Merge pull request #5126 from JacobBarthelmeh/crl
do not error out on CRL next date if using NO_VERIFY
2022-05-12 08:44:29 -07:00
9ca1206bf3 Merge pull request #5131 from SparkiDev/sp_win_fixes_1
SP: Windows build fixes
2022-05-12 09:56:27 -05:00
44be4e1cc8 Reset ret in client and server after wolfSSL_dtls_got_timeout()
- Do UDP connect only with simulateWantWrite to accommodate macOS that doesn't like sendto being called on connected UDP sockets
- Call wolfSSL_dtls_get_current_timeout only on a DTLS connection
2022-05-12 16:48:04 +02:00
9914da3046 Fix resumption failure and use range in connect state logic 2022-05-12 15:46:08 +02:00
a31b76878f DTLS fixes with WANT_WRITE simulations
- WANT_WRITE could be returned in unexpected places. This patch takes care of that.
- Change state after SendBuffered only if in a sending state to begin with.
- Adapt client and server to simulate WANT_WRITE with DTLS
2022-05-12 15:46:08 +02:00
829e9f5277 tls13: fix cookie has keyShare information check
Fix the check to see if the cookie has key_share information or not (needed to
reconstruct the HelloRetryRequest). At the moment, it looks like we never send a
cookie without KeyShare extension. Indeed the HelloRetryRequest is sent only
because the client didn't provide a good KeyShareEntry in the first
ClientHello. When we will support DTLSv1.3, the HelloRetryRequest will be used
as a return-routability check and it may be sent without the KeyShare extension.
2022-05-12 12:10:58 +02:00
8e3d7fc6f4 wolfcrypt: logging: use do{}while(0) to disable WOLFSSL_MSG* macro
otherwise statement of the type:

if (condtion)
    WOLFSSL_MSG("");

after preprocessing will become:

if (condition)
    ;

The empty body emits a warning from the compiler.
2022-05-12 09:59:27 +02:00
36739bca62 cleanup memory on structure free 2022-05-11 21:57:13 -07:00
818ac2b8dd add more REQ attribute support 2022-05-11 22:27:48 -06:00
798d81723b Merge pull request #5128 from rizlik/dtls_bidrectional_shutdown
Support DTLS bidirectional shutdown in the examples
2022-05-11 17:00:44 -07:00
f5b0d3c0b4 SP: Windows build fixes 2022-05-12 08:25:46 +10:00
36575ff480 Merge pull request #5125 from douzzer/20220510-strncmp-misuse
s/strncmp/strcmp/g
2022-05-12 08:22:00 +10:00
5d93a48ddf veify ok if alternate cert chain mode for verifyCallback 2022-05-12 06:15:18 +09:00
5caef7eaba avoid dead store with test case 2022-05-11 11:53:17 -06:00
9bee0281cb print out test errors to stderr instead of stdout 2022-05-11 11:40:54 -06:00
fd9e1e21ed Remove the Python wrappers from wolfSSL source
The wolfCrypt and wolfSSL Python wrappers are maintained in the
wolfCrypt-py and wolfSSL-py trees respectively. The duplicates in this
tree are stale. The content has been checked and any important changes
have been ported over to their respective trees.
2022-05-11 15:02:51 +01:00
eb6f9152db Revert modifications addressed by wolfSSL/scripts PR #235 2022-05-11 07:27:16 -06:00
761ab6b17a tests: add bidirectional shutdown UDP tests 2022-05-11 13:27:37 +02:00
257c55a311 examples: allow bidirectional shutdown in UDP
This commit allows the examples to perform a bidirectional shutdown also when
using UDP. It is useful to test DTLS retransmission.

Signed-off-by: Marco Oliverio <marco@wolfssl.com>
2022-05-11 13:27:24 +02:00
27e73818c5 tests: run test_wolfSSL_dtls_export() over UDP instead of TCP 2022-05-11 12:20:15 +02:00
692a01238e tests: support udp in test_server_nofail() 2022-05-11 12:19:09 +02:00
dca71d36f6 SP: Script changed, generated result update 2022-05-11 10:51:19 +10:00
d90a89898c wolfssl/test.h:OCSPRespFreeCb(): fix non-void return of and from void function. 2022-05-10 15:14:21 -05:00
9fbb4a923f src/internal.c:GetCipherKeaStr(): allow "ECDH" (in addition to "ECDHE") as a suite clause that maps to KEA "ECDH". 2022-05-10 15:12:00 -05:00
77fa0ccb82 src/tls.c:BuildTlsFinished(): work around false positive -Wmaybe-uninitialized. 2022-05-10 15:10:23 -05:00
531120131a do not error out on CRL next date if using NO_VERIFY 2022-05-10 14:00:21 -06:00
26673a0f28 where appropriate, use strcmp/strcasecmp, not strncmp/strncasecmp;
add macro XSTRCASECMP();

update XSTRNCASECMP() for XC32 >= 1.00 to use strncasecmp.
2022-05-10 12:20:12 -05:00
cb6a138caf Implement peer review feedback 2022-05-10 08:43:18 -06:00
f06ac9965c internal.c: fix: plaintext check account for the current record only 2022-05-10 13:12:09 +02:00
db23d8a0cf internal.c: don't skip records if we don't process early-data
If we don't process early data, we want to skip only the current record and not
all the received data
2022-05-10 13:04:43 +02:00
445c1e6ceb internal.c: don't check TLS13 plaintext limit twice
Plaintext size is checked before decryption in TLS 1.3
2022-05-10 12:51:50 +02:00
0747a16893 Merge pull request #5119 from JacobBarthelmeh/fuzzing
adjust setting of input pointer with BER pkcs7 edge case
2022-05-10 09:40:51 +10:00
d5f7beefd4 Address issues ID'd by new windows multi-config test 2022-05-09 16:50:56 -06:00
063e757f6b Merge pull request #5121 from miyazakh/sce_example_update2 2022-05-09 14:15:13 -06:00
d133fa6143 server: check that the first packet of udp connection is clientHello
Used to allow for bi-directional shutdown tests with UDP and DTLS
2022-05-09 13:45:27 +02:00
0c7e9a0104 internal.c: fix pad-size when more records are received at once
don't consider the end of the record the end of received data as more records
may be read at once when DTLS will be supported.
2022-05-09 11:00:31 +02:00
59fdf05155 Merge pull request #5111 from kaleb-himes/ABI-check-test-rev2
Refactor wolfSSL_ASN1_TIME_adj to use GetFormattedTimeString (new API)
2022-05-09 09:15:57 +10:00
d95b2e69b5 Merge pull request #5112 from JacobBarthelmeh/Testing
fix for indef buffer check with pkcs7
2022-05-09 09:03:10 +10:00
b76c70d969 Merge pull request #5120 from dgarske/v5.3.0_cubepack 2022-05-08 07:50:20 -06:00
75d90aaf2f update key data and add fixes
Fix Aes gcm memory curruption

  - fix delta size calculation
  - add logging SEGGER printf for RA6M4
  - update client example

Added test cases

 - Fixed aes buffer overflow
 - Fixed usable
 - Fixed sce - no-sce use case
 - Add logging SEGGER printf for RA6M4
2022-05-07 10:43:43 +09:00
421f54e60a Merge pull request #5118 from douzzer/20220405-declaration-after-statement
20220405 declaration after statement
2022-05-06 16:16:52 -07:00
74b3df4f6c Refactor tmpF in RsaMGF1 2022-05-06 16:14:47 -07:00
bc877dab2a Changes to support v5.3.0 cube pack for ST. 2022-05-06 15:49:11 -07:00
1e1a722332 Merge pull request #5113 from JacobBarthelmeh/docs
fix markdown in readme notes
2022-05-06 14:20:16 -07:00
576f0aa045 adjust setting of input pointer with BER pkcs7 edge case 2022-05-06 14:22:53 -06:00
6be3dae6d3 Merge pull request #5104 from tmael/32_bit_ssize
Fix for stack and heap measurements of a 32-bit build
2022-05-06 14:32:06 -05:00
ad2119b2f8 Review comments 2022-05-06 12:00:32 -07:00
36877d78b4 Merge pull request #5078 from julek-wolfssl/wpas-tls13
Clean up wolfSSL_clear() and add some more logging
2022-05-06 11:45:43 -07:00
b59ac022c9 fix comment explaining ConstantCompare() in AES_GCM_decrypt_C(). 2022-05-06 13:36:54 -05:00
ccc9b1535d fix whitespace. 2022-05-06 13:34:32 -05:00
99b44f15ef fix various -Wdeclaration-after-statement, with and without --enable-smallstack. 2022-05-06 13:34:32 -05:00
3e774be88c Minor text and formatting cleanups. 2022-05-06 11:01:40 -07:00
e1aefc08ac Merge pull request #5110 from douzzer/20220405-NETWORK_UNSHARE_HELPER
$NETWORK_UNSHARE_HELPER
2022-05-06 09:46:36 -07:00
88443dea8c Merge pull request #5114 from SparkiDev/ct_fixes_2
SP: Div fixes for constant time
2022-05-06 09:44:11 -07:00
b6b007de3c Call ctx->rem_sess_cb when a session is about to be invalid
Allow the user to register a session remove callback with wolfSSL_CTX_sess_set_remove_cb() that will be called when the session is about to be free'd or evicted from cache.
2022-05-06 16:34:28 +02:00
ef89e2e637 Rename utc_str[_buf] -> time_str[_buf] (semantic change) 2022-05-06 08:18:14 -06:00
3e1ba5d4d4 Implement peer review feedback and leave some breadcrumbs in the event of future updates 2022-05-06 07:50:39 -06:00
b19f70d182 Fix TSIP build with NO_AES_CBC 2022-05-06 07:31:13 -05:00
7e9896d162 Only clear session when we didn't complete a handshake
- Allow overriding buffer size with `WOLFSSL_MSG_EX_BUF_SZ`
- Allow disabling `WOLFSSL_MSG_EX` by defining `NO_WOLFSSL_MSG_EX`
2022-05-06 12:35:49 +02:00
9ffc300641 SP: Div fixes for constant time
Implement div words for different platforms.
Use implementation not using a divide instruction unless
SP_DIV_WORD_USE_DIV or we know there is a div instruction.
Fix Thumb implementation of div word.
2022-05-06 16:02:18 +10:00
a9c7bc9d00 fix markdown in readme notes 2022-05-05 17:12:55 -06:00
853db0841f fix for indef buffer check with pkcs7 2022-05-05 16:25:28 -06:00
ecf449dfe0 Refactor wolfSSL_ASN1_TIME_adj to use GetUnformattedTimeString (new API) 2022-05-05 16:25:25 -06:00
a4eaa31b5e Merge pull request #5101 from dgarske/sniffer_async_test
Improve the sniffer asynchronous test case to support multiple concurrent streams
2022-05-06 08:14:32 +10:00
4d4145e6a0 add support for $NETWORK_UNSHARE_HELPER to the relevant scripts/. 2022-05-05 15:59:11 -05:00
19e8bb05f3 wolfcrypt/src/aes.c: fix shiftTooManyBitsSigned in AES_GCM_decrypt_C(). 2022-05-05 15:54:31 -05:00
ffe5599013 Fix testsuite 32-bit build 2022-05-05 08:08:09 -07:00
6e880495dc Merge pull request #5102 from SparkiDev/ct_valgrind_fixes_1
Constant time changes
2022-05-05 07:43:00 -07:00
189c9ab234 Constant time changes
GCM: make borrow constant time.
AES-GCM decrypt: compare at end and constant time.
Random: array_add touchs all elements every time.
RSA-OAEP: look for padding byte in constant time (look at every byte in
array).
SP
 - reduce conditional use (make them bit ops)
 - Fix point adds to not use double when adding infinity to infinity
 - Implement signed div as __divi3 is not constant time.
 - Move check sof input variables to API.
2022-05-05 12:26:57 +10:00
e81670a3c0 Merge pull request #5106 from douzzer/20220504-linuxkm-wc-port-h
linuxkm_wc_port.h: move several more definitions outside the BUILDING_WOLFSSL gate
2022-05-04 13:09:19 -07:00
9767631ebe Merge pull request #5100 from anhu/enable-wolfssh
For consistency, add --enable-wolfssh
2022-05-04 13:02:54 -07:00
af8865d13e linuxkm_wc_port.h: move several more definitions outside the BUILDING_WOLFSSL gate, as they are needed for applications to include various wolfssl headers. 2022-05-04 13:16:45 -05:00
bdd6072ede Check nomalloc with verify inline 2022-05-04 09:33:38 -07:00
f12fd6ab8b fix spelling 2022-05-04 09:11:12 -07:00
af8f18b634 Merge pull request #5103 from danielinux/rsa-encryptsize
wc_RsaEncryptSize needed in verify only and no-PSS builds
2022-05-04 07:53:06 -07:00
fff3402ed4 WOLFSSL ---> WOLFSSH 2022-05-04 09:28:08 -04:00
e606cccb10 wc_RsaEncryptSize needed in verify only and no-PSS builds 2022-05-04 14:20:44 +02:00
97f54e8e0a Support RSA OAEP with no malloc 2022-05-03 22:57:47 -07:00
ca955032a0 Fix 32-bit enable-trackmemory build 2022-05-03 20:48:38 -07:00
a9d28da7ce Fix 32-bit enable-stacksize build 2022-05-03 20:16:56 -07:00
5f539b3921 Improve the sniffer asynchronous test case to support multiple concurrent streams. 2022-05-03 16:43:15 -07:00
cb929e1247 For consistency, add a --enable-wolfssl; keep --enable-ssl for backwards compat. 2022-05-03 12:08:13 -04:00
e722c15be8 Merge pull request #5098 from JacobBarthelmeh/Release
- prep for release 5.3.0
2022-05-03 10:48:53 +10:00
628a91efda Fix for size calculation for encrypt then mac without openssl extra enabled. Fix for cast warning. 2022-05-02 17:11:48 -06:00
6f5be32d3a update rpm spec 2022-05-02 17:08:38 -06:00
94e34d7a98 use NO_SESSION_CACHE_REF with titan cache due to session rows too big error 2022-05-02 17:08:38 -06:00
29401334d3 prepare for release 5.3.0 2022-05-02 17:08:38 -06:00
48cb185ce9 Merge pull request #5096 from JacobBarthelmeh/Testing
- static analysis test fixes
2022-05-02 10:05:08 -07:00
14ff3d1f0f fix for macro guard with test case building with trusted peer certs 2022-04-29 14:46:35 -07:00
35f46018a5 Merge pull request #5094 from SparkiDev/mrg_armv8_old_c_2
Move delaration to before code statements.
2022-04-29 11:02:32 -06:00
9d7a02b28e remove uint from test case and put variable declaration at top of scope 2022-04-29 10:40:44 -06:00
38c01b9d9f fix for infer diff report 2022-04-29 10:34:38 -06:00
895522aa18 Make the critical extension flags in DecodedCert always available.
Prior to this commit, these were guarded by OPENSSL_EXTRA ||
OPENSSL_EXTRA_X509_SMALL. Adding them into the struct for non-compatibility
layer builds only increases memory usage slightly and is useful for the user.
2022-04-28 15:46:16 -07:00
ef4d484f85 Move delaration to before code statements. 2022-04-29 08:13:20 +10:00
ea8e9ee699 Merge pull request #5063 from kaleb-himes/ZD13349
Ensure supported curves and curve size(s) WIN FIPS
2022-04-28 11:50:19 -06:00
df4dd7d5b3 Merge pull request #5088 from dgarske/sniffer_async_2
Fix to properly trap errors in sniffer (broken after async additions)
2022-04-28 09:47:05 -06:00
2ec7951de6 Merge pull request #4803 from danielinux/tirtos-update-202201
Update TIRTOS support
2022-04-28 10:12:32 -05:00
9970b68e45 Add HAVE_TLS_EXTENSIONS 2022-04-28 09:10:13 -06:00
881b9e5b07 Merge pull request #5093 from SparkiDev/rsa_fermat_fix
Fix use of WC_RSA_NO_FERMAT_CHECK
2022-04-28 06:40:08 -07:00
f91936944d Fix use of WC_RSA_NO_FERMAT_CHECK 2022-04-28 16:29:48 +10:00
67838e099d Merge pull request #5092 from ejohnstown/cert-ext-gen-test
Certificate Extension Generation Test
2022-04-28 10:25:28 +10:00
8b39f863e6 fix for buffer size and key cover 2022-04-27 13:14:22 -07:00
3294a3f8f8 Certificate Extension Generation Test
The test for certificate extensions requires both the test certs option
and the certificate generation option to run. The certs for the test are
generated by wolfCrypt. This disables the extensions test if
certificate generation is disabled.
2022-04-27 13:08:28 -07:00
22802604c0 Merge pull request #5090 from dgarske/public_dh
Fix for DH public FFDHE incorrectly getting enabled
2022-04-27 13:08:46 -05:00
277d6dc5dd Fix minor clang-tidy warnings for async. 2022-04-27 10:22:19 -07:00
93e8133453 Merge pull request #4896 from elms/compat/const_casting_fun
Casting away `const` for improved compatibility
2022-04-27 09:35:58 -07:00
7e803f346d Merge pull request #5076 from JacobBarthelmeh/fuzzing
fix for sanity check on PKCS7 indef read
2022-04-27 09:34:34 -07:00
8bf228d346 Merge pull request #5083 from SparkiDev/d2i_ecpriv_der
d2i_ECPrivateKey() takes DER encoded data
2022-04-27 09:32:04 -07:00
1d64c735ce Merge pull request #5086 from elms/cmake/ocsp_crl
cmake: Add CRL, OCSP, and OCSP stapling options
2022-04-27 09:31:51 -07:00
ad68bb9a7a Merge pull request #5091 from SparkiDev/mrg_armv8_old_c
Can't declare variables in for statements
2022-04-27 09:31:19 -07:00
83f4f9e5ef Espressif notes for user_settings.h preference 2022-04-27 08:41:33 -07:00
fbc2ccca1e Fix to properly trap errors in sniffer SetupKeys after async changes. Fix minor scan-build warnings. 2022-04-27 08:28:36 -07:00
11bdb8550e Correction 2022-04-27 08:33:56 -06:00
c0d7f3b2e6 add support for i.MX8 with QNX CAAM 2022-04-27 02:27:05 -07:00
ac48438bd0 Can't declare variables in for statements 2022-04-27 11:10:53 +10:00
7233732159 move ESP8266-specific to separate section 2022-04-26 17:58:14 -07:00
f86f4a8ca0 d2i_ECPrivateKey() takes DER encoded data
Code was incorrectly using data as a private key instead of DER
decoding.
Fixed i2d_EcPrivateKey() to output DER encoded data.
2022-04-27 09:39:50 +10:00
ec38048711 cmake: Add CRL, OCSP, and OCSP stapling options 2022-04-26 16:23:46 -07:00
25e8bd6b45 Merge pull request #5044 from SparkiDev/sp_read_radix_10_oob
SP Math
2022-04-26 16:21:11 -07:00
67029dc4e7 Fix to make sure the old public DH API's are not enabled unless FIPS v2 or older. Broken in PR #5018. 2022-04-26 15:39:54 -07:00
321e44226a Casting away const for improved compatibility
This is appears to be an existing pattern.

Fixes #4893
2022-04-26 14:31:40 -07:00
a6d019ecf9 Merge pull request #5073 from JacobBarthelmeh/PKCS7 2022-04-26 14:41:13 -06:00
cbc27f7de4 Merge pull request #5085 from douzzer/20220426-multi-test
20220426 multi-test fixups
2022-04-26 11:15:59 -07:00
7436a41bc7 Merge pull request #5046 from SparkiDev/cppcheck_fixes_8
cppcheck: fixes
2022-04-26 10:37:42 -07:00
7e8598f75b Merge pull request #5081 from dgarske/sniffer_decrypt
Restore sniffer internal decrypt function. This allows decrypting TLS…
2022-04-26 09:37:32 -07:00
67a3326e6d Merge pull request #5082 from SparkiDev/sp_c++
CPP protection for extern references to asm code
2022-04-26 08:33:15 -07:00
4e02d7e404 fix clang-tidy-Customer-CFG-7 readability-redundant-preprocessor. 2022-04-26 10:20:26 -05:00
704a18d103 Merge pull request #5079 from tmael/rsa_vfg
Fix no malloc RSA  test
2022-04-26 08:11:44 -07:00
e6d267ef16 src/ssl.c wolSSL_DH_new_by_nid(): fix cppcheck nullPointer report. 2022-04-26 09:58:07 -05:00
5e1a358dff wolfcrypt/src/evp.c wolfSSL_EVP_PKEY_free(): fix clang-diagnostic-implicit-fallthrough. 2022-04-26 09:57:54 -05:00
2c5db7b64c fix whitespace. 2022-04-26 09:57:25 -05:00
0be79a8629 CPP protection for extern references to asm code 2022-04-26 10:17:25 +10:00
8737d46bb1 Merge pull request #5018 from haydenroche5/libspdm
Make changes to compatibility layer to support libspdm.
2022-04-26 09:55:22 +10:00
d362b6dd08 Merge pull request #5033 from haydenroche5/ec_key_print_fp
Add wolfSSL_EC_KEY_print_fp to compat layer.
2022-04-26 09:51:37 +10:00
273ed1df76 Restore sniffer internal decrypt function. This allows decrypting TLS v1.2 traffic ignoring AEAD errors. 2022-04-25 16:28:09 -07:00
20e5e654a3 cppcheck: fixes
CBIORecv/Send are only assigned once.
IOCB_ReadCtx/WriteCtx only assigned once.
BuildMessage checks output and input wiht sizeOnly every call - state
machine doesn't cache these.
Renamed alias_tbl variables to something unique.
Other cppcheck fixes.
Also reworked pem_read_bio_key().
2022-04-26 09:26:41 +10:00
1181081c38 Merge pull request #5075 from dgarske/cryptocb
Fix for PKCS7 with Crypto Callbacks
2022-04-25 17:23:28 -06:00
3ab5ccd04f Add support for EVP_PKEY_sign/verify functionality (#5056)
* Fix wolfSSL_RSA_public_decrypt() return value to match Openssl
* Add support for EVP_PKEY_verify_init() and EVP_PKEY_verify()
* wpa_supplicant SAE public key functionality requires this function.
* Add DSA support for EVP_PKEY_sign/verify()
* Add ECDSA support for EVP_PKEY_sign/verify()
* Add tests for EVP_PKEY_sign_verify()
* Fix "siglen = keySz" at error cases
* Fix wolfSSL_DSA_do_sign() usage
1. Check wolfSSL_BN_num_bytes() return value
2. Check siglen size
3. Double the siglen
* Check return code of wolfSSL_i2d_ECDSA_SIG() in wolfSSL_EVP_DigestSignFinal()
* Add size calculations to `wolfSSL_EVP_PKEY_sign`
* Add size checks to wolfSSL_EVP_PKEY_sign before writing out signature
* Use wc_ecc_sig_size() to calculate ECC signature size
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2022-04-25 14:19:56 -07:00
9bf4a94796 with WOLFSSL_NO_DH186 restriction allow odd DH param size generations 2022-04-25 15:13:24 -06:00
bfd24cfa23 Merge pull request #5071 from dgarske/scan-build
Fixes for various nightly scan-build errors and warnings
2022-04-25 13:30:43 -07:00
85ef91ce6d Move up local variable at the beginning 2022-04-25 12:40:31 -07:00
34d541109d Additional scan-build warning fixes. 2022-04-25 09:55:36 -07:00
18a6a7c4a7 Fix RSA nomalloc test 2022-04-25 09:50:50 -07:00
cd2c7e1438 guard on test case for ecc curves 2022-04-25 09:01:24 -06:00
4013f83e4f Add some missing logs and implement WOLFSSL_MSG_EX()
WOLFSSL_MSG_EX() uses XVSNPRINTF to allow for formatted strings to be printed. It uses a 100 byte internal stack buffer to format the log message.
2022-04-25 15:59:07 +02:00
15a48e411d Add WOLFSSL_ESP8266 for ESP-IDF 2022-04-23 12:30:34 -07:00
70ad19467c Merge pull request #5068 from cconlon/jniPKCallbacks
Don't enable PK Callbacks with JNI FIPS builds
2022-04-22 16:08:29 -07:00
4ecf3545d7 Improve scan-build fix for ProcessPeerCertParse checking of empty dCert. With WOLFSSL_SMALL_CERT_VERIFY it is NULL. 2022-04-22 16:07:24 -07:00
e9b80e53fa Fix issue with InitX509Name. 2022-04-22 16:02:54 -07:00
74cd2fd910 Fix for integer.c possible uses of mp_int input with DP NULL. 2022-04-22 16:02:54 -07:00
ea2841fa7a Make sure ASN1 isDynamic is always set to 0. SK Cipher doesn't have free (data is contained in the SK). 2022-04-22 16:02:54 -07:00
84a33183a6 Various scan-build fixes. 2022-04-22 16:02:54 -07:00
3755b88a02 Fix InitX509Name to set dynamicName on init. 2022-04-22 16:02:53 -07:00
c41b1b1b9b Fix to ensure args->dCert is set for ProcessPeerCertParse. 2022-04-22 16:02:53 -07:00
a6a89d3316 Fix for integer.c s_mp_add output to make sure it grows if not set. 2022-04-22 16:02:53 -07:00
5a75e0f6c6 Fix for MCAPI CRYPT_AES_CTX size with ./configure --enable-pkcallbacks --enable-mcapi --enable-ecc --enable-sha512 --with-libz --enable-opensslextra. 2022-04-22 16:02:53 -07:00
293d7e1241 Fix for report of Use of memory after it is freed. Force the dataIsAlloc set to 0. 2022-04-22 16:02:53 -07:00
8fb1bb8781 Merge pull request #5074 from embhorn/zd14105
Fix for mingw builds
2022-04-22 15:27:58 -07:00
9cbf92df01 Fix for PKCS7 sign to allow providing a public key only if using crypto callback w/devId. ZD13949. 2022-04-22 14:29:43 -07:00
d96bd30398 fix for sanity check on PKCS7 indef read 2022-04-22 15:28:03 -06:00
b543aa0148 Fix for mingw builds 2022-04-22 14:35:46 -05:00
bf16696d8c Merge pull request #5036 from dgarske/sniffer
Fixes for minor sniffer and async issues
2022-04-22 12:24:33 -07:00
ed58cfdc0f Add DEBUG_CRYPTOCB and wc_CryptoCb_InfoString to help with debugging crypto callbacks. 2022-04-22 12:20:55 -07:00
d5927a58dd add store of PKCS7 cert used for verify 2022-04-22 11:26:34 -06:00
8ea953f8c0 add support for importing private only EC key to a WOLFSSL_EVP_PKEY struct 2022-04-22 10:20:42 -06:00
cb1dbb75f8 Fixes for sniffer-gen.sh. 2022-04-22 08:25:00 -07:00
8c4887c166 Free session in wolfSSL_clear
- Define `NO_SESSION_CACHE_REF` in wpa build
2022-04-22 15:54:04 +02:00
6606984101 Fix for building sniffer without ECC while Curve25519 is enabled. 2022-04-21 16:54:11 -07:00
2fa1e19fe7 Fix for ./configure --enable-sniffer --enable-session-ticket --disable-ecc && make. 2022-04-21 13:28:38 -07:00
cfa338314d do not enable PK Callbacks with JNI in FIPS mode 2022-04-21 11:06:54 -06:00
4a4b019e30 tests/api.c: in test_wc_ecc_verify_hash_ex(), check that passing zero r and/or s to wc_ecc_verify_hash_ex() returns MP_ZERO_E. 2022-04-21 07:21:42 +02:00
cfab451328 Merge pull request #5024 from dgarske/zd13538 2022-04-20 13:08:13 -07:00
7964fa4195 Merge pull request #5055 from elms/cmake/out_of_src 2022-04-20 11:16:50 -07:00
f9acaab6fe Fix memory leak with pcap bpf_program not calling pcap_freecode. 2022-04-19 16:45:49 -07:00
ec76f79e9d Fixes for sniffer decrypt broken in PR #4875. The TLS v1.2 sniffer decrypt did not have ssl->curRL set for proper auth tag calculation and was placing the data at offset + 8 to leave room for explicit IV. 2022-04-19 16:31:27 -07:00
49f510544a Merge pull request #5057 from haydenroche5/pem_write_ec_rsa_pub
Add wolfSSL_PEM_write_RSAPublicKey and wolfSSL_PEM_write_EC_PUBKEY.
2022-04-19 16:19:38 -07:00
696c5eed25 Ensure supported curves and curve size(s) WIN FIPS 2022-04-19 16:16:15 -06:00
29392ac6b3 spell fix: OSCP -> OCSP 2022-04-19 15:11:08 -07:00
d4e8922dfd cmake: fixup install lib structure for windows 2022-04-19 15:11:08 -07:00
a7cc438c9c cmake: out of source support
Add `WOLFSSL_BUILD_OUT_OF_TREE` option to force not changing the
source tree. Also defaults to `CMAKE_DISABLE_SOURCE_CHANGES` to avoid
failures
2022-04-19 15:11:08 -07:00
5d0654ee56 Merge pull request #5062 from dgarske/clang_str
Fix for issue with `error: format string is not a string literal`
2022-04-19 14:27:36 -05:00
d7085069d6 Add wolfSSL_PEM_write_RSAPublicKey and wolfSSL_PEM_write_EC_PUBKEY.
These were compatibility layer stubs before.
2022-04-19 09:42:10 -07:00
95a85d16d2 Fix for issue with error: format string is not a string literal. 2022-04-19 08:49:05 -07:00
70a0983bbc Fix for minor warning with chain input enabled and async disabled. 2022-04-18 16:17:37 -07:00
52b176b6a1 Merge pull request #5060 from cconlon/ecFipsReady
ECDH_compute_key: allow setting of globalRNG with FIPS 140-3 / Ready
2022-04-18 16:15:14 -07:00
710f49795f Fix for session cache locking with session stats in get_locked_session_stats. 2022-04-18 14:29:42 -07:00
659d33fdaf Fixes for minor sniffer and async issues:
* Sniffer: Remove old restrictions for max strength, encrypt-then-mac and forcing openssl-extra.
* Fix bound warning with strncpy in sniffer.c.
* Fix for async DH issue.
* Fix for SP math all not initializing raw big int.
* Fix for array bounds warning with "-O3" on SetEccPublicKey.
* Fix a sniffer async edge case with TLS v1.2 static RSA and extended master.
* Improved the sniffer test script detection of features.
* Disable ECC custom curve test with Intel QuickAssist.
2022-04-18 11:46:40 -07:00
9172abc969 Merge pull request #5059 from julek-wolfssl/missing-XFCLOSE
Add missing XFCLOSE()
2022-04-18 14:16:36 -04:00
567ae7ca55 Merge pull request #5061 from miyazakh/sce_keydata_update 2022-04-18 09:14:34 -06:00
6e70cdf3b5 Update key data for sce example 2022-04-17 14:29:44 +09:00
e89b4cce4c Merge pull request #5045 from SparkiDev/wycheproof_armasm
Wycheproof testing of Aarch64 ASM
2022-04-15 11:23:45 -07:00
8eed940e3a Merge pull request #5040 from SparkiDev/wycheproof_intelasm
Wycheproof fixes
2022-04-15 11:19:57 -07:00
3ab87ba2ed Merge pull request #5039 from SparkiDev/ecc_pub_api
ECC: make public APIS for add and double points
2022-04-15 11:09:37 -07:00
35cb3c8a79 ECDH_compute_key: allow setting of globalRNG with FIPS 140-3 / Ready 2022-04-15 09:36:14 -06:00
6c16b9c0b5 Merge pull request #5054 from miyazakh/tsipV1p15_grose
Update Renesas TSIP version to 1.15 on GR-ROSE
2022-04-15 09:34:09 -06:00
a70e188758 Merge pull request #5058 from douzzer/20220414-clang-tidy-intmath
20220414-clang-tidy-intmath
2022-04-15 10:17:27 -05:00
a6319fc2a9 Add missing XFCLOSE() 2022-04-15 16:26:31 +02:00
607a24b499 fixes for clang-tidy and sanitizer hygiene with --disable-fastmath. 2022-04-14 21:06:04 -05:00
096889927d wolfcrypt/src/port/devcrypto/devcrypto_aes.c: remove redundant "int ret" in wc_AesCtrEncrypt() (supersedes #5052). 2022-04-14 20:23:31 -05:00
2e3ebd7d8c Merge pull request #5053 from kaleb-himes/CLOUD_PORTING_A
Change void cast(s) to be non-conditional and consolidate condition l…
2022-04-14 14:21:42 -05:00
2fbe030e5e update tsip version to 1.15 2022-04-14 06:42:11 +09:00
d706e2be32 Change void cast(s) to be non-conditional and consolidate condition logic 2022-04-13 10:25:43 -06:00
947c72937f Merge pull request #5049 from miyazakh/unused_param 2022-04-13 09:02:26 -06:00
6cd87d56d4 Merge pull request #5042 from TakayukiMatsuo/certupdate 2022-04-13 09:00:10 -06:00
26b5d032b7 Merge pull request #5050 from SparkiDev/ecc_import_fail
ECC: fix import failure return
2022-04-13 08:02:27 -05:00
824b7a3f3f ECC: fix import failure return
Passing in x=0 and y=0 meant to return ECC_INF_E.
Passing in x=0, y=not 0 or x=not 0, y=0 now checks whether the point is
valid and forces a return of BAD_FUNC_ARG when IS_POINT_E is returned
from check.
2022-04-13 14:03:13 +10:00
c5056f408f fix unused parameter when using CRYPTO_CB_ONLY_RSA 2022-04-13 07:48:18 +09:00
55e13d40b3 SP Math
sp_read_radix_10: check _sp_add_d doesn't error due to overflow
_sp_add_d: Don't change value of used for result until it is known to be
valid.
2022-04-13 08:33:30 +10:00
6cc91c8f9b Wycheproof testing of Aarch64 ASM
Fix which bytes are incremented for AES-GCM - only 4 bytes are counter.
Fix Curve25519 to reduce to below modulus at end.
2022-04-12 11:45:14 +10:00
0ef7435580 Make changes to compatibility layer to support libspdm.
- Add support for ASN1_TIME_compare, DH_new_by_nid, OBJ_length, OBJ_get0_data,
and ChaCha20-Poly1305 and HKDF in the EVP layer.
- Map EC_POINT_get_affine_coordinates to
wolfSSL_EC_POINT_get_affine_coordinates_GFp and EC_POINT_set_affine_coordinates
to wolfSSL_EC_POINT_set_affine_coordinates_GFp.
- Add kdf.h compatibility header.
2022-04-11 15:07:27 -07:00
0717135e49 Add wolfSSL_EC_KEY_print_fp to compat layer. 2022-04-11 13:02:38 -07:00
830db63bcf Update certificate signature data for TSIP in response to /certs update 2022-04-12 02:55:58 +09:00
e87ded85b4 Merge pull request #5041 from embhorn/zd13969
Add ability to set ECC Sign userCTX using WOLFSSL_CTX
2022-04-11 09:38:52 -07:00
ab6dc8d669 Add ability to set ECC Sign userCTX using WOLFSSL_CTX 2022-04-11 08:41:27 -05:00
2995c96f11 Wycheproof fixes
Curve25519: reduce to less than mod at end of curve25519, optimize to
not use imulq when andq can be used instead.
x86_64 Karatsuba Mul: Don't put add carry into overflow and then
continue adding zero. Overflow is lost.
2022-04-11 15:09:40 +10:00
b6db087a62 ECC: make public APIS for add and double points
Use internal API internally.
2022-04-11 09:19:23 +10:00
0298a29a6f Merge pull request #5037 from JacobBarthelmeh/hsm
fix for function rename
2022-04-11 08:48:28 +10:00
cd1344bbed Merge pull request #5032 from kaleb-himes/ZD13946
Add logic equivalent to configure.ac in settings.h for poly1305
2022-04-08 15:13:16 -06:00
83ad0b7010 fix for function rename 2022-04-08 15:05:08 -06:00
79e2b2b4ce Merge pull request #5030 from LinuxJedi/add-iar-msp430
Add IAR MSP430 example
2022-04-08 13:15:42 -07:00
5d46d10933 Address peer feedback 2022-04-08 10:12:24 -06:00
c84c465fc6 Merge pull request #5035 from douzzer/20220408-fuzz-6262033210802176
oss-fuzz 6262033210802176
2022-04-08 08:34:16 -07:00
50bc20e340 Fix include.am for MSP430 2022-04-08 16:26:48 +01:00
6a21a90f41 Merge pull request #5034 from SparkiDev/sp_wycheproof_fixes
SP fixes from Whycheproof tests
2022-04-08 08:20:56 -07:00
997feecd6e Remove unused header from MSP430 example 2022-04-08 15:42:38 +01:00
676fe19e2f Fixes to the MSP430 example
* Fix include.am missing line
* Fix macros
* Add "static" keyword where needed
* Make compatible with MSP430 GCC
* Add MSP430 GCC Makefile
* Fix watchdog issue with GCC, also fixes IAR when large data model is
  used
* Fix comment style
* Fix typo in RNG (makes it ever so slightly more random)
* Add example output to README
2022-04-08 15:08:55 +01:00
1c570fae3b wolfcrypt/src/asn.c GetLength_ex(): test for overlong length spec before using length as shift operand. 2022-04-08 08:15:02 -05:00
ed7e1f9770 SP fixes from Whycheproof tests
EC point add is a double if affine ordinates are the same.
Fix AVX2 implementation of mod inv to do conversion from 26 bits in
32-bit registers to 64 bits in 64-bit registers. Also handle negative
value.
RSA OAEP: loop down to last byte. Must have a separator.
Div for x86_64: fix to have all 1s when high word equals divisor.
2022-04-08 15:01:06 +10:00
9859492222 Merge pull request #5029 from haydenroche5/asn1_time_diff_2038 2022-04-07 16:45:11 -06:00
5ea38b059e For improved compatibility populate the extension value for NID_subject_alt_name. 2022-04-07 11:10:03 -07:00
5231dc63fa Merge pull request #5031 from douzzer/20220407-clang-tidy
20220407 clang-tidy
2022-04-07 09:03:56 -07:00
c1421b1be8 Add logic equivalent to configure.ac in settings.h for poly1305 2022-04-07 09:00:26 -06:00
be742cabda Add missing include.am 2022-04-07 15:39:32 +01:00
288fdbcc3e fix readability-named-parameter. 2022-04-07 08:02:24 -05:00
28cefb0d1a fix clang-analyzer-core.NonNullParamChecker. 2022-04-07 08:01:00 -05:00
4efd06fdc1 fix readability-inconsistent-declaration-parameter-name. 2022-04-07 07:59:59 -05:00
0083afc279 fix whitespace. 2022-04-07 07:59:07 -05:00
2663f5abaf Add IAR MSP430 example
A basic MSP430 example for IAR IDE.
2022-04-07 11:07:27 +01:00
161d74879a Change time2epoch to TimeToUnixTime. 2022-04-06 21:38:24 -07:00
284ebacc57 Merge pull request #4916 from JacobBarthelmeh/hsm
Add SECO use and expand cryptodev
2022-04-07 10:21:32 +10:00
80766566fc Fixes for X509_add_ext and new test case. 2022-04-06 16:35:53 -07:00
87dc197284 Merge pull request #5028 from douzzer/20220406-cppcheck
fixes to mollify cppcheck (sizeofDivisionMemfunc, zerodivcond, shiftTooManyBits, signConversionCond)
2022-04-07 08:45:24 +10:00
e9aae8b571 use hash grow function with cmac 2022-04-06 15:08:19 -06:00
f6f6d91ae1 Merge pull request #5027 from LinuxJedi/fix-dox
Minor documentation cleanup
2022-04-06 14:01:08 -07:00
9b2d927de7 Merge pull request #5026 from danielinux/fix_unititialized_var
Fixed unused variable in asn.c
2022-04-06 13:03:47 -05:00
1b5af2fdd9 Merge pull request #5022 from SparkiDev/wycheproof_fixes
Wycheproof fixes/changes
2022-04-06 10:29:17 -07:00
49e72633b8 Merge pull request #5025 from SparkiDev/ssl_move_x509
ssl.c break out
2022-04-06 10:10:18 -07:00
2a0b726c15 add AES init functions to ECB test case 2022-04-06 09:42:38 -07:00
4e8c180290 fixes to mollify cppcheck (sizeofDivisionMemfunc, zerodivcond, shiftTooManyBits, signConversionCond). 2022-04-06 11:36:01 -05:00
5ea9d11295 Minor documentation cleanup
Fixes two things across all the Doxygen:

1. Remove WOLFSSL_API from each definition
2. Add missing parameter names from functions
2022-04-06 16:17:36 +01:00
91d883d99f macro guard on ECB test case and use realloc for hash 2022-04-06 07:04:17 -07:00
3d9a1647d4 Fixed unused variable in asn.c 2022-04-06 15:35:28 +02:00
25aa0af260 ssl.c break out
Move the X509 API out of ssl.c into x509.c
2022-04-06 17:25:26 +10:00
e9187f5f00 Wycheproof fixes/changes
Allow Chachac20-Poly1305 to take an empty msg.
Allow AES-SIV to have an empty nonce.
Don't allow the length to be malleable. Must use the smallest number of
bytes to represent value.
ECDSA and DSA signature values are positive.
Add Sha512-224 and Sha512-256 OIDs.
ASN template - ensure the ECDSA/DSA signature uses all data.
Curve25519/Curve448 - WOLFSSL_ECDHX_SHARED_NOT_ZERO means shared secret
can't be 0.
Curve25519/Curve448 - check public value is less than order.
ECC - x or y may be zero but not both.
Ed25519/Ed448 - check S is less than order.
Ed448 - ge_p3_dbl can be simplified for ASM.
Prime check (integer.c/tfm.c/sp_int.c): Don't allow negative values and
make sure random candidate doesn't have bits higher than those in a set
when bits not a multiple of 8.
RSA: support Sha512-224 and Sha512-256.
RSA: Fix check for invalid in decryption. Affects plaintexts 256 bytes
and longer.
RSA: Don't allow base be larger than modulus.
RSA: Check small ciphertext (1 or 0) on decrypt when not using OAEP.
RSA: WOLFSSL_RSA_DECRYPT_TO_0_LEN allows decrypted value to be 0.
SP math all: fix div to handle large a and d when checking size of
remainder.
SP math all: set sign of result in sp_mod_2d()
2022-04-06 15:35:01 +10:00
a338b4c933 refactor SHA grew function, revert benchmark devid, increase SHA_CTX size, add AES ECB cryptocb test 2022-04-05 14:45:18 -07:00
4f5aa81031 Merge pull request #5000 from ejohnstown/tls13-wctest
Add TLSv1.3 KDF to wolfCrypt Test
2022-04-05 10:45:35 -07:00
6a3f98627e Merge pull request #5013 from anhu/wc_CheckCertSigPubKey
Add new public API wc_CheckCertSigPubKey()
2022-04-05 09:48:08 -07:00
99fbd6f160 Merge pull request #4963 from SparkiDev/tls13_psk_multi_id
TLS 1.3 PSK: multiple ids for a cipher suite
2022-04-05 09:47:14 -07:00
e9a238ca86 Merge pull request #5021 from JacobBarthelmeh/certs
allow up to and including CTC_MAX_SKID_SIZE (32 byte hash)
2022-04-05 09:46:34 -07:00
97b85552e8 Merge pull request #5023 from douzzer/20220405-strict-aliasing
enforce strict aliasing rules
2022-04-05 09:46:12 -07:00
eefc0f2f57 Add TLSv1.3 KDF to wolfCrypt Test
Added a test for the TLSv1.3 KDF to the wolfcrypt test. It uses 6
different test cases from the CAVP tests. A set of 8 session keys are
generated using multiple exporters.
2022-04-05 08:56:15 -07:00
328de3ed63 remove -Wno-strict-aliasing from AX_HARDEN_CC_COMPILER_FLAGS and AX_HARDEN_CXX_COMPILER_FLAGS in m4/ax_harden_compiler_flags.m4, and fix strict aliasing infractions in api.c. 2022-04-05 08:10:16 -05:00
e3409a40a5 configure.ac: when $ENABLED_LINUXKM_DEFAULTS, set -DWOLFSSL_OLD_PRIME_CHECK only if $ENABLED_FIPS == no. 2022-04-05 08:10:03 -05:00
b2a2a8af4a fix whitespace. 2022-04-05 08:09:48 -05:00
df9335ee0a Merge pull request #4988 from tmael/sp_loop
Fixes for Diab C89 and armclang
2022-04-05 08:20:47 +10:00
8dd07bbb73 Merge pull request #5011 from dgarske/ecc_key_decode
Fix to check if `wc_EccPublicKeyToDer` has enough output buffer space
2022-04-05 08:03:03 +10:00
77485d987e Merge pull request #5010 from haydenroche5/asn1_time_diff_2038
Fix year 2038 problem in wolfSSL_ASN1_TIME_diff.
2022-04-05 07:58:36 +10:00
c3a9520eb5 Merge pull request #5016 from dgarske/async_fixes
Fixes for async in wolfCrypt test
2022-04-05 07:56:08 +10:00
fc6e10ff42 Another test fixup. 2022-04-04 17:42:25 -04:00
68ebb051e5 allow up to and including CTC_MAX_SKID_SIZE (32 byte hash) 2022-04-04 15:19:17 -06:00
f39bd5e02b Merge pull request #5014 from dgarske/kcapi_ecc_import 2022-04-04 14:08:29 -07:00
829a8a4039 Merge pull request #5009 from embhorn/zd13980
Fix build errors for NO_WOLFSSL_SERVER and NO_WOLFSSL_CLIENT
2022-04-04 12:43:49 -07:00
6513e2ce8f Merge pull request #5019 from douzzer/20220404-linux5v18-etc
20220404 linux5v18 etc
2022-04-04 11:08:18 -07:00
bb4698a9e8 Merge pull request #5020 from douzzer/20220402-fips-linuxkm-pie-only-on-linuxkm
--enable-fips=v5 --disable-linuxkm-pie
2022-04-04 11:08:06 -07:00
9c1e2a83d1 Fix year 2038 problem in wolfSSL_ASN1_TIME_diff.
Prior to this commit, this function used XMKTIME (mktime) to convert the
passed in WOLFSSL_ASN1_TIMEs to Unix timestamps. On platforms where time_t is
32 bits long, times after the year 2038 can't be represented with this type. To
fix this, we need to not use XMKTIME. With this commit, the static function
time2epoch is added to ssl.c, which uses the date time information to compute
seconds since the Unix epoch without the use of mktime. It returns the seconds
as a long long. This is sufficient to make the function work for years > 2038 on
the platform of the user who discovered this problem in the first place (Yocto
Linux on ARMv7).
2022-04-04 11:01:21 -07:00
400c7238ef Test fixup. 2022-04-04 13:43:06 -04:00
ae9926cc42 Missing flag in unit test. 2022-04-04 12:39:10 -04:00
9b5ad6f218 Merge pull request #4968 from miyazakh/cryptonly
add WOLF_CRYPTO_CB_ONLY_RSA and WOLF_CRYPTO_CB_ONLY_ECC
2022-04-04 08:31:41 -07:00
757c93c6d5 Merge pull request #4945 from kaleb-himes/ZD13795
Fix for ZD13795 and also remove all-caps parameter
2022-04-04 08:25:10 -07:00
04385f8557 configure.ac: fips 140-3: don't insist on linuxkm-pie unless configuring an actual linuxkm build. 2022-04-04 10:14:22 -05:00
0d6c283f7a fixes for -Werror=declaration-after-statement in debug builds. 2022-04-04 09:29:26 -05:00
492704992a wolfssl/wolfcrypt/settings.h: #ifdef WOLFSSL_LINUXKM, make sure config.h is included only once, before masking out inapplicable autodetected features. 2022-04-04 09:28:06 -05:00
0fba16a394 Merge pull request #4998 from haydenroche5/get_conv_form
Add wolfSSL_EC_KEY_get_conv_form to compatibility layer.
2022-04-04 08:47:14 +10:00
880afe0d89 Add wolfSSL_EC_KEY_get_conv_form to compatibility layer. 2022-04-02 13:57:33 -07:00
54aa211fee Merge pull request #5015 from douzzer/20220401-Wvla-Wdeclaration-after-statement
fix codebase for -Wvla -Wdeclaration-after-statement
2022-04-01 18:48:00 -07:00
8e4abb0011 addressed code review comment 2022-04-02 09:18:28 +09:00
c522baa75e Unit tests. 2022-04-01 18:34:21 -04:00
ae3996fd0e fix codebase for -Wvla -Wdeclaration-after-statement; fix some whitespace. 2022-04-01 14:44:10 -05:00
211007fb44 WOLFSSL_ASN_API ---> WOLFSSL_API 2022-04-01 15:24:40 -04:00
bd0e222fec Merge pull request #5012 from julek-wolfssl/evp-enc-dec-block
Implement `EVP_EncodeBlock` and `EVP_DecodeBlock`
2022-04-01 12:24:23 -07:00
6ec0c22a28 Fixes for async in wolfCrypt test. 2022-04-01 12:04:31 -07:00
ded168f238 Add check for buffer space in wc_EccPublicKeyToDer. Refactor SetEccPublicKey to put public key directly into output buffer and eliminate small stack. Fixes ZD 13904. 2022-04-01 11:46:27 -07:00
9c572efa40 Disable the public key check in import private key for KCAPI. Fix type warning in KCAPI AES. 2022-04-01 11:27:17 -07:00
e1965094ad Add check for ULONG_MAX in SP math to detect if pre-processor correctly handles 64-bit types. 2022-04-01 09:24:46 -07:00
edea6428d9 Add new public API wc_CheckCertSigPubKey() 2022-04-01 11:40:25 -04:00
ef16ce806c Fix build errors for NO_WOLFSSL_SERVER and NO_WOLFSSL_CLIENT 2022-04-01 08:04:41 -05:00
6dffa8a13d Implement EVP_EncodeBlock and EVP_DecodeBlock 2022-04-01 13:29:40 +02:00
4db45cea4e Fixes to build with diab and armclang 2022-03-31 20:48:28 -07:00
99af84f1e2 Whitespace cleanups. 2022-04-01 09:36:53 +09:00
d3a379adac add WOLF_CRYPTO_CB_ONLY_RSA and WOLF_CRYPTO_CB_ONLY_ECC 2022-04-01 09:36:52 +09:00
b45cd921b6 Merge pull request #5005 from dgarske/renesas_spell 2022-03-31 17:44:04 -06:00
7b21cd8cf0 Merge pull request #5001 from dgarske/kcapi_ecc
KCAPI ECC/AES optimizations to further reduce page memory use
2022-04-01 08:36:23 +10:00
79444fdb56 Merge pull request #4997 from dgarske/qat_eckg
Support for Intel QuickAssist ECC KeyGen acceleration
2022-04-01 08:32:21 +10:00
1add8703e2 Merge pull request #4996 from haydenroche5/bn_rand
Improve wolfSSL_BN_rand.
2022-04-01 08:12:22 +10:00
5a8fc919ef Merge pull request #5006 from dgarske/mcapi_test 2022-03-31 18:06:13 -04:00
33d2f2687f Merge pull request #5007 from douzzer/20220331-ignore-readability-avoid-const-params-in-decls
20220331-ignore-readability-avoid-const-params-in-decls
2022-03-31 15:05:22 -07:00
01f9f7df5f Merge pull request #5002 from JacobBarthelmeh/Compatibility-Layer
sanity check before copy with new memory bio
2022-03-31 15:08:26 -05:00
0f0fdea7ff Merge pull request #5004 from julek-wolfssl/apache-enable-etm
Allow encrypt then mac with apache
2022-03-31 12:08:50 -07:00
773170464e undo changes to header files (see b7cecbacb) made to mollify clang-tidy's overly pedantic readability-avoid-const-params-in-decls -- keep declarations and definitions fully aligned, to mollify broken compilers. 2022-03-31 14:02:08 -05:00
acb04bec0c Fix mcapi_test.c to include the settings.h before crypto.h. 2022-03-31 10:54:53 -07:00
61f6b5e29c Peer review feedback. 2022-03-31 10:04:23 -07:00
064888bb2a Add KCAPI ECC support for using a private key id. 2022-03-31 09:05:03 -07:00
f8007b2d8f Further KCAPI AES/ECC memory optimizations. Adds KCAPI_USE_XMALLOC option for AES and ECC to reduce page memory use in certain KCAPI cases that allow it. 2022-03-31 08:58:22 -07:00
1993851274 Renesas spelling, code formatting and whitespace fixes. 2022-03-31 08:02:00 -07:00
90fe2ab894 Merge pull request #4999 from embhorn/zd13969
Add wolfSSL_CTX_SetCertCbCtx to set user context for CB
2022-03-31 07:43:47 -07:00
4b5649edc9 Allow encrypt then mac with apache 2022-03-31 15:55:57 +02:00
3f03f4e40a Handle case where bits is 0 properly. 2022-03-30 16:56:53 -07:00
1de5165dcc KCAPI ECC optimization to further reduce page memory use. 2022-03-30 15:01:01 -07:00
8136c55a39 sanity check before copy with new memory bio 2022-03-30 14:02:03 -07:00
a914d782c0 Merge pull request #4810 from anhu/engine_fla 2022-03-30 13:43:09 -07:00
c905c613e9 Support for Intel QuickAssist ECC KeyGen acceleration. 2022-03-30 13:07:47 -07:00
ea38e1aab5 Add wolfSSL_CTX_SetCertCbCtx to set user context for CB 2022-03-30 12:27:11 -05:00
366f159fbb Merge pull request #4991 from gojimmypi/patch-2
Overhaul Espressif ESP-IDF wolfSSL setup_win.bat
2022-03-30 06:56:49 -07:00
2029bf0a0b Merge pull request #4992 from JacobBarthelmeh/Compatibility-Layer
support creating new mem bio of length 0
2022-03-30 06:55:53 -07:00
d9df00cdfb Merge pull request #4994 from dgarske/kcapi
KCAPI ECC memory optimizations and KCAPI AES build fix
2022-03-30 11:50:39 +10:00
2077690bf0 Improve wolfSSL_BN_rand.
- Previously, this function would round up the requested bits to the next
multiple of 8. With this commit, the function returns a number of exactly the
number of bits requested, which is the same behavior as OpenSSL. This problem
was discovered by a user using the compatibility layer with OpenSSH's ssh-keygen
utility.
- This function now respects the top and bottom parameters.
- Improved unit testing.
2022-03-29 18:08:21 -07:00
409a0acb88 fine tuning on wolfcrypt\test\test_paths.h 2022-03-29 16:07:10 -07:00
d72d28ac60 copy errors are now only warnings 2022-03-29 15:39:09 -07:00
1dc3808aae Merge pull request #4986 from cconlon/sslFipsReady
Fix FIPS defines in wolfSSL_RSA_sign_generic_padding() / RSA_verify_ex()
2022-03-29 16:02:17 -05:00
d287863a35 Update setup_win.bat
more copy error checking. remove trailing whitespace.
2022-03-29 12:52:50 -07:00
d10e72bc98 Fix for KCAPI AES with WOLFSSL_NO_KCAPI_AES_CBC. 2022-03-29 12:50:28 -07:00
4ad2f68071 fix defines for FIPS around RSA-PSS in wolfSSL_RSA_sign_generic_padding() and wolfSSL_RSA_verify_ex() 2022-03-29 10:03:16 -06:00
0989a14395 Merge pull request #4995 from douzzer/20220328-multi-test-fixes
fix reproducible-build for libtool 2.4.7
2022-03-29 08:00:45 -07:00
e9b941e16e configure.ac: fix --enable-reproducible-build to cope with update from libtool-2.4.6 to -2.4.7. 2022-03-29 07:53:43 -05:00
8edf237f75 Merge pull request #4993 from SparkiDev/sakke_gen_table_tmp_size_fix
SP: fix number of temps alloced in sp_ecc_gen_table
2022-03-28 21:32:35 -05:00
194138f0b8 Merge pull request #4990 from dgarske/async_fix
Fixes for async ECC
2022-03-29 10:30:38 +10:00
9a8be82653 Merge pull request #4987 from julek-wolfssl/ffmpeg
Add support for `--enable-ffmpeg`
2022-03-28 16:33:20 -07:00
f50514b228 SP: fix number of temps alloced in sp_ecc_gen_table
Ony affects SAKKE and as a result of point add changes.
2022-03-29 09:11:45 +10:00
1abcd4b035 Reduce KCAPI ECC page memory allocation sizes. 2022-03-28 15:40:07 -07:00
05f377011b Fix for building with KCAPI AES enabled. 2022-03-28 15:05:58 -07:00
f7f94cede0 support creating new mem bio of length 0 2022-03-28 15:52:42 -06:00
0627437048 Suggestions from haydenroche5 2022-03-28 17:44:00 -04:00
12349f39e6 Merge pull request #4974 from kareem-wolfssl/iotsafe
IOTSafe workarounds
2022-03-28 13:49:44 -07:00
b203726623 Overhaul Espressif ESP-IDF wolfSSL setup_win.bat
# Description

This is a replacement to https://github.com/wolfSSL/wolfssl/pull/4989, per the [comment](https://github.com/wolfSSL/wolfssl/pull/4989#issuecomment-1080998040)

Overhauled `win_setup.bat` for more robust and flexible install of wolfSSL to ESP-IDF `component` directory. 

Functionally, there are no significant changes.  However this version:

- more verbose output 
- show directories used
- more error checking
- check for existing wolfSSL component; prompt to purge or update
- save and optionally re-use `config.h` and `user_settings.h`
- optionally target an alternate ESP-IDF path (useful for VisualGDB)
- offer tips and reminders upon completion

# Testing

Tested on Windows 10 with both ESP-IDF command prompt and stand-alone DOS prompt (e.g. for VisualGDB)

# Checklist

 - [ ] added tests
 - [ ] updated/added doxygen
 - [ ] updated appropriate READMEs
 - [ ] Updated manual and documentation

cc: @dgarske
2022-03-28 11:54:50 -07:00
5b0735cdb4 Fixes for async ECC broke in PR #4982. 2022-03-28 11:29:33 -07:00
52902f1d37 IoTSafe: Add SP_RSA to user_settings.h template. 2022-03-28 10:25:05 -07:00
6dc86e7df1 Add support for --enable-ffmpeg 2022-03-28 12:47:19 +02:00
be938ed197 IoTSafe Workarounds: Address code review feedback. 2022-03-25 16:17:53 -07:00
25d5a624d2 Merge pull request #4975 from cconlon/smallStack
smallstack cleanup for OpenSSL Compatibility Functions
2022-03-25 17:06:59 -06:00
0ee01f08bc Merge pull request #4984 from douzzer/20220325-multi-test-cleanup
20220325 multi-test fixes
2022-03-25 15:06:34 -07:00
3af3274dcd Merge pull request #4982 from SparkiDev/sp_x64_improvements
SP ASM improvements
2022-03-25 13:04:01 -07:00
07f9ca60ac Fix for async without threading. ./configure --enable-asynccrypt --enable-all CFLAGS="-DWC_NO_ASYNC_THREADING". 2022-03-25 12:43:04 -07:00
0930086fa1 Fix for increased mcapi (used by Microchip) ctx sizes if PK callbacks is enabled due to key id/label. 2022-03-25 12:36:07 -07:00
008c8509c6 multi-test fixes: whitespace in wolfcrypt/src/random.c and wolfcrypt/test/test.c, bugprone-macro-parentheses and -Wenum-compare in WS_RETURN_CODE() (wolfssl/ssl.h), and clang-analyzer-deadcode.DeadStores in api.c. 2022-03-25 13:26:41 -05:00
04e2b6c62a Merge pull request #4983 from douzzer/20220324-gcc-12-fixes
fixups for warnings from gcc-12
2022-03-24 19:16:27 -07:00
7eb95674ee Merge pull request #4966 from dgarske/kcapi
Fixes for KCAPI AES GCM and ECC
2022-03-25 10:18:16 +10:00
fd66f6bcec SP ASM improvements
Change Karatsuba implementations for x86_64.
Fix ECC code to better handle corner cases.
Add 'lower' versions of functions wehn an input is known to be less than m.
Add mont_add/dbl/tpl/sub for P384.
Change ECC point add to be cache-attack resistant.
Change mod_exp to be cache-attack resistant.
2022-03-25 10:04:25 +10:00
14522f25ff Merge pull request #4904 from kaleb-himes/OE22_NS9210_FIX
Fix up random.h conflicts with cert 3389 releases and some NETOS issues
2022-03-24 16:07:23 -07:00
feb58a8455 Merge pull request #4956 from julek-wolfssl/bind-9.18.0
bind 9.18.0 fixes
2022-03-25 08:27:34 +10:00
12776b3772 fixups for warnings from gcc-12:
src/internal.c: use XMEMCMP(), not ==, to compare array elements (fixes conflict of 74408e3ee3 vs 617eda9d44);

fix spelling of NAMEDGROUP_LEN (was NAMEDGREOUP_LEN);

src/ssl.c: in CheckcipherList() and wolfSSL_parse_cipher_list(), use XMEMCPY(), not XSTRNCPY(), to avoid (benign) -Wstringop-truncation;

scripts/sniffer-tls13-gen.sh: fix for shellcheck SC2242 (exit 1, not -1).
2022-03-24 16:33:36 -05:00
b509e174bb Whitespace fix. 2022-03-24 10:19:28 -07:00
ceae169a34 Merge pull request #4969 from dgarske/pk_pubkey 2022-03-24 12:40:03 -04:00
624f1499f0 Merge pull request #4978 from julek-wolfssl/issue/4970
Prefer status_request_v2 over status_request when both are present
2022-03-24 08:30:12 -07:00
5a0d794e88 Merge pull request #4980 from anhu/iv_docs
Correction about AES using IV in docs
2022-03-24 08:29:55 -07:00
29c0c9bf48 Rebase fixes 2022-03-24 13:41:50 +01:00
850b8c5c3b OpenSSL compatible API
`WOLFSSL_ERROR_CODE_OPENSSL` breaks ABI compatiblity due to changing the expected return code. Let's only do this when building with the full compatibility layer.
2022-03-24 12:16:59 +01:00
88d5059c36 Jenkins fixes
`WS_RETURN_CODE` was not functioning properly in master
2022-03-24 12:16:59 +01:00
98bc8402db Refactor memory BIO
- use the `WOLFSSL_BUF_MEM` struct to resize the internal memory buffer
- add a `WOLFSSL_BIO_RESIZE_THRESHOLD` define that will be used to determine how often to shrink the internal buffer. This should cut down on the number of free/malloc calls made significantly. This should help with our inefficient 1 byte reads in `loadX509orX509REQFromPemBio`.
- implement `wolfSSL_BUF_MEM_resize` which allows bi-directional buffer size manipulation
2022-03-24 12:16:59 +01:00
ae9b01c5b8 bind 9.18.0 fixes
- return `1` from `wolfSSL_BIO_set_mem_eof_return` instead of `0` for success
- bind requires ALPN
- `OPENSSL_COMPATIBLE_DEFAULT` defined for bind
- `WOLFSSL_ERROR_CODE_OPENSSL` defined when using compatibility layer
- return `bio->eof` on no pending data to read in memory BIO (defaults to `WOLFSSL_BIO_ERROR`)
- `flags` is no longer an input parameter in `wolfSSL_ERR_get_error_line_data`
- allow lazy parameter loading in `wolfSSL_DH_set0_key`
- implement reference counter in `WOLFSSL_EC_KEY`
- load serial number from `x509->serialNumber` if `x509->serial` is empty
2022-03-24 12:16:59 +01:00
f71a85d5f9 Merge pull request #4979 from dgarske/sniffer_tidy 2022-03-23 15:13:20 -04:00
1bc71da1df Correction about AES using IV in docs 2022-03-23 13:35:13 -04:00
6e550c8d75 Fix for KCAPI ECC KeyGen. Disable ECC consistency checks with KCAPI. Allow public AddSignature (used to be public). Fix KCAPI ECC SharedSecret output size. 2022-03-23 09:37:50 -07:00
8bafa7f601 Fix for KCAPI ECC sign (was not returning the signature, since ret always 0). 2022-03-23 09:37:50 -07:00
c9e3094cb0 Fixes for KCAPI ECC verify. Cleanup of the pubkey_raw. Fix KCAPI AES possible used uninitialized. 2022-03-23 09:37:50 -07:00
8d695f97c9 Fix for KCAPI KcapiEcc_LoadKey parameter to kcapi_kpp_keygen. Added option to release handle on load. Fixes for KCAPI sign output length. Added additional argument checking. 2022-03-23 09:37:50 -07:00
318350f63b Fix for ecc_check_privkey_gen with KCAPI. Fix KCAPI ECDSA to ensure we don't leak handle for multiple sign/verify calls. 2022-03-23 09:37:50 -07:00
9f2dc408a0 Fixes for KCAPI AES GCM. Add guards for algorithm macros on KCAPI. 2022-03-23 09:37:50 -07:00
1b0e5f4806 Allow disabling DRBG with KCAPI. Add KCAPI /dev/hwrng support. 2022-03-23 09:37:50 -07:00
5fe6f1c875 For KCAPI do not force enable ECC curves, set K or seed callback, disable AES GCM tests with non standard IV. 2022-03-23 09:37:50 -07:00
b04954dc98 Merge pull request #4977 from SparkiDev/ssl_move_x509_store
ssl.c: move out X509 store APIs to new file
2022-03-23 09:36:33 -07:00
f129c32273 Fixes for whitespace, script bug and bit-field type. 2022-03-23 09:31:04 -07:00
b6e590836d initialize ENABLE_FIPS 2022-03-23 10:29:59 -04:00
4412496adb Prefer status_request_v2 over status_request when both are present
Reported in https://github.com/wolfSSL/wolfssl/issues/4970
2022-03-23 11:20:22 +01:00
90f53aed34 ssl.c: move out X509 store APIs to new file 2022-03-23 13:59:54 +10:00
3dd2219548 Don't over-write ENABLED_FIPS with no if user didn't specify anything. 2022-03-22 20:33:27 -04:00
d864fc9a3f Merge pull request #4972 from julek-wolfssl/asn-time-tz-diff
`mktime` may return a negative due to timezones around the unix epoch
2022-03-22 14:03:59 -05:00
cf0e4a0e3d Merge pull request #4976 from anhu/kill_tabs
Get rid of tabs I added previously.
2022-03-22 11:35:00 -07:00
906ea4ad03 smallstack reduction for wolfSSL_EC_POINT_invert 2022-03-22 10:00:17 -06:00
64a309e245 smallstack reduction for wolfSSL_ASN1_INTEGER_to_BN 2022-03-22 10:00:17 -06:00
ddc1899d48 smallstack reduction for wolfSSL_EC_POINT_get_affine_coordinates_GFp 2022-03-22 10:00:17 -06:00
94e1b87ae0 smallstack reduction for wolfSSL_X509_set_ext, wolfSSL_EC_POINT_mul, wolfSSL_ECDSA_do_sign, wolfSSL_i2d_X509_NAME, wolfSSL_X509_REQ_sign 2022-03-22 10:00:13 -06:00
c41bef6486 Get rid of tabs I added previously. 2022-03-22 11:56:15 -04:00
aa38d99538 Fix for TLS PK callback issue with Ed25519/Ed448 and public key not being set. 2022-03-22 08:33:54 -07:00
c377a709e1 Merge pull request #4953 from cconlon/apiVersionDiff
More checks on OPENSSL_VERSION_NUMBER for API prototype differences
2022-03-21 16:59:06 -06:00
2babac6cb5 Merge pull request #4875 from dgarske/sniffer_async 2022-03-21 16:47:23 -04:00
210eb6283c smallstack reduction for wc_ecc_import_x963_ex, mp_jacobi 2022-03-21 14:43:43 -06:00
851ff9e661 smallstack reduction for PrintPubKeyRSA, PrintPubKeyDSA, PrintPubKeyDH 2022-03-21 14:43:43 -06:00
339e44bd87 smallstack reduction for wc_ecc_import_point_der_ex() 2022-03-21 14:43:43 -06:00
59665a44b5 Fixes for allowing server to have a public key set when using external key with PK callbacks. 2022-03-21 13:14:24 -07:00
29c120356e Sniffer asynchronous support.
* Adds stateful handling of DH shared secret computation in `SetupKeys`.
* Improved the decrypt handling to use internal functions and avoid generating alerts on failures.
* Fix for sniffer resume due to missing `sessionIDSz` broken in #4807.
* Fix sniffer test cases to split resume (session_ticket) tests.
* Add `snifftest` list of build features so test script can gate running resume test.
2022-03-21 12:05:08 -07:00
af70edb99d Strip trailing zeroes from cert buffer when using IOTSAFE_NO_GETDATA. 2022-03-21 10:53:36 -07:00
4951646c91 touch up class name and function comments 2022-03-21 10:56:09 -06:00
fb3d38c3e8 add example C# PSK client 2022-03-21 10:19:45 -06:00
c213c725d7 Merge pull request #4971 from SparkiDev/fp_div2_mod_ct_oob
TFM fp_div_2_ct: rework to avoid overflow
2022-03-21 09:11:41 -07:00
8bf14ba1d3 Merge pull request #4957 from JacobBarthelmeh/Compatibility-Layer
alter return value and add error string
2022-03-21 09:10:04 -07:00
08d6474878 Merge pull request #4954 from SparkiDev/rsa_fermat
RSA: check for small difference between p and q
2022-03-21 09:09:38 -07:00
b90df0a6aa Merge pull request #4951 from ejohnstown/wolfrand
wolfRand for AMD
2022-03-21 09:09:19 -07:00
d7037da0b5 mktime may return a negative due to timezones around the unix epoch 2022-03-21 17:07:13 +01:00
9763030675 Merge pull request #4845 from cconlon/pkcs7compat 2022-03-21 15:26:37 +01:00
8dbd8b0ad6 RSA: check for small difference between p and q 2022-03-21 10:58:14 +10:00
aa14607a6f TFM fp_div_2_ct: rework to avoid overflow
Don't set the overflow word. Instead integrate the div by 2 into the
function so that the overflow word doesn't need to be stored.
2022-03-21 10:43:06 +10:00
2f52d3cd20 Merge pull request #4965 from dgarske/aes_win_clang
Fixes for Windows AESNI with clang
2022-03-21 08:24:21 +10:00
dcaa218ed8 Merge pull request #4927 from cconlon/upRef 2022-03-18 18:10:36 -07:00
7ea6b73c7b Merge pull request #4928 from cconlon/compatCleanups 2022-03-18 16:23:56 -07:00
2637e5e361 Merge pull request #4926 from cconlon/namePrintRFC5523 2022-03-18 15:53:07 -07:00
c491a6c829 EVP_PKEY_copy_parameters: correctly mark inner struct owned 2022-03-18 16:37:45 -06:00
a79daa5ea8 Merge pull request #4959 from haydenroche5/asn1_time_diff_bug
Fix bug in wolfSSL_ASN1_TIME_diff.
2022-03-18 14:28:23 -07:00
582f0d82e4 address review feedback for PKCS7 compat additions 2022-03-18 12:07:44 -06:00
bfee3dffc6 Merge pull request #4967 from dgarske/pubkey_size
Fix for `wc_EccPublicKeyToDer` incorrectly requiring too much buffer
2022-03-18 09:22:52 -06:00
bcce015496 Merge pull request #4964 from julek-wolfssl/wolfSSL_get_session-docs
Update `wolfSSL_get_session` docs
2022-03-18 06:51:27 -07:00
bb27fa4555 Fix for wc_EccPublicKeyToDer incorrectly requiring too much buffer. Merge error included old ASN code and incorrectly excluded ASN template. ZD13904. 2022-03-17 18:51:37 -07:00
ef66a12a24 Merge pull request #4961 from dgarske/cust_fixups
Various portability improvements (Time, DTLS epoch size, IV alloc)
2022-03-18 11:38:57 +10:00
f117308135 Merge pull request #4921 from dgarske/private_keyid
Added private key id/label support - improve PK callback public key use
2022-03-18 11:36:28 +10:00
b546b2a5ec Improve logic around private key id/label. Adds WOLF_PRIVATE_KEY_ID. 2022-03-17 14:48:30 -07:00
f954aef973 Fixes for Windows AESNI with clang. Improve 32-bit support. 2022-03-17 14:05:24 -07:00
ae25a48509 Improve the build message to not always allocate the IV (16 byte) (use fixed buffer if <= 16 bytes). 2022-03-17 14:01:57 -07:00
3fba5d17c3 Various portability improvements:
* Change DTLS epoch size word16.
* Allow override of the `RECORD_SIZE` and `STATIC_BUFFER_LEN`.
* Remove endianness force from game build.
* Add `gmtime_s` option.
* Fix for macro conflict with `MAX_KEY_SIZE`.
* Expose functions `wolfSSL_X509_notBefore`, `wolfSSL_X509_notAfter`, `wolfSSL_X509_version` without `OPENSSL_EXTRA`.
2022-03-17 14:00:55 -07:00
54477d1bea improvements around keystore key update 2022-03-17 12:04:52 -06:00
40c79b1134 add macro guards to handle build with QNX CAAM 2022-03-17 12:04:52 -06:00
9bf2962852 default to strict NVM operations with key generation 2022-03-17 12:04:52 -06:00
090932b65c FIPS benchmark of cmac and ecb 2022-03-17 12:04:52 -06:00
55b42dd85a Add SECO use and expand cryptodev 2022-03-17 12:04:52 -06:00
1fd090d094 Update wolfSSL_get_session docs
Recommend using `wolfSSL_get1_session` and `NO_SESSION_CACHE_REF` for session resumption purposes. `wolfSSL_get_session` should not be used unless to inspect the current session object.
2022-03-17 12:56:28 +01:00
f76105a93b TLS 1.3 PSK: multiple ids for a cipher suite
When WOLFSSL_PSK_MULTI_ID_PER_CS is defined, multiple identities can be
returned for a cipher suite.
The first byte of the identity is the count of identites that have been
seen so far for the cipher suite.
2022-03-17 09:31:25 +10:00
aa8e5a29d4 Merge pull request #4947 from cconlon/compatSmallStack
Stack/smallstack cleanup for OpenSSL compatibility functions
2022-03-15 16:47:23 -07:00
a52539c489 Merge pull request #4958 from TakayukiMatsuo/example 2022-03-15 17:39:07 -06:00
5b268c0852 Merge pull request #4960 from anhu/stm32_pq_bench
Add Post-quantum KEM benchmark for STM32
2022-03-15 16:36:08 -07:00
f80faebfe5 wolfRand for AMD
1. Add configure option to enable AMD's RDSEED.
2. Add seed parameters when building specifically for AMD using RDSEED.
3. Update the wolfCrypt test to play nice with the larger seed size.
2022-03-15 15:20:08 -07:00
fbfb1fee91 Add Post-quantum KEM benchmark for STM32 2022-03-15 14:49:40 -04:00
6e6aa5b0c1 Fix bug in wolfSSL_ASN1_TIME_diff.
This function should not error out if one of the passed in times is the Unix
epoch. This amounts to erroring out when the XMKTIME returns < 0, rather than
<= 0.
2022-03-15 10:52:05 -07:00
d0e83be596 alter return value and add error string 2022-03-15 10:26:59 -07:00
365a4de154 Fix settings and removed warnings 2022-03-16 02:12:45 +09:00
d531e21f34 Merge pull request #4946 from dgarske/async_earlydata
Fixes for TLS v1.3 early data with async
2022-03-15 12:12:09 -05:00
9c29102c43 Merge pull request #4948 from SparkiDev/tls12_pa_failsafe
TLS: add peer authentication failsafe for TLS 1.2 and below
2022-03-15 09:42:56 -07:00
6762cd90da add tests for PKCS7_sign(), PKCS7_final(), SMIME_write_PKCS7() 2022-03-15 10:21:22 -06:00
ce514e6fc5 add PKCS7_sign, PKCS7_final, SMIME_write_PKCS7. add signer cert verify support to PKCS7_verify, support for PKCS7_TEXT, PKCS7_DETACHED, PKCS7_STREAM 2022-03-15 10:21:22 -06:00
ba4f3379ba remove unimplemented wc_MIME_* prototypes in asn.h 2022-03-15 10:21:22 -06:00
a7d5e6400d add support for PKCS7_TEXT flag to PKCS7_verify() 2022-03-15 10:21:22 -06:00
2febed01a5 Merge pull request #4949 from SparkiDev/ssl_move_conf
ssl.c: move TXT and CONF APIs out into conf.c
2022-03-15 09:02:42 -07:00
f7c5c9f713 extra checks for OPENSSL_VERSION_NUMBER for API prototype differences 2022-03-15 09:41:51 -06:00
7c63dd6245 smallstack reduction for wolfSSL_set_accept_state() 2022-03-15 09:40:51 -06:00
062003916c stack/smallstack reduction for wolfssl_x509_make_der(), d2iGenericKey(), PrintPubKeyEC(), wolfSSL_EC_POINT_add() 2022-03-15 09:40:48 -06:00
343e8bccdd ssl.c: move TXT and CONF APIs out into conf.c 2022-03-15 12:09:24 +10:00
4ec49d2189 Merge pull request #4943 from SparkiDev/sp_arm64_perf_1
SP ASM performance improvements
2022-03-14 18:40:51 -07:00
e3276ca683 Merge pull request #4939 from SparkiDev/aes_gcm_align
AES-GCM: stack alignment issues
2022-03-14 18:37:11 -07:00
9ed061cc96 TLS: add peer authentication failsafe for TLS 1.2 and below
Tightened the TLS 1.3 failsafe checks too.
2022-03-15 08:51:44 +10:00
eeb7f72a07 AES-GCM: stack alignment issues
Don't expect stack to be aligned.
vmovdqu is no longer slower than vmovdqa.
2022-03-15 08:49:43 +10:00
b3319bd952 Undo the logic around enable sha as its enabled by default already. 2022-03-14 16:29:13 -04:00
34e491f39f Merge pull request #4950 from SparkiDev/regression_fixes_3
TLS 1.3 script test: wait for server to write file
2022-03-14 13:24:06 -07:00
821e293ed4 Fix to add test where needed. 2022-03-14 15:54:39 -04:00
b3e28fab67 Make the code simpler. 2022-03-14 13:51:05 -04:00
ea500bd1c8 --enable-engine=fips-v2,fips-readyetc., etc. 2022-03-14 13:51:05 -04:00
07ee2bcecf Created new --enable-engine and --enable-engine-witout-fips flags 2022-03-14 13:51:05 -04:00
2c1ecacbfc TLS 1.3 script test: wait for server to write file
Also fixes for:
./configure --enable-psk --disable-rsa --disable-ecc --disable-dh
C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK
./configure --disable-shared --enable-curve448 --enable-ed448
--disable-rsa --disable-dh --enable-tls13 --disable-ecc --enable-certgen
--enable-keygen
2022-03-14 14:42:47 +10:00
4966eb7897 Merge pull request #4944 from douzzer/20220310-asn-template-EncodeExtensions-overrun
wolfcrypt/src/asn.c: fix buffer underrun in EncodeExtensions() and leak in ParseCRL_Extensions()
2022-03-13 21:21:07 -05:00
cdb45b12c5 Merge pull request #4884 from haydenroche5/i2d_x509_name_fix
Improve wolfSSL_i2d_X509_name.
2022-03-14 11:57:07 +10:00
20562b3f78 DecodeNameConstraints (ASN Template): free ASNGetData 2022-03-14 09:14:19 +10:00
a816f329cc Merge pull request #4856 from anhu/stm32u5
Enable support for STM32U585 and PQC for STM32
2022-03-11 14:49:46 -08:00
fb0c9b2a66 ssl.c: use InitHandshakeHashes(), not FreeHandshakeHashes(), to reset ssl->hsHashes. 2022-03-11 16:26:24 -06:00
dd8fb41f66 Fixes for TLS v1.3 early data with async. 2022-03-11 14:03:46 -08:00
830431ccdf scripts/tls13.test: fix whitespace. 2022-03-11 13:54:50 -06:00
82ab7bf32c ssl.c: fix hash state memory leaks in wolfSSL_clear() and wolfSSL_TicketKeyCb(). 2022-03-11 13:40:01 -06:00
8cba961bac Comment fixups, bad braces, and stray &. 2022-03-11 12:14:02 -05:00
9fff321e3e address PR review feedback on EVP_PKEY changes 2022-03-11 10:11:02 -07:00
82c6f58eb0 define BIO_CTRL_SET, BIO_CTRL_GET 2022-03-11 09:53:56 -07:00
6e6108bb98 remove duplicate BIO_CLOSE/BIO_NOCLOSE definition, already in openssl/bio.h 2022-03-11 09:53:56 -07:00
238072c84d map BIO_s_accept to BIO_s_socket for basic use 2022-03-11 09:53:56 -07:00
2639c5e268 X509V3_set_ctx arg check fix, debug log cleanup 2022-03-11 09:53:51 -07:00
385ece92d8 ECCSI and SAKKE: fix smallstackcache memory leaks in library, and blue-moon undefined behavior bugs in test.c eccsi_test(() and sakke_test(). 2022-03-11 10:06:18 -06:00
fc92584bd2 Address the one that was missed 2022-03-11 08:36:36 -07:00
64953299cf scripts/tls13.test: retries (up to 10) for early data scenarios, to mitigate race noted in #4918 . 2022-03-11 08:18:14 -06:00
7602eef98f src/ssl.c: use strlcpy(), not strncpy(), to make string_fortified happy (else "error: ‘__builtin_strncpy’ specified bound 46 equals destination size"). 2022-03-11 08:15:44 -06:00
b2ae7f4230 wolfssl/openssl/asn1.h: in ASN1_SIMPLE(), use OFFSETOF() macro. 2022-03-11 07:59:08 -06:00
c3eab0dcdd Fixes from sanitizer build
Fix OID index in SetNameRdnItems for multi attributes.
Stop warning about strncpy to small.
Fix casting in ASN1_SIMPLE to use consistent type.
2022-03-11 14:27:50 +10:00
cf030de48a Merge pull request #4930 from SparkiDev/tfm_alloc_fails
TFM: handle more alloc failure cases gracefully
2022-03-10 15:42:21 -08:00
3ea5e56c26 SP ASM performance improvements
Mostly improving Aarch64 assembly.
Change Karatsuba implementations.
Specialised code for exponentiating to 0x10001 for RSA.
2022-03-11 08:42:46 +10:00
570daa6a7f Enable support for STM32U585 and PQ on M4 2022-03-10 14:19:01 -05:00
0eef90f951 Fix for ZD13795 and also remove all-caps parameter 2022-03-10 11:40:32 -07:00
c78bfa4db8 scripts/tls13.test: when $early_data = yes, print the matching line counts. 2022-03-10 11:56:20 -06:00
227804f034 wolfcrypt/src/asn.c: in ParseCRL_Extensions(), add missing FREE_ASNGETDATA(). 2022-03-10 11:45:37 -06:00
170b125b39 wolfcrypt/src/asn.c: fix buffer underrun in EncodeExtensions(), due to faulty iteration limit calculation, when smallstack build. 2022-03-10 09:38:19 -06:00
6b7f0d4ee7 Merge pull request #4905 from anhu/custom_ext_parse
Injection and parsing of custom extensions in X.509 certificates.
2022-03-10 10:39:05 +10:00
b30ada1608 Merge pull request #4940 from ejohnstown/wolfrand
Fix wolfRand Build
2022-03-09 15:42:19 -08:00
47895fe78d Merge pull request #4942 from dgarske/sp_math_opensslextra
Fixes to support building opensslextra with SP math
2022-03-10 08:53:21 +10:00
b4df909df0 Merge pull request #4934 from haydenroche5/x509_v_err_sync
Sync up X509_V_ERR codes with OpenSSL.
2022-03-10 08:37:10 +10:00
98f733767b Use MAX_OID_SZ 2022-03-09 17:20:50 -05:00
e1da313b91 EVP_PKEY_copy_parameters: add support for EVP_PKEY_DH 2022-03-09 14:34:09 -07:00
141cf822f2 Merge pull request #4941 from douzzer/20220309-script-cleanup
20220309 script cleanup
2022-03-09 13:30:50 -08:00
bcfe8bf2e2 Merge pull request #4933 from haydenroche5/x509_set_ext_ext_key_usage 2022-03-09 13:22:49 -07:00
3a62857dbd Fixes to support building opensslextra with SP math. Disables some of the compatibility layer BN and ECC point handling. 2022-03-09 11:53:56 -08:00
b043225dbd Fixes inspired by review by SparkiDev. 2022-03-09 13:39:53 -05:00
d6fb454063 Fix wolfRand Build
1. Remove the v3 FIPS build from configure and automake. This was for
   the old FIPS Ready build, which is now fixed to the certificate 3389
   configuration.
2. Remove AES-GCM, PKCS12, and SHA-3 from wolfRand build. They were
   getting reenabled later in the configure.
2022-03-09 10:35:39 -08:00
abfc788389 script cleanup: use #!/bin/bash on all scripts that use "echo -e" (/bin/sh is sometimes a non-Bourne/non-POSIX shell, e.g. dash/ash, with no support for "echo -e"); fix whitespace. 2022-03-09 12:28:22 -06:00
67cc8ed482 tests/api.c: fix test_wolfSSL_BIO_Qt_usecase() "function declaration isn’t a prototype". 2022-03-09 12:27:19 -06:00
4ff82e22e6 Merge pull request #4938 from douzzer/20220308-shellcheck-errors
fixes for shell script errors detected by shellcheck --severity=error.
2022-03-08 12:51:11 -08:00
70857f7b3c Merge pull request #4923 from miyazakh/set_bio
Set bio read/write flag obviously
2022-03-08 13:08:33 -07:00
c256d8ca92 Merge pull request #4936 from julek-wolfssl/no-force-ecc-ca
Don't force a ECC CA when a custom CA is passed with `-A`
2022-03-08 10:58:35 -08:00
c9a7393923 fixes for shell script errors detected by shellcheck --severity=error. 2022-03-08 12:51:48 -06:00
a4229c6cf8 Merge pull request #4932 from SparkiDev/tls_hmac_fix
TLS HMAC: fix number of blocks to not process
2022-03-08 10:06:11 -08:00
4a912f29d1 Merge pull request #4843 from tmael/sp_diab
Support (no)inline with Wind River Diab compiler
2022-03-08 10:00:16 -08:00
3c64731c4f Don't force a ECC CA when a custom CA is passed with -A
The following config would fail `../configure --enable-opensslall CFLAGS="-DOPENSSL_COMPATIBLE_DEFAULTS" && make -j check`. This is because `test-fails.conf` `ECC no signer error` test expects a failure while the ECC CA was being added as a trusted cert due to  `OPENSSL_COMPATIBLE_DEFAULTS`.
2022-03-08 15:02:43 +01:00
031c97f835 Merge pull request #4931 from douzzer/20220307-early-data-and-c99-fixes
enable-earlydata vs enable-fips/enable-asynccrypt
2022-03-08 07:34:58 -06:00
f71be0546c addressed review comments 2022-03-08 18:20:30 +09:00
31736307fd Sync up X509_V_ERR codes with OpenSSL.
We defined these codes to values that didn't match those in OpenSSL. This is a
problem if a user is porting code from OpenSSL to wolfSSL that uses hardcoded
versions of these values. While the user's code should be fixed to not use
hardcoded values, we can make the port smoother by syncing the values up.
2022-03-07 15:58:46 -08:00
2cbe28fcf9 Sequences are constructed 2022-03-07 18:50:38 -05:00
872ed28882 Merge pull request #4925 from kareem-wolfssl/nullSslMethod
Add SSL_R_NULL_SSL_METHOD_PASSED.
2022-03-07 15:36:56 -08:00
f49983b3b3 EVP_PKEY_keygen: add DH keygen support, fixes to EVP_PKEY_set1/get1_DH 2022-03-07 16:32:23 -07:00
939ce713df EVP_PKEY_derive: set internal DH key if needed 2022-03-07 16:32:22 -07:00
f3f0d49fce EVP_PKEY_CTX_new: set curve NID from pkey if available 2022-03-07 16:32:22 -07:00
85f85cc76a add DH_up_ref() and unit test 2022-03-07 16:32:22 -07:00
8e0f5f9289 EVP_PKEY_get1/set1_EC_KEY: modify for EC_KEY_up_ref support 2022-03-07 16:31:09 -07:00
76014260f6 add EC_KEY_up_ref() and unit test 2022-03-07 16:31:09 -07:00
9b808bde20 Fixes for building with HAVE_EX_DATA no compat layer. 2022-03-07 17:20:58 -06:00
39d975a3c3 Add extended key usage support to wolfSSL_X509_set_ext. 2022-03-07 15:20:01 -08:00
0231304607 fixes for make check with --enable-all (now including --enable-earlydata) with fips or asynccrypt:
in scripts/tls13.test, use fips-compatible server-side cipher suite for "TLS v1.3 cipher suite mismatch" test, and modernize some syntax;

in configure.ac, omit earlydata from enable-all when asynccrypt, pending fix;

also in configure.ac, fix AC_CHECK_DECLS()-overriding-AC_CHECK_FUNCS() kludge, to fix CPPFLAGS=-std=c99 builds.
2022-03-07 17:19:31 -06:00
0a91d42f2c TLS HMAC: fix number of blocks to not process
Change made to line for static analysis.
Change was made incorrectly due to bracketting.
This fixes it.
2022-03-08 08:10:52 +10:00
a9cc1ca877 Merge pull request #4924 from dgarske/coexist_fixes 2022-03-07 13:00:22 -08:00
d77d9b93dc This fixes a make check error.
The flags activated code that didn't account for the new oid encoding. This
code fixes that.
2022-03-07 15:47:47 -05:00
0e0ac14bbf Merge pull request #4901 from SparkiDev/kcapi_ecdh_fixes
Fixes for KCAPI ECDH/DH and page alignment
2022-03-07 11:01:16 -08:00
e7041d2315 Merge pull request #4929 from SparkiDev/siphash_clang
SipHash: Replace gcc specific ASM instruction with generic
2022-03-07 10:34:13 -08:00
3b4ba669d4 Merge pull request #4922 from dgarske/async_disable_fixes
Fixes for async disables around the DevCopy calls
2022-03-07 13:51:09 +10:00
1ca35f6cca TFM: handle more alloc failure cases gracefully 2022-03-07 13:20:39 +10:00
d5989dc15e SipHash: Replace gcc specific ASM instruction with generic
clang would not compile movxzb.
Replaced with movzbq.
2022-03-07 08:49:28 +10:00
a68261cd82 Merge pull request #4757 from kareem-wolfssl/xstatstruct
Add separate "struct stat" definition XSTAT_TYPE to make overriding XSTAT easier.
2022-03-07 08:32:05 +10:00
7006efe97f Merge pull request #4861 from JacobBarthelmeh/ECC
Deterministic ECDSA: fix for larger curve sizes
2022-03-07 08:26:35 +10:00
84beb5ed7b Merge pull request #4918 from miyazakh/enableall_earlydata
enable early data when specifying `--enable-all` option
2022-03-07 08:05:36 +10:00
6bc3b7fc9d addressed jenkins failure 2022-03-06 07:41:37 +09:00
a572c19268 set bio flag obviously
fix nightly Qt test
2022-03-06 07:41:36 +09:00
9be0633ce3 Merge pull request #4824 from dgarske/fips_ready_user
User settings template for FIPS v5 ready
2022-03-05 07:52:03 -06:00
2fc47fedee Merge pull request #4900 from miyazakh/esp_waituntil
Fix wait-until-done in rsa hw primitive acceleration of ESP-IDF port
2022-03-04 17:32:06 -07:00
930a3d85e1 add support to X509_NAME_print_ex() for RFC5523 basic escape 2022-03-04 17:19:33 -07:00
0c3b9c733f Fixes for KCAPI ECDH/DH and page alignment. ZD 13763 2022-03-04 15:06:16 -08:00
f162d7f530 Add SSL_R_NULL_SSL_METHOD_PASSED. 2022-03-04 15:11:09 -07:00
719ed213d5 Add separate "struct stat" definition XSTAT_TYPE to make overriding XSTAT easier. 2022-03-04 14:54:56 -07:00
0a1c052c40 doxygen for wc_SetCustomExtension() 2022-03-04 16:24:27 -05:00
e6189a638c IOTSafe workarounds: Allow reading files with no GetSize command available, allow sign command response with no padding. 2022-03-04 14:03:47 -07:00
806cd4fbba doxygen for myUnknownExtCallback() 2022-03-04 15:32:11 -05:00
3839b0e675 Fixes for building wolfSSL along side openssl. 2022-03-04 12:06:24 -08:00
ce8ef8f7c6 Merge pull request #4913 from kareem-wolfssl/makeClean
Allow disabling forced 'make clean' at the end of ./configure.
2022-03-04 12:02:08 -08:00
e1829e614d Merge pull request #4820 from haydenroche5/evp_pkey_paramgen
Add wolfSSL_EVP_PKEY_paramgen to the compatibility layer.
2022-03-04 11:49:21 -07:00
a4a4bdc20f fix typo, add macro guard, remove dead code path 2022-03-04 10:49:11 -07:00
90355df4b0 disable early data for --enable-distro
addressed jenkins failure
2022-03-04 17:00:29 +09:00
e91f0f173b Fixes for async disables around the DevCopy calls. ZD13824 2022-03-03 16:33:18 -08:00
09e7b7150f Allow overriding make command used for make clean with make. 2022-03-03 15:51:26 -07:00
9ec30f02a6 Merge pull request #4898 from kaleb-himes/140-2-ready 2022-03-03 14:43:02 -08:00
3ad94c63f5 Pass the tests! 2022-03-03 17:02:26 -05:00
7ec61dfe05 Make jenkins happy 2022-03-03 15:44:00 -05:00
0e8066dda0 Fix typo 2022-03-03 11:45:42 -07:00
d1212f9247 add P521 test case and fix for k generation 2022-03-03 10:44:24 -07:00
2567cd5e5a Merge pull request #4912 from julek-wolfssl/ZD13742
Check `input` size in `DecodeNsCertType`
2022-03-03 08:22:49 -08:00
3a5f78b55a Merge pull request #4919 from julek-wolfssl/ZD13737
Reported in ZD13737
2022-03-03 08:22:11 -08:00
949f8b5be1 Revert back to word16 API. 2022-03-03 10:41:05 -05:00
63e4ba5854 Merge pull request #4906 from julek-wolfssl/ZD13606-master
Fix issues reported in ZD13606
2022-03-03 21:27:22 +10:00
85fc2bb7fa Make old less secure TimingPadVerify implementation available
For customers that don't need full side channel security.
2022-03-03 21:17:25 +10:00
bdb7399398 Reported in ZD13737
Implement `wolfSSL_BIO_eof` support for most available BIO's
2022-03-03 10:25:09 +01:00
c7c3ee00bb Address code review
- Use functions instead of accessing `BIO` members
- Add `wolfSSL_BIO_method_type`
2022-03-03 10:09:41 +01:00
b45bbdc078 enable early data when enabled all 2022-03-03 16:36:03 +09:00
dad2332a95 Merge pull request #4917 from kaleb-himes/TIRTOS_KDF_ADD
Add the new kdf.c file to the TIRTOS build
2022-03-02 17:02:47 -08:00
56de8cd622 add check on hash size passed in 2022-03-02 16:52:04 -07:00
a54045113a fixes from review by dgarske 2022-03-02 17:39:15 -05:00
5d0614c630 Merge pull request #4911 from SparkiDev/enc_pem_cbc_padding
ASN PemToDer: remove padding when AES_CBC encrypted
2022-03-02 14:32:45 -08:00
59970d94f5 Merge pull request #4908 from dgarske/tick_pad
Fix for padding in session tickets
2022-03-03 08:20:35 +10:00
25556dea8d Add the new kdf.c file to the TIRTOS build 2022-03-02 14:56:46 -07:00
d86122a5e7 Merge pull request #4909 from JacobBarthelmeh/PKCS12
refactor PKCS12 parse key creation
2022-03-02 12:37:06 -08:00
deea6261e9 Allow disabling forced 'make clean' at the end of ./configure. 2022-03-02 13:20:22 -07:00
0053bd3af1 Now we can inject as wellgit checkout custom_ext_parse 2022-03-02 15:16:39 -05:00
aa18209c99 free buffer since pkey struct makes its own copy 2022-03-02 09:59:21 -07:00
f846aceee2 Check input size in DecodeNsCertType 2022-03-02 17:17:17 +01:00
8b24be04e8 ASN PemToDer: remove padding when AES_CBC encrypted 2022-03-02 11:33:44 +10:00
119f2d2651 Fix for padding in session tickets. Adds padding based on WOLFSSL_GENERAL_ALIGNMENT. Increases enc_len to 32-bit. Related to PR #4887 2022-03-01 15:40:57 -08:00
d1ba82d5e5 Merge pull request #4903 from julek-wolfssl/psk-resuming-certs
OpenSSL considers PSK resuming
2022-03-02 08:57:40 +10:00
b03233a35e handle free'ing up items in fail case 2022-03-01 15:24:53 -07:00
c3e7ff0e61 addressed code review 2022-03-02 07:09:33 +09:00
45ff8af026 refactor PKCS12 parse key creation 2022-03-01 14:49:59 -07:00
b21036947c Merge pull request #4894 from SparkiDev/sp_p521_hashlen_fix
SP P521: hash len needs special attention when 521 bits
2022-03-01 12:04:51 -08:00
71056f6591 Merge pull request #4902 from SparkiDev/tlsx_usc_leak
TLSX: supported groups in temporary not always freed
2022-03-01 12:04:35 -08:00
a104cf887e Ticket failure should result in a regular handshake 2022-03-01 10:34:43 +01:00
645f385031 Fix BioReceive for closed connection
The pending check was forcing a `WOLFSSL_CBIO_ERR_WANT_WRITE` return even though the underlying socket was closed and `WOLFSSL_BIO_FLAG_READ|WOLFSSL_BIO_FLAG_RETRY` was not set. The `wolfSSL_BIO_ctrl_pending(ssl->biord) == 0` is old and I can't find a reason to keep checking it. I left it just in the case where there is output data pending.
2022-03-01 10:34:20 +01:00
5aef687414 OpenSSL considers PSK resuming
- `SSL_VERIFY_FAIL_IF_NO_PEER_CERT` check passes on a TLS 1.3 PSK connection that isn't a ticket
2022-03-01 10:09:24 +01:00
605d701113 SP P521: hash len needs special attention when 521 bits
Need to right shift number down when hash is more than 521 bits.
Previously handled at a byte level and now at bit level.
Always return err from sp_*_ecc_mulmod_add_only_*().
When ECC add and double points are public and only have SP
implementation, check that the point ordinates are the right size.
2022-03-01 09:56:22 +10:00
1aff4399d1 Merge pull request #4899 from dgarske/kcapi
Improvements to KCAPI support
2022-03-01 08:52:55 +10:00
cb95aed41b Parsing of custom extensions in X.509 certificates. 2022-02-28 16:35:19 -05:00
9644a04db2 Peer review fix. 2022-02-28 11:32:12 -08:00
ac7bd0aae8 Fix up random.h conflicts with cert 3389 releases and some NETOS issues 2022-02-28 12:09:50 -07:00
c22282a8aa Merge pull request #4864 from TakayukiMatsuo/rsk65n 2022-02-28 09:12:24 -07:00
92bd5a4076 Merge pull request #4891 from dgarske/multi_test 2022-02-28 15:28:39 +01:00
1cb7342f61 Merge pull request #4895 from SparkiDev/benchmark_threaded
Benchmark: support multi-threaded testing
2022-02-27 21:41:07 -08:00
350881b1bb TLSX: supported groups in temporary not always freed
Fix handling of errors so that temporary is always freed.
2022-02-28 11:40:58 +10:00
f3df4400d5 Merge pull request #4886 from dgarske/zd13745
Adds CSR userId support in subject name
2022-02-28 10:15:41 +10:00
4f4a509e8c fix wait until in rsa primitive 2022-02-26 09:52:14 +09:00
9bdef1577b Fixes for hmac. 2022-02-25 15:19:52 -08:00
cc2eb0ab71 KCAPI Testing fixes. 2022-02-25 15:16:55 -08:00
870ff5b352 Merge pull request #4890 from miyazakh/objinfo
fix to use EXT_KEY_USAGE_OID in object_info
2022-02-25 16:02:48 -07:00
ce6b6951d2 Fix issue with missing OID's for ASN template. 2022-02-25 14:23:01 -08:00
ae1072afad Cleanup mess of ASN_NAME_MAX. 2022-02-25 14:23:01 -08:00
a2381ba954 Adds CSR userId support in subject name. Minor build fixes for ASN template. 2022-02-25 14:22:59 -08:00
08d1e5cb60 Merge pull request #4897 from anhu/bad_macro
Correct bad macros
2022-02-25 14:18:57 -08:00
3fdb6f0a4a Only use pthreads if supported in config. 2022-02-25 13:05:04 -08:00
27c445235c Add a cert 3389 ready option 2022-02-25 13:50:06 -07:00
821fd3c898 Peer review fixes. Check idSz and add comment about session variable use. 2022-02-25 11:38:05 -08:00
1a9faa1f7e fix suggested by dgarske 2022-02-25 14:00:07 -05:00
e3e1426b91 Improve benchmark threading macros and text output. Thread protections on variables. Fixes for testing with async. 2022-02-25 10:51:19 -08:00
997a3aabc6 Correct bad macros 2022-02-25 13:19:35 -05:00
a39a1c1d87 More fixups from cppcheck and clang-tidy. 2022-02-25 10:03:17 -08:00
56adf831a3 Benchmark: support multi-threaded testing 2022-02-25 14:12:03 +10:00
5859b90ad8 Merge pull request #4841 from haydenroche5/vs_resource_file_update
Update Visual Studio resource files.
2022-02-24 15:29:46 -08:00
c33ae4c245 Improve wolfSSL_i2d_X509_NAME and wolfSSL_i2d_X509_NAME_canon.
Like other i2d functions, these functions should be able to take a NULL output
parameter and return the necessary output buffer size. This commit adds this
ability. This commit also removes some redundant code in wolfSSL_i2d_X509_NAME.
2022-02-24 14:48:52 -08:00
269ab86002 Fixes for DoClientTicket changes. 2022-02-24 14:28:50 -08:00
c2987a9ef9 Fix for IPv6 sockaddr_len set but not read. 2022-02-24 14:09:08 -08:00
6dd7a289e7 Fix for "set but not used". 2022-02-24 13:43:56 -08:00
6e24e21d5a Fix for heap pointer in wolfSSL_DupSession. 2022-02-24 12:56:39 -08:00
2b794f03c1 Fixes for multi-test pass. Breaks from PR #4807. 2022-02-24 11:48:40 -08:00
07fdca1d62 Merge pull request #4885 from SparkiDev/asn_templ_bad_name 2022-02-24 12:44:27 -05:00
86e08525cb Merge pull request #4852 from elms/fix/more_oot
automake: fix fips touch and cleanup
2022-02-24 09:04:05 -08:00
5fdc339e34 Merge pull request #4889 from SparkiDev/sp_int_iar
SP math all: IAR doesn't accept comment lines in assembly
2022-02-24 08:37:51 -08:00
de81447b2d fix to use EXT_KEY_USAGE_OID in object_info 2022-02-24 15:18:32 +09:00
3d5b933f3c SP math all: IAR doesn't accept comment lines in assembly
Replace assembly comment lines with C comment lines.
2022-02-24 16:06:31 +10:00
bb50777f1a ASN template: handle short OIDs
cert_asn1_test was constructing a BER encoding of a certificate that
didn't have all the components. It was trying to test putting in a bad
OID in the certificate name.
The original ASN.1 parsing code stopped at the bad name. ASN.1 template
code does the whole structure and then digs into the name.
A complete certificate should have always been used.
2022-02-24 15:36:56 +10:00
b13826a3a5 Merge pull request #4840 from haydenroche5/visual_studio_cleanup
Clean up Visual Studio output and intermediate directories.
2022-02-24 15:07:13 +10:00
25407e955b Update Visual Studio resource files.
- Add a resource file for the wolfSSL FIPS VS solution.
- Update copyright year in existing wolfssl.rc.
2022-02-23 16:53:26 -08:00
d1895e5679 automake: fix fips touch and cleanup
This fixes an issue with yocto that only occurs when using `devtool`
which builds out of tree.
2022-02-23 14:11:31 -08:00
51d66877f7 Add wolfSSL_EVP_PKEY_paramgen to the compatibility layer.
Currently, it only supports ECC, which is all we need it for for the OpenSplice
port we're working on. In the ECC case, all it needs to do is set the group
appropriately. The logic is very similar to `wolfSSL_EVP_PKEY_keygen`, minus
the final step of actually generating the key.
2022-02-23 13:59:15 -08:00
666cf508a2 Merge pull request #4874 from dgarske/ocsp_ipv6 2022-02-23 13:37:16 -08:00
fbc7d5a6b2 Minor textual fixes. Thanks Hayden. 2022-02-23 09:43:10 -08:00
0824a64c92 Merge pull request #4807 from julek-wolfssl/stunnel-5.61
stunnel 5.61 support
2022-02-23 09:41:51 -08:00
b84086a482 Merge pull request #4883 from SparkiDev/ssl_bio_move
BIO: move APIs out of ssl.c
2022-02-23 09:38:54 -08:00
0afc5e2cf1 Merge pull request #4881 from SparkiDev/sp_asm_shift_fix
SP asm: fix for modexp corner case
2022-02-23 09:37:25 -08:00
8623b0c089 Merge pull request #4849 from SparkiDev/sp_p521
SP: Add support for P521
2022-02-23 09:33:49 -08:00
3a34a4cd1d Merge pull request #4882 from SparkiDev/even_mod_check
RSA/DH: check for even modulus
2022-02-23 09:33:12 -08:00
2c978a96b2 Prevent possibility of an infinite retry loop and resource exhaution
Reported in ZD13606
2022-02-23 10:07:21 +01:00
fb943a2f23 Rebase and make wolfSSL_CTX_up_ref always available
`wolfSSL_CTX_up_ref` is a small and potentially useful API for users so it doesn't need to be restricted only to the compatibility layer. The reference counting mechanisms are always available anyway. This just exposes the functionality to the user.
2022-02-23 09:55:52 +01:00
d1f53055e9 Peeking can't return a WOLFSSL_ERROR_WANT_READ in compatibility mode 2022-02-23 09:47:34 +01:00
617eda9d44 Fix misc memory issues
- Make `InternalTicket` memory alignment independent
2022-02-23 09:47:34 +01:00
b402102e58 Add backwards compatibility for wolfSSL_get_session
Before this pull request, `wolfSSL_get_session` always returned a pointer to the internal session cache. The user can't tell if the underlying session hasn't changed before it calls `wolfSSL_set_session` on it. This PR adds a define `NO_SESSION_CACHE_REF` (for now only defined with `OPENSSL_COMPATIBLE_DEFAULTS`) that makes wolfSSL only return a pointer to `ssl->session`. The issue is that this makes the pointer returned non-persistent ie: it gets free'd with the `WOLFSSL` object. This commit leverages the lightweight `ClientCache` to "increase" the size of the session cache. The hash of the session ID is checked to make sure that the underlying session hasn't changed.
2022-02-23 09:47:34 +01:00
ceff401269 Fixes for Jenkins tests
- Move test to `HAVE_IO_TESTS_DEPENDENCIES`
- Implement `wolfSSL_trust_peer_cert`
- have{cipher} options weren't being set with only RSA enabled
2022-02-23 09:47:34 +01:00
91b08fb691 Allocate ssl->session separately on the heap
- Refactor session cache access into `AddSessionToCache` and `wolfSSL_GetSessionFromCache`
2022-02-23 09:47:34 +01:00
1d712d47ba Access to session cache is now atomic
- Adding and getting sessions to and from the local cache is now atomic.
  - The new internal `wolfSSL_GetSessionFromCache` requires a destination object to be supplied when retrieving from the cache so that items can be retrieved independently from the cache. For most existing calls, the destination is `ssl->session`.
  -`PREALLOC_SESSION_TICKET_LEN` defines how much memory is temporarily allocated for the ticket if it doesn't fit in the static session buffer.
2022-02-23 09:47:34 +01:00
afca455cda stunnel 5.61 support
- New/Implemented API
  - `SSL_has_pending`
  - `wolfSSL_CertManagerLoadCRLFile`
  - `wolfSSL_LoadCRLFile`
  - `wolfSSL_CTX_LoadCRLFile`
  - `wolfSSL_CTX_add_session`
- Calling chain certificate API (for example `wolfSSL_CTX_use_certificate_chain_file`) no longer requires an actual chain certificate PEM file to be passed in as input. `ProcessUserChain` error in `ProcessBuffer` is ignored if it returns that it didn't find a chain.
- Add `WOLFSSL_TICKET_HAVE_ID` macro. When defined tickets will include the original session ID that can be used to lookup the session in internal cache. This is useful for fetching information about the peer that doesn't get sent in a resumption (such as the peer's certificate chain).
  - Add `ssl->ticketSessionID` field because `ssl->session.sessionID` is used to return the "bogus" session ID sent by the client in TLS 1.3
- `OPENSSL_COMPATIBLE_DEFAULTS` changes
  - Define `WOLFSSL_TRUST_PEER_CERT` and certificates added as CA's will also be loaded as trusted peer certificates
  - Define `WOLFSSL_TLS13_MIDDLEBOX_COMPAT`
- Seperate `internalCacheOff` and `internalCacheLookupOff` options to govern session addition and lookup
- `VerifyServerSuite` now determines if RSA is available by checking for it directly and not assuming it as the default if static ECC is not available
- `WOLFSSL_SESSION` changes
  - `ssl->extSession` added to return a dynamic session when internalCacheOff is set
  - `ssl->session.refPtr` made dynamic and gets free'd in `SSL_ResourceFree`
- If `SSL_MODE_AUTO_RETRY` is set then retry should only occur during a handshake
- `WOLFSSL_TRUST_PEER_CERT` code now always uses `cert->subjectHash` for the `cm->tpTable` table row selection
- Change some error message names to line up with OpenSSL equivalents
- Run `MatchSuite` again if certificate setup callback installed and successful
- Refactor clearing `ASN_NO_PEM_HEADER` off the error queue into a macro
- `wolfSSL_get_peer_certificate` now returns a duplicated object meaning that the caller needs to free the returned object
- Allign `wolfSSL_CRYPTO_set_mem_functions` callbacks with OpenSSL API
- `wolfSSL_d2i_PKCS12_bio` now consumes the input BIO. It now supports all supported BIO's instead of only memory BIO.
- stunnel specific
  - Always return a session object even if we don't have a session in cache. This allows stunnel to save information in the session external data that will be transfered to new connections if the session is reused
  - When allocating a dynamic session, always do `wolfSSL_SESSION_set_ex_data(session, 0, (void *)(-1)`. This is to mimic the new index callback set in `SSL_SESSION_get_ex_new_index`.
- Fix comment in `wolfSSL_AES_cbc_encrypt`
- Trusted peer certificate suite tests need to have CRL disabled since we don't have the issuer certificate in the CA store if the certificates are only added as trusted peer certificates.
tested
2022-02-23 09:47:34 +01:00
2eb044dc60 SP: Add support for P521 2022-02-23 14:51:47 +10:00
d33b787993 BIO: move APIs out of ssl.c
Get configuration working: --enable-all CFLAGS=-DNO_BIO
2022-02-23 14:11:30 +10:00
b5ed5c9b99 RSA/DH: check for even modulus 2022-02-23 09:51:15 +10:00
194466c35a Peer review fixes. 2022-02-22 15:22:27 -08:00
5b6130889e SP asm: fix for modexp corner case
When exponent bit length is a multiple of the window size and the top
word has only window bits in it, then n is shifted down by an undefined
value (size of a word). The n value is not used after this.
Check for this condition and don't attempt to shift n.
2022-02-23 09:17:08 +10:00
2beb27972b OCSP IPv6 support with --enable-ipv6 or WOLFSSL_IPV6. Improve the logic around C99 and getaddrinfo. 2022-02-22 15:07:05 -08:00
fef8a57eb2 Merge pull request #4880 from julek-wolfssl/plain-alert
Detect if we are processing a plaintext alert
2022-02-22 10:11:08 -08:00
e8c9a413ca Merge pull request #4878 from SparkiDev/sp_x64_oob_write_fix_1
ECC with SP math: OOB write
2022-02-22 09:53:32 -08:00
b40226099d Merge pull request #4877 from SparkiDev/sp_x64_asm_fix_1
SP asm: fix map function to use p not point
2022-02-22 09:50:53 -08:00
d10900e124 ECC with SP math: OOB write
Don't let input points ordinates be greater than modulus in length.
2022-02-22 17:00:23 +10:00
78f116b27f SP asm: fix map function to use p not point 2022-02-22 16:33:24 +10:00
2a750acf03 Merge pull request #4873 from dgarske/async_v5.2.0
Asynchronous Release v5.2.0: TLS 1.3 HelloRetryRequest
2022-02-22 10:35:17 +10:00
250a06f759 Merge pull request #4865 from SparkiDev/sp_int_mont_red
SP int: Montgomery Reduction
2022-02-21 16:20:17 -08:00
31abc99f6f Fix for async handling of TLS v1.3 hello retry broken in #4863. 2022-02-21 14:14:20 -08:00
6a81cc976e Merge pull request #4872 from SparkiDev/tls13_empty_cert_cli
TLS 1.3: fail immediately if server sends empty certificate message
2022-02-21 14:10:40 -08:00
38d4da56ab Merge pull request #4857 from julek-wolfssl/ZD13631
Reported in ZD13631
2022-02-21 14:01:51 -08:00
d834c50c85 Merge pull request #4858 from julek-wolfssl/ZD13611
Reported in ZD13611
2022-02-21 14:01:42 -08:00
e6c07a296d Merge pull request #4866 from ejohnstown/release
Prepare for release 5.2.0
2022-02-21 09:09:58 -08:00
9263e6ead3 TLS 1.3: fail immediately if server sends empty certificate message 2022-02-21 21:34:13 +10:00
eb9220a0b5 Modify example app to work with FreeRTOS+IoT 2022-02-21 12:46:43 +09:00
ad8bf40b5e Update readme for release. 2022-02-20 13:05:04 -08:00
bb8af1cac5 Prepare for release 5.2.0
1. Update versions as appropriate.
2. Modify FreeAtomicUser() to only free the Aes data in the callback
   contexts if the contexts exist.
2022-02-18 13:55:22 -08:00
ffb4ae07df Merge pull request #4871 from wolfSSL/small-leak
Fix Small Memory Leaks
2022-02-18 13:53:56 -08:00
041d300b2b Fix Small Memory Leaks
Found with the configuration running the unit test through valgrind.

    % ./configure CFLAGS=-DNO_WOLFSSL_CIPHER_SUITE_TEST \
      --enable-all --disable-fastmath --enable-debug --disable-shared

1. ssl.c: In wolfSSL_DSA_generate_key(), we initialize (and allocate)
   all the parameters in the key (p, q, g, x, y), and then we generate a
   key, initializes (and allocates) x and y, again. mp_clear them
   first.
2. evp.c: When printing public keys, the temporary mp_int wasn't getting
   correctly freed.
3. evp.c: When printing public keys, modified the utility functions to
   return once with a do-while-0 loop.
2022-02-18 10:01:49 -08:00
4b0c8c07f4 Merge pull request #4870 from elms/fix/tls13_renegotiation_info_ext
tls13: fix not including RENEGOTIATION_INFO ext
2022-02-17 13:09:02 -08:00
208c457348 tls13: fix to not send RENEGOTIATION_INFO ext
Introduced in PR #4742 to enable sending of extension in TLS1.2
without fully supporting secure renegotiation in accordance with
RFC 5746 4.3 https://datatracker.ietf.org/doc/html/rfc5746#section-4.3
2022-02-17 11:22:17 -08:00
95ae242550 Merge pull request #4869 from wolfSSL/silabs-aes
SILABS port: fix sizeof
2022-02-17 10:45:47 -08:00
b343c2691b Merge pull request #4867 from maximevince/master
Fix WOLFSSL_NO_TLS12 for Async dev
2022-02-17 10:18:18 -08:00
4361d1bdd2 SILABS port: fix sizeof
A sizeof wasn't dereferencing a pointer using the sizeof the pointer and
not the actual struct. This is limited to setting the key for an AES
operation only when using SILABS SE2 acceleration.
2022-02-17 08:52:46 -08:00
111ae9da84 Fix WOLFSSL_NO_TLS12 for Async dev 2022-02-17 08:10:19 +01:00
c5875cfc5a Detect if we are processing a plaintext alert 2022-02-16 10:50:44 +01:00
df0b516c68 Merge pull request #4863 from SparkiDev/tls13_auth
TLS 1.3: improved checks on received message type
2022-02-15 11:33:34 -08:00
a5ce2a33eb add macro guard around test case 2022-02-15 11:58:59 -07:00
15d0dd258a Add cert test for UID name component 2022-02-15 14:05:46 +01:00
ea5785f6fd SP int: Montgomery Reduction
Improve performance for ECC curves when all bits in words are used (mask
is 0).
On 64-bit platforms, improves performance for 256 and 384 bit curves.
On 32-bit platforms, improves performance for 224, 256, 384 bit curves.
2022-02-15 17:19:57 +10:00
94c03a77f5 TLS 1.3: improved checks on received message type
pskNegotiated field added to indicate Session Ticket or PSK negotiated.

peerAuthGood field added to indicate that any require peer
authentication (certificate, if required, or PSK) have been performed.
2022-02-15 13:25:16 +10:00
9906c9c55e Merge pull request #4862 from dgarske/no_server
Fix typo for no server
2022-02-15 10:31:12 +10:00
07045083a9 Merge pull request #4859 from SparkiDev/sp_int_thumb_small
SP int: fixup ARM Thumb asm for small builds
2022-02-14 16:07:50 -08:00
6571151d17 SP int: fixup ARM Thumb asm for small builds
Small builds or arm Thumb can't use r7.
2022-02-15 08:34:21 +10:00
c992ddbfc0 Merge pull request #4853 from SparkiDev/curve448_128bit_perf
Curve448: inline Karatsuba in sqr and mul for 128-bit impl
2022-02-14 12:04:57 -08:00
16566f329e Fix typo for no server. Should be NO_WOLFSSL_SERVER. 2022-02-14 10:37:34 -08:00
ff4ee20f05 Merge pull request #4860 from SparkiDev/disable_hmac
Configure HMAC: define NO_HMAC when HMAC disabled
2022-02-14 10:08:32 -08:00
f0a0cd1078 fix for larger curve sizes with deterministic ECC sign 2022-02-14 09:55:38 -07:00
445ed2f234 Reported in ZD13631
`ssl->peerVerifyRet` wasn't being cleared when retrying with an alternative cert chain
2022-02-14 11:01:59 +01:00
f02296a4e6 Configure HMAC: define NO_HMAC when HMAC disabled 2022-02-14 17:22:10 +10:00
38653510eb Curve448: inline Karatsuba in sqr and mul for 128-bit impl 2022-02-14 09:09:57 +10:00
4e5380668c Reported in ZD13611
The `UID` name component could not be parsed if it appears in a subject or issuer name
2022-02-12 00:36:07 +01:00
40b171124f Fixes to resolve a few make check issues. 2022-02-11 15:20:25 -08:00
2fa542eb28 Merge pull request #4846 from haydenroche5/fips_mode_compat
Implement FIPS_mode and FIPS_mode_set in the compat layer.
2022-02-11 12:50:30 -08:00
88f202aa22 Merge pull request #4855 from julek-wolfssl/issue-4854
wolfSSL_get_error may return SSL_ERROR_NONE on ret <= 0
2022-02-11 09:01:16 -08:00
4f8ffc4586 wolfSSL_get_error may return SSL_ERROR_NONE on ret <= 0
Fix docs mismatch reported in https://github.com/wolfSSL/wolfssl/issues/4854
2022-02-11 12:37:12 +01:00
34b6102816 Merge pull request #4847 from douzzer/20220209_clang-Os
fixes for clang -Os on clang >= 12.0.0
2022-02-10 21:31:01 -06:00
7da3b8458a Merge pull request #4851 from miyazakh/update_RA6M3_rmunsrc 2022-02-10 18:14:09 -07:00
fbf38fff07 wolfcrypt/src/sp_int.c: fix comment around clang-12+ -Os. 2022-02-10 16:43:17 -06:00
5c9510d92e fips_check.sh: for linuxv2 add COPY_DIRECT with wolfcrypt/src/{aes_asm.S,aes_asm.asm}; for linuxv5 add wolfcrypt/src/aes_gcm_asm.S to COPY_DIRECT; fix whitespace. 2022-02-10 16:01:08 -06:00
cbc253d713 wolfcrypt/test/test.c: gate ecc_encrypt_e2e_test() on !HAVE_FIPS || FIPS_VERSION_GE(5,3). 2022-02-10 16:00:52 -06:00
c581e13380 bwrap tweaks:
in scripts/ocsp.test, don't call ping.test when $AM_BWRAPPED = yes (ping is setuid, so fails under bwrap);

in scripts/unit.test.in, don't bwrap if $AM_BWRAPPED = yes (double-bwrapping always fails);

in testsuite/testsuite.c testsuite_test(), build tempName using tempDir, and try to assign tempDir from XGETENV("TMPDIR"), fallback to hardcoded "/tmp".
2022-02-10 15:54:39 -06:00
91578df19d fixes for clang -Os on clang >= 12.0.0; fixes for bugs in blake2s. 2022-02-10 15:54:10 -06:00
562fcd3916 Implement FIPS_mode and FIPS_mode_set in the compat layer. 2022-02-10 13:14:05 -08:00
34c87b83e2 Merge pull request #4848 from SparkiDev/sp_int_div_word_2
SP int, cortex, thumb div_word: fix to work
2022-02-10 07:42:00 -08:00
a1198549dd Merge pull request #4844 from dgarske/bench_cleanups 2022-02-10 10:24:55 -05:00
d1267b5203 Merge pull request #4805 from SparkiDev/ecies_aes_ctr
ECIES: add support for more encryption algorithms
2022-02-10 07:04:24 -08:00
e351f1a7e7 rm unused src links 2022-02-10 22:21:24 +09:00
e8fb17f7b5 SP int, cortex, thumb div_word: fix to work
Cortex builds needed # before number. Arm32 works with or without.
Thumb div_word needed to shift up if divisor too small (like other ARM
implementations).
2022-02-10 12:07:11 +10:00
e50f661639 ECIES: add support for more encryption algorithms
Add support to ECIES for AES-256-CBC, AES-128-CTR, AES-256-CTR.
Added new API wc_ecc_ctx_set_algo() that sets the encryption, KDF and
MAC algorithms.
Cleanup formatting of ECIES code.
2022-02-10 09:54:22 +10:00
4f1aa9a475 Fix benchmark input/output arguments. Cleanup line length and whitespace. 2022-02-09 13:13:42 -08:00
cba262440a Merge pull request #4842 from SparkiDev/sha3_arm_fixup
ARMASM, SHA-3: fixup when not using crypto instructions
2022-02-09 10:20:46 -08:00
bee025842e Merge pull request #4828 from TakayukiMatsuo/rtos 2022-02-09 09:37:47 -07:00
0d5edfadcb Merge pull request #4837 from SparkiDev/sp_c_config
SP C: when sp_c32.c ad sp_c64.c are included in build changed
2022-02-09 07:51:20 -08:00
c472b3582e Merge pull request #4839 from douzzer/20220207-clang-tidy-15
20220208 clang-tidy-15 fixes etc.
2022-02-09 08:36:18 -06:00
343cb0da23 SP C: when sp_c32.c ad sp_c64.c are included in build changed
When compiling with the CFLAG -m32, sp_c32.c is used and not sp_c64.c.
The build system cannot detect that this is a 32-bit platform and to use
sp_c32.c.

The SP code detects which implementaiton to use and sets defines that
enable the code in sp_c32.c or sp_c64.c.

ENABLED_64BIT, 64-bit platform, was on by default, which is not always
true.
By making ENABLED_64BIT not default then the decision of which SP C
files to include in the build had to change to not being the other.
That is, sp_c64.c is not included when the configuration line explicitly
enables 32bit and sp_c32.c is not include when the configuration line
explicitly enables 64bit.
2022-02-09 15:56:57 +10:00
f49b7107a0 Add __inline__ for Diab compiler 2022-02-08 19:54:26 -08:00
32c80781bf Prevent diab compiler from inlining functions 2022-02-08 19:25:13 -08:00
b436262cdf ARMASM, SHA-3: fixup when not using crypto instructions 2022-02-09 09:36:00 +10:00
49defbd2cc Merge pull request #4836 from embhorn/zd13634
Remove deprecated VS solution
2022-02-08 15:18:21 -08:00
67b2a1be40 Merge pull request #4831 from dgarske/zd13571_2
Improve the client certificate checking logic
2022-02-09 08:27:03 +10:00
1bd4cb4eee Modify example app to work with FreeRTOS+IoT 2022-02-09 07:18:39 +09:00
34946c2440 Merge pull request #4832 from TakayukiMatsuo/rose 2022-02-08 14:54:47 -07:00
74408e3ee3 fixes for whitespace, C++ warnings, and LLVM 15 clang-tidy defects/carps:
* whitespace in src/ssl.c, tests/api.c, wolfssl/openssl/fips_rand.h.

* clang-analyzer-core.StackAddressEscape from llvm-15 clang-tidy, in tests/suites.c:execute_test_case().

* bugprone-suspicious-memory-comparison from llvm-15 clang-tidy, in src/internal.c:DoSessionTicket() and src/ssl.c:wolfSSL_sk_push().
2022-02-08 15:20:22 -06:00
ed1fc9fc51 Merge pull request #4833 from SparkiDev/sha3_arm_crypto
SHA-3, ARM64: add assembly support for crypto instructions
2022-02-08 11:05:35 -08:00
7ec1e69dba Fixes for supporting the openssl compatibility layer. Adds ChaCha/Poly, DH extra and verify callbacks. 2022-02-08 10:18:41 -08:00
6930cc0b21 Clean up Visual Studio output and intermediate directories.
Currently, wolfssl.vcxproj and IDE/WIN10/wolfssl-fips.vcxproj do not use the
same scheme for their output and intermediate directories. Further, across
configuration/platform combinations, wolfssl.vcxproj isn't consistent, either.
For example:

```
Release|x64
OutDir: $(SolutionDir)$(Platform)\$(Configuration)\
IntDir: $(Platform)\$(Configuration)\obj\

Release|Win32
OutDir: $(SolutionDir)$(Configuration)\
IntDir: $(Configuration)\obj\
```

This commit makes every configuration/platform combo for all Visual Studio
projects follow the same pattern:

```
OutDir: $(SolutionDir)$(Platform)\$(Configuration)\
IntDir: $(Configuration)\$(Platform)\$(ProjectName)_obj\
```

The `$(ProjectName)_obj` piece gets rid of a Visual Studio warning about not
mingling the intermediate objects of disparate builds.
2022-02-08 09:23:27 -08:00
3ee6e93590 Merge pull request #4838 from SparkiDev/g++_fix_4
Rework functions to avoid warning with g++
2022-02-08 10:20:58 -06:00
1f69c52ce8 Merge pull request #4830 from dgarske/no_hmac
Fixes for building without HMAC
2022-02-07 22:26:38 -06:00
d2307186d9 Rework functions to avoid warning with g++ 2022-02-08 12:36:36 +10:00
0042a2594c SHA-3, ARM64: add assembly support for crypto instructions
Add ability to compile ARM assembly from inline C code.
2022-02-08 12:21:38 +10:00
b60d2dccce Include the havePeerCert argument in the check. 2022-02-07 16:31:50 -08:00
5169a3cf89 Improve header comments and logic. Remove NO_PWDBASED and added CRL. 2022-02-07 15:58:10 -08:00
5e5a389afb Remove deprecated VS solution 2022-02-07 17:14:41 -06:00
d0246a280d Merge pull request #4834 from anhu/guard_wc_PKCS7_SetPassword
Fix tests to properly gate on ! NO_PWDBASED && ! NO_SHA
2022-02-07 15:12:22 -08:00
56c562a516 Fixes for building with ./configure --enable-opensslextra --enable-cryptonly CFLAGS="-DNO_HMAC" && make. Found this testing a customers configuration with latest. Also fixes some trailing whitespace. 2022-02-07 15:10:21 -08:00
d085984103 Merge pull request #4829 from kosmas-valianos/kTLS
Expose Sequence Numbers so that Linux TLS (kTLS) can be configured
2022-02-07 14:55:07 -08:00
5361c0bda0 Update signature as the certificate is renewed 2022-02-08 07:31:50 +09:00
e47dd675af Fix tests to properly gate on ! NO_PWDBASED && ! NO_SHA 2022-02-07 14:44:26 -05:00
dd2e0064b2 Merge pull request #4827 from SparkiDev/sp_int_dw_asm
SP math, Aarch64, ARM32: div word asm fixup
2022-02-07 11:32:14 -08:00
54e7db0a9a Merge pull request #4739 from rizlik/psa
support Platform Security Architecture (PSA) API
2022-02-07 10:40:21 -08:00
4c8f0709fc Merge pull request #4720 from dgarske/fips_compat 2022-02-07 09:56:24 -07:00
3cdb1c639d Improve the client certificate checking logic. Make sure calling wolfSSL_CTX_mutual_auth is also checked. 2022-02-07 08:09:38 -08:00
3d85a9690f Merge pull request #4819 from lealem47/hashMismatch
Fix for OpenSSL x509_NAME_hash mismatch
2022-02-07 08:08:49 -08:00
30b35acd39 Expose Sequence Numbers so that Linux TLS (kTLS) can be configured 2022-02-07 09:30:59 +01:00
f6d79ff598 Merge pull request #4813 from dgarske/zd13571
Fix for mutual authentication to prevent mismatch of certificate and sigalgo
2022-02-07 11:00:04 +10:00
f9ff551992 Fix for OpenSSL x509_NAME_hash mismatch 2022-02-04 16:59:51 -08:00
1f8ff7d9fe Merge pull request #4822 from embhorn/zd13613
Fix warnings in VS
2022-02-04 15:37:31 -08:00
2077184953 psa: add compile-time error if builded with crypto cb 2022-02-04 21:45:38 +01:00
b8635efda7 psa: add README.md and doxygen header 2022-02-04 21:45:38 +01:00
0cb2cc1705 psa: support pk callbacks for ECDSA, ECDH, HKDF 2022-02-04 21:45:38 +01:00
630b244cee psa: introduce global lock 2022-02-04 21:45:38 +01:00
a7165907da psa: support AES 2022-02-04 21:45:38 +01:00
9ccfc81f26 psa: support PSA SHA1/SHA256/SHA224 2022-02-04 21:45:38 +01:00
06915b6fa3 psa: support PSA random generator 2022-02-04 21:45:38 +01:00
08047b2d95 Add checking to make sure key is present in all cases. Explicitly set validSigAlgo to zero with comment to clarify the default assumption. 2022-02-04 11:47:06 -08:00
2d184348fb Merge pull request #4825 from embhorn/gh4815
Fix wolfSSL_PEM_X509_INFO_read with NO_FILESYSTEM
2022-02-04 10:42:40 -08:00
327e35fc25 Merge pull request #4826 from haydenroche5/evp_aes_gcm_iv_bug
Fix IV length bug in EVP AES-GCM code.
2022-02-04 10:38:02 -08:00
d1ca8fc673 Merge pull request #4821 from elms/cmake/help_cleanup 2022-02-04 09:37:39 -08:00
08fbcf5eae autoconf: add PSA options 2022-02-04 12:12:04 +01:00
bd1b58dd7f SP math, Aarch64, ARM32: div word asm fixup
ASM code is dividing by top half of divisor. If this value is very small
then bad results are calculated.
Moved the divisor up by a quarter of the width if top quarter of divisor
is 0.
2022-02-04 11:59:31 +10:00
b850cc89b0 Fix IV length bug in EVP AES-GCM code.
In `wolfSSL_EVP_CipherInit`, `ctx`'s `ivSz` field isn't being accounted for.
A common OpenSSL EVP AES-GCM flow looks like this:

- `EVP_CIPHER_CTX_new`
- `EVP_EncryptInit_ex`
- `EVP_CIPHER_CTX_ctrl` with command `EVP_CTRL_GCM_SET_IVLEN` to set the IV
length to 16 (AES block size) instead of the default 12
- `EVP_EncryptInit_ex` again to set the key and IV
- `EVP_EncryptUpdate` however many times
- `EVP_EncryptFinal`

In fact, we test this flow in our unit test `test_wolfssl_EVP_aes_gcm`. However,
in our implementation, the second call to `EVP_EncryptInit_ex` unconditionally
resets the IV length back to 12. This doesn't cause a test failure because
decryption has the same problem, so both sides of the equation have the same
wrong view of the IV.

The solution is to preserve the IV length in wolfSSL_EVP_CipherInit if ctx->ivSz
is non-zero. Otherwise, use the default of 12 (`GCM_NONCE_MID_SZ`).

This was discovered by a user migrating to the compatibility layer. As I
mentioned, it isn't exposed by our testing. It is exposed if you try to use the
same key and IV with OpenSSL and compare the resulting ciphertext with wolfSSL.
They won't be the same and thus won't interoperate.
2022-02-03 17:40:26 -08:00
50700c3c28 Make sure Rabbit and HC128 are disabled when building FIPS against older wolfSSL. 2022-02-03 14:53:11 -08:00
a0444bf72f Fix wolfSSL_PEM_X509_INFO_read with NO_FILESYSTEM 2022-02-03 16:52:08 -06:00
7b2e457d04 Fix VS unreachable code warning 2022-02-03 15:53:35 -06:00
db6d924d4b User settings template for FIPS v5. 2022-02-03 13:35:13 -08:00
53e64b55e1 Merge pull request #4823 from haydenroche5/alpn_bug
Fix bug in TLSX_ALPN_ParseAndSet when using ALPN select callback.
2022-02-03 13:16:13 -08:00
fab2e99bff Fix bug in TLSX_ALPN_ParseAndSet when using ALPN select callback.
At the start of this function, it attempts to find an ALPN extension in the
ssl object's extensions with `TLSX_Find`. If an ALPN select callback has been
set (i.e. via `wolfSSL_CTX_set_alpn_select_cb`), that gets called next. If that
callback finds a match, it removes all existing ALPN extensions found in the
ssl object. It then uses the new protocol name like this:

```
if (TLSX_UseALPN(&ssl->extensions, (char*)out, outLen, 0, ssl->heap)
                                                           == WOLFSSL_SUCCESS) {
    if (extension == NULL) {
        extension = TLSX_Find(ssl->extensions,
                              TLSX_APPLICATION_LAYER_PROTOCOL);
    }
}
```

The bug is exposed if `extension` is not NULL, i.e. it was found on that initial
`TLSX_Find` call. `extension` is not NULL but it now points to garbage because
all the old ALPN extensions were just removed. It won't have it's value assigned
to the new extension that just got pushed via `TLSX_UseALPN` because of this
NULL check. This results in a segfault later in the function.

The solution is to remove the NULL check and always update `extension` after the
`TLSX_UseALPN` call.

This bug was discovered by a customer when using nginx + wolfSSL. I was able to
reproduce locally with curl acting as the client
2022-02-03 09:36:18 -08:00
f0b953ce0c Fix warnings in VS 2022-02-03 07:19:43 -06:00
fab8eca2fd cmake: Check for valid voerride values
Also remove trailing whitespace
2022-02-02 16:32:00 -08:00
9b4289c751 cmake: Add KEYGEN option. Cleanup help messages.
Add `WOLFSSL_KEYGEN` option and override enable when `WOLFTPM` is
enabled

Also major reduction of variables for help messages. Override only
updates `VALUE`
2022-02-02 16:15:47 -08:00
d3e3f57b77 Merge pull request #4818 from julek-wolfssl/guido-13454
`object` and `value` need to be `free`'ed
2022-02-02 16:04:39 -08:00
17eee2ba0c Merge pull request #4817 from julek-wolfssl/ZD13495
ZD13495
2022-02-02 15:54:08 -08:00
97dd974a94 object and value need to be free'ed 2022-02-02 23:13:59 +01:00
e13861bcde Fix for mutual authentication to prevent mismatch of certificate and sig algo. Work from Sean P. ZD 13571 2022-02-02 12:20:02 -08:00
28d3292a16 Merge pull request #4811 from haydenroche5/dh_get_2048_256
Add DH_get_2048_256 to compatibility layer.
2022-02-02 12:12:34 -08:00
0618b69b6d Merge pull request #4816 from julek-wolfssl/ok-error
For `0` OpenSSL prints "ok"
2022-02-02 12:10:35 -08:00
9efb791abc Merge pull request #4814 from SparkiDev/bio_dump_iter
wolfSSL_BIO_dump: fix output format and make iterative
2022-02-02 12:02:07 -08:00
d5b294edc4 ZD13495
- `wolfSSLeay_version` now returns the version of wolfSSL
- `wolfssl/openssl/crypto.h` was not enveloped in a `extern "C"` wrapper
2022-02-02 17:38:36 +01:00
c629c3fcaa Add DH_get_2048_256 to compatibility layer. 2022-02-02 07:59:17 -08:00
1552e89810 For 0 OpenSSL prints "ok" 2022-02-02 15:54:21 +01:00
cebb127ac3 test: don't free AesXts struct in-between tests that reuse the key 2022-02-02 10:46:40 +01:00
641576390d wolfSSL_BIO_dump() and wolfSSL_OBJ_obj2txt() rework
wolfSSL_BIO_dump(): fix output format and make iterative
wolfSSL_OBJ_obj2txt(): make iterative, test and rework.
2022-02-02 12:43:06 +10:00
59ea65bad3 Merge pull request #4809 from haydenroche5/asn1_int 2022-02-01 13:44:32 -07:00
99799a3e3e Merge pull request #4806 from anhu/kill_idea
Purge IDEA cipher
2022-02-01 12:27:55 -08:00
24a2ed7e9e Merge pull request #4780 from dgarske/ipsec_racoon 2022-01-31 15:10:58 -08:00
df85ea7e87 Merge pull request #4800 from SparkiDev/sp_c_smul
SP C: multiplication of two signed types with overflow is undefined in C
2022-01-31 14:29:18 -08:00
13c759cc10 Merge pull request #4812 from douzzer/20220131-camellia-clang-tidy
wolfcrypt/src/camellia.c: clang-tidy fixes (bugprone-macro-parentheses).
2022-01-31 14:13:23 -08:00
a742c33c0c Mention IDEA removal in README.md. 2022-01-31 16:18:39 -05:00
9ea40f3a9c Purge IDEA cipher 2022-01-31 15:29:25 -05:00
a7de880745 wolfcrypt/src/camellia.c: clang-tidy fixes (bugprone-macro-parentheses). 2022-01-31 14:21:54 -06:00
ecb3f215b5 Merge pull request #4808 from lealem47/certreq
Fix for certreq and certgen options with openssl compatability
2022-01-31 10:16:22 -08:00
5bdaf44354 Merge pull request #4774 from anhu/kill_rabbit
Purge Rabbit cipher
2022-01-31 09:17:23 -08:00
6b71289ae1 Add new ASN1_INTEGER compatibility functions.
This commit adds:

- wolfSSL_i2d_ASN1_INTEGER
- wolfSSL_d2i_ASN1_INTEGER
- wolfSSL_ASN1_INTEGER_cmp
2022-01-29 17:01:16 -08:00
e58ff9e765 Merge pull request #4795 from wolfSSL/cmake/wolftpm
cmake: Add options to support wolfTPM
2022-01-28 14:52:53 -08:00
f509dafd6c README.md addition 2022-01-28 17:20:25 -05:00
f608b1a731 macro logic fix 2022-01-28 13:54:13 -08:00
e135ea7338 Fix for certreq and certgen options with openssl compatability 2022-01-28 12:39:00 -08:00
40fff86807 Merge pull request #4801 from tmael/cert_rr
cert subset improvements
2022-01-28 11:00:55 -08:00
b957a6e872 Purge Rabbit cipher 2022-01-28 13:13:53 -05:00
6e76f21f9e cmake: Add options to support wolfTPM
* certgen
 * certgencache
 * certreq
 * certext
 * cryptocb
 * pkcs7
 * X9.63 KDF
 * AES-CFB
2022-01-28 09:44:09 -08:00
c69010adef Peer review feedback. 2022-01-28 09:21:03 -08:00
6615f019f5 Improved HMAC_Init error logging and code comment for FIPS failure on wc_HmacSetKey call. 2022-01-28 09:21:03 -08:00
80ae237852 Fixes for building with ipsec-tools/racoon and openvpn:
* Fix for `EVP_CIPHER_CTX_flags`, which mapped to a missing function (broke openvpn)
* Added stack of name entries for ipsec/racoon support.
* Added `X509_STORE_CTX_set_flags` stub.
* Added PKCS7 NID types.
* Improved FIPS "SHA" logic in `test_wolfSSL_SHA`
* Added some uncommon NID type definitions.
* Expose the DH `DH_set_length` and `DH_set0_pqg` with OPENSSL_ALL
2022-01-28 09:21:03 -08:00
46f25ea3e0 Merge pull request #4804 from douzzer/20220127-clang-tidy-fips_test_h
clang-tidy hygiene for fips_test.h
2022-01-28 09:00:03 -08:00
cd72b4652b Merge pull request #4798 from lealem47/cmake 2022-01-28 08:42:29 -08:00
30b2073228 test.c: fix gating on wc_ecc_encrypt_ex() for FIPS <5.3 --enable-all. 2022-01-27 19:54:07 -06:00
19042023f4 MD5 vs. FIPS 140-3: fix gating so that unit.test succeeds when --enable-fips=v5 --enable-md5 (HMAC-MD5 is non-FIPS in 140-3, but even in a FIPS 140-3 build, the non-FIPS API can be accessed directly by #undef'ing wc_Hmac*()). 2022-01-27 18:37:29 -06:00
d9073f39e1 fips_test.h: add arg names to prototypes, and delete obsolete+unused DoIntegrityTest() prototype. 2022-01-27 18:37:29 -06:00
1465f99b12 Merge pull request #4734 from haydenroche5/fips_v5_des3
Allow DES3 with FIPS v5-dev.
2022-01-27 15:07:22 -08:00
667009007b Merge pull request #4799 from SparkiDev/file_gen_fixes
Generated files: fixes
2022-01-27 14:21:34 -08:00
77a64d0087 Merge pull request #4802 from SparkiDev/ecies_compressed
ECIES: allow compressed public keys
2022-01-27 14:21:12 -08:00
1c12490c98 Adding some CMake options 2022-01-27 11:52:37 -08:00
f323964e8a Update TIRTOS module
Use SP_MATH by default. Added missing object files.
2022-01-27 16:23:23 +01:00
b890a2f15d ECIES: allow compressed public keys
ECIES messages have a public key/point at start of the data.
It can be either uncompressed or compressed.
Adding support for decrypting and encrypting of compressed point.
2022-01-27 12:10:59 +10:00
a37e17084d Use mp_iszero 2022-01-26 17:33:42 -08:00
1c1bd413e0 cert subset SHA2-256, ecc-256, cert gen, cryptocb 2022-01-26 17:11:00 -08:00
91b1e541c5 SP C: multiplication of two signed types with overflow is undefined in C
Montgomery Reduction: cast variables to be unsigned where signed
multiplication with overflow is performed.
2022-01-27 10:25:02 +10:00
a242424abe Generated files: fixes
Fixups from updating scripts that generate the files.
Include settings.h for ARM32 assembly.
ARM32 SHA-512 ASM has only one function, Transform_Sha512_Len(). The
implementation is dependent on defines.
2022-01-27 10:05:45 +10:00
9bbc5e07e6 Merge pull request #4733 from JacobBarthelmeh/ECC
include hmac for deterministic ecc sign build
2022-01-26 10:01:46 -08:00
25c6417f03 Merge pull request #4797 from douzzer/20220124-clang-tidy
clang-tidying headers
2022-01-26 10:01:00 -08:00
b7cecbacb2 update headers to resolve clang-tidy carping (mostly bugprone-macro-parentheses and readability-named-parameter). also disables MSC C4028 because incompatible with readability-avoid-const-params-in-decls. 2022-01-26 02:06:37 -06:00
9250edc2ea wolfcrypt/src/fe_x25519_128.i: harmonize argument names in fe_cswap() and fe_cmov() with those used in fe_operations.c. 2022-01-26 02:05:26 -06:00
85da17bcf8 src/ssl.c: fix argument name in openssl compat layer wrappers of hash final funcs in ssl.c (use "output", not "input"). 2022-01-26 00:27:45 -06:00
1e3516d924 src/ssl.c: implement wolfSSL_SHA512_224_Transform() and wolfSSL_SHA512_256_Transform(). 2022-01-26 00:27:07 -06:00
7c9f4911c3 src/wolfio.c: protect __GLIBC__ comparison with defined(__GLIBC__). 2022-01-26 00:22:13 -06:00
cfc7337bda Merge pull request #4794 from rizlik/openssl_srtp_script_fix
dtls-srtp: don't run openssl_srtp.test on make check
2022-01-25 16:31:29 -08:00
d0dbdd374d Merge pull request #4775 from elms/cmake/asm_user_settings
cmake: enable ASM and fix thread with usersettings
2022-01-25 16:25:16 -08:00
38558d7fd1 dtls-srtp: don't run openssl_srtp.test on make check 2022-01-25 21:51:56 +01:00
588f4a11c9 Merge pull request #4785 from douzzer/20220120-aes-internal-error-handling
20220120-aes-internal-error-handling
2022-01-24 20:45:53 -08:00
58789991f9 Allow DES3 with FIPS v5-dev. 2022-01-24 15:18:44 -08:00
50e3565df6 Merge pull request #4779 from SparkiDev/dyn_cert
Cert: allow allocation of fields even with WOLFSSL_NO_MALLOC
2022-01-24 14:17:41 -08:00
746c05ca44 AES: peer review: remove gating around sanity checks on aes->rounds in software wc_AesEncrypt() and wc_AesDecrypt();
use local variable crypto_cb_ret around WOLF_CRYPTO_CB calls for clarity;

fix line length.
2022-01-24 15:47:23 -06:00
f0041852b5 aes.c: add error catching and percolation for wc_AesGetKeySize() on FREESCALE_LTC in wc_AesEncrypt(), wc_AesDecrypt(), and wc_AesCtrEncrypt(). 2022-01-24 13:34:22 -06:00
5ff1d98306 AES: fix linebreaks in newly overlong lines in aes.c and aes.h; add missing return code in armv8-aes.c wc_AesDecryptDirect(); add missing RESTORE_VECTOR_REGISTERS() in software wc_AesXtsEncrypt() (all pursuant to peer review in #4785 from Sean). 2022-01-24 12:32:25 -06:00
565a7b0aab aes.c: in linuxkm clause of WOLFSSL_AES_DIRECT section, gate on WOLFSSL_LINUXKM && WOLFSSL_AESNI (with no-asm falling through to the generic definition), and use wolfssl-idiomatic WARN_UNUSED_RESULT, not linux-kernel-idiomatic __must_check. (thanks to John S peer review) 2022-01-24 11:44:16 -06:00
a718637c6f AES: harmonize wc_Aes{Encrypt,Decrypt} and wc_Aes{Encrypt,Decrypt}Direct implementations to return int; add return values to all static void functions in aes.c that can fail; add WARN_UNUSED_RESULT to all static functions in aes.c with return values; implement missing error percolation around AES block cipher implementations; bump FIPS version for v5-ready and v5-dev to 5.3 (v5-RC12 is 5.2). 2022-01-24 11:44:16 -06:00
dee66cfe9e Merge pull request #4789 from SparkiDev/sp_invmod_oob
SP int: sp_modinv fixes for sizes
2022-01-24 09:08:08 -08:00
93404361ff Merge pull request #4783 from SparkiDev/mac_sha512_def
SHA-512 ASM: For Mac computers default to using SHA512 instructions
2022-01-24 09:03:08 -08:00
44c0a5f9f8 Merge pull request #4790 from SparkiDev/decodesubtree_oobr
ParseCert: check index in DecodeSubtree before accessing tag
2022-01-24 08:36:52 -08:00
3d63e41653 SP int: sp_modinv fixes for sizes
sp_invmod with even modulus requires a multiplication by modulus. Don't
let modulus overflow result variable 'r'.
Fix allocation of temporary sp_ints to be correct size.
Add test for maximum modulus size in test.c.

Remove leading spaces on functions so git correctly determines which
function has changed.
Put in Thumb code for more sizes of _sp_mul_*().
2022-01-24 15:18:20 +10:00
1dd213db76 ParseCert: check index in DecodeSubtree before accessing tag 2022-01-24 12:30:48 +10:00
198843aa34 Merge pull request #4787 from douzzer/20220121-fixits-20220118-clang-tidy
cleanup re #4772
2022-01-21 12:46:07 -08:00
2955d7339e remove a debugging printf, fix whitespace/indentation, and add a comment re gethostbyname_r buffer size. 2022-01-21 13:00:22 -06:00
7a36d57e8f Merge pull request #4784 from SparkiDev/sp_int_modinv_perf
SP int: minor improvements to sp_invmod
2022-01-21 10:30:09 -08:00
869246609a Merge pull request #4772 from douzzer/20220118-clang-tidy
clang-tidy fixes/cleanups
2022-01-21 10:29:26 -08:00
4f9d0b7ea7 fix whitespace. 2022-01-21 01:26:44 -06:00
bfada558bd remove extraneous build gates and fix whitespace justification in a comment (peer review re PR #4772). 2022-01-21 01:26:44 -06:00
386aac9694 AES-SIV:
in configure.ac, enable SIV only if !ENABLED_FIPS or if building FIPS v5-dev;

in cmac.{c,h}, remove !HAVE_FIPS gating on ShiftAndXorRb().
2022-01-21 01:26:33 -06:00
84f7d812d3 linuxkm/module_exports.c.template: include siphash.h. 2022-01-21 01:25:48 -06:00
10b8f56fec wolfio.c: in wolfIO_TcpConnect(), test for usability of gethostbyname_r by (__GLIBC__ >= 2) && defined(__USE_MISC), not defined(__GNUC__). 2022-01-21 01:25:48 -06:00
5e33da8147 fix whitespace. 2022-01-21 01:25:48 -06:00
bb07d0a490 wolfio.c: refactor wolfIO_TcpConnect(() to use gethostbyname_r() if GNUC && !SINGLE_THREADED, for thread safety. 2022-01-21 01:25:48 -06:00
6a56d3e131 jumbo patch of fixes for clang-tidy gripes (with some bug fixes).
defect/gripe statistics:

    configured --enable-all --enable-sp-math-all --enable-intelasm

    with LLVM 13 clang-tidy -checks=readability-*,bugprone-*,misc-no-recursion,misc-misplaced-const,misc-redundant-expression,misc-unused-parameters,misc-unused-using-decls,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-optin.performance.Padding,-readability-braces-around-statements,-readability-function-size,-readability-function-cognitive-complexity,-bugprone-suspicious-include,-bugprone-easily-swappable-parameters,-readability-isolate-declaration,-readability-magic-numbers,-readability-else-after-return,-bugprone-reserved-identifier,-readability-suspicious-call-argument,-bugprone-suspicious-string-compare,-bugprone-branch-clone,-misc-redundant-expression,-readability-non-const-parameter,-readability-redundant-control-flow,-readability-misleading-indentation,-bugprone-narrowing-conversions,-bugprone-implicit-widening-of-multiplication-result

    [note these figures don't reflect additional defects fixed in this commit for --enable-smallstack, --enable-fips, --enable-async, --enable-asn=template, and --enable-fastmath, and --disable-fastmath]

    pre-patch warning count per file, with suppressions:

    clang-analyzer-security.insecureAPI.strcpy    6  wolfssl/tests/suites.c
    clang-analyzer-security.insecureAPI.strcpy    2  wolfssl/testsuite/testsuite.c
    bugprone-suspicious-missing-comma             3  wolfssl/examples/server/server.c
    bugprone-suspicious-missing-comma             3  wolfssl/examples/client/client.c
    readability-redundant-preprocessor            2  wolfssl/wolfcrypt/src/asn.c
    readability-redundant-preprocessor            1  wolfssl/wolfcrypt/src/rsa.c
    readability-redundant-preprocessor            9  wolfssl/src/ssl.c
    readability-redundant-preprocessor            2  wolfssl/src/tls13.c
    readability-redundant-preprocessor           18  wolfssl/tests/api.c
    readability-redundant-preprocessor            3  wolfssl/src/internal.c
    readability-redundant-preprocessor           10  wolfssl/wolfcrypt/test/test.c
    readability-named-parameter                   1  wolfssl/wolfcrypt/benchmark/benchmark.c
    readability-named-parameter                   7  wolfssl/src/internal.c
    readability-named-parameter                   1  wolfssl/wolfcrypt/src/ecc.c
    readability-named-parameter                   1  wolfssl/testsuite/testsuite.c
    readability-named-parameter                  11  wolfssl/wolfcrypt/src/ge_operations.c
    misc-no-recursion                             3  wolfssl/src/ssl.c
    readability-uppercase-literal-suffix          4  wolfssl/wolfcrypt/src/asn.c
    readability-uppercase-literal-suffix          1  wolfssl/src/ssl.c
    readability-uppercase-literal-suffix         13  wolfssl/wolfcrypt/benchmark/benchmark.c
    bugprone-too-small-loop-variable              1  wolfssl/wolfcrypt/src/rsa.c
    bugprone-too-small-loop-variable              2  wolfssl/wolfcrypt/src/sha3.c
    bugprone-too-small-loop-variable              4  wolfssl/wolfcrypt/src/idea.c
    bugprone-signed-char-misuse                   2  wolfssl/src/ssl.c
    bugprone-signed-char-misuse                   3  wolfssl/wolfcrypt/src/sp_int.c
    bugprone-signed-char-misuse                   3  wolfssl/examples/client/client.c
    bugprone-macro-parentheses                   19  wolfssl/wolfcrypt/src/aes.c
    bugprone-macro-parentheses                  109  wolfssl/wolfcrypt/src/camellia.c
    bugprone-macro-parentheses                    1  wolfssl/src/tls.c
    bugprone-macro-parentheses                    3  wolfssl/wolfcrypt/src/md4.c
    bugprone-macro-parentheses                    2  wolfssl/wolfcrypt/src/asn.c
    bugprone-macro-parentheses                   26  wolfssl/wolfcrypt/src/blake2b.c
    bugprone-macro-parentheses                  257  wolfssl/wolfcrypt/src/sha3.c
    bugprone-macro-parentheses                   15  wolfssl/src/ssl.c
    bugprone-macro-parentheses                    1  wolfssl/wolfcrypt/src/sha.c
    bugprone-macro-parentheses                    8  wolfssl/tests/api.c
    bugprone-macro-parentheses                    4  wolfssl/wolfcrypt/src/sp_int.c
    bugprone-macro-parentheses                    6  wolfssl/wolfcrypt/benchmark/benchmark.c
    bugprone-macro-parentheses                   38  wolfssl/wolfcrypt/src/hc128.c
    bugprone-macro-parentheses                   12  wolfssl/wolfcrypt/src/md5.c
    bugprone-macro-parentheses                   10  wolfssl/wolfcrypt/src/sha256.c
    bugprone-macro-parentheses                    4  wolfssl/wolfcrypt/test/test.c
    bugprone-macro-parentheses                    3  wolfssl/wolfcrypt/src/ecc.c
    bugprone-macro-parentheses                    2  wolfssl/tests/suites.c
    bugprone-macro-parentheses                    4  wolfssl/wolfcrypt/src/cpuid.c
    bugprone-macro-parentheses                   26  wolfssl/wolfcrypt/src/blake2s.c
    bugprone-macro-parentheses                   24  wolfssl/wolfcrypt/src/sha512.c
    bugprone-macro-parentheses                    3  wolfssl/wolfcrypt/src/poly1305.c
    bugprone-macro-parentheses                   24  wolfssl/wolfcrypt/src/ripemd.c
    readability-inconsistent-declaration-parameter-name    1  wolfssl/src/internal.c
    readability-inconsistent-declaration-parameter-name    1  wolfssl/testsuite/testsuite.c

    pre-patch warning count summaries, with suppressions:

    clang-analyzer-security.insecureAPI.strcpy                  8
    bugprone-suspicious-missing-comma                           6
    readability-redundant-preprocessor                         45
    readability-named-parameter                                21
    misc-no-recursion                                           3
    readability-uppercase-literal-suffix                       18
    bugprone-too-small-loop-variable                            7
    bugprone-signed-char-misuse                                 8
    bugprone-macro-parentheses                                601
    readability-inconsistent-declaration-parameter-name         2

    pre-patch warning count summaries, without suppressions:

    clang-analyzer-security.insecureAPI.strcpy                  8
    bugprone-branch-clone                                     152
    readability-non-const-parameter                           118
    bugprone-suspicious-missing-comma                           6
    bugprone-suspicious-include                                52
    readability-magic-numbers                               22423
    readability-redundant-preprocessor                         45
    readability-named-parameter                                21
    readability-function-cognitive-complexity                 845
    readability-else-after-return                             398
    bugprone-implicit-widening-of-multiplication-result       595
    readability-function-size                                  21
    readability-isolate-declaration                          1090
    misc-redundant-expression                                   2
    bugprone-narrowing-conversions                            994
    misc-no-recursion                                           3
    readability-uppercase-literal-suffix                       18
    bugprone-reserved-identifier                               56
    readability-suspicious-call-argument                       74
    bugprone-too-small-loop-variable                            7
    bugprone-easily-swappable-parameters                      437
    bugprone-signed-char-misuse                                 8
    readability-misleading-indentation                         94
    bugprone-macro-parentheses                                601
    readability-inconsistent-declaration-parameter-name         2
    bugprone-suspicious-string-compare                        495
    readability-redundant-control-flow                         20
    readability-braces-around-statements                    11483
    clang-analyzer-valist.Uninitialized                         1
    clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling   3502
2022-01-21 01:25:48 -06:00
b75fe633ad SP int: minor improvements to sp_invmod 2022-01-21 16:47:59 +10:00
8a2cab8702 SHA-512 ASM: For Mac computers default to using SHA512 instructions 2022-01-21 16:40:35 +10:00
30e9d2813e Merge pull request #4782 from haydenroche5/aes_siv_gpp
Fix AES-SIV test with g++.
2022-01-21 15:37:12 +10:00
888bd2b304 Fix AES-SIV test with g++.
The string initializers for the AES-SIV test vector fields needed an extra byte
for the null terminator expected by g++.
2022-01-20 19:22:25 -08:00
848f5eeb0c Merge pull request #4755 from dgarske/dtls_srtp
DTLS SRTP (RFC5764) support (adds `--enable-srtp`)
2022-01-21 10:43:47 +10:00
d1a23a3285 Merge pull request #4758 from kareem-wolfssl/asioOldTls
Fix building ASIO with Old TLS disabled.
2022-01-20 10:44:41 -08:00
427b67d51b Merge pull request #4756 from kareem-wolfssl/noBio
Fix building with OPENSSL_EXTRA and NO_BIO defined.
2022-01-20 10:41:22 -08:00
5ea23d389c Merge pull request #4778 from haydenroche5/chrony
Add --enable-chrony configure option.
2022-01-20 08:46:00 -08:00
40f573df72 dtls-srtp: NIT: fix EKM size in comments 2022-01-20 16:55:44 +01:00
46c0809f5a dtls-srtp: add script to test interop with OpenSSL 2022-01-20 16:55:44 +01:00
d5aa76b161 dtsl-srtp: use PRF according to the DTLS version used
RFC 5764 sec 4.1.2
2022-01-20 16:55:30 +01:00
cdb2936244 dtls-srtp: PRF: fix correct order of client/server random in seed
see RFC 5705 Section 4
2022-01-20 16:12:04 +01:00
231a0bbb84 dtls-srtp: no ekm cross check on single threaded/no pthread conf 2022-01-20 16:12:04 +01:00
1af3ea56c8 Cert: allow allocation of fields even with WOLFSSL_NO_MALLOC
subjectCN and publicKey in a DecodedCert are needed by the certificate
store in some cases. For embedded, allow them to be allocated even with
WOLFSSL_NO_MALLOC defined.
2022-01-20 16:16:09 +10:00
d728a7f0e6 Merge pull request #4777 from SparkiDev/sp_modinv_even_fix
SP int: fix rework of sp_invmod
2022-01-19 20:32:48 -08:00
a05b1b012f Add --enable-chrony configure option.
This turns on the necessary features for using the chrony NTP package with
wolfSSL.
2022-01-19 19:13:34 -08:00
95efdccd7f Merge pull request #4751 from SparkiDev/sp_int_thumb_asm
SP int: ARM Thumb asm snippets
2022-01-19 18:52:02 -08:00
609d6442b1 Merge pull request #4753 from SparkiDev/siphash
Add SipHash algorithm
2022-01-19 18:51:44 -08:00
fcce4f7a92 Merge pull request #4765 from haydenroche5/aes_siv
Add AES-SIV (RFC 5297).
2022-01-19 18:51:12 -08:00
29513e1ec8 include hmac for deterministic ecc sign build 2022-01-20 09:25:32 +07:00
b767857abb SP int: fix rework of sp_invmod
Simplify code and check for m mod a == 0 which means there is no
inverse.
2022-01-20 10:37:31 +10:00
a6485a228d Add SipHash algorithm 2022-01-20 09:41:18 +10:00
a1185adf2c SP int: ARM Thumb asm snippets 2022-01-20 09:16:45 +10:00
62b07d8806 Add AES-SIV (RFC 5297).
This commit adds functions to encrypt and decrypt data using AES in SIV mode, as
described in RFC 5297. This was added in the process of porting chrony to
wolfSSL. chrony is an NTP implementation that can use NTS (network time
security), which requires AES-SIV.
2022-01-19 14:32:33 -08:00
d668037541 Merge pull request #4746 from elms/gh/templates
github: Initial templates
2022-01-19 14:04:21 -08:00
c6fdb34daa cmake: enable ASM and fix thread with usersettings
* Assembly files were not being compiled.
* With When `-DWOLFSSL_USER_SETTINGS` `HAVE_PTHREAD` was not
  propagating to `config.h`
2022-01-19 13:34:25 -08:00
7adbf59f22 Merge pull request #4767 from anhu/kill_hc128
Get rid of HC-128
2022-01-19 12:20:18 -08:00
c5d3581ac2 Merge pull request #4771 from SparkiDev/sp_c_mont_red
SP C: fix corner case of P256 and P384 mont red
2022-01-19 11:32:49 -08:00
0175013604 Merge pull request #4770 from anhu/cve
CVE-2022-23408
2022-01-19 11:31:24 -08:00
0f50ffb2ef github: Initial templates 2022-01-19 10:36:01 -08:00
8e0ece920b Test cleanups. Fix possible leak in TLSX_UseSRTP. 2022-01-19 09:22:02 -08:00
af71aec77e Mention removal of HC-128 in README.md 2022-01-19 09:49:25 -05:00
86ba0ef643 tests: support test for SRTP
the test will check that the same Exported Keying Material is generated between
client and server
2022-01-19 13:35:29 +01:00
9b69f693e4 dtls-srtp: check that length of strings matched before memcomparing
otherwise if profile_str_len is > strlen(gSrtpProfiles[i].name) we end up
comparing memory past gSrtpProfiles[i].name. -fsanitize=address catches this:

```
==100159==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f40d8d533b2 at pc 0x7f40d8eb014f bp 0x7f40d50fe240 sp 0x7f40d50fd9e8
READ of size 21 at 0x7f40d8d533b2 thread T107
    #0 0x7f40d8eb014e in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860
    #1 0x7f40d8eb06e6 in __interceptor_memcmp /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:892
    #2 0x7f40d8eb06e6 in __interceptor_memcmp /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:887
    #3 0x7f40d8c2e830 in DtlsSrtpFindProfile src/ssl.c:1310
    #4 0x7f40d8c2e9ed in DtlsSrtpSelProfiles src/ssl.c:1347
    #5 0x7f40d8c2eada in wolfSSL_CTX_set_tlsext_use_srtp src/ssl.c:1359
    #6 0x563bf381b4c5 in server_test examples/server/server.c:2278
    #7 0x7f40d88f0258 in start_thread (/usr/lib/libpthread.so.0+0x9258)
    #8 0x7f40d88195e2 in __GI___clone (/usr/lib/libc.so.6+0xfe5e2)
```
2022-01-19 13:14:58 +01:00
c06ba390cd SP C: fix corner case of P256 and P384 mont red 2022-01-19 14:22:04 +10:00
4c05d35452 Merge pull request #4743 from miyazakh/tls_bench_onlymode 2022-01-18 15:41:48 -07:00
2984cb5abf Merge pull request #4768 from SparkiDev/sp_invmod_nr
SP math: sp_invmod changed to not call itself
2022-01-18 16:20:37 -06:00
65d1d32972 Merge pull request #4769 from SparkiDev/sp_mont_red_neg
SP math neg: Mont Reduce fix
2022-01-18 14:12:09 -08:00
884b8634af CVE-2022-23408 2022-01-18 16:06:08 -05:00
e6466f92b7 Counting properly 2022-01-18 15:41:16 -05:00
ff128c07a1 Remove extra references to Guid no longer required. Note that other count gaps exist so this should be fine. 2022-01-18 15:23:08 -05:00
ba589955f7 Improve the DTLS SRTP client side parsing. 2022-01-18 11:23:13 -08:00
e745de657f Merge pull request #4761 from haydenroche5/time_cb
Add time callback functionality.
2022-01-18 16:49:19 +10:00
53a4903e2f SP math neg: Mont Reduce fix
Compare the absolute value for negatives.
2022-01-18 16:22:38 +10:00
e11d484746 Merge pull request #4752 from LinuxJedi/fix-ber-der
Fix buffer overflows in BERtoDER
2022-01-17 21:05:39 -07:00
84b06ac1b6 Merge pull request #4730 from embhorn/zd13475
Document wc_AesCfbEncrypt and wc_AesCfbDecrypt
2022-01-17 19:45:45 -07:00
1b0926a3b8 Add time callback functionality.
This commit adds `wolfSSL_SetTimeCb` and `wolfSSL_time`. The former allows the
user to override the function wolfSSL uses to get the current time,
`wolfSSL_time`. If set, `wolfSSL_time` uses that function. If not set,
`wolfSSL_time` uses the `XTIME` macro by default. This functionality is needed
for the port of chrony to wolfSSL. chrony is an NTP implementation that uses
GnuTLS by default. For TLS, chrony uses the time it computes in place of the
default system time function.
2022-01-17 17:49:51 -08:00
fc861f3d6d SP math: sp_invmod changed to not call itself
When the modulus is even, calculate m^-1 mod a instead and fixup after.
Don't call self to do inverse.
2022-01-18 10:45:57 +10:00
f3f5b0f53b Peer review fixes. Improve profile not found handling or errors. Improve inline function. 2022-01-17 15:52:40 -08:00
c2860cb311 Get rid of HC-128 2022-01-17 18:11:54 -05:00
ec44747029 Merge pull request #4764 from SparkiDev/evp_cbn_casecmp
wolfSSL_EVP_get_cipherbyname: case compare
2022-01-17 14:11:07 -08:00
d38c5003d0 Merge pull request #4762 from ejohnstown/old-gcc
Old Compiler Warning Cleanup (GCC 4.0.2)
2022-01-17 09:44:44 -08:00
989a4f096e Merge pull request #4728 from miyazakh/sce_aes128_cryonly 2022-01-17 10:28:57 -07:00
e953707258 Merge pull request #4754 from miyazakh/update_espidfport 2022-01-17 10:27:28 -07:00
6197853f37 Document wc_AesCfbEncrypt and wc_AesCfbDecrypt 2022-01-17 11:27:19 -06:00
d06cf97d73 Old Compiler Warning Cleanup (GCC 4.0.2)
test.c:
1. Removed pragma disabling the warning for unused functions.
2. Fixed the guards around the function that wasn't getting removed from
   the build. And matched the guards to the call of the function. The
   issue is a test that fails only in a cert 3389 build using Arm
   assembly single-precision public keys.
3. Fixed the guards around a couple other functions.
2022-01-16 22:08:35 -08:00
1b5d0c75b8 wolfSSL_EVP_get_cipherbyname: case compare
Accept any case alternatives to name or alias.
Remove case only different aliases.
Tidy up formatting in function.
2022-01-17 09:39:16 +10:00
b68b14b499 Merge pull request #4724 from embhorn/zd13462
Improve param checks of enc
2022-01-16 15:35:54 -08:00
815527be6b Merge pull request #4745 from SparkiDev/m1_sha512
Aarch64 SHA512: fixup to work on Apple M1
2022-01-16 15:29:01 -08:00
15f501358d Merge pull request #4716 from julek-wolfssl/issue-4592
Verification: Domain check should only be performed on leaf certs
2022-01-17 08:40:14 +10:00
001469589b Old Compiler Warning Cleanup (GCC 4.0.2)
Fixed a lot of shadowed global values. Some were prototype and function
declaration parameter name conflicts. Some conflicted with typenames.
Some conflicted with globals in libc.
2022-01-14 17:43:21 -08:00
5ddf4392df Old Compiler Warning Cleanup (GCC 4.0.2)
pwdbased.c: Simplified some arithmetic to fix a variable promotion
warning.
2022-01-14 17:36:12 -08:00
2cf21a3f69 Old Compiler Warning Cleanup (GCC 4.0.2)
ecc.c,api.c: Initialize some variables to fix warning for possible
uninitialized variable use.
2022-01-14 17:33:49 -08:00
e724622506 Old Compiler Warning Cleanup (GCC 4.0.2)
ge_operations.c: Added the keyword `inline` to several function
prototypes for functions declared `inline`.
2022-01-14 17:19:01 -08:00
2085624a29 Old Compiler Warning Cleanup (GCC 4.0.2)
1. Removed pragma disabling the warning for non-literal format strings
on `printf()`.
2. Switched the `printf()` into two printf calls.
2022-01-14 17:11:55 -08:00
153b9abc31 Old Compiler Warning Cleanup (GCC 4.0.2)
ssl.c: Fix a couple of checks on hashType enum that were using a `< 0`
for the lower bound on an unsigned.
2022-01-14 16:32:18 -08:00
021f9171c5 Fix building ASIO with Old TLS disabled. 2022-01-14 15:00:02 -07:00
eade8ecdf1 DTLS SRTP improvements. Added support for client to send list of profiles. Added support for more SRTP profiles. 2022-01-14 13:43:29 -08:00
1ed152daeb Fix building with OPENSSL_EXTRA and NO_BIO defined. 2022-01-14 11:19:01 -07:00
31e84d82b8 Domain check should only be performed on leaf certs
- Refactor `*_set_verify` functions into common logic
- NULL protect `wolfSSL_X509_VERIFY_PARAM_set1_host` and add debug info
2022-01-14 18:16:42 +01:00
6ccbd8776f DTLS SRTP (RFC5764) support (adds --enable-srtp). Used with WebRTC to agree on profile for new real-time session keys. 2022-01-14 07:35:45 -08:00
a33d901409 update ESP-IDF port to fix failure 2022-01-14 15:35:28 +09:00
f81e15f342 Merge pull request #4750 from SparkiDev/etm-disable
TLS EncryptThenMac; fix when extension response sent
2022-01-13 13:33:57 -08:00
8d7059497e Merge pull request #4742 from elms/fix/secure_renegotiate_compat
TLS: Default secure renegotiation compatibility
2022-01-13 10:23:27 -08:00
1a4bc322f7 Fix buffer overflow in PKCS7_VerifySignedData
wc_PKCS7_AddDataToStream() was called the first time prior to BERtoDER
conversion, subsequent times afterwards which meant the stream idx
pointer was incorrect. This patch restarts the stream after conversion.

Fixes ZD13476
2022-01-13 14:49:31 +00:00
92d01611ff Fix buffer overflow in GetOID
When converting BER to DER we switched the pointer for pkiMsg to the DER
but not the size which could cause buffer overflow.

Fixes ZD13471
2022-01-13 13:26:32 +00:00
70b169e3f2 TLS EncryptThenMac; fix when extension response sent
Only respond with the extension when negotiated a block cipher.
2022-01-13 12:46:21 +10:00
ba579753ba Merge pull request #4749 from ejohnstown/vpath-fix 2022-01-12 17:06:37 -08:00
15c5ac880e PKCS7 Test Output
When running the test with PKCS7 enabled, there's an additional option
that will save to disk the generated PKCS7 blobs for by-hand review.
(PKCS7_OUTPUT_TEST_BUNDLES) Fixed a couple compile errors that were
missed with that option enabled.
2022-01-12 14:51:11 -08:00
33f0e2eda5 In the wolfCrypt test, fix a few filenames to use the VPATH versions. 2022-01-12 14:50:43 -08:00
0acf8d0e75 Merge pull request #4732 from embhorn/zd13375
SP int, TFM: Init vars for static analysis
2022-01-13 07:06:19 +10:00
3ddfb0f189 Aarch64 SHA512: fixup to work on Apple M1
Directive needed on Apple to indicate SHA3 extensions available.
Fixup C file as well - remove unused constants not avaiable and
prototype function that is extern elsewhere.
2022-01-12 12:56:39 +10:00
336e595ebb Remove some lingering oldname return values 2022-01-11 17:09:52 -08:00
723cfb2d0b make server/client only work 2022-01-12 09:23:23 +09:00
efe2cea8d1 TLS: Default secure renegotiation compatability
By default this change will have servers send the renegotiation info
extension, but not allow renegotiation. This is accordance with RFC 5746

From to RFC 5746:
> In order to enable clients to probe, even servers that do not support
> renegotiation MUST implement the minimal version of the extension
> described in this document for initial handshakes, thus signaling
> that they have been upgraded.

With openSSL 3.0 the default it not allow connections to servers
without secure renegotiation extension. See
https://github.com/openssl/openssl/pull/15127
2022-01-11 15:56:35 -08:00
abc9b7197d Merge pull request #4676 from ThalesGroup/iotsafe-hkdf-extract
Iotsafe hkdf extract
2022-01-11 07:37:30 -08:00
f0f65f41b7 addressed review comments 2022-01-11 19:53:54 +09:00
c7b0b7003e Merge pull request #4700 from dgarske/pkcs11_id
Improved the PKCS11 init to support slotId or tokenName
2022-01-11 14:25:37 +10:00
30777bb5ee nit minor changes 2022-01-11 10:08:52 +08:00
9a4981a5a8 Improved the PKCS11 init to support slotId or tokenName. Adds new wc_Pkcs11Token_InitName and alters existing wc_Pkcs11Token_Init to allow NULL tokenName. ZD13348 2022-01-10 16:53:01 -08:00
5910ada93d Merge pull request #4736 from douzzer/20220107-cppcheck-hygiene
cppcheck sweep
2022-01-10 12:52:22 -08:00
6a02826bbf Merge pull request #4740 from dgarske/sess_names_docs
Session doc and naming cleanups
2022-01-10 14:38:47 -06:00
5392190807 Merge pull request #4741 from danielinux/psoc6-sha512-fix
PsoC6 hw crypto: added missing wc_InitSha512_ex()
2022-01-10 12:32:13 -08:00
814e7c91e0 PsoC6 hw crypto: added missing wc_InitSha512_ex() 2022-01-10 18:30:53 +01:00
f72d198778 Merge pull request #4723 from dgarske/se050 2022-01-10 10:11:49 -07:00
43bbc5d2e5 Merge pull request #4738 from SparkiDev/sp_int_div_arm_2
SP int: ARM64/32 sp_div_word changes
2022-01-10 07:58:28 -08:00
6ce248e2f9 Improve documentation for wolfSSL_get1_session. Add wolfSSL specific naming on the internal session functions to avoid possible user conflicts. ZD13363 and ZD13487. 2022-01-10 07:47:19 -08:00
5cce1926bb Init vars for static analysis 2022-01-10 08:24:29 -06:00
6398087d5b SP int: ARM64/32 sp_div_word changes
Fixup up formatting.
Fix comments.
Aarch64: don't use variable r when hi can be used.
ARM 32-bit: Add a version that uses udiv - not available on all chips
and can be slower anyway.
2022-01-10 16:27:39 +10:00
1a291870a3 minor fixes 2022-01-10 10:28:14 +08:00
4bbf90d604 Merge pull request #4702 from SparkiDev/sp_int_div_arm
SP int: transplant the div_word from SP into SP int for ARM64 and ARM32
2022-01-09 17:54:39 -08:00
355b5821b2 WOLFSSL_SESSION_EXPORT: fixes for scan-build complaints (deadcode.DeadStores) building --enable-all --enable-sessionexport. 2022-01-08 11:43:56 -06:00
c50964cc35 src/internal.c: fix flubbed edit in wolfSSL_session_import_internal(). 2022-01-08 11:08:57 -06:00
49fc54ef1f linuxkm/linuxkm_wc_port.h: move XMALLOC/XREALLOC/XFREE definitions outside BUILDING_WOLFSSL gate as-was, for back-compat. 2022-01-08 02:41:02 -06:00
56c28ff307 src/ssl.c: in wolfSSL_SESSION_has_ticket(), add (void)sess if !defined(HAVE_SESSION_TICKET), to fix -Wunused-parameter. 2022-01-08 02:39:50 -06:00
ff0eb5a41e wolfcrypt/test/test.c: in wolfcrypt_test(), tweak formatting of CheckRunTimeSettings() to resolve invalidPrintfArgType_uint from cppcheck --force. 2022-01-08 01:35:46 -06:00
a4444e6c3e wolfcrypt/test/test.c: in rsa_oaep_padding_test(), remove accidentally repeated MEMORY_E check. 2022-01-08 01:10:02 -06:00
7341b54a20 wolfssl/wolfcrypt/tfm.h: fixes for cppcheck complaints: preprocessorErrorDirective[division/modulo by zero] 2022-01-08 00:34:33 -06:00
cb86da71fa wolfssl/wolfcrypt/ecc.h: fixes for cppcheck complaints: preprocessorErrorDirective[division/modulo by zero] 2022-01-08 00:34:22 -06:00
fdb6a2d87d wolfssl/test.h: fixes for cppcheck complaints: nullPointerRedundantCheck invalidScanfArgType_int 2022-01-08 00:34:09 -06:00
29fcbb0b19 wolfcrypt/test/test.c: fixes for cppcheck complaints: memleakOnRealloc nullPointerRedundantCheck uninitvar invalidPrintfArgType_uint 2022-01-08 00:33:54 -06:00
70ab36f81c wolfcrypt/src/wc_port.c: fixes for cppcheck complaints: uninitvar nullPointer 2022-01-08 00:33:33 -06:00
8aa1100508 wolfcrypt/src/wc_pkcs11.c: fixes for cppcheck complaints: uninitvar 2022-01-08 00:32:48 -06:00
71b0b89e95 wolfcrypt/src/srp.c: fixes for cppcheck complaints: identicalInnerCondition 2022-01-08 00:32:37 -06:00
82b508b917 wolfcrypt/src/sha512.c: fixes for cppcheck complaints: nullPointerRedundantCheck 2022-01-08 00:32:26 -06:00
6e763825ed wolfcrypt/src/sha.c: fixes for cppcheck complaints: bufferAccessOutOfBounds 2022-01-08 00:32:14 -06:00
094d89bfb9 wolfcrypt/src/rsa.c: fixes for cppcheck complaints: identicalInnerCondition 2022-01-08 00:32:03 -06:00
24bb007d3c wolfcrypt/src/random.c: fixes for cppcheck complaints: uninitvar 2022-01-08 00:31:51 -06:00
1488e28ea3 wolfcrypt/src/port/ti/ti-aes.c: fixes for cppcheck complaints: missingReturn[false positive] 2022-01-08 00:31:36 -06:00
9e76ec8855 wolfcrypt/src/pkcs7.c: fixes for cppcheck complaints: nullPointerArithmeticRedundantCheck 2022-01-08 00:31:07 -06:00
dc98f4dd30 wolfcrypt/src/pkcs12.c: fixes for cppcheck complaints: uselessAssignmentPtrArg 2022-01-08 00:30:52 -06:00
67de528d91 wolfcrypt/src/logging.c: fixes for cppcheck complaints: invalidPrintfArgType_sint 2022-01-08 00:30:32 -06:00
f126e6add5 wolfcrypt/src/integer.c: fixes for cppcheck complaints: nullPointerRedundantCheck[false positive; added suppression] 2022-01-08 00:30:20 -06:00
1eb5537e34 wolfcrypt/src/fe_low_mem.c: fixes for cppcheck complaints: funcArgOrderDifferent 2022-01-08 00:30:00 -06:00
d4aa6bd1fc wolfcrypt/src/evp.c: fixes for cppcheck complaints: bufferAccessOutOfBounds nullPointerRedundantCheck 2022-01-08 00:29:47 -06:00
c557a74953 wolfcrypt/src/ecc.c: fixes for cppcheck complaints: invalidPrintfArgType_sint identicalInnerCondition 2022-01-08 00:29:35 -06:00
d36a1be74b wolfcrypt/src/dh.c: fixes for cppcheck complaints: identicalInnerCondition 2022-01-08 00:29:18 -06:00
11f72877a2 wolfcrypt/src/asn.c: fixes for cppcheck complaints: invalidPrintfArgType_uint nullPointerRedundantCheck 2022-01-08 00:29:09 -06:00
8ba6027073 src/wolfio.c: fixes for cppcheck complaints: nullPointer uninitvar 2022-01-08 00:28:35 -06:00
bb727d2ef2 src/ssl.c: fixes for cppcheck complaints: uselessAssignmentPtrArg autoVariables[not a defect; added suppression] invalidPrintfArgType_sint nullPointerRedundantCheck pointerSize 2022-01-08 00:28:09 -06:00
4d3dfc451d src/sniffer.c: fixes for cppcheck complaints: negativeIndex 2022-01-08 00:27:59 -06:00
b69dc00bd7 src/internal.c: fixes for cppcheck complaints: nullPointerRedundantCheck uninitvar 2022-01-08 00:27:47 -06:00
ff4c6e5d7b linuxkm: relocate WOLFSSL_LINUXKM code in wolfssl/wolfcrypt/wc_port.h and wolfcrypt/src/memory.c to linuxkm/{linuxkm_wc_port.h,linuxkm_memory.c}, and gate SIMD in IRQ handlers on -DLINUXKM_SIMD_IRQ in prep for Linux 5.16;
linuxkm: when -DWOLFCRYPT_ONLY, don't include ssl.h in module_exports.c.template and module_hooks.c, and fix gating to work right with that;

wolfssl/wolfcrypt/types.h: add support for a WOLFSSL_XFREE_NO_NULLNESS_CHECK gate (used in cppcheck analysis).
2022-01-07 22:39:38 -06:00
a14982b079 configure.ac: add ENABLED_WPAS to the config summary. 2022-01-07 21:36:24 -06:00
b4da751076 Fixes for SE050 Ed25519/Curve25519. 2022-01-07 12:54:54 -08:00
bbc9bc5e2c wolfcrypt/src/port/kcapi/kcapi_hmac.c: fix memory leak in wc_HmacSetKey() (fixes #4731). 2022-01-07 12:40:31 -06:00
b97894c617 Merge pull request #4729 from anhu/STM32U575xx
Add support for STM32U575xx boards.
2022-01-06 16:34:28 -08:00
f3e1e8c155 Add support for STM32U575xx boards. 2022-01-06 15:40:45 -05:00
d21105b3ca Merge pull request #4725 from elms/cmake/min_ver_3.16
cmake: Increase minimum version to 3.16 and fix HomeBrew build
2022-01-06 08:09:44 -08:00
f74831a7da Improve param checks of enc 2022-01-06 09:12:18 -06:00
0e6ba492e5 update signed ca
fix aes128-gcm crypt only usecase
2022-01-06 15:18:16 +09:00
252e2b6a99 Merge pull request #4726 from ejohnstown/typos
Fix a couple typos in asn.c
2022-01-05 14:51:50 -08:00
1e903a20a5 Merge pull request #4722 from dgarske/minor 2022-01-05 15:03:44 -05:00
32223b9c3a Merge pull request #4697 from LinuxJedi/isotp
Add ISO-TP support to wolfio
2022-01-05 10:34:43 -08:00
66ade8006b Fix a couple typos in asn.c 2022-01-05 10:24:25 -08:00
cc2b69573c cmake: Increase minimum version to 3.16 and fix HomeBrew build
Increasing cmake version required to allow use of more recent
additions in the future.

Reported issue is that Homebrew use different compiler than AppleClang
(from XCode). Correctly test for AppleClang to set xcode specific `ar`
and `ranlib` flags. It may also be appropraite to use for ANDROID as
well see
7d057b2738 (diff-6f7a068f87ca22bd0105fef2143b0960e4993854863fd20c9416c677ee33a737R61-R67)
2022-01-05 09:29:27 -08:00
e847bf7301 ISO-TP buffer fixes
* Flow control failed on wrap around when there is going to be no more
  flow control packets.
* If ISOTP_Send is provided more than 4095 bytes, limit it to 4095 bytes
  as wolfSSL will retry with the rest.
* Set the default receive size to the max ISO-TP data size.
* A few other cleanups.
2022-01-05 11:37:15 +00:00
84df7a50dc Minor build warning fixes. Possible benchmark unused bench_pq_asym_algs. Fix if RSA enabled and WOLFSSL_SP_MATH set and WOLFSSL_HAVE_SP_RSA is not. 2022-01-04 15:38:35 -08:00
96e1f77c32 Adds compatibility FIPS DRBG API's and test cases. 2022-01-04 15:13:06 -08:00
35847c1371 Merge pull request #4717 from embhorn/zd13452
Fix heap-buffer-overflow in GetBerHeader
2022-01-04 16:11:03 -07:00
be69412e27 Merge pull request #4682 from JacobBarthelmeh/qnx
add check on mutex lock return value with qnx CAAM
2022-01-04 14:36:40 -08:00
db1bb9ea6a Merge pull request #4694 from anhu/with-curl
Add a --enable-curl build option
2022-01-04 13:39:07 -08:00
cf29badd52 Merge pull request #4721 from anhu/lighty
lighttpd requires WOLFSSL_KEY_GEN…
2022-01-04 12:37:41 -08:00
038a9d8fa9 lighttpd requires WOLFSSL_KEY_GEN. Without it, a call to wolfSSL_CTX_use_PrivateKey fails. 2022-01-04 13:09:13 -05:00
58d8f52107 Merge pull request #4719 from JacobBarthelmeh/release
bump version for dev and update year in readme
2022-01-04 08:40:06 -08:00
247cbdeef7 Cleanups for ISO-TP in wolfio
* Add Doxygen comments
* Make ISOTP_Send, ISOTP_Receive and wolfSSL_SetIO_ISOTP safer
* Reorder isotp_wolfssl_ctx
* Other minor cleanups
2022-01-04 12:57:11 +00:00
12d3f94c98 update build and update NULL salt usecase 2022-01-04 13:18:39 +08:00
7dd50a1beb bump version for dev and update year in readme 2022-01-03 16:02:10 -07:00
3134bd2e71 Fix heap-buffer-overflow in GetBerHeader 2022-01-03 14:51:47 -06:00
a0b9e2bead Merge pull request #4715 from JacobBarthelmeh/release
update README for release v5.1.1
2022-01-03 10:51:51 -08:00
5f16a826dd update README for release v5.1.1 2022-01-03 09:39:16 -07:00
70ca57790c Merge pull request #4713 from ejohnstown/fips-RC12
FIPS RC12
2021-12-30 17:16:03 -08:00
68e58bb321 Update configure and fips-check.sh for FIPS RC12. 2021-12-30 15:21:44 -08:00
7ad7821193 Merge pull request #4712 from rizlik/aes_free_fix
Fix potential resources leaks
2021-12-30 13:57:04 -08:00
ea5374c62d wolfcrypt: aes: gcm: streaming api: add missing wc_AesFree() 2021-12-30 20:33:23 +01:00
4907696ed4 wolfssl: keys: add missing wc_AesFree() when setting new keys 2021-12-30 20:30:36 +01:00
2679c386ae wolfcrypt: wc_encrypt: add missing wc_AesFree() 2021-12-30 20:30:36 +01:00
933065d696 wolfcrypt: cmac: add missing wc_AesFree() 2021-12-30 20:30:36 +01:00
7edc916057 wolfcrypt/wolfssl: tests: adding missing wc_Aes*Free()
In some Aes implementation this may leak resources
2021-12-30 20:30:33 +01:00
67b27f64d0 Merge pull request #4708 from dgarske/async_v5.1.0
Fixes for wolfSSL Async v5.1.0
2021-12-29 13:30:41 -07:00
ff68ab8eea Merge pull request #4707 from JacobBarthelmeh/release
bump version by .1 for developing on
2021-12-29 12:09:43 -08:00
c4f51931c9 Merge pull request #4710 from JacobBarthelmeh/sessionExport
fix for location of xmemset
2021-12-29 11:52:08 -08:00
69733e87c5 SNI and ALT_CERT_CHAINS 2021-12-29 12:50:50 -05:00
73b4cc9476 fix for location of xmemset 2021-12-29 10:48:06 -07:00
bc6690c584 Merge pull request #4709 from miyazakh/Update_fspv3p5_RA6M3 2021-12-29 09:10:18 -07:00
d11e88298a Add Make file and fix identation 2021-12-29 11:45:32 +08:00
4fc2891d5a Merge branch 'wolfSSL:master' into iotsafe-hkdf-extract 2021-12-29 11:15:13 +08:00
f5df363cdd remove configure.xml from include.am 2021-12-29 11:16:14 +09:00
1d107d0403 update RA6M3 projects to the latest e2studio and FSP v3.5.0 2021-12-29 11:06:48 +09:00
930cad649e Fix to resolve possible memory leak with DSA wc_DsaPublicKeyDecode in API unit test when used with HAVE_WOLF_BIGINT. 2021-12-28 16:34:54 -08:00
0f9550d80a increase version for rpm build 2021-12-28 15:35:14 -08:00
616026880e bump version by .1 for dev 2021-12-28 16:25:05 -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
7c2a2229c5 Use XMEMCPY and defined constannts for ISOTP 2021-12-24 11:56:16 +00: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
80a4793201 SP int: transplant the div_word from SP into SP int for ARM64 and ARM32 2021-12-24 12:26:19 +10: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
8eea17d92a More stuff, probably not complete yet 2021-12-23 17:28:24 -05: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
bb8d38c2a1 Add ISO-TP support to wolfio
ISO-TP is a commonly used simple transport layer for CAN bus which
allows larger than the 1-8 bytes payload than the CAN bus protocol
allows.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fixed unit test

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

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

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

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

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

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

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

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

add missing project file

update project

update dist include

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

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

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

add project info

adjust wolfssl library template

change TRNG collection

fix include.am

fix argument for TRNG

rename example templates

comment out DEBUG_WOLFSSL

change include.am

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

fix for release mode build

add in threading protection and seperate out rng

added callback function and updates to README

update default handle to lock, and add finished handle call

cleanup after veiwing diff of changes
2019-12-23 14:17:58 -07:00
5348ecb1f2 initial makefile and build with hexagon 2019-12-23 13:49:06 -07:00
ca59bc2d16 big endian changes 2019-12-23 12:33:59 -07:00
99a7aff31e Increment pkey references count 2019-12-20 22:38:54 -08:00
48e59eaeb1 Free EVP ctx pkey 2019-12-20 22:38:54 -08:00
9d94b48056 Add blinding of mod inverse to RSA key gen 2019-12-20 12:17:42 +10:00
6c7e86f366 Maintentance: DTLS
1. Client wasn't skipping a handshake state when the server sends a
hello without a hello verify. It ended up resetting the handshake hash
and resending Hello with its next messages.
2019-12-19 11:48:05 -08:00
22f0b145d3 Various cleanups and fixes:
* Fix for key gen macro name in benchmark.c
* Fix for possible RSA fall-through warning.
* Fix for building `WOLFSSL_STM32_PKA` without `HAVE_ECC`.
* Added option to build RSA keygen without the DER to PEM using `WOLFSSL_NO_DER_TO_PEM`.
* Added options.h includes for test.c and benchmark.c.
* Added printf warning on the math size mismatch in test.c.
* Added support for benchmarking larger sizes.
* TLS benchmarks for HiFive unleashed.
2019-12-18 07:09:26 -08:00
69a0c1155f Review comment 2019-12-17 17:36:38 -08:00
5711d12364 Remove SSL_library_init() calls in unit tests to fix valgrind issues 2019-12-17 15:54:10 -07:00
c66ca1b774 Remove unused dNSName malloc from wolfSSL_X509_get_ext_d2i 2019-12-10 17:00:16 -07:00
b08d180bc9 WOLFSSL_DH redefined error fix 2019-12-09 16:13:18 -07:00
4511557f01 More jenkins test fixes 2019-12-09 15:57:53 -07:00
9ad970d8a4 Fixes for jenkins test failures 2019-12-09 14:04:52 -07:00
ee13dfd878 Add Qt 5.12 and 5.13 support
Co-Authored-By: aaronjense <aaron@wolfssl.com>
Co-Authored-By: MJSPollard <mpollard@wolfssl.com>
Co-Authored-By: Quinn Miller <quinnmiller1997@users.noreply.github.com>
Co-Authored-By: Tim Parrish <timparrish@users.noreply.github.com>
2019-12-06 14:27:01 -07:00
2528121925 Fix RSA public key only builds
Client side only and no client auth
2019-12-06 20:42:27 +10:00
4f8a37ef7b Remove wc_RsaSSL_VerifyInline from Cryptocell 2019-12-05 10:40:21 -08:00
889f111454 Update CC readme 2019-12-02 14:55:21 -08:00
996cef6db2 Added stdio.h include to types.h. 2019-07-10 18:26:43 +02:00
2575 changed files with 1828402 additions and 376840 deletions

40
.cyignore Normal file
View File

@ -0,0 +1,40 @@
# wolfSSL folders
$(SEARCH_wolfssl)/IDE
$(SEARCH_wolfssl)/examples
$(SEARCH_wolfssl)/linuxkm
$(SEARCH_wolfssl)/mcapi
$(SEARCH_wolfssl)/mplabx
$(SEARCH_wolfssl)/mqx
$(SEARCH_wolfssl)/tirtos
$(SEARCH_wolfssl)/tests
$(SEARCH_wolfssl)/testsuite
$(SEARCH_wolfssl)/wolfcrypt/src/port/autosar
$(SEARCH_wolfssl)/zephyr
# wolfSSL files
$(SEARCH_wolfssl)/wolfcrypt/src/aes_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/aes_xts_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/aes_gcm_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/aes_gcm_x86_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/chacha_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/fe_x25519_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/poly1305_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/sha256_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/sha512_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/sha3_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/sm3_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/sp_x86_64_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/sp_sm2_x86_64_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/wc_kyber_asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-aes-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-curve25519.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-sha256-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-32-sha512-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-curve25519.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-sha3-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/armv8-sha512-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-aes-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-curve25519.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-sha256-asm.S
$(SEARCH_wolfssl)/wolfcrypt/src/port/arm/thumb2-sha512-asm.S

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

58
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@ -0,0 +1,58 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: >
Thanks for reporting an bug. If you would prefer a private method,
please email support@wolfssl.com
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. email@example.com
validations:
required: false
- type: input
id: version
attributes:
label: Version
description: What version were you using?
validations:
required: true
- type: textarea
id: details
attributes:
label: Description
description: |
Describe the issue in detail
Please include:
* Specific `./configure` options or `user_settings.h`
* Target and build environment
placeholder: |
Blinded by the light!
Code runs too fast. It's gone plaid!
...
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Reproduction steps
description: If possible please give instructions on how to reproduce.
placeholder: |
1. `./configure --enable-42`
2. `make question`
3.
...
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

28
.github/ISSUE_TEMPLATE/other.yaml vendored Normal file
View File

@ -0,0 +1,28 @@
name: General Issue
description: Request support with an issue
labels: ["triage"]
body:
- type: markdown
attributes:
value: >
Thanks for reporting an issue. If you would prefer a private method,
please email support@wolfssl.com
- type: input
id: version
attributes:
label: Version
description: What version were you using?
validations:
required: true
- type: textarea
id: details
attributes:
label: Description
description: |
Describe the issue in detail.
Please include specific configuration options or user_settings.h
placeholder: |
`./configure --enable-world-domination` fails
...
validations:
required: true

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,16 @@
# Description
Please describe the scope of the fix or feature addition.
Fixes zd#
# Testing
How did you test?
# Checklist
- [ ] added tests
- [ ] updated/added doxygen
- [ ] updated appropriate READMEs
- [ ] Updated manual and documentation

12
.github/SECURITY.md vendored Normal file
View File

@ -0,0 +1,12 @@
# Security Policy
## Reporting a Vulnerability
If you discover a vulnerability, please report it to support@wolfssl.com
1. Include a detailed description
2. Include method to reproduce and/or method of discovery
3. We will evaluate the report promptly and respond to you with findings.
4. We will credit you with the report if you would like.
**Please keep the vulnerability private** until a fix has been released.

44
.github/workflows/async.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Async Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
make_check:
strategy:
matrix:
config: [
# Add new configs here
'--enable-asynccrypt --enable-all --enable-dtls13',
'--enable-asynccrypt-sw --enable-ocspstapling --enable-ocspstapling2',
'--enable-ocsp CFLAGS="-DTEST_NONBLOCK_CERTS"',
]
name: make check
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 6
steps:
- uses: actions/checkout@v4
name: Checkout wolfSSL
- name: Test wolfSSL async
run: |
./async-check.sh install
./configure ${{ matrix.config }}
make check
- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ] ; then
cat test-suite.log
fi

70
.github/workflows/curl.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: curl Test
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-curl
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-curl
path: build-dir
retention-days: 5
test_curl:
name: ${{ matrix.curl_ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 15
needs: build_wolfssl
strategy:
fail-fast: false
matrix:
curl_ref: [ 'master', 'curl-8_4_0' ]
steps:
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install nghttp2 libpsl5 libpsl-dev
sudo pip install impacket
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-curl
path: build-dir
- name: Build curl
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: curl/curl
path: curl
ref: ${{ matrix.curl_ref }}
configure: --with-wolfssl=$GITHUB_WORKSPACE/build-dir
check: false
- name: Test curl
working-directory: curl
run: make -j test-ci

91
.github/workflows/cyrus-sasl.yml vendored Normal file
View File

@ -0,0 +1,91 @@
name: cyrus-sasl Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all
install: true
# Don't run tests as this config is tested in many other places
check: false
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-sasl
path: build-dir
retention-days: 5
sasl_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
ref: [ 2.1.28 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
needs: build_wolfssl
steps:
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install krb5-kdc krb5-otp libkrb5-dev \
libsocket-wrapper libnss-wrapper krb5-admin-server libdb5.3-dev
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-sasl
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Checkout sasl
uses: actions/checkout@v4
with:
repository: cyrusimap/cyrus-sasl
ref: cyrus-sasl-${{ matrix.ref }}
path: sasl
- name: Build cyrus-sasl
working-directory: sasl
run: |
patch -p1 < $GITHUB_WORKSPACE/osp/cyrus-sasl/${{ matrix.ref }}/${{ matrix.ref }}.patch
autoreconf -ivf
./configure --with-openssl=no --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-dblib=berkeley --disable-shared
# Need to run 'make' twice with '--disable-shared' for some reason
make -j || make -j
- name: Run testsuite
working-directory: sasl
run: |
make -j -C utils testsuite saslpasswd2
$GITHUB_WORKSPACE/osp/cyrus-sasl/${{ matrix.ref }}/run-tests.sh

60
.github/workflows/disabled/haproxy.yml vendored Normal file
View File

@ -0,0 +1,60 @@
name: HaProxy Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
haproxy_check:
strategy:
fail-fast: false
matrix:
# List of refs to test
ref: [ master ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-quic --enable-haproxy
install: true
- name: Checkout VTest
uses: actions/checkout@v4
with:
repository: vtest/VTest
path: VTest
- name: Build VTest
working-directory: VTest
# Special flags due to: https://github.com/vtest/VTest/issues/12
run: make FLAGS='-O2 -s -Wall'
- name: Checkout HaProxy
uses: actions/checkout@v4
with:
repository: haproxy/haproxy
path: haproxy
ref: ${{ matrix.ref }}
- name: Build HaProxy
working-directory: haproxy
run: >-
make -j TARGET=linux-glibc DEBUG='-DDEBUG_MEMORY_POOLS -DDEBUG_STRICT'
USE_OPENSSL_WOLFSSL=1 USE_QUIC=1 SSL_INC=$GITHUB_WORKSPACE/build-dir/include/
SSL_LIB=$GITHUB_WORKSPACE/build-dir/lib/ ADDLIB=-Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
- name: Test HaProxy
working-directory: haproxy
run: make reg-tests reg-tests/ssl VTEST_PROGRAM=$GITHUB_WORKSPACE/VTest/vtest

292
.github/workflows/disabled/hostap.yml vendored Normal file
View File

@ -0,0 +1,292 @@
name: hostap and wpa-supplicant Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
strategy:
matrix:
include:
- build_id: hostap-build1
wolf_extra_config: --disable-tls13
- build_id: hostap-build2
wolf_extra_config: --enable-brainpool --enable-wpas-dpp
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-20.04
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
# No way to view the full strategy in the browser (really weird)
- name: Print strategy
run: |
cat <<EOF
${{ toJSON(matrix) }}
EOF
- if: ${{ runner.debug }}
name: Enable wolfSSL debug logging
run: |
echo "wolf_debug_flags=--enable-debug" >> $GITHUB_ENV
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: >-
--enable-wpas CFLAGS=-DWOLFSSL_STATIC_RSA
${{ env.wolf_debug_flags }} ${{ matrix.wolf_extra_config }}
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build_id }}
path: build-dir
retention-days: 5
# Build wpa_supplicant with wolfSSL and hostapd with OpenSSL and interop.
hostap_test:
strategy:
fail-fast: false
matrix:
# should hostapd be compiled with wolfssl
hostapd: [true, false]
# should wpa_supplicant be compiled with wolfssl
wpa_supplicant: [true, false]
# Fix the versions of hostap and osp to not break testing when a new
# patch is added in to osp. hostap_cherry_pick is used to apply the
# commit that updates the certificates used for testing. Tests are read
# from the corresponding configs/hostap_ref/tests file.
config: [
{
hostap_ref: hostap_2_10,
hostap_cherry_pick: 36fcbb1a4ee4aa604f15079eae2ffa4fe7f44680,
remove_teap: true,
# TLS 1.3 does not work for this version
build_id: hostap-build1,
},
# Test the dpp patch
{
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
hostap_cherry_pick: 36fcbb1a4ee4aa604f15079eae2ffa4fe7f44680,
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
build_id: hostap-build2
},
]
# parallelize the tests to be able to run all tests within 10 minutes
# Update the <total server> in the ./run-tests.py step when changing.
server: [1, 2, 3, 4, 5]
exclude:
# don't test openssl on both sides
- hostapd: false
wpa_supplicant: false
# no hostapd support for dpp yet
- hostapd: true
config: {
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
build_id: hostap-build2
}
name: hwsim test
# For openssl 1.1
runs-on: ubuntu-20.04
# This should be a safe limit for the tests to run.
timeout-minutes: 12
needs: build_wolfssl
steps:
# No way to view the full strategy in the browser (really weird)
- name: Print strategy
run: |
cat <<EOF
${{ toJSON(matrix) }}
EOF
- name: Print computed job run ID
run: |
SHA_SUM=$(sha256sum << 'END_OF_HEREDOC' | cut -d " " -f 1
${{ toJSON(github) }}
END_OF_HEREDOC
)
echo "our_job_run_id=$SHA_SUM" >> $GITHUB_ENV
echo Our job run ID is $SHA_SUM
- name: Checkout wolfSSL
uses: actions/checkout@v4
with:
path: wolfssl
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# hostap dependencies
sudo apt-get install -y libpcap0.8 libpcap-dev curl libcurl4-openssl-dev \
libnl-3-dev binutils-dev libssl-dev libiberty-dev libnl-genl-3-dev \
libnl-route-3-dev libdbus-1-dev linux-modules-extra-`uname -r` \
bridge-utils
sudo pip3 install pycryptodome
- name: Enable mac80211
run: |
sudo modprobe mac80211
lsmod | grep mac80211
- if: ${{ runner.debug }}
name: Enable hostap debug logging
run: |
echo "hostap_debug_flags=-d" >> $GITHUB_ENV
- name: Download lib
uses: actions/download-artifact@v4
with:
name: ${{ matrix.config.build_id }}
path: build-dir
- name: Setup d-bus
working-directory: wolfssl/.github/workflows/hostap-files
run: |
sudo cp dbus-wpa_supplicant.conf /usr/share/dbus-1/system.d/wpa_supplicant.conf
sudo service dbus reload
# This is super hack-ish :P
# If you are trying to reproduce this on a more generic system, you can
# just run `sudo apt install linux-modules-extra-$(uname -r)` and
# this should have the module in the package. No need to compile it.
- name: Compile and install mac80211_hwsim
working-directory: wolfssl/.github/workflows/hostap-files
run: |
# The tag will be the first two numbers of from uname -r
LINUX_TAG=$(uname -r | grep -oP '^\d+\.\d+')
# Download the correct version of the driver
wget https://raw.githubusercontent.com/torvalds/linux/v$LINUX_TAG/drivers/net/wireless/mac80211_hwsim.c
wget https://raw.githubusercontent.com/torvalds/linux/v$LINUX_TAG/drivers/net/wireless/mac80211_hwsim.h
make
sudo make install
sudo modprobe mac80211_hwsim
lsmod | grep mac80211_hwsim
sudo rmmod mac80211_hwsim
- name: Checkout hostap
uses: actions/checkout@v4
with:
repository: julek-wolfssl/hostap-mirror
path: hostap
ref: ${{ matrix.config.hostap_ref }}
# necessary for cherry pick step
fetch-depth: 0
- if: ${{ matrix.config.hostap_cherry_pick }}
name: Cherry pick certificate update
working-directory: hostap
run: git cherry-pick -n -X theirs ${{ matrix.config.hostap_cherry_pick }}
- if: ${{ matrix.config.osp_ref }}
name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
ref: ${{ matrix.config.osp_ref }}
- if: ${{ matrix.config.osp_ref }}
name: Apply patch files
working-directory: hostap
run: |
for f in $GITHUB_WORKSPACE/osp/hostap-patches/pending/*
do
patch -p1 < $f
done
- if: ${{ matrix.hostapd }}
name: Setup hostapd config file
run: |
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/hostapd.config \
hostap/hostapd/.config
cat <<EOF >> hostap/hostapd/.config
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
EOF
- if: ${{ matrix.wpa_supplicant }}
name: Setup wpa_supplicant config file
run: |
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/wpa_supplicant.config \
hostap/wpa_supplicant/.config
cat <<EOF >> hostap/wpa_supplicant/.config
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
EOF
- name: Build hostap
working-directory: hostap/tests/hwsim/
run: ./build.sh
- if: ${{ matrix.hostapd }}
name: Confirm hostapd linking with wolfSSL
run: ldd hostap/hostapd/hostapd | grep wolfssl
- if: ${{ matrix.wpa_supplicant }}
name: Confirm wpa_supplicant linking with wolfSSL
run: ldd hostap/wpa_supplicant/wpa_supplicant | grep wolfssl
- if: ${{ matrix.config.remove_teap }}
name: Remove EAP-TEAP from test configuration
working-directory: hostap/tests/hwsim/auth_serv
run: |
sed -e 's/"erp-teap@example.com"\tTEAP//' -i eap_user.conf
sed -e 's/"erp-teap@example.com"\tMSCHAPV2\t"password"\t\[2\]//' -i eap_user.conf
sed -e 's/"TEAP"\t\tTEAP//' -i eap_user.conf
sed -e 's/TEAP,//' -i eap_user.conf
- name: Run tests
id: testing
working-directory: hostap/tests/hwsim/
run: |
# Run tests in increments of 50 to cut down on the uploaded log size.
while mapfile -t -n 50 ary && ((${#ary[@]})); do
TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ')
# Retry up to three times
for i in {1..3}; do
HWSIM_RES=0 # Not set when command succeeds
# Logs can grow quickly especially in debug mode
sudo rm -rf logs
sudo ./start.sh
sudo ./run-tests.py ${{ env.hostap_debug_flags }} --split ${{ matrix.server }}/5 $TESTS || HWSIM_RES=$?
sudo ./stop.sh
if [ "$HWSIM_RES" -eq "0" ]; then
break
fi
done
echo "test ran $i times"
if [ "$HWSIM_RES" -ne "0" ]; then
exit $HWSIM_RES
fi
done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests
- name: Change failure log permissions
if: ${{ failure() && steps.testing.outcome == 'failure' }}
working-directory: hostap/tests/hwsim/
run: |
sudo chown -R $USER:$USER logs
zip -9 -r logs.zip logs/current
- name: Upload failure logs
if: ${{ failure() && steps.testing.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: hostap-logs-${{ env.our_job_run_id }}
path: hostap/tests/hwsim/logs.zip
retention-days: 5

43
.github/workflows/docker-Espressif.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Espressif examples tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
espressif_latest:
name: latest Docker container
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 12
container:
image: espressif/idf:latest
steps:
- uses: actions/checkout@v4
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
espressif_v4_4:
name: v4.4 Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:release-v4.4
steps:
- uses: actions/checkout@v4
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
espressif_v5_0:
name: v5.0 Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:release-v5.0
steps:
- uses: actions/checkout@v4
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh

63
.github/workflows/docker-OpenWrt.yml vendored Normal file
View File

@ -0,0 +1,63 @@
# This workflow tests out new libraries with existing OpenWrt builds to check
# there aren't any compatibility issues. Take a look at Docker/OpenWrt/README.md
name: OpenWrt test
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_library:
name: Compile libwolfssl.so
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
container:
image: alpine:latest
steps:
- name: Install required tools
run: apk add argp-standalone asciidoc bash bc binutils bzip2 cdrkit coreutils diffutils elfutils-dev findutils flex musl-fts-dev g++ gawk gcc gettext git grep intltool libxslt linux-headers make musl-libintl musl-obstack-dev ncurses-dev openssl-dev patch perl python3-dev rsync tar unzip util-linux wget zlib-dev autoconf automake libtool
- uses: actions/checkout@v4
- name: Compile libwolfssl.so
run: ./autogen.sh && ./configure --enable-all && make
- name: Upload libwolfssl.so
uses: actions/upload-artifact@v4
with:
name: openwrt-libwolfssl.so
path: src/.libs/libwolfssl.so
retention-days: 5
compile_container:
name: Compile container
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 2
needs: build_library
strategy:
fail-fast: false
matrix:
release: [ "22.03.6", "21.02.7" ] # some other versions: 21.02.0 21.02.5 22.03.0 22.03.3 snapshot
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/download-artifact@v4
with:
name: openwrt-libwolfssl.so
path: Docker/OpenWrt/.
- name: Build but dont push
uses: docker/build-push-action@v5
with:
context: Docker/OpenWrt
platforms: linux/amd64
push: false
tags: openwrt-test:latest
build-args: DOCKER_BASE_CONTAINER=openwrt/rootfs:x86-64-${{ matrix.release }}
cache-from: type=gha
cache-to: type=gha,mode=max

101
.github/workflows/grpc.yml vendored Normal file
View File

@ -0,0 +1,101 @@
name: grpc Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 10
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all 'CPPFLAGS=-DWOLFSSL_RSA_KEY_CHECK -DHAVE_EX_DATA_CLEANUP_HOOKS'
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-grpc
path: build-dir
retention-days: 5
grpc_check:
strategy:
fail-fast: false
matrix:
include:
- ref: v1.60.0
tests: >-
bad_ssl_alpn_test bad_ssl_cert_test client_ssl_test
crl_ssl_transport_security_test server_ssl_test
ssl_transport_security_test ssl_transport_security_utils_test
test_core_security_ssl_credentials_test test_cpp_end2end_ssl_credentials_test
h2_ssl_cert_test h2_ssl_session_reuse_test
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 30
needs: build_wolfssl
steps:
- name: Confirm IPv4 and IPv6 support
run: |
ip addr list lo | grep 'inet '
ip addr list lo | grep 'inet6 '
- name: Install prereqs
run:
sudo apt-get install build-essential autoconf libtool pkg-config cmake clang libc++-dev
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-grpc
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Checkout grpc
uses: actions/checkout@v4
with:
repository: grpc/grpc
path: grpc
ref: ${{ matrix.ref }}
- name: Build grpc
working-directory: ./grpc
run: |
patch -p1 < ../osp/grpc/grpc-${{ matrix.ref }}.patch
git submodule update --init
mkdir cmake/build
cd cmake/build
cmake -DgRPC_BUILD_TESTS=ON -DgRPC_SSL_PROVIDER=wolfssl \
-DWOLFSSL_INSTALL_DIR=$GITHUB_WORKSPACE/build-dir ../..
make -j $(nproc) ${{ matrix.tests }}
- name: Run grpc tests
working-directory: ./grpc
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
./tools/run_tests/start_port_server.py
for t in ${{ matrix.tests }} ; do
./cmake/build/$t
done

103
.github/workflows/hitch.yml vendored Normal file
View File

@ -0,0 +1,103 @@
name: hitch Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-hitch
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-hitch
path: build-dir
retention-days: 5
hitch_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
include:
- ref: 1.7.3
ignore-tests: >-
test13-r82.sh test15-proxy-v2-npn.sh test39-client-cert-proxy.sh
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-hitch
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y libev-dev libssl-dev automake python3-docutils flex bison pkg-config make
- name: Checkout hitch
uses: actions/checkout@v4
with:
repository: varnish/hitch
ref: 1.7.3
path: hitch
# Do this before configuring so that it only detects the updated list of
# tests
- if: ${{ matrix.ignore-tests }}
name: Remove tests that we want to ignore
working-directory: ./hitch/src/tests
run: |
rm ${{ matrix.ignore-tests }}
- name: Configure and build hitch
run: |
cd $GITHUB_WORKSPACE/hitch/
patch -p1 < $GITHUB_WORKSPACE/osp/hitch/hitch_1.7.3.patch
autoreconf -ivf
SSL_CFLAGS="-I$GITHUB_WORKSPACE/build-dir/include/ -I$GITHUB_WORKSPACE/build-dir/include/wolfssl" SSL_LIBS="-L$GITHUB_WORKSPACE/build-dir/lib -lwolfssl" ./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir/ --enable-silent-rules --enable-documentation --enable-warnings --with-lex --with-yacc --prefix=$GITHUB_WORKSPACE/build-dir
make -j$(nproc)
- name: Confirm hitch built with wolfSSL
working-directory: ./hitch
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
ldd src/hitch | grep wolfssl
- name: Run hitch tests, skipping ignored tests
working-directory: ./hitch
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
make check

11
.github/workflows/hostap-files/Makefile vendored Normal file
View File

@ -0,0 +1,11 @@
obj-m := mac80211_hwsim.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) M=$(PWD) modules
install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
depmod -A
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean

2
.github/workflows/hostap-files/README vendored Normal file
View File

@ -0,0 +1,2 @@
Makefile and directory used in .github/workflows/hostap.yml to
compile the mac80211_hwsim kernel module.

View File

@ -0,0 +1,122 @@
#CC=ccache gcc
CONFIG_DRIVER_NONE=y
CONFIG_DRIVER_NL80211=y
CONFIG_RSN_PREAUTH=y
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
CONFIG_EAP=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_PAX=y
CONFIG_EAP_PSK=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_UNAUTH_TLS=y
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
CONFIG_IPV6=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_FULL_DYNAMIC_VLAN=y
CONFIG_VLAN_NETLINK=y
CONFIG_LIBNL32=y
CONFIG_LIBNL3_ROUTE=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_WPS=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
#CONFIG_WPS_STRICT=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_P2P_MANAGER=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_WPA_CLI_EDIT=y
CONFIG_ACS=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_WNM=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_SQLITE=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CFLAGS += -DCONFIG_RADIUS_TEST
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
CONFIG_SUITEB192=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_h += -fsanitize=undefined
#LIBS_n += -fsanitize=undefined
#LIBS_c += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_TAXONOMY=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_OWE=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y
CONFIG_AIRTIME_POLICY=y
CONFIG_IEEE80211BE=y

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
#CC=ccache gcc
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_TLV=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_EKE=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
CONFIG_USIM_SIMULATOR=y
CONFIG_SIM_SIMULATOR=y
#CONFIG_PCSC=y
CONFIG_IPV6=y
CONFIG_DRIVER_NONE=y
CONFIG_PKCS12=y
CONFIG_CTRL_IFACE=unix
CONFIG_WPA_CLI_EDIT=y
CONFIG_OCSP=y
#CONFIG_ELOOP_POLL=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_DEBUG_FILE=y
CONFIG_WPS=y
#CONFIG_WPS_STRICT=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
CONFIG_WPS_ER=y
#CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CFLAGS += -I/usr/include/libnl3
CONFIG_LIBNL32=y
CONFIG_IBSS_RSN=y
CONFIG_AP=y
CONFIG_MESH=y
CONFIG_P2P=y
CONFIG_WIFI_DISPLAY=y
CONFIG_ACS=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_TDLS=y
CONFIG_TDLS_TESTING=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_HE_OVERRIDES=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_EXT_PASSWORD_TEST=y
CONFIG_EXT_PASSWORD_FILE=y
CONFIG_EAP_UNAUTH_TLS=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_WNM=y
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
CONFIG_SUITEB192=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_c += -fsanitize=undefined
#LIBS_p += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
CONFIG_OWE=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y

View File

@ -0,0 +1,120 @@
#CC=ccache gcc
CONFIG_DRIVER_NONE=y
CONFIG_DRIVER_NL80211=y
CONFIG_RSN_PREAUTH=y
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
CONFIG_EAP=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_PAX=y
CONFIG_EAP_PSK=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_UNAUTH_TLS=y
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
CONFIG_IPV6=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_FULL_DYNAMIC_VLAN=y
CONFIG_VLAN_NETLINK=y
CONFIG_LIBNL32=y
CONFIG_LIBNL3_ROUTE=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_WPS=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
#CONFIG_WPS_STRICT=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_P2P_MANAGER=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_WPA_CLI_EDIT=y
CONFIG_ACS=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_WNM=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_SQLITE=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CFLAGS += -DCONFIG_RADIUS_TEST
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_h += -fsanitize=undefined
#LIBS_n += -fsanitize=undefined
#LIBS_c += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_TAXONOMY=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_OWE=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y
CONFIG_AIRTIME_POLICY=y

View File

@ -0,0 +1,656 @@
sae_pk
sae_pk_group_negotiation
sae_pk_sec_3
sae_pk_sec_5
sae_pk_group_20
sae_pk_group_21
sae_pk_group_20_sae_group_19
sae_pk_group_20_sae_group_21
sae_pk_group_19_sae_group_20
sae_pk_password_without_pk
sae_pk_only
sae_pk_modes
sae_pk_not_on_ap
sae_pk_mixed
sae_pk_mixed_immediate_confirm
sae_pk_missing_ie
sae_pk_unexpected_status
sae_pk_invalid_signature
sae_pk_invalid_fingerprint
sae_pk_and_psk
sae_pk_and_psk_invalid_password
sae_pk_invalid_pw
sae
sae_password_ecc
sae_pmksa_caching
sae_pmksa_caching_pmkid
sae_pmksa_caching_disabled
sae_groups
sae_group_nego
sae_group_nego_no_match
sae_anti_clogging
sae_forced_anti_clogging
sae_mixed
sae_and_psk
sae_and_psk2
sae_wpa3_roam
sae_mixed_mfp
sae_mfp
sae_missing_password
sae_key_lifetime_in_memory
sae_oom_wpas
sae_proto_ecc
sae_proto_ffc
sae_proto_commit_delayed
sae_proto_commit_replay
sae_proto_confirm_replay
sae_proto_hostapd
sae_proto_hostapd_ecc
sae_proto_hostapd_ffc
sae_proto_hostapd_status_126
sae_proto_hostapd_status_127
sae_reflection_attack_ecc
sae_reflection_attack_ecc_internal
sae_commit_override
sae_commit_override2
sae_commit_invalid_scalar_element_ap
sae_commit_invalid_element_ap
sae_commit_invalid_scalar_element_sta
sae_commit_invalid_element_sta
sae_anti_clogging_proto
sae_no_random
sae_invalid_anti_clogging_token_req
sae_password
sae_password_short
sae_password_long
sae_connect_cmd
sae_password_id
sae_password_id_ecc
sae_password_id_ffc
sae_password_id_only
sae_password_id_pwe_looping
sae_password_id_pwe_check_ap
sae_password_id_pwe_check_sta
sae_forced_anti_clogging_pw_id
sae_reauth
sae_sync
sae_confirm_immediate
sae_confirm_immediate2
sae_pwe_group_19
sae_pwe_group_20
sae_pwe_group_21
sae_pwe_group_28
sae_pwe_group_29
sae_pwe_group_30
sae_pwe_group_1
sae_pwe_group_2
sae_pwe_group_22
sae_pwe_h2e_only_ap
sae_pwe_h2e_only_ap_sta_forcing_loop
sae_pwe_loop_only_ap
sae_h2e_rejected_groups
sae_h2e_rejected_groups_unexpected
sae_h2e_password_id
sae_pwe_in_psk_ap
sae_auth_restart
sae_rsne_mismatch
sae_h2e_rsnxe_mismatch
sae_h2e_rsnxe_mismatch_retries
sae_h2e_rsnxe_mismatch_assoc
sae_h2e_rsnxe_mismatch_ap
sae_h2e_rsnxe_mismatch_ap2
sae_h2e_rsnxe_mismatch_ap3
sae_forced_anti_clogging_h2e
sae_forced_anti_clogging_h2e_loop
sae_okc
sae_okc_sta_only
sae_okc_pmk_lifetime
sae_pmk_lifetime
sae_and_psk_multiple_passwords
sae_pmf_roam
sae_ocv_pmk
sae_ocv_pmk_failure
sae_reject
eap_tls_pkcs8_pkcs5_v2_des3
eap_tls_pkcs8_pkcs5_v15
eap_tls_session_resumption
eap_tls_session_resumption_expiration
eap_tls_session_resumption_radius
eap_tls_sha512
eap_tls_sha384
eap_tls_ext_cert_check
eap_tls_errors
ap_wpa2_delayed_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission2
ap_wpa2_delayed_group_m1_retransmission
ap_wpa2_delayed_group_m1_retransmission_igtk
ap_wpa2_delayed_m1_m3_zero_tk
ap_wpa2_plaintext_m1_m3
ap_wpa2_plaintext_m1_m3_pmf
ap_wpa2_plaintext_m3
ap_wpa2_plaintext_group_m1
ap_wpa2_plaintext_group_m1_pmf
ap_wpa2_test_command_failures
ap_wpa2_gtk_initial_rsc_tkip
ap_wpa2_gtk_initial_rsc_ccmp
ap_wpa2_gtk_initial_rsc_ccmp_256
ap_wpa2_gtk_initial_rsc_gcmp
ap_wpa2_gtk_initial_rsc_gcmp_256
ap_wpa2_igtk_initial_rsc_aes_128_cmac
ap_wpa2_igtk_initial_rsc_bip_gmac_128
ap_wpa2_igtk_initial_rsc_bip_gmac_256
ap_wpa2_igtk_initial_rsc_bip_cmac_256
ap_wpa2_psk
ap_wpa2_psk_file
ap_wpa2_psk_file_keyid
ap_wpa2_psk_mem
ap_wpa2_ptk_rekey
ap_wpa2_ptk_rekey_blocked_ap
ap_wpa2_ptk_rekey_blocked_sta
ap_wpa2_ptk_rekey_anonce
ap_wpa2_ptk_rekey_ap
ap_wpa2_sha256_ptk_rekey
ap_wpa2_sha256_ptk_rekey_ap
ap_wpa2_psk_file_errors
ap_wpa2_psk_wildcard_ssid
ap_wpa2_gtk_rekey
ap_wpa2_gtk_rekey_request
ap_wpa2_gtk_rekey_failure
ap_wpa2_gtk_rekey_fail_1_sta
ap_wpa2_gmk_rekey
ap_wpa2_strict_rekey
ap_wpa2_psk_ext
ap_wpa2_psk_unexpected
ap_wpa2_psk_ext_retry_msg_3
ap_wpa2_psk_ext_retry_msg_3b
ap_wpa2_psk_ext_retry_msg_3c
ap_wpa2_psk_ext_retry_msg_3d
ap_wpa2_psk_ext_retry_msg_3e
ap_wpa2_psk_ext_delayed_ptk_rekey
ap_wpa2_psk_ext_eapol
ap_wpa2_psk_ext_eapol_retry1
ap_wpa2_psk_ext_eapol_retry1b
ap_wpa2_psk_ext_eapol_retry1c
ap_wpa2_psk_ext_eapol_retry1d
ap_wpa2_psk_ext_eapol_type_diff
ap_wpa2_psk_ext_eapol_key_info
ap_wpa2_psk_supp_proto
ap_wpa2_psk_supp_proto_no_ie
ap_wpa2_psk_supp_proto_ie_mismatch
ap_wpa2_psk_supp_proto_ok
ap_wpa2_psk_supp_proto_no_gtk
ap_wpa2_psk_supp_proto_anonce_change
ap_wpa2_psk_supp_proto_unexpected_group_msg
ap_wpa2_psk_supp_proto_msg_1_invalid_kde
ap_wpa2_psk_supp_proto_wrong_pairwise_key_len
ap_wpa2_psk_supp_proto_wrong_group_key_len
ap_wpa2_psk_supp_proto_gtk_tx_bit_workaround
ap_wpa2_psk_supp_proto_gtk_keyidx_0_and_3
ap_wpa2_psk_supp_proto_no_gtk_in_group_msg
ap_wpa2_psk_supp_proto_too_long_gtk_in_group_msg
ap_wpa2_psk_supp_proto_too_long_gtk_kde
ap_wpa2_psk_supp_proto_gtk_not_encrypted
ap_wpa2_psk_wep
ap_wpa2_psk_drop_first_msg_4
ap_wpa2_psk_disable_enable
ap_wpa2_psk_incorrect_passphrase
ap_wpa2_psk_no_random
ap_wpa2_psk_assoc_rsn
ap_wpa2_psk_ft_workaround
ap_wpa2_psk_assoc_rsn_pmkid
ap_wpa2_eapol_retry_limit
ap_wpa2_disable_eapol_retry
ap_wpa2_disable_eapol_retry_group
ap_wpa2_psk_mic_0
ap_wpa2_psk_local_error
ap_wpa2_psk_ap_control_port
ap_wpa2_psk_rsne_mismatch_ap
ap_wpa2_psk_rsne_mismatch_ap2
ap_wpa2_psk_rsne_mismatch_ap3
ap_wpa2_psk_rsnxe_mismatch_ap
ap_wpa2_psk_ext_key_id_ptk_rekey_ap0
ap_wpa2_psk_ext_key_id_ptk_rekey_ap1
ap_wpa2_psk_ext_key_id_ptk_rekey_ap2
ap_wpa2_psk_ext_key_id_ptk_rekey_sta0
ap_wpa2_psk_ext_key_id_ptk_rekey_sta1
ap_wpa2_psk_ext_key_id_ptk_rekey_sta2
ap_wpa2_eap_sim
ap_wpa2_eap_sim_imsi_identity
ap_wpa2_eap_sim_imsi_privacy_key
ap_wpa2_eap_sim_imsi_privacy_attr
ap_wpa2_eap_sim_sql
ap_wpa2_eap_sim_config
ap_wpa2_eap_sim_id_0
ap_wpa2_eap_sim_id_1
ap_wpa2_eap_sim_id_2
ap_wpa2_eap_sim_id_3
ap_wpa2_eap_sim_ext
ap_wpa2_eap_sim_ext_replace_sim
ap_wpa2_eap_sim_ext_replace_sim2
ap_wpa2_eap_sim_ext_replace_sim3
ap_wpa2_eap_sim_ext_auth_fail
ap_wpa2_eap_sim_change_bssid
ap_wpa2_eap_sim_no_change_set
ap_wpa2_eap_sim_ext_anonymous
ap_wpa2_eap_sim_ext_anonymous_no_pseudonym
ap_wpa2_eap_sim_oom
ap_wpa2_eap_aka
ap_wpa2_eap_aka_imsi_identity
ap_wpa2_eap_aka_imsi_privacy_key
ap_wpa2_eap_aka_imsi_privacy_attr
ap_wpa2_eap_aka_imsi_privacy_key_expired
ap_wpa2_eap_aka_sql
ap_wpa2_eap_aka_config
ap_wpa2_eap_aka_ext
ap_wpa2_eap_aka_ext_auth_fail
ap_wpa2_eap_aka_prime_imsi_identity
ap_wpa2_eap_aka_prime_imsi_privacy_key
ap_wpa2_eap_aka_prime_ext_auth_fail
ap_wpa2_eap_aka_prime_ext
ap_wpa2_eap_ttls_pap
ap_wpa2_eap_ttls_pap_subject_match
ap_wpa2_eap_ttls_pap_check_cert_subject
ap_wpa2_eap_ttls_pap_incorrect_password
ap_wpa2_eap_ttls_chap
ap_wpa2_eap_ttls_chap_altsubject_match
ap_wpa2_eap_ttls_chap_incorrect_password
ap_wpa2_eap_ttls_mschap
ap_wpa2_eap_ttls_mschap_incorrect_password
ap_wpa2_eap_ttls_mschapv2
ap_wpa2_eap_ttls_invalid_phase2
ap_wpa2_eap_ttls_mschapv2_suffix_match
ap_wpa2_eap_ttls_mschapv2_domain_match
ap_wpa2_eap_ttls_mschapv2_incorrect_password
ap_wpa2_eap_ttls_mschapv2_utf8
ap_wpa2_eap_ttls_eap_gtc
ap_wpa2_eap_ttls_eap_gtc_incorrect_password
ap_wpa2_eap_ttls_eap_gtc_no_password
ap_wpa2_eap_ttls_eap_gtc_server_oom
ap_wpa2_eap_ttls_eap_gtc_oom
ap_wpa2_eap_ttls_eap_md5
ap_wpa2_eap_ttls_eap_md5_incorrect_password
ap_wpa2_eap_ttls_eap_md5_no_password
ap_wpa2_eap_ttls_eap_md5_server_oom
ap_wpa2_eap_ttls_eap_mschapv2
ap_wpa2_eap_ttls_eap_mschapv2_no_password
ap_wpa2_eap_ttls_eap_mschapv2_server_oom
ap_wpa2_eap_ttls_eap_sim
ap_wpa2_eap_ttls_eap_sim_ext
ap_wpa2_eap_ttls_eap_vendor
ap_wpa2_eap_peap_eap_sim
ap_wpa2_eap_peap_eap_sim_ext
ap_wpa2_eap_fast_eap_sim_ext
ap_wpa2_eap_ttls_eap_aka
ap_wpa2_eap_peap_eap_aka
ap_wpa2_eap_peap_eap_mschapv2
ap_wpa2_eap_peap_eap_mschapv2_domain
ap_wpa2_eap_peap_eap_mschapv2_incorrect_password
ap_wpa2_eap_peap_crypto_binding
ap_wpa2_eap_peap_crypto_binding_server_oom
ap_wpa2_eap_peap_params
ap_wpa2_eap_peap_eap_gtc
ap_wpa2_eap_peap_eap_tls
ap_wpa2_eap_peap_eap_vendor
ap_wpa2_eap_tls
ap_wpa2_eap_tls_blob
ap_wpa2_eap_tls_blob_pem
ap_wpa2_eap_tls_blob_missing
ap_wpa2_eap_tls_with_tls_len
ap_wpa2_eap_tls_pkcs12
ap_wpa2_eap_tls_pkcs12_blob
ap_wpa2_eap_tls_pkcs12_blob_pem
ap_wpa2_eap_tls_diff_ca_trust
ap_wpa2_eap_tls_diff_ca_trust2
ap_wpa2_eap_tls_diff_ca_trust3
ap_wpa2_eap_tls_neg_suffix_match
ap_wpa2_eap_tls_neg_domain_match
ap_wpa2_eap_tls_neg_subject_match
ap_wpa2_eap_tls_neg_altsubject_match
ap_wpa2_eap_unauth_tls
ap_wpa2_eap_ttls_server_cert_hash
ap_wpa2_eap_ttls_server_cert_hash_invalid
ap_wpa2_eap_pwd
ap_wpa2_eap_pwd_nthash
ap_wpa2_eap_pwd_salt_sha1
ap_wpa2_eap_pwd_salt_sha256
ap_wpa2_eap_pwd_salt_sha512
ap_wpa2_eap_pwd_groups
ap_wpa2_eap_pwd_invalid_group
ap_wpa2_eap_pwd_disabled_group
ap_wpa2_eap_pwd_as_frag
ap_wpa2_eap_gpsk
ap_wpa2_eap_sake
ap_wpa2_eap_eke
ap_wpa2_eap_eke_many
ap_wpa2_eap_eke_serverid_nai
ap_wpa2_eap_eke_server_oom
ap_wpa2_eap_ikev2
ap_wpa2_eap_ikev2_as_frag
ap_wpa2_eap_ikev2_oom
ap_wpa2_eap_pax
ap_wpa2_eap_psk
ap_wpa2_eap_psk_oom
ap_wpa2_eap_interactive
ap_wpa2_eap_ext_enable_network_while_connected
ap_wpa2_eap_vendor_test
ap_wpa2_eap_vendor_test_oom
ap_wpa2_eap_fast_gtc_identity_change
ap_wpa2_eap_fast_eap_vendor
ap_wpa2_eap_tls_ocsp
ap_wpa2_eap_tls_ocsp_multi
ap_wpa2_eap_tls_ocsp_key_id
ap_wpa2_eap_tls_ocsp_ca_signed_good
ap_wpa2_eap_tls_ocsp_ca_signed_revoked
ap_wpa2_eap_tls_ocsp_ca_signed_unknown
ap_wpa2_eap_tls_ocsp_server_signed
ap_wpa2_eap_tls_ocsp_invalid_data
ap_wpa2_eap_tls_ocsp_invalid
ap_wpa2_eap_tls_ocsp_unknown_sign
ap_wpa2_eap_tls_intermediate_ca
ap_wpa2_eap_tls_ocsp_multi_revoked
ap_wpa2_eap_tls_domain_suffix_match_cn_full
ap_wpa2_eap_tls_domain_match_cn
ap_wpa2_eap_tls_domain_suffix_match_cn
ap_wpa2_eap_tls_domain_suffix_mismatch_cn
ap_wpa2_eap_tls_domain_mismatch_cn
ap_wpa2_eap_ttls_long_duration
ap_wpa2_eap_ttls_server_cert_eku_client
ap_wpa2_eap_ttls_server_cert_eku_client_server
ap_wpa2_eap_ttls_server_pkcs12
ap_wpa2_eap_ttls_server_pkcs12_extra
ap_wpa2_eap_ttls_dh_params_server
ap_wpa2_eap_ttls_dh_params_dsa_server
ap_wpa2_eap_ttls_dh_params_not_found
ap_wpa2_eap_ttls_dh_params_invalid
ap_wpa2_eap_reauth
ap_wpa2_eap_reauth_ptk_rekey_blocked_sta
ap_wpa2_eap_request_identity_message
ap_wpa2_eap_sim_aka_result_ind
ap_wpa2_eap_sim_zero_db_timeout
ap_wpa2_eap_too_many_roundtrips
ap_wpa2_eap_too_many_roundtrips_server
ap_wpa2_eap_too_many_roundtrips_server2
ap_wpa2_eap_expanded_nak
ap_wpa2_eap_sql
ap_wpa2_eap_non_ascii_identity
ap_wpa2_eap_non_ascii_identity2
ap_wpa2_eap_unexpected_wep_eapol_key
ap_wpa2_eap_session_ticket
ap_wpa2_eap_no_workaround
ap_wpa2_eap_tls_check_crl
ap_wpa2_eap_tls_check_crl_not_strict
ap_wpa2_eap_tls_crl_reload
ap_wpa2_eap_tls_check_cert_subject
ap_wpa2_eap_tls_check_cert_subject_neg
ap_wpa2_eap_tls_oom
ap_wpa2_eap_tls_macacl
ap_wpa2_eap_oom
ap_wpa2_eap_tls_13
ap_wpa2_eap_tls_13_ocsp
ap_wpa2_eap_tls_13_missing_prot_success
ap_wpa2_eap_tls_13_fragmentation
ap_wpa2_eap_ttls_13
ap_wpa2_eap_peap_13
ap_wpa2_eap_tls_13_ec
ap_wpa2_eap_sim_db
ap_wpa2_eap_sim_db_sqlite
ap_wpa2_eap_assoc_rsn
ap_wpa2_eap_status
ap_wpa2_eap_gpsk_ptk_rekey_ap
ap_wpa2_eap_wildcard_ssid
ap_wpa2_eap_psk_mac_addr_change
ap_wpa2_eap_server_get_id
ap_wpa2_radius_server_get_id
ap_wpa2_eap_tls_tod
ap_wpa2_eap_tls_tod_tofu
ap_wpa2_eap_sake_no_control_port
dpp_network_intro_version
dpp_network_intro_version_change
dpp_network_intro_version_missing_req
dpp_tcp_pkex
dpp_tcp_pkex_auto_connect_2
dpp_tcp_pkex_auto_connect_2_status
dpp_tcp_pkex_auto_connect_2_status_fail
dpp_tcp_pkex_while_associated
dpp_tcp_pkex_while_associated_conn_status
dpp_controller_relay_pkex
dpp_push_button
dpp_push_button_session_overlap_sta
dpp_push_button_session_overlap_ap
dpp_push_button_session_overlap_configurator
dpp_push_button_2sta
dpp_push_button_r_hash_mismatch_sta
dpp_push_button_i_hash_mismatch_ap
dpp_push_button_r_hash_mismatch_ap
dpp_push_button_ext_conf
dpp_push_button_wpas_conf
dpp_private_peer_introduction
dpp_qr_code_parsing
dpp_uri_version
dpp_uri_supported_curves
dpp_uri_host
dpp_qr_code_parsing_fail
dpp_qr_code_curves
dpp_qr_code_curves_brainpool
dpp_qr_code_unsupported_curve
dpp_qr_code_keygen_fail
dpp_qr_code_auth_broadcast
dpp_configurator_enrollee_prime256v1
dpp_configurator_enrollee_secp384r1
dpp_configurator_enrollee_brainpoolP256r1
dpp_configurator_enrollee_brainpoolP384r1
dpp_configurator_enrollee_brainpoolP512r1
dpp_configurator_enroll_conf
dpp_qr_code_curve_prime256v1
dpp_qr_code_curve_secp384r1
dpp_qr_code_curve_secp521r1
dpp_qr_code_curve_brainpoolP256r1
dpp_qr_code_curve_brainpoolP384r1
dpp_qr_code_curve_brainpoolP512r1
dpp_qr_code_set_key
dpp_qr_code_auth_mutual
dpp_qr_code_auth_mutual_p_256
dpp_qr_code_auth_mutual_p_384
dpp_qr_code_auth_mutual_p_521
dpp_qr_code_auth_mutual_bp_256
dpp_qr_code_auth_mutual_bp_384
dpp_qr_code_auth_mutual_bp_512
dpp_auth_resp_retries
dpp_qr_code_auth_mutual_not_used
dpp_qr_code_auth_mutual_curve_mismatch
dpp_qr_code_auth_hostapd_mutual2
dpp_qr_code_listen_continue
dpp_qr_code_auth_initiator_enrollee
dpp_qr_code_auth_initiator_either_2
dpp_qr_code_auth_initiator_either_3
dpp_config_legacy
dpp_config_legacy_psk_hex
dpp_config_fragmentation
dpp_config_legacy_gen
dpp_config_legacy_gen_psk
dpp_config_dpp_gen_prime256v1
dpp_config_dpp_gen_secp384r1
dpp_config_dpp_gen_secp521r1
dpp_config_dpp_gen_expiry
dpp_config_dpp_gen_expired_key
dpp_config_dpp_gen_3rd_party
dpp_config_dpp_override_prime256v1
dpp_config_dpp_override_secp384r1
dpp_config_override_objects
dpp_config_signed_connector_error_no_dot_1
dpp_config_signed_connector_error_no_dot_2
dpp_config_signed_connector_error_unexpected_signature_len
dpp_config_no_csign
dpp_config_no_signed_connector
dpp_config_unexpected_signed_connector_char
dpp_config_root_not_an_object
dpp_config_no_wi_fi_tech
dpp_config_no_discovery
dpp_config_no_discovery_ssid
dpp_config_too_long_discovery_ssid
dpp_config_no_cred
dpp_config_no_cred_akm
dpp_config_error_legacy_no_pass
dpp_config_error_legacy_too_long_pass
dpp_config_error_legacy_psk_with_sae
dpp_config_error_legacy_no_pass_for_sae
dpp_config_error_legacy_invalid_psk
dpp_config_error_legacy_too_short_psk
dpp_config_connector_error_ext_sign
dpp_config_connector_error_too_short_timestamp
dpp_config_connector_error_invalid_timestamp
dpp_config_connector_error_invalid_timestamp_date
dpp_config_connector_error_expired_1
dpp_config_connector_error_expired_2
dpp_config_connector_error_expired_3
dpp_config_connector_error_expired_4
dpp_config_connector_error_expired_6
dpp_config_connector_error_no_groups
dpp_config_connector_error_empty_groups
dpp_config_connector_error_missing_group_id
dpp_config_connector_error_missing_net_role
dpp_config_connector_error_missing_net_access_key
dpp_config_connector_error_net_access_key_mismatch
dpp_akm_sha256
dpp_akm_sha384
dpp_akm_sha512
dpp_network_introduction
dpp_network_introduction_expired
dpp_and_sae_akm
dpp_ap_config
dpp_ap_config_p256_p256
dpp_ap_config_p256_p384
dpp_ap_config_p384_p256
dpp_ap_config_p384_p384
dpp_ap_config_p521_p256
dpp_ap_config_p521_p384
dpp_ap_config_bp256_bp256
dpp_ap_config_bp384_bp384
dpp_ap_config_bp512_bp512
dpp_ap_config_p256_bp256
dpp_ap_config_bp256_p256
dpp_ap_config_p521_bp512
dpp_ap_config_reconfig_configurator
dpp_auto_connect_legacy
dpp_auto_connect_legacy_ssid_charset
dpp_auto_connect_legacy_sae_1
dpp_auto_connect_legacy_sae_2
dpp_auto_connect_legacy_psk_sae_1
dpp_auto_connect_legacy_psk_sae_2
dpp_auto_connect_legacy_psk_sae_3
dpp_auto_connect_legacy_pmf_required
dpp_test_vector_p_256
dpp_test_vector_p_256_b
dpp_test_vector_p_521
dpp_pkex
dpp_pkex_v2
dpp_pkex_p256
dpp_pkex_p384
dpp_pkex_p521
dpp_pkex_bp256
dpp_pkex_bp384
dpp_pkex_bp512
dpp_pkex_config
dpp_pkex_no_identifier
dpp_pkex_identifier_mismatch
dpp_pkex_identifier_mismatch2
dpp_pkex_identifier_mismatch3
dpp_pkex_test_vector
dpp_pkex_code_mismatch
dpp_pkex_code_mismatch_limit
dpp_pkex_curve_mismatch
dpp_pkex_curve_mismatch_failure
dpp_pkex_curve_mismatch_failure2
dpp_pkex_exchange_resp_processing_failure
dpp_pkex_commit_reveal_req_processing_failure
dpp_pkex_config2
dpp_pkex_no_responder
dpp_pkex_after_retry
dpp_pkex_hostapd_responder
dpp_pkex_v2_hostapd_responder
dpp_pkex_hostapd_initiator
dpp_pkex_v2_hostapd_initiator
dpp_pkex_hostapd_initiator_fallback
dpp_pkex_hostapd_initiator_no_response
dpp_pkex_hostapd_errors
dpp_pkex_nak_curve_change
dpp_pkex_nak_curve_change2
dpp_hostapd_configurator
dpp_hostapd_configurator_responder
dpp_hostapd_configurator_fragmentation
dpp_hostapd_enrollee_fragmentation
dpp_hostapd_enrollee_gas_timeout
dpp_hostapd_enrollee_gas_timeout_comeback
dpp_hostapd_enrollee_gas_errors
dpp_hostapd_enrollee_gas_proto
dpp_hostapd_enrollee_gas_tx_status_errors
dpp_hostapd_configurator_override_objects
dpp_own_config
dpp_own_config_group_id
dpp_proto_after_wrapped_data_auth_req
dpp_auth_req_stop_after_ack
dpp_auth_req_retries
dpp_auth_req_retries_multi_chan
dpp_proto_after_wrapped_data_auth_resp
dpp_proto_after_wrapped_data_auth_conf
dpp_proto_after_wrapped_data_conf_req
dpp_proto_after_wrapped_data_conf_resp
dpp_proto_stop_at_pkex_exchange_resp
dpp_proto_stop_at_pkex_cr_req
dpp_proto_stop_at_pkex_cr_resp
dpp_proto_network_introduction
dpp_hostapd_auth_conf_timeout
dpp_tcp
dpp_tcp_port
dpp_tcp_mutual
dpp_tcp_mutual_hostapd_conf
dpp_tcp_conf_init
dpp_tcp_conf_init_hostapd_enrollee
dpp_tcp_controller_management_hostapd
dpp_tcp_controller_management_hostapd2
dpp_tcp_controller_start_failure
dpp_tcp_init_failure
dpp_controller_rx_failure
dpp_controller_rx_errors
dpp_conn_status_success
dpp_conn_status_wrong_passphrase
dpp_conn_status_no_ap
dpp_conn_status_connector_mismatch
dpp_conn_status_assoc_reject
dpp_conn_status_success_hostapd_configurator
dpp_mud_url
dpp_mud_url_hostapd
dpp_config_save
dpp_config_save2
dpp_config_save3
dpp_nfc_uri
dpp_nfc_uri_hostapd
dpp_nfc_uri_hostapd_tag_read
dpp_nfc_negotiated_handover
dpp_nfc_negotiated_handover_diff_curve
dpp_nfc_negotiated_handover_hostapd_sel
dpp_nfc_negotiated_handover_hostapd_req
dpp_nfc_errors_hostapd
dpp_with_p2p_device
dpp_pfs_ap_0
dpp_pfs_ap_1
dpp_pfs_ap_2
dpp_pfs_connect_cmd
dpp_pfs_connect_cmd_ap_2
dpp_pfs_connect_cmd_ap_2_sae
dpp_pfs_ap_0_sta_ver1
dpp_pfs_errors
dpp_qr_code_auth_rand_mac_addr
dpp_enterprise
dpp_enterprise_tcp
dpp_enterprise_tcp2
dpp_qr_code_config_event_initiator
dpp_qr_code_config_event_initiator_set_comeback
dpp_qr_code_config_event_initiator_slow
dpp_qr_code_config_event_initiator_failure
dpp_qr_code_config_event_initiator_no_response
dpp_qr_code_config_event_initiator_both
dpp_tcp_qr_code_config_event_initiator
dpp_discard_public_action

View File

@ -0,0 +1,163 @@
#CC=ccache gcc
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_TLV=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_EKE=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_FAST=y
CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
CONFIG_USIM_SIMULATOR=y
CONFIG_SIM_SIMULATOR=y
#CONFIG_PCSC=y
CONFIG_IPV6=y
CONFIG_DRIVER_NONE=y
CONFIG_PKCS12=y
CONFIG_CTRL_IFACE=unix
CONFIG_WPA_CLI_EDIT=y
CONFIG_OCSP=y
#CONFIG_ELOOP_POLL=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_DEBUG_FILE=y
CONFIG_WPS=y
#CONFIG_WPS_STRICT=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
CONFIG_WPS_ER=y
#CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CFLAGS += -I/usr/include/libnl3
CONFIG_LIBNL32=y
CONFIG_IBSS_RSN=y
CONFIG_AP=y
CONFIG_MESH=y
CONFIG_P2P=y
CONFIG_WIFI_DISPLAY=y
CONFIG_ACS=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_TDLS=y
CONFIG_TDLS_TESTING=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_HE_OVERRIDES=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_EXT_PASSWORD_TEST=y
CONFIG_EXT_PASSWORD_FILE=y
CONFIG_EAP_UNAUTH_TLS=y
CONFIG_SAE=y
CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_WNM=y
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_c += -fsanitize=undefined
#LIBS_p += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
CONFIG_OWE=y
CONFIG_DPP=y
CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y

View File

@ -0,0 +1,47 @@
From a53a6a67dc121b45d611318e2a37815cc209839c Mon Sep 17 00:00:00 2001
From: Juliusz Sosinowicz <juliusz@wolfssl.com>
Date: Fri, 19 Apr 2024 16:41:38 +0200
Subject: [PATCH] Fixes for running tests under UML
- Apply commit ID fix from more recent commit
- priv_sz and pub_sz are checked and fail on UML. Probably because stack is zeroed out.
---
src/crypto/crypto_wolfssl.c | 2 +-
tests/hwsim/run-all.sh | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
index 00ecf61352..a57fa50697 100644
--- a/src/crypto/crypto_wolfssl.c
+++ b/src/crypto/crypto_wolfssl.c
@@ -785,7 +785,7 @@ int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey,
int ret = -1;
WC_RNG rng;
DhKey *dh = NULL;
- word32 priv_sz, pub_sz;
+ word32 priv_sz = prime_len, pub_sz = prime_len;
if (TEST_FAIL())
return -1;
diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh
index ee48cd0581..75c3a58b52 100755
--- a/tests/hwsim/run-all.sh
+++ b/tests/hwsim/run-all.sh
@@ -15,7 +15,13 @@ export LOGDIR
if [ -z "$DBFILE" ]; then
DB=""
else
- DB="-S $DBFILE --commit $(git rev-parse HEAD)"
+ DB="-S $DBFILE"
+ if [ -z "$COMMITID" ]; then
+ COMMITID="$(git rev-parse HEAD)"
+ fi
+ if [ -n "$COMMITID" ]; then
+ DB="$DB --commit $COMMITID"
+ fi
if [ -n "$BUILD" ]; then
DB="$DB -b $BUILD"
fi
--
2.34.1

View File

@ -0,0 +1,119 @@
#CC=ccache gcc
CONFIG_DRIVER_NONE=y
CONFIG_DRIVER_NL80211=y
CONFIG_RSN_PREAUTH=y
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_TLS=wolfssl
CONFIG_EAP=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_TLS=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_GTC=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_PAX=y
CONFIG_EAP_PSK=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_FAST=y
#CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_UNAUTH_TLS=y
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
CONFIG_EAP_EKE=y
CONFIG_PKCS12=y
CONFIG_RADIUS_SERVER=y
CONFIG_IPV6=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_FULL_DYNAMIC_VLAN=y
CONFIG_VLAN_NETLINK=y
CONFIG_LIBNL32=y
CONFIG_LIBNL3_ROUTE=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_WPS=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
#CONFIG_WPS_STRICT=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_P2P_MANAGER=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_WPA_CLI_EDIT=y
CONFIG_ACS=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_WNM=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_SQLITE=y
CONFIG_SAE=y
#CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CFLAGS += -DCONFIG_RADIUS_TEST
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_h += -fsanitize=undefined
#LIBS_n += -fsanitize=undefined
#LIBS_c += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_TAXONOMY=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_OWE=y
#CONFIG_DPP=y
#CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y
CONFIG_AIRTIME_POLICY=y

View File

@ -0,0 +1,270 @@
sae
sae_password_ecc
sae_pmksa_caching
sae_pmksa_caching_pmkid
sae_pmksa_caching_disabled
sae_groups
sae_group_nego
sae_group_nego_no_match
sae_anti_clogging
sae_forced_anti_clogging
sae_mixed
sae_and_psk
sae_and_psk2
sae_wpa3_roam
sae_mixed_mfp
sae_mfp
sae_missing_password
sae_key_lifetime_in_memory
sae_oom_wpas
sae_proto_ecc
sae_proto_ffc
sae_proto_commit_delayed
sae_proto_commit_replay
sae_proto_confirm_replay
sae_proto_hostapd
sae_proto_hostapd_ecc
sae_proto_hostapd_ffc
sae_proto_hostapd_status_126
sae_proto_hostapd_status_127
sae_reflection_attack_ecc
sae_reflection_attack_ecc_internal
sae_commit_override
sae_commit_override2
sae_commit_invalid_scalar_element_ap
sae_commit_invalid_element_ap
sae_commit_invalid_scalar_element_sta
sae_commit_invalid_element_sta
sae_anti_clogging_proto
sae_no_random
sae_bignum_failure_unsafe_group
sae_invalid_anti_clogging_token_req
sae_password
sae_password_short
sae_password_long
sae_connect_cmd
sae_password_id
sae_password_id_ecc
sae_password_id_ffc
sae_password_id_only
sae_password_id_pwe_looping
sae_password_id_pwe_check_ap
sae_password_id_pwe_check_sta
sae_forced_anti_clogging_pw_id
sae_reauth
sae_sync
sae_confirm_immediate
sae_confirm_immediate2
sae_pwe_group_19
sae_pwe_group_20
sae_pwe_group_21
sae_pwe_group_1
sae_pwe_group_2
sae_pwe_group_22
sae_pwe_h2e_only_ap
sae_pwe_h2e_only_ap_sta_forcing_loop
sae_pwe_loop_only_ap
sae_h2e_rejected_groups
sae_h2e_rejected_groups_unexpected
sae_h2e_password_id
sae_pwe_in_psk_ap
sae_auth_restart
sae_rsne_mismatch
sae_h2e_rsnxe_mismatch
sae_h2e_rsnxe_mismatch_retries
sae_h2e_rsnxe_mismatch_assoc
sae_h2e_rsnxe_mismatch_ap
sae_h2e_rsnxe_mismatch_ap2
sae_h2e_rsnxe_mismatch_ap3
sae_forced_anti_clogging_h2e
sae_forced_anti_clogging_h2e_loop
sae_okc
sae_okc_sta_only
sae_okc_pmk_lifetime
sae_pmk_lifetime
sae_and_psk_multiple_passwords
sae_pmf_roam
sae_ocv_pmk
sae_ocv_pmk_failure
sae_reject
eap_tls_pkcs8_pkcs5_v2_des3
eap_tls_pkcs8_pkcs5_v15
eap_tls_sha512
eap_tls_sha384
eap_tls_errors
eap_proto_peap_errors_server
eap_proto_peap_errors
ap_wpa2_delayed_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission
ap_wpa2_delayed_m1_m3_retransmission2
ap_wpa2_delayed_group_m1_retransmission
ap_wpa2_delayed_group_m1_retransmission_igtk
ap_wpa2_delayed_m1_m3_zero_tk
ap_wpa2_plaintext_m1_m3
ap_wpa2_plaintext_m1_m3_pmf
ap_wpa2_plaintext_m3
ap_wpa2_plaintext_group_m1
ap_wpa2_plaintext_group_m1_pmf
ap_wpa2_test_command_failures
ap_wpa2_gtk_initial_rsc_tkip
ap_wpa2_gtk_initial_rsc_ccmp
ap_wpa2_gtk_initial_rsc_ccmp_256
ap_wpa2_gtk_initial_rsc_gcmp
ap_wpa2_gtk_initial_rsc_gcmp_256
ap_wpa2_igtk_initial_rsc_aes_128_cmac
ap_wpa2_igtk_initial_rsc_bip_gmac_128
ap_wpa2_igtk_initial_rsc_bip_gmac_256
ap_wpa2_igtk_initial_rsc_bip_cmac_256
ap_wpa2_psk
ap_wpa2_psk_file
ap_wpa2_psk_file_keyid
ap_wpa2_psk_mem
ap_wpa2_ptk_rekey
ap_wpa2_ptk_rekey_blocked_ap
ap_wpa2_ptk_rekey_blocked_sta
ap_wpa2_ptk_rekey_anonce
ap_wpa2_ptk_rekey_ap
ap_wpa2_sha256_ptk_rekey
ap_wpa2_sha256_ptk_rekey_ap
ap_wpa2_psk_file_errors
ap_wpa2_psk_wildcard_ssid
ap_wpa2_gtk_rekey
ap_wpa2_gtk_rekey_request
ap_wpa2_gtk_rekey_failure
ap_wpa2_gmk_rekey
ap_wpa2_strict_rekey
ap_wpa2_psk_ext
ap_wpa2_psk_unexpected
ap_wpa2_psk_ext_retry_msg_3
ap_wpa2_psk_ext_retry_msg_3b
ap_wpa2_psk_ext_retry_msg_3c
ap_wpa2_psk_ext_retry_msg_3d
ap_wpa2_psk_ext_retry_msg_3e
ap_wpa2_psk_ext_delayed_ptk_rekey
ap_wpa2_psk_ext_eapol
ap_wpa2_psk_ext_eapol_retry1
ap_wpa2_psk_ext_eapol_retry1b
ap_wpa2_psk_ext_eapol_retry1c
ap_wpa2_psk_ext_eapol_retry1d
ap_wpa2_psk_ext_eapol_type_diff
ap_wpa2_psk_ext_eapol_key_info
ap_wpa2_psk_wep
ap_wpa2_psk_ifdown
ap_wpa2_psk_drop_first_msg_4
ap_wpa2_psk_disable_enable
ap_wpa2_psk_incorrect_passphrase
ap_wpa2_psk_no_random
ap_wpa2_psk_assoc_rsn
ap_wpa2_psk_ft_workaround
ap_wpa2_psk_assoc_rsn_pmkid
ap_wpa2_eapol_retry_limit
ap_wpa2_disable_eapol_retry
ap_wpa2_disable_eapol_retry_group
ap_wpa2_psk_mic_0
ap_wpa2_psk_local_error
ap_wpa2_psk_inject_assoc
ap_wpa2_psk_ap_control_port
ap_wpa2_psk_ap_control_port_disabled
ap_wpa2_psk_rsne_mismatch_ap
ap_wpa2_psk_rsne_mismatch_ap2
ap_wpa2_psk_rsne_mismatch_ap3
ap_wpa2_psk_rsnxe_mismatch_ap
ap_wpa2_psk_ext_key_id_ptk_rekey_ap0
ap_wpa2_psk_ext_key_id_ptk_rekey_ap1
ap_wpa2_psk_ext_key_id_ptk_rekey_ap2
ap_wpa2_psk_ext_key_id_ptk_rekey_sta0
ap_wpa2_psk_ext_key_id_ptk_rekey_sta1
ap_wpa2_psk_ext_key_id_ptk_rekey_sta2
ap_wpa2_eap_sim
ap_wpa2_eap_sim_sql
ap_wpa2_eap_sim_config
ap_wpa2_eap_sim_id_0
ap_wpa2_eap_sim_id_1
ap_wpa2_eap_sim_id_2
ap_wpa2_eap_sim_id_3
ap_wpa2_eap_sim_ext
ap_wpa2_eap_sim_ext_replace_sim
ap_wpa2_eap_sim_ext_replace_sim2
ap_wpa2_eap_sim_ext_replace_sim3
ap_wpa2_eap_sim_ext_auth_fail
ap_wpa2_eap_sim_change_bssid
ap_wpa2_eap_sim_no_change_set
ap_wpa2_eap_sim_ext_anonymous
ap_wpa2_eap_sim_ext_anonymous_no_pseudonym
ap_wpa2_eap_sim_oom
ap_wpa2_eap_aka
ap_wpa2_eap_aka_sql
ap_wpa2_eap_aka_config
ap_wpa2_eap_aka_ext
ap_wpa2_eap_aka_ext_auth_fail
ap_wpa2_eap_aka_prime
ap_wpa2_eap_aka_prime_sql
ap_wpa2_eap_aka_prime_ext_auth_fail
ap_wpa2_eap_aka_prime_ext
ap_wpa2_eap_ttls_invalid_phase2
ap_wpa2_eap_ttls_eap_vendor
ap_wpa2_eap_fast_eap_sim
ap_wpa2_eap_fast_eap_aka
ap_wpa2_eap_peap_params
ap_wpa2_eap_peap_eap_gtc
ap_wpa2_eap_peap_eap_vendor
ap_wpa2_eap_ttls_server_cert_hash
ap_wpa2_eap_ttls_server_cert_hash_invalid
ap_wpa2_eap_pwd
ap_wpa2_eap_pwd_nthash
ap_wpa2_eap_pwd_salt_sha1
ap_wpa2_eap_pwd_salt_sha256
ap_wpa2_eap_pwd_salt_sha512
ap_wpa2_eap_pwd_groups
ap_wpa2_eap_pwd_invalid_group
ap_wpa2_eap_pwd_disabled_group
ap_wpa2_eap_pwd_as_frag
ap_wpa2_eap_gpsk
ap_wpa2_eap_sake
ap_wpa2_eap_ikev2
ap_wpa2_eap_ikev2_as_frag
ap_wpa2_eap_ikev2_oom
ap_wpa2_eap_pax
ap_wpa2_eap_psk
ap_wpa2_eap_psk_oom
ap_wpa2_eap_interactive
ap_wpa2_eap_ext_enable_network_while_connected
ap_wpa2_eap_vendor_test
ap_wpa2_eap_vendor_test_oom
ap_wpa2_eap_ttls_ocsp_revoked
ap_wpa2_eap_ttls_ocsp_unknown
ap_wpa2_eap_ttls_optional_ocsp_unknown
ap_wpa2_eap_ttls_long_duration
ap_wpa2_eap_ttls_server_cert_eku_client
ap_wpa2_eap_ttls_server_cert_eku_client_server
ap_wpa2_eap_ttls_dh_params
ap_wpa2_eap_ttls_dh_params_dsa
ap_wpa2_eap_ttls_dh_params_not_found
ap_wpa2_eap_ttls_dh_params_invalid
ap_wpa2_eap_ttls_dh_params_blob
ap_wpa2_eap_ttls_dh_params_server
ap_wpa2_eap_ttls_dh_params_dsa_server
ap_wpa2_eap_reauth
ap_wpa2_eap_reauth_ptk_rekey_blocked_sta
ap_wpa2_eap_request_identity_message
ap_wpa2_eap_sim_aka_result_ind
ap_wpa2_eap_sim_zero_db_timeout
ap_wpa2_eap_too_many_roundtrips
ap_wpa2_eap_too_many_roundtrips_server
ap_wpa2_eap_too_many_roundtrips_server2
ap_wpa2_eap_expanded_nak
ap_wpa2_eap_sql
ap_wpa2_eap_non_ascii_identity
ap_wpa2_eap_non_ascii_identity2
ap_wpa2_eap_unexpected_wep_eapol_key
ap_wpa2_eap_oom
ap_wpa2_eap_sim_db
ap_wpa2_eap_sim_db_sqlite
ap_wpa2_eap_assoc_rsn
ap_wpa2_eap_status
ap_wpa2_eap_gpsk_ptk_rekey_ap
ap_wpa2_eap_wildcard_ssid
ap_wpa2_eap_psk_mac_addr_change
ap_wpa2_eap_server_get_id
ap_wpa2_radius_server_get_id
ap_wpa2_eap_sake_no_control_port

View File

@ -0,0 +1,163 @@
#CC=ccache gcc
#CONFIG_TLS=openssl
CONFIG_TLS=wolfssl
#CONFIG_TLS=internal
#CONFIG_INTERNAL_LIBTOMMATH=y
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_TLV=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_EKE=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_FAST=y
#CONFIG_EAP_TEAP=y
CONFIG_EAP_IKEV2=y
ifeq ($(CONFIG_TLS), wolfssl)
CONFIG_EAP_PWD=y
endif
ifeq ($(CONFIG_TLS), openssl)
CONFIG_EAP_PWD=y
endif
CONFIG_USIM_SIMULATOR=y
CONFIG_SIM_SIMULATOR=y
#CONFIG_PCSC=y
CONFIG_IPV6=y
CONFIG_DRIVER_NONE=y
CONFIG_PKCS12=y
CONFIG_CTRL_IFACE=unix
CONFIG_WPA_CLI_EDIT=y
CONFIG_OCSP=y
#CONFIG_ELOOP_POLL=y
CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211AC=y
CONFIG_IEEE80211AX=y
CONFIG_OCV=y
CONFIG_DEBUG_FILE=y
CONFIG_WPS=y
#CONFIG_WPS_STRICT=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
CONFIG_WPS_ER=y
#CONFIG_WPS_REG_DISABLE_OPEN=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CFLAGS += -I/usr/include/libnl3
CONFIG_LIBNL32=y
CONFIG_IBSS_RSN=y
CONFIG_AP=y
CONFIG_MESH=y
CONFIG_P2P=y
CONFIG_WIFI_DISPLAY=y
CONFIG_ACS=y
CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y
CONFIG_WPA_TRACE=y
CONFIG_WPA_TRACE_BFD=y
CONFIG_TDLS=y
CONFIG_TDLS_TESTING=y
CONFIG_NO_RANDOM_POOL=y
CONFIG_TLSV11=y
CONFIG_TLSV12=y
CONFIG_HT_OVERRIDES=y
CONFIG_VHT_OVERRIDES=y
CONFIG_HE_OVERRIDES=y
CONFIG_DEBUG_LINUX_TRACING=y
CONFIG_INTERWORKING=y
CONFIG_HS20=y
CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y
CONFIG_EXT_PASSWORD_TEST=y
CONFIG_EXT_PASSWORD_FILE=y
CONFIG_EAP_UNAUTH_TLS=y
CONFIG_SAE=y
#CONFIG_SAE_PK=y
CFLAGS += -DALL_DH_GROUPS
CONFIG_WNM=y
CONFIG_FST=y
CONFIG_FST_TEST=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y
# AddressSanitizer (ASan) can be enabled by uncommenting the following lines.
# This can be used as a more efficient memory error detector than valgrind
# (though, with still some CPU and memory cost, so VM cases will need more
# memory allocated for the guest).
#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g
#LIBS += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g
#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g
# Undefined Behavior Sanitizer (UBSan) can be enabled by uncommenting the
# following lines.
#CFLAGS += -Wno-format-nonliteral
#CFLAGS += -fsanitize=undefined
##CFLAGS += -fno-sanitize-recover
#LIBS += -fsanitize=undefined
##LIBS += -fno-sanitize-recover
#LIBS_c += -fsanitize=undefined
#LIBS_p += -fsanitize=undefined
CONFIG_MBO=y
CONFIG_FILS=y
CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
CONFIG_OWE=y
#CONFIG_DPP=y
#CONFIG_DPP2=y
CONFIG_WEP=y
CONFIG_PASN=y

View File

@ -0,0 +1,23 @@
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
<allow own="fi.epitest.hostap.WPASupplicant"/>
<allow send_destination="fi.epitest.hostap.WPASupplicant"/>
<allow send_interface="fi.epitest.hostap.WPASupplicant"/>
<allow own="fi.w1.wpa_supplicant1"/>
<allow send_destination="fi.w1.wpa_supplicant1"/>
<allow send_interface="fi.w1.wpa_supplicant1"/>
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
</policy>
<policy context="default">
<deny own="fi.epitest.hostap.WPASupplicant"/>
<deny send_destination="fi.epitest.hostap.WPASupplicant"/>
<deny send_interface="fi.epitest.hostap.WPASupplicant"/>
<deny own="fi.w1.wpa_supplicant1"/>
<deny send_destination="fi.w1.wpa_supplicant1"/>
<deny send_interface="fi.w1.wpa_supplicant1"/>
<deny receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
</policy>
</busconfig>

313
.github/workflows/hostap-vm.yml vendored Normal file
View File

@ -0,0 +1,313 @@
name: hostap and wpa-supplicant Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
env:
LINUX_REF: v6.6
jobs:
build_wolfssl:
strategy:
matrix:
include:
- build_id: hostap-vm-build1
wolf_extra_config: --disable-tls13
- build_id: hostap-vm-build2
wolf_extra_config: >-
--enable-wpas-dpp --enable-brainpool --with-eccminsz=192
--enable-tlsv10 --enable-oldtls
name: Build wolfSSL
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 10
steps:
# No way to view the full strategy in the browser (really weird)
- name: Print strategy
run: |
cat <<EOF
${{ toJSON(matrix) }}
EOF
- if: ${{ runner.debug }}
name: Enable wolfSSL debug logging
run: |
echo "wolf_debug_flags=--enable-debug" >> $GITHUB_ENV
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: >-
--enable-wpas CPPFLAGS=-DWOLFSSL_STATIC_RSA
${{ env.wolf_debug_flags }} ${{ matrix.wolf_extra_config }}
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build_id }}
path: build-dir
retention-days: 5
build_uml_linux:
name: Build UML (UserMode Linux)
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 10
steps:
- name: Checking if we have kernel in cache
uses: actions/cache@v4
id: cache
with:
path: linux/linux
key: ${{ env.LINUX_REF }}
lookup-only: true
- name: Checkout hostap
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: julek-wolfssl/hostap-mirror
path: hostap
- name: Checkout linux
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: torvalds/linux
path: linux
- name: Compile linux
if: steps.cache.outputs.cache-hit != 'true'
run: |
cp hostap/tests/hwsim/vm/kernel-config.uml linux/.config
cd linux
yes "" | ARCH=um make -j $(nproc)
hostap_test:
strategy:
fail-fast: false
matrix:
# should hostapd be compiled with wolfssl
hostapd: [true, false]
# should wpa_supplicant be compiled with wolfssl
wpa_supplicant: [true, false]
# Fix the versions of hostap and osp to not break testing when a new
# patch is added in to osp. Tests are read from the corresponding
# configs/hostap_ref/tests file.
config: [
{
hostap_ref: hostap_2_10,
remove_teap: true,
# TLS 1.3 does not work for this version
build_id: hostap-vm-build1,
},
# Test the dpp patch
{
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
build_id: hostap-vm-build2
},
{
hostap_ref: 07c9f183ea744ac04585fb6dd10220c75a5e2e74,
osp_ref: e1876fbbf298ee442bc7ab8561331ebc7de17528,
build_id: hostap-vm-build2
},
]
exclude:
# don't test openssl on both sides
- hostapd: false
wpa_supplicant: false
# no hostapd support for dpp yet
- hostapd: true
config: {
hostap_ref: b607d2723e927a3446d89aed813f1aa6068186bb,
osp_ref: ad5b52a49b3cc2a5bfb47ccc1d6a5137132e9446,
build_id: hostap-vm-build2
}
name: hwsim test
# For openssl 1.1
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 45
needs: [build_wolfssl, build_uml_linux]
steps:
- name: Checking if we have kernel in cache
uses: actions/cache/restore@v4
id: cache
with:
path: linux/linux
key: ${{ env.LINUX_REF }}
fail-on-cache-miss: true
- name: show file structure
run: tree
# No way to view the full strategy in the browser (really weird)
- name: Print strategy
run: |
cat <<EOF
${{ toJSON(matrix) }}
EOF
- name: Print computed job run ID
run: |
SHA_SUM=$(sha256sum << 'END_OF_HEREDOC' | cut -d " " -f 1
${{ toJSON(github) }}
END_OF_HEREDOC
)
echo "our_job_run_id=$SHA_SUM" >> $GITHUB_ENV
echo Our job run ID is $SHA_SUM
- name: Checkout wolfSSL
uses: actions/checkout@v4
with:
path: wolfssl
- name: Download lib
uses: actions/download-artifact@v4
with:
name: ${{ matrix.config.build_id }}
path: build-dir
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# hostap dependencies
sudo apt-get install -y libpcap0.8 libpcap-dev curl libcurl4-openssl-dev \
libnl-3-dev binutils-dev libssl-dev libiberty-dev libnl-genl-3-dev \
libnl-route-3-dev libdbus-1-dev bridge-utils tshark
sudo pip3 install pycryptodome
- name: Checkout hostap
uses: actions/checkout@v4
with:
repository: julek-wolfssl/hostap-mirror
path: hostap
ref: ${{ matrix.config.hostap_ref }}
- name: Update certs
working-directory: hostap/tests/hwsim/auth_serv
run: ./update.sh
- if: ${{ matrix.config.osp_ref }}
name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
ref: ${{ matrix.config.osp_ref }}
- if: ${{ matrix.config.osp_ref }}
name: Apply patch files
working-directory: hostap
run: |
for f in $GITHUB_WORKSPACE/osp/hostap-patches/pending/*
do
patch -p1 < $f
done
- name: Apply extra patches
working-directory: hostap
run: |
FILE=$GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/extra.patch
if [ -f "$FILE" ]; then
patch -p1 < $FILE
fi
- if: ${{ matrix.hostapd }}
name: Setup hostapd config file
run: |
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/hostapd.config \
hostap/hostapd/.config
cat <<EOF >> hostap/hostapd/.config
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
EOF
- if: ${{ matrix.wpa_supplicant }}
name: Setup wpa_supplicant config file
run: |
cp wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/wpa_supplicant.config \
hostap/wpa_supplicant/.config
cat <<EOF >> hostap/wpa_supplicant/.config
CFLAGS += -I$GITHUB_WORKSPACE/build-dir/include -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
LIBS += -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib
EOF
- name: Build hostap and wpa_supplicant
working-directory: hostap/tests/hwsim/
run: ./build.sh
- if: ${{ matrix.hostapd }}
name: Confirm hostapd linking with wolfSSL
run: ldd hostap/hostapd/hostapd | grep wolfssl
- if: ${{ matrix.wpa_supplicant }}
name: Confirm wpa_supplicant linking with wolfSSL
run: ldd hostap/wpa_supplicant/wpa_supplicant | grep wolfssl
- if: ${{ matrix.config.remove_teap }}
name: Remove EAP-TEAP from test configuration
working-directory: hostap/tests/hwsim/auth_serv
run: |
sed -e 's/"erp-teap@example.com"\tTEAP//' -i eap_user.conf
sed -e 's/"erp-teap@example.com"\tMSCHAPV2\t"password"\t\[2\]//' -i eap_user.conf
sed -e 's/"TEAP"\t\tTEAP//' -i eap_user.conf
sed -e 's/TEAP,//' -i eap_user.conf
- if: ${{ runner.debug }}
name: Enable hostap debug logging
run: |
echo "hostap_debug_flags=--debug" >> $GITHUB_ENV
- name: Run tests
id: testing
working-directory: hostap/tests/hwsim/
run: |
cat <<EOF >> vm/vm-config
KERNELDIR=$GITHUB_WORKSPACE/linux
KVMARGS="-cpu host"
EOF
# Run tests in increments of 200 to not stall out the parallel-vm script
while mapfile -t -n 200 ary && ((${#ary[@]})); do
TESTS=$(printf '%s\n' "${ary[@]}" | tr '\n' ' ')
HWSIM_RES=0 # Not set when command succeeds
./vm/parallel-vm.py ${{ env.hostap_debug_flags }} --nocurses $(nproc) $TESTS || HWSIM_RES=$?
if [ "$HWSIM_RES" -ne "0" ]; then
# Let's re-run the failing tests. We gather the failed tests from the log file.
FAILED_TESTS=$(grep 'failed tests' /tmp/hwsim-test-logs/*-parallel.log | sed 's/failed tests: //' | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
printf 'failed tests: %s\n' "$FAILED_TESTS"
./vm/parallel-vm.py ${{ env.hostap_debug_flags }} --nocurses $(nproc) $FAILED_TESTS
fi
rm -r /tmp/hwsim-test-logs
done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests
# The logs are quite big. It hasn't been useful so far so let's not waste
# precious gh space.
#- name: zip logs
# if: ${{ failure() && steps.testing.outcome == 'failure' }}
# working-directory: hostap/tests/hwsim/
# run: |
# rm /tmp/hwsim-test-logs/latest
# zip -9 -r logs.zip /tmp/hwsim-test-logs
#
#- name: Upload failure logs
# if: ${{ failure() && steps.testing.outcome == 'failure' }}
# uses: actions/upload-artifact@v4
# with:
# name: hostap-logs-${{ env.our_job_run_id }}
# path: hostap/tests/hwsim/logs.zip
# retention-days: 5

77
.github/workflows/ipmitool.yml vendored Normal file
View File

@ -0,0 +1,77 @@
name: ipmitool Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all
install: true
# Don't run tests as this config is tested in many other places
check: false
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-ipmitool
path: build-dir
retention-days: 5
build_ipmitool:
strategy:
fail-fast: false
matrix:
git_ref: [ c3939dac2c060651361fc71516806f9ab8c38901 ]
name: ${{ matrix.git_ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-ipmitool
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Build ipmitool
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: ipmitool/ipmitool
ref: ${{ matrix.git_ref }}
path: ipmitool
patch-file: $GITHUB_WORKSPACE/osp/ipmitool/*-${{ matrix.git_ref }}.patch
configure: --with-wolfssl=$GITHUB_WORKSPACE/build-dir
# No checks included and not running since it depends on hardware
check: false
- name: Confirm built with wolfSSL
working-directory: ipmitool
run: |
ldd src/ipmitool | grep wolfssl
ldd src/ipmievd | grep wolfssl

85
.github/workflows/jwt-cpp.yml vendored Normal file
View File

@ -0,0 +1,85 @@
name: jwt-cpp Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all
install: true
# Don't run tests as this config is tested in many other places
check: false
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-jwt-cpp
path: build-dir
retention-days: 5
build_pam-ipmi:
strategy:
fail-fast: false
matrix:
ref: [ 0.6.0 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install libgtest-dev
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-jwt-cpp
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Checkout jwt-cpp
uses: actions/checkout@v4
with:
repository: Thalhammer/jwt-cpp
path: jwt-cpp
ref: v${{ matrix.ref }}
- name: Build pam-ipmi
working-directory: jwt-cpp
run: |
patch -p1 < ../osp/jwt-cpp/${{ matrix.ref }}.patch
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig \
cmake -B build -DJWT_SSL_LIBRARY:STRING=wolfSSL -DJWT_BUILD_TESTS=ON .
make -j -C build
ldd ./build/tests/jwt-cpp-test | grep wolfssl
- name: Run jwt-cpp tests
working-directory: jwt-cpp
run: ./build/tests/jwt-cpp-test

96
.github/workflows/krb5.yml vendored Normal file
View File

@ -0,0 +1,96 @@
name: Kerberos 5 Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 5
steps:
- name: workaround high-entropy ASLR
# not needed after either an update to llvm or runner is done
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-krb CC='gcc -fsanitize=address'
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-krb5
path: build-dir
retention-days: 5
krb5_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
ref: [ 1.21.1 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 8
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-krb5
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Checkout krb5
uses: actions/checkout@v4
with:
repository: krb5/krb5
ref: krb5-${{ matrix.ref }}-final
path: krb5
- name: Apply patch
working-directory: ./krb5
run: |
patch -p1 < $GITHUB_WORKSPACE/osp/krb5/Patch-for-Kerberos-5-${{ matrix.ref }}.patch
- name: workaround high-entropy ASLR
# not needed after either an update to llvm or runner is done
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Build krb5
working-directory: ./krb5/src
run: |
autoreconf -ivf
# Using rpath because LD_LIBRARY_PATH is overwritten during testing
export WOLFSSL_CFLAGS="-I$GITHUB_WORKSPACE/build-dir/include -I$GITHUB_WORKSPACE/build-dir/include/wolfssl -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib"
export WOLFSSL_LIBS="-lwolfssl -L$GITHUB_WORKSPACE/build-dir/lib -Wl,-rpath=$GITHUB_WORKSPACE/build-dir/lib"
./configure --with-crypto-impl=wolfssl --with-tls-impl=wolfssl --disable-pkinit \
CFLAGS='-fsanitize=address' LDFLAGS='-fsanitize=address'
CFLAGS='-fsanitize=address' LDFLAGS='-fsanitize=address' make -j
- name: Run tests
working-directory: ./krb5/src
run: |
CFLAGS='-fsanitize=address' LDFLAGS='-fsanitize=address' make -j check

67
.github/workflows/libssh2.yml vendored Normal file
View File

@ -0,0 +1,67 @@
name: libssh2 Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all
check: false # config is already tested in many other PRB's
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-libssh2
path: build-dir
retention-days: 5
libssh2_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
ref: [ 1.11.0 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 8
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-libssh2
path: build-dir
- name: Build and test libssh2
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: libssh2/libssh2
ref: libssh2-${{ matrix.ref }}
path: libssh2
configure: --with-crypto=wolfssl --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
check: true
- name: Confirm libssh2 built with wolfSSL
working-directory: ./libssh2
run: ldd src/.libs/libssh2.so | grep wolfssl

79
.github/workflows/libvncserver.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: libvncserver Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all
install: true
# Don't run tests as this config is tested in many other places
check: false
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-libvncserver
path: build-dir
retention-days: 5
build_libvncserver:
strategy:
fail-fast: false
matrix:
ref: [ 0.9.13 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-libvncserver
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Checkout libvncserver
uses: actions/checkout@v4
with:
repository: LibVNC/libvncserver
path: libvncserver
ref: LibVNCServer-${{ matrix.ref }}
- name: Build libvncserver
working-directory: libvncserver
run: |
patch -p1 < ../osp/libvncserver/${{ matrix.ref }}.patch
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig \
cmake -B build -DWITH_GNUTLS=OFF -DWITH_OPENSSL=OFF -DWITH_GCRYPT=OFF -DWITH_WOLFSSL=ON .
make -j -C build VERBOSE=1
ldd build/libvncclient.so | grep wolfssl
ldd build/libvncserver.so | grep wolfssl
- name: Run libvncserver tests
working-directory: libvncserver
run: make -C build test

14
.github/workflows/memcached.sh vendored Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
if [ -z "$GITHUB_WORKSPACE" ]; then
echo '$GITHUB_WORKSPACE is not set'
exit 1
fi
if [ -z "$HOST_ROOT" ]; then
echo '$HOST_ROOT is not set'
exit 1
fi
chroot $HOST_ROOT make -C $GITHUB_WORKSPACE/memcached \
-j$(nproc) PARALLEL=$(nproc) test_tls

116
.github/workflows/memcached.yml vendored Normal file
View File

@ -0,0 +1,116 @@
name: memcached Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-memcached
install: true
- name: Bundle Docker entry point
run: cp wolfssl/.github/workflows/memcached.sh build-dir/bin
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-memcached
path: build-dir
retention-days: 5
memcached_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
include:
- ref: 1.6.22
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-memcached
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y libevent-dev libevent-2.1-7 automake pkg-config make libio-socket-ssl-perl
- name: Checkout memcached
uses: actions/checkout@v4
with:
repository: memcached/memcached
ref: 1.6.22
path: memcached
- name: Configure and build memcached
run: |
cd $GITHUB_WORKSPACE/memcached/
patch -p1 < $GITHUB_WORKSPACE/osp/memcached/memcached_1.6.22.patch
./autogen.sh
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig ./configure --enable-wolfssl
make -j$(nproc)
- name: Confirm memcached built with wolfSSL
working-directory: ./memcached
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
ldd memcached | grep wolfssl
- name: Run memcached tests
working-directory: ./memcached
run: |
# Retry up to three times
# Using docker because interrupting the tests doesn't close running
# background servers. They can become daemonized and then all re-runs
# will always fail.
chmod +x $GITHUB_WORKSPACE/build-dir/bin/memcached.sh
for i in {1..3}; do
echo "-------- RUNNING TESTS --------"
MEMCACHED_RES=0 # Not set when command succeeds
# Tests should usually take less than 4 minutes. If already taking
# 5 minutes then they are probably stuck. Interrupt and re-run.
time timeout -s SIGKILL 5m docker run -v /:/host \
-v $GITHUB_WORKSPACE/build-dir/bin/memcached.sh:/memcached.sh \
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
-e HOST_ROOT=/host \
-e LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH \
alpine:latest /memcached.sh || MEMCACHED_RES=$?
if [ "$MEMCACHED_RES" -eq "0" ]; then
break
fi
done
echo "test ran $i times"
if [ "$MEMCACHED_RES" -ne "0" ]; then
exit $MEMCACHED_RES
fi

63
.github/workflows/multi-arch.yml vendored Normal file
View File

@ -0,0 +1,63 @@
name: Multiple architectures
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
my_matrix:
name: Multi-arch test
strategy:
fail-fast: false
matrix:
include:
- HOST: aarch64-linux-gnu
CC: aarch64-linux-gnu-gcc
ARCH: arm64
EXTRA_OPTS: --enable-sp-asm --enable-armasm
- HOST: arm-linux-gnueabihf
CC: arm-linux-gnueabihf-gcc
ARCH: armhf
EXTRA_OPTS: --enable-sp-asm
- HOST: riscv64-linux-gnu
CC: riscv64-linux-gnu-gcc
ARCH: riscv64
# Config to ensure CPUs without Thumb instructions compiles
- HOST: arm-linux-gnueabi
CC: arm-linux-gnueabi-gcc
CFLAGS: -marm -DWOLFSSL_SP_ARM_ARCH=6
ARCH: armel
EXTRA_OPTS: --enable-sp-asm
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 10
steps:
- name: Install Compiler
run: |
sudo apt update
sudo apt install -y crossbuild-essential-${{ matrix.ARCH }} qemu-user
- uses: actions/checkout@v4
- name: Build
env:
CC: ${{ matrix.CC }}
CFLAGS: ${{ matrix.CFLAGS }}
QEMU_LD_PREFIX: /usr/${{ matrix.HOST }}
run: ./autogen.sh && ./configure --host=${{ matrix.HOST }} --enable-all --disable-examples ${{ matrix.EXTRA_OPTS }} && make
- name: Print errors
if: ${{ failure() }}
run: |
if [ -f config.log ] ; then
cat config.log
fi
- name: Run WolfCrypt Tests
env:
QEMU_LD_PREFIX: /usr/${{ matrix.HOST }}
run: ./wolfcrypt/test/testwolfcrypt

62
.github/workflows/multi-compiler.yml vendored Normal file
View File

@ -0,0 +1,62 @@
name: Multiple compilers and versions
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
my_matrix:
name: Compiler test
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-9
CXX: g++-9
OS: ubuntu-latest
- CC: gcc-10
CXX: g++-10
OS: ubuntu-latest
- CC: gcc-11
CXX: g++-11
OS: ubuntu-latest
- CC: gcc-12
CXX: g++-12
OS: ubuntu-latest
- CC: clang-10
CXX: clang++-10
OS: ubuntu-20.04
- CC: clang-11
CXX: clang++-11
OS: ubuntu-20.04
- CC: clang-12
CXX: clang++-12
OS: ubuntu-20.04
- CC: clang-13
CXX: clang++-13
OS: ubuntu-latest
- CC: clang-14
CXX: clang++-14
OS: ubuntu-latest
runs-on: ${{ matrix.OS }}
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- uses: actions/checkout@v4
- name: Build
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
run: ./autogen.sh && ./configure && make && make dist
- name: Show log on errors
if: ${{ failure() }}
run: |
cat config.log

77
.github/workflows/net-snmp.yml vendored Normal file
View File

@ -0,0 +1,77 @@
name: net-snmp Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-net-snmp
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-net-snmp
path: build-dir
retention-days: 5
net-snmp_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
include:
- ref: 5.9.3
test_opts: -e 'agentxperl'
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-net-snmp
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Build net-snmp
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: net-snmp/net-snmp
ref: v${{ matrix.ref }}
path: net-snmp
patch-file: $GITHUB_WORKSPACE/osp/net-snmp/${{ matrix.ref }}.patch
configure: --disable-shared --with-wolfssl=$GITHUB_WORKSPACE/build-dir
check: false
- name: Run net-snmp tests
working-directory: net-snmp
run: |
autoconf --version | grep -P '2\.\d\d' -o > dist/autoconf-version
make -j test TESTOPTS="${{ matrix.test_opts }}"

219
.github/workflows/nginx.yml vendored Normal file
View File

@ -0,0 +1,219 @@
name: nginx Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- if: ${{ runner.debug }}
name: Enable wolfSSL debug logging
run: |
# We don't use --enable-debug since it makes the logs too loud
echo "wolf_debug_flags= CFLAGS='-g3 -O0'" >> $GITHUB_ENV
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-nginx ${{ env.wolf_debug_flags }}
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-nginx
path: build-dir
retention-days: 5
nginx_check:
strategy:
fail-fast: false
matrix:
include:
# in general we want to pass all tests that match *ssl*
- ref: 1.25.0
test-ref: 5b2894ea1afd01a26c589ce11f310df118e42592
# Following tests pass with sanitizer on
sanitize-ok: >-
h2_ssl_proxy_cache.t h2_ssl.t h2_ssl_variables.t h2_ssl_verify_client.t
mail_imap_ssl.t mail_ssl_conf_command.t mail_ssl_session_reuse.t
mail_ssl.t proxy_ssl_certificate_empty.t proxy_ssl_certificate.t
proxy_ssl_certificate_vars.t proxy_ssl_conf_command.t proxy_ssl_name.t
ssl_certificate_chain.t ssl_certificate_perl.t ssl_certificates.t
ssl_certificate.t ssl_client_escaped_cert.t ssl_conf_command.t
ssl_crl.t ssl_curve.t ssl_engine_keys.t ssl_ocsp.t ssl_password_file.t
ssl_proxy_protocol.t ssl_proxy_upgrade.t ssl_reject_handshake.t
ssl_session_reuse.t ssl_session_ticket_key.t ssl_sni_reneg.t
ssl_sni_sessions.t ssl_sni.t ssl_stapling.t ssl.t ssl_verify_client.t
ssl_verify_depth.t stream_proxy_ssl_certificate.t stream_proxy_ssl_certificate_vars.t
stream_proxy_ssl_conf_command.t stream_proxy_ssl_name_complex.t
stream_proxy_ssl_name.t stream_ssl_certificate.t stream_ssl_conf_command.t
stream_ssl_preread_alpn.t stream_ssl_preread_protocol.t stream_ssl_preread.t
stream_ssl_realip.t stream_ssl_session_reuse.t stream_ssl.t stream_ssl_variables.t
stream_ssl_verify_client.t stream_upstream_zone_ssl.t upstream_zone_ssl.t
uwsgi_ssl_certificate.t uwsgi_ssl_certificate_vars.t uwsgi_ssl.t
uwsgi_ssl_verify.t
# Following tests do not pass with sanitizer on (with OpenSSL too)
sanitize-not-ok: >-
grpc_ssl.t h2_proxy_request_buffering_ssl.t h2_proxy_ssl.t
proxy_request_buffering_ssl.t proxy_ssl_keepalive.t proxy_ssl.t
proxy_ssl_verify.t stream_proxy_protocol_ssl.t stream_proxy_ssl.t
stream_proxy_ssl_verify.t stream_ssl_alpn.t
- ref: 1.24.0
test-ref: 212d9d003886e3a24542855fb60355a417f037de
# Following tests pass with sanitizer on
sanitize-ok: >-
h2_ssl_proxy_cache.t h2_ssl.t h2_ssl_variables.t h2_ssl_verify_client.t
mail_imap_ssl.t mail_ssl_conf_command.t mail_ssl_session_reuse.t mail_ssl.t
proxy_ssl_certificate_empty.t proxy_ssl_certificate.t proxy_ssl_certificate_vars.t
proxy_ssl_name.t ssl_certificate_chain.t ssl_certificate_perl.t ssl_certificates.t
ssl_certificate.t ssl_client_escaped_cert.t ssl_conf_command.t ssl_crl.t
ssl_engine_keys.t ssl_ocsp.t ssl_password_file.t ssl_proxy_protocol.t
ssl_proxy_upgrade.t ssl_reject_handshake.t ssl_session_reuse.t
ssl_session_ticket_key.t ssl_sni_reneg.t ssl_sni_sessions.t ssl_sni.t
ssl_stapling.t ssl.t ssl_verify_client.t stream_proxy_ssl_certificate.t
stream_proxy_ssl_certificate_vars.t stream_proxy_ssl_name_complex.t
stream_proxy_ssl_name.t stream_ssl_alpn.t stream_ssl_certificate.t
stream_ssl_conf_command.t stream_ssl_preread_alpn.t stream_ssl_preread_protocol.t
stream_ssl_preread.t stream_ssl_realip.t stream_ssl_session_reuse.t stream_ssl.t
stream_ssl_variables.t stream_ssl_verify_client.t stream_upstream_zone_ssl.t
upstream_zone_ssl.t uwsgi_ssl_certificate.t uwsgi_ssl_certificate_vars.t
uwsgi_ssl.t uwsgi_ssl_verify.t
# Following tests do not pass with sanitizer on (with OpenSSL too)
sanitize-not-ok: >-
grpc_ssl.t h2_proxy_request_buffering_ssl.t h2_proxy_ssl.t
proxy_request_buffering_ssl.t proxy_ssl_conf_command.t proxy_ssl_keepalive.t
proxy_ssl.t proxy_ssl_verify.t ssl_curve.t ssl_verify_depth.t
stream_proxy_protocol_ssl.t stream_proxy_ssl_conf_command.t stream_proxy_ssl.t
stream_proxy_ssl_verify.t
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 6
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-nginx
path: build-dir
- name: Install dependencies
run: |
sudo cpan -iT Proc::Find Net::SSLeay IO::Socket::SSL
- name: Checkout wolfssl-nginx
uses: actions/checkout@v4
with:
repository: wolfssl/wolfssl-nginx
path: wolfssl-nginx
- name: Checkout nginx
uses: actions/checkout@v4
with:
repository: nginx/nginx
path: nginx
ref: release-${{ matrix.ref }}
- name: Apply nginx patch
working-directory: nginx
run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl.patch
- if: ${{ runner.debug }}
name: Apply nginx debug patch
working-directory: nginx
run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl-debug.patch
- name: Checkout nginx-tests
uses: actions/checkout@v4
with:
repository: nginx/nginx-tests
path: nginx-tests
ref: ${{ matrix.test-ref }}
- name: Apply nginx-tests patch
working-directory: nginx-tests
run: patch -p1 < ../wolfssl-nginx/nginx-tests-patches/*${{ matrix.test-ref }}.patch
- name: Build nginx without sanitizer
working-directory: nginx
run: |
./auto/configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-http_ssl_module \
--with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
--with-http_v2_module --with-mail --with-mail_ssl_module
make -j
- name: Confirm nginx built with wolfSSL
working-directory: nginx
run: ldd objs/nginx | grep wolfssl
- if: ${{ runner.debug }}
name: Run nginx-tests without sanitizer (debug)
working-directory: nginx-tests
run: |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y \
TEST_NGINX_BINARY=../nginx/objs/nginx prove -v ${{ matrix.sanitize-not-ok }}
- if: ${{ !runner.debug }}
name: Run nginx-tests without sanitizer
working-directory: nginx-tests
run: |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
prove ${{ matrix.sanitize-not-ok }}
- if: ${{ runner.debug }}
name: Enable wolfSSL debug logging
run: |
echo "nginx_c_flags=-O0" >> $GITHUB_ENV
- name: workaround high-entropy ASLR
# not needed after either an update to llvm or runner is done
run: sudo sysctl vm.mmap_rnd_bits=28
- name: Build nginx with sanitizer
working-directory: nginx
run: |
./auto/configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-http_ssl_module \
--with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
--with-http_v2_module --with-mail --with-mail_ssl_module \
--with-cc-opt='-fsanitize=address -DNGX_DEBUG_PALLOC=1 -g3 ${{ env.nginx_c_flags }}' \
--with-ld-opt='-fsanitize=address ${{ env.nginx_c_flags }}'
make -j
- name: Confirm nginx built with wolfSSL
working-directory: nginx
run: ldd objs/nginx | grep wolfssl
- if: ${{ runner.debug }}
name: Run nginx-tests with sanitizer (debug)
working-directory: nginx-tests
run: |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y \
TEST_NGINX_BINARY=../nginx/objs/nginx prove -v ${{ matrix.sanitize-ok }}
- if: ${{ !runner.debug }}
name: Run nginx-tests with sanitizer
working-directory: nginx-tests
run: |
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
prove ${{ matrix.sanitize-ok }}

43
.github/workflows/no-malloc.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: No Malloc Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
make_check:
strategy:
matrix:
config: [
# Add new configs here
'--enable-rsa --enable-keygen --disable-dh CFLAGS="-DWOLFSSL_NO_MALLOC"',
]
name: make check
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 6
steps:
- uses: actions/checkout@v4
name: Checkout wolfSSL
- name: Test wolfSSL
run: |
./autogen.sh
./configure ${{ matrix.config }}
make
./wolfcrypt/test/testwolfcrypt
- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ] ; then
cat test-suite.log
fi

37
.github/workflows/ocsp.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: OCSP Test
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
ocsp_stapling:
name: ocsp stapling
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout wolfSSL
uses: actions/checkout@v4
- name: Build wolfSSL
run: autoreconf -ivf && ./configure --enable-ocsp --enable-ocspstapling && make
- name: Start OCSP responder 1
run: openssl ocsp -port 22221 -ndays 1000 -index certs/ocsp/index-intermediate1-ca-issued-certs.txt -rsigner certs/ocsp/ocsp-responder-cert.pem -rkey certs/ocsp/ocsp-responder-key.pem -CA certs/ocsp/intermediate1-ca-cert.pem &
- name: Start OCSP responder 2
run: openssl ocsp -port 22220 -ndays 1000 -index certs/ocsp/index-ca-and-intermediate-cas.txt -rsigner certs/ocsp/ocsp-responder-cert.pem -rkey certs/ocsp/ocsp-responder-key.pem -CA certs/ocsp/root-ca-cert.pem &
- name: Start TLS server
run: ./examples/server/server -p 11111 -c ./certs/ocsp/server1-cert.pem -k ./certs/ocsp/server1-key.pem -d &
- name: Test Look Up
run: ./examples/client/client -A ./certs/ocsp/root-ca-cert.pem -o

77
.github/workflows/openssh.yml vendored Normal file
View File

@ -0,0 +1,77 @@
name: openssh Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: >-
--enable-openssh --enable-dsa --with-max-rsa-bits=8192
--enable-intelasm --enable-sp-asm
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-openssh
path: build-dir
retention-days: 5
openssh_check:
strategy:
fail-fast: false
matrix:
include:
- git_ref: 'V_9_6_P1'
osp_ver: '9.6'
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-openssh
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Build and test openssh
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: openssh/openssh-portable
ref: ${{ matrix.git_ref }}
path: openssh
patch-file: $GITHUB_WORKSPACE/osp/openssh-patches/openssh-${{ matrix.osp_ver }}.patch
configure: --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-rpath=-Wl,-rpath=
check: false
# make tests take >20 minutes. Consider limiting?
- name: Run tests
working-directory: ./openssh
run: |
# Run all the tests except (t-exec) as it takes too long
make file-tests interop-tests extra-tests unit

86
.github/workflows/openvpn.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: OpenVPN Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-openvpn
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-openvpn
path: build-dir
retention-days: 5
openvpn_check:
strategy:
fail-fast: false
matrix:
# List of refs to test
ref: [ release/2.6, v2.6.0, master ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 10
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-openvpn
path: build-dir
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev \
linux-libc-dev man2html libcmocka-dev python3-docutils \
libtool automake autoconf libnl-genl-3-dev libnl-genl-3-200
- name: workaround high-entropy ASLR
# not needed after either an update to llvm or runner is done
run: sudo sysctl vm.mmap_rnd_bits=28
- if: ${{ matrix.ref != 'master' }}
name: Build and test openvpn with fsanitize
run: |
echo 'extra_c_flags=CC="gcc -fsanitize=address" CFLAGS="-fno-omit-frame-pointer -O2"' >> $GITHUB_ENV
- name: Build and test openvpn
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: OpenVPN/openvpn
ref: ${{ matrix.ref }}
path: openvpn
configure: >-
--with-crypto-library=wolfssl
WOLFSSL_CFLAGS="-I$GITHUB_WORKSPACE/build-dir/include/ -I$GITHUB_WORKSPACE/build-dir/include/wolfssl"
WOLFSSL_LIBS="-L$GITHUB_WORKSPACE/build-dir/lib -lwolfssl"
${{ env.extra_c_flags }}
check: true
- name: Confirm OpenVPN built with wolfSSL
working-directory: ./openvpn
run: ldd src/openvpn/openvpn | grep wolfssl

152
.github/workflows/os-check.yml vendored Normal file
View File

@ -0,0 +1,152 @@
name: Ubuntu-Macos-Windows Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
make_check:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
config: [
# Add new configs here
'',
'--enable-all --enable-asn=template',
'--enable-all --enable-asn=original',
'--enable-harden-tls',
'--enable-tls13 --enable-session-ticket --enable-dtls --enable-dtls13
--enable-opensslextra --enable-sessioncerts
CPPFLAGS=''-DWOLFSSL_DTLS_NO_HVR_ON_RESUME -DHAVE_EXT_CACHE
-DWOLFSSL_TICKET_HAVE_ID -DHAVE_EX_DATA -DSESSION_CACHE_DYNAMIC_MEM'' ',
'--enable-all --enable-secure-renegotiation',
'--enable-all --enable-haproxy --enable-quic',
'--enable-dtls --enable-dtls13 --enable-earlydata
--enable-session-ticket --enable-psk
CPPFLAGS=''-DWOLFSSL_DTLS13_NO_HRR_ON_RESUME'' ',
]
name: make check
runs-on: ${{ matrix.os }}
# This should be a safe limit for the tests to run.
timeout-minutes: 14
steps:
- name: Build and test wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
configure: ${{ matrix.config }}
check: true
make_user_settings:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
user-settings: [
# Add new user_settings.h here
'examples/configs/user_settings_all.h',
]
name: make user_setting.h
runs-on: ${{ matrix.os }}
# This should be a safe limit for the tests to run.
timeout-minutes: 14
steps:
- name: Build and test wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
configure: --enable-usersettings
check: true
user-settings: ${{ matrix.user-settings }}
make_user_settings_testwolfcrypt:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
user-settings: [
# Add new user_settings.h here
'examples/configs/user_settings_min_ecc.h',
'examples/configs/user_settings_wolfboot_keytools.h',
'examples/configs/user_settings_wolftpm.h',
'examples/configs/user_settings_wolfssh.h',
'examples/configs/user_settings_tls12.h',
]
name: make user_setting.h (testwolfcrypt only)
runs-on: ${{ matrix.os }}
# This should be a safe limit for the tests to run.
timeout-minutes: 14
steps:
- name: Build and test wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
configure: --enable-usersettings --disable-examples
check: false
user-settings: ${{ matrix.user-settings }}
- name: Run wolfcrypt/test/testwolfcrypt
run: ./wolfcrypt/test/testwolfcrypt
# Has to be dedicated function due to the sed call
make_user_all:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
name: make user_setting.h (with sed)
runs-on: ${{ matrix.os }}
# This should be a safe limit for the tests to run.
timeout-minutes: 14
steps:
- uses: actions/checkout@v4
- if: ${{ matrix.os == 'macos-latest' }}
run: brew install automake libtool
- run: ./autogen.sh
- name: user_settings_all.h with compatibility layer
run: |
cp ./examples/configs/user_settings_all.h user_settings.h
sed -i -e "s/if 0/if 1/" user_settings.h
./configure --enable-usersettings
make
make check
windows_build:
name: Windows Build Test
runs-on: windows-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 6
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
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- 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}}
- name: Run Test
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Release/x64/testsuite.exe

54
.github/workflows/packaging.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: Packaging Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Package wolfSSL
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 10
steps:
- name: Checkout wolfSSL
uses: actions/checkout@v4
- name: Configure wolfSSL
run: |
autoreconf -ivf
./configure --enable-distro --enable-all \
--disable-openssl-compatible-defaults --enable-intelasm \
--enable-dtls13 --enable-dtls-mtu \
--enable-sp-asm --disable-examples --disable-silent-rules
- name: Make sure OPENSSL_COMPATIBLE_DEFAULTS is not present in options.h
run: |
! grep OPENSSL_COMPATIBLE_DEFAULTS wolfssl/options.h
- name: Build wolfSSL .deb
run: make deb-docker
- name: Build wolfSSL .rpm
run: make rpm-docker
- name: Confirm packages built
run: |
DEB_COUNT=$(find -name 'libwolfssl*.deb' | wc -l)
if [ "$DEB_COUNT" != "2" ]; then
echo Did not find exactly two deb packages!!!
exit 1
fi
RPM_COUNT=$(find -name 'wolfssl*.rpm' | wc -l)
if [ "$RPM_COUNT" != "4" ]; then
echo Did not find exactly four rpm packages!!!
exit 1
fi

86
.github/workflows/pam-ipmi.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: pam-ipmi Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-all
install: true
# Don't run tests as this config is tested in many other places
check: false
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-pam-ipmi
path: build-dir
retention-days: 5
build_pam-ipmi:
strategy:
fail-fast: false
matrix:
git_ref: [ e4b13e6725abb178f62ee897fe1c0e81b06a9431 ]
name: ${{ matrix.git_ref }}
runs-on: ubuntu-latest
needs: build_wolfssl
steps:
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install libpam-dev ninja-build
sudo pip3 install meson
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-pam-ipmi
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Checkout pam-ipmi
uses: actions/checkout@v4
with:
repository: openbmc/pam-ipmi
path: pam-ipmi
ref: ${{ matrix.git_ref }}
- name: Build pam-ipmi
working-directory: pam-ipmi
run: |
patch -p1 < ../osp/pam-ipmi/*-${{ matrix.git_ref }}.patch
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig meson setup build
ninja -C build
- name: Confirm built with wolfSSL
working-directory: pam-ipmi
run: |
ldd ./build/src/pam_ipmisave/pam_ipmisave.so | grep wolfssl

76
.github/workflows/socat.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: socat Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-maxfragment --enable-opensslall --enable-opensslextra --enable-dtls --enable-oldtls --enable-tlsv10 --enable-ipv6 'CPPFLAGS=-DWOLFSSL_NO_DTLS_SIZE_CHECK -DOPENSSL_COMPATIBLE_DEFAULTS'
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-socat
path: build-dir
retention-days: 3
socat_check:
strategy:
fail-fast: false
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 30
needs: build_wolfssl
steps:
- name: Install prereqs
run:
sudo apt-get install build-essential autoconf libtool pkg-config clang libc++-dev
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-socat
path: build-dir
- name: Download socat
run: curl -O http://www.dest-unreach.org/socat/download/socat-1.8.0.0.tar.gz && tar xvf socat-1.8.0.0.tar.gz
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Build socat
working-directory: ./socat-1.8.0.0
run: |
patch -p1 < ../osp/socat/1.8.0.0/socat-1.8.0.0.patch
autoreconf -vfi
./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir
make
- name: Run socat tests
working-directory: ./socat-1.8.0.0
run: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
export SHELL=/bin/bash
SOCAT=$GITHUB_WORKSPACE/socat-1.8.0.0/socat ./test.sh -t 0.5 --expect-fail 146,216,309,310,386,399,402,459,460,467,468,478,492,528,530

74
.github/workflows/stunnel.yml vendored Normal file
View File

@ -0,0 +1,74 @@
name: stunnel Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfssl:
name: Build wolfSSL
# Just to keep it the same as the testing target
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
steps:
- name: Build wolfSSL
uses: wolfSSL/actions-build-autotools-project@v1
with:
path: wolfssl
configure: --enable-stunnel
install: true
- name: Upload built lib
uses: actions/upload-artifact@v4
with:
name: wolf-install-stunnel
path: build-dir
retention-days: 5
stunnel_check:
strategy:
fail-fast: false
matrix:
# List of releases to test
ref: [ 5.67 ]
name: ${{ matrix.ref }}
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 4
needs: build_wolfssl
steps:
- name: Download lib
uses: actions/download-artifact@v4
with:
name: wolf-install-stunnel
path: build-dir
- name: Checkout OSP
uses: actions/checkout@v4
with:
repository: wolfssl/osp
path: osp
- name: Build and test stunnel
uses: wolfSSL/actions-build-autotools-project@v1
with:
repository: mtrojnar/stunnel
ref: stunnel-${{ matrix.ref }}
path: stunnel
patch-file: $GITHUB_WORKSPACE/osp/stunnel/${{ matrix.ref }}/stunnel-${{ matrix.ref }}.patch
configure: --enable-wolfssl SSLDIR=$GITHUB_WORKSPACE/build-dir
check: true
- name: Confirm stunnel built with wolfSSL
working-directory: ./stunnel
run: ldd src/stunnel | grep wolfssl

128
.github/workflows/zephyr.yml vendored Normal file
View File

@ -0,0 +1,128 @@
name: Zephyr tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
run_test:
name: Build and run
strategy:
fail-fast: false
matrix:
config:
- zephyr-ref: v3.4.0
zephyr-sdk: 0.16.1
- zephyr-ref: v3.5.0
zephyr-sdk: 0.16.3
- zephyr-ref: v2.7.4
zephyr-sdk: 0.16.3
runs-on: ubuntu-latest
# This should be a safe limit for the tests to run.
timeout-minutes: 25
steps:
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# most of the ci-base zephyr docker image packages
sudo apt-get install -y zip bridge-utils uml-utilities \
git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake \
cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc \
gcovr git git-core gnupg gperf gtk-sharp2 help2man iproute2 lcov libcairo2-dev \
libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev \
libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make \
net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip \
python3-ply python3-setuptools python-is-python3 qemu rsync socat srecord sudo \
texinfo unzip wget ovmf xz-utils
- name: Install west
run: sudo pip install west
- name: Init west workspace
run: west init --mr ${{ matrix.config.zephyr-ref }} zephyr
- name: Update west.yml
working-directory: zephyr/zephyr
run: |
REF=$(echo '${{ github.ref }}' | sed -e 's/\//\\\//g')
sed -e 's/remotes:/remotes:\n \- name: wolfssl\n url\-base: https:\/\/github.com\/${{ github.repository_owner }}/' -i west.yml
sed -e "s/projects:/projects:\n \- name: wolfssl\n path: modules\/crypto\/wolfssl\n remote: wolfssl\n revision: $REF/" -i west.yml
- name: Update west workspace
working-directory: zephyr
run: west update -n -o=--depth=1
- name: Export zephyr
working-directory: zephyr
run: west zephyr-export
- name: Install pip dependencies
working-directory: zephyr
run: sudo pip install -r zephyr/scripts/requirements.txt
- name: Install zephyr SDK
run: |
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ matrix.config.zephyr-sdk }}/zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
tar xf zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
cd zephyr-sdk-${{ matrix.config.zephyr-sdk }}
./setup.sh -h -c -t x86_64-zephyr-elf
- name: Fix options for 2.7.4
if: ${{ matrix.config.zephyr-ref == 'v2.7.4' }}
working-directory: zephyr/modules/crypto/wolfssl
run: |
sed -i -e 's/CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE/CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE/g' $(find -name prj.conf)
- name: Run wolfssl test
id: wolfssl-test
working-directory: zephyr
run: |
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test -vvv
rm -rf zephyr/twister-out
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_test/sample.crypto.wolfssl_test_no_malloc -vvv
rm -rf zephyr/twister-out
- name: Run wolfssl TLS sock test
# Results in a page fault that I can't trace
if: ${{ matrix.config.zephyr-ref != 'v2.7.4' }}
id: wolfssl-tls-sock
working-directory: zephyr
run: |
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock -vvv
rm -rf zephyr/twister-out
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_sock/sample.crypto.wolfssl_tls_sock_no_malloc -vvv
rm -rf zephyr/twister-out
- name: Run wolfssl TLS thread test
if: ${{ matrix.config.zephyr-ref != 'v2.7.4' }}
id: wolfssl-tls-thread
working-directory: zephyr
run: |
./zephyr/scripts/twister -T modules/crypto/wolfssl --test zephyr/samples/wolfssl_tls_thread/sample.crypto.wolfssl_tls_thread -vvv
rm -rf zephyr/twister-out
- name: Zip failure logs
if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }}
run: |
zip -9 -r logs.zip zephyr/twister-out
- name: Upload failure logs
if: ${{ failure() && (steps.wolfssl-test.outcome == 'failure' || steps.wolfssl-tls-sock.outcome == 'failure' || steps.wolfssl-tls-thread.outcome == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: zephyr-client-test-logs
path: logs.zip
retention-days: 5

164
.gitignore vendored
View File

@ -5,18 +5,21 @@ ctaocrypt/src/src/
*.o
*.patch
*.deps
*.d
*.libs
*.cache
.dirstamp
*.user
configure
config.*
!cmake/config.in
*Debug/
*Release/
*.ncb
*.suo
*.sdf
*.opensdf
*.cmd
ipch/
build-aux/
rpm/spec
@ -24,6 +27,7 @@ rpm/spec
stamp-h
cyassl/options.h
wolfssl/options.h
.build_params
libtool.m4
aclocal.m4
aminclude.am
@ -60,6 +64,8 @@ ctaocrypt/benchmark/benchmark
ctaocrypt/test/testctaocrypt
wolfcrypt/benchmark/benchmark
wolfcrypt/test/testwolfcrypt
examples/async/async_client
examples/async/async_server
examples/benchmark/tls_bench
examples/client/client
examples/echoclient/echoclient
@ -69,19 +75,26 @@ examples/sctp/sctp-server
examples/sctp/sctp-server-dtls
examples/sctp/sctp-client
examples/sctp/sctp-client-dtls
examples/asn1/asn1
examples/pem/pem
server_ready
snifftest
output
mcapi/test
testsuite/testsuite
tests/unit
testsuite/testsuite.test
tests/unit.test
tests/bio_write_test.txt
test-write-dhparams.pem
testsuite/*.der
testsuite/*.pem
testsuite/*.raw
testsuite/*.obj
testsuite/*.pdb
testsuite/*.idb
tests/unit
tests/unit.test
tests/bio_write_test.txt
tests/test-log-dump-to-file.txt
tests/cert_cache.tmp
test-write-dhparams.pem
cert.der
cert.pem
certecc.der
@ -203,14 +216,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
@ -226,6 +231,24 @@ IDE/MDK-ARM/LPC43xx/LPC43xx/
*.gcno
*.gcda
*.gcov
*.dgcov
!linuxkm/Makefile
/Kbuild
linuxkm/*.ko
linuxkm/*.ko.signed
linuxkm/Module.symvers
linuxkm/built-in.a
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-*
@ -266,23 +289,6 @@ mqx/wolfcrypt_benchmark/.settings
mqx/wolfcrypt_benchmark/.cwGeneratedFileSetLog
mqx/wolfcrypt_benchmark/SaAnalysispointsManager.apconfig
# User Crypto example build
wolfcrypt/user-crypto/aclocal.m4
wolfcrypt/user-crypto/config.guess
wolfcrypt/user-crypto/autom4te.cache
wolfcrypt/user-crypto/config.log
wolfcrypt/user-crypto/config.status
wolfcrypt/user-crypto/config.sub
wolfcrypt/user-crypto/depcomp
wolfcrypt/user-crypto/install-sh
wolfcrypt/user-crypto/libtool
wolfcrypt/user-crypto/ltmain.sh
wolfcrypt/user-crypto/m4
wolfcrypt/user-crypto/missing
wolfcrypt/user-crypto/Makefile.in
wolfcrypt/user-crypto/lib/libusercrypto.*
*.hzs
# wolfSSL CSharp wrapper
wrapper/CSharp/x64/
@ -307,6 +313,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/
@ -315,6 +325,10 @@ wolfcrypt/src/port/intel/qat_test
# Arduino Generated Files
/IDE/ARDUINO/wolfSSL
scripts/memtest.txt
/IDE/ARDUINO/Arduino_README_prepend.md.tmp
/IDE/ARDUINO/library.properties.tmp
/IDE/ARDUINO/library.properties.tmp.backup
/IDE/ARDUINO/PREPENDED_README.md
# Doxygen generated files
doc/doxygen_warnings
@ -323,6 +337,8 @@ doc/pdf
# XCODE Index
IDE/XCODE/Index
IDE/**/xcshareddata
IDE/**/DerivedData
# ARM DS-5 && Eclipse
\.settings/
@ -335,3 +351,93 @@ IDE/XCODE/Index
/IDE/Renesas/e2studio/Projects/test/trash
/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
# Xilinx
/IDE/XilinxSDK/data
# Emacs
*~
# CMake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
# GDB Settings
\.gdbinit
libFuzzer
# Pycharm and other IDEs
\.idea
# FIPS
XXX-fips-test
# ASYNC
/wolfAsyncCrypt
/async
# Generated user_settings_asm.h.
user_settings_asm.h
# VisualGDB
**/.visualgdb
# Espressif sdk config default should be saved in sdkconfig.defaults
# we won't track the actual working sdkconfig files
/IDE/Espressif/**/sdkconfig
/IDE/Espressif/**/sdkconfig.old
# MPLAB
/IDE/MPLABX16/wolfssl.X/dist/default/
/IDE/MPLABX16/wolfssl.X/.generated_files
/IDE/MPLABX16/wolfcrypt_test.X/dist/default/
/IDE/MPLABX16/wolfcrypt_test.X/.generated_files
# auto-created CMake backups
**/CMakeLists.txt.old
# MagicCrypto (ARIA Cipher)
MagicCrypto
# CMake build directory
/out
/out_temp
# debian packaging
debian/changelog
debian/control
*.deb
# PlatformIO
/**/.pio
/**/.vscode/.browse.c_cpp.db*
/**/.vscode/c_cpp_properties.json
/**/.vscode/launch.json
/**/.vscode/ipch
/**/sdkconfig.esp32dev

2762
CMakeLists.txt Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

56
Docker/Dockerfile Normal file
View File

@ -0,0 +1,56 @@
ARG DOCKER_BASE_IMAGE=ubuntu:22.04
FROM $DOCKER_BASE_IMAGE
USER root
# Set timezone to UTC
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
ARG DEPS_WOLFSSL="build-essential autoconf libtool clang clang-tools zlib1g-dev libuv1-dev libpam0g-dev valgrind git linux-headers-generic gcc-multilib g++-multilib libpcap-dev bubblewrap gdb iputils-ping lldb bsdmainutils netcat binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu"
ARG DEPS_LIBOQS="astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind git"
ARG DEPS_UDP_PROXY="wget libevent-dev"
ARG DEPS_TESTS="abi-dumper libcurl4-openssl-dev tcpdump libpsl-dev python3-pandas python3-tabulate libnl-genl-3-dev libcap-ng-dev"
ARG DEPS_TOOLS="ccache clang-tidy maven"
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
&& apt install -y ${DEPS_WOLFSSL} ${DEPS_LIBOQS} ${DEPS_UDP_PROXY} ${DEPS_TESTS} ${DEPS_TOOLS} \
&& apt clean -y && rm -rf /var/lib/apt/lists/*
# Add 'docker' user
ARG USER=docker
ARG UID=1000
ARG GID=1000
RUN groupadd -f -g ${GID} docker && ( getent passwd ${UID} || useradd -ms /bin/bash ${USER} -u ${UID} -g ${GID} )
# Add github.com as an SSH known host
RUN ssh -o StrictHostKeyChecking=no -T git@github.com; cat ~/.ssh/known_hosts >> /etc/ssh/ssh_known_hosts
# install ccache
RUN mkdir -p /opt/ccache/bin && for prog in gcc g++ cc c++ cpp arm-none-eabi-c++ arm-none-eabi-cpp arm-none-eabi-gcc arm-none-eabi-g++; do ln -s /usr/bin/ccache /opt/ccache/bin/$(basename $prog); done
ENV PATH /opt/ccache/bin:$PATH
# install liboqs
RUN git clone --single-branch https://github.com/open-quantum-safe/liboqs.git && cd liboqs && git checkout db08f12b5a96aa6582a82aac7f65cf8a4d8b231f \
&& mkdir build && cd build && cmake -DOQS_DIST_BUILD=ON -DOQS_USE_CPUFEATURE_INSTRUCTIONS=OFF -DOQS_USE_OPENSSL=0 .. && make -j8 all && make install && cd ../.. && rm -rf liboqs
RUN mkdir /opt/sources
# install liblms
RUN cd /opt/sources && git clone --single-branch https://github.com/cisco/hash-sigs.git && cd hash-sigs && git checkout b0631b8891295bf2929e68761205337b7c031726 \
&& sed -i 's/USE_OPENSSL 1/USE_OPENSSL 0/g' sha256.h && make -j4 hss_lib_thread.a
# Install pkixssh to /opt/pkixssh for X509 interop testing with wolfSSH
RUN mkdir /var/empty
RUN cd /opt/sources && wget -q -O- https://roumenpetrov.info/secsh/src/pkixssh-14.1.1.tar.gz | tar xzf - && cd pkixssh-14.1.1 && ./configure --prefix=/opt/pkixssh/ --exec-prefix=/opt/pkixssh/ && make install
# Install udp/tcp-proxy
RUN cd /opt/sources && git clone --depth=1 --single-branch --branch=main http://github.com/wolfssl/udp-proxy && cd udp-proxy && make && cp tcp_proxy udp_proxy /bin/.
# Allow non-root to use tcpdump (will need NET_RAW and NET_ADMIN capability when running the container)
RUN setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/tcpdump
# Allow non-root to use gdb on processes (will need SYS_PTRACE capability when running the container)
RUN setcap 'CAP_SYS_PTRACE+eip' /usr/bin/gdb
# Add in Jenkins userID
RUN for i in $(seq 1001 1010); do ( getent passwd ${i} || useradd -ms /bin/bash jenkins${i} -u ${i} -g ${GID} ); done
USER ${UID}:${GID}

View File

@ -0,0 +1,11 @@
ARG DOCKER_BASE_IMAGE=wolfssl/wolfssl-builder
FROM $DOCKER_BASE_IMAGE
USER root
ARG DEPS_TESTING="gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu gcc-powerpc-linux-gnu gcc-powerpc64-linux-gnu gcc-arm-none-eabi"
RUN DEBIAN_FRONTEND=noninteractive apt update \
&& apt install -y ${DEPS_TESTING} \
&& apt clean -y && rm -rf /var/lib/apt/lists/*
USER docker

12
Docker/OpenWrt/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
# This Dockerfile is used in conjunction with the docker-OpenWrt.yml GitHub Action.
ARG DOCKER_BASE_CONTAINER=openwrt/rootfs:x86-64-snapshot
FROM $DOCKER_BASE_CONTAINER
RUN mkdir -p /var/lock # Fix for parent container
COPY libwolfssl.so /tmp/libwolfssl.so
RUN export LIBWOLFSSL=$(ls /usr/lib/libwolfssl.so.* -1); \
rm ${LIBWOLFSSL} && ln -s /tmp/libwolfssl.so ${LIBWOLFSSL}
# for debugging purposes to make sure the correct library is tested
RUN ls -Ll /usr/lib/libwolfssl* && ldd /lib/libustream-ssl.so | grep wolfssl
COPY runTests.sh /tmp/.
RUN /tmp/runTests.sh

13
Docker/OpenWrt/README.md Normal file
View File

@ -0,0 +1,13 @@
This container is really only useful in conjunction with the GitHub Workflow
found in .github/workflows/docker-OpenWrt.yml. The idea is that we will
compile a new libwolfssl that gets placed in official OpenWrt containers to
run some tests ensuring the library is still compatible with existing
binaries.
To run the test locally, build libwolfssl.so (or download from the GitHub Action)
and put it in Docker/OpenWrt. Then switch to that folder and run:
docker build -t openwrt --build-args DOCKER_BASE_CONTAINER=<openwrtContainer> .
where 'openwrtContainer' => "openwrt/rootfs:x86-64-22.03-SNAPSHOT" or similar
This should run some sample tests. The resulting container then can be used to
evaluate OpenWrt with the latest wolfSSL library.

27
Docker/OpenWrt/runTests.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
runCMD() { # usage: runCMD "<command>" "<retVal>"
TMP_FILE=$(mktemp)
eval $1 > $TMP_FILE 2>&1
RETVAL=$?
if [ "$RETVAL" != "$2" ]; then
echo "Command ($1) returned ${RETVAL}, but expected $2. Error output:"
cat $TMP_FILE
exit 1
fi
}
# Successful tests
runCMD "ldd /lib/libustream-ssl.so" 0
# Temporary workaround: comment out missing kmods repo line for 21.02 specifically.
# Remove after fixed upstream.
runCMD "sed '\/src\/gz openwrt_kmods https:\/\/downloads.openwrt.org\/releases\/21.02-SNAPSHOT\/targets\/x86\/64\/kmods\/5.4.238-1-5a722da41bc36de95a7195be6fce1b45/s//#&/' -i /etc/opkg/distfeeds.conf" 0
runCMD "opkg update" 0
runCMD "uclient-fetch 'https://letsencrypt.org'" 0
# Negative tests
runCMD "uclient-fetch --ca-certificate=/dev/null 'https://letsencrypt.org'" 5
runCMD "uclient-fetch 'https://self-signed.badssl.com/'" 5
runCMD "uclient-fetch 'https://untrusted-root.badssl.com/'" 5
runCMD "uclient-fetch 'https://expired.badssl.com/'" 5
echo "All tests passed."

16
Docker/README.md Normal file
View File

@ -0,0 +1,16 @@
# Overview
This is a Docker environment for compiling, testing and running WolfSSL. Use `run.sh` to build everything (Docker container, WolfSSL, etc.). This script takes in arguments that can be passed to `./configure`. For example: `run.sh --enable-all`
When the compilation and tests succeed, you will be dropped in to a shell environment within the container. This can be useful to build other things within the environment. Additional tests can be run as well as debugging of code.
# Docker Hub
These images are also uploaded to the wolfSSL's [Docker Hub page](https://hub.docker.com/orgs/wolfssl/repositories). There is a convenience script here `buildAndPush.sh` that will create the appropriate containers and push them to the repo.
# FAQ
## permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
You need to be added to the `docker` group to run Docker containers. Run `sudo usermod -aG docker $USER`. You may need to restart the Docker daemon.
## Unable to access symlinked files outside of WolfSSL
The volume mounted in the Docker container needs to have all files that your compilation will need. To solve this, you have a couple options:
1. Change the `WOLFSSL_DIR` variable in the `run.sh` to one higher up (by adding `/..` to the path). Then update the `docker build` to include the correct path to the Dockerfile and the `docker run` argument to the working directory (`-w`) to the WolfSSL source directory
2. Move the external repository to within the WolfSSL directory. For example create an `external` folder which has your files. This route may have complications when stashing Git work.

37
Docker/buildAndPush.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# Assume we're in wolfssl/Docker
WOLFSSL_DIR=$(builtin cd ${BASH_SOURCE%/*}/..; pwd)
DOCKER_BUILD_OPTIONS="$1"
if [ "${DOCKER_BASE_IMAGE}" != "" ]; then
DOCKER_BUILD_OPTIONS+=" --build-arg DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}"
fi
NUM_FAILURES=0
CUR_DATE=$(date -u +%F)
echo "Building wolfssl/wolfssl-builder:${CUR_DATE} as ${DOCKER_BUILD_OPTIONS}"
docker build -t wolfssl/wolfssl-builder:${CUR_DATE} ${DOCKER_BUILD_OPTIONS} "${WOLFSSL_DIR}/Docker" && \
docker tag wolfssl/wolfssl-builder:${CUR_DATE} wolfssl/wolfssl-builder:latest && \
docker build --build-arg DOCKER_BASE_IMAGE=wolfssl/wolfssl-builder:${CUR_DATE} -t wolfssl/testing-cross-compiler:${CUR_DATE} "${WOLFSSL_DIR}/Docker" -f Dockerfile.cross-compiler && \
docker tag wolfssl/testing-cross-compiler:${CUR_DATE} wolfssl/testing-cross-compiler:latest
if [ $? -eq 0 ]; then
echo "Pushing containers to DockerHub"
docker push wolfssl/wolfssl-builder:${CUR_DATE} && docker push wolfssl/wolfssl-builder:latest && \
docker push wolfssl/testing-cross-compiler:${CUR_DATE} && docker push wolfssl/testing-cross-compiler:latest
else
echo "Warning: Build wolfssl/wolfssl-builder failed. Continuing"
((NUM_FAILURES++))
fi
echo "Building wolfssl/wolfCLU:${CUR_DATE}"
docker buildx build --pull --push --build-arg DUMMY=${CUR_DATE} -t wolfssl/wolfclu:${CUR_DATE} --platform=linux/amd64,linux/arm64,linux/arm/v7 "${WOLFSSL_DIR}/Docker/wolfCLU" && \
docker buildx build --pull --push --build-arg DUMMY=${CUR_DATE} -t wolfssl/wolfclu:latest --platform=linux/amd64,linux/arm64,linux/arm/v7 "${WOLFSSL_DIR}/Docker/wolfCLU"
if [ $? -ne 0 ]; then
echo "Warning: Build wolfssl/wolfclu failed. Continuing"
((NUM_FAILURES++))
fi
echo "Script completed in $SECONDS seconds. Had $NUM_FAILURES failures."

13
Docker/include.am Normal file
View File

@ -0,0 +1,13 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= Docker/Dockerfile
EXTRA_DIST+= Docker/Dockerfile.cross-compiler
EXTRA_DIST+= Docker/run.sh
EXTRA_DIST+= Docker/README.md
ignore_files+=Docker/buildAndPush.sh
ignore_files+=Docker/OpenWRT/Dockerfile
ignore_files+=Docker/OpenWRT/runTests.sh
ignore_files+=Docker/OpenWRT/README.md

View File

@ -0,0 +1,6 @@
FROM debian:latest
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y build-essential autoconf gawk debhelper lintian

View File

@ -0,0 +1,3 @@
FROM fedora:latest
RUN dnf install -y make automake gcc rpmdevtools

14
Docker/run.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
echo "Running with \"${*}\"..."
# Assume we're in wolfssl/Docker
WOLFSSL_DIR=$(builtin cd ${BASH_SOURCE%/*}/..; pwd)
docker build -t wolfssl/wolfssl-builder --build-arg UID=$(id -u) --build-arg GID=$(id -g) "${WOLFSSL_DIR}/Docker" && \
docker run --rm -it -v ${HOME}/.gitconfig:/home/docker/.gitconfig:ro -v ${HOME}/.ssh:/home/docker/.ssh:ro -v "${WOLFSSL_DIR}:/tmp/wolfssl" -w /tmp/wolfssl wolfssl/wolfssl-builder /bin/bash -c "./autogen.sh && ./configure ${*@Q} && make" && \
docker run --rm -it -v ${HOME}/.gitconfig:/home/docker/.gitconfig:ro -v ${HOME}/.ssh:/home/docker/.ssh:ro -v "${WOLFSSL_DIR}:/tmp/wolfssl" -w /tmp/wolfssl wolfssl/wolfssl-builder /bin/bash
exitval=$?
echo "Exited with error code $exitval"
exit $exitval

26
Docker/wolfCLU/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
ARG DOCKER_BASE_IMAGE=ubuntu
FROM ubuntu as BUILDER
ARG DEPS_WOLFSSL="build-essential autoconf libtool zlib1g-dev libuv1-dev libpam0g-dev git libpcap-dev libcurl4-openssl-dev bsdmainutils netcat iputils-ping bubblewrap"
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y apt-utils \
&& apt install -y ${DEPS_WOLFSSL} ${DEPS_LIBOQS} \
&& apt clean -y && rm -rf /var/lib/apt/lists/*
ARG NUM_CPU=16
# This arg is to force a rebuild starting from this line
ARG DUMMY=date
# install wolfssl
RUN DUMMY=${DUMMY} git clone --depth=1 --single-branch --branch=master http://github.com/wolfssl/wolfssl && cd wolfssl && ./autogen.sh && ./configure --enable-all && make -j $NUM_CPU && make install && ldconfig
# install wolfCLU
RUN git clone --depth=1 --single-branch --branch=main http://github.com/wolfssl/wolfCLU && cd wolfCLU && ./autogen.sh && ./configure && make -j $NUM_CPU && make install
FROM ${DOCKER_BASE_IMAGE}
USER root
COPY --from=BUILDER /usr/local/lib/libwolfssl.so /usr/local/lib/
COPY --from=BUILDER /usr/local/bin/wolfssl* /usr/local/bin/
RUN ldconfig
ENTRYPOINT ["/usr/local/bin/wolfssl"]
LABEL org.opencontainers.image.source=https://github.com/wolfssl/wolfssl
LABEL org.opencontainers.image.description="Simple wolfCLU in a container"

10
Docker/wolfCLU/README.md Normal file
View File

@ -0,0 +1,10 @@
This is a small container that has wolfCLU installed for quick access. To build your own run the following:
```
docker build --pull --build-arg DUMMY=$(date +%s) -t wolfclu .
```
To run the container, you can use:
```
docker run -it --rm -v $(pwd):/ws -w /ws wolfclu version
```
This command will allow you to use the certs/keys in your local directory.

29
Docker/yocto/Dockerfile Normal file
View File

@ -0,0 +1,29 @@
FROM ubuntu
# Set timezone to UTC
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales libacl1 vim && apt clean -y && rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
# Add in non-root user
ENV UID_OF_DOCKERUSER 1000
RUN useradd -m -s /bin/bash -g users -u ${UID_OF_DOCKERUSER} dockerUser
RUN chown -R dockerUser:users /home/dockerUser && chown dockerUser:users /opt
USER dockerUser
RUN cd /opt && git clone git://git.yoctoproject.org/poky
WORKDIR /opt/poky
ARG YOCTO_VERSION=kirkstone
RUN git checkout -t origin/${YOCTO_VERSION} -b ${YOCTO_VERSION} && git pull
# This arg is to be able to force a rebuild starting from this line
ARG DUMMY=date
RUN DUMMY=${DUMMY} git clone --single-branch --branch=master https://github.com/wolfssl/meta-wolfssl.git && \
/bin/bash -c "source oe-init-build-env" && \
echo 'IMAGE_INSTALL:append = " wolfssl wolfclu wolfssh wolfmqtt wolftpm wolfclu "' >> /opt/poky/build/conf/local.conf && \
sed -i '/\/opt\/poky\/meta-poky \\/a \\t/opt/poky/meta-wolfssl \\' /opt/poky/build/conf/bblayers.conf
RUN /bin/bash -c "source oe-init-build-env && bitbake core-image-minimal"

27
Docker/yocto/buildAndPush.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
# Assume we're in wolfssl/Docker/yocto
WOLFSSL_DIR=$(builtin cd ${BASH_SOURCE%/*}/../..; pwd)
DOCKER_BUILD_OPTIONS="$1"
if [ "${DOCKER_BASE_IMAGE}" != "" ]; then
DOCKER_BUILD_OPTIONS+=" --build-arg DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}"
fi
NUM_FAILURES=0
CUR_DATE=$(date -u +%F)
for ver in kirkstone langdale scarthgap; do
echo "Building wolfssl/yocto:${ver}-${CUR_DATE} as ${DOCKER_BUILD_OPTIONS}"
docker build -t wolfssl/yocto:${ver}-${CUR_DATE} --build-arg YOCTO_VERSION=${ver} --build-arg BUILD_DATE=${CUR_DATE} -f Dockerfile "${WOLFSSL_DIR}/Docker/yocto" && \
docker tag wolfssl/yocto:${ver}-${CUR_DATE} wolfssl/yocto:${ver}-latest
if [ $? -eq 0 ]; then
echo "Pushing containers to DockerHub"
docker push wolfssl/yocto:${ver}-${CUR_DATE} && docker push wolfssl/yocto:${ver}-latest
else
echo "Warning: Build wolfssl/yocto:${ver} failed. Continuing"
((NUM_FAILURES++))
fi
done
echo "Script completed in $SECONDS seconds. Had $NUM_FAILURES failures."

View File

@ -0,0 +1,13 @@
# Arduino wolfSSL Library
This library is restructured from [wolfSSL](https://github.com/wolfSSL/wolfssl/) Release ${WOLFSSL_VERSION} for the Arduino platform.
The Official wolfSSL Arduino Library is found in [The Library Manager index](http://downloads.arduino.cc/libraries/library_index.json).
See the [Arduino-wolfSSL logs](https://downloads.arduino.cc/libraries/logs/github.com/wolfSSL/Arduino-wolfSSL/).
## Arduino Releases
The first Official wolfSSL Arduino Library is `5.6.6-Arduino.1`: a slightly modified, post [release 5.6.6](https://github.com/wolfSSL/wolfssl/releases/tag/v5.6.6-stable) version update.
See other [wolfSSL releases versions](https://github.com/wolfSSL/wolfssl/releases). The `./wolfssl-arduino.sh INSTALL` [script](https://github.com/wolfSSL/wolfssl/tree/master/IDE/ARDUINO) can be used to install specific GitHub versions as needed.

View File

@ -1,29 +1,89 @@
### wolfSSL with Arduino
# wolfSSL with Arduino
##### Reformatting wolfSSL as a compatible Arduino Library
This is a shell script that will re-organize the wolfSSL library to be
compatible with Arduino projects. The Arduino IDE requires a library's source
files to be in the library's root directory with a header file in the name of
the library. This script moves all src/ files to the `IDE/ARDUINO/wolfSSL`
directory and creates a stub header file called `wolfssl.h`.
See the [example sketches](./sketches/README.md):
Step 1: To configure wolfSSL with Arduino, enter the following from within the
wolfssl/IDE/ARDUINO directory:
- [sketches/wolfssl_server](./sketches/wolfssl_server/README.md)
- [sketches/wolfssl_client](./sketches/wolfssl_client/README.md)
`./wolfssl-arduino.sh`
When publishing a new version to the Arduino Registry, be sure to edit `WOLFSSL_VERSION_ARUINO_SUFFIX` in the `wolfssl-arduino.sh` script.
Step 2: Copy the directory wolfSSL that was just created to:
`~/Documents/Arduino/libraries/` directory so the Arduino IDE can find it.
## Boards
Step 3: Edit `<arduino-libraries>/wolfSSL/user_settings.h`
Many of the supported boards are natively built-in to the [Arduino IDE Board Manager](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-board-manager/)
and by adding [additional cores](https://docs.arduino.cc/learn/starting-guide/cores/) as needed.
STM32 Support can be added by including this link in the "Additional Boards Managers URLs" field
from [stm32duino/Arduino_Core_STM32](https://github.com/stm32duino/Arduino_Core_STM32?tab=readme-ov-file#getting-started) .
```
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
```
## Using wolfSSL from the Arduino IDE
The Official wolfSSL: https://github.com/wolfSSL/arduino-wolfSSL See [PR #1](https://github.com/wolfSSL/Arduino-wolfSSL/pull/1).
This option will allow wolfSSL to be installed directly using the native Arduino tools.
## Manually Reformatting wolfSSL as a Compatible Arduino Library
Use [this](./wolfssl-arduino.sh) shell script that will re-organize the wolfSSL library to be
compatible with [Arduino Library Specification](https://arduino.github.io/arduino-cli/0.35/library-specification/)
for projects that use Arduino IDE 1.5.0 or newer.
The Arduino IDE requires a library's source files to be in the library's root directory with a
header file in the name of the library. This script moves all `src/` files to the `IDE/ARDUINO/wolfSSL/src`
directory and creates a stub header file called `wolfssl.h` inside that directory.
### Step 1:
To configure wolfSSL with Arduino, enter ONE of the following 4 commands
from within the `wolfssl/IDE/ARDUINO` directory:
1. `./wolfssl-arduino.sh`
- Creates an Arduino Library directory structure in the local `wolfSSL` directory of `IDE/ARDUINO`.
- You can add your own `user_settings.h`, or copy/rename the [default](../../examples/configs/user_settings_arduino.h).
2. `./wolfssl-arduino.sh INSTALL` (The most common option)
- Creates an Arduino Library in the local `wolfSSL` directory
- Moves that directory to the Arduino library directory:
- `$HOME/Arduino/libraries` for most bash environments
- `/mnt/c/Users/$USER/Documents/Arduino/libraries` (for WSL)
- Adds the [default](../../examples/configs/user_settings_arduino.h) as `user_settings.h`.
- The wolfSSL library is now available from the Arduino IDE.
3. `./wolfssl-arduino.sh INSTALL /path/to/repository` (Used to update [arduino-wolfSSL](https://github.com/wolfSSL/arduino-wolfSSL))
- Creates an Arduino Library in `wolfSSL` directory
- Copies that directory contents to the specified `/path/to/repository`
- Adds the [default](../../examples/configs/user_settings_arduino.h) as `user_settings.h`.
4. `./wolfssl-arduino.sh INSTALL /path/to/any/other/directory`
- Creates an Arduino Library in `wolfSSL` directory
- Copies that directory contents to the specified `/path/to/any/other/directory`
### Step 2:
Edit `<arduino-libraries>/wolfSSL/src/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](https://github.com/wolfssl/wolfssl/tree/master/examples/configs)"
Step 4: If you experience any issues with custom user_settings.h see the wolfssl
### Step 3:
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/
Step 5: If you still have any issues contact support@wolfssl.com for more help.
If you have any issues contact support@wolfssl.com for help.
# Including wolfSSL in Arduino Libraries (for Arduino version 2.0 or greater)
1. In the Arduino IDE:
The wolfSSL library should automatically be detected when found in the `libraries`
directory.
- In `Sketch -> Include Library` choose wolfSSL for new sketches.
##### Including wolfSSL in Arduino Libraries (for Arduino version 1.6.6)
@ -32,6 +92,90 @@ Step 5: If you still have any issues contact support@wolfssl.com for more help.
`IDE/ARDUNIO/wolfSSL` folder.
- In `Sketch -> Include Library` choose wolfSSL.
2. Open an example Arduino sketch for wolfSSL:
- wolfSSL Client INO sketch: `sketches/wolfssl_client/wolfssl_client.ino`
- wolfSSL Server INO sketch: `sketches/wolfssl_server/wolfssl_server.ino`
##### wolfSSL Examples
Open an example Arduino sketch for wolfSSL:
- wolfSSL [Client INO sketch](./sketches/wolfssl_client/README.md): `sketches/wolfssl_client/wolfssl_client.ino`
- wolfSSL [Server INO sketch](./sketches/wolfssl_server/README.md): `sketches/wolfssl_server/wolfssl_server.ino`
#### Script Examples
Refresh the local Windows Arduino wolfSSL library from GitHub repository directory using WSL:
Don't forget to edit `WOLFSSL_VERSION_ARUINO_SUFFIX`!
```bash
# Change to the wolfSSL Arduino IDE directory
cd /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO
# remove current Arduino wolfSSL library
rm -rf /mnt/c/Users/$USER/Documents/Arduino/libraries/wolfssl
# Install wolfSSL as an Arduino library
./wolfssl-arduino.sh INSTALL
```
Publish wolfSSL from WSL to a `Arduino-wolfSSL-$USER` repository.
```bash
cd /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO
rm -rf /mnt/c/Users/$USER/Documents/Arduino/libraries/wolfSSL
rm -rf /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO/wolfSSL
./wolfssl-arduino.sh INSTALL /mnt/c/workspace/Arduino-wolfSSL-$USER/
```
Publish wolfSSL from WSL to default Windows local library.
```bash
cd /mnt/c/workspace/wolfssl-$USER/IDE/ARDUINO
rm -rf /mnt/c/Users/$USER/Documents/Arduino/libraries/wolfSSL
rm -rf /mnt/c/workspace/wolfssl-arduino/IDE/ARDUINO/wolfSSL
./wolfssl-arduino.sh INSTALL
```
Test the TLS server by running a local command-line client.
```bash
cd /mnt/c/workspace/wolfssl-$USER
./examples/client/client -h 192.168.1.43 -p 11111 -v 3
```
Build wolfSSL to include wolfSSH support to an alternate development directory.
```bash
cd /mnt/c/workspace/wolfssl-$USER
./configure --prefix=/mnt/c/workspace/wolfssh-$USER/wolfssl_install --enable-ssh
make
make install
```
Build wolfSSH with wolfSSL not installed to default directory.
```bash
cd /mnt/c/workspace/wolfssh-$USER
./configure --with-wolfssl=/mnt/c/workspace/wolfssh-$USER/wolfssl_install
make
./examples/client/client -u jill -h 192.168.1.34 -p 22222 -P upthehill
```
Test the current wolfSSL.
```bash
cd /mnt/c/workspace/wolfssl-arduino
git status
./autogen.sh
./configure --enable-all
make clean
make && make test
```
Build and run `testwolfcrypt`.
```bash
./autogen.sh
./configure --enable-all
make clean && make && ./wolfcrypt/test/testwolfcrypt
```

View File

@ -3,6 +3,15 @@
# All paths should be given relative to the root
EXTRA_DIST+= IDE/ARDUINO/README.md
EXTRA_DIST+= IDE/ARDUINO/Arduino_README_prepend.md
EXTRA_DIST+= IDE/ARDUINO/keywords.txt
EXTRA_DIST+= IDE/ARDUINO/library.properties.template
EXTRA_DIST+= IDE/ARDUINO/sketches/README.md
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_client/README.md
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_client/wolfssl_client.ino
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_server/README.md
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_server/wolfssl_server.ino
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_version/README.md
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_version/wolfssl_version.ino
EXTRA_DIST+= IDE/ARDUINO/wolfssl.h
EXTRA_DIST+= IDE/ARDUINO/wolfssl-arduino.sh

21
IDE/ARDUINO/keywords.txt Normal file
View File

@ -0,0 +1,21 @@
# Syntax Coloring Map For wolfSSL
# See https://arduino.github.io/arduino-cli/0.35/library-specification/#keywords
#
# Be sure to use tabs, not spaces. This might help:
# tr ' ' '\t' < keywords1.txt > keywords.txt
#=============================================
# Datatypes (KEYWORD1)
#=============================================
#=============================================
# Methods and Functions (KEYWORD2)
#=============================================
wolfSSL_SetIORecv KEYWORD1
#=============================================
# Instances (KEYWORD2)
#=============================================
ctx KEYWORD2

View File

@ -0,0 +1,9 @@
name=wolfssl
version=${WOLFSSL_VERSION}${WOLFSSL_VERSION_ARUINO_SUFFIX}
author=wolfSSL Inc.
maintainer=wolfSSL inc <support@wolfssl.com>
sentence=A lightweight SSL/TLS library written in ANSI C and targeted for embedded, RTOS, and resource-constrained environments.
paragraph=Manual: https://www.wolfssl.com/documentation/manuals/wolfssl/index.html.
category=Communication
url=https://www.wolfssl.com/
architectures=*

View File

@ -0,0 +1,12 @@
# wolfSSL Arduino Examples
There are currently two example Arduino sketches:
* [wolfssl_client](./wolfssl_client/README.md): Basic TLS listening client.
* [wolfssl_server](./wolfssl_server/README.md): Basic TLS server.
Examples have been most recently confirmed operational on the
[Arduino IDE](https://www.arduino.cc/en/software) 2.2.1.
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE).
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/).

View File

@ -0,0 +1,22 @@
# Arduino Basic TLS Listening Client
Open the [wolfssl_client.ino](./wolfssl_client.ino) file in the Arduino IDE.
Other IDE products are also supported, such as:
- [PlatformIO in VS Code](https://docs.platformio.org/en/latest/frameworks/arduino.html)
- [VisualGDB](https://visualgdb.com/tutorials/arduino/)
- [VisualMicro](https://www.visualmicro.com/)
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE).
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/).
### Troubleshooting
When encountering odd errors such as `undefined reference to ``_impure_ptr'`, try cleaning the Arduino
cache directories. For Windows, that's typically in:
```text
C:\Users\%USERNAME%\AppData\Local\Temp\arduino\sketches
```

View File

@ -1,6 +1,6 @@
/* wolfssl_client.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -19,138 +19,876 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/*
Tested with:
1) Intel Galileo acting as the Client, with a laptop acting as a server using
the server example provided in examples/server.
Legacy Arduino v1.86 was used to compile and program the Galileo
2) Espressif ESP32 WiFi
3) Arduino Due, Nano33 IoT, Nano RP-2040
*/
/*
* Note to code editors: the Arduino client and server examples are edited in
* parallel for side-by-side comparison between examples.
*/
/* If you have a private include, define it here, otherwise edit WiFi params */
#define MY_PRIVATE_CONFIG "/workspace/my_private_config.h"
/* set REPEAT_CONNECTION to a non-zero value to continually run the example. */
#define REPEAT_CONNECTION 0
/* Edit this with your other TLS host server address to connect to: */
#define WOLFSSL_TLS_SERVER_HOST "192.168.1.39"
/* wolfssl TLS examples communicate on port 11111 */
#define WOLFSSL_PORT 11111
/* Choose a monitor serial baud rate: 9600, 14400, 19200, 57600, 74880, etc. */
#define SERIAL_BAUD 115200
/* We'll wait up to 2000 milliseconds to properly shut down connection */
#define SHUTDOWN_DELAY_MS 2000
/* Number of times to retry connection. */
#define RECONNECT_ATTEMPTS 20
/* Optional stress test. Define to consume memory until exhausted: */
/* #define MEMORY_STRESS_TEST */
/* Choose client or server example, not both. */
#define WOLFSSL_CLIENT_EXAMPLE
/* #define WOLFSSL_SERVER_EXAMPLE */
#if defined(MY_PRIVATE_CONFIG)
/* the /workspace directory may contain a private config
* excluded from GitHub with items such as WiFi passwords */
#include MY_PRIVATE_CONFIG
static const char* ssid PROGMEM = MY_ARDUINO_WIFI_SSID;
static const char* password PROGMEM = MY_ARDUINO_WIFI_PASSWORD;
#else
/* when using WiFi capable boards: */
static const char* ssid PROGMEM = "your_SSID";
static const char* password PROGMEM = "your_PASSWORD";
#endif
#define BROADCAST_ADDRESS "255.255.255.255"
/* There's an optional 3rd party NTPClient library by Fabrice Weinberg.
* If it is installed, uncomment define USE_NTP_LIB here: */
/* #define USE_NTP_LIB */
#ifdef USE_NTP_LIB
#include <NTPClient.h>
#endif
#include <wolfssl.h>
/* Important: make sure settings.h appears before any other wolfSSL headers */
#include <wolfssl/wolfcrypt/settings.h>
/* Reminder: settings.h includes user_settings.h
* For ALL project wolfSSL settings, see:
* [your path]/Arduino\libraries\wolfSSL\src\user_settings.h */
#include <wolfssl/ssl.h>
#include <Ethernet.h>
#include <wolfssl/certs_test.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
const char host[] = "192.168.1.148"; // server to connect to
const int port = 11111; // port on server to connect to
/* Define DEBUG_WOLFSSL in user_settings.h for more verbose logging. */
#if defined(DEBUG_WOLFSSL)
#define PROGRESS_DOT F("")
#else
#define PROGRESS_DOT F(".")
#endif
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
int reconnect = 10;
/* Convert a macro to a string */
#define xstr(x) str(x)
#define str(x) #x
EthernetClient client;
/* optional board-specific networking includes */
#if defined(ESP32)
#define USING_WIFI
#include <WiFi.h>
#include <WiFiUdp.h>
#ifdef USE_NTP_LIB
WiFiUDP ntpUDP;
#endif
/* Ensure the F() flash macro is defined */
#ifndef F
#define F
#endif
WiFiClient client;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL;
#elif defined(ESP8266)
#define USING_WIFI
#include <ESP8266WiFi.h>
WiFiClient client;
void setup() {
WOLFSSL_METHOD* method;
#elif defined(ARDUINO_SAM_DUE)
#include <SPI.h>
/* There's no WiFi/Ethernet on the Due. Requires Ethernet Shield.
/* Needs "Ethernet by Various" library to be installed. Tested with V2.0.2 */
#include <Ethernet.h>
EthernetClient client;
Serial.begin(9600);
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
#define USING_WIFI
#include <SPI.h>
#include <WiFiNINA.h> /* Needs Arduino WiFiNINA library installed manually */
WiFiClient client;
method = wolfTLSv1_2_client_method();
if (method == NULL) {
Serial.println("unable to get method");
return;
}
ctx = wolfSSL_CTX_new(method);
if (ctx == NULL) {
Serial.println("unable to get ctx");
return;
}
// initialize wolfSSL using callback functions
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
return;
}
#elif defined(ARDUINO_ARCH_RP2040)
#define USING_WIFI
#include <SPI.h>
#include <WiFiNINA.h>
WiFiClient client;
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx) {
int sent = 0;
#elif defined(USING_WIFI)
#define USING_WIFI
#include <WiFi.h>
#include <WiFiUdp.h>
#ifdef USE_NTP_LIB
WiFiUDP ntpUDP;
#endif
WiFiClient client;
sent = client.write((byte*)msg, sz);
/* TODO
#elif defined(OTHER_BOARD)
*/
#else
#define USING_WIFI
WiFiClient client;
return sent;
}
#endif
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
int ret = 0;
/* Only for syntax highlighters to show interesting options enabled: */
#if defined(HAVE_SNI) \
|| defined(HAVE_MAX_FRAGMENT) \
|| defined(HAVE_TRUSTED_CA) \
|| defined(HAVE_TRUNCATED_HMAC) \
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) \
|| defined(HAVE_SUPPORTED_CURVES) \
|| defined(HAVE_ALPN) \
|| defined(HAVE_SESSION_TICKET) \
|| defined(HAVE_SECURE_RENEGOTIATION) \
|| defined(HAVE_SERVER_RENEGOTIATION_INFO)
#endif
while (client.available() > 0 && ret < sz) {
reply[ret++] = client.read();
}
static const char host[] PROGMEM = WOLFSSL_TLS_SERVER_HOST; /* server to connect to */
static const int port PROGMEM = WOLFSSL_PORT; /* port on server to connect to */
return ret;
}
static WOLFSSL_CTX* ctx = NULL;
static WOLFSSL* ssl = NULL;
static char* wc_error_message = (char*)malloc(80 + 1);
static char errBuf[80];
void loop() {
int err = 0;
int input = 0;
int total_input = 0;
char msg[32] = "hello wolfssl!";
int msgSz = (int)strlen(msg);
char errBuf[80];
char reply[80];
const char* cipherName;
if (reconnect) {
reconnect--;
if (client.connect(host, port)) {
#if defined(MEMORY_STRESS_TEST)
#define MEMORY_STRESS_ITERATIONS 100
#define MEMORY_STRESS_BLOCK_SIZE 1024
#define MEMORY_STRESS_INITIAL (4*1024)
static char* memory_stress[MEMORY_STRESS_ITERATIONS]; /* typically 1K per item */
static int mem_ctr = 0;
#endif
Serial.print("Connected to ");
Serial.println(host);
static int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
static int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
static int reconnect = RECONNECT_ATTEMPTS;
static int lng_index PROGMEM = 0; /* 0 = English */
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
Serial.println("Unable to allocate SSL object");
return;
}
#if defined(__arm__)
#include <malloc.h>
extern char _end;
extern "C" char *sbrk(int i);
static char *ramstart=(char *)0x20070000;
static char *ramend=(char *)0x20088000;
#endif
err = wolfSSL_connect(ssl);
if (err != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Connect Error: ");
Serial.println(errBuf);
}
/*****************************************************************************/
/* fail_wait - in case of unrecoverable error */
/*****************************************************************************/
int fail_wait(void) {
show_memory();
Serial.print("SSL version is ");
Serial.println(wolfSSL_get_version(ssl));
cipherName = wolfSSL_get_cipher(ssl);
Serial.print("SSL cipher suite is ");
Serial.println(cipherName);
if ((wolfSSL_write(ssl, msg, msgSz)) == msgSz) {
Serial.print("Server response: ");
while (client.available() || wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
total_input += input;
if (input < 0) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Read Error: ");
Serial.println(errBuf);
break;
} else if (input > 0) {
reply[input] = '\0';
Serial.print(reply);
} else {
Serial.println();
}
}
} else {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Write Error: ");
Serial.println(errBuf);
}
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
client.stop();
Serial.println("Connection complete.");
reconnect = 0;
} else {
Serial.println("Trying to reconnect...");
Serial.println(F("Failed. Halt."));
while (1) {
delay(1000);
}
}
delay(1000);
return 0;
}
/*****************************************************************************/
/* show_memory() to optionally view during debugging. */
/*****************************************************************************/
int show_memory(void)
{
#if defined(__arm__)
struct mallinfo mi = mallinfo();
char *heapend=sbrk(0);
register char * stack_ptr asm("sp");
#if defined(DEBUG_WOLFSSL_VERBOSE)
Serial.print(" arena=");
Serial.println(mi.arena);
Serial.print(" ordblks=");
Serial.println(mi.ordblks);
Serial.print(" uordblks=");
Serial.println(mi.uordblks);
Serial.print(" fordblks=");
Serial.println(mi.fordblks);
Serial.print(" keepcost=");
Serial.println(mi.keepcost);
#endif
#if defined(DEBUG_WOLFSSL) || defined(MEMORY_STRESS_TEST)
Serial.print("Estimated free memory: ");
Serial.print(stack_ptr - heapend + mi.fordblks);
Serial.println(F(" bytes"));
#endif
#if (0)
/* Experimental: not supported on all devices: */
Serial.print("RAM Start %lx\n", (unsigned long)ramstart);
Serial.print("Data/Bss end %lx\n", (unsigned long)&_end);
Serial.print("Heap End %lx\n", (unsigned long)heapend);
Serial.print("Stack Ptr %lx\n",(unsigned long)stack_ptr);
Serial.print("RAM End %lx\n", (unsigned long)ramend);
Serial.print("Heap RAM Used: ",mi.uordblks);
Serial.print("Program RAM Used ",&_end - ramstart);
Serial.print("Stack RAM Used ",ramend - stack_ptr);
Serial.print("Estimated Free RAM: %d\n\n",stack_ptr - heapend + mi.fordblks);
#endif
#else
Serial.println(F("show_memory() not implemented for this platform"));
#endif
return 0;
}
/*****************************************************************************/
/* EthernetSend() to send a message string. */
/*****************************************************************************/
int EthernetSend(WOLFSSL* ssl, char* message, int sz, void* ctx) {
int sent = 0;
(void)ssl;
(void)ctx;
sent = client.write((byte*)message, sz);
return sent;
}
/*****************************************************************************/
/* EthernetReceive() to receive a reply string. */
/*****************************************************************************/
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
int ret = 0;
(void)ssl;
(void)ctx;
while (client.available() > 0 && ret < sz) {
reply[ret++] = client.read();
}
return ret;
}
/*****************************************************************************/
/* Arduino setup_hardware() */
/*****************************************************************************/
int setup_hardware(void) {
int ret = 0;
#if defined(ARDUINO_SAMD_NANO_33_IOT)
Serial.println(F("Detected known tested and working Arduino Nano 33 IoT"));
#elif defined(ARDUINO_ARCH_RP2040)
Serial.println(F("Detected known tested and working Arduino RP-2040"));
#elif defined(__arm__) && defined(ID_TRNG) && defined(TRNG)
/* need to manually turn on random number generator on Arduino Due, etc. */
pmc_enable_periph_clk(ID_TRNG);
trng_enable(TRNG);
Serial.println(F("Enabled ARM TRNG"));
#endif
show_memory();
randomSeed(analogRead(0));
return ret;
}
/*****************************************************************************/
/* Arduino setup_datetime() */
/* The device needs to have a valid date within the valid range of certs. */
/*****************************************************************************/
int setup_datetime(void) {
int ret = 0;
int ntp_tries = 20;
/* we need a date in the range of cert expiration */
#ifdef USE_NTP_LIB
#if defined(ESP32)
NTPClient timeClient(ntpUDP, "pool.ntp.org");
timeClient.begin();
timeClient.update();
delay(1000);
while (!timeClient.isTimeSet() && (ntp_tries > 0)) {
timeClient.forceUpdate();
Serial.println(F("Waiting for NTP update"));
delay(2000);
ntp_tries--;
}
if (ntp_tries <= 0) {
Serial.println(F("Warning: gave up waiting on NTP"));
}
Serial.println(timeClient.getFormattedTime());
Serial.println(timeClient.getEpochTime());
#endif
#endif
#if defined(ESP32)
/* see esp32-hal-time.c */
ntp_tries = 5;
/* Replace "pool.ntp.org" with your preferred NTP server */
configTime(0, 0, "pool.ntp.org");
/* Wait for time to be set */
while ((time(nullptr) <= 100000) && ntp_tries > 0) {
Serial.println(F("Waiting for time to be set..."));
delay(2000);
ntp_tries--;
}
#endif
return ret;
} /* setup_datetime */
/*****************************************************************************/
/* Arduino setup_network() */
/*****************************************************************************/
int setup_network(void) {
int ret = 0;
#if defined(USING_WIFI)
int status = WL_IDLE_STATUS;
/* The ESP8266 & ESP32 support both AP and STA. We'll use STA: */
#if defined(ESP8266) || defined(ESP32)
WiFi.mode(WIFI_STA);
#else
String fv;
if (WiFi.status() == WL_NO_MODULE) {
Serial.println("Communication with WiFi module failed!");
/* don't continue if no network */
while (true) ;
}
fv = WiFi.firmwareVersion();
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
Serial.println("Please upgrade the firmware");
}
#endif
Serial.print(F("Connecting to WiFi "));
Serial.print(ssid);
status = WiFi.begin(ssid, password);
while (status != WL_CONNECTED) {
delay(1000);
Serial.print(F("."));
Serial.print(status);
status = WiFi.status();
}
Serial.println(F(" Connected!"));
#else
/* Newer Ethernet shields have a
* MAC address printed on a sticker on the shield */
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 42);
IPAddress myDns(192, 168, 1, 1);
Ethernet.init(10); /* Most Arduino shields */
/* Ethernet.init(5); * MKR ETH Shield */
/* Ethernet.init(0); * Teensy 2.0 */
/* Ethernet.init(20); * Teensy++ 2.0 */
/* Ethernet.init(15); * ESP8266 with Adafruit FeatherWing Ethernet */
/* Ethernet.init(33); * ESP32 with Adafruit FeatherWing Ethernet */
Serial.println(F("Initialize Ethernet with DHCP:"));
if (Ethernet.begin(mac) == 0) {
Serial.println(F("Failed to configure Ethernet using DHCP"));
/* Check for Ethernet hardware present */
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println(F("Ethernet shield was not found."));
while (true) {
delay(1); /* do nothing */
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println(F("Ethernet cable is not connected."));
}
/* try to configure using IP address instead of DHCP : */
Ethernet.begin(mac, ip, myDns);
}
else {
Serial.print(F(" DHCP assigned IP "));
Serial.println(Ethernet.localIP());
}
/* We'll assume the Ethernet connection is ready to go. */
#endif
Serial.println(F("********************************************************"));
Serial.print(F(" wolfSSL Example Client IP = "));
#if defined(USING_WIFI)
Serial.println(WiFi.localIP());
#else
Serial.println(Ethernet.localIP());
#endif
Serial.print(F(" Configured Server Host to connect to: "));
Serial.println(host);
Serial.println(F("********************************************************"));
Serial.println(F("Setup network complete."));
return ret;
}
/*****************************************************************************/
/* Arduino setup_wolfssl() */
/*****************************************************************************/
int setup_wolfssl(void) {
int ret = 0;
WOLFSSL_METHOD* method;
/* Show a revision of wolfssl user_settings.h file in use when available: */
#if defined(WOLFSSL_USER_SETTINGS_ID)
Serial.print(F("WOLFSSL_USER_SETTINGS_ID: "));
Serial.println(F(WOLFSSL_USER_SETTINGS_ID));
#else
Serial.println(F("No WOLFSSL_USER_SETTINGS_ID found."));
#endif
#if defined(NO_WOLFSSL_SERVER)
Serial.println(F("wolfSSL server code disabled to save space."));
#endif
#if defined(NO_WOLFSSL_CLIENT)
Serial.println(F("wolfSSL client code disabled to save space."));
#endif
#if defined(DEBUG_WOLFSSL)
wolfSSL_Debugging_ON();
Serial.println(F("wolfSSL Debugging is On!"));
#else
Serial.println(F("wolfSSL Debugging is Off! (enable with DEBUG_WOLFSSL)"));
#endif
/* See ssl.c for TLS cache settings. Larger cache = use more RAM. */
#if defined(NO_SESSION_CACHE)
Serial.println(F("wolfSSL TLS NO_SESSION_CACHE"));
#elif defined(MICRO_SESSION_CACHEx)
Serial.println(F("wolfSSL TLS MICRO_SESSION_CACHE"));
#elif defined(SMALL_SESSION_CACHE)
Serial.println(F("wolfSSL TLS SMALL_SESSION_CACHE"));
#elif defined(MEDIUM_SESSION_CACHE)
Serial.println(F("wolfSSL TLS MEDIUM_SESSION_CACHE"));
#elif defined(BIG_SESSION_CACHE)
Serial.println(F("wolfSSL TLS BIG_SESSION_CACHE"));
#elif defined(HUGE_SESSION_CACHE)
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
#elif defined(HUGE_SESSION_CACHE)
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
#else
Serial.println(F("WARNING: Unknown or no TLS session cache setting."));
/* See wolfssl/src/ssl.c for amount of memory used.
* It is best on embedded devices to choose a TLS session cache size. */
#endif
ret = wolfSSL_Init();
if (ret == WOLFSSL_SUCCESS) {
Serial.println("Successfully called wolfSSL_Init");
}
else {
Serial.println("ERROR: wolfSSL_Init failed");
}
/* See companion server example with wolfSSLv23_server_method here.
* method = wolfSSLv23_client_method()); SSL 3.0 - TLS 1.3.
* method = wolfTLSv1_2_client_method(); only TLS 1.2
* method = wolfTLSv1_3_client_method(); only TLS 1.3
*
* see Arduino\libraries\wolfssl\src\user_settings.h */
Serial.println("Here we go!");
method = wolfSSLv23_client_method();
if (method == NULL) {
Serial.println(F("unable to get wolfssl client method"));
fail_wait();
}
ctx = wolfSSL_CTX_new(method);
if (ctx == NULL) {
Serial.println(F("unable to get ctx"));
fail_wait();
}
return ret;
}
/*****************************************************************************/
/* Arduino setup_certificates() */
/*****************************************************************************/
int setup_certificates(void) {
int ret = 0;
Serial.println(F("Initializing certificates..."));
show_memory();
/* Use built-in validation, No verification callback function: */
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, 0);
/* Certificate */
Serial.println("Initializing certificates...");
ret = wolfSSL_CTX_use_certificate_buffer(ctx,
CTX_CLIENT_CERT,
CTX_CLIENT_CERT_SIZE,
CTX_CLIENT_CERT_TYPE);
if (ret == WOLFSSL_SUCCESS) {
Serial.print("Success: use certificate: ");
Serial.println(xstr(CTX_SERVER_CERT));
}
else {
Serial.println(F("Error: wolfSSL_CTX_use_certificate_buffer failed: "));
wc_ErrorString(ret, wc_error_message);
Serial.println(wc_error_message);
fail_wait();
}
/* Setup private client key */
ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
CTX_CLIENT_KEY,
CTX_CLIENT_KEY_SIZE,
CTX_CLIENT_KEY_TYPE);
if (ret == WOLFSSL_SUCCESS) {
Serial.print("Success: use private key buffer: ");
Serial.println(xstr(CTX_SERVER_KEY));
}
else {
Serial.println(F("Error: wolfSSL_CTX_use_PrivateKey_buffer failed: "));
wc_ErrorString(ret, wc_error_message);
Serial.println(wc_error_message);
fail_wait();
}
ret = wolfSSL_CTX_load_verify_buffer(ctx,
CTX_CA_CERT,
CTX_CA_CERT_SIZE,
CTX_CA_CERT_TYPE);
if (ret == WOLFSSL_SUCCESS) {
Serial.println(F("Success: load_verify CTX_CA_CERT"));
}
else {
Serial.println(F("Error: wolfSSL_CTX_load_verify_buffer failed: "));
wc_ErrorString(ret, wc_error_message);
Serial.println(wc_error_message);
fail_wait();
}
return ret;
} /* Arduino setup */
/*****************************************************************************/
/*****************************************************************************/
/* Arduino setup() */
/*****************************************************************************/
/*****************************************************************************/
void setup(void) {
int i = 0;
Serial.begin(SERIAL_BAUD);
while (!Serial && (i < 10)) {
/* wait for serial port to connect. Needed for native USB port only */
delay(1000);
i++;
}
Serial.println(F(""));
Serial.println(F(""));
Serial.println(F("wolfSSL TLS Client Example Startup."));
/* define DEBUG_WOLFSSL in wolfSSL user_settings.h for diagnostics */
#if defined(DEBUG_WOLFSSL)
wolfSSL_Debugging_ON();
#endif
/* Optionally pre-allocate a large block of memory for testing */
#if defined(MEMORY_STRESS_TEST)
Serial.println(F("WARNING: Memory Stress Test Active!"));
Serial.print(F("Allocating extra memory: "));
Serial.print(MEMORY_STRESS_INITIAL);
Serial.println(F(" bytes..."));
memory_stress[mem_ctr] = (char*)malloc(MEMORY_STRESS_INITIAL);
show_memory();
#endif
setup_hardware();
setup_network();
setup_datetime();
setup_wolfssl();
setup_certificates();
/* Initialize wolfSSL using callback functions. */
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
Serial.println(F("Completed Arduino setup!"));
/* See companion wolfssl_server.ino code; server begins listening here
* https://github.com/wolfSSL/wolfssl/tree/master/IDE/ARDUINO/sketches/wolfssl_server
* Any other server will work. See also:
* https://github.com/wolfSSL/wolfssl/tree/master/examples/client
*/
/* See companion wolfssl_server.ino code */
return;
} /* Arduino setup */
/*****************************************************************************/
/* wolfSSL error_check() */
/*****************************************************************************/
int error_check(int this_ret, bool halt_on_error,
const __FlashStringHelper* message) {
int ret = 0;
if (this_ret == WOLFSSL_SUCCESS) {
Serial.print(F("Success: "));
Serial.println(message);
}
else {
Serial.print(F("ERROR: return = "));
Serial.print(this_ret);
Serial.print(F(": "));
Serial.println(message);
Serial.println(wc_GetErrorString(this_ret));
if (halt_on_error) {
fail_wait();
}
}
show_memory();
return ret;
} /* error_check */
/*****************************************************************************/
/* wolfSSL error_check_ssl */
/* Parameters: */
/* ssl is the current WOLFSSL object pointer */
/* halt_on_error set to true to suspend operations for critical error */
/* message is expected to be a memory-efficient F("") macro string */
/*****************************************************************************/
int error_check_ssl(WOLFSSL* ssl, int this_ret, bool halt_on_error,
const __FlashStringHelper* message) {
int err = 0;
if (ssl == NULL) {
Serial.println(F("ssl is Null; Unable to allocate SSL object?"));
#ifndef DEBUG_WOLFSSL
Serial.println(F("Define DEBUG_WOLFSSL in user_settings.h for more."));
#else
Serial.println(F("See wolfssl/wolfcrypt/error-crypt.h for codes."));
#endif
Serial.print(F("ERROR: "));
Serial.println(message);
show_memory();
if (halt_on_error) {
fail_wait();
}
}
else {
err = wolfSSL_get_error(ssl, this_ret);
if (err == WOLFSSL_SUCCESS) {
Serial.print(F("Success m: "));
Serial.println(message);
}
else {
if (err < 0) {
wolfSSL_ERR_error_string(err, errBuf);
Serial.print(F("WOLFSSL Error: "));
Serial.print(err);
Serial.print(F("; "));
Serial.println(errBuf);
}
else {
Serial.println(F("Success: ssl object."));
}
}
}
return err;
}
/*****************************************************************************/
/*****************************************************************************/
/* Arduino loop() */
/*****************************************************************************/
/*****************************************************************************/
void loop() {
char reply[80];
char msg[32] = "hello wolfssl!";
const char* cipherName;
int retry_shutdown = SHUTDOWN_DELAY_MS; /* max try, once per millisecond */
int total_input = 0;
int msgSz = 0;
int input = 0;
int ret = 0;
int err = 0;
msgSz = (int)strlen(msg);
Serial.println(F(""));
Serial.println(F("Starting Arduino loop() ..."));
if (reconnect) {
reconnect--;
/* WiFi client returns true if connection succeeds, false if not. */
/* Wired client returns int (1,-1,-2,-3,-4) for connection status. */
Serial.print(F("Connecting to "));
Serial.print(host);
Serial.print(F(":"));
Serial.println(port);
/* can also use: IPAddress server(192,168,1,37); */
Serial.println(F("Here we go..."));
ret = client.connect(host, port);
Serial.println(F("Ok, checking..."));
if (ret > 0) {
Serial.println(F("Connected!"));
/* initialize wolfSSL */
ret = wolfSSL_Init();
error_check(ret, false, F("calling wolfSSL_Init") );
/* create secure connection object. see setup for ctx certs. */
Serial.println(F("Calling ssl = wolfSSL_new(ctx)"));
ssl = wolfSSL_new(ctx);
error_check_ssl(ssl, 0, true, F("Create WOLFSSL object from ctx"));
Serial.print(F("Connecting to wolfSSL TLS Secure Server..."));
do {
err = 0; /* reset error */
Serial.println(F("wolfSSL_connect ..."));
ret = wolfSSL_connect(ssl);
Serial.print("wolfSSL_connect return result =");
Serial.println(ret);
if ((ret != WOLFSSL_SUCCESS) && (ret != WC_PENDING_E)) {
Serial.println(F("Failed connection, checking error."));
err = error_check_ssl(ssl, ret, true,
F("Create WOLFSSL object from ctx"));
Serial.print("err =");
Serial.println(err);
}
else {
Serial.print(PROGRESS_DOT);
}
} while (err == WC_PENDING_E);
Serial.println();
Serial.println(F("Connected!"));
Serial.print(F("SSL version is "));
Serial.println(wolfSSL_get_version(ssl));
cipherName = wolfSSL_get_cipher(ssl);
Serial.print(F("SSL cipher suite is "));
Serial.println(cipherName);
/* see test.h
* TODO: test.h needs a little bit of Arduino work for these:
showPeerEx(ssl, lng_index);
showPeerPEM(ssl);
*/
Serial.print(F("Sending secure message to server: "));
Serial.println(msg);
ret = wolfSSL_write(ssl, msg, msgSz);
if (ret == msgSz) {
Serial.print(F("Waiting for Server response..."));
while (!client.available()) {
/* wait for data */
delay(1); /* 1 ms delay */
}
Serial.print(F("Reading response.."));
/* read data */
do {
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
if (ret < 0) {
error_check_ssl(ssl, ret, false,
F("during TLS Read"));
}
else {
Serial.print(PROGRESS_DOT);
}
} while (err == WC_PENDING_E);
Serial.println();
Serial.println();
Serial.println(reply); /* typically: I hear you fa shizzle! */
Serial.println();
} /* wolfSSL_write message size matched */
else {
error_check_ssl(ssl, ret, false,
F("during TLS Write"));
} /* any wolfSSL_write message size mismatch is an error */
Serial.print(F("Shutting down.."));
do {
delay(1);
Serial.print(PROGRESS_DOT);
retry_shutdown--;
ret = wolfSSL_shutdown(ssl);
} while ( (ret == WOLFSSL_SHUTDOWN_NOT_DONE)
&& (retry_shutdown > 0)
); /* There may be pending data, so wait until done. */
Serial.println();
if (retry_shutdown <= 0) {
/* if wolfSSL_free is called before properly shutting down the
* ssl object, undesired results may occur. */
Serial.println(F("Warning! Shutdown did not properly complete."));
}
wolfSSL_free(ssl);
client.stop();
Serial.println(F("Connection complete."));
if (REPEAT_CONNECTION) {
reconnect = RECONNECT_ATTEMPTS;
}
else {
reconnect = 0;
}
} /* client.connect(host, port) */
else {
Serial.println(F("Problem sending message. Trying to reconnect..."));
}
}
delay(1000);
if ((reconnect > 0) && (REPEAT_CONNECTION)) {
Serial.println(F("Arduino loop repeating..."));
Serial.println();
}
else {
printf("wow");
Serial.println(F("Done!"));
while(1) {
/* wait forever */
}
}
#if defined(MEMORY_STRESS_TEST)
if (mem_ctr < MEMORY_STRESS_ITERATIONS) {
/* reminder: mem_ctr == 0 is MEMORY_STRESS_INITIAL allocation */
mem_ctr++;
Serial.print(F("Memory stress increment: "));
Serial.print(mem_ctr);
Serial.print(F(". Allocating addition memory (bytes): "));
Serial.println(MEMORY_STRESS_BLOCK_SIZE);
memory_stress[mem_ctr] = (char*)malloc(MEMORY_STRESS_BLOCK_SIZE);
show_memory();
}
#endif
} /* Arduino loop repeats */

View File

@ -0,0 +1,134 @@
# Arduino Basic TLS Server
Open the [wolfssl_server.ino](./wolfssl_server.ino) file in the Arduino IDE.
Other IDE products are also supported, such as:
- [PlatformIO in VS Code](https://docs.platformio.org/en/latest/frameworks/arduino.html)
- [VisualGDB](https://visualgdb.com/tutorials/arduino/)
- [VisualMicro](https://www.visualmicro.com/)
For examples on other platforms, see the [IDE directory](https://github.com/wolfssl/wolfssl/tree/master/IDE).
Additional examples can be found on [wolfSSL/wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/).
## Connect with an Arduino Sketch
See the companion [Arduino Sketch Client](../wolfssl_client/wolfssl_client.ino).
## Connect with Linux Client
See also the [wolfSSL Example TLS Client](https://github.com/wolfSSL/wolfssl/tree/master/examples/client)
and [wolfSSL Example TLS Server](https://github.com/wolfSSL/wolfssl/tree/master/examples/server).
Assuming a listening [Arduino Sketch Server](./wolfssl_server.ino) at `192.168.1.38` on port `11111`,
connect with the `client` executable:
```
./examples/client/client -h 192.168.1.38 -p 11111 -v 3
```
## wolfSSL Error -308 wolfSSL_connect error state on socket
When using a wired Ethernet connection, and this error is encountered, simply
press the reset button or power cycle the Arduino before making a connection.
Here's one possible script to test the server from a command-line client:
```bash
#!/bin/bash
echo "client log " > client_log.txt
counter=1
THIS_ERR=0
while [ $THIS_ERR -eq 0 ]; do
./examples/client/client -h 192.168.1.38 -p 11111 -v 3 >> client_log.txt
THIS_ERR=$?
if [ $? -ne 0 ]; then
echo "Failed!"
exit 1
fi
echo "Iteration $counter"
echo "Iteration $counter" >> client_log.txt
((counter++))
done
```
Output expected from the `client` command:
```
$ ./examples/client/client -h 192.168.1.38 -p 11111 -v 3
Alternate cert chain used
issuer : /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
subject: /C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Support/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
altname = example.com
altname = 127.0.0.1
serial number:01
SSL version is TLSv1.2
SSL cipher suite is ECDHE-RSA-AES128-GCM-SHA256
SSL curve name is SECP256R1
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIE6DCCA9CgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMCVVMx
EDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNh
d3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMjMxMjEz
MjIxOTI4WhcNMjYwOTA4MjIxOTI4WjCBkDELMAkGA1UEBhMCVVMxEDAOBgNVBAgM
B01vbnRhbmExEDAOBgNVBAcMB0JvemVtYW4xEDAOBgNVBAoMB3dvbGZTU0wxEDAO
BgNVBAsMB1N1cHBvcnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAMCVCOFXQfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hn
f/5cnFF194rKB+c1L4/hvXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/X
GQ0lT+FjY1GLC2Q/rUO4pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bM
QLRpo0YzaYduxLsXpvPo3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq
0KGWSrzh1Bpbx6DAwWN4D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ
6dgIvDMgs1gip6rrxOHmYYPF0pbf2dBPrdcCAwEAAaOCAUUwggFBMB0GA1UdDgQW
BBSzETLJkpiE4sn40DtuA0LKHw6OPDCB1AYDVR0jBIHMMIHJgBQnjmcRdMMmHT/t
M2OzpNgdMOXo1aGBmqSBlzCBlDELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB01vbnRh
bmExEDAOBgNVBAcMB0JvemVtYW4xETAPBgNVBAoMCFNhd3Rvb3RoMRMwEQYDVQQL
DApDb25zdWx0aW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xHzAdBgkqhkiG
9w0BCQEWEGluZm9Ad29sZnNzbC5jb22CFDNEGqhsAez2YPJwUQpM0RT6vOlEMAwG
A1UdEwQFMAMBAf8wHAYDVR0RBBUwE4ILZXhhbXBsZS5jb22HBH8AAAEwHQYDVR0l
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQBK/7nl
hZvaU2Z/ByK/thnqQuukEQdi/zlfMzc6hyZxPROyyrhkOHuKmUgOpaRrsZlu4EZR
vRlSrbymfip6fCOnzNteQ31rBMi33ZWt8JGAWcUZkSYnkbhIHOtVtqp9pDjxA7xs
i6qU1jwFepbFBvEmFC51+93lNbMBLLOtYlohmgi+Vvz5okKHhuWpxZnPrhS+4LkI
JA0dXNYU4UyfQLOp6S1Si0y/rEQxZ8GNBoXsD+SZ10t7IQZm1OT1nf+O8IY5WB2k
W+Jj73zJGIeoAiUQPoco+fXvR56lgAgRkGj+0aOoUbk3/9XKfId/a7wsEsjFhYv8
DMa5hrjJBMNRN9JP
-----END CERTIFICATE-----
Session timeout set to 500 seconds
Client Random : 56A0BB9647B064D3F20947032B74B31FDB4C93DBAC9460BA8AEA213A2B2DD4A8
SSL-Session:
Protocol : TLSv1.2
Cipher : TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
Session-ID: 3255404E997FA9C27ECB4F1A20A70E722E4AA504B63A945FC175434D1907EC31
Session-ID-ctx:
Master-Key: 67F22168BBADD678643BBA76B398277270C29788AC18FD05B57F6B715F49A7BCEEF75BEAF7FE266B0CC058534AF76C1F
TLS session ticket: NONE
Start Time: 1705533296
Timeout : 500 (sec)
Extended master secret: no
I hear you fa shizzle!
```
### Troubleshooting
When encountering odd errors such as `undefined reference to ``_impure_ptr'`, such as this:
```text
c:/users/gojimmypi/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\gojimmypi\AppData\Local\Temp\arduino\sketches\EAB8D79A02D1ECF107884802D893914E\libraries\wolfSSL\wolfcrypt\src\logging.c.o:(.literal.wolfssl_log+0x8): undefined reference to `_impure_ptr'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
```
Try cleaning the Arduino cache directories. For Windows, that's typically in:
```text
C:\Users\%USERNAME%\AppData\Local\Temp\arduino\sketches
```
Remove all other boards from other serial ports, leaving one the one being programmed.

View File

@ -1,6 +1,6 @@
/* wolfssl_server.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -19,158 +19,820 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/*
Tested with:
#include <wolfssl.h>
#include <wolfssl/ssl.h>
#include <Ethernet.h>
1) Intel Galileo acting as the Client, with a laptop acting as a server using
the server example provided in examples/server.
Legacy Arduino v1.86 was used to compile and program the Galileo
#define USE_CERT_BUFFERS_256
#include <wolfssl/certs_test.h>
2) Espressif ESP32 WiFi
#ifdef NO_WOLFSSL_SERVER
#error Please undefine NO_WOLFSSL_SERVER for this example
3) Arduino Due, Nano33 IoT, Nano RP-2040
*/
/*
* Note to code editors: the Arduino client and server examples are edited in
* parallel for side-by-side comparison between examples.
*/
/* If you have a private include, define it here, otherwise edit WiFi params */
#define MY_PRIVATE_CONFIG "/workspace/my_private_config.h"
/* set REPEAT_CONNECTION to a non-zero value to continually run the example. */
#define REPEAT_CONNECTION 1
/* Edit this with your other TLS host server address to connect to: */
/* #define WOLFSSL_TLS_SERVER_HOST "192.168.1.34" */
/* wolfssl TLS examples communicate on port 11111 */
#define WOLFSSL_PORT 11111
/* Choose a monitor serial baud rate: 9600, 14400, 19200, 57600, 74880, etc. */
#define SERIAL_BAUD 115200
/* We'll wait up to 2000 milliseconds to properly shut down connection */
#define SHUTDOWN_DELAY_MS 2000
/* Number of times to retry connection. */
#define RECONNECT_ATTEMPTS 20
/* Optional stress test. Define to consume memory until exhausted: */
/* #define MEMORY_STRESS_TEST */
/* Choose client or server example, not both. */
/* #define WOLFSSL_CLIENT_EXAMPLE */
#define WOLFSSL_SERVER_EXAMPLE
#if defined(MY_PRIVATE_CONFIG)
/* the /workspace directory may contain a private config
* excluded from GitHub with items such as WiFi passwords */
#include MY_PRIVATE_CONFIG
static const char* ssid PROGMEM = MY_ARDUINO_WIFI_SSID;
static const char* password PROGMEM = MY_ARDUINO_WIFI_PASSWORD;
#else
/* when using WiFi capable boards: */
static const char* ssid PROGMEM = "your_SSID";
static const char* password PROGMEM = "your_PASSWORD";
#endif
const int port = 11111; // port to listen on
#define BROADCAST_ADDRESS "255.255.255.255"
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
/* There's an optional 3rd party NTPClient library by Fabrice Weinberg.
* If it is installed, uncomment define USE_NTP_LIB here: */
/* #define USE_NTP_LIB */
#ifdef USE_NTP_LIB
#include <NTPClient.h>
#endif
EthernetServer server(port);
EthernetClient client;
#include <wolfssl.h>
/* Important: make sure settings.h appears before any other wolfSSL headers */
#include <wolfssl/wolfcrypt/settings.h>
/* Reminder: settings.h includes user_settings.h
* For ALL project wolfSSL settings, see:
* [your path]/Arduino\libraries\wolfSSL\src\user_settings.h */
#include <wolfssl/ssl.h>
#include <wolfssl/certs_test.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL;
/* Define DEBUG_WOLFSSL in user_settings.h for more verbose logging. */
#if defined(DEBUG_WOLFSSL)
#define PROGRESS_DOT F("")
#else
#define PROGRESS_DOT F(".")
#endif
void setup() {
int err;
WOLFSSL_METHOD* method;
/* Convert a macro to a string */
#define xstr(x) str(x)
#define str(x) #x
Serial.begin(9600);
/* optional board-specific networking includes */
#if defined(ESP32)
#define USING_WIFI
#include <WiFi.h>
#include <WiFiUdp.h>
#ifdef USE_NTP_LIB
WiFiUDP ntpUDP;
#endif
/* Ensure the F() flash macro is defined */
#ifndef F
#define F
#endif
WiFiClient client;
WiFiServer server(WOLFSSL_PORT);
#elif defined(ESP8266)
#define USING_WIFI
#include <ESP8266WiFi.h>
WiFiClient client;
WiFiServer server(WOLFSSL_PORT);
#elif defined(ARDUINO_SAM_DUE)
#include <SPI.h>
/* There's no WiFi/Ethernet on the Due. Requires Ethernet Shield.
/* Needs "Ethernet by Various" library to be installed. Tested with V2.0.2 */
#include <Ethernet.h>
EthernetClient client;
EthernetClient server(WOLFSSL_PORT);
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
#define USING_WIFI
#include <SPI.h>
#include <WiFiNINA.h> /* Needs Arduino WiFiNINA library installed manually */
WiFiClient client;
WiFiServer server(WOLFSSL_PORT);
#elif defined(ARDUINO_ARCH_RP2040)
#define USING_WIFI
#include <SPI.h>
#include <WiFiNINA.h>
WiFiClient client;
WiFiServer server(WOLFSSL_PORT);
#elif defined(USING_WIFI)
#define USING_WIFI
#include <WiFi.h>
#include <WiFiUdp.h>
#ifdef USE_NTP_LIB
WiFiUDP ntpUDP;
#endif
WiFiClient client;
WiFiServer server(WOLFSSL_PORT);
/* TODO
#elif defined(OTHER_BOARD)
*/
#else
#define USING_WIFI
WiFiClient client;
WiFiServer server(WOLFSSL_PORT);
#endif
method = wolfTLSv1_2_server_method();
if (method == NULL) {
Serial.println("unable to get method");
return;
}
ctx = wolfSSL_CTX_new(method);
if (ctx == NULL) {
Serial.println("unable to get ctx");
return;
}
/* Only for syntax highlighters to show interesting options enabled: */
#if defined(HAVE_SNI) \
|| defined(HAVE_MAX_FRAGMENT) \
|| defined(HAVE_TRUSTED_CA) \
|| defined(HAVE_TRUNCATED_HMAC) \
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
|| defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) \
|| defined(HAVE_SUPPORTED_CURVES) \
|| defined(HAVE_ALPN) \
|| defined(HAVE_SESSION_TICKET) \
|| defined(HAVE_SECURE_RENEGOTIATION) \
|| defined(HAVE_SERVER_RENEGOTIATION_INFO)
#endif
// 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
err = wolfSSL_CTX_use_PrivateKey_buffer(ctx, ecc_key_der_256,
sizeof_ecc_key_der_256, WOLFSSL_FILETYPE_ASN1);
if (err != WOLFSSL_SUCCESS) {
Serial.println("error setting key");
return;
}
err = wolfSSL_CTX_use_certificate_buffer(ctx, serv_ecc_der_256,
sizeof_serv_ecc_der_256, WOLFSSL_FILETYPE_ASN1);
if (err != WOLFSSL_SUCCESS) {
Serial.println("error setting certificate");
return;
}
/* we expect our IP address from DHCP */
// Start the server
server.begin();
return;
static WOLFSSL_CTX* ctx = NULL;
static WOLFSSL* ssl = NULL;
static char* wc_error_message = (char*)malloc(80 + 1);
static char errBuf[80];
#if defined(MEMORY_STRESS_TEST)
#define MEMORY_STRESS_ITERATIONS 100
#define MEMORY_STRESS_BLOCK_SIZE 1024
#define MEMORY_STRESS_INITIAL (4*1024)
static char* memory_stress[MEMORY_STRESS_ITERATIONS]; /* typically 1K per item */
static int mem_ctr = 0;
#endif
static int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
static int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
static int reconnect = RECONNECT_ATTEMPTS;
static int lng_index PROGMEM = 0; /* 0 = English */
#if defined(__arm__)
#include <malloc.h>
extern char _end;
extern "C" char *sbrk(int i);
static char *ramstart=(char *)0x20070000;
static char *ramend=(char *)0x20088000;
#endif
/*****************************************************************************/
/* fail_wait - in case of unrecoverable error */
/*****************************************************************************/
int fail_wait(void) {
show_memory();
Serial.println(F("Failed. Halt."));
while (1) {
delay(1000);
}
return 0;
}
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx) {
int sent = 0;
/*****************************************************************************/
/* show_memory() to optionally view during debugging. */
/*****************************************************************************/
int show_memory(void)
{
#if defined(__arm__)
struct mallinfo mi = mallinfo();
sent = client.write((byte*)msg, sz);
char *heapend=sbrk(0);
register char * stack_ptr asm("sp");
#if defined(DEBUG_WOLFSSL_VERBOSE)
Serial.print(" arena=");
Serial.println(mi.arena);
Serial.print(" ordblks=");
Serial.println(mi.ordblks);
Serial.print(" uordblks=");
Serial.println(mi.uordblks);
Serial.print(" fordblks=");
Serial.println(mi.fordblks);
Serial.print(" keepcost=");
Serial.println(mi.keepcost);
#endif
return sent;
#if defined(DEBUG_WOLFSSL) || defined(MEMORY_STRESS_TEST)
Serial.print("Estimated free memory: ");
Serial.print(stack_ptr - heapend + mi.fordblks);
Serial.println(F(" bytes"));
#endif
#if (0)
/* Experimental: not supported on all devices: */
Serial.print("RAM Start %lx\n", (unsigned long)ramstart);
Serial.print("Data/Bss end %lx\n", (unsigned long)&_end);
Serial.print("Heap End %lx\n", (unsigned long)heapend);
Serial.print("Stack Ptr %lx\n",(unsigned long)stack_ptr);
Serial.print("RAM End %lx\n", (unsigned long)ramend);
Serial.print("Heap RAM Used: ",mi.uordblks);
Serial.print("Program RAM Used ",&_end - ramstart);
Serial.print("Stack RAM Used ",ramend - stack_ptr);
Serial.print("Estimated Free RAM: %d\n\n",stack_ptr - heapend + mi.fordblks);
#endif
#else
Serial.println(F("show_memory() not implemented for this platform"));
#endif
return 0;
}
/*****************************************************************************/
/* EthernetSend() to send a message string. */
/*****************************************************************************/
int EthernetSend(WOLFSSL* ssl, char* message, int sz, void* ctx) {
int sent = 0;
(void)ssl;
(void)ctx;
sent = client.write((byte*)message, sz);
return sent;
}
/*****************************************************************************/
/* EthernetReceive() to receive a reply string. */
/*****************************************************************************/
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
int ret = 0;
int ret = 0;
(void)ssl;
(void)ctx;
while (client.available() > 0 && ret < sz) {
reply[ret++] = client.read();
}
return ret;
while (client.available() > 0 && ret < sz) {
reply[ret++] = client.read();
}
return ret;
}
void loop() {
int err = 0;
int input = 0;
char errBuf[80];
char reply[80];
int replySz = 0;
const char* cipherName;
/*****************************************************************************/
/* Arduino setup_hardware() */
/*****************************************************************************/
int setup_hardware(void) {
int ret = 0;
// Listen for incoming client requests.
client = server.available();
if (!client) {
#if defined(ARDUINO_SAMD_NANO_33_IOT)
Serial.println(F("Detected known tested and working Arduino Nano 33 IoT"));
#elif defined(ARDUINO_ARCH_RP2040)
Serial.println(F("Detected known tested and working Arduino RP-2040"));
#elif defined(__arm__) && defined(ID_TRNG) && defined(TRNG)
/* need to manually turn on random number generator on Arduino Due, etc. */
pmc_enable_periph_clk(ID_TRNG);
trng_enable(TRNG);
Serial.println(F("Enabled ARM TRNG"));
#endif
show_memory();
randomSeed(analogRead(0));
return ret;
}
/*****************************************************************************/
/* Arduino setup_datetime() */
/* The device needs to have a valid date within the valid range of certs. */
/*****************************************************************************/
int setup_datetime(void) {
int ret = 0;
int ntp_tries = 20;
/* we need a date in the range of cert expiration */
#ifdef USE_NTP_LIB
#if defined(ESP32)
NTPClient timeClient(ntpUDP, "pool.ntp.org");
timeClient.begin();
timeClient.update();
delay(1000);
while (!timeClient.isTimeSet() && (ntp_tries > 0)) {
timeClient.forceUpdate();
Serial.println(F("Waiting for NTP update"));
delay(2000);
ntp_tries--;
}
if (ntp_tries <= 0) {
Serial.println(F("Warning: gave up waiting on NTP"));
}
Serial.println(timeClient.getFormattedTime());
Serial.println(timeClient.getEpochTime());
#endif
#endif
#if defined(ESP32)
/* see esp32-hal-time.c */
ntp_tries = 5;
/* Replace "pool.ntp.org" with your preferred NTP server */
configTime(0, 0, "pool.ntp.org");
/* Wait for time to be set */
while ((time(nullptr) <= 100000) && ntp_tries > 0) {
Serial.println(F("Waiting for time to be set..."));
delay(2000);
ntp_tries--;
}
#endif
return ret;
} /* setup_datetime */
/*****************************************************************************/
/* Arduino setup_network() */
/*****************************************************************************/
int setup_network(void) {
int ret = 0;
#if defined(USING_WIFI)
int status = WL_IDLE_STATUS;
/* The ESP8266 & ESP32 support both AP and STA. We'll use STA: */
#if defined(ESP8266) || defined(ESP32)
WiFi.mode(WIFI_STA);
#else
String fv;
if (WiFi.status() == WL_NO_MODULE) {
Serial.println("Communication with WiFi module failed!");
/* don't continue if no network */
while (true) ;
}
fv = WiFi.firmwareVersion();
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
Serial.println("Please upgrade the firmware");
}
#endif
Serial.print(F("Connecting to WiFi "));
Serial.print(ssid);
status = WiFi.begin(ssid, password);
while (status != WL_CONNECTED) {
delay(1000);
Serial.print(F("."));
Serial.print(status);
status = WiFi.status();
}
Serial.println(F(" Connected!"));
#else
/* Newer Ethernet shields have a
* MAC address printed on a sticker on the shield */
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 42);
IPAddress myDns(192, 168, 1, 1);
Ethernet.init(10); /* Most Arduino shields */
/* Ethernet.init(5); * MKR ETH Shield */
/* Ethernet.init(0); * Teensy 2.0 */
/* Ethernet.init(20); * Teensy++ 2.0 */
/* Ethernet.init(15); * ESP8266 with Adafruit FeatherWing Ethernet */
/* Ethernet.init(33); * ESP32 with Adafruit FeatherWing Ethernet */
Serial.println(F("Initialize Ethernet with DHCP:"));
if (Ethernet.begin(mac) == 0) {
Serial.println(F("Failed to configure Ethernet using DHCP"));
/* Check for Ethernet hardware present */
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println(F("Ethernet shield was not found."));
while (true) {
delay(1); /* do nothing */
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println(F("Ethernet cable is not connected."));
}
/* try to configure using IP address instead of DHCP : */
Ethernet.begin(mac, ip, myDns);
}
else {
Serial.print(F(" DHCP assigned IP "));
Serial.println(Ethernet.localIP());
}
/* We'll assume the Ethernet connection is ready to go. */
#endif
Serial.println(F("********************************************************"));
Serial.print(F(" wolfSSL Example Server IP = "));
#if defined(USING_WIFI)
Serial.println(WiFi.localIP());
#else
Serial.println(Ethernet.localIP());
#endif
/* In server mode, there's no host definition. */
/* See companion example: wolfssl_client.ino */
Serial.println(F("********************************************************"));
Serial.println(F("Setup network complete."));
return ret;
}
/*****************************************************************************/
/* Arduino setup_wolfssl() */
/*****************************************************************************/
int setup_wolfssl(void) {
int ret = 0;
WOLFSSL_METHOD* method;
/* Show a revision of wolfssl user_settings.h file in use when available: */
#if defined(WOLFSSL_USER_SETTINGS_ID)
Serial.print(F("WOLFSSL_USER_SETTINGS_ID: "));
Serial.println(F(WOLFSSL_USER_SETTINGS_ID));
#else
Serial.println(F("No WOLFSSL_USER_SETTINGS_ID found."));
#endif
#if defined(NO_WOLFSSL_SERVER)
Serial.println(F("wolfSSL server code disabled to save space."));
#endif
#if defined(NO_WOLFSSL_CLIENT)
Serial.println(F("wolfSSL client code disabled to save space."));
#endif
#if defined(DEBUG_WOLFSSL)
wolfSSL_Debugging_ON();
Serial.println(F("wolfSSL Debugging is On!"));
#else
Serial.println(F("wolfSSL Debugging is Off! (enable with DEBUG_WOLFSSL)"));
#endif
/* See ssl.c for TLS cache settings. Larger cache = use more RAM. */
#if defined(NO_SESSION_CACHE)
Serial.println(F("wolfSSL TLS NO_SESSION_CACHE"));
#elif defined(MICRO_SESSION_CACHEx)
Serial.println(F("wolfSSL TLS MICRO_SESSION_CACHE"));
#elif defined(SMALL_SESSION_CACHE)
Serial.println(F("wolfSSL TLS SMALL_SESSION_CACHE"));
#elif defined(MEDIUM_SESSION_CACHE)
Serial.println(F("wolfSSL TLS MEDIUM_SESSION_CACHE"));
#elif defined(BIG_SESSION_CACHE)
Serial.println(F("wolfSSL TLS BIG_SESSION_CACHE"));
#elif defined(HUGE_SESSION_CACHE)
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
#elif defined(HUGE_SESSION_CACHE)
Serial.println(F("wolfSSL TLS HUGE_SESSION_CACHE"));
#else
Serial.println(F("WARNING: Unknown or no TLS session cache setting."));
/* See wolfssl/src/ssl.c for amount of memory used.
* It is best on embedded devices to choose a TLS session cache size. */
#endif
ret = wolfSSL_Init();
if (ret == WOLFSSL_SUCCESS) {
Serial.println("Successfully called wolfSSL_Init");
}
else {
Serial.println("ERROR: wolfSSL_Init failed");
}
/* See companion server example with wolfSSLv23_server_method here.
* method = wolfSSLv23_client_method()); SSL 3.0 - TLS 1.3.
* method = wolfTLSv1_2_client_method(); only TLS 1.2
* method = wolfTLSv1_3_client_method(); only TLS 1.3
*
* see Arduino\libraries\wolfssl\src\user_settings.h */
Serial.println("Here we go!");
method = wolfSSLv23_server_method();
if (method == NULL) {
Serial.println(F("unable to get wolfssl server method"));
fail_wait();
}
ctx = wolfSSL_CTX_new(method);
if (ctx == NULL) {
Serial.println(F("unable to get ctx"));
fail_wait();
}
return ret;
}
/*****************************************************************************/
/* Arduino setup_certificates() */
/*****************************************************************************/
int setup_certificates(void) {
int ret = 0;
Serial.println(F("Initializing certificates..."));
show_memory();
/* Use built-in validation, No verification callback function: */
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
/* Certificate */
Serial.println("Initializing certificates...");
ret = wolfSSL_CTX_use_certificate_buffer(ctx,
CTX_SERVER_CERT,
CTX_SERVER_CERT_SIZE,
CTX_CA_CERT_TYPE);
if (ret == WOLFSSL_SUCCESS) {
Serial.print("Success: use certificate: ");
Serial.println(xstr(CTX_SERVER_CERT));
}
else {
Serial.print("Error: wolfSSL_CTX_use_certificate_buffer failed: ");
wc_ErrorString(ret, wc_error_message);
Serial.println(wc_error_message);
fail_wait();
}
/* Setup private server key */
ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
CTX_SERVER_KEY,
CTX_SERVER_KEY_SIZE,
CTX_SERVER_KEY_TYPE);
if (ret == WOLFSSL_SUCCESS) {
Serial.print("Success: use private key buffer: ");
Serial.println(xstr(CTX_SERVER_KEY));
}
else {
Serial.print("Error: wolfSSL_CTX_use_PrivateKey_buffer failed: ");
wc_ErrorString(ret, wc_error_message);
Serial.println(wc_error_message);
fail_wait();
}
return ret;
} /* Arduino setup */
/*****************************************************************************/
/*****************************************************************************/
/* Arduino setup() */
/*****************************************************************************/
/*****************************************************************************/
void setup(void) {
int i = 0;
Serial.begin(SERIAL_BAUD);
while (!Serial && (i < 10)) {
/* wait for serial port to connect. Needed for native USB port only */
delay(1000);
i++;
}
Serial.println(F(""));
Serial.println(F(""));
Serial.println(F("wolfSSL TLS Server Example Startup."));
/* define DEBUG_WOLFSSL in wolfSSL user_settings.h for diagnostics */
#if defined(DEBUG_WOLFSSL)
wolfSSL_Debugging_ON();
#endif
/* Optionally pre-allocate a large block of memory for testing */
#if defined(MEMORY_STRESS_TEST)
Serial.println(F("WARNING: Memory Stress Test Active!"));
Serial.print(F("Allocating extra memory: "));
Serial.print(MEMORY_STRESS_INITIAL);
Serial.println(F(" bytes..."));
memory_stress[mem_ctr] = (char*)malloc(MEMORY_STRESS_INITIAL);
show_memory();
#endif
setup_hardware();
setup_network();
setup_datetime();
setup_wolfssl();
setup_certificates();
/* Initialize wolfSSL using callback functions. */
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
#if defined THIS_USER_SETTINGS_VERSION
Serial.print(F("This user_settings.h version:"))
Serial.println(THIS_USER_SETTINGS_VERSION)
#endif
/* Start the server
* See https://www.arduino.cc/reference/en/libraries/ethernet/server.begin/
*/
Serial.println(F("Completed Arduino setup()"));
server.begin();
Serial.println("Begin Server... (waiting for remote client to connect)");
/* See companion wolfssl_client.ino code */
return;
}
} /* Arduino setup */
if (client.connected()) {
/*****************************************************************************/
/* wolfSSL error_check() */
/*****************************************************************************/
int error_check(int this_ret, bool halt_on_error,
const __FlashStringHelper* message) {
int ret = 0;
if (this_ret == WOLFSSL_SUCCESS) {
Serial.print(F("Success: "));
Serial.println(message);
}
else {
Serial.print(F("ERROR: return = "));
Serial.print(this_ret);
Serial.print(F(": "));
Serial.println(message);
Serial.println(wc_GetErrorString(this_ret));
if (halt_on_error) {
fail_wait();
}
}
show_memory();
Serial.println("Client connected");
return ret;
} /* error_check */
/*****************************************************************************/
/* wolfSSL error_check_ssl */
/* Parameters: */
/* ssl is the current WOLFSSL object pointer */
/* halt_on_error set to true to suspend operations for critical error */
/* message is expected to be a memory-efficient F("") macro string */
/*****************************************************************************/
int error_check_ssl(WOLFSSL* ssl, int this_ret, bool halt_on_error,
const __FlashStringHelper* message) {
int err = 0;
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
Serial.println("Unable to allocate SSL object");
return;
Serial.println(F("ssl is Null; Unable to allocate SSL object?"));
#ifndef DEBUG_WOLFSSL
Serial.println(F("Define DEBUG_WOLFSSL in user_settings.h for more."));
#else
Serial.println(F("See wolfssl/wolfcrypt/error-crypt.h for codes."));
#endif
Serial.print(F("ERROR: "));
Serial.println(message);
show_memory();
if (halt_on_error) {
fail_wait();
}
}
else {
err = wolfSSL_get_error(ssl, this_ret);
if (err == WOLFSSL_SUCCESS) {
Serial.print(F("Success m: "));
Serial.println(message);
}
else {
if (err < 0) {
wolfSSL_ERR_error_string(err, errBuf);
Serial.print(F("WOLFSSL Error: "));
Serial.print(err);
Serial.print(F("; "));
Serial.println(errBuf);
}
else {
Serial.println(F("Success: ssl object."));
}
}
}
err = wolfSSL_accept(ssl);
if (err != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Accept Error: ");
Serial.println(errBuf);
}
Serial.print("SSL version is ");
Serial.println(wolfSSL_get_version(ssl));
cipherName = wolfSSL_get_cipher(ssl);
Serial.print("SSL cipher suite is ");
Serial.println(cipherName);
Serial.print("Server Read: ");
while (client.available() || wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
if (input < 0) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Read Error: ");
Serial.println(errBuf);
break;
} else if (input > 0) {
replySz = input;
reply[input] = '\0';
Serial.print(reply);
} else {
Serial.println();
}
}
// echo data
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Write Error: ");
Serial.println(errBuf);
}
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
}
client.stop();
Serial.println("Connection complete");
return err;
}
/*****************************************************************************/
/*****************************************************************************/
/* Arduino loop() */
/*****************************************************************************/
/*****************************************************************************/
void loop() {
char errBuf[80] = "(no error";
char reply[80] = "(no reply)";
const char msg[] = "I hear you fa shizzle!";
const char* cipherName;
int input = 0;
int replySz = 0;
int retry_shutdown = SHUTDOWN_DELAY_MS; /* max try, once per millisecond */
int ret = 0;
IPAddress broadcast_address(255, 255, 255, 255);
/* Listen for incoming client requests. */
client = server.available();
if (client) {
Serial.println("Have Client");
while (!client.connected()) {
/* wait for the client to actually connect */
delay(10);
}
Serial.print("Client connected from remote IP: ");
Serial.println(client.remoteIP());
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
Serial.println("Unable to allocate SSL object");
fail_wait();
}
ret = wolfSSL_accept(ssl);
if (ret != WOLFSSL_SUCCESS) {
ret = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(ret, errBuf);
Serial.print("TLS Accept Error: ");
Serial.println(errBuf);
}
cipherName = wolfSSL_get_cipher(ssl);
Serial.print("SSL cipher suite is ");
Serial.println(cipherName);
Serial.print("Server Read: ");
while (!client.available()) {
/* wait for data */
}
/* read data */
while (wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
if (input < 0) {
ret = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(ret, errBuf);
Serial.print("TLS Read Error: ");
Serial.println(errBuf);
break;
}
else if (input > 0) {
replySz = input;
reply[input] = '\0';
Serial.print(reply);
}
else {
Serial.println("<end of reply, input == 0>");
}
}
/* Write our message into reply buffer to send */
memset(reply, 0, sizeof(reply));
memcpy(reply, msg, sizeof(msg));
replySz = strnlen(reply, sizeof(reply));
Serial.println("Sending reply...");
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
ret = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(ret, errBuf);
Serial.print("TLS Write Error: ");
Serial.println(errBuf);
}
else {
Serial.println("Reply sent!");
}
Serial.println("Shutdown!");
do {
delay(1);
retry_shutdown--;
ret = wolfSSL_shutdown(ssl);
} while ((ret == WOLFSSL_SHUTDOWN_NOT_DONE) && (retry_shutdown > 0));
if (retry_shutdown <= 0) {
/* if wolfSSL_free is called before properly shutting down the
* ssl object, undesired results may occur. */
Serial.println("Warning! Shutdown did not properly complete.");
}
wolfSSL_free(ssl);
Serial.println("Connection complete.");
if (REPEAT_CONNECTION) {
Serial.println();
Serial.println("Waiting for next connection.");
}
else {
client.stop();
Serial.println("Done!");
while (1) {
/* wait forever if not repeating */
delay(100);
}
}
}
else {
/* Serial.println("Client not connected. Trying again..."); */
}
delay(100);
} /* Arduino loop repeats */

View File

@ -0,0 +1,3 @@
# Arduino Basic Hello World
This example simply compiles in wolfSSL and shows the current version number.

View File

@ -0,0 +1,24 @@
#include <Arduino.h>
#include <wolfssl.h>
#include <wolfssl/version.h>
/* Choose a monitor serial baud rate: 9600, 14400, 19200, 57600, 74880, etc. */
#define SERIAL_BAUD 115200
/* Arduino setup */
void setup() {
Serial.begin(SERIAL_BAUD);
while (!Serial) {
/* wait for serial port to connect. Needed for native USB port only */
}
Serial.println(F(""));
Serial.println(F(""));
Serial.println(F("wolfSSL setup complete!"));
}
/* Arduino main application loop. */
void loop() {
Serial.print("wolfSSL Version: ");
Serial.println(LIBWOLFSSL_VERSION_STRING);
delay(60000);
}

View File

@ -2,67 +2,323 @@
# this script will reformat the wolfSSL source code to be compatible with
# an Arduino project
# run as bash ./wolfssl-arduino.sh
# run as bash ./wolfssl-arduino.sh [INSTALL] [path]
#
# ./wolfssl-arduino.sh
# The default is to install to a local wolfSSL directory (`ROOT_DIR`).
# If successfully built, and the INSTALL option is used, tis directory
# is then moved to the target.
#
# ./wolfssl-arduino.sh INSTALL
# Creates a local wolfSSL directory and then moves it to the ARDUINO_ROOT
#
# ./wolfssl-arduino.sh INSTALL /mnt/c/workspace/Arduino-wolfSSL-$USER
# Updates the Arduino-wolfSSL fork for $USER to refresh versions.
#
# To ensure a pristine build, the directory must not exist.
#
# Reminder there's typically no $USER for GitHub actions, but:
# ROOT_DIR="/mnt/c/Users/$USER/Documents/Arduino/libraries"
#
# The company name is "wolfSSL Inc."; Theres a space, no comma, and a period after "Inc."
# The Arduino library name is "wolfssl" (all lower case)
# The Arduino library directory name is "wolfssl" (all lower case)
# The Arduino library include file is "wolfssl.h" (all lower case)
# The Published wolfSSL Arduino Registry is at https://github.com/wolfSSL/Arduino-wolfSSL.git
# See https://downloads.arduino.cc/libraries/logs/github.com/wolfSSL/Arduino-wolfSSL/
ROOT_DIR="/wolfssl"
DIR=${PWD##*/}
# The Arduino Version will initially have a suffix appended during fine tuning stage.
WOLFSSL_VERSION_ARUINO_SUFFIX="-Arduino.3"
space(){
echo "" >> "$1"
}
# For verbose copy, set CP_CMD="-v", otherwise clear it: CP_CMD="cp"
# Do not set to empty string, as copy will fail with this: CP_CMD=""
# CP_CMD="cp -v "
CP_CMD="cp "
if [ "$DIR" = "ARDUINO" ]; then
rm -rf wolfSSL
mkdir wolfSSL
# Specify the executable shell checker you want to use:
MY_SHELLCHECK="shellcheck"
cp ../../src/*.c ./wolfSSL
cp ../../wolfcrypt/src/*.c ./wolfSSL
# There are special circumstances to publish to GitHub repository.
# Typically: https://github.com/wolfSSL/Arduino-wolfSSL
#
# Unlike a local Arduino library that requires a clean directory,
# we'll allow extra files, overwrites, etc.
#
# Note in all cases, the local IDE/ARDUINO/wolfssl must be empty.
THIS_INSTALL_IS_GITHUB="false"
mkdir wolfSSL/wolfssl
cp ../../wolfssl/*.h ./wolfSSL/wolfssl
mkdir wolfSSL/wolfssl/wolfcrypt
cp ../../wolfssl/wolfcrypt/*.h ./wolfSSL/wolfssl/wolfcrypt
# Check if the executable is available in the PATH
if command -v "$MY_SHELLCHECK" >/dev/null 2>&1; then
# Run your command here
shellcheck "$0" || exit 1
else
echo "$MY_SHELLCHECK is not installed. Please install it if changes to this script have been made."
fi
# support misc.c as include in wolfcrypt/src
mkdir ./wolfSSL/wolfcrypt
mkdir ./wolfSSL/wolfcrypt/src
cp ../../wolfcrypt/src/misc.c ./wolfSSL/wolfcrypt/src
cp ../../wolfcrypt/src/asm.c ./wolfSSL/wolfcrypt/src
if ! [ "$CP_CMD" = "cp " ]; then
if [ "$CP_CMD" = "cp -v" ]; then
echo "Copy verbose mode"
else
echo "ERROR: Copy mode not supported: $CP_CMD"
exit 1
fi
fi
# Check environment
if [ -n "$WSL_DISTRO_NAME" ]; then
# we found a non-blank WSL environment distro name
current_path="$(pwd)"
pattern="/mnt/?"
if echo "$current_path" | grep -Eq "^$pattern"; then
# if we are in WSL and shared Windows file system, 'ln' does not work.
ARDUINO_ROOT="/mnt/c/Users/$USER/Documents/Arduino/libraries"
else
ARDUINO_ROOT="$HOME/Arduino/libraries"
fi
fi
echo "The Arduino library root is: $ARDUINO_ROOT"
if [ $# -gt 0 ]; then
THIS_OPERATION="$1"
if [ "$THIS_OPERATION" = "INSTALL" ]; then
THIS_INSTALL_DIR=$2
echo "Install is active."
if [ "$THIS_INSTALL_DIR" = "" ]; then
if [ -d "$ARDUINO_ROOT$ROOT_DIR" ]; then
echo "Error: the installation directory already exists: $ARDUINO_ROOT$ROOT_DIR"
echo "A new directory needs to be created to ensure there are no stray files"
echo "Please delete or move the directory and try again."
exit 1
fi
else
echo "Installing to $THIS_INSTALL_DIR"
if [ -d "$THIS_INSTALL_DIR/.git" ];then
echo "Target is a GitHub repository."
THIS_INSTALL_IS_GITHUB="true"
else
echo "Target is NOT a GitHub repository."
fi
fi
else
echo "Error: not a valid operation: $THIS_OPERATION"
exit 1
fi
fi
ROOT_SRC_DIR="${ROOT_DIR}/src"
EXAMPLES_DIR="${ROOT_DIR}/examples"
WOLFSSL_SRC="${ROOT_SRC_DIR}/src"
WOLFSSL_HEADERS="${ROOT_SRC_DIR}/wolfssl"
WOLFCRYPT_ROOT="${ROOT_SRC_DIR}/wolfcrypt"
WOLFCRYPT_SRC="${WOLFCRYPT_ROOT}/src"
WOLFCRYPT_HEADERS="${WOLFSSL_HEADERS}/wolfcrypt"
OPENSSL_DIR="${WOLFSSL_HEADERS}/openssl"
# TOP indicates the file directory for top level of the wolfssl repository.
TOP_DIR="../.."
WOLFSSL_SRC_TOP="${TOP_DIR}/src"
WOLFSSL_HEADERS_TOP="${TOP_DIR}/wolfssl"
WOLFCRYPT_ROOT_TOP="${TOP_DIR}/wolfcrypt"
WOLFCRYPT_SRC_TOP="${WOLFCRYPT_ROOT_TOP}/src"
WOLFCRYPT_HEADERS_TOP="${WOLFSSL_HEADERS_TOP}/wolfcrypt"
OPENSSL_DIR_TOP="${WOLFSSL_HEADERS_TOP}/openssl"
WOLFSSL_VERSION=$(grep -i "LIBWOLFSSL_VERSION_STRING" ${TOP_DIR}/wolfssl/version.h | cut -d '"' -f 2)
if [ "$WOLFSSL_VERSION" = "" ]; then
echo "ERROR: Could not find wolfSSL Version in ${TOP_DIR}/wolfssl/version.h"
exit 1
else
echo "Found wolfSSL version $WOLFSSL_VERSION"
echo "# WOLFSSL_VERSION_ARUINO_SUFFIX $WOLFSSL_VERSION_ARUINO_SUFFIX"
fi
echo ""
THIS_DIR=${PWD##*/}
if [ "$THIS_DIR" = "ARDUINO" ]; then
# mkdir ./wolfssl
if [ -d ".${ROOT_DIR}" ]; then
echo "ERROR: $(realpath ".${ROOT_DIR}") is not empty"
exit 1
else
echo "Step 01: mkdir .${ROOT_DIR}"
mkdir ."${ROOT_DIR}"
fi
# mkdir ./wolfssl/src
if [ ! -d ".${ROOT_SRC_DIR}" ]; then
echo "Step 02: mkdir .${ROOT_SRC_DIR}"
mkdir ."${ROOT_SRC_DIR}"
fi
# mkdir ./wolfssl/src/wolfssl
if [ ! -d ".${WOLFSSL_HEADERS}" ]; then
echo "Step 03: mkdir .${WOLFSSL_HEADERS}"
mkdir ."${WOLFSSL_HEADERS}"
fi
# cp ../../wolfssl/*.h ./wolfssl/src/wolfssl
echo "Step 04: cp ${WOLFSSL_HEADERS_TOP}/*.h .${WOLFSSL_HEADERS}"
$CP_CMD "${WOLFSSL_HEADERS_TOP}"/*.h ."${WOLFSSL_HEADERS}"
if [ ! -d ".${WOLFCRYPT_HEADERS}" ]; then
# mkdir ./wolfssl/src/wolfssl/wolfcrypt
echo "Step 05: mkdir .${WOLFCRYPT_HEADERS}"
mkdir ."${WOLFCRYPT_HEADERS}"
mkdir ."${WOLFCRYPT_HEADERS}/port"
mkdir ."${WOLFCRYPT_HEADERS}/port/atmel"
mkdir ."${WOLFCRYPT_HEADERS}/port/Espressif"
fi
# cp ../../wolfssl/wolfcrypt/*.h ./wolfssl/src/wolfssl/wolfcrypt
echo "Step 06: cp ${WOLFCRYPT_HEADERS_TOP}/*.h .${WOLFCRYPT_HEADERS}"
$CP_CMD "${WOLFCRYPT_HEADERS_TOP}"/*.h ."${WOLFCRYPT_HEADERS}" || exit 1
$CP_CMD "${WOLFCRYPT_HEADERS_TOP}"/port/atmel/*.h ."${WOLFCRYPT_HEADERS}/port/atmel" || exit 1
$CP_CMD "${WOLFCRYPT_HEADERS_TOP}"/port/Espressif/*.h ."${WOLFCRYPT_HEADERS}/port/Espressif" || exit 1
# Add in source files to wolfcrypt/src
if [ ! -d ".${WOLFCRYPT_ROOT}" ]; then
# mkdir ./wolfssl/src/wolfcrypt
echo "Step 07: mkdir .${WOLFCRYPT_ROOT}"
mkdir ."${WOLFCRYPT_ROOT}"
fi
# mkdir ./wolfssl/src/wolfcrypt/src
if [ ! -d ".${WOLFCRYPT_SRC}" ]; then
echo "Step 08: mkdir .${WOLFCRYPT_SRC}"
mkdir ."${WOLFCRYPT_SRC}"
mkdir ."${WOLFCRYPT_SRC}"/port
mkdir ."${WOLFCRYPT_SRC}"/port/atmel
mkdir ."${WOLFCRYPT_SRC}"/port/Espressif
fi
# cp ../../wolfcrypt/src/*.c ./wolfssl/src/wolfcrypt/src
echo "Step 09: cp ${WOLFCRYPT_SRC_TOP}/*.c .${WOLFCRYPT_SRC}"
$CP_CMD -r "${WOLFCRYPT_SRC_TOP}"/*.c ."${WOLFCRYPT_SRC}" || exit 1
$CP_CMD -r "${WOLFCRYPT_SRC_TOP}"/port/atmel/*.c ."${WOLFCRYPT_SRC}"/port/atmel || exit 1
$CP_CMD -r "${WOLFCRYPT_SRC_TOP}"/port/Espressif/*.c ."${WOLFCRYPT_SRC}"/port/Espressif || exit 1
# Add in source files to top level src folders
if [ ! -d ".${WOLFSSL_SRC}" ]; then
# mkdir ./wolfssl/src/src
echo "Step 10: mkdir .${WOLFSSL_SRC}"
mkdir ."${WOLFSSL_SRC}"
fi
$CP_CMD "${WOLFSSL_SRC_TOP}"/*.c ."${WOLFSSL_SRC}" || exit 1
# put bio and evp as includes
mv ./wolfSSL/bio.c ./wolfSSL/wolfssl
mv ./wolfSSL/evp.c ./wolfSSL/wolfssl
$CP_CMD ."${WOLFSSL_SRC}"/bio.c ."${WOLFSSL_HEADERS}" || exit 1
$CP_CMD ."${WOLFCRYPT_SRC}"/evp.c ."${WOLFSSL_HEADERS}" || exit 1
echo "/* Generated wolfSSL header file for Arduino */" > ./wolfSSL/wolfssl.h
echo "#include <wolfssl/wolfcrypt/settings.h>" >> ./wolfSSL/wolfssl.h
echo "#include <wolfssl/ssl.h>" >> ./wolfSSL/wolfssl.h
# make a copy of evp.c and bio.c for ssl.c to include inline
$CP_CMD ."${WOLFSSL_HEADERS}"/evp.c ."${WOLFCRYPT_SRC}"/evp.c || exit 1
$CP_CMD ."${WOLFSSL_HEADERS}"/bio.c ."${WOLFCRYPT_SRC}"/bio.c || exit 1
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
# copy openssl compatibility headers to their appropriate location
if [ ! -d ".${OPENSSL_DIR}" ]; then
mkdir ."${OPENSSL_DIR}"
fi
$CP_CMD "${OPENSSL_DIR_TOP}"/* ."${OPENSSL_DIR}" || exit 1
cp wolfSSL/wolfssl/wolfcrypt/settings.h wolfSSL/wolfssl/wolfcrypt/settings.h.bak
echo " /* wolfSSL Generated ARDUINO settings */" > ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo "#ifndef WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo " #define WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo "#endif /* WOLFSSL_USER_SETTINGS */" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo " /* wolfSSL Generated ARDUINO settings: END */" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
cat ./wolfSSL/wolfssl/wolfcrypt/settings.h.bak >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
# Finally, copy the Arduino-specific wolfssl library files into place: [lib]/src
$CP_CMD ./wolfssl.h ".${ROOT_SRC_DIR}"/wolfssl.h
echo "Copy examples...."
# Copy examples
mkdir -p ".${ROOT_SRC_DIR}"/examples
echo "Copy wolfssl_client example...."
mkdir -p ".${EXAMPLES_DIR}"/wolfssl_client
$CP_CMD ./sketches/wolfssl_client/wolfssl_client.ino ".${EXAMPLES_DIR}"/wolfssl_client/wolfssl_client.ino || exit 1
$CP_CMD ./sketches/wolfssl_client/README.md ".${EXAMPLES_DIR}"/wolfssl_client/README.md || exit 1
echo "Copy wolfssl_server example...."
mkdir -p .${EXAMPLES_DIR}/wolfssl_server
$CP_CMD ./sketches/wolfssl_server/wolfssl_server.ino ".${EXAMPLES_DIR}"/wolfssl_server/wolfssl_server.ino || exit 1
$CP_CMD ./sketches/wolfssl_server/README.md ".${EXAMPLES_DIR}"/wolfssl_server/README.md || exit 1
echo "Copy wolfssl_server example...."
mkdir -p .${EXAMPLES_DIR}/wolfssl_version
$CP_CMD ./sketches/wolfssl_version/wolfssl_version.ino ".${EXAMPLES_DIR}"/wolfssl_version/wolfssl_version.ino || exit 1
$CP_CMD ./sketches/wolfssl_version/README.md ".${EXAMPLES_DIR}"/wolfssl_version/README.md || exit 1
else
echo "ERROR: You must be in the IDE/ARDUINO directory to run this script"
exit 1
fi
# At this point, the library is complete, but we need some additional files.
#
# optional diagnostics:
# echo ".${ROOT_DIR}"
# echo "${TOP_DIR}"
# echo "cp ${TOP_DIR}/README.md .${ROOT_DIR}/"
# Replace the `${WOLFSSL_VERSION}` text in Arduino_README_prepend.md,
# saving it to a .tmp file. Prepend that file to the wolfSSL README.md
# file as PREPENDED_README.md, then copy that to the publish directory
# as an Arduino-specific README.md file.
VERSION_PLACEHOLDER="\${WOLFSSL_VERSION}"
ARDUINO_VERSION_SUFFIX_PLACEHOLDER="\${WOLFSSL_VERSION_ARUINO_SUFFIX}"
PREPEND_FILE="Arduino_README_prepend.md"
PROPERTIES_FILE_TEMPLATE="library.properties.template"
sed s/"$VERSION_PLACEHOLDER"/"$WOLFSSL_VERSION"/ "$PREPEND_FILE" > "$PREPEND_FILE.tmp"
cat "$PREPEND_FILE.tmp" ${TOP_DIR}/README.md > PREPENDED_README.md
# Here we'll insert the wolfSSL version into the `library.properties.tmp` file, along with an Arduino version suffix.
# The result should be something like version=5.6.6.Arduino.1 (for the 1st incremental version on top of 5.6.6)
sed s/"$VERSION_PLACEHOLDER"/"$WOLFSSL_VERSION"/ "$PROPERTIES_FILE_TEMPLATE" > "library.properties.tmp"
sed -i.backup s/"$ARDUINO_VERSION_SUFFIX_PLACEHOLDER"/"$WOLFSSL_VERSION_ARUINO_SUFFIX"/ "library.properties.tmp"
# cat library.properties.tmp
# echo "${WOLFSSL_VERSION_ARUINO_SUFFIX}"
echo "Step 11: Final root file copy"
$CP_CMD PREPENDED_README.md ."${ROOT_DIR}"/README.md || exit 1
$CP_CMD library.properties.tmp ."${ROOT_DIR}"/library.properties || exit 1
$CP_CMD "${TOP_DIR}"/"LICENSING" ."${ROOT_DIR}"/ || exit 1
$CP_CMD "${TOP_DIR}"/"README" ."${ROOT_DIR}"/ || exit 1
$CP_CMD "${TOP_DIR}"/"COPYING" ."${ROOT_DIR}"/ || exit 1
$CP_CMD "${TOP_DIR}"/"ChangeLog.md" ."${ROOT_DIR}"/ || exit 1
$CP_CMD "${TOP_DIR}"/".editorconfig" ."${ROOT_DIR}"/ || exit 1
$CP_CMD "${TOP_DIR}"/".gitignore" ."${ROOT_DIR}"/ || exit 1
$CP_CMD "keywords.txt" ."${ROOT_DIR}"/ || exit 1
echo "Step 12: Workspace to publish:"
echo ""
head -n 3 PREPENDED_README.md
echo ""
ls ./wolfssl -al
echo ""
# Optionally install to a separate directory.
# Note we should have exited above if a problem was encountered,
# as we'll never want to install a bad library.
if [ "$THIS_OPERATION" = "INSTALL" ]; then
if [ "$THIS_INSTALL_IS_GITHUB" = "true" ]; then
echo "Installing to GitHub directory: $THIS_INSTALL_DIR"
cp -r ."$ROOT_DIR"/* "$THIS_INSTALL_DIR" || exit 1
else
echo "Config:"
echo "cp ../../examples/configs/user_settings_arduino.h ".${ROOT_SRC_DIR}"/user_settings.h"
# Nearly an ordinary copy, but we remove any lines with ">>" (typically edit with caution warning in comments)
grep -v '>>' ../../examples/configs/user_settings_arduino.h > ".${ROOT_SRC_DIR}"/user_settings.h || exit 1
# Show the user_settings.h revision string:
grep "WOLFSSL_USER_SETTINGS_ID" ."${ROOT_SRC_DIR}/user_settings.h"
echo ""
echo "Install:"
echo "mv .$ROOT_DIR $ARDUINO_ROOT"
mv ."$ROOT_DIR" "$ARDUINO_ROOT" || exit 1
echo "Arduino wolfSSL Version: $WOLFSSL_VERSION$WOLFSSL_VERSION_ARUINO_SUFFIX"
fi
fi
echo "Done!"

View File

@ -1,6 +1,6 @@
/* md2.h
/* wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2024 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -19,25 +19,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Edit with caution. This is an Arduino-library specific header for wolfSSL */
/* check for old macro */
#if !defined(CYASSL_MD2) && defined(WOLFSSL_MD2)
#define CYASSL_MD2
#ifndef WOLFSSL_USER_SETTINGS
#define WOLFSSL_USER_SETTINGS
#endif
#ifdef CYASSL_MD2
#include <Arduino.h>
#ifndef CTAO_CRYPT_MD2_H
#define CTAO_CRYPT_MD2_H
#include <wolfssl/wolfcrypt/md2.h>
#define InitMd2 wc_InitMd2
#define Md2Update wc_Md2Update
#define Md2Final wc_Md2Final
#define Md2Hash wc_Md2Hash
#endif /* CTAO_CRYPT_MD2_H */
#endif /* CYASSL_MD2 */
/* wolfSSL user_settings.h must be included from settings.h */
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
int wolfSSL_Arduino_Serial_Print(const char *const s)
{
/* See wolfssl/wolfcrypt/logging.c */
Serial.println(F(s));
return 0;
};

153
IDE/AURIX/Cpu0_Main.c Normal file
View File

@ -0,0 +1,153 @@
/* Cpu0_Main.c
*
* Copyright (C) 2006-2023 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
*/
/* Infineon includes */
#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "IfxAsclin_Asc.h"
#include "IfxCpu_Irq.h"
#include "IfxPort.h"
#include "SysSe/Bsp/Bsp.h"
/* For mapping stdio printf */
#include <stdio.h>
#include <string.h>
/* used to wait for CPU sync event */
IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;
#define SERIAL_BAUDRATE 115200 /* Baud rate in bit/s */
#define SERIAL_PIN_RX IfxAsclin0_RXA_P14_1_IN /* RX pin of the board */
#define SERIAL_PIN_TX IfxAsclin0_TX_P14_0_OUT /* TX pin of the board */
#define INTPRIO_ASCLIN0_TX 19 /* Priority of the ISR */
#define ASC_TX_BUFFER_SIZE 128 /* Definition of the buffer size */
/* Declaration of the ASC handle */
static IfxAsclin_Asc g_asc;
/* Declaration of the FIFOs parameters:
* The transfer buffers allocate memory for the data itself and for FIFO runtime
* variables. 8 more bytes have to be added to ensure a proper circular buffer
* handling independent from the address to which the buffers have been located.
*/
static uint8 g_ascTxBuffer[ASC_TX_BUFFER_SIZE + sizeof(Ifx_Fifo) + 8];
/******************************************************************************/
/*----Function Implementations------------------------------------------------*/
/******************************************************************************/
/* Re-target the C library printf function to the asc lin. */
int fputc(int ch, FILE *f)
{
Ifx_SizeT count;
/* convert to CRLF */
if (ch == (int)'\n') {
int chcr = (int)'\r';
count = 1;
IfxAsclin_Asc_write(&g_asc, &chcr, &count, TIME_INFINITE);
}
count = 1;
IfxAsclin_Asc_write(&g_asc, &ch, &count, TIME_INFINITE);
return ch;
}
/* Add the Interrupt Service Routine */
IFX_INTERRUPT(asclin0_Tx_ISR, 0, INTPRIO_ASCLIN0_TX);
void asclin0_Tx_ISR(void)
{
IfxAsclin_Asc_isrTransmit(&g_asc);
}
static void init_UART(void)
{
IfxAsclin_Asc_Config ascConfig;
IfxCpu_Irq_installInterruptHandler(asclin0_Tx_ISR, INTPRIO_ASCLIN0_TX);
/* Port pins configuration */
const IfxAsclin_Asc_Pins pins = {
NULL_PTR, IfxPort_InputMode_pullUp, /* CTS pin not used */
&SERIAL_PIN_RX, IfxPort_InputMode_pullUp, /* RX pin */
NULL_PTR, IfxPort_OutputMode_pushPull, /* RTS pin not used */
&SERIAL_PIN_TX, IfxPort_OutputMode_pushPull, /* TX pin */
IfxPort_PadDriver_cmosAutomotiveSpeed1
};
/* Initialize an instance of IfxAsclin_Asc_Config with default values */
IfxAsclin_Asc_initModuleConfig(&ascConfig, SERIAL_PIN_TX.module);
/* Set the desired baud rate */
ascConfig.baudrate.baudrate = SERIAL_BAUDRATE;
/* ISR priorities and interrupt target */
ascConfig.interrupt.txPriority = INTPRIO_ASCLIN0_TX;
ascConfig.interrupt.typeOfService = IfxCpu_Irq_getTos(IfxCpu_getCoreIndex());
/* FIFO configuration */
ascConfig.txBuffer = &g_ascTxBuffer;
ascConfig.txBufferSize = ASC_TX_BUFFER_SIZE;
ascConfig.pins = &pins;
/* Initialize module with above parameters */
IfxAsclin_Asc_initModule(&g_asc, &ascConfig);
/* Turn off buffers, so I/O occurs immediately */
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
int send_UART(const char* str)
{
Ifx_SizeT count = (Ifx_SizeT)strlen(str);
IfxAsclin_Asc_write(&g_asc, str, &count, TIME_INFINITE);
return (int)count;
}
void core0_main(void)
{
IfxCpu_enableInterrupts();
/* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
* Enable the watchdogs and service them periodically if it is required
*/
IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
/* Wait for CPU sync event */
IfxCpu_emitEvent(&g_cpuSyncEvent);
IfxCpu_waitEvent(&g_cpuSyncEvent, 1);
/* Initialize the UART to board VCOM */
init_UART();
/* bare metal loop */
while(1)
{
extern void run_wolf_tests(void);
run_wolf_tests();
/* wait 5 seconds */
waitTime(IfxStm_getTicksFromMilliseconds(BSP_DEFAULT_TIMER, 5 * 1000));
} /* while */
}

114
IDE/AURIX/README.md Normal file
View File

@ -0,0 +1,114 @@
# Infineon AURIX Development Studio
An Eclipse based IDE for developing software for the Infineon TriCore AURIX TX3XX.
Tested Platform:
* Infineon AURIX™ Development Studio 1.7.2 (Build 20220617-0730)
* Infineon TriBoard TC399 v2.0
* wolfSSL v5.4.0 (with PR 5419)
## Running wolfCrypt on TriCore
1) Add the wolfSSL source and headers to `Libraries/wolfssl`.
- Only the following folders are required: `src`, `wolfcrypt` and `wolfssl`.
- See script to help with producing bundle here: https://github.com/wolfSSL/wolfssl/blob/master/scripts/makedistsmall.sh
2) Add `WOLFSSL_USER_SETTINGS` to the Preprocessing symbols list. C/C++ Build -> Settings -> TASKING C/C++ Compiler -> Preprocessing.
3) Add `Libraries/wolfssl` to the include path. C/C++ General -> Paths and Symbols -> Includes -> GNU C
4) Add ignores for the following warnings. Unused static function (553) and switch missing break (536). C/C++ Build -> Settings -> TASKING C/C++ Compiler -> Diagnostics
5) Copy `Cpu0_Main.c`, `user_settings.h` and `wolf_main.c` into the project folder.
6) Increase the stack by modifying `Lcf_Tasking_Tricore_Tc.lsl` to adjusting the USTACK0-4 (`LCF_USTACK#_SIZE`) from 2k to 12k.
6) Build and run/debug.
### Example output from wolfCrypt test and benchmark
Benchmark Configuration:
* TriCore (TC1.6.2P) 32-bit super-scalar running at 300MHz:
* Release build: `-O2`
* SP Math SMALL: sp_c32.c for RSA/ECC/DH
* AES GCM SMALL
```
Running wolfCrypt Tests...
------------------------------------------------------------------------------
wolfSSL version 5.4.0
------------------------------------------------------------------------------
error test passed!
MEMORY test passed!
base64 test passed!
asn test passed!
RANDOM test passed!
SHA test passed!
SHA-256 test passed!
Hash test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
HMAC-KDF test passed!
TLSv1.3 KDF test passed!
GMAC test passed!
Chacha test passed!
POLY1305 test passed!
ChaCha20-Poly1305 AEAD test passed!
AES test passed!
AES192 test passed!
AES256 test passed!
AES-GCM test passed!
RSA test passed!
ECC test passed!
ECC buffer test passed!
CMAC test passed!
logging test passed!
time test passed!
mutex test passed!
memcb test passed!
Test complete
Crypt Test: Return code 0
Running wolfCrypt Benchmarks...
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 725 KB took 1.023 seconds, 708.703 KB/s
AES-128-CBC-enc 2 MB took 1.002 seconds, 2.071 MB/s
AES-128-CBC-dec 2 MB took 1.005 seconds, 2.065 MB/s
AES-192-CBC-enc 2 MB took 1.002 seconds, 1.779 MB/s
AES-192-CBC-dec 2 MB took 1.013 seconds, 1.783 MB/s
AES-256-CBC-enc 2 MB took 1.003 seconds, 1.558 MB/s
AES-256-CBC-dec 2 MB took 1.009 seconds, 1.573 MB/s
AES-128-GCM-enc 225 KB took 1.013 seconds, 222.112 KB/s
AES-128-GCM-dec 225 KB took 1.014 seconds, 221.892 KB/s
AES-192-GCM-enc 225 KB took 1.046 seconds, 215.107 KB/s
AES-192-GCM-dec 225 KB took 1.046 seconds, 215.104 KB/s
AES-256-GCM-enc 225 KB took 1.070 seconds, 210.279 KB/s
AES-256-GCM-dec 225 KB took 1.069 seconds, 210.477 KB/s
GMAC Small 251 KB took 1.000 seconds, 251.000 KB/s
AES-128-ECB-enc 2 MB took 1.000 seconds, 2.000 MB/s
AES-128-ECB-dec 2 MB took 1.000 seconds, 2.049 MB/s
AES-192-ECB-enc 2 MB took 1.000 seconds, 1.727 MB/s
AES-192-ECB-dec 2 MB took 1.000 seconds, 1.772 MB/s
AES-256-ECB-enc 2 MB took 1.000 seconds, 1.518 MB/s
AES-256-ECB-dec 2 MB took 1.000 seconds, 1.563 MB/s
CHACHA 3 MB took 1.007 seconds, 3.322 MB/s
CHA-POLY 2 MB took 1.011 seconds, 2.028 MB/s
POLY1305 6 MB took 1.003 seconds, 6.012 MB/s
SHA 3 MB took 1.004 seconds, 3.380 MB/s
SHA-256 2 MB took 1.003 seconds, 1.558 MB/s
AES-128-CMAC 2 MB took 1.010 seconds, 2.055 MB/s
AES-256-CMAC 2 MB took 1.010 seconds, 1.547 MB/s
HMAC-SHA 3 MB took 1.004 seconds, 3.356 MB/s
HMAC-SHA256 2 MB took 1.010 seconds, 1.547 MB/s
RSA 2048 public 50 ops took 1.020 sec, avg 20.400 ms, 49.019 ops/sec
RSA 2048 private 2 ops took 2.377 sec, avg 1188.492 ms, 0.841 ops/sec
ECC [ SECP256R1] 256 key gen 16 ops took 1.061 sec, avg 66.313 ms, 15.080 ops/sec
ECDHE [ SECP256R1] 256 agree 16 ops took 1.059 sec, avg 66.187 ms, 15.109 ops/sec
ECDSA [ SECP256R1] 256 sign 14 ops took 1.058 sec, avg 75.570 ms, 13.233 ops/sec
ECDSA [ SECP256R1] 256 verify 8 ops took 1.080 sec, avg 135.002 ms, 7.407 ops/sec
Benchmark complete
Benchmark Test: Return code 0
```
## Running wolfCrypt on the HSM (Cortex M3)
Coming soon
## Support
For questions please email facts@wolfssl.com

8
IDE/AURIX/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/AURIX/Cpu0_Main.c
EXTRA_DIST+= IDE/AURIX/README.md
EXTRA_DIST+= IDE/AURIX/user_settings.h
EXTRA_DIST+= IDE/AURIX/wolf_main.c

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -19,7 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Example wolfSSL user settings for STM32F4 with CubeMX */
/* Template for the Infineon AURIX Development Studio and TC3XX
* Example wolfSSL user settings with #if 0/1 gates to enable/disable algorithms and features.
* This file is included with wolfssl/wolfcrypt/settings.h when WOLFSSL_USER_SETTINGS is defined.
*/
#ifndef WOLFSSL_USER_SETTINGS_H
#define WOLFSSL_USER_SETTINGS_H
@ -31,73 +35,91 @@ extern "C" {
/* ------------------------------------------------------------------------- */
/* Platform */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_GENERAL_ALIGNMENT
#define WOLFSSL_GENERAL_ALIGNMENT 4
/* Alignment and sizeof 64-bit */
#define WOLFSSL_GENERAL_ALIGNMENT 4
#define SIZEOF_LONG_LONG 8
#undef SINGLE_THREADED
//#define SINGLE_THREADED
/* disable threading - mutex locking */
#define SINGLE_THREADED
#undef WOLFSSL_SMALL_STACK
#define WOLFSSL_SMALL_STACK
/* ignore file include warnings */
#define WOLFSSL_IGNORE_FILE_WARN
#undef WOLFSSL_STM32F4
#define WOLFSSL_STM32F4
#undef WOLFSSL_STM32_CUBEMX
#define WOLFSSL_STM32_CUBEMX
#undef FREERTOS
#define FREERTOS
#undef WOLFSSL_USER_IO
/* disable the built-in socket support and use the IO callbacks.
* Set with wolfSSL_CTX_SetIORecv/wolfSSL_CTX_SetIOSend
*/
#define WOLFSSL_USER_IO
#undef WOLFSSL_NO_SOCK
#define WOLFSSL_NO_SOCK
/* Disable file system */
#define NO_FILESYSTEM
/* ------------------------------------------------------------------------- */
/* HW Crypto Acceleration */
/* Port */
/* ------------------------------------------------------------------------- */
// See settings.h STM32F4 section
/* Optionally Disable Hardware Hashing Support */
//#define NO_STM32_HASH
//#define NO_STM32_RNG
//#define NO_STM32_CRYPTO
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
#define WOLFSSL_GMTIME
#define USER_TICKS
extern unsigned long my_time(unsigned long* timer);
#define XTIME my_time
/* Use built-in P-RNG (SHA256 based) with HW RNG */
#undef HAVE_HASHDRBG
#define HAVE_HASHDRBG
/* Custom Seed Source */
#define CUSTOM_RAND_TYPE unsigned int
extern unsigned int my_rng_seed_gen(void);
#undef CUSTOM_RAND_GENERATE
#define CUSTOM_RAND_GENERATE my_rng_seed_gen
/* Standard Lib - C89 */
#define XSTRCASECMP(s1,s2) strcmp((s1),(s2))
/* ------------------------------------------------------------------------- */
/* Math Configuration */
/* ------------------------------------------------------------------------- */
#undef USE_FAST_MATH
#define USE_FAST_MATH
#ifdef USE_FAST_MATH
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT
#undef TFM_NO_ASM
//#define TFM_NO_ASM
/* Optimizations (TFM_ARM, TFM_ASM or none) */
//#define TFM_ASM
#endif
/* Wolf Single Precision Math */
#undef USE_FAST_MATH
#undef WOLFSSL_SP
#if 0
#define WOLFSSL_SP
#define WOLFSSL_SP_SMALL /* use smaller version of code */
#if 1
/* Wolf Single Precision Math */
#define WOLFSSL_HAVE_SP_RSA
//#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_CACHE_RESISTANT
#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
#define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
#define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
//#define WOLFSSL_SP_ASM /* required if using the ASM versions */
#define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
//#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
#define WOLFSSL_SP_NO_MALLOC
//#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
/* use smaller version of code */
#define WOLFSSL_SP_SMALL
/* SP Assembly Speedups - specific to chip type */
//#define WOLFSSL_SP_ASM
//#define WOLFSSL_SP_ARM32_ASM
//#define WOLFSSL_SP_ARM64_ASM
//#define WOLFSSL_SP_ARM_THUMB_ASM
//#define WOLFSSL_SP_ARM_CORTEX_M_ASM
#endif
#ifndef WOLFSSL_SP_MATH
#if 0
/* fast math (tfmc.) (stack based and timing resistant) */
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#else
/* normal heap based integer.c (not timing resistant) */
#define USE_INTEGER_HEAP_MATH
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Crypto */
@ -107,115 +129,112 @@ extern "C" {
#if 1
#ifdef USE_FAST_MATH
/* Maximum math bits (Max RSA key bits * 2) */
#undef FP_MAX_BITS
#define FP_MAX_BITS 4096
#define FP_MAX_BITS 4096
#endif
/* half as much memory but twice as slow */
#undef RSA_LOW_MEM
//#define RSA_LOW_MEM
/* Enables blinding mode, to prevent timing attacks */
#undef WC_RSA_BLINDING
#define WC_RSA_BLINDING
/* RSA PSS Support (required for TLS v1.3)*/
#if 0
#define WC_RSA_PSS
#endif
/* RSA PSS Support */
#define WC_RSA_PSS
#else
#define NO_RSA
#endif
/* ECC */
#if 1
#undef HAVE_ECC
#define HAVE_ECC
/* Manually define enabled curves */
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
//#define HAVE_ECC384
//#define HAVE_ECC521
/* Fixed point cache (speeds repeated operations against same private key) */
#undef FP_ECC
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#undef FP_ENTRIES
#define FP_ENTRIES 2
#undef FP_LUT
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#undef ECC_SHAMIR
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#undef ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#ifdef USE_FAST_MATH
#ifdef NO_RSA
/* Custom fastmath size if not using RSA */
/* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
#undef FP_MAX_BITS
#define FP_MAX_BITS (256 + 32)
#else
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#endif
/* Enable TFM optimizations for ECC */
//#define TFM_ECC192
//#define TFM_ECC224
#define TFM_ECC256
//#define TFM_ECC384
//#define TFM_ECC521
#endif
#endif
/* DH */
#undef NO_DH
#if 0
#define HAVE_DH /* freeRTOS settings.h requires this */
/* Use table for DH instead of -lm (math) lib dependency */
#if 1
#define WOLFSSL_DH_CONST
#define HAVE_FFDHE_2048
//#define HAVE_FFDHE_4096
//#define HAVE_FFDHE_6144
//#define HAVE_FFDHE_8192
#endif
#else
//#define NO_DH
#define NO_DH
#endif
/* ECC */
#undef HAVE_ECC
#if 1
#define HAVE_ECC
/* Manually define enabled curves */
#define ECC_USER_CURVES
#ifdef ECC_USER_CURVES
/* Manual Curve Selection */
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
#define HAVE_ECC384
//#define HAVE_ECC521
#endif
/* Fixed point cache (speeds repeated operations against same private key) */
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#define FP_ENTRIES 2
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#define ECC_TIMING_RESISTANT
/* Compressed ECC Key Support */
//#define HAVE_COMP_KEY
/* Use alternate ECC size for ECC math */
#ifdef USE_FAST_MATH
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
#if defined(NO_RSA) && defined(NO_DH)
/* Custom fastmath size if not using RSA/DH */
#define FP_MAX_BITS (256 * 2)
#else
/* use heap allocation for ECC points */
#define ALT_ECC_SIZE
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overridden */
//#define FP_MAX_BITS_ECC (256 * 2)
#endif
/* Speedups specific to curve */
#ifndef NO_ECC256
#define TFM_ECC256
#endif
#endif
#endif
/* AES */
#undef NO_AES
#if 1
#undef HAVE_AESGCM
#define HAVE_AESGCM
#define HAVE_AES_CBC
/* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#undef GCM_SMALL
/* GCM Method: GCM_TABLE_4BIT, GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#define HAVE_AESGCM
#define GCM_SMALL
#undef WOLFSSL_AES_COUNTER
#define WOLFSSL_AES_COUNTER
#undef WOLFSSL_AES_DIRECT
#define WOLFSSL_AES_DIRECT
#undef HAVE_AES_ECB
#define HAVE_AES_ECB
#define WOLFSSL_AES_DIRECT
#define HAVE_AES_ECB
#else
#define NO_AES
#endif
/* DES */
#undef NO_DES3
#if 1
/* DES3 */
#undef NO_DES3
#if 0
#else
#define NO_DES3
#endif
@ -228,7 +247,6 @@ extern "C" {
#define HAVE_POLY1305
/* Needed for Poly1305 */
#undef HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH
#endif
@ -237,10 +255,10 @@ extern "C" {
#undef HAVE_ED25519
#if 0
#define HAVE_CURVE25519
#define HAVE_ED25519
#define HAVE_ED25519 /* ED25519 Requires SHA512 */
/* Optionally use small math (less flash usage, but much slower) */
#if 0
#if 1
#define CURVED25519_SMALL
#endif
#endif
@ -252,6 +270,7 @@ extern "C" {
/* Sha */
#undef NO_SHA
#if 1
/* on by default */
/* 1k smaller, but 25% slower */
//#define USE_SLOW_SHA
#else
@ -274,124 +293,128 @@ extern "C" {
/* Sha512 */
#undef WOLFSSL_SHA512
#if 1
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA512
#if 0
#define WOLFSSL_SHA512
#define HAVE_SHA512 /* freeRTOS settings.h requires this */
/* Sha384 */
#undef WOLFSSL_SHA384
#if 1
#if 0
#define WOLFSSL_SHA384
#endif
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA512
#endif
/* Sha3 */
#undef WOLFSSL_SHA3
#if 0
#define WOLFSSL_SHA3
#endif
/* MD5 */
#if 1
/* enabled */
#undef NO_MD5
#if 0
/* on by default */
#else
#define NO_MD5
#endif
/* HKDF */
#undef HAVE_HKDF
#if 1
#define HAVE_HKDF
#endif
/* CMAC */
#undef WOLFSSL_CMAC
#if 1
#define WOLFSSL_CMAC
/* Note: requires WOLFSSL_AES_DIRECT */
#endif
/* HMAC - on by default */
#undef NO_HMAC
#if 1
/* on by default */
#else
#define NO_HMAC
#endif
/* ------------------------------------------------------------------------- */
/* ASN */
/* ------------------------------------------------------------------------- */
#if 0
/* Use the newer ASN template code */
#define WOLFSSL_ASN_TEMPLATE
//#define WOLFSSL_CUSTOM_OID
//#define HAVE_OID_ENCODING
//#define HAVE_OID_DECODING
#else
/* Use the original custom ASN code */
#endif
/* Optionally disable time checking for ASN */
//#define NO_ASN_TIME
/* ------------------------------------------------------------------------- */
/* Benchmark / Test */
/* ------------------------------------------------------------------------- */
/* Use reduced benchmark / test sizes */
#undef BENCH_EMBEDDED
#define BENCH_EMBEDDED
#undef USE_CERT_BUFFERS_2048
#define USE_CERT_BUFFERS_2048
#undef USE_CERT_BUFFERS_256
/* Use test buffers from array (not filesystem) */
#ifndef NO_FILESYSTEM
#define USE_CERT_BUFFERS_256
#define USE_CERT_BUFFERS_2048
#endif
/* ------------------------------------------------------------------------- */
/* Debugging */
/* ------------------------------------------------------------------------- */
#undef DEBUG_WOLFSSL
//#define DEBUG_WOLFSSL
#ifdef DEBUG_WOLFSSL
/* Use this to measure / print heap usage */
#if 0
#undef USE_WOLFSSL_MEMORY
#define USE_WOLFSSL_MEMORY
#undef WOLFSSL_TRACK_MEMORY
#define WOLFSSL_TRACK_MEMORY
#define WOLFSSL_DEBUG_MEMORY
#define WOLFSSL_DEBUG_MEMORY_PRINT
#endif
#undef DEBUG_WOLFSSL
#undef NO_ERROR_STRINGS
#if 0
#define DEBUG_WOLFSSL
#define WOLFSSL_LOG_PRINTF
#else
#undef NO_WOLFSSL_MEMORY
//#define NO_WOLFSSL_MEMORY
#undef NO_ERROR_STRINGS
//#define NO_ERROR_STRINGS
#if 0
#define NO_ERROR_STRINGS
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Port */
/* Memory */
/* ------------------------------------------------------------------------- */
#if 0
/* Static memory requires fast math or SP math with no malloc */
#define WOLFSSL_STATIC_MEMORY
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
/* ------------------------------------------------------------------------- */
/* RNG */
/* ------------------------------------------------------------------------- */
/* Size of returned HW RNG value */
#define NO_OLD_RNGNAME
/* Choose RNG method */
#if 1
#ifndef STM32_RNG
#define WOLFSSL_GENSEED_FORTEST
#endif
/* Use built-in P-RNG (SHA256 based) with HW RNG */
/* P-RNG + HW RNG (P-RNG is ~8K) */
#undef HAVE_HASHDRBG
#define HAVE_HASHDRBG
#else
/* Bypass P-RNG and use only HW RNG */
extern int custom_rand_generate_block(unsigned char* output, unsigned int sz);
#undef CUSTOM_RAND_GENERATE_BLOCK
#define CUSTOM_RAND_GENERATE_BLOCK custom_rand_generate_block
/* Disable fallback malloc/free */
#define WOLFSSL_NO_MALLOC
#if 1
#define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Enable Features */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_TLS13
#if 0
#define WOLFSSL_TLS13
#endif
#undef KEEP_PEER_CERT
//#define KEEP_PEER_CERT
#undef HAVE_COMP_KEY
//#define HAVE_COMP_KEY
#undef HAVE_TLS_EXTENSIONS
#define WOLFSSL_TLS13
#define WOLFSSL_OLD_PRIME_CHECK /* Use faster DH prime checking */
#define HAVE_TLS_EXTENSIONS
#undef HAVE_SUPPORTED_CURVES
#define HAVE_SUPPORTED_CURVES
#define WOLFSSL_BASE64_ENCODE
#undef WOLFSSL_BASE64_ENCODE
//#define WOLFSSL_BASE64_ENCODE
//#define WOLFSSL_KEY_GEN /* For RSA Key gen only */
//#define KEEP_PEER_CERT
//#define HAVE_COMP_KEY
/* TLS Session Cache */
#if 0
@ -404,67 +427,31 @@ extern "C" {
/* ------------------------------------------------------------------------- */
/* Disable Features */
/* ------------------------------------------------------------------------- */
#undef NO_WOLFSSL_SERVER
//#define NO_WOLFSSL_SERVER
#undef NO_WOLFSSL_CLIENT
//#define NO_WOLFSSL_CLIENT
#undef NO_CRYPT_TEST
//#define NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
//#define NO_CRYPT_BENCHMARK
//#define WOLFCRYPT_ONLY
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */
#undef NO_INLINE
//#define NO_INLINE
#undef NO_FILESYSTEM
#define NO_FILESYSTEM
#undef NO_WRITEV
#define NO_WRITEV
#undef NO_MAIN_DRIVER
#define NO_MAIN_DRIVER
//#define NO_DEV_RANDOM
#undef NO_DEV_RANDOM
#define NO_DEV_RANDOM
#undef NO_DSA
#define NO_DSA
#undef NO_RC4
#define NO_RC4
#undef NO_OLD_TLS
#define NO_OLD_TLS
#undef NO_HC128
#define NO_HC128
#undef NO_RABBIT
#define NO_RABBIT
#undef NO_PSK
#define NO_PSK
#undef NO_MD4
#define NO_DSA
#define NO_RC4
#define NO_MD4
#undef NO_PWDBASED
#define NO_PWDBASED
#undef NO_CODING
//#define NO_CODING
/* bypass certificate date checking, due to lack of properly configured RTC source */
#undef NO_ASN_TIME
#define NO_ASN_TIME
//#define NO_CERTS
//#define NO_SIG_WRAPPER
#ifdef __cplusplus
}

150
IDE/AURIX/wolf_main.c Normal file
View File

@ -0,0 +1,150 @@
/* wolf_main.c
*
* Copyright (C) 2006-2023 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
*/
/* wolfSSL includes */
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/random.h> /* for CUSTOM_RAND_TYPE */
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
/* Infineon Includes */
#include "Ifx_Types.h"
#include "IfxStm.h"
extern int send_UART(const char* str);
static void my_logging_cb(const int logLevel, const char *const logMessage)
{
send_UART(logMessage);
send_UART("\r\n");
(void)logLevel; /* not used */
}
/* TIME CODE */
/* Optionally you can define NO_ASN_TIME to disable all cert time checks */
static int hw_get_time_sec(void)
{
/* get time in seconds */
return IfxStm_get(&MODULE_STM0) / IfxStm_getFrequency(&MODULE_STM0);
}
/* This is used by wolfCrypt asn.c for cert time checking */
unsigned long my_time(unsigned long* timer)
{
(void)timer;
return hw_get_time_sec();
}
#ifndef WOLFCRYPT_ONLY
/* This is used by TLS only */
unsigned int LowResTimer(void)
{
return hw_get_time_sec();
}
#endif
#ifndef NO_CRYPT_BENCHMARK
/* This is used by wolfCrypt benchmark tool only */
double current_time(int reset)
{
double timeNow;
uint64_t timeMs, ticks = IfxStm_get(&MODULE_STM0);
(void)reset;
timeMs = ticks / (IfxStm_getFrequency(&MODULE_STM0) / 1000);
timeNow = (timeMs / 1000); // sec
timeNow += (double)(timeMs % 1000) / 1000; // ms
return timeNow;
}
#endif
/* RNG CODE */
/* TODO: Implement real RNG */
static unsigned int gCounter;
unsigned int hw_rand(void)
{
//#warning Must implement your own random source
return ++gCounter;
}
unsigned int my_rng_seed_gen(void)
{
return hw_rand();
}
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
void run_wolf_tests(void)
{
func_args args;
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
wolfSSL_SetLoggingCb(my_logging_cb);
/* initialize wolfSSL */
#ifdef WOLFCRYPT_ONLY
wolfCrypt_Init();
#else
wolfSSL_Init();
#endif
memset(&args, 0, sizeof(args));
args.return_code = NOT_COMPILED_IN; /* default */
printf("Running wolfCrypt Tests...\n");
#ifndef NO_CRYPT_TEST
args.return_code = 0;
wolfcrypt_test(&args);
printf("Crypt Test: Return code %d\n", args.return_code);
#else
args.return_code = NOT_COMPILED_IN;
#endif
printf("Running wolfCrypt Benchmarks...\n");
#ifndef NO_CRYPT_BENCHMARK
args.return_code = 0;
benchmark_test(&args);
#else
args.return_code = NOT_COMPILED_IN;
#endif
printf("Benchmark Test: Return code %d\n", args.return_code);
#ifdef WOLFCRYPT_ONLY
wolfCrypt_Cleanup();
#else
wolfSSL_Cleanup();
#endif
}

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

@ -0,0 +1,119 @@
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/hmac.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/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

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

@ -0,0 +1,138 @@
/* 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 constraints */
#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_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

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

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2019 wolfSSL Inc.
* Copyright (C) 2006-2023 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -18,6 +18,8 @@
* 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>
@ -25,7 +27,7 @@
/* wolfCrypt_Init/wolfCrypt_Cleanup to turn CryptoCell hardware on/off */
#include <wolfssl/wolfcrypt/wc_port.h>
/* SEGGER_RTT_Init, you can potential replace it with other serial terminal */
/* SEGGER_RTT_Init, you can potentially replace it with other serial terminal */
#include "SEGGER_RTT.h"
int main(void)

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2019 wolfSSL Inc.
* Copyright (C) 2006-2023 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*/
@ -87,7 +88,6 @@ extern "C" {
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_CACHE_RESISTANT
//#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
/* Assembly */
@ -137,6 +137,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
@ -554,12 +557,6 @@ extern "C" {
#undef NO_OLD_TLS
#define NO_OLD_TLS
#undef NO_HC128
#define NO_HC128
#undef NO_RABBIT
#define NO_RABBIT
#undef NO_PSK
#define NO_PSK

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-2019 wolfSSL Inc.
* Copyright (C) 2006-2023 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,619 @@
<?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.h</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/fe_x25519_128.h</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/hmac.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/hmac.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/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

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