Commit Graph

23698 Commits

Author SHA1 Message Date
JacobBarthelmeh
beeda7bc6f Merge pull request #8100 from douzzer/20241022-cleanups
20241022-cleanups
2024-10-23 10:08:57 -06:00
Daniel Pouzzner
ea491b80ef tests/api.c: gate test_GENERAL_NAME_set0_othername() on OPENSSL_ALL, not OPENSSL_EXTRA, as it fails with --enable-all-crypto --enable-opensslextra, and is commented to require --enable-opensslall. 2024-10-23 00:02:29 -05: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
508555c927 configure.ac: add several missing low level crypto algorithms to all-crypto that are already included indirectly in enable-all. 2024-10-23 00:02:29 -05:00
Daniel Pouzzner
30181f2ced configure.ac: for reproducible-build, use --build-id=sha1, not --build-id=none, to support users relying on build-id in the linked object. 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
Daniel Pouzzner
6429315216 fix references to misnamed HAVE_SHA224, HAVE_SHA384, HAVE_SHA512 (correct names have WOLFSSL_ prefixes). 2024-10-23 00:02:28 -05:00
JacobBarthelmeh
43fe46cf24 Merge pull request #8099 from dgarske/armasm_aes
Fix issue with ARM ASM with AES CFB/OFB not initializing the "left" member
2024-10-22 17:29:45 -06: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
846ef1570d Merge pull request #8096 from philljj/fix_coverity_more
Fix more coverity errors.
2024-10-21 23:57:56 -05:00
Daniel Pouzzner
f8fc31e134 Merge pull request #8090 from gojimmypi/pr-visual-studio-2022
Add Visual Studio 2022 Project Files for wolfSSL, Test, & Benchmark
2024-10-21 23:56:57 -05:00
Daniel Pouzzner
805eaa90cc Merge pull request #7797 from julek-wolfssl/softhsm
Init SoftHSMv2 support
2024-10-21 23:56:12 -05:00
jordan
5fd9e99bbd coverity: don't overwrite obj in wolfSSL_X509_get_ext_d2i. 2024-10-21 20:49:34 -05:00
JacobBarthelmeh
b535d9f752 Merge pull request #8093 from philljj/fix_coverity
Fix coverity
2024-10-21 16:45:51 -06:00
gojimmypi
ee24446bee Add Visual Studio 2022 Project Files for wolfSSL, Test, & Benchmark 2024-10-21 14:05:51 -07:00
jordan
5690af82dc wolfcrypt test: fix double free. 2024-10-21 15:57:24 -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
38c337967e Merge pull request #8086 from bandi13/addDependency
Need 'libfile' for license.pl
2024-10-21 14:20:42 -05: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
JacobBarthelmeh
8a71c3b3db Merge pull request #8066 from gojimmypi/pr-espressif-wolfcrypt
Apply various Espressif compatibility updates
2024-10-21 11:36:24 -06: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
JacobBarthelmeh
ef063aac2f Merge pull request #8091 from julek-wolfssl/openvpn-action-update
openvpn action: remove v2.6.0 as certs have expired
2024-10-21 08:50:53 -06:00
Juliusz Sosinowicz
e1aba52e51 openvpn action: remove v2.6.0 as certs have expired 2024-10-21 13:50:36 +02:00
philljj
ea3a79e216 Merge pull request #8089 from douzzer/20241017-wc-delete-methods
20241017-wc-delete-methods
2024-10-19 11:07:19 -05: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
philljj
61b726fae7 Merge pull request #8088 from douzzer/20241016-dtls13-cleanup
20241016-dtls13-cleanup
2024-10-17 15:58:07 -04:00
Daniel Pouzzner
06de22e72b api.c:test_wolfSSL_dtls_stateless_maxfrag(): add missing condition (clang-analyzer-core.NullDereference). 2024-10-17 10:57:19 -05:00
Daniel Pouzzner
fa65da7bb0 analyzer-driven cleanups of --enable-dtls13 --enable-dtls-mtu --enable-dtls-frag-ch:
Dtls13HashClientHello(): fix wc_HashType handling;

Dtls13SendFragment(): fix identicalConditionAfterEarlyExit;

GetDtlsRecordHeader(): fix error handling around GetDtls13RecordHeader() (incorrectLogicOperator);

test_wolfSSL_dtls_stateless_maxfrag(): fix a clang-analyzer-core.NullDereference,
test_dtls_frag_ch(): fix a clang-diagnostic-embedded-directive,
test_AEAD_limit_client(): fix an united-data defect found by valgrind.
2024-10-17 00:06:32 -05:00
Daniel Pouzzner
abc6edf4c7 Merge pull request #7796 from SparkiDev/dtls_read_write_threaded
SSL asynchronous read/write and encrypt
2024-10-17 00:05:47 -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
Andras Fekete
4ca0176668 Need 'libfile' for license.pl 2024-10-16 17:37:17 -04:00
Daniel Pouzzner
9665434694 Merge pull request #8080 from SparkiDev/coverity_fix_5
Unit test: fix coverity issue
2024-10-16 16:31:27 -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
Daniel Pouzzner
a833d6e9b2 Merge pull request #8084 from anhu/kyber_levels
Correct kyber levels. Was copy and paste error.
2024-10-16 15:54:18 -05:00
jordan
115507e0c0 coverity: null check. 2024-10-16 13:08:06 -05:00
Anthony Hu
db6df887a6 Correct kyber levels. Was copy and paste error. 2024-10-16 13:39:57 -04:00
jordan
d6fe15af8c coverity: check mp_sub_d return values. 2024-10-16 11:23:33 -05:00
philljj
2abbab2fd8 Merge pull request #8082 from SparkiDev/bn_bin2bn_fix
BN API: fix BN_bin2bn to handle NULL data properly
2024-10-16 12:00:41 -04:00