Commit Graph

2720 Commits (a18d0161efb0cd4615223da89866945ae9d05e7b)

Author SHA1 Message Date
David Garske a18d0161ef Fixes for minor implicit cast warnings and line length. Also fixed benchmark.c error without ChaCha and unused encrypt_only. 2024-08-01 15:26:02 -07: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
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
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 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
David Garske 5e58affd5d
Merge pull request #7789 from SparkiDev/test_ssl_load
SSL loading of keys/certs: testing and fixes
2024-07-26 11:48:13 -07: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
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 73dc9baaf9 Stop testing custom extensions in dual alg cert tests. 2024-07-25 16:09:19 -04:00
aidan garske 55540d03e7 fix for PR#7786 BUFFER_E bad case 2024-07-25 09:03:19 -07:00
aidan garske dace3acd4d api.c and asn.c changes to allow 0 to be passed in and expanded coverage on test cases
(cherry picked from commit 8572f67e60d419ddd74d4a2b7051dcaa7d0ca6b4)
2024-07-25 08:09:37 -07:00
Sean Parkinson a34ea32f52
Merge pull request #7730 from anhu/unknownExtCallbackEx
Extend the unknown extension callback.
2024-07-24 08:37:44 +10: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 851bb34f3c
Merge pull request #7762 from ColtonWilley/increase_default_max_alt_names
Increase default max alt names from 128 to 1024
2024-07-19 07:37:50 -07:00
Colton Willey a82b76978e Modify max altname test to run if limit has been lowered 2024-07-18 11:28:11 -07:00
Colton Willey 7434092a3a Increase default max alt names from 128 to 1024 2024-07-18 11:11:38 -07:00
jordan 6a745518bc Misc cleanup: FreeX509 null pointer checks, and spelling cleanup. 2024-07-17 10:04:52 -05:00
Daniel Pouzzner 5298039d09 fixes from peer review: move OS-specific code from wolfSSL_BIO_read() and wolfSSL_BIO_write() to wolfIO_Recv(), wolfIO_Send(), wolfIO_RecvFrom(), and wolfIO_SendTo(); add SOCKET_ETIMEDOUT definitions to wolfio.h; misc cleanups. 2024-07-16 19:12:19 -05:00
Daniel Pouzzner 0a928ead3f address peer review around WOLFSSL_HAVE_BIO_ADDR:
refactor housekeeping for bio->bytes_read and bio->bytes_write, and add WOLFSSL_BIO_HAVE_FLOW_STATS gate;

add WOLFSSL_BIO_FLAG_RETRY housekeeping for WOLFSSL_BIO_SOCKET and WOLFSSL_BIO_DGRAM;

refactor WOLFSSL_BIO.peer_addr to be inline rather than a pointer;

add wolfSSL_set_mtu_compat() and wolfSSL_CTX_load_verify_locations_compat() implementations;

enable WOLFSSL_HAVE_BIO_ADDR and WOLFSSL_DTLS_MTU when OPENSSL_ALL.
2024-07-16 19:12:18 -05:00
Daniel Pouzzner 7216a543dd checkpoint: complete test_wolfSSL_BIO_datagram(); fix some WOLFSSL_HAVE_BIO_ADDR gates to also gate on WOLFSSL_DTLS and OPENSSL_EXTRA; use DTLS_RECVFROM_FUNCTION, DTLS_SENDTO_FUNCTION, SOCKET_T, SOCKADDR, SOCKADDR_IN, and SOCKADDR_IN6 macros and types, and add SOCKADDR_UN type. 2024-07-16 19:12:18 -05:00
Daniel Pouzzner bd7f7c8bdf checkpoint: add wolfSSL_BIO_ADDR_free to wolfSSL_BIO_free(); tweak EXPECT_SUCCESS() to tolerate TEST_SKIPPED; add WIP test_wolfSSL_BIO_datagram. 2024-07-16 19:12:18 -05:00
Eric Blankenhorn 1112751654 mosquitto workflow update 2024-07-16 10:28:40 -05:00
Sean Parkinson 0d8763be57
Merge pull request #7665 from anhu/lighty-debug
Don't do multithreaded logging tests if single threaded
2024-07-16 09:28:11 +10:00
JacobBarthelmeh baec0ced59
Merge pull request #7731 from ColtonWilley/zephyr_tls_support
Changes needed for default TLS support in zephyr kernel
2024-07-11 16:46:43 -06:00
Colton Willey 978456e39d Remove get cipher bytes from header 2024-07-11 14:51:38 -07:00
Colton Willey 7b089f548e Remove get cipher list bytes 2024-07-11 14:39:44 -07:00
Sean Parkinson 0979fe8fea
Merge pull request #7709 from JacobBarthelmeh/staticmemory
fix test case for lean static memory build
2024-07-11 09:51:35 +10:00
Anthony Hu e581930cb7 Extend the unknown extension callback.
This will allow the user to pass in a context pointer. Allows them to avoid
global variables.

We also add unknown extensions callback when processing a CA in cert manager
as CA certs can have unknown extensions as well.

