Commit Graph

8671 Commits

Author SHA1 Message Date
David Garske
548a2c6d8e Fixed issues building with nocrypt. Improved logic on ASN_BER_TO_DER. Improved logic on unknown extension callback (new WC_ASN_UNKNOWN_EXT_CB gate). 2024-07-31 09:42:46 -07:00
David Garske
bbbc1e074c Fixes for clang-tidy. 2024-07-30 10:35:21 -07:00
David Garske
afb6fe6c5f Fixes for building due to missing OCSP and DecodePolicyOID (--enable-curl and --enable-openssh). 2024-07-30 10:35:21 -07:00
David Garske
20f7d6f9f4 ASN macro simplification. Added new --enable-asn=all and WOLFSSL_ASN_ALL option. Added granular macros for ASN features like: WOLFSSL_ASN_CA_ISSUER, WOLFSSL_ASN_PARSE_KEYUSAGE, WOLFSSL_ASN_TIME_STRING, WOLFSSL_OCSP_PARSE_STATUS. 2024-07-30 10:35:20 -07:00
David Garske
f9dc5e9f4d Fixes for uses of deprecated sprintf. If C89 remap XSNPRINTF to use sprintf. 2024-07-29 14:03:44 -07:00
Sean Parkinson
034af8d99c Merge pull request #7787 from dgarske/stm32u5a
Fix STM32 Hash FIFO and add support for STM32U5A9xx
2024-07-29 17:36:52 +10:00
Sean Parkinson
3b74a64029 Merge pull request #7791 from aidangarske/privkeytoder_fix2
`api.c` and `asn.c` changes to allow 0 to be passed in and expanded coverage on test cases.
2024-07-29 09:40:20 +10:00
András Fekete
b1765ca6b4 Merge pull request #7785 from dgarske/asn_original
Fixes for ASN original
2024-07-26 14:49:13 -04:00
Sean Parkinson
f7094ff3c4 Dilithium: add option to precalc with small sign (#7744)
WOLFSSL_DILITHIUM_SIGN_SMALL_MEM_PRECALC added.
It allocates memory for and pre-calculates s1, s2 and t0.
This saves decoding the vectors repeatedly in each signature trial.
2024-07-26 11:46:55 -07:00
David Garske
c3b5322f86 Merge pull request #7753 from SparkiDev/cortexm_label_fix_2
Cortex-M/Thumb2 ASM: fix label
2024-07-26 11:45:09 -07:00
Daniel Pouzzner
b40913e80c wolfcrypt/src/random.c: restore outer cast in array_add() to avoid -Wconversion added in b28e22aef0, itself a fix for a defect added in ed11669f3c (root cause of warning is implicit type promotion). 2024-07-25 15:25:32 -05:00
aidan garske
55540d03e7 fix for PR#7786 BUFFER_E bad case 2024-07-25 09:03:19 -07:00
JacobBarthelmeh
b28e22aef0 fix for casting with add 2024-07-25 09:16:05 -06:00
aidan garske
dace3acd4d api.c and asn.c changes to allow 0 to be passed in and expanded coverage on test cases
(cherry picked from commit 8572f67e60d419ddd74d4a2b7051dcaa7d0ca6b4)
2024-07-25 08:09:37 -07:00
David Garske
c4f73f5955 Peer review cleanups. 2024-07-24 16:57:51 -07:00
David Garske
42403a526e Fix to resolve STM32 hash FIFO. Simplify logic for ensuring FIFO gets filled before doing a save/restore. ZD 18294 2024-07-24 16:06:04 -07:00
Kaleb Himes
3a4788b7bb Merge pull request #7783 from douzzer/20240723-AesGcmXcrypt-NULL-in-checks
20240723-AesGcmXcrypt-NULL-in-checks
2024-07-24 15:33:42 -06:00
David Garske
7f7d94abd5 Fixes for ASN original (old) to support checking int leading 0 and invalid OID. Disable invalid UTF8 test for old ASN (only supported with newer ASN template). 2024-07-24 12:35:37 -07:00
David Garske
007f9ea39d Fix to restore --enable-asn=original. Fixes for building with ASN original (old). Add the new limit checks for alt names and subtree to the old ASN code. 2024-07-24 08:28:25 -07:00
David Garske
d0782a97ce Merge pull request #7773 from Laboratory-for-Safe-and-Secure-Systems/kyber_compat
Kyber fixes
2024-07-24 07:37:10 -07:00
Tobias Frauenschläger
e2b642d4ab WolfSSL Kyber and CMake fixes
* Make sure wc_kyber implementation is compiled using CMake (also for
  Zephyr)
* Fix compilation issue when Liboqs is also enabled
* Fix WOLFSSL_INTEL_ASM and WOLFSSL_ARM_ASM CMake options

Signed-off-by: Tobias Frauenschläger
<tobias.frauenschlaeger@oth-regensburg.de>
2024-07-24 09:55:29 +02:00
Daniel Pouzzner
f8726148df wolfcrypt/src/aes.c: in wc_AesGcmEncrypt() and wc_AesGcmDecrypt(), check and return BAD_FUNC_ARG for nonzero sizes associated with null pointers. 2024-07-23 19:07:32 -05:00
Sean Parkinson
3284f53574 Cortex-M/Thumb2 ASM: fix label
IAR doesn't like %=.
Fix code to be consistent in use of labels and branch instructions.
2024-07-24 09:20:40 +10:00
Sean Parkinson
a34ea32f52 Merge pull request #7730 from anhu/unknownExtCallbackEx
Extend the unknown extension callback.
2024-07-24 08:37:44 +10:00
Daniel Pouzzner
6ee22de999 linuxkm: initial support for cross-compilation.
also, additional backward-compatibility measures around cp and clean recipe in linuxkm/Makefile.

also, in sp_int.c, tweak DECL_DYN_SP_INT_ARRAY() to use an explicit XMEMSET() to clear n[], to avoid unshimmable implicit memset() from gcc on aarch64.
2024-07-23 10:29:03 -05:00
David Garske
8f908e76f9 Merge pull request #7776 from douzzer/20240722-fixes
20240722-fixes
2024-07-23 06:46:38 -07:00
David Garske
7c6eb7c4a1 Merge pull request #7751 from SparkiDev/ecc_koblitz_ssl
ECC key load: fixes
2024-07-22 16:40:59 -07:00
Daniel Pouzzner
367508f498 wolfcrypt/src/asn.c: in EccSpecifiedECDomainDecode(), in calls to DataToHexString(), cast curve->size to word32 to resolve -Wconversion.
wolfcrypt/src/dh.c: in GeneratePrivateDh186(), add explicit suppression of uninitvar for "cBuf" arg that isn't fully initialized.

wolfcrypt/test/test.c: in mp_test_param(), explicitly initialize "buffer" to avoid uninitvar warning.

configure.ac: in FIPS builds, don't include enable_cryptocb in --enable-all or --enable-all-crypto.  (they can still be enabled explicitly in FIPS builds with --enable-cryptocb, but the combination is not currently supported.)
2024-07-22 18:21:36 -05:00
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