Commit Graph

7987 Commits

Author SHA1 Message Date
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
0ab1f1969d Merge pull request #7828 from miyazakh/zd18141_ocspv2multi
Sever side checks OCSP even if it uses v2 multi
2024-08-07 17:40:23 -05:00
Daniel Pouzzner
92952a5538 Merge pull request #7839 from bandi13/noIfXFREE
No if xfree
2024-08-07 17:08:12 -05:00
Andras Fekete
a31d8c5ce7 Addressing PR comments 2024-08-07 11:14:15 -04:00
Andras Fekete
101088c390 Fix potential NULL dereference 2024-08-06 12:35:01 -04:00
Andras Fekete
3a83c33499 Fix compilation error 2024-08-06 11:44:32 -04: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
Hideki Miyazaki
c947fc8fda sever side checks OCSP even if it uses v2 multi 2024-08-06 13:01:56 +09: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
Andras Fekete
a0b2da98e6 Remove if(ptr) XFREE(ptr) 2024-08-05 17:47:59 -04: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
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
1b8254d668 Merge pull request #7808 from Laboratory-for-Safe-and-Secure-Systems/preTBS_memory_leak
Fix memory leak in wc_GeneratePreTBS()
2024-08-01 08:47:47 +10:00
David Garske
54997837f4 Merge pull request #7805 from julek-wolfssl/wolfSSL_X509_REQ_add1_attr_by_NID-push-cleanup
wolfSSL_X509_REQ_add1_attr_by_NID: clean up push call for analyzers
2024-07-31 13:16:30 -07: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
Sean Parkinson
dbf88e4c73 Merge pull request #7779 from rizlik/ocsp-dfree-fix
ocsp: don't free ocsp request if saved in ssl->ctx->certOcspRequest
2024-07-31 09:31:42 +10:00
Sean Parkinson
ad76038b86 Merge pull request #7812 from dgarske/fix_tls12_secret_callback
Fix for TLS v1.2 secret callback, incorrectly detecting bad master secret
2024-07-31 09:29:09 +10: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
Sean Parkinson
31cb72ed8a Merge pull request #7788 from anhu/kyber_with_fips
Allow kyber to be built with FIPS
2024-07-31 09:04:29 +10:00
David Garske
1d9b86e2b0 Fix for TLS v1.2 secret callback, incorrectly detecting bad master secret. API test cleanups (no sleep needed). 2024-07-30 11:54:17 -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
Tobias Frauenschläger
36d01cdb9b Fix memory leak in wc_GeneratePreTBS()
In the wc_GeneratePreTBS() method (used for WOLFSSL_DUAL_ALG_CERTS
support), there was a workaround for alt names in certificates, as the
CopyDecodedToX509() method wasn't properly copying them. As a proper
copy mechanism is implemented now, we have to remove the workaround as
it now causes a memory leak of the copied values.

Signed-off-by: Tobias Frauenschläger
<tobias.frauenschlaeger@oth-regensburg.de>
2024-07-30 10:38:48 +02: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
Juliusz Sosinowicz
2d5462d77d wolfSSL_X509_REQ_add1_attr_by_NID: clean up push call for analyzers 2024-07-29 18:18:07 +02:00
Marco Oliverio
31380aca13 fixup! ocsp: don't free ocsp request if saved in ssl->ctx->certOcspRequest 2024-07-29 15:00:41 +00:00
Sean Parkinson
caab2c2dca SSL loading of keys/certs: testing and fixes
Added tests to cover ssl_load.c functions.
Fixes from testing.
pk.c: renamed wolfssl_dh_load_key to wolfssl_dh_load_params as it
doesn't handle keys - just parameters.
2024-07-26 11:43:10 +10:00
Anthony Hu
181c408d17 Allow kyber to be built with FIPS 2024-07-24 20:36:51 -04:00
Sean Parkinson
a34ea32f52 Merge pull request #7730 from anhu/unknownExtCallbackEx
Extend the unknown extension callback.
2024-07-24 08:37:44 +10:00
Marco Oliverio
bb60c58800 ocsp: don't free ocsp request if saved in ssl->ctx->certOcspRequest 2024-07-23 16:02:07 +00:00
David Garske
7c6eb7c4a1 Merge pull request #7751 from SparkiDev/ecc_koblitz_ssl
ECC key load: fixes
2024-07-22 16:40:59 -07:00
David Garske
575df43889 Merge pull request #7768 from JacobBarthelmeh/copyright
update copyright to 2024
2024-07-19 14:27:39 -07:00
Daniel Pouzzner
787397b28e src/bio.c and related:
* refactor WOLFSSL_BIO.num and WOLFSSL_BIO.ptr as unions, for clarity and bug resistance (no functional changes).

