Commit Graph

9109 Commits

Author SHA1 Message Date
JacobBarthelmeh
aa32027c26 Merge pull request #8236 from philljj/zephyr_thread_type
wc_port: change zephyr struct k_thread tid member to pointer.
2024-12-05 09:29:30 -07:00
Lealem Amedie
3476425967 Fix for Compressed Keys with FIPS 2024-12-03 14:56:30 -07:00
JacobBarthelmeh
42afede3fc Merge pull request #8235 from dgarske/fix_sp_rsa_publiconly
Fixes for building with SP RSA small and RSA Public only
2024-12-02 10:39:08 -07:00
JacobBarthelmeh
015d47b9cd Merge pull request #8231 from LinuxJedi/STM32MP13
Add STM32MP13 HAL support for more SHA types
2024-12-02 10:18:38 -07:00
jordan
a18f71c27b wc_port: change zephyr struct k_thread tid member to pointer. 2024-11-27 16:05:48 -06:00
David Garske
57e1bf9fba Fixes for building with SP RSA small and RSA Public only. ZD 18996 2024-11-27 13:26:45 -08:00
Andrew Hutchings
f15dbb9110 Add STM32MP13 HAL support for more SHA types
This adds STM32 HAL support for:

* SHA384
* SHA512 (with -224 and -256)
* SHA3 (all variants apart from SHAKE)

The partial FIFO block calculations have been adjusted based in the
STM32 code to support the larger hash sizes.

This should work with other chips such as the STM32U5xx, but is not
enabled for that yet.
2024-11-27 15:04:45 +00:00
Daniel Pouzzner
b65d3fff56 fixes for OPENSSL_COEXIST with FIPS and with/without TEST_OPENSSL_COEXIST. 2024-11-26 19:38:32 -06:00
JacobBarthelmeh
5e13fc2c84 Merge pull request #7410 from SparkiDev/sp_arm_big_endian
SP: big-endian support
2024-11-26 17:05:53 -07:00
JacobBarthelmeh
70d595478c Merge pull request #8227 from douzzer/20241125-linuxkm-aarch64-pie
20241125-linuxkm-aarch64-pie
2024-11-26 13:31:01 -07:00
David Garske
29dc0f5d0b Merge pull request #8223 from LinuxJedi/STM32MP1
Initial support for STM32MP13 HAL
2024-11-26 09:34:04 -08:00
Andrew Hutchings
5d0ee8c9f3 Initial support for STM32MP13 HAL
This adds support for the STM32MP13 HAL, tested on the STM32MP135F MPU.

Using the HAL this modifies our previous RNG, AES-CBC, AES-GCM, HASH,
ECDSA and DES3 ST HAL acceleration to work with the MPU. It also works
around bugs found in the AES-GCM code of the HAL.

The HAL does not appear to have support for MD5 HASH at the moment, so
this has been given a flag to disable it on this MPU.
2024-11-26 14:15:57 +00:00
Daniel Pouzzner
7dcec3e62f linuxkm: work around aarch64 dependency on alt_cb_patch_nops for enable-linuxkm-pie (FIPS support). 2024-11-26 00:12:29 -06:00
JacobBarthelmeh
02432990dc Merge pull request #8210 from night1rider/devcrypto-authtag-error
/dev/crypto auth error fix/adjustment for benchmark
2024-11-25 16:42:58 -07:00
night1rider
02e6ec0c86 devcrypto auth error fix/adjustment 2024-11-25 14:43:12 -07:00
Daniel Pouzzner
bfeb0ad48e expand opensslcoexist to all low level crypto APIs. 2024-11-22 19:27:56 -06:00
JacobBarthelmeh
033a2a08e9 Merge pull request #8212 from bandi13/fixTestFailure
Fix Renesas test
2024-11-22 10:42:21 -07:00
David Garske
401a64d112 Improve stdarg.h around uses of var_arg. Cleanup warning for XFREE/XMALLOC redef. 2024-11-22 08:11:32 -08:00
Daniel Pouzzner
d85c108952 wolfssl/wolfcrypt/error-crypt.h, wolfcrypt/src/error.c: add WC_FAILURE ("wolfCrypt generic failure") with value -1, for traceable error return of -1 in wolfCrypt.
configure.ac: add OPENSSL_EXTRA to --enable-wolfsentry.

linuxkm/linuxkm_wc_port.h, linuxkm/module_hooks.c, wolfssl/ssl.h: accommodate backward dependencies for wolfSSL_X509_NAME_add_entry_by_NID, wolfSSL_X509_NAME_free, and wolfSSL_X509_NAME_new_ex.

