Commit Graph

20175 Commits

Author SHA1 Message Date
Kareem
e871b1c04d Add hitch support to wolfSSL.
Add support for cipher aliases DHE, EDH and EECDH.

Add define SSL_CTRL_GET_CHAIN_CERTS to help hitch and other programs detect SSL_CTX_get0_chain_certs is supported.

Add wolfSSL_get_locking_callback.

Allow using ECDHE+RSA cipher suites when ECDHE alias is used while in OpenSSL compatibility mode.

Add more alerts for hitch.

SSL_CM should use the CTX's x509_store_pt if available.

Add support for SSL_CERT_FILE and SSL_CERT_DIR.  Load default OpenSSL TLS 1.3 ciphers when using OPENSSL_COMPATIBLE_DEFAULTS.

Use wolfSSL_sk_X509_new_null to allocate WOLFSSL_STACK in wolfSSL_CTX_get_extra_chain_certs.  Previous approach of malloc'ing without setting type/memsetting was leading to a segfault.

Add --enable-hitch.

hitch: Add unit tests for new APIs, fix a couple of issues uncovered by unit testing.

Correct behavior of wolfSSL_BIO_set_mem_buf for BIO_CLOSE/NOCLOSE and update unit test accordingly.

Add Github action test for hitch.
2023-07-10 10:06:10 -07:00
JacobBarthelmeh
9d18648dfb Merge pull request #6589 from SparkiDev/aarch64_aes_opensslextra_fix
AES GCM stream: arm asm fix when --enable-opensslextra
2023-07-10 10:55:50 -06:00
JacobBarthelmeh
2426cf14ca Merge pull request #6583 from SparkiDev/certman_split
Moved CertManager APIs into own file
2023-07-10 09:20:09 -06:00
Sean Parkinson
9f6ef65e8f Merge pull request #6557 from julek-wolfssl/zd/16332
Don't allow a resumption handshake inside of a SCR
2023-07-10 13:51:29 +10:00
Sean Parkinson
fa053be533 Merge pull request #6496 from JacobBarthelmeh/PKCS7
parse ASN1 only with SMIME_read_PKCS7
2023-07-10 10:16:20 +10:00
Sean Parkinson
360b61aff2 AES GCM stream: arm asm fix when --enable-opensslextra
aadLen is now in gcm field of Aes.
2023-07-10 10:13:26 +10:00
Sean Parkinson
52a3d591b5 Fix check of date to respect VERIFY_SKIP_DATE in ASN.1 template
DecodeCertInternal was not recognizing VERIFY_SKIP_DATE.
2023-07-10 10:05:59 +10:00
JacobBarthelmeh
9d3a95a287 account for error return in test case when building without pkcs7 streaming 2023-07-09 12:42:29 -07:00
JacobBarthelmeh
0e2749eeb4 adjust test case for asn=original 2023-07-08 07:37:26 -07:00
JacobBarthelmeh
7866a40d06 resolve kari decode without recipient certificate 2023-07-08 07:37:26 -07:00
JacobBarthelmeh
f0354b4cbe parse ASN1 only with SMIME_read_PKCS7 2023-07-08 07:36:10 -07:00
David Garske
770590a3be Rebase fix to add back set_verify call in CertManagerLoadCA. Fix API tests for bad date check. Various spelling fixes. 2023-07-07 15:08:08 -07:00
Sean Parkinson
3af87f6f93 Moved CertManager APIs into own file
Split out certificate manager APIs into ssl_certman.c.
ssl.c includes ssl_certman.c
Better test coverage.
Minor fixes.
wolfSSL_X509_chain_up_ref calls XFREE with name->heap but name may be
NULL. Check for NULL first.
2023-07-07 15:08:08 -07:00
David Garske
f2809c5a24 Merge pull request #6586 from julek-wolfssl/zephyr-action
Add zephyr testing github action
2023-07-07 14:54:07 -07:00
Juliusz Sosinowicz
c4cbf0508b Add zephyr action 2023-07-07 20:18:19 +02:00
JacobBarthelmeh
7213cb3cfb Merge pull request #6463 from dgarske/silabs_erf32
Updated support for Silicon Labs Simplicity Studio and the ERF32 Gecko SDK
2023-07-07 11:42:00 -06:00
David Garske
91fb24161b Merge pull request #6515 from julek-wolfssl/nginx-1.25.0
Add support for nginx-1.25.0
2023-07-07 09:29:23 -07:00
David Garske
9599ddd80a Merge pull request #6575 from julek-wolfssl/zd/15258
Properly enforce the pathLenConstraint of the BasicConstraints extension
2023-07-07 08:58:28 -07:00
David Garske
abe1bce914 Fix silabs_ecc_export_public to set the signing only flag. Added tests cases for import of private and public only verify in the SiLabs example. 2023-07-07 08:25:46 -07:00
Juliusz Sosinowicz
0abaa89787 Add support for nginx-1.25.0
- nginx: add necessary defines and function
- Implement Certificate Authorities for TLS 1.3
- Implement secret logging for TLS 1.3. Can be used for example with:
  ./configure CPPFLAGS="-DWOLFSSL_SSLKEYLOGFILE -DSHOW_SECRETS -DHAVE_SECRET_CALLBACK -DWOLFSSL_SSLKEYLOGFILE_OUTPUT='\"/tmp/secrets\"'"
