Commit Graph

8638 Commits

Author SHA1 Message Date
Daniel Pouzzner
765231060e wolfcrypt/test/test.c: add missing PRIVATE_KEY_UNLOCK() for hpke_test(). 2024-07-19 18:31:01 -05:00
David Garske
575df43889 Merge pull request #7768 from JacobBarthelmeh/copyright
update copyright to 2024
2024-07-19 14:27:39 -07:00
Daniel Pouzzner
e13a8ddcfb fixes for null derefs in native Dilithium and Kyber implementations, detected by unit.test and cppcheck. 2024-07-19 14:35:39 -05:00
Daniel Pouzzner
0aa0f26289 wolfcrypt/src/dilithium.c: fix null deref in wc_dilithium_init_ex(). 2024-07-19 14:25:53 -05:00
JacobBarthelmeh
31a6a2bf59 update copyright to 2024 2024-07-19 13:15:05 -06:00
David Garske
74d4ae0075 Merge pull request #7704 from aidangarske/PKCS7_PEM
Added PKCS7 PEM support:
2024-07-19 07:39:51 -07:00
David Garske
8bf2fb0ae0 Merge pull request #7765 from Laboratory-for-Safe-and-Secure-Systems/dilithium_fixes
Dilithium fixes
2024-07-19 07:36:05 -07:00
Tobias Frauenschläger
f87849b6f6 Dilithium fixes
* Fixed incorrect XFREE calls
* Use key->heap where possible
* Fixed compilation with WOLFSSL_DILITHIUM_VERIFY_SMALL_MEM and
  WC_DILITHIUM_CACHE_PUB_VECTORS
* Fixed compilation with WOLFSSL_DILITHIUM_ASSIGN_KEY (const pointers)

Signed-off-by: Tobias Frauenschläger
<tobias.frauenschlaeger@oth-regensburg.de>
2024-07-19 07:52:14 +02:00
gojimmypi
8356b349a5 minor asn update: comments, code format, dateType check in CheckDate. 2024-07-18 18:25:53 -07:00
Sean Parkinson
e6fcd488a6 Merge pull request #7685 from dgarske/renesas_rx_tsip
Renesas RX TSIP ECDSA support
2024-07-19 10:53:00 +10:00
David Garske
4eab0f1231 Fix hard coded values in TSIP ECC verify. Fix issues with tab indentation and spelling. 2024-07-18 16:45:27 -07:00
Daniel Pouzzner
4bc04673d1 suppress 4 uninitvar warnings, all associated with passing partially written arrays (true but benign positives). newly detected by cppcheck 2.14.2. 2024-07-18 17:22:17 -05:00
Daniel Pouzzner
c36ab59f24 fixes for defects identified by nightly testing:
* ecc.c: in wc_ecc_free(), fix gating around handling for key->sign_k to resolve memory leak, and in wc_ecc_gen_deterministic_k(), fix -Wconversion.

* test.c: add missing mp_free()s to ecdsa_test_deterministic_k_rs() and ecc521_test_deterministic_k().

* wc_HashType: change several occurrences of int to enum wc_HashType, including ecc_key.hashType and API wc_ecc_set_deterministic_ex(), to resolve C++ warnings.

