Commit Graph

22936 Commits

Author SHA1 Message Date
Tobias Frauenschläger
e2b642d4ab WolfSSL Kyber and CMake fixes
* Make sure wc_kyber implementation is compiled using CMake (also for
  Zephyr)
* Fix compilation issue when Liboqs is also enabled
* Fix WOLFSSL_INTEL_ASM and WOLFSSL_ARM_ASM CMake options

Signed-off-by: Tobias Frauenschläger
<tobias.frauenschlaeger@oth-regensburg.de>
2024-07-24 09:55:29 +02:00
David Garske
a9ff7730ce
Merge pull request #7772 from douzzer/20240719-test-hpke-PRIVATE_KEY_UNLOCK
20240719-test-hpke-PRIVATE_KEY_UNLOCK
2024-07-20 11:44:08 -07:00
Daniel Pouzzner
765231060e wolfcrypt/test/test.c: add missing PRIVATE_KEY_UNLOCK() for hpke_test(). 2024-07-19 18:31:01 -05:00
Daniel Pouzzner
6952d1a5ea wolfssl/wolfcrypt/error-crypt.h: add NO_STDIO_FILESYSTEM definition for WC_ERR_TRACE(). 2024-07-19 18:30:31 -05:00
David Garske
33f71f6f60
Merge pull request #7770 from bandi13/fixWolfEngineFlag
Fix the actual definition of the ECC_MIN_KEY_SZ
2024-07-19 14:37:55 -07:00
David Garske
575df43889
Merge pull request #7768 from JacobBarthelmeh/copyright
update copyright to 2024
2024-07-19 14:27:39 -07:00
David Garske
4d8a6b84fb
Merge pull request #7760 from douzzer/20240718-BIO_DGRAM-memory-leak
20240718-BIO_DGRAM-memory-leak
2024-07-19 14:24:30 -07:00
David Garske
16a2d2e71d
Merge pull request #7769 from douzzer/20240719-PQ-fixes
20240719-PQ-fixes
2024-07-19 14:20:33 -07:00
Andras Fekete
c3d30e7987 Fix the actual definition of the ECC_MIN_KEY_SZ 2024-07-19 16:01:56 -04: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
Daniel Pouzzner
e13a8ddcfb fixes for null derefs in native Dilithium and Kyber implementations, detected by unit.test and cppcheck. 2024-07-19 14:35:39 -05:00
Daniel Pouzzner
0aa0f26289 wolfcrypt/src/dilithium.c: fix null deref in wc_dilithium_init_ex(). 2024-07-19 14:25:53 -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
74d4ae0075
Merge pull request #7704 from aidangarske/PKCS7_PEM
Added PKCS7 PEM support:
2024-07-19 07:39:51 -07:00
David Garske
3e02a70c07
Merge pull request #7707 from JacobBarthelmeh/psk
use max key length for PSK encrypt buffer size
2024-07-19 07:38:57 -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
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
David Garske
8bf2fb0ae0
Merge pull request #7765 from Laboratory-for-Safe-and-Secure-Systems/dilithium_fixes
Dilithium fixes
2024-07-19 07:36:05 -07:00
David Garske
b3c812921a
Merge pull request #7764 from gojimmypi/pr-asn-update
minor asn update: comments, code format, dateType check in CheckDate.
2024-07-19 07:35:02 -07:00
Tobias Frauenschläger
f87849b6f6 Dilithium fixes
* Fixed incorrect XFREE calls
* Use key->heap where possible
* Fixed compilation with WOLFSSL_DILITHIUM_VERIFY_SMALL_MEM and
  WC_DILITHIUM_CACHE_PUB_VECTORS
* Fixed compilation with WOLFSSL_DILITHIUM_ASSIGN_KEY (const pointers)

Signed-off-by: Tobias Frauenschläger
<tobias.frauenschlaeger@oth-regensburg.de>
2024-07-19 07:52:14 +02:00
gojimmypi
8356b349a5
minor asn update: comments, code format, dateType check in CheckDate. 2024-07-18 18:25:53 -07:00
Sean Parkinson
e6fcd488a6
Merge pull request #7685 from dgarske/renesas_rx_tsip
Renesas RX TSIP ECDSA support
2024-07-19 10:53:00 +10:00
Sean Parkinson
47dcac657c
Merge pull request #7763 from douzzer/20240718-cppcheck-2v14v2-suppressions
20240718-cppcheck-2v14v2-suppressions
2024-07-19 10:03:04 +10:00
David Garske
4eab0f1231 Fix hard coded values in TSIP ECC verify. Fix issues with tab indentation and spelling. 2024-07-18 16:45:27 -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
Hideki Miyazaki
945a24e5b4 fix compile error 2024-07-19 06:41:17 +09: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
Kareem
3492caba51 Fix not calling the signing callback when using PK callbacks + TLS 1.3. 2024-07-18 10:33:19 -07:00
Sean Parkinson
27c3140c2b
Merge pull request #7757 from douzzer/20240717-fixes
20240717-fixes
2024-07-18 10:41:03 +10: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
Sean Parkinson
ec9fcf5353
Merge pull request #7648 from douzzer/20240418-exosip-apis
20240418-exosip-apis
2024-07-17 22:59:34 +10:00
David Garske
bbd8fdfc38 Cleanup Renesas RX default devId and improve logic for overflow check. 2024-07-16 17:48:16 -07: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
Daniel Pouzzner
9023aeef75 BIO/wolfio: refactor TranslateReturnCode(), wolfSSL_LastError(), and TranslateIoError() into complete+consistent wolfSSL_LastError() and TranslateIoReturnCode(), handling all special cases correctly, and correctly returning WOLFSSL_CBIO_ERR_WANT_WRITE and WOLFSSL_CBIO_ERR_TIMEOUT. use TranslateIoReturnCode() directly in wolfIO_Recv(), wolfIO_Send(), wolfIO_RecvFrom(), wolfIO_SendTo(), and remove now-superfluous TranslateIoError() calls from EmbedReceive(), EmbedSend(), EmbedReceiveFrom(), EmbedSendTo(), EmbedReceiveFromMcast(). 2024-07-16 19:12:19 -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
0c1163f01f src/bio.c: restore inadvertently removed update of bio->connected in wolfSSL_BIO_ctrl() case BIO_CTRL_DGRAM_SET_CONNECTED. 2024-07-16 19:12:18 -05:00
Daniel Pouzzner
9e99544315 wolfssl/ssl.h: fix double-WOLFSSL_API on wolfSSL_CTX_load_verify_locations_compat(). 2024-07-16 19:12:18 -05:00
Daniel Pouzzner
1159fc333f src/bio.c: in wolfSSL_BIO_ADDR_size(), add missing gate on HAVE_SYS_UN_H for AF_UNIX. 2024-07-16 19:12:18 -05:00
Daniel Pouzzner
51c49b678e src/bio.c: fix gating for WOLFSSL_BIO_DGRAM handling. 2024-07-16 19:12:18 -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
61eb6987d0 src/ssl.c: remove old version of wolfSSL_set_bio(). 2024-07-16 19:12:18 -05:00
Daniel Pouzzner
62db3533ae wolfSSL_CTX_load_verify_locations(): set up with OpenSSL-compatible behavior (WOLFSSL_LOAD_FLAG_IGNORE_ERR). 2024-07-16 19:12:18 -05:00
Daniel Pouzzner
2d370f3e4e wolfSSL_BIO_read(): return MEMORY_E if wolfSSL_BIO_ADDR_new() fails. 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