- Implement session context checking for tickets
- Check for authorized responder in OCSP basic response
- Fix handling call to ocsp->statusCb
- compat: Translate SOCKET_PEER_CLOSED_E to WOLFSSL_ERROR_SYSCALL
- Fix wolfSSL_CTX_set_session_cache_mode
  - WOLFSSL_SESS_CACHE_OFF means nothing should be on
  - WOLFSSL_SESS_CACHE_NO_INTERNAL turns off only the internal cache
- Respect ssl->options.internalCacheOff
- Implement SSL_SESSION_set_time
- wolfSSL_SSL_in_init: fix detection for TLS 1.3
- Fix handling call to ssl->alpnSelect
- SendTls13NewSessionTicket: always generate new ID
  - When we send a new ticket for the same session (for example we resumed a connection and are sending a new ticket so that the client can resume in the future), we need to generate a new ID so that we don't overwrite the old session in the cache. Overwriting the session results in the `diff` calculation in `DoClientTicketCheck()` producing the wrong value and failing to resume.
Add nginx github action test
- Fix memory leaks
- wolfSSL_OCSP_basic_verify: implement OCSP_TRUSTOTHER flag
- AKID: implement matching on issuer name and serial number
- ocsp: check for a chain match for OCSP responder
- Split CreateTicket into CreateTicket and SetupTicket
- SendCertificateStatus: free response.buffer
- Use heap hint when allocating responseBuffer
- Remove responseBuffer from internal API's that don't use it anywhere
2023-07-07 11:22:58 +02:00
Sean Parkinson
52b5adb54a Merge pull request #6581 from kareem-wolfssl/eccNullKCheck
Fixed crash in wc_ecc_free.
2023-07-07 10:54:18 +10:00
David Garske
4d25faafe2 Merge pull request #6582 from SparkiDev/aes_gcm_arm_fix
AES-GCM ARM asm: fixes from GCM changes
2023-07-06 17:12:08 -07:00
Sean Parkinson
f3bae3192a Merge pull request #6580 from dgarske/sig_verify
Fix for `wc_SignatureGenerate_ex` calling verify twice
2023-07-07 08:40:39 +10:00
Sean Parkinson
af5b3b551a AES-GCM ARM asm: fixes from GCM changes
GCM is now its own structure.
GMULT, GHASH, GenerateM0 made public and fixed here too.
2023-07-07 08:35:14 +10:00
Juliusz Sosinowicz
2248140bf3 Clear ssl->arrays->sessionIDSz at start of function 2023-07-06 15:13:56 -07:00
Juliusz Sosinowicz
57e53d1a43 Don't allow a resumption handshake inside of a SCR 2023-07-06 15:13:56 -07:00
Kareem
fb9e036d5b Add NULL check in TFM's fp_forcezero. 2023-07-06 14:47:18 -07:00
Kareem
657679efda Only check for ALT_ECC_SIZE case, otherwise key->k is an array which will never be NULL. 2023-07-06 21:15:37 -07:00
Kareem
e995568626 Fixed crash in wc_ecc_free. 2023-07-06 21:10:32 -07:00
Juliusz Sosinowicz
2cf916581d Jenkins fixes 2023-07-06 19:55:54 +02:00
Juliusz Sosinowicz
c041863aaa Code review 2023-07-06 19:00:11 +02:00
Juliusz Sosinowicz
d2642e329d Properly enforce the pathLenConstraint of the BasicConstraints extension
- move the testsuite file helps into a new tests/utils.c file so that they can be used across all tests
- dump the raw TLS stream when WOLFSSL_DUMP_MEMIO_STREAM is defined so that it can be examined in Wireshark
2023-07-06 19:00:11 +02:00
David Garske
9ca53ac7f7 Fix for wc_SignatureGenerate_ex calling verify twice. 2023-07-06 09:34:03 -07:00
David Garske
fb0c769d6c Merge pull request #6578 from douzzer/20230705-analyzer-fixes
20230705-analyzer-fixes
2023-07-06 09:04:39 -07:00
David Garske
e8f3afc85b Merge pull request #6579 from julek-wolfssl/getsockopt-endianness
getsockopt needs to take in an int
2023-07-06 09:04:13 -07:00
David Garske
caa0e5aabf Fix for silabs_ecc_export_public to set the type (curve). 2023-07-06 08:57:02 -07:00
David Garske
794425c431 Merge pull request #6577 from SparkiDev/sm_update_1
SM tests: void in function declaration that is its prototype
2023-07-06 06:04:14 -07:00
Juliusz Sosinowicz
0b4e4287c9 getsockopt needs to take in an int
This caused an issue on big endian platforms