* fixes for various C++ warnings/errors in crypto and TLS layers and test and benchmark code -- implicit casts, negative initializers for unsigned type, jumped initializers, and missing enums in switch()es.
2024-07-17 18:07:08 -05:00
David Garske
bbd8fdfc38 Cleanup Renesas RX default devId and improve logic for overflow check. 2024-07-16 17:48:16 -07:00
Daniel Pouzzner
5298039d09 fixes from peer review: move OS-specific code from wolfSSL_BIO_read() and wolfSSL_BIO_write() to wolfIO_Recv(), wolfIO_Send(), wolfIO_RecvFrom(), and wolfIO_SendTo(); add SOCKET_ETIMEDOUT definitions to wolfio.h; misc cleanups. 2024-07-16 19:12:19 -05:00
Daniel Pouzzner
41efa0492c add ASN_ prefixes to ISSUER, SUBJECT, BEFORE, and AFTER enum constants defined in wolfssl/wolfcrypt/asn.h. 2024-07-16 19:12:18 -05:00
Sean Parkinson
0f3ebedba0 Merge pull request #7700 from aidangarske/ECDSA_deterministic_k
ecc.c and test.c changes to add support in ecc_sign_determinsitic.c
2024-07-17 09:12:32 +10:00
aidan garske
237df2cb11 Hash Type selection changes to ecc.c. 2024-07-16 15:17:40 -07:00
Sean Parkinson
500951f059 Dilithium: support fixed size arays in dilithium_key
Support fixed size arrays for pre-generated matrix and vectors.
Define: WC_DILITHIUM_FIXED_ARRAY
2024-07-17 07:36:14 +10:00
aidan garske
96af77d757 Hash Type selection changes to ecc.c. 2024-07-16 11:12:29 -07:00
JacobBarthelmeh
bbd769d43a Merge pull request #7728 from SparkiDev/poly1305_aarch64_uniq_name
Poly1305 AArch64: unique naming of asm funcs
2024-07-16 10:10:54 -06:00
Sean Parkinson
e002b6efd3 Merge pull request #7742 from embhorn/zd18240
Fix ParseCRL_AuthKeyIdExt setting extAuthKeyIdSet
2024-07-16 09:38:54 +10:00
Sean Parkinson
f2f3a8273d Merge pull request #7732 from kaleb-himes/NUCLEUS-FIPS-SRTP-KDF
Check-in Nucleus Plus 2.3 port work
2024-07-16 09:37:15 +10:00
Sean Parkinson
137831367d Merge pull request #7710 from anhu/preTBS_altsigalg_fix
Stop stripping out the sequence header on the AltSigAlg extension.
2024-07-16 09:35:11 +10:00
David Garske
2b4acf5027 Revert built-in wc_GenerateSeed support for RX TSIP removed in #6851. 2024-07-15 10:10:38 -07:00
Sean Parkinson
93ca213a68 Merge pull request #7736 from space88man/fix-pkcs11-slot
wolfcrypt/src/wc_pkcs11.c: iterate correctly over slotId
2024-07-15 15:52:40 +10:00
Eric Blankenhorn
d6731f0f84 Fix ParseCRL_AuthKeyIdExt setting extAuthKeyIdSet 2024-07-12 07:43:23 -05:00
JacobBarthelmeh
1cf96eb72c Merge pull request #7741 from douzzer/20240714-asn-Wconversion
20240714-asn-Wconversion
2024-07-11 16:48:52 -06:00
JacobBarthelmeh
baec0ced59 Merge pull request #7731 from ColtonWilley/zephyr_tls_support
Changes needed for default TLS support in zephyr kernel
2024-07-11 16:46:43 -06:00
Sean Parkinson
e0494b5f04 Merge pull request #7738 from dgarske/pkcs11_rsakeygen
Fix to support PKCS11 without RSA key generation
2024-07-12 08:45:53 +10:00
Daniel Pouzzner
76f669b1cc wolfcrypt/src/asn.c: fix -Wconversion in GetLength_ex() added in fea7a89b86. 2024-07-11 14:47:58 -05:00
Sean Parkinson
3cc7bbea67 Merge pull request #7737 from JacobBarthelmeh/staticmemory-singlethreaded
fix for staticmemory and singlethreaded build
2024-07-11 09:57:08 +10:00
David Garske
41cf8c090b Fix compiler issues with unused variable and printf. 2024-07-10 16:07:43 -07:00
David Garske
28db1b19e1 Fix to support PKCS11 without RSA key generation. Fixed Pkcs11Rsa where ret failure could be ignored. 2024-07-10 11:17:02 -07:00
JacobBarthelmeh
204668778b Merge pull request #7733 from SparkiDev/coverity_3
Coverity fixes
2024-07-10 10:01:29 -06:00
JacobBarthelmeh
6703a58c51 fix for staticmemory and singlethreaded build 2024-07-10 09:44:10 -06:00
S-P Chan
fdd03fa909 wolfcrypt/src/wc_pkcs11.c: iterate correctly over slotId when searching for token
Addresses #7734
2024-07-10 21:01:35 +08:00
Sean Parkinson
fea7a89b86 Coverity fixes
pk.c:
	EncryptDerKey - setting wrong ret value on allocation failure.
	wolfssl_rsa_generate_key_native - now checks e is a valid long
before passing in.
	Fix formatting.

ssl_load.c:
	ProcessBufferPrivPkcs8Dec - now checking password is not NULL
before zeroizing. Allocation may fail and ForceZero doesn't check for
NULL.
	Fix formatting.

tests/api.c:
	test_RsaSigFailure_cm - Check cert_sz is greater than zero
before use.
	send_new_session_ticket - assert that building the message
doesn't return error or 0.
	test_ticket_nonce_malloc - fix setting of medium and big to use
preprocessor. Fix big to be medium + 20.

asn.c:
	GetLength_ex - Fix type of bytes so that it can go negative.

sp_int.h:
	sp_clamp - add one to ii while it is a signed.
	Fix formatting.
2024-07-10 11:40:48 +10:00
kaleb-himes
c333fdf545 Check-in Nucleus Plus 2.3 port work 2024-07-09 15:53:00 -06:00
Colton Willey
4ec07bb5a8 Changes needed for default TLS support in zephyr kernel 2024-07-09 12:00:34 -07:00
Sean Parkinson
90836c782b Poly1305 AArch64: unique naming of asm funcs
Change function names to ensure no clash with OpenSSL.
Specifically: poly1305_blocks()
2024-07-09 11:02:10 +10:00
Sean Parkinson
d1e26b4f5d Dilithium: fixes
Fix inclusion of functions dilithium_vec_check_low() in build:
--enable-dilithium=verify-only,44,65,87
CFLAGS=-DWOLFSSL_DILITHIUM_VERIFY_SMALL_MEM
Fix memory leaks in unit.test:
--enable-dilithium CFLAGS=-DWC_DILITHIUM_CACHE_MATRIX_A 'CC=clang
-fsanitize=address'
2024-07-08 15:02:43 +10:00
Daniel Pouzzner
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
Daniel Pouzzner
c8a9bdbe15 wolfcrypt/src/asn.c: fix for -Wconversion in FillSigner(). 2024-07-05 20:42:32 -05:00
Daniel Pouzzner
88af1a2932 fixes for Coverity #394680, #394682, #394693, #394712. 2024-07-05 20:42:32 -05:00
JacobBarthelmeh
de20bb7ba9 fix for coverity issue 394677 2024-07-05 15:13:28 -06:00
David Garske
d5016d451f Merge pull request #7714 from JacobBarthelmeh/coverity
Coverity issues reported
2024-07-05 13:49:20 -07:00
kaleb-himes
f42fb587a5 Address coverity issue 394706 2024-07-05 13:54:23 -06:00
JacobBarthelmeh
c880fcf822 add check on padSz return, coverity issue 394711 2024-07-05 12:07:42 -06:00
JacobBarthelmeh
50a7243486 fix for coverity issue 394670 possible overflow 2024-07-05 11:53:19 -06:00