Commit Graph

10150 Commits

Author SHA1 Message Date
gojimmypi
ca920edbd0 Fix LMS C4146 unary minus warning in MSVC, new param check 2025-11-11 19:26:52 -08:00
JacobBarthelmeh
4da365214a Merge pull request #9412 from SparkiDev/regression_fixes_21
Regression testing fixes
2025-11-11 09:32:43 -07:00
Sean Parkinson
d84564217c Regression testing fixes
Fix #ifdef protection for AES tests.
2025-11-11 21:46:04 +10:00
Sean Parkinson
b7ade58c52 SP label noinline: function inlined even when asked not to
The label L_521_mont_reduce_9_nomask is therefore appearing more than
once in the compiled code.
Adding '%=' to the end of the label ensure it has a unique number
appended to it even when inlined.
2025-11-10 20:05:41 +10:00
David Garske
b45217db00 Merge pull request #9402 from anhu/stsafe_doc
Correction about how to get interface files.
2025-11-07 13:59:45 -08:00
Anthony Hu
22ab16df97 Correction about how to get interface files. 2025-11-07 16:53:30 -05:00
Sean Parkinson
f376c8d910 Merge pull request #9388 from lealem47/scan_build
Various fixes for nightly tests
2025-11-07 09:30:08 +10:00
Sean Parkinson
3416a0f70e Merge pull request #9393 from rlm2002/zd20756
Integer overflow and dead code removal
2025-11-07 09:27:05 +10:00
JacobBarthelmeh
ca51fda3bb Merge pull request #9372 from SparkiDev/curve25519_no_lshift_neg_val
Curve25519: lshift of a negative value is undefined in C
2025-11-06 15:22:38 -07:00
Ruby Martin
ec60d88f82 remove deadcode else statement when computing kid_type 2025-11-06 15:04:37 -07:00
Ruby Martin
9b2f7a371f remove duplicate keylen check (deadcode)
wrap if statement in macro guard
2025-11-06 15:04:37 -07:00
Ruby Martin
78f2e65da6 add cast to int64_t 2025-11-06 14:58:37 -07:00
Lealem Amedie
2b8f83fd8d Fixes for getrandom detection 2025-11-06 14:16:38 -07:00
Lealem Amedie
d3de6305e8 Exit wolfcrypt test if wolfCrypt_Init fails 2025-11-06 10:24:44 -07:00
Lealem Amedie
08db159c5d Fixes for minor scan-build warnings 2025-11-05 21:27:06 -07:00
Sean Parkinson
b0a7f5938c Merge pull request #9379 from holtrop/rust-wc-ed448
Rust wrapper: add wolfssl::wolfcrypt::ed448 module
2025-11-06 09:38:32 +10:00
Sean Parkinson
aa0b37a7e5 Merge pull request #9384 from night1rider/crypto-callback-return-fix
Reset Return to Success if fallback to software Copy Callbacks Sha
2025-11-06 08:50:00 +10:00
Daniel Pouzzner
3d99090bcb Merge pull request #9374 from philljj/spelling_cleanup
wolfcrypt test: tiny spelling correction.
2025-11-05 13:44:44 -06:00
night1rider
572776e685 Reset return value to success when copy callback requests to use software function instead 2025-11-04 13:25:16 -07:00
Daniel Pouzzner
54dc060579 implement WC_MUTEX_OPS_INLINE and WC_RWLOCK_OPS_INLINE gates. 2025-11-04 12:01:58 -06:00
Daniel Pouzzner
abec842c59 wolfcrypt/src/asn.c: in wc_Ed25519PublicKeyToDer(), when old FIPS, cast "key" arg to wc_ed25519_export_public(). 2025-11-04 09:38:50 -06:00
Josh Holtrop
b82cccce21 Rust wrapper: add wolfssl::wolfcrypt::ed448 module 2025-11-04 08:34:46 -05:00
Daniel Pouzzner
d47108c97f Merge pull request #9368 from holtrop/rust-wc-ed25519
Rust wrapper: add wolfssl::wolfcrypt::ed25519 module
2025-11-03 22:40:43 -06:00
Sean Parkinson
e4d47fb5c7 Curve25519/448: lshift of negative is undefined in C
Change all left shifts to be of unsigned values.
In some cases the values were negative.