linuxkm/lkcapi_glue.c: if CONFIG_CRYPTO_MANAGER, assert match of CONFIG_CRYPTO_FIPS and HAVE_FIPS.

src/ssl_crypto.c, wolfcrypt/src/wc_lms.c, wolfcrypt/src/wc_lms_impl.c, wolfcrypt/src/wc_xmss.c, wolfcrypt/test/test.c: add missing casts for XMALLOC()s.

src/ssl_crypto.c: in wolfSSL_AES_decrypt(), fix gate for wc_AesDecryptDirect() return type.

wolfcrypt/test/test.c: smallstack refactor in test_dilithium_decode_level().

tests/api.c: fix uninited vars and "embedding a directive within macro arguments is not portable" in test_wc_dilithium_der().
2024-11-21 21:59:26 -06:00
Reda Chouk
378519d7fb Adding missing checks missing initialization of sp_int/mp_int initialization (
in case of MEMORY_E).

removed printf (added for previous debugging)
2024-11-21 23:55:34 +01:00
Brett Nicholas
cceeb776f7 gate dilithium OID autodetection on FIPS 204 draft mode 2024-11-21 09:38:11 -08:00
JacobBarthelmeh
04932dd97d Merge pull request #8206 from dgarske/rx_tsip
Fixes for RSA TSIP RSA Sign/Verify
2024-11-21 09:30:48 -07:00
JacobBarthelmeh
c06f65a8ac Merge pull request #8182 from dgarske/no_compat_headers
Support for building without wolfssl/openssl header files
2024-11-20 21:33:18 -07:00
David Garske
d109f38cbd Fixes for RSA TSIP RSA Sign/Verify. Tested on RX72N EnvisionKit. Added THREADX threading support.
```
Start wolf tsip crypt Test

 simple crypt test by using TSIP
 sha_test() passed
 sha256_test() passed
 tsip_aes_cbc_test()  passed
 tsip_aes256_test()  passed
 tsip_rsa_test(2048) passed
 tsip_rsa_SignVerify_test(2048) passed

End wolf tsip crypt Test
```
2024-11-20 13:08:26 -08:00
JacobBarthelmeh
be70bea687 Merge pull request #8202 from LinuxJedi/fix-cryptodev-debug
Fix cryptodev debug output
2024-11-20 14:00:05 -07:00
David Garske
ef67b1c06a Support for building without wolfssl/openssl header files. ZD 18465
* Fix for `TlsSessionCacheGetAndLock` that was not checking the sessionIDSz, so could return a pointer to an invalid session (if 0's). Resolves issue with `test_wolfSSL_CTX_sess_set_remove_cb` test.
* Fix cast warning with `HAVE_EX_DATA` in Windows VS.
* Fix openssl_extra without PKCS12.
* Refactor the EX data crypto and session API's to gate on `HAVE_EX_DATA_CRYPTO`.
* Grouped the EX data API's in ssl.h
* Moved API's in ssl.h to separate the compatibility ones from ours.
2024-11-20 12:32:32 -08:00
Andrew Hutchings
f5e6e17c7c Fix cryptodev debug output
Cryptodev has two sections for the session info struct, cipher and hash.
Our debug mode was using hash for the output even if we were using
cipher, so would output random data. Simple 'if' statement to do the
correct thing.
2024-11-20 06:41:58 +00:00
JacobBarthelmeh
42825e82d2 Merge pull request #8200 from anhu/crl-orig
Fix for github issue 8198
2024-11-19 09:35:59 -07:00
David Garske
18f52b2573 Merge pull request #8177 from bigbrett/dilithium-get-algo-from-der
ML-DSA/Dilithium: obtain security level from DER when decoding
2024-11-19 07:32:39 -08:00
David Garske
261ddc13ad Merge pull request #8006 from ColtonWilley/crl_update_cb
CRL improvements and update callback
2024-11-18 20:11:37 -08:00
Brett Nicholas
48dcbe9caf fix typo in comment 2024-11-18 16:50:35 -07:00
Brett Nicholas
9815fcd3ea make inOutKeyType parameter mandatory for DecodeAsymKey_Assign 2024-11-18 16:46:10 -07:00
Brett Nicholas
d50fb63071 add macros for dilithium DER export buffer sizes 2024-11-18 16:14:26 -07:00
Brett Nicholas
63deea57e0 properly protect test.c calls to dilithium public/private API 2024-11-18 15:47:00 -07:00
Anthony Hu
237bb24f87 Fix for github issue 8198 2024-11-18 17:33:13 -05:00
Colton Willey
55be5035a0 Merge branch 'master' of github.com:ColtonWilley/wolfssl into crl_update_cb 2024-11-18 09:52:51 -08:00
Sean Parkinson
10e8f6887e SP ARM: big-endian support
Handle reading and writing from big-endian byte array when compiling for
big endian.
Rework little endian to be more effiecient too.
2024-11-18 10:29:04 +10:00
Daniel Pouzzner
18cc3e0c92 add .wolfssl_known_macro_extras;
src/wolfio.c: #include <errno.h> if necessary;

wolfcrypt/src/asn.c: gate WOLFSSL_MSG_EX() uses on defined(DEBUG_WOLFSSL), for pedantic C89 compatibility (no variadic macros);

wolfssl/wolfcrypt/wc_port.h: refine setup for XFENCE().
2024-11-16 18:23:11 -06:00
Daniel Pouzzner
ae0d73d9fd Merge pull request #8122 from miyazakh/tsip_rsa_private_enc
Implement TSIP RSA Public Enc/Private Dec
2024-11-16 16:12:51 -06:00
David Garske
649b78f460 Merge pull request #8193 from douzzer/20241115-macro-fixes
20241115-macro-fixes
2024-11-15 15:58:57 -08:00
David Garske
ada922be00 Merge pull request #8166 from philljj/fix_holder_entityname
acert: fix holder entityName parsing.
2024-11-15 14:49:00 -08:00
Daniel Pouzzner
ebfde75d91 fixes for misspelled/malformed macro names, and add missing BUILD_AESCCM setup in wolfssl/internal.h 2024-11-15 15:33:51 -06:00
jordan
c71fdc3ca2 acert: review cleanup. 2024-11-15 13:48:17 -06:00
Daniel Pouzzner
a95b759ffa peer review for #8187 and unrelated bug fixes:
return error code from wolfSSL_RefWithMutexUnlock() to expose result to caller;

fix endianness bug in src/x509.c:wolfSSL_X509_add_ext() (fixes failing test_wolfSSL_X509_add_ext on BE targets);

fix possible file handle leak in tests/api.c:test_wolfSSL_d2i_X509_REQ() (reported by clang-tidy);

in wolfssl/ssl.h, define CONST_NUM_ERR_WOLFSSL_SUCCESS, so that WOLFSSL_SUCCESS can be benignly miswrapped in WC_NO_ERR_TRACE().
2024-11-15 12:52:50 -06:00
Daniel Pouzzner
595f55eceb add struct wolfSSL_RefWithMutex, wolfSSL_RefWithMutexLock, and wolfSSL_RefWithMutexUnlock, and change WOLFSSL_CTX.ref from wolfSSL_Ref to wolfSSL_RefWithMutex.
in in wc_port.c, rename mutexful implementations of wolfSSL_Ref*() to wolfSSL_RefWithMutex*(), and build them even if defined(WOLFSSL_ATOMIC_OPS).

refactor wolfSSL_CTX_UnloadIntermediateCerts() to wrap the refcount check and deallocation with wolfSSL_RefWithMutexLock()...wolfSSL_RefWithMutexUnlock().

move port-specific setup for WARN_UNUSED_RESULT, WC_MAYBE_UNUSED, and WC_INLINE, from types.h to wc_port.h, to make them usable by port-specific definitions later in wc_port.h.

when defined(SINGLE_THREADED) and !defined(WOLFSSL_NO_ATOMICS), typedef int wolfSSL_Atomic_Int, so that access to wolfSSL_Atomic_Ints in SINGLE_THREADED builds is easy.

refactor fallback definitions of wolfSSL_Atomic_Int_FetchAdd and wolfSSL_Atomic_Int_FetchSub as WC_INLINE functions to avoid -Wunused-result.
2024-11-15 12:35:41 -06:00
jordan
622fc70d1e acert: fix holder entityName parsing, light cleanup, better testing. 2024-11-15 11:38:19 -06:00
Brett Nicholas
2207791aab removed DecodeAsymKeyXXX_Assign_ex function, functionality now included in original _Assign function 2024-11-15 10:25:10 -07:00
David Garske
5f06a7f732 Merge pull request #8188 from douzzer/20241114-wc_mp_sign_t
20241114-wc_mp_sign_t
2024-11-15 08:36:42 -08:00
David Garske
fcfd3be160 Merge pull request #8186 from SparkiDev/tfm_mask_cast
TFM: explicit cast of -1 to fp_digit
2024-11-14 17:57:00 -08:00
David Garske
54bdb39454 Merge pull request #8176 from SparkiDev/x509_coverage
X509: improve testing coverage
2024-11-14 17:49:33 -08:00