* in wolfSSL_BIO_free(), add WOLFSSL_BIO_DGRAM to the test for closing bio->num.fd, fixing a descriptor leak.

* use SOCKET_INVALID consistently as the invalid value for WOLFSSL_BIO.num.fd, and use SOCKET_T consistently as the internal type for file descriptors.

* move the definitions for SOCKET_T and SOCKET_INVALID from wolfio.h to the filesystem section of wc_port.h, and allow override definitions of SOCKET_T.

detected and tested with wolfssl-multi-test.sh ... pq-hybrid-all-rpk-valgrind-unittest. also tested with wolfssl-multi-test.sh ... super-quick-check.
2024-07-19 14:50:26 -05:00
JacobBarthelmeh
31a6a2bf59 update copyright to 2024 2024-07-19 13:15:05 -06:00
David Garske
0eeae4da8c Merge pull request #6460 from embhorn/mosquitto_osp
Add support for Mosquitto OSP
2024-07-19 07:49:32 -07:00
David Garske
bd5586623a Merge pull request #7703 from SparkiDev/def_ticket_cbc_hmac
Default session ticket enc/dec: allow AES-CBC with HMAC
2024-07-19 07:41:27 -07:00
David Garske
08b211c3bb Merge pull request #7761 from kareem-wolfssl/zd18300
Fix not calling the signing callback when using PK callbacks + TLS 1.3.
2024-07-19 07:37:37 -07:00
David Garske
b5e188830d Merge pull request #7755 from philljj/misc_cleanup
Misc cleanup: FreeX509 null pointer checks, and spelling cleanup.
2024-07-19 07:37:24 -07:00
Daniel Pouzzner
4bc04673d1 suppress 4 uninitvar warnings, all associated with passing partially written arrays (true but benign positives). newly detected by cppcheck 2.14.2. 2024-07-18 17:22:17 -05:00
Kareem
3492caba51 Fix not calling the signing callback when using PK callbacks + TLS 1.3. 2024-07-18 10:33:19 -07:00
Daniel Pouzzner
c36ab59f24 fixes for defects identified by nightly testing:
* ecc.c: in wc_ecc_free(), fix gating around handling for key->sign_k to resolve memory leak, and in wc_ecc_gen_deterministic_k(), fix -Wconversion.

* test.c: add missing mp_free()s to ecdsa_test_deterministic_k_rs() and ecc521_test_deterministic_k().

* wc_HashType: change several occurrences of int to enum wc_HashType, including ecc_key.hashType and API wc_ecc_set_deterministic_ex(), to resolve C++ warnings.

* fixes for various C++ warnings/errors in crypto and TLS layers and test and benchmark code -- implicit casts, negative initializers for unsigned type, jumped initializers, and missing enums in switch()es.
2024-07-17 18:07:08 -05:00
jordan
6a745518bc Misc cleanup: FreeX509 null pointer checks, and spelling cleanup. 2024-07-17 10:04:52 -05:00
Daniel Pouzzner
ee7748f2e3 PR7648 20240418-exosip-apis peer review:
* tweak typography;
* move wolfSSL_i2d_X509_PUBKEY() from ssl.c to x509.c;
* in asn.h, add !NO_ASN_OLD_TYPE_NAMES macros to remap old names (ISSUER, SUBJECT, BEFORE, AFTER) by default unless the macros are already defined.
2024-07-16 19:12:19 -05:00