Commit Graph

8209 Commits (devin/1739920896-esp32-fixes)

Author SHA1 Message Date
Sean Parkinson 614a0e3f09
Merge pull request #8123 from dgarske/armasm
Fix issue with error: conflicting types for 'BlockSha3'
2024-10-31 09:37:26 +10:00
David Garske 807975c864
Merge pull request #8127 from anhu/percentd
added a missing %d
2024-10-30 15:21:15 -07:00
JacobBarthelmeh bc56129ed8 display heap pointer with debug enabled 2024-10-30 14:39:12 -06:00
Anthony Hu 54dc8320d2 added a missing %d 2024-10-30 14:53:21 -04:00
David Garske 0669ba82c4 Avoid stdint types. 2024-10-30 10:28:45 -07:00
Brett Nicholas 97a370ed08 added generic curve25519 encode/decode functions that can handle combined keypairs 2024-10-30 09:37:16 -06:00
David Garske c557c6f2bd Fix issue with error: conflicting types for 'BlockSha3'.
```
[CC-AARCH64] lib/wolfssl/wolfcrypt/src/port/arm/armv8-sha3-asm_c.o
lib/wolfssl/wolfcrypt/src/port/arm/armv8-sha3-asm_c.c:212:6: error: conflicting types for 'BlockSha3'; have 'void(long unsigned int *)'
  212 | void BlockSha3(unsigned long* state)
      |      ^~~~~~~~~
In file included from lib/wolfssl/wolfcrypt/src/port/arm/armv8-sha3-asm_c.c:35:
lib/wolfssl/wolfssl/wolfcrypt/sha3.h:224:20: note: previous declaration of 'BlockSha3' with type 'void(word64 *)' {aka 'void(long long unsigned int *)'}
  224 | WOLFSSL_LOCAL void BlockSha3(word64 *s);
      |                    ^~~~~~~~~
```
2024-10-29 16:56:50 -07:00
Hideki Miyazaki b07a372b52 Fix spaces and tabs 2024-10-30 06:42:07 +09:00
JacobBarthelmeh 2b8d43cef2
Merge pull request #8119 from dgarske/async_20241028
Fixes for asynchronous release - SHA3/HMAC devId
2024-10-29 15:11:43 -06:00
David Garske 84b5d6613d More fixes for building x86 in Visual Studio for non-windows OS (Watcom C compiler). Followup to PR #7884. Fixes ZD 18465
* Consolidate the USE_WINDOWS_API to a single place.
* Expand the `WOLFSSL_NOT_WINDOWS_API` improvement for intrinsics and word sizes.
* Fix for macro variadic `...` when no variables are used (some compilers like Watcom C have issue with this).
* Fix for Watcom C compiler "long long" -> "__int64".
* Fix a couple of minor cast warnings reported from VS.
2024-10-29 11:50:24 -07:00
Hideki Miyazaki 32c1f8bbd7 implement TSIP RSA Public Enc/Private Dec 2024-10-29 20:09:22 +09:00
David Garske ea35b98005 Fixed SHA3 issue with possible uninitialized devId when building with async. Fixed HMAC set key issue with devId/heap getting lost. 2024-10-28 11:30:05 -07:00
Daniel Pouzzner 6f87f57d7a fixes for gating and ARM32 alignment defects:
wolfcrypt/src/port/arm/armv8-aes.c: in the WOLFSSL_ARMASM_NO_HW_CRYPTO version of wc_AesSetKey(), copy the supplied userKey to a properly aligned buffer if necessary before calling AES_set_encrypt_key();

src/dtls13.c: in Dtls13GetRnMask(), if defined(WOLFSSL_LINUXKM)), return retval of wc_AesEncryptDirect();

wolfcrypt/src/misc.c: add readUnalignedWord32(), writeUnalignedWord32(), readUnalignedWords32(), and writeUnalignedWords32();

wolfcrypt/src/siphash.c: use readUnalignedWord64(), readUnalignedWord32(), and writeUnalignedWord64(), to avoid unaligned access faults, and fix cast in byte-reversing version of GET_U32().
2024-10-25 23:52:32 -05:00
Daniel Pouzzner 82273094e0
Merge pull request #8107 from JacobBarthelmeh/aesgcm
fix for state of aes.gcm.H on re-use
2024-10-23 16:52:42 -05:00
JacobBarthelmeh d0f5778429 fix for state of aes.gcm.H on re-use 2024-10-23 15:04:06 -06:00
Kareem 8986a9dae0 Fix 256-bit ECC conditional in ecc_map_ex. 2024-10-23 11:12:48 -07:00
Daniel Pouzzner 3bbd00f918 wolfcrypt/src/asn.c: tweak retval handling in MakeSignature() CERTSIGN_STATE_DO section for the benefit of WOLFSSL_DEBUG_TRACE_ERROR_CODES. 2024-10-23 00:02:29 -05:00
Daniel Pouzzner bffcfb7efc wolfcrypt/src/ecc.c: in wc_ecc_get_curve_id_from_oid(), deconditionalize guard against zero-length len added in 03a6eed037, to fix test_wc_ecc_get_curve_id_from_oid() failing in cross-mingw-all-crypto. 2024-10-23 00:02:29 -05:00
David Garske 5a0bb3a3ed Fix issue with ARM ASM with AES CFB/OFB not initializing the "left" member. ZD 18841. 2024-10-22 14:30:54 -07:00
Daniel Pouzzner 805eaa90cc
Merge pull request #7797 from julek-wolfssl/softhsm
Init SoftHSMv2 support
2024-10-21 23:56:12 -05:00
jordan 35def11781 coverity: fix error, and cleanup. 2024-10-21 14:59:32 -05:00
JacobBarthelmeh 104c805b82
Merge pull request #8092 from douzzer/20241021-wc_FreeRsaKey-WOLFSSL_XILINX_CRYPT
20241021-wc_FreeRsaKey-WOLFSSL_XILINX_CRYPT
2024-10-21 13:26:55 -06:00
Daniel Pouzzner 25da3bfe5f
Merge pull request #8070 from JacobBarthelmeh/testing_static_memory
use heap hint with wolfSSL_CTX_check_private_key
2024-10-21 13:57:55 -05:00
Daniel Pouzzner f24b987f59 wolfcrypt/src/rsa.c: fix wc_FreeRsaKey() WOLFSSL_XILINX_CRYPT XFREE() call to pass key->heap as before. 2024-10-21 12:26:29 -05:00
gojimmypi 187a9b5b4d
Apply various Espressif compatibility updates 2024-10-21 09:20:32 -07:00
JacobBarthelmeh bc0a2c43e6 avoid warning for unused parameter with certain build configurations 2024-10-21 10:04:26 -06:00
JacobBarthelmeh efff8e096c
Merge pull request #8076 from gojimmypi/pr-update-espressif-examples
Update Espressif Examples
2024-10-21 09:57:29 -06:00
Juliusz Sosinowicz 901384e704 Init SoftHSMv2 support
- wolfSSL_EVP_PKEY_set1_DH: If both private and public present, output private key
- ToTraditionalInline_ex2: Add DH checking
- wc_ecc_get_curve_id: check index is not negative
- Fix i2d_PKCS8_PRIV_KEY_INFO to actually output pkcs8 instead of just der
- wolfSSL_EVP_PKEY2PKCS8: Create duplicate to avoid double free
- wolfSSL_DH_generate_key: Fix case where not enough buffer was allocated for 128 bit case
- pkcs8_encode: Add DSA and DH support
- wolfSSL_d2i_PKCS8_PKEY: Correctly advance buffer
- RSA_LOW_MEM: export all integers in compat layer
- Add softhsm action
- Define
  - OPENSSL_DH_MAX_MODULUS_BITS
  - OPENSSL_DSA_MAX_MODULUS_BITS
  - OPENSSL_RSA_MAX_MODULUS_BITS
- Implement
  - BN_mul_word
  - i2d_ECPKParameters
  - PEM_write_bio_PKCS8_PRIV_KEY_INFO
  - PEM_read_bio_PKCS8_PRIV_KEY_INFO
  - i2d_PKCS8_PRIV_KEY_INFO
  - RSA_padding_add_PKCS1_PSS_mgf1
  - RSA_verify_PKCS1_PSS_mgf1
2024-10-21 17:26:42 +02:00
JacobBarthelmeh 8fda4ce147 use heap hint with wolfSSL_CTX_check_private_key 2024-10-21 08:53:15 -06:00
Daniel Pouzzner 996986d0c1 refactor wc_AesDelete, wc_curve25519_delete, wc_ed25519_delete, wc_HashDelete, and wc_DeleteRsaKey to take two arguments, the first a required pointer to the object, the second an optional pointer to the pointer to be zeroed upon successful deletion, for the benefit of calling from C# without unsafe code.
wrapper/CSharp/wolfSSL_CSharp/wolfCrypt.cs: update for new calling conventions around wc_AesNew, wc_curve25519_new, wc_ed25519_new, wc_HashNew, and wc_NewRsaKey, and the corresponding delete functions.
2024-10-18 21:13:38 -05:00
Daniel Pouzzner f44d12026a wolfssl/wolfcrypt/{aes.h,curve25519.h,ed25519.h,hash.h,rsa.h}: remove unneeded .isAllocated member from struct definitions, and add int *result_code argument to constructor prototypes;
wolfssl/wolfcrypt/aes.h: add Aes.streamData_sz;

src/tls13.c: fix devId passed to wc_HmacInit() in CreateCookieExt() and TlsCheckCookie();