Fixes ZD 18252
2024-07-10 13:22:19 -04:00
JacobBarthelmeh 204668778b
Merge pull request #7733 from SparkiDev/coverity_3
Coverity fixes
2024-07-10 10:01:29 -06:00
Sean Parkinson fea7a89b86 Coverity fixes
pk.c:
	EncryptDerKey - setting wrong ret value on allocation failure.
	wolfssl_rsa_generate_key_native - now checks e is a valid long
before passing in.
	Fix formatting.

ssl_load.c:
	ProcessBufferPrivPkcs8Dec - now checking password is not NULL
before zeroizing. Allocation may fail and ForceZero doesn't check for
NULL.
	Fix formatting.

tests/api.c:
	test_RsaSigFailure_cm - Check cert_sz is greater than zero
before use.
	send_new_session_ticket - assert that building the message
doesn't return error or 0.
	test_ticket_nonce_malloc - fix setting of medium and big to use
preprocessor. Fix big to be medium + 20.

asn.c:
	GetLength_ex - Fix type of bytes so that it can go negative.

sp_int.h:
	sp_clamp - add one to ii while it is a signed.
	Fix formatting.
2024-07-10 11:40:48 +10:00
Colton Willey 4ec07bb5a8 Changes needed for default TLS support in zephyr kernel 2024-07-09 12:00:34 -07:00
Sean Parkinson d1e26b4f5d Dilithium: fixes
Fix inclusion of functions dilithium_vec_check_low() in build:
--enable-dilithium=verify-only,44,65,87
CFLAGS=-DWOLFSSL_DILITHIUM_VERIFY_SMALL_MEM
Fix memory leaks in unit.test:
--enable-dilithium CFLAGS=-DWC_DILITHIUM_CACHE_MATRIX_A 'CC=clang
-fsanitize=address'
2024-07-08 15:02:43 +10:00
JacobBarthelmeh fee9788bb0 fix for coverity report 394710 2024-07-05 15:40:47 -06:00
JacobBarthelmeh 5ca9b2f8a4
Merge pull request #7712 from SparkiDev/kyber_ml_kem
KYBER/ML-KEM: make ML-KEM available
2024-07-05 09:15:08 -06:00
Sean Parkinson 1fd9f2af91 KYBER/ML-KEM: make ML-KEM available
Added ML-KEM instead of Kyber implementation with WOLFSSL_ML_KEM.
Tests added from NIST for ML-KEM operations.
2024-07-04 23:51:23 +10:00
Sean Parkinson 387f36657c Dilithium: Add KATs and fix key generation
Add KATs from NIST and fix key generation to produce output of KATs.
2024-07-04 22:22:11 +10:00
Anthony Hu 4c13834500 Don't do multithreaded logging tests if single threaded 2024-07-03 19:31:21 -04:00
JacobBarthelmeh a8780d4a80 fix test case for lean static memory build 2024-07-03 11:25:05 -06:00
JacobBarthelmeh 6409b68b21
Merge pull request #7698 from dgarske/asan_compat_list
Fix ASAN warning with compatibility layer cipher list parsing
2024-07-02 17:12:38 -06:00
JacobBarthelmeh a490d4fdf7
Merge pull request #7628 from SparkiDev/alert_after_ch
TLS: wrong TLS version in alert after ClientHello
2024-07-02 17:10:24 -06:00
Sean Parkinson 1e3f623ff3 Regression testing: fix compilation for unusual configs
Disable ECC but have OPENSSL_EXTRA and curve25519 - fix #ifdef
protection in ssl.c.

tests/api.c:
SSL_SESSION_get_max_fragment_length is not available when no session
cache.
ASN1 APIs using generalized time disabled when NO_ASN_TIME defined so
disable tests.
2024-07-01 21:52:56 +10:00
David Garske 7faf0dccc7 Fix for ASAN warning with compatibility layer lists in `ParseCipherList` and `CheckcipherList` (ZD 18175). Add test case for ASAN to trigger NULL + 1 warning. Cleanup messy `WOLFSSL_TIRTOS` in api.c. 2024-06-28 15:26:40 -07:00
Sean Parkinson 4d56cc1790 Regression testing: memory allocation failure
Fixes from memory allocation failure testing.
Also:
fix asn.c to have ifdef protection around code compiled in with dual
algorithm certificates.
  fix test_tls13_rpk_handshake() to support no TLS 1.2 or no TLS 1.3.
fix wc_xmss_sigsleft() to initialize the index to avoid compilation
error.
2024-06-27 17:17:53 +10:00
jordan 394948ce94 Fix Infer issues. 2024-06-24 20:44:33 -05:00
Sean Parkinson a094831e1a Dilithium: C code optimized
Changes to get best out of 32-bit ARM chips.
Fixes come compile errors when cutting out functions.
WOLFSSL_DILITHIUM_SIGN_CHECK_Y and WOLFSSL_DILITHIUM_SIGN_CHECK_W0 added
to speed up signing. No longer specification conformat when either used.
2024-06-24 16:37:43 +10:00
David Garske d545253df7
Merge pull request #7594 from JacobBarthelmeh/socat
Updating socat version support
2024-06-20 09:17:41 -07:00
Daniel Pouzzner 38c7327660
Merge pull request #7622 from SparkiDev/ml-dsa
Dilithium/ML-DSA: Implementation of ML-DSA-44/65/87
2024-06-19 13:32:35 -04:00