From the getsockopt man page:
       Most socket-level options utilize an int argument for optval.  For setsockopt(), the argument should be non‐
       zero to enable a boolean option, or zero if the option is to be disabled.
2023-07-06 11:40:36 +02:00
Daniel Pouzzner
1912f1bc2a fixes for clang-analyzer-core.NullDereference, clang-analyzer-core.NonNullParamChecker, clang-analyzer-deadcode.DeadStores, readability-redundant-preprocessor, clang-diagnostic-unreachable-code-break, -Werror=sign-conversion, bugprone-macro-parentheses, "Call to 'malloc' has an allocation size of 0 bytes", clang-diagnostic-declaration-after-statement re tests/unit.h:ExpectPtr() pragmas. 2023-07-06 00:53:37 -05:00
Sean Parkinson
7a73c9aac7 SM tests: void in function declaration that is its prototype
Need to have void in prototype of funtion.
2023-07-06 08:57:30 +10:00
David Garske
652c5491fe Merge pull request #6571 from julek-wolfssl/dtls-mtu-interop
Always add DTLS_MTU_ADDITIONAL_READ_BUFFER for better MTU interop
2023-07-05 13:03:10 -07:00
Juliusz Sosinowicz
b0c2e29a2e Always add DTLS_MTU_ADDITIONAL_READ_BUFFER for better MTU interop 2023-07-05 10:19:19 -07:00
David Garske
856b5c3f1b Merge pull request #6566 from JacobBarthelmeh/soname
update soname to 40
2023-07-05 09:21:10 -07:00
David Garske
f00b5c3a1e Merge pull request #6537 from SparkiDev/sm
SM2/SM3/SM4: Chinese cipher support
2023-07-04 10:03:37 -07:00
David Garske
b682c2c4bb Merge pull request #6437 from julek-wolfssl/windows-crl-monitor
Implement CRL monitor for Windows
2023-07-04 10:03:14 -07:00
Juliusz Sosinowicz
7af1f0cf05 Add additional windows logging for DoMonitor 2023-07-04 14:12:38 +02:00
Juliusz Sosinowicz
f58539581d Fix DoMonitor for Mac/BSD 2023-07-04 13:24:00 +02:00
Juliusz Sosinowicz
2feec88702 Add comment explaining threading usage 2023-07-04 11:18:44 +02:00
Juliusz Sosinowicz
713670dcc7 Use smaller buffer for copying 2023-07-04 11:18:44 +02:00
Juliusz Sosinowicz
3d2db844c1 Speed up waiting for file removal 2023-07-04 11:18:44 +02:00