src/keys.c: in SetKeys(), call wc_HmacInit() on hmacs only if newly allocated;

wolfcrypt/src/aes.c:
* in wc_Gmac(), wc_GmacVerify(), and AesSivCipher(), use wc_AesNew() and wc_AesDelete();
* in wc_AesInit(), zero the object on entry, and remove superseded piecemeal initializations to zero;
* in wc_AesFree(), zero aes->streamData, and zero the entire object as final cleanup;

wolfcrypt/src/curve25519.c: in wc_curve25519_free(), zero the entire object rather than zeroing piecemeal;

wolfcrypt/test/test.c:
* add fallback implementations (for old FIPS) of wc_HashNew(), wc_HashDelete(), wc_curve25519_new(), wc_curve25519_delete(), wc_ed25519_new(), and wc_ed25519_delete();
* update constructor calls throughout for new semantics;
* refactor ed25519_test() for proper cleanup and error encoding.
2024-10-18 17:49:28 -05:00
Daniel Pouzzner 984d16b727 refactor wolfcrypt constructors:
add delete APIs, matching recently added wc_AesNew, wc_curve25519_new, wc_ed25519_new, wc_HashNew, and wc_NewRsaKey:
* wc_AesDelete()
* wc_HashDelete()
* wc_DeleteRsaKey()
* wc_curve25519_delete()
* wc_ed25519_delete()

* remove handling in corresponding preexisting free APIs for recently added .isAllocated member -- this restores preexisting semantics;

* add WC_NO_CONSTRUCTORS gate, and auto-activate it when NO_WOLFSSL_MEMORY && WOLFSSL_NO_MALLOC (unless preempted by XMALLOC_USER or XMALLOC_OVERRIDE);

* exclude recently added .isAllocated members from wolfcrypt structs when defined(WC_NO_CONSTRUCTORS);

* adjust wolfcrypt/test/test.c for consistency with the above, and fix cleanup codes/dynamics in several tests.
2024-10-17 18:48:07 -05:00
Daniel Pouzzner 8803f3dd70
Merge pull request #8085 from philljj/fix_coverity
Fix coverity errors
2024-10-16 17:18:31 -05:00
Daniel Pouzzner cc421ddace
Merge pull request #8075 from night1rider/MAX-HW-SHA-FIX
Fixing CB needing HAVE_AES_ECB and SHA struct issue for MAX32666/5 port
2024-10-16 17:17:01 -05:00
Daniel Pouzzner 0c640eb3c5
Merge pull request #8081 from SparkiDev/arm32_thumb2_asm_fix
Thumb2 ASM: indicated by WOLFSSL_ARMASM_THUMB2
2024-10-16 17:00:01 -05:00
Daniel Pouzzner 49ad2d5c46
Merge pull request #8079 from SparkiDev/arm32_asm_regen
ARM32 ASM: regeneration after scripts changes
2024-10-16 16:45:28 -05:00
Daniel Pouzzner 4ed3c00b29
Merge pull request #8078 from SparkiDev/sp_c_cast_and
SP C: cast after and with constant
2024-10-16 16:30:15 -05:00
jordan 554ebc2e9e coverity: fix double free of encryptedContent. 2024-10-16 16:27:44 -05:00
Sean Parkinson 1ce90cc8a5 Thumb2 ASM: indicated by WOLFSSL_ARMASM_THUMB2
Detecting ARM or Thumb2 is not simple so making our own define that will
work: WOLFSSL_ARMASM_THUMB2 to indicate to use Thumb2 assembly code.
2024-10-16 13:56:44 +10:00
gojimmypi a13f48aea0
Update Espressif Examples 2024-10-15 18:36:28 -07:00
Sean Parkinson fb8d2fc42f ARM32 ASM: regeneration after scripts changes
Scripts changed to make generated code not go over 80 characters per
line but SP not updated.
Fix input register formatting in all ARM32 C assembly code.
2024-10-16 10:25:16 +10:00
Sean Parkinson a81aa287a5 SP C: cast after and with constant
Always cast to sp_digit after and with a constant that would convert
value to integer.
2024-10-16 09:48:10 +10:00
Daniel Pouzzner ffc07215a4 clean up wolfcrypt code base for -std=c89 -pedantic: add WC_BITFIELD macro to avoid -Wpedantics for "type of bit-field ... is a GCC extension", with overrideable default definition "byte", and replace parent types of all bitfields with WC_BITFIELD;
fix numerous trailing commas in enums, mostly by removing them, but one (in asn.h, enum Extensions_Sum) using WOLF_ENUM_DUMMY_LAST_ELEMENT();

rearrange bitfields in struct ed25519_key for contiguity;

always define WOLFSSL_SP_NO_DYN_STACK when defined(WOLF_C89).
2024-10-15 18:24:03 -05:00
Daniel Pouzzner 4fd33b6b5d
Merge pull request #8014 from SparkiDev/lms_sha256_192
LMS: SHA-256/192 parameters
2024-10-15 17:24:46 -05:00
Sean Parkinson ae46f52a66 LMS: SHA-256/192 parameters
Add support for parameter sets with SHA-256/192.
2024-10-16 07:15:18 +10:00
philljj 6cde74436e
Merge pull request #8065 from douzzer/20241010-WOLFSSL_NO_MALLOC
20241010-WOLFSSL_NO_MALLOC
2024-10-15 17:03:25 -04:00
night1rider 1449f4f4d7 Fixing CB needing HAVE_AES_ECB and SHA struct issue for MAX3266X Hardware 2024-10-15 14:18:07 -06:00
jordan f5074772da infer: fix more uninitialized value errors. 2024-10-15 12:41:09 -05:00
Daniel Pouzzner 0d5d05d44d more WOLFSSL_NO_MALLOC fixes:
wolfcrypt/src/dh.c: in wc_DhGenerateParams(), use named constant for buf size, and only XFREE it if !WOLFSSL_NO_MALLOC;

wolfcrypt/src/ecc.c and wolfssl/wolfcrypt/ecc.h: in wc_ecc_new_point_ex(), remove !WOLFSSL_NO_MALLOC gate around XMALLOC(), and if XMALLOC()ed, set ecc_point.isAllocated, then in wc_ecc_del_point_ex, XFREE() iff ecc_point.isAllocated;

wolfcrypt/src/pkcs7.c: in wc_PKCS7_RsaVerify(), when WOLFSSL_NO_MALLOC, jumbo-size the digest buffer to cope with in-place dynamics in RsaUnPad();

wolfcrypt/test/test.c: add !WOLFSSL_NO_MALLOC gates around various XFREE()s of objects that are on the stack in WOLFSSL_NO_MALLOC builds;

wolfssl/wolfcrypt/types.h: add an unconditional include of memory.h (itself guarded against multiple inclusion) to assure availability of WC_DEBUG_CIPHER_LIFECYCLE prototypes/macros.
2024-10-14 14:21:29 -05:00
Daniel Pouzzner 0665ff9de7 wolfcrypt/src/asn.c: revert earlier WOLFSSL_NO_MALLOC changes (not needed, after proper gating in test.c). 2024-10-14 14:21:29 -05:00
Daniel Pouzzner 551eb3f44b wolfcrypt/src/ed25519.c and wolfcrypt/src/hash.c: remove gating around isAllocated XFREE()s in wc_ed25519_free() and wc_HashFree(). 2024-10-14 14:21:28 -05:00
Daniel Pouzzner dc2a8118de Revert "Allow compiling aes.c with WOLFSSL_NO_MALLOC"
This reverts commit 56a96ba609.
2024-10-14 14:21:28 -05:00
Daniel Pouzzner ee92f38f88 Revert "fix unused variables"
This reverts commit 06195a2e2a.
2024-10-14 14:21:28 -05:00
Daniel Pouzzner 886ebb6ec0 fixes for enable-all-crypto enable-cryptonly WOLFSSL_NO_MALLOC:
wolfcrypt/src//asn.c: add stack buffer codepaths in ParseKeyUsageStr(), SetKeyIdFromPublicKey(), and EncodePolicyOID;

wolfcrypt/src/dh.c: add stack buffer codepath in wc_DhGenerateParams();

wolfcrypt/src/ecc.c: add always-fail codepath to find_hole() to preempt heap allocation attempts;

wolfcrypt/test/test.c: gate out several heap-dependent subtests when defined(WOLFSSL_NO_MALLOC), and add a stack buffer codepath in ed448_test();