Changed 128-bit variable implementation of Curve25519. (generated)
Changed Ed25519 C implementation.
Changed Curve448 C implementation. (generated)
Changed Ed448 C implementation. (generated)
2025-11-04 10:40:23 +10:00
jordan
720b8e117c wolfcrypt test: tiny spelling correction. 2025-11-03 10:06:47 -06:00
Sean Parkinson
574067e204 Curve25519: lshift of a negative value is undefined in C
Change all left shifts to be of unsigned values.
In some cases the values were negative.

Added macros to make the code easier to be consistent.
2025-11-03 22:08:52 +10:00
Daniel Pouzzner
78ff20569e linuxkm:
globally rename+unify:
* HAVE_LINUXKM_PIE_SUPPORT and USE_WOLFSSL_LINUXKM_PIE_REDIRECT_TABLE under gate WC_PIE_RELOC_TABLES
* WC_LKM_INDIRECT_SYM_BY_FUNC_ONLY as WC_PIE_INDIRECT_SYM_BY_FUNC_ONLY
* WC_LKM_INDIRECT_SYM_BY_DIRECT_TABLE_READ as WC_PIE_INDIRECT_SYM_BY_DIRECT_TABLE_READ
* WC_LKM_INDIRECT_SYM() as WC_PIE_INDIRECT_SYM;

linuxkm/linuxkm_wc_port.h:
* implement pointer-caching inline wolfssl_linuxkm_get_pie_redirect_table_local() for the WC_PIE_INDIRECT_SYM_BY_FUNC_ONLY path;
* for FIPS_VERSION3_GE(6,0,0), add wolfCrypt_FIPS_*_ro_sanity pointers to struct wolfssl_linuxkm_pie_redirect_table, and corresponding ad hoc prototypes;

linuxkm/Makefile and linuxkm/module_hooks.c: move wc_linuxkm_pie_reloc_tab into the wolfCrypt PIE container;

linuxkm/module_hooks.c and linuxkm/linuxkm_wc_port.h: harmonize the types of __wc_{text,rodata}_{start,end} with wolfCrypt_FIPS_{first,last,ro_start,ro_end} to allow drop-in use of the all-inclusive ELF fenceposts, activated by WC_USE_PIE_FENCEPOSTS_FOR_FIPS.
2025-10-31 16:03:51 -05:00
Josh Holtrop
7cbcd0b00d Rust wrapper: add wolfssl::wolfcrypt::ed25519 module 2025-10-31 11:03:15 -04:00
Daniel Pouzzner
9273c00566 Merge pull request #9364 from dgarske/silabs_ecb
Fixed issue with AES ECB offloading to hardware to use full size
2025-10-30 23:55:31 -05:00
Daniel Pouzzner
643cbe127d Merge pull request #9354 from rlm2002/coverity
20251027 Coverity fixes
2025-10-30 23:54:18 -05:00
Daniel Pouzzner
299257eae9 Merge pull request #9360 from SparkiDev/aarch64_sha256_vreg_fix
Aarch64 ASM: missing push and pop of vector regs
2025-10-30 23:46:11 -05:00
David Garske
c5ae76e40d Fixed issue with AES ECB offloading to hardware to use full size, not
just block
2025-10-29 15:52:33 -07:00
Sean Parkinson
d7807d39e0 Aarch64 ASM: missing push and pop of vector regs
Generated code wasn't pushing and poping vector registers when they were
64-bit.
Generation code fixed and SHA-256 ASM code fixed.
2025-10-29 09:15:32 +10:00
Daniel Pouzzner
9b90ea83eb src/x509.c: in wolfSSL_X509_get_ext_by_OBJ() and wolfSSL_X509_load_cert_crl_file(), add local protection from null derefs (fixes -Wnull-dereferences);
wolfcrypt/src/chacha.c and wolfssl/wolfcrypt/chacha.h: implement USE_ARM_CHACHA_SPEEDUP gate;

wolfcrypt/src/kdf.c: in wc_SSH_KDF(), add early return if _HashInit() fails (fixes _HashFree() of uninited _hash);

