Commit Graph

8344 Commits

Author SHA1 Message Date
Daniel Pouzzner
11e8a89f67 wolfcrypt/src/aes.c: coddle XCode (clang) to clear frivolous -Wparentheses-equality. 2024-01-29 17:58:13 -06:00
Daniel Pouzzner
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
David Garske
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
David Garske
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
David Garske
a6326bd80a Merge pull request #7183 from SparkiDev/regression_fixes_9
Regression testing fixes
2024-01-29 07:42:34 -08:00
David Garske
60de159707 Merge pull request #7176 from danielinux/iotsafe-sha384
IoT-Safe sha384+sha512 support
2024-01-29 07:35:50 -08:00
Sean Parkinson
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
Daniel Pouzzner
856c9a9a7f wolfcrypt/src/port/arm/armv8-aes.c: revert changes in a0415ce855. 2024-01-29 00:17:19 -06:00
Daniel Pouzzner
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
Sean Parkinson
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
Daniel Pouzzner
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
Daniel Pouzzner
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
jordan
947528ee16 Fix ext_xmss SigsLeft. 2024-01-26 17:07:43 -06:00
Daniel Pouzzner
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
Daniel Pouzzner
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
Anthony Hu
fe87f16114 Fixes that prevent memory leaks when using OQS.
Fixes ZD 17177.
2024-01-26 14:54:01 -05:00
JacobBarthelmeh
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
Daniele Lacamera
72e34a829a Fixed wrong define 2024-01-26 16:35:08 +01:00
JacobBarthelmeh
db3873ff40 Merge pull request #7172 from bandi13/fixUninitVar
Fix compilation errors about uninitialized variables
2024-01-26 08:32:41 -07:00
Daniele Lacamera
6dab75368d [IoT-Safe] Add support sha384 + sha512 2024-01-26 10:20:03 +01:00
gojimmypi
ac6181d7ae Improved Espressif SHA HW/SW selection 2024-01-25 15:23:58 -08:00
JacobBarthelmeh
4c7f038149 Merge pull request #7161 from SparkiDev/xmss
XMSS implementation
2024-01-25 08:41:13 -08:00
Andras Fekete
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
Sean Parkinson
a5961907b0 XMSS implementation
Supporting code for wolfSSL C implementation of XMSS.
2024-01-25 11:21:39 +10:00
Sean Parkinson
999f84518c RSA Decryption: check private value after decryption 2024-01-24 16:09:15 +10:00
JacobBarthelmeh
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
David Garske
fa87e227b4 Restore useful comments above wc_RsaDirect in the .c file. 2024-01-23 08:39:35 -08:00
JacobBarthelmeh
78f7454043 Merge pull request #7154 from anhu/EccKeyParamCopy_error
Fix missing heap hint in `EccKeyParamCopy`
2024-01-23 08:11:35 -08:00
David Garske
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
David Garske
3d62896137 Add documentation for wc_RsaDirect. 2024-01-22 13:41:25 -08:00
David Garske
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
Sean Parkinson
b0de0a1c95 Merge pull request #7143 from julek-wolfssl/zd/17303
EVP_Cipher: correct parameter checking
2024-01-23 07:15:20 +10:00
Andras Fekete
5c75ca539e Check NULL input 2024-01-22 12:45:42 -05:00
Anthony Hu
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
Juliusz Sosinowicz
fc7143a8f4 Code review 2024-01-22 16:08:06 +01:00
David Garske
6b8280f663 Merge pull request #7144 from bandi13/20240119-codesonar
20240119 codesonar
2024-01-19 09:35:02 -08:00
David Garske
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
Andras Fekete
dbc209d8ea Always initialize 'decryptedKey'
Warning 750167.5627928
2024-01-19 10:58:29 -05:00
Andras Fekete
2c162ffb97 Make sure aes->rounds is initialized
Warning 684346.5627323
2024-01-19 10:39:33 -05:00
Andras Fekete
726e7026cb Uninitialized variable because we don't check return value
Warning 544870.5627882
2024-01-19 10:31:20 -05:00
Juliusz Sosinowicz
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
David Garske
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
Anthony Hu
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
Tobias Frauenschläger
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
Tobias Frauenschläger
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
Daniel Pouzzner
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
John Bland
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
David Garske
4f8fd98d0d Merge pull request #7109 from Frauschi/falcon_compat
PQC: Update Falcon support to match OQS
2024-01-17 14:18:32 -08:00
David Garske
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
Tobias Frauenschläger
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