wolfssl/wolfcrypt/types.h: harmonize macro definitions of XFREE() to use do { ... } while (0) wrappers to assure syntactic indivisibility.
2024-10-14 14:21:28 -05:00
Juliusz Sosinowicz 743a78dc85
Merge pull request #8046 from embhorn/zd18758
Clear ctx in wolfSSL_EVP_DigestInit
2024-10-14 14:35:20 +02:00
Daniel Pouzzner caf920100c
Merge pull request #8051 from cconlon/eccOidCacheLock
Add lock around static ECC ecc_oid_cache
2024-10-11 17:34:54 -05:00
Daniel Pouzzner dfd8ead95e
Merge pull request #8050 from philljj/fix_acert_defines
Fix acert defines, add more tests, cleanup.
2024-10-11 16:22:34 -05:00
Sean Parkinson 65742c4a7a ARM32 ASM: regenerated with fixes
Fix thumb interwork def check to be consistent and update #endif.
Remove duplicate check in generated C files.
2024-10-11 09:07:57 +02:00
Sean Parkinson 9c4960f3fa
Merge pull request #8035 from danielinux/armv8-armasm-ARMv7-A
Allow armv8-asm on ARMv7-A with -mthumb-interwork
2024-10-11 09:49:31 +10:00
Chris Conlon 7b805d7a7d Add lock around static ECC ecc_oid_cache 2024-10-09 14:35:14 -06:00
Daniele Lacamera 06195a2e2a fix unused variables 2024-10-09 14:06:38 +02:00
Daniele Lacamera 56a96ba609 Allow compiling aes.c with WOLFSSL_NO_MALLOC 2024-10-09 13:55:42 +02:00
Daniele Lacamera 43574e2255 Allow building with WOLFSSL_NO_MALLOC again 2024-10-09 13:44:03 +02:00
Daniele Lacamera a23d384e06 Improve guards to build with -mthumb-interwork 2024-10-09 12:41:55 +02:00
jordan 052cf77233 acert: fix defines, cleanup, more testing. 2024-10-08 16:11:46 -05:00
David Garske e4f4274b4a Fix AesSivCipher heap hint on cleanup. 2024-10-08 12:11:15 -07:00
David Garske 4753e1c32e Use `byte` for `isAllocated` bit-field. Cleanup some of the "heap" hint logic. 2024-10-08 10:37:45 -07:00
Eric Blankenhorn cd5ddeb1c5 Clear ctx in wolfSSL_EVP_DigestInit 2024-10-07 14:20:50 -05:00
David Garske 59389a0ef5 Fix possible AES leaks detected with sanitizer and clang-tidy. 2024-10-05 11:52:22 -07:00
David Garske dbd3484fdc Fix for issue with `wc_HashAlg` being a union. 2024-10-05 11:44:59 -07:00
David Garske 0bb41e1eb4 Resolve hash new leak due to improper heap hint check. Make sure isAllocated is initialized to 0. 2024-10-05 11:44:58 -07:00
Aidan Garske e10c943bf3 wolfCrypt CSharp Wrapper:
* Adds RNG, ECC(ECIES and ECDHE), RSA, ED25519/Curve25519, AES-GCM, and Hashing to the CSharp wrapper.
* Adds GitHub action for building the CSharp wrapper solution and running wolfCrypt test and a TLS server/client example.
* Adds "new" API's for wolfCrypt for platforms that cannot tolerate the structs directly.
* Fixes for several scan-build warnings.
2024-10-05 11:44:58 -07:00
Daniel Pouzzner e944967731 wolfssl/wolfcrypt/types.h: add WC_NO_STATIC_ASSERT path, and add C89-compatible live fallback definition for wc_static_assert().
wolfssl/internal.h: refactor WOLFSSL_ASSERT_EQ() and WOLFSSL_ASSERT_SIZEOF_GE() to use wc_static_assert(), and drop unused WOLFSSL_ASSERT_TEST() and WOLFSSL_ASSERT_SIZEOF_TEST().

src/ssl_crypto.c and wolfcrypt/src/evp.c: refactor ad hoc asserts in wolfSSL_DES_ecb_encrypt(), wolfSSL_CRYPTO_cts128_decrypt(), and wolfSSL_EVP_DigestInit(), to use wc_static_assert().
2024-10-04 21:11:25 -05:00
Daniel Pouzzner 2e539ef70c
Merge pull request #7983 from philljj/tiny_dilithium_cleanup
dilithium: small cleanup to support wolfboot.
2024-10-03 23:37:11 -05:00
Sean Parkinson f7afc47d98 Kyber ARM32 ASM: add assembly using base instructions
Support ARMv4 up to ARMv8.
Base instructions only - faster implemenation will use NEON.
2024-10-04 11:06:18 +10:00
jordan c3410f2cb8 dilithium: support building dilithium with wolfboot. 2024-10-03 16:38:12 -05:00
David Garske d0d802a2df
Merge pull request #8038 from SparkiDev/sp_math_ppc_li_fix
SP Maths: PowerPC ASM fix
2024-10-03 11:03:31 -07:00
David Garske afe5209427
Merge pull request #7706 from SparkiDev/kyber_thumb2_asm
Kyber ASM ARMv7E-M/ARMv7-M: added assembly code
2024-10-03 10:56:42 -07:00
Sean Parkinson d2047986d9 Kyber ASM ARMv7E-M/ARMv7-M: added assembly code
Improved performance by reworking kyber_ntt, kyber_invtt,
kyber_basemul_mont, kyber_basemul_mont_add, kyber_rej_uniform_c to be
in assembly.
Replace WOLFSSL_SP_NO_UMAAL with WOLFSSL_ARM_ARCH_7M
2024-10-03 18:11:31 +10:00
Sean Parkinson 695914ed33 SP Maths: PowerPC ASM fix
The instruction 'li' is a pseduo instruction for 'load immediate'.
With some compilers, the immediate was interpretted R0[0].
Change to use XOR instead.
2024-10-03 09:00:06 +10:00
Daniel Pouzzner e814d1baea
Merge pull request #8016 from SparkiDev/dilithium_draft_final_fix
Dilithium: Final and draft available in one build
2024-10-02 14:02:00 -05:00
Sean Parkinson 50bbdbbe42 Dilithium: Final and draft available in one build
Make draft version of ML-DSA compiled in with final.
Use WC_ML_DSA_44_DRAFT, WC_ML_DSA_65_DRAFT and WC_ML_DSA_87_DRAFT for
the level to get the draft implementation.
2024-10-02 22:23:25 +10:00
gojimmypi 75a676bc7e
Espressif _thread_local_start and _thread_local_end fix 2024-10-01 03:19:31 -07:00
JacobBarthelmeh ee7f02bbd6
Merge pull request #8004 from SparkiDev/dilithium_fixes_1
Dilithium: fixes
2024-09-30 10:01:16 -06:00
JacobBarthelmeh 113a61c11e
Merge pull request #8025 from douzzer/20240927-fixes2
20240927-fixes2
2024-09-30 09:43:12 -06:00
David Garske 2db2bedd5f
Merge pull request #8027 from SparkiDev/kyber_original_fix
Kyber original: fix to work
2024-09-30 07:58:30 -07:00
David Garske 47add7e9e2
Merge pull request #8020 from SparkiDev/arm32_base_chacha20_poly1305
ARM32 ChaCha20, Poly1305: assembly code
2024-09-30 06:53:37 -07:00
Sean Parkinson bb67069e4a Kyber original: fix to work
Encapsulate the message (hash of rand) for original.
Final of FIPS 203 uses rand.
2024-09-30 22:05:26 +10:00
Sean Parkinson e4301bc554 ARM32 generated files: fix line lengths
Generated ARM32 assembly files no longer have lines with more than 80
characters.
2024-09-30 08:50:31 +10:00
Daniel Pouzzner 60c2499602 wolfssl/wolfcrypt/types.h: when defining fallback do-nothing SAVE_VECTOR_REGISTERS2(), also define SAVE_VECTOR_REGISTERS2_DOES_NOTHING, and likewise for fallback CAN_SAVE_VECTOR_REGISTERS, define CAN_SAVE_VECTOR_REGISTERS_ALWAYS_TRUE;
wolfcrypt/src/aes.c:
* when SAVE_VECTOR_REGISTERS2_DOES_NOTHING, define do-nothing VECTOR_REGISTERS_PUSH and VECTOR_REGISTERS_POP, to mollify Coverity CONSTANT_EXPRESSION_RESULT;
* in AesGcmDecryptUpdate_aesni(), omit " && (c != NULL)" clause from computation of endA argument to AesGcmAadUpdate_aesni(), to mollify Coverity FORWARD_NULL (impermissible nullness is already checked and BAD_FUNC_ARGed by the sole caller, wc_AesGcmDecryptUpdate());

wolfcrypt/src/misc.c: add readUnalignedWord64(), writeUnalignedWord64(), readUnalignedWords64(), and writeUnalignedWords64(), for safe word64 access to possibly-unaligned data;

wolfcrypt/src/wc_kyber_poly.c: use readUnalignedWords64() and readUnalignedWord64() to mitigate sanitizer-reported "load of misaligned address".
2024-09-27 17:15:53 -05:00
JacobBarthelmeh b96e73f9ed
Merge pull request #7936 from gojimmypi/pr-add-espressif-esp-tls-cert-bundle
Add wolfSSL esp-tls and Certificate Bundle Support
2024-09-27 15:22:49 -06:00
Daniel Pouzzner 794f0d8d19 src/pk.c: add missing "keySz = padded_keySz" in _DH_compute_key() ct cleanup path.
wolfcrypt/src/wc_kyber_poly.c: add SAVE_VECTOR_REGISTERS2()...RESTORE_VECTOR_REGISTERS() wrappers for AVX2 implementations.