wolfcrypt/src/sha256.c: initialize sha256->W in ARMASM variant of wc_InitSha256_ex(), and pass sha256->heap to XMALLOC/XFREE consistently.
2025-10-28 16:42:14 -05:00
Ruby Martin
e546d319c1 Fix Coverity INTEGER_OVERFLOW in sp_to_unsigned_bin, avoid unsigned underflow 2025-10-28 11:12:19 -06:00
David Garske
a4be322fd6 Merge pull request #9356 from SparkiDev/sp_asm_add_sub_p384_arm
SP ASM ARM32/Thumb2: inline asm for add and subs
2025-10-28 08:55:54 -07:00
Sean Parkinson
50521699af SP ASM ARM32/Thumb2: inline asm for add and subs
Implement add, sub, double and triple in assembly for P384.
2025-10-28 17:49:40 +10:00
Sean Parkinson
d883a950d2 ML-KEM SHA-3: fix r
Constant r wasn't being loaded into register in all assembly functions
that use it - it just got lucky most of the time.
2025-10-28 12:04:12 +10:00
Sean Parkinson
070923a373 AES ARM ASM: user data loaded 1 reg at a time
User key may not be aligned and need to use instructions that don't
require alignment. Change to use ldr instead of ldp or ldrd.
2025-10-28 11:03:58 +10:00
David Garske
e6af5bcd4f Merge pull request #9353 from embhorn/gh9347
Build errors in memtest config and sniffer
2025-10-27 13:15:00 -07:00
JacobBarthelmeh
a1d000cede Merge pull request #9343 from dgarske/silabs_aesdirect
Fixed issue with SiLibs AES Direct (required by DTLS v1.3)
2025-10-27 13:04:12 -06:00
David Garske
76abc43812 Put unused fix in correct location. 2025-10-27 10:25:31 -07:00
David Garske
c825d0b34c Merge pull request #9345 from JacobBarthelmeh/devid
fix for passing devId from WOLFSSL_CTX down to hash operation
2025-10-27 08:47:51 -07:00
Eric Blankenhorn
7ef560c188 Fix build error with memtest and memorylog 2025-10-27 10:47:13 -05:00
Sean Parkinson
093cc04076 Stack API: Pull out implementation into separate file
General stack APIs pulled out into ssl_sk.c.
Other simple APIs also pulled out into ssl_sk.c.
wolfSSL_lh_retrieve also pulled out into ssl_sk.c.

Added tests of public APIs that weren't already tested.
2025-10-27 17:08:41 +10:00
JacobBarthelmeh
1a779b3f73 fix for passing devId from WOLFSSL_CTX down to hash operation 2025-10-24 16:39:25 -06:00
Daniel Pouzzner
c145b7ee81 wolfcrypt/src/aes.c: define GCM_GMULT_LEN() when WOLFSSL_ARMASM, and fix gating on wolfCrypt_FIPS_AES_sanity (always gate in for FIPS v7+);
wolfcrypt/src/port/af_alg/afalg_aes.c: check for null key arg;

configure.ac: rename BUILD_FIPS_CURRENT to BUILD_FIPS_V2_PLUS (no functional change), and remove unused ARMASM_DIST_SOURCES set up code added in #9332;

src/include.am:
* set up $(ARMASM_SHA256_C), and use it to properly include wolfcrypt/src/sha256.c alongside armasm when appropriate;
* fix gating on Curved25519 armasm (BUILD_FIPS_V6_PLUS, not BUILD_FIPS_V6);

tests/api/test_aes.c and wolfcrypt/test/test.c: gate out incompatible coverage for WOLFSSL_AFALG and WOLFSSL_KCAPI (test_wc_AesCbcEncryptDecrypt_MultiBlocks(), test_wc_AesCtrSetKey*(), test_wc_AesCtrEncrypt*(), test_wc_AesGcmEncryptDecrypt_Sizes()).
2025-10-24 15:08:56 -05:00
David Garske
d62b1068d2 Fixed issue with SiLibs AES Direct (required by DTLS v1.3). ZD 20695 2025-10-24 11:58:56 -07:00
JacobBarthelmeh
7f5d02c36b Merge pull request #9317 from SparkiDev/benchmark_asym_cc
Benchmark: add cycle counts for asym ops
2025-10-23 09:31:30 -06:00
Daniel Pouzzner
b1f2ff73ed wolfcrypt/src/sha256.c: in wc_Sha256HashBlock(), use ByteReverseWords() rather than a series of ByteReverseWord32() to get WOLFSSL_USE_ALIGN. 2025-10-22 22:54:20 -05:00