src/bio.c and src/ssl.c: add several missing WC_NO_ERR_TRACE()s, and tweak several returns to generate error traces.
2024-09-27 00:28:45 -05:00
Colton Willey 3d9a4ccddc Use GetShortInt instead for CRL number extension parsing 2024-09-26 15:43:30 -07:00
David Garske 2285c02f1c
Merge pull request #7998 from SparkiDev/kyber_aarch64_asm
Kyber Aarch64: assembly implementations of functions
2024-09-26 11:59:06 -07:00
Sean Parkinson 2323a5cf59 ARM32 ChaCha20, Poly1305: assembly code
Add assembly code for ChaCha20 and Poly1305 on ARM32 when no NEON
available.
2024-09-26 20:24:58 +10:00
gojimmypi 2a354905cb
Add wolfSSL esp-tls and Certificate Bundle Support, improve esp32_mp RSA 2024-09-25 19:42:21 -07:00
Sean Parkinson de657787cf Kyber Aarch64: assembly implementations of functions
Aarch64 assembly implementation of Kyber functions.
SHA-3 assembly implementations when not hardware crypto.
2024-09-26 09:10:05 +10:00
JacobBarthelmeh 45b88048c2 make macro unique to wolfSSL 2024-09-25 15:59:57 -06:00
JacobBarthelmeh d72c0b372c
Merge pull request #7990 from buchstabenwurst/master
Add support for (DevkitPro)libnds
2024-09-25 15:52:34 -06:00
JacobBarthelmeh 67b0c4d03f
Merge pull request #8009 from philljj/asn_cleanup
asn: cleanup around edPubKeyASN.
2024-09-25 10:09:40 -06:00
Brett Nicholas 7592241a46
Merge pull request #8007 from billphipps/fix_cmac_cryptocb
Update to separate CMAC and AES conditional compiles.  Correct update.
2024-09-25 08:43:27 -06:00
Bill Phipps 60dbe38226
Update cmac.c to eliminate extra spaces 2024-09-24 18:34:19 -04:00
Bill Phipps 13b26bc46b
Update cryptocb.c to fix comment 2024-09-24 18:27:58 -04:00
Brett Nicholas 967dc443fa
remove trailing whitespace 2024-09-24 12:58:01 -06:00
jordan c6124d573a asn: tiny peer review cleanup. 2024-09-24 13:01:13 -05:00
Bill Phipps 8aa63e3aad One more time to quiet clang tidy 2024-09-24 13:43:56 -04:00
Bill Phipps 5e1db686e1 Update logic to avoid clang-tidy warning. 2024-09-24 13:14:00 -04:00
Bill Phipps 35442d27b5 Fixed overlong lines. Thanks clang-tidy 2024-09-24 12:48:54 -04:00
John Safranek 17261467a6 Revert "FP SmallStack Fix"
This reverts commit 47e51400bb.

Turns out we don't want to put those fp_ints on the stack unless
absolutely necessary.
2024-09-24 09:19:43 -07:00
Bill Phipps 0d158fc663 Updates due to peer review 2024-09-24 12:06:19 -04:00
jordan 0f646b6e4b asn: cleanup around edPubKeyASN. 2024-09-23 23:24:36 -05:00
Bill Phipps c16ebaeb47 Update to seperate CMAC and AES conditional compiles. Correct update. 2024-09-23 15:33:52 -04:00
Colton Willey e5022e3ef0 Fix broken endif 2024-09-23 12:11:04 -07:00
Colton Willey 183aef241c CRL improvements, add parsing for CRL number, do not allow CRL duplicates, add callback for when CRL entry is updated. 2024-09-23 11:52:39 -07:00
Sean Parkinson 67528f91b3 Dilithium: fixes
Fixes to hint error dectection.
Fix public key decode to fail when DER length is zero for the public key
data.
2024-09-23 09:05:17 +10:00
Daniel Pouzzner bc6881974d
Merge pull request #8001 from ejohnstown/ecc-test-fix
ECC Test Fix
2024-09-20 20:53:28 -05:00
John Safranek 735c0f6b3a ECC Test Fix
The ECC key generation test was failing due not using large enough of a
buffer. Fixed to use a better size.

1. Set the shared digest/sig buffer size in
   _ecc_pairwise_consistency_test() to the maximum possible based on the
   math in wc_ecc_sig_sz().
2024-09-20 17:25:21 -07:00
David Garske a9cc880f65
Merge pull request #7993 from miyazakh/renesas_rx65n_rsk_update
Update TSIP driver version to v1.21 for RX65N RSK
2024-09-20 17:07:21 -07:00
David Garske 3c67abc664
Merge pull request #7954 from JacobBarthelmeh/pkcs7
add option to set custom SKID with PKCS7 bundle creation
2024-09-20 17:05:44 -07:00
JacobBarthelmeh 554d52b069
Merge pull request #7777 from night1rider/MAX32666-port
MAX32665 and MAX32666 TPU HW and ARM ASM Crypto Callback Support
2024-09-20 17:14:34 -06:00
Hideki Miyazaki 3f0a17b331 Update TSIP driver version to v1.21
Use ASN_TEMPLATE
Extracting YEAR and MONTH from __DATE__
2024-09-21 06:23:59 +09:00
Daniel Pouzzner 55cd8a800f FIPS v5 gating fixes:
configure.ac:
* fix logic in "Forcing off" test expressions, first flubbed in 19106a9510;
* fix auto-enable of compkey to exclude v5 even if v5-dev.

src/tls13.c: fix gating for HKDF _ex() variants (>=6.0, not >=5.3).

wolfcrypt/src/error.c: snip out stray spaces at start of several ECC error message strings.

wolfcrypt/test/test.c:
* in render_error_message(), use wolfSSL_ERR_reason_error_string() if available rather than wc_GetErrorString(), to render non-wolfcrypt error strings;
* in ecc_test_deterministic_k(), ecc384_test_deterministic_k(), ecc521_test_deterministic_k(), on FIPS <6.0, gate out SHA384 and SHA512 tests (FIPS v5 only supports SHA256 in wc_ecc_gen_deterministic_k());
* in cmac_test(), gate use of wc_AesCmacGenerate_ex() and wc_AesCmacVerify_ex() on >=6.0, not >=5.3.
2024-09-20 13:53:36 -05:00
ZackLabPC 9881edfabe Crypto Callback Support for ARM ASM: AES-ECB/CBC, SHA-1/256/384/512 + Fix SP SHA CB Bug 2024-09-20 09:42:53 -06:00
night1rider 1cb324affa Expanding mutexing and Adding in AES Callbacks for HW 2024-09-20 09:42:53 -06:00
night1rider 8f8b4e6665 Addressing Feedback, Adding Null Checks and Mutex Around TRNG 2024-09-20 09:42:53 -06:00
night1rider fe7987f241 Adding SHA-384/512 support, Null Checks, RNG Health Test for HW, and MAA call update for MAX3266X Port. 2024-09-20 09:42:52 -06:00
night1rider d714e55a2b Addressing PR comments typos and cleanup and support HAVE_AES_ECB, Sha1, and Sha224 2024-09-20 09:42:52 -06:00
msi-debian 2e8cf39feb Initial PR for MAX32665 and MAX32666 TPU HW Support 2024-09-20 09:42:52 -06:00
JacobBarthelmeh 8017c816bb check on RNG init return with test, and make input const 2024-09-20 08:34:28 -07:00
JacobBarthelmeh 5adad7d869 fix for sanity check of null input 2024-09-20 08:34:28 -07:00
JacobBarthelmeh ca3b1a1412 add test case 2024-09-20 08:34:28 -07:00
JacobBarthelmeh 7a23cff27f add PKCS7 set custom SKID 2024-09-20 08:34:28 -07:00
JacobBarthelmeh bddb83b62a
Merge pull request #7992 from ejohnstown/ecc-pct-ss
Small Stack ECC Pairwise Consistency Test
2024-09-20 09:13:21 -06:00
András Fekete bbbc40dacc
Merge pull request #7996 from julek-wolfssl/move-mymemmem
memmem is only being used in testing so move it there

Failing test is disabled in: 5be198fa0e
2024-09-20 09:08:44 -04:00
Daniel Pouzzner 212708e3b4 wolfssl/wolfcrypt/ecc.h and wolfcrypt/src/ecc.c: refactor ecc_sets and ecc_sets_count using accessor functions, to fix linker relocation errors in Fedora packaging test. 2024-09-19 17:03:07 -05:00
Juliusz Sosinowicz d7303664b5 memmem is only being used in testing so move it there 2024-09-19 15:54:20 +02:00
John Safranek a81efc0f6f Small Stack ECC Pairwise Consistency Test
1. Update the ECC PCT to use the key's heap to allocate any buffers for
   the test. This is similar to how RSA does it.
2. Put the buffers on the stack if not using small stack option.
2024-09-18 15:14:52 -07:00
Daniel Pouzzner 072c5311a5 m4/ax_atomic.m4: fixes for C++ compatibility.
wolfssl/wolfcrypt/wc_port.h: add WOLFSSL_API attribute to wolfSSL_Atomic_Int_Init, wolfSSL_Atomic_Int_FetchAdd, and wolfSSL_Atomic_Int_FetchAdd, and add fallback definitions for them, allowing elimination of SINGLE_THREADED implementations of wolfSSL_Ref*(), and allowing ungated use of wolfSSL_Atomic_* calls in api.c.

wolfcrypt/src/dh.c: in wc_DhAgree_ct(), remove frivolous XMEMSET() and stray semicolon.

wolfcrypt/benchmark/benchmark.c: fix bench_rsaKeyGen() to skip tests of key sizes below RSA_MIN_SIZE, and add 4096 bit benchmark if RSA_MAX_SIZE is big enough.

tests/unit.h:
* adopt definitions of TEST_FAIL, TEST_SUCCESS, and TEST_SKIPPED from unit.c, remap TEST_SKIPPED from -7777 to 3, and add TEST_SUCCESS_NO_MSGS, TEST_SKIPPED_NO_MSGS, EXPECT_DECLS_NO_MSGS(), and EXPECT_FAILURE_CODEPOINT_ID, to support existing and future expected-particular-failure test cases without log noise.
* rename outer gate from CyaSSL_UNIT_H to TESTS_UNIT_H.

tests/api.c:
* use EXPECT_DECLS_NO_MSGS() in test_ssl_memio_setup(), test_ssl_memio_read_write(), and test_wolfSSL_client_server_nofail_memio(), and globally update affected expected error codes to correspond.
* use atomics for {client,server}SessRemCount{Malloc,free} to fix races in SessRemCtxCb() and SessRemSslSetupCb().
2024-09-18 16:25:26 -05:00
Joshua Okeleke 337456cc1e Add support for (DevkitPro)libnds 2024-09-18 21:27:53 +02:00
JacobBarthelmeh ffd0fb23f7
Merge pull request #7979 from SparkiDev/sp_x86_64_no_avx_fix
SP x86_64 asm: check for AVX2 support
2024-09-18 10:23:12 -06:00
Juliusz Sosinowicz 1e75a2367c Address code review 2024-09-18 10:35:29 +02:00
Juliusz Sosinowicz 8ce6f17144 Add dtls 1.3 cid api test 2024-09-18 10:35:29 +02:00
John Safranek 47e51400bb FP SmallStack Fix
The function _fp_exptmod_nct() is using WOLFSSL_NO_MALLOC to guard
using stack allocation vs malloc. It's twin function _fp_exptmod_ct()
is using WOLFSSL_SMALL_STACK for this. This is causing inappropriate use
of malloc() in a small stack environment. The no-malloc case will also
be kept so static memory and no-malloc fix still works.

1. Change the guards for `#ifndef WOLFSSL_NO_MALLOC` in the function
   `_fp_exptmod_nct()` to `#if defined(WOLFSSL_SMALL_STACK) &&
   !defined(WOLFSSL_NO_MALLOC)`.
2024-09-17 10:55:11 -07:00
Sean Parkinson aa41e09937 SP x86_64 asm: check for AVX2 support
Check for AVX2 as well as BMI2 and ADX.
Some virtual machines may not have AVX2 with the others.
2024-09-17 14:14:27 +10:00
Daniel Pouzzner 04c781ad9b wolfcrypt/src/dh.c: in wc_DhAgree_ct(), implement failsafe constant-time key size fixup, to work around sp-math constant-time key clamping.
also fix a -Wunused in src/ssl_load.c:DataToDerBuffer() teased out by configuration permutations.
2024-09-16 17:33:25 -05:00
Daniel Pouzzner 52030f182b
Merge pull request #7972 from miyazakh/renesas_tsip_update_
Renesas TSIP version update
2024-09-14 00:41:19 -05:00
Daniel Pouzzner 990d38a068
Merge pull request #7974 from dgarske/noasn
Support for NO_ASN when wildcard *.c is used
2024-09-14 00:34:15 -05:00
Daniel Pouzzner 80f3b0d3d8
Merge pull request #7926 from philljj/x509_acert_support
x509 attribute cert support
2024-09-14 00:30:29 -05:00
Daniel Pouzzner 4545a9b4a2
Merge pull request #7960 from night1rider/mmcau-DesEcb
DES ECB using mmcau HW Library, and DES ECB basic test
2024-09-14 00:07:18 -05:00
Daniel Pouzzner 84f0800b96 configure.ac:
* set DEFAULT_ENABLED_ALL_ASM=no if enable_afalg or ENABLED_32BIT;
* omit enable_srtp_kdf from enable-all-crypto if enable_afalg.

linuxkm: add GetCAByAKID to wolfssl_linuxkm_pie_redirect_table.

src/x509.c: in GenerateDNSEntryIPString(), use XMEMSET() to initialize tmpName, not = {0}, to avoid unmaskable compiler emission of memset() call.

wolfssl/openssl/ssl.h: add OPENSSL_EXTRA to an existing OPENSSL_ALL-gated section, consistent with gating of correspinding section in wolfssl/ssl.h.

wolfssl/wolfcrypt/settings.h: adopt setup for WOLFSSL_SP_NO_UMAAL from wolfssl/wolfcrypt/sp_int.h now that it's used by wolfcrypt/src/port/arm/thumb2-poly1305-asm.S.
2024-09-13 18:01:11 -05:00
David Garske 8cea8283db Support for NO_ASN when wildcard *.c is used. Added `STM32H743xx` support. 2024-09-13 13:52:21 -07:00
jordan 7df446bf4e cleanup: fix cast warning, and small cleanup. 2024-09-13 09:26:19 -05:00
jordan 7faed6cded X509 attribute cert (acert) support. 2024-09-13 08:03:55 -05:00
Hideki Miyazaki c49f1e22bd Update TSIP version for RX72N and GR-ROSE
fix readme
2024-09-13 14:12:39 +09:00
Sean Parkinson 4fa20cb770
Merge pull request #7965 from ColtonWilley/pkcs12_use_indef_len
Use context specific for PKCS7 encrypted data encoding
2024-09-13 12:17:08 +10:00
Colton Willey b0ddccc802 Change PKCS7 encrypted content encoding to use ASN_CONTEXT_SPECIFIC 2024-09-12 16:46:35 -07:00
Sean Parkinson 171ab4b13a
Merge pull request #7967 from douzzer/20240910-configure-enable-all-asm-and-sp-cleanup
20240910-configure-enable-all-asm-and-sp-cleanup
2024-09-13 09:18:37 +10:00
Daniel Pouzzner f6d40ad229
Merge pull request #7955 from gojimmypi/pr-espressif-port-updates
Update Espressif sha, util, mem, time helpers
2024-09-12 18:15:25 -05:00
Daniel Pouzzner eb53a95f57 wolfcrypt/src/asn.c:DecodeSingleResponse(): fix gating for "at" working var, by refactoring gating for WOLFSSL_OCSP_PARSE_STATUS sections for clarity. 2024-09-12 14:38:50 -05:00
Daniel Pouzzner 53c4c0095a wolfcrypt/src/sp_cortexm.c: update from scripts#423. 2024-09-12 13:29:02 -05:00
Daniel Pouzzner 8d0047fedf SP: fixes for several bugprone-macro-parentheses and -Wconversions. 2024-09-12 13:29:01 -05:00
Daniel Pouzzner e227b2ad7d wolfcrypt/src/sp_int.c: fix bugprone-too-small-loop-variable in _sp_mul(). 2024-09-12 13:29:01 -05:00
Daniel Pouzzner 5b8e9e692f wolfcrypt/src/siphash.c: fixes for bugprone-macro-parentheses. 2024-09-12 13:29:01 -05:00
David Garske 20e2e33e25
Merge pull request #7939 from SparkiDev/thumb2_poly1305
undefined
2024-09-12 11:15:53 -07:00
Siert Wieringa 9e2a7b3653
Feature/multiple aes siv ads (#7911)
* Proposed new interface for AesSivEncrypt with number of ADs != 1.

* Implement AES SIV S2V computation with a number of ADs not equal to 1.

* Add Example A.1 from RFC5297 to AES SIV test vectors.

* Add tests for new AES SIV interface, and add test vectors for examples given in RFC5297.

* Include the nonce in count of maximum number of ADs.

* Addressing review comments.

* Addressing review comments: Use uppercase 'U' suffix on unsigned constant.

* Rename local variables named 'ad0' to 'ad', since the zero makes no sense, especially since in the RFC 5297 document they're actually counting the ADs from 1.
2024-09-12 07:55:29 -07:00
Sean Parkinson 27033c225f Thumb-2 ChaCha, Poly1305: implemention in assembly
Implementation of ChaCha algorithm for ARM Thumb-2.
Implementation of Poly1305 algorithm for ARM Thumb-2.
2024-09-12 10:59:01 +10:00
Sean Parkinson d23bfd2eb9
Merge pull request #7963 from anhu/p11nopin
Check for PIN before saving it.
2024-09-12 10:20:47 +10:00
Colton Willey 88d1ed7393 Modify pkcs8 pbe encryption to use indefinite length encoding, making it consistent with both old ASN code and openssl 2024-09-11 15:55:05 -07:00
Anthony Hu 246228e410 Check for PIN before saving it. 2024-09-11 14:39:03 -04:00
Sean Parkinson 1c8f1e6921
Merge pull request #7802 from douzzer/20240725-wc_DhAgree_ct
20240725-wc_DhAgree_ct
2024-09-11 08:06:58 +10:00
Sean Parkinson 10c1fa2088
Merge pull request #7931 from barracuda156/powerpc-darwin
Fixes for PowerPC
2024-09-10 10:34:09 +10:00
Sean Parkinson 500a3b41e4
Merge pull request #7932 from barracuda156/dispatch
Fixes for earlier macOS
2024-09-10 10:29:45 +10:00
night1rider e912aff7e5 DES ECB using mmcau HW Library, and DES ECB basic test 2024-09-09 15:32:21 -06:00
Daniel Pouzzner 49a680540c add constant time DH key agreement APIs:
* adds wc_DhAgree_ct().
* adds wolfSSL_DH_compute_key_padded(), using wc_DhAgree_ct() if available, with fallback fixup code.
* adds unit test coverage in api.c:test_wolfSSL_DH() for expected-success calls to wolfSSL_DH_compute_key() and wolfSSL_DH_compute_key_padded().
2024-09-09 16:24:07 -05:00
Daniel Pouzzner c81c9be9ce error code fixes:
* fix TLS layer to consistently use WOLFSSL_FATAL_ERROR for error retvals, rather than literal -1.
* add WC_NO_ERR_TRACE() wrapper around LENGTH_ONLY_E (it does not signify an error condition).
* refactor errcode handling for traceability in wolfSSL_DSA_do_sign(), wolfSSL_DH_size(), wolfSSL_EC_KEY_get_conv_form(), wolfSSL_d2i_DSA_SIG(), wolfSSL_DSA_do_sign(), SetDhInternal(), and wolfSSL_EC_KEY_get_conv_form().
2024-09-06 19:33:48 -05:00
gojimmypi b57fcd0bd8
Update Espressif sha, util, mem, time helpers 2024-09-06 16:33:04 -07:00
David Garske 80a63a3fce
Merge pull request #7924 from anhu/pqm4_purge
Get rid of pqm4 in favour our own Kyber/MLDSA implementation
2024-09-06 12:00:26 -07:00
Sean Parkinson 5f40f9a140 Thumb-2 ChaCha: implemention in assembly
Implementation of ChaCha algorithm for ARM Thumb-2.
2024-09-06 10:16:45 +10:00
Sean Parkinson 96e2c51f07
Merge pull request #7907 from ColtonWilley/rsa_pad_crypto_cb
Add new crypto callback for RSA with padding.
2024-09-06 08:48:36 +10:00
Sean Parkinson 6fc9dcae07
Merge pull request #7947 from douzzer/20240905-mp_sign_t
20240905-mp_sign_t
2024-09-06 08:46:23 +10:00
Daniel Pouzzner dcaff9dff4
Merge pull request #7944 from JacobBarthelmeh/pkcs12
add parsing over optional PKCS8 attributes
2024-09-05 16:55:44 -05:00
David Garske 887c5abcb1
Merge pull request #7949 from douzzer/20240905-whitespace-and-utf8-cleanup
20240905-whitespace-and-utf8-cleanup
2024-09-05 14:38:19 -07:00
Daniel Pouzzner 9f6a75cdfd
Merge pull request #7934 from rizlik/ocsp-get-ca-keyhash-fix
ocsp: search CA by key hash instead of ext key id
2024-09-05 15:03:54 -05:00
Daniel Pouzzner a3fb5029f8 clean up trailing whitespace and misplaced CRLFs, add missing final newlines, remove stray UTF8 nonprintables (BOMs) and ASCIIfy stray homoglyphs (spaces and apostrophes), guided by expanded coverage in wolfssl-multi-test check-source-text. 2024-09-05 14:52:18 -05:00
Daniel Pouzzner 603c03c0be MPI: add mp_sign_t and sp_sign_t. 2024-09-05 10:37:02 -05:00
JacobBarthelmeh 9a8573afc9 touch up pkcs8 create function and test case warning 2024-09-04 15:48:44 -06:00
JacobBarthelmeh 2a1165460e add parsing over optional PKCS8 attributes 2024-09-04 15:15:53 -06:00
Daniel Pouzzner a31733db85
Merge pull request #7909 from SparkiDev/dilithium_fips204_draft
Dilithium: Support FIPS 204 Draft
2024-09-04 14:34:59 -05:00
Daniel Pouzzner c9ff15da21
Merge pull request #7901 from SparkiDev/memusage_8
Memory usage improvements
2024-09-04 12:34:44 -05:00
David Garske 7c7de235d8
Merge pull request #7937 from douzzer/20240903-missing-WC_NO_ERR_TRACEs
20240903-missing-WC_NO_ERR_TRACEs
2024-09-04 08:07:19 -07:00
Sean Parkinson 88c3e0af22 Memory usage improvements
kdf.c: wc_PRF() - No need for previous, reuse current.
sha256.c: Transform_Sha256() - Add slow but small version for many
register implementation.
sp_int.h: Change 'used' and 'size' fields to 16-bit types when possible.
sp_int.c: Fixes for 16-bit used.
2024-09-04 22:51:31 +10:00
Daniel Pouzzner b26fa6cf59
Merge pull request #7918 from SparkiDev/type_conversion_fixes_3
Type conversion fixes
2024-09-03 20:18:00 -05:00
Daniel Pouzzner 121b8c52f8
Merge pull request #7869 from julek-wolfssl/libspdm-x509
libspdm x509 parts
2024-09-03 20:09:31 -05:00
Daniel Pouzzner 806df85477 backfill more missing WC_NO_ERR_TRACE()s on error code operands, and refactor away the obsolete GEN_MEM_ERR macro mechanism in wolfcrypt/src/ecc.c. 2024-09-03 17:44:11 -05:00
David Garske b7a6c6c314 Fixes for building RISCV ASM with enable-all.
* Fix type warning for SHA512 ByteReverseWords call
* Fix issue with riscv-asm and xchacha.
2024-09-03 09:37:01 -07:00
Marco Oliverio 293719c168 ocsp: search CA by key hash instead of ext key id 2024-09-02 15:25:53 +00:00
Sean Parkinson ed7beb4e0e Type conversion fixes
Changes to get compilation with -Wconversion passing on the files.
2024-09-02 19:19:23 +10:00
Juliusz Sosinowicz 2c9a3c5c1c Missing libspdm features
- RsaFunctionPrivate: detect when only n,e,d are available
- wolfSSL_EVP_add_digest: return success
- wolfSSL_EVP_add_cipher: return success
- wolfSSL_BN_bin2bn: accept NULL data if len is 0 (checked in mp_read_unsigned_bin)
- wolfssl_read_bio: advance correct bio
- wolfSSL_X509_set_ext: return raw extension data for BASIC_CA_OID
- Implement
  - sk_X509_EXTENSION_free
  - d2i_EC_PUBKEY_bio
  - d2i_RSA_PUBKEY_bio
  - d2i_X509_REQ_INFO
  - X509_REQ_INFO_free
  - ASN1_TIME_set_string_X509
2024-09-02 10:01:12 +02:00
Sergey Fedorov 2ddfe15c4f Fix libdispatch usage condition 2024-09-01 21:03:18 +08:00
Sergey Fedorov ef2424336c sp_int.c: fix ppc asm for macOS 2024-09-01 20:17:11 +08:00
Sergey Fedorov b6bfae9c24 asm.c: fix ppc asm for macOS 2024-09-01 20:17:11 +08:00
Colton Willey 2bcfff3497 Expand testing to include SW implementation of RSA with padding callback, code cleanup to address review comments. 2024-08-30 13:41:51 -07:00
David Garske 13ec0f0694
Merge pull request #7916 from SparkiDev/riscv-sha3-asm
RISC-V ASM: SHA-3
2024-08-30 09:06:36 -07:00
Sean Parkinson d475ecc8d3
Merge pull request #7917 from douzzer/20240828-WOLFSSL_DEBUG_TRACE_ERROR_CODES-TLS
20240828-WOLFSSL_DEBUG_TRACE_ERROR_CODES-TLS
2024-08-30 14:12:20 +10:00
Daniel Pouzzner 4b4000bf61
Merge pull request #7903 from SparkiDev/ecc_sigalgo_params_null
Certificates: ECC signature algorithm parameter
2024-08-29 16:16:08 -05:00
Daniel Pouzzner 17870d4159 src/internal.c: in wolfSSL_ERR_reason_error_string(), add missing error string for SCR_DIFFERENT_CERT_E.
wolfssl/ssl.h, wolfssl/error-ssl.h, wolfssl/wolfcrypt/error-crypt.h, wolfcrypt/src/error.c, and src/internal.c:
* fix values of WOLFSSL_ERROR_SSL and WOLFSSL_ERROR_WANT_X509_LOOKUP to match OpenSSL values;
* move legacy CyaSSL compat layer error codes from ssl.h to error-ssl.h and renumber them to conform to existing sequence;
* move enum IOerrors from ssl.h to error-ssl.h to get picked up by support/gen-debug-trace-error-codes.sh;
* add to enum wolfSSL_ErrorCodes negative counterparts for several positive error return constants;
* include error-ssl.h from ssl.h;
* add label (wolfCrypt_ErrorCodes) to error-crypt.h enum, and in wc_GetErrorString(), use switch ((enum wolfCrypt_ErrorCodes)error) to activate switch warnings for missing enums;
* in wolfSSL_ERR_reason_error_string(), use switch((enum wolfSSL_ErrorCodes)error) to activate switch warnings for missing enums;
* in ssl.h, add special-case WOLFSSL_DEBUG_TRACE_ERROR_CODES macros for WOLFSSL_FAILURE;
* in error-crypt.h, add missing WOLFSSL_API attribute to wc_backtrace_render(); and
* harmonize gating of error codes, ssl.h / error-ssl.h / internal.c:wolfSSL_ERR_reason_error_string() / api.c:error_test().

tests/api.c:
* add error_test() adapted from wolfcrypt/test/test.c, checking all error strings for expected presence/absence and length, called from existing test_wolfSSL_ERR_strings().
* in post_auth_version_client_cb(), add missing !NO_ERROR_STRINGS gating.

add numerous WC_NO_ERR_TRACE()s to operand error code uses, cleaning up error traces in general, and particularly when WOLFSSL_DEBUG_TRACE_ERROR_CODES_ALWAYS.
* crypto lib (36),
* crypto test&benchmark (20),
* TLS lib (179),
* examples (122),
* linuxkm (3),
* tests/api.c (2272).
2024-08-29 14:22:56 -05:00
Anthony Hu 844d0ec558 Get rid of pqm4 in favour our own Kyber/MLDSA implementation 2024-08-29 13:23:39 -04:00
Reda Chouk 109e4c3dfb added missing wolfSSL_X509_NAME_free(dName) 2024-08-29 17:59:02 +02:00
Sean Parkinson 7c3d66ecd6 RISC-V ASM: SHA-3
Add assembly implementations of SHA-3.
Use VSRL_VX instead of two VSRL_VI operations as immediate is only 5
bits.
2024-08-29 17:58:02 +10:00
Daniel Pouzzner b178138d83 src/internal.c: in wolfSSL_ERR_reason_error_string(), add missing error string for SCR_DIFFERENT_CERT_E, and de-gate error strings previously gated on HAVE_HTTP_CLIENT.
tests/api.c: add error_test() adapted from wolfcrypt/test/test.c, checking all error strings for expected presence/absence and length, called from existing test_wolfSSL_ERR_strings().

wolfssl/ssl.h, wolfssl/error-ssl.h, and wolfssl/wolfcrypt/error-crypt.h:
* move several negative error return codes from ssl.h to error-ssl.h,
* renumber them to conform to existing sequence, and
* include error-ssl.h from ssl.h;
* add special-case WOLFSSL_DEBUG_TRACE_ERROR_CODES macros for WOLFSSL_FAILURE;
* add missing WOLFSSL_API attribute to wc_backtrace_render().

add numerous WC_NO_ERR_TRACE()s to operand error code uses, cleaning up error traces in general, and particularly when WOLFSSL_DEBUG_TRACE_ERROR_CODES_ALWAYS.
* crypto lib (36),
* crypto test&benchmark (20),
* TLS lib (179),
* examples (122),
* linuxkm (3),
* tests/api.c (2272).
2024-08-28 23:05:04 -05:00
Sean Parkinson a3e239c2ad Certificates: ECC signature algorithm parameter
Allow, with a define, ECC signature algorithm parameters to be NULL and
not just empty.
Only for interop.
2024-08-28 11:10:41 +10:00
Sean Parkinson 652158fcac Dilithium: Support FIPS 204 Draft
Compile with WOLFSSL_DILITHIUM_FIPS204_DRAFT to get code that implements
the FIPS-204 August 2023 DRAFT.
Alternatively, --enable-dilithium=draft or
--enable-dilithium=fips204-draft
2024-08-28 11:02:01 +10:00
Colton Willey b7299a23c0 Add new crypto callback for RSA with padding. 2024-08-27 13:09:23 -07:00
Daniel Pouzzner 90152fedda
Merge pull request #7902 from gasbytes/wc_pkcs7_decodeauthenvelopeddata-problem
Added check on error out from wc_PKCS7_EncodeAuthEnvelopedData
2024-08-27 00:40:21 -05:00
Daniel Pouzzner 2537e08a99
Merge pull request #7890 from embhorn/zd18463
Various Coverity fixes
2024-08-26 23:34:23 -05:00
Reda Chouk 25dd8b641e added check on error out from wc_PKCS7_EncodeAuthEnvelopedData 2024-08-26 19:29:06 +02:00
Sean Parkinson 60f438f0c3 Dilithum, Kyber: Update to final specification
FIPS 203 and FIPS 204 final specification changes.
2024-08-26 17:42:27 +10:00
Daniel Pouzzner 3f0ba97d1e
Merge pull request #7893 from gojimmypi/pr-asn-allow-zero-serial
Introduce WOLFSSL_ASN_ALLOW_0_SERIAL
2024-08-23 21:09:41 -05:00
Daniel Pouzzner 1d34b565fa
Merge pull request #7891 from SparkiDev/test_fixes_2
Test fixes
2024-08-23 21:08:44 -05:00
Daniel Pouzzner a39f521f7f
Merge pull request #7884 from dgarske/x86_notwindows
Fixes for building x86 in Visual Studio for non-windows OS
2024-08-23 17:38:30 -05:00
Eric Blankenhorn 6dab58266d Various Coverity fixes 2024-08-23 16:09:18 -05:00
gojimmypi 8baf39310f
Introduce WOLFSSL_ASN_ALLOW_0_SERIAL 2024-08-22 12:30:15 -07:00
Sean Parkinson 08d8a74992 Test fixes
api.c:
	Update #ifdefs.
sp_int.c:
	Fix free call when hardening is disabled.
2024-08-22 16:09:22 +10:00
Sean Parkinson e99bbf9429
Merge pull request #7875 from douzzer/20240814-debug-trace-errcodes-MP
20240814-debug-trace-errcodes-MP
2024-08-22 10:10:45 +10:00
Daniel Pouzzner 05c4955316 linuxkm: add support for WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES using dump_stack(). 2024-08-20 23:36:07 -05:00
Daniel Pouzzner 0da78a7ee2 move several MP error codes from wolfssl/wolfcrypt/sp_int.h, wolfssl/wolfcrypt/tfm.h, and wolfssl/wolfcrypt/integer.h, to wolfssl/wolfcrypt/error-crypt.h, harmonizing their names and numbers.
wolfssl/wolfcrypt/error-crypt.h: add WC_FIRST_E.

wolfcrypt/src/error.c: add MP error code strings.

wolfssl/error-ssl.h: add WOLFSSL_FIRST_E and WOLFSSL_LAST_E.

wolfcrypt/test/test.c: update error_test() for new error code layout, refactoring the "missing" check.

src/internal.c: use WC_FIRST_E and WC_LAST_E  in wolfSSL_ERR_reason_error_string().

src/ssl.c: fix wolfSSL_ERR_GET_REASON() to identify in-range error codes using WC_FIRST_E, WC_LAST_E, WOLFSSL_FIRST_E, and WOLFSSL_LAST_E.

sp_int.h: provide for WOLFSSL_DEBUG_TRACE_ERROR_CODES, and refactor MP error codes as enums, for consistency with other error codes.

wolfcrypt/src/ecc.c: fix 2 identicalInnerCondition's.
2024-08-20 14:09:06 -05:00
Juliusz Sosinowicz 3260a9b680 Address code review 2024-08-20 10:53:44 +02:00
David Garske 294362a0b7 Fixes for building x86 in Visual Studio for non-windows OS. 2024-08-19 13:00:41 -07:00
Juliusz Sosinowicz a6a40de249 init sssd support
- Refactor OCSP to separate IO callback
- wolfSSL_BIO_reset: fix return
- CheckCertCRL_ex: return CRL_CERT_DATE_ERR instead of ASN_AFTER_DATE_E
- CheckCertCRL_ex: return most relevant error code
- i2d/d2i APIs: correct parameters handling and return codes
- Custom ASN1 structures: major refactor to make it much more versatile
- Use WOLFSSL_ASSERT_SIZEOF_GE where applicable
- wolfSSL_EVP_SignFinal: implement ecc
- wolfSSL_EVP_VerifyFinal: implement ecc
- OBJ_NAME_do_all: bring closer to OpenSSL functionality
- Correct return of *_push api
- Implement:
  - OCSP_REQ_CTX API
  - d2i_ECPKParameters
  - wolfSSL_sk_insert
  - OCSP_parse_url
  - X509_STORE_set1_param
  - X509_get0_subject_key_id
  - X509_OBJECT_retrieve_by_subject
  - OCSP_sendreq_nbio
2024-08-16 17:22:41 +02:00
David Garske 1190d1bafe
Merge pull request #7873 from SparkiDev/riscv-poly1305-asm
RISC-V 64 ASM: Add Poly1305 implementation
2024-08-15 09:40:06 -07:00
Sean Parkinson ccd8b9aa8d
Merge pull request #7872 from douzzer/20240814-linuxkm-kyber-asm
20240814-linuxkm-kyber-asm
2024-08-15 14:46:55 +10:00
Daniel Pouzzner 003ea8bff0
Merge pull request #7868 from dgarske/pq_xms_lmss
Fixes for building wolfBoot sources for PQ LMS/XMSS
2024-08-14 23:28:12 -05:00
Daniel Pouzzner a2acc41b3f wolfcrypt/src/wc_kyber.c: in kyberkey_encapsulate(), don't overallocate "at" for USE_INTEL_SPEEDUP. 2024-08-14 21:51:12 -05:00
Sean Parkinson 3ade7a875e RISC-V 64 ASM: Add Poly1305 implementation
Implementation using standard and vector instructions.
2024-08-15 09:01:34 +10:00
Daniel Pouzzner 7a29b1e4fd add comments explaining dependence on idempotency for race-free dynamics re checkedAESNI, haveAESNI, intel_flags, and sha_method. see #7863. 2024-08-14 15:23:48 -05:00
Daniel Pouzzner 1fa2d2d625 ASN: move DecodedCert.extSubjKeyIdSz and .extAuthKeyIdSz out of the OPENSSL_EXTRA gate. fixes test.c:certext_test(), broken by f8c968d8d1 for some valid configs. 2024-08-14 14:45:11 -05:00
Daniel Pouzzner 21484ec75a linuxkm: add asm support for Kyber. 2024-08-14 14:45:11 -05:00
Anthony Hu 498dadad97 Ensure correct issuer is copied into PKCS7 struct during verification 2024-08-14 11:29:02 -04:00
Daniel Pouzzner ee966beb77 wolfcrypt/src/evp.c: add wolfSSL_EVP_PKEY_is_a() and test_EVP_PKEY_is_a(). also add test_EVP_CIPHER_key_length() and add missing RC4 clause to wolfSSL_EVP_Cipher_key_length(). 2024-08-14 09:23:02 -05:00
David Garske 01eaa56290 Fixes for building wolfBoot sources for PQ LMS/XMSS.
* Don't throw `#error "This code requires libxmss"`, just gate ext_xmss on HAVE_LIBXMSS. Same for LMS.
2024-08-13 14:10:45 -07:00
Daniel Pouzzner 3875a1855e
Merge pull request #7859 from SparkiDev/aarch64_poly1305_asm_improv
Aarch64 Poly1305 ASM: Improve performance
2024-08-12 18:35:49 -05:00
Daniel Pouzzner 7fac450c92
Merge pull request #7860 from dgarske/have_config
Add missing config.h on .c files
2024-08-12 18:33:04 -05:00
David Garske 537827ebde Add missing config.h on some .c files. 2024-08-12 09:29:07 -07:00
Sean Parkinson 3725594020 Aarch64 Poly1305 ASM: Improve performance
Do as many multiplications in base 64 rather than 26 with normal integer
registers.
2024-08-12 12:47:44 +10:00
JacobBarthelmeh 85bab19090
Merge pull request #7845 from ColtonWilley/pkcs7_digest_absent_params
Add option for absent hash params in PKCS7
2024-08-09 15:56:28 -06:00
Daniel Pouzzner 656ba24de5
Merge pull request #7852 from SparkiDev/sp_no_rng_fix
SP: no RNG fix
2024-08-09 15:00:15 -05:00
Daniel Pouzzner e142b16ae2
Merge pull request #7848 from miyazakh/fips_wcPBKDF2ex
Check klen in byte in wc_PBKDF2_ex
2024-08-09 14:49:53 -05:00
Daniel Pouzzner 034e13298f
Merge pull request #7847 from SparkiDev/sp_xfree_2
SP: Remove check of NULL before XFREE
2024-08-09 14:47:05 -05:00
Sean Parkinson 17a09d9853 SP: no RNG fix
Don't use RNG API when WC_NO_RNG is defined.
2024-08-09 10:18:12 +10:00
Daniel Pouzzner 24e34aa41a wolfcrypt/src/logging.c: in WOLFSSL_BUFFER(), on averted overrun, log a buffer error rather than silently failing; in wc_backtrace_render(), fix !WOLFSSL_MUTEX_INITIALIZER race mitigation code. 2024-08-08 10:49:05 -05:00
Daniel Pouzzner f5e775fe95 wolfcrypt/src/wc_kyber.c: fixes for null derefs (nullPointerRedundantCheck) in wc_KyberKey_MakeKeyWithRandom() and wc_KyberKey_Decapsulate() added in d350ba6c41. 2024-08-08 09:13:56 -05:00
Daniel Pouzzner 763ced668e fixes for defects identified by cppcheck and clang-tidy on --enable-debug builds: null deref in tests/api.c:load_pem_key_file_as_der(), redundant declarations in wolfcrypt/benchmark/benchmark.c, and numerous unchecked XSNPRINTF()s in wolfcrypt/src/logging.c and src/internal.c. 2024-08-08 09:00:42 -05:00
Daniel Pouzzner 5f6067c3e1 add --enable-debug-trace-errcodes=backtrace.
* uses libbacktrace to enhance existing "ERR TRACE" messages with backtraces, rendered in same format as the sanitizers.
* adds wc_backtrace_render() and some related callbacks to wolfcrypt/src/logging.c.
* adds an overrideable WOLFSSL_DEBUG_BACKTRACE_RENDER_CLAUSE to the WC_ERR_TRACE() mechanism in wolfssl/wolfcrypt/error-crypt.h.
2024-08-08 09:00:42 -05:00
Hideki Miyazaki 180ad206fc check klen in byte 2024-08-08 08:52:08 +09:00
Sean Parkinson abc910c03c SP: Remove check of NULL before XFREE
Removed more checks of NULL before XFREE.
Formatting fixes as well.
2024-08-08 09:36:05 +10:00
Daniel Pouzzner 92952a5538
Merge pull request #7839 from bandi13/noIfXFREE
No if xfree
2024-08-07 17:08:12 -05:00
Andras Fekete 38d191c159 More PR comment fixes 2024-08-07 16:56:57 -04:00
Colton Willey 75c3030554 Add option for absent hash params in PKCS7 2024-08-07 11:07:45 -07:00
Andras Fekete a31d8c5ce7 Addressing PR comments 2024-08-07 11:14:15 -04:00
Sean Parkinson 632d9653da
Merge pull request #7842 from embhorn/zd18417
Fix template DecodeSubjDirAttr to set extSubjDirAttr data
2024-08-07 18:29:04 +10:00
Sean Parkinson 18aa2b8d78
Merge pull request #7843 from dgarske/fix_sp_small_gcc
Fix for SP small calling label with GCC
2024-08-07 09:23:46 +10:00
Daniel Pouzzner 6116d5edb4
Merge pull request #7824 from anhu/maxq10xx_update
Update to the maxq10xx support
2024-08-06 18:01:39 -05:00
Sean Parkinson 2cc5ecf117
Merge pull request #7759 from JacobBarthelmeh/poly1305
w64wrapper for poly1305
2024-08-07 07:31:25 +10:00
David Garske 91ea7ab206 Fix for SP small calling label with GCC (broken in PR #7753). 2024-08-06 11:05:40 -07:00
David Garske a30d9c9818
Merge pull request #7833 from SparkiDev/riscv-sha512-asm
RISC-V 64: Add assembly code for SHA-512
2024-08-06 10:39:10 -07:00
Anthony Hu 29a5cc39f2 Duplicate code removed 2024-08-06 10:19:09 -07:00
Anthony Hu 3cf3f297ba Update to the maxq10xx support 2024-08-06 10:19:09 -07:00
Eric Blankenhorn 1c2b47d8ad Fix template DecodeSubjDirAttr to set extSubjDirAttr data 2024-08-06 11:34:14 -05:00
JacobBarthelmeh f1ace62363 add null sanity check and adjust add 2024-08-06 09:12:17 -06:00
Andras Fekete f419e2351b Remove NULL test with 'ptr = NULL' at the end 2024-08-06 10:55:37 -04:00
Andras Fekete d350ba6c41 remove NULL test with XFREE arguments with dereference 2024-08-06 10:44:59 -04:00
Andras Fekete d6a7187538 Programmatically remove NULL test with { XFREE() } 2024-08-06 10:37:43 -04:00
Andras Fekete eb0c64d79a Remove NULL test when there is a dereference 2024-08-06 10:29:02 -04:00
Andras Fekete d7a0f49906 Programmatically remove NULL test before XFREE 2024-08-06 10:20:45 -04:00
Sean Parkinson 4062b94fb3 RISC-V 64: Add assembly code for SHA-512
Cleanup RISC-V 64 SHA-256 by removing unused rev_idx.
2024-08-06 10:21:48 +10:00
JacobBarthelmeh cc2ed4a75b add w64Add for build with word64 2024-08-05 16:47:35 -06:00
Sean Parkinson fc19c36bf8 Dilithium: fix check hint
When all indeces are 0, then don't check hints against indeces.
2024-08-06 08:22:47 +10:00
Daniel Pouzzner d65be7af21 wolfcrypt/src/asn.c and wolfssl/wolfcrypt/asn.h: in SetDNSEntry(), defer XFREE(dnsEntry, ...) until end (fixes double free); add PBE_NONE to enum PBESTypes; in EncryptContent(), initialize id to PBE_NONE to fix a -Wmaybe-uninitialized (CheckAlgo() can leave it unchanged even when returning success). 2024-08-04 15:41:52 -05:00
Daniel Pouzzner 9aa0742baa
Merge pull request #7798 from dgarske/asn_macros
ASN macro simplification

merged with github CI tests failing due to unrelated upstream changes (same tests all previously succeeded on this PR, with only 25d14f1937 added in the meantime).

supplementary testing with `wolfssl-multi-test.sh ... super-quick-check` after rebase on then-current `master` 15e99c8eff.
2024-08-02 16:36:50 -05:00
David Garske 25d14f1937 Fail with NOT_COMPILED_IN if someone tries to use ConfirmSignature with NO_ASN_CRYPT. Also default to signature failed. 2024-08-02 08:25:15 -07:00
Sean Parkinson 423c1d3e57 fixup 2024-08-02 11:58:50 +10:00
David Garske 65283fb9bb Improvement for the --enable-asn=nocrypt. Note: This option skips certificate signature checking, so make check TLS expected failures do not pass. Cleanup of the api.c headers / macros. 2024-08-01 10:27:22 -07:00
Sean Parkinson ebb49b6e68 RISC-V ChaCha20: assembly implementations
ChaCha20:
  scalar and vector implementations
  vector implementations doing 6, 4, 2, 1 block at a time.
  scalar implemetations using roriw and pack
  vector implementations using VROR_VI and roriw.

RISC-V SHA-256: avoid using s0 if it can be helped.
2024-08-01 17:51:59 +10:00
Sean Parkinson 1bc085358a
Merge pull request #7817 from dgarske/wildcard_c
Fix for .c files to ensure macro guards for wildcard
2024-08-01 08:46:35 +10:00
David Garske 1dd94bb0cb Fix for .c files to ensure macro guards for wildcard. 2024-07-31 14:23:05 -07:00
Daniel Pouzzner 6017c86e5d wolfcrypt/src/wc_port.c: fix -Wconversions in wc_strdup_ex(). 2024-07-31 19:36:59 +00:00
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 6a1139a6ee
Merge pull request #7758 from SparkiDev/riscv-sha256-asm
RISC-V 64: Add assembly code for SHA-256
2024-07-30 16:23:57 -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
András Fekete 50d60bf0e7
Code sonar cleanup (#7782)
* Fix Warning 826814.9284764
* Fix Warning 826836.9285316
Co-authored-by: Andras Fekete <andras@wolfssl.com>
2024-07-30 09:42:43 -07:00
Sean Parkinson f1e01e4636 RISC-V 64: Add assembly code for SHA-256
Move common defines out of AES file to header file.
2024-07-30 12:21:13 +10: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