Commit Graph

7235 Commits

Author SHA1 Message Date
JacobBarthelmeh
d3202600a4 Merge pull request #6525 from lealem47/san
Improve subjectAltName extension parsing and printing
2023-07-22 08:19:54 -06:00
JacobBarthelmeh
2acc4a6dd5 Merge pull request #6561 from lealem47/zd16348
Fix for adding pkcs9 contentType entry name
2023-07-21 17:04:47 -06:00
JacobBarthelmeh
c2a3f5316d Merge pull request #6591 from embhorn/zd16296
Add CRL_REPORT_LOAD_ERRORS option
2023-07-21 17:00:23 -06:00
Lealem Amedie
0cd5a293ca Fix for parsing pkcs9_contentType 2023-07-21 13:57:45 -06:00
Lealem Amedie
4821859bbc Fix for adding pkcs9 contentType entry name 2023-07-21 13:57:45 -06:00
Kareem
4bb907522b Fix wolfSSL_SMIME_write_PKCS7 not removing NULL characters between sections. 2023-07-21 11:08:15 -07:00
Eric Blankenhorn
f9cb9560c4 Add CRL_REPORT_LOAD_ERRORS option 2023-07-21 10:06:35 -05:00
Lealem Amedie
ec49e6b44d Avoid clash b/n two surname entries 2023-07-19 17:10:23 -06:00
Lealem Amedie
ec4527c789 address more feedback 2023-07-19 16:27:03 -06:00
Lealem Amedie
16058ce168 Address review comments 2023-07-19 12:01:01 -06:00
JacobBarthelmeh
8065ba18f9 Merge pull request #6620 from douzzer/20230714-WC_DO_NOTHING
20230714-WC_DO_NOTHING
2023-07-18 17:04:02 -06:00
JacobBarthelmeh
a026d843cf Merge pull request #6564 from philljj/add_lms_hooks
Add LMS/HSS wolfCrypt hooks.
2023-07-14 14:33:25 -06:00
JacobBarthelmeh
517138806a Merge pull request #6613 from anhu/GENERAL_NAME_set0_value
Adding wolfSSL_GENERAL_NAME_set0_value() compat layer API.
2023-07-14 14:18:58 -06:00
Anthony Hu
933dae393e Make PRBs happy 2023-07-14 14:33:43 -04:00
Anthony Hu
31a02f194e Address review comments. 2023-07-14 12:09:14 -04:00
JacobBarthelmeh
7361332c87 Merge pull request #6616 from SparkiDev/sm2_sp_not_avail
ECC and SM2: SP implementation not available yet
2023-07-14 09:58:43 -06:00
Daniel Pouzzner
f6f8d2eda3 add WC_DO_NOTHING macro to wolfssl/wolfcrypt/types.h, with default expansion "do {} while (0)", and globally refactor to use the macro where appropriate, annotating intended-null macros-with-args with "/* null expansion */";
tweak several #includes of settings.h to include types.h instead (all of these are for clarity, as types.h is indirectly included by later #includes), and add #include <wolfssl/wolfcrypt/types.h> where missing;

remove trailing semicolons from PRAGMA*() macro invocations as they are unneeded and can be harmful (inducing frivolous -Wdeclaration-after-statement etc.).
2023-07-14 09:50:01 -05:00
Sean Parkinson
377417e668 ECC and SM2: SP implementation not available yet
ecc.c: Keep code, but don't compile in until implementation for SM2
added to SP.
ssl.c: Fix warning for when ECC_MINSIZE is zero and sz is unsigned.
2023-07-14 08:04:00 +10:00
David Garske
e3e0b4505c Fix for building ED25519 with WOLFSSL_NO_CLIENT_AUTH or NO_ED25519_CLIENT_AUTH set:
```
/wolfssl/src/ssl.c:6744:33: error: 'Options' has no member named 'cacheMessages'
 6744 |                     ssl->options.cacheMessages = 1;
      |
```
2023-07-13 13:53:04 -07:00
Anthony Hu
4ccd6dfbe1 Adding wolfSSL_GENERAL_NAME_set0_value() compat layer API. 2023-07-13 16:09:47 -04:00
JacobBarthelmeh
11d26797d2 Merge pull request #6601 from SparkiDev/type_conversion_fixes_2
Type conversion fixes: make explicit
2023-07-13 13:33:58 -06:00
JacobBarthelmeh
b889b27b8c Merge pull request #6585 from cconlon/x509Ext
Fixes for WOLFSSL_X509 cert gen, WOLFSSL_ALT_NAMES to --enable-jni
2023-07-12 16:55:08 -06:00
Sean Parkinson
2c9609039d Type conversion fixes: make explicit
Changed to types and casting so that there are no implcit conversion
warnings (gcc -Wconversion) in these files.
2023-07-13 08:36:02 +10:00
Chris Conlon
ea7ea356a0 Fixes for WOLFSSL_X509 cert generation with key usage, extended key usage, and basic constraints 2023-07-12 14:33:42 -06:00
Daniel Pouzzner
648f474d83 configure.ac:
if ENABLED_LINUXKM_PIE, add -DWOLFSSL_NO_OCSP_ISSUER_CHECK to gate out backward dependency in asn.c;

  if ENABLE_LINUXKM, don't error on FIPS without thread_ls_on;

  for --enable-curl, set ENABLED_MD4="yes", and move --enable-md4 AC_ARG_ENABLE() clause up to a position adjacent to des3 handling;

scripts/sniffer-gen.sh: fix illegal exit code (SC2242);

src/internal.c: fix clang-analyzer-core.NonNullParamChecker in CreateTicket();

src/ocsp.c: fix readability-redundant-preprocessor;

src/tls.c: fix empty-body in TLSX_PskKeModes_Parse() and clang-diagnostic-unreachable-code-break in ALPN_Select();

tests/api.c: fix several clang-analyzer-core.NullDereference related to Expect*() refactor;

wolfcrypt/src/asn.c:

  fix -Wconversions in DecodeAuthKeyId() and ParseCertRelative();

  fix readability-redundant-declaration re GetCA() and GetCAByName();

  gate inclusion of wolfssl/internal.h on !defined(WOLFCRYPT_ONLY);

wolfssl/internal.h: add macro-detection gating around GetCA() and GetCAByName() prototypes matching gates in wolfcrypt/src/asn.c;

tests/utils.c: in create_tmp_dir(), use one-arg variant of mkdir() if defined(__CYGWIN__) || defined(__MINGW32__).
2023-07-12 13:47:40 -05:00
Lealem Amedie
1329543b62 Other miscellaneous fixes 2023-07-11 13:27:37 -06:00
David Garske
8f36f78e6c Merge pull request #6400 from bandi13/ARIA-cipher
Aria cipher
2023-07-11 09:50:42 -07:00
JacobBarthelmeh
ba4c96f727 Merge pull request #6593 from SparkiDev/sm_update_2
SM cipher suite: fix name
2023-07-11 09:28:24 -06:00
Sean Parkinson
f26b8bdf62 Merge pull request #6584 from julek-wolfssl/issue/6554
Always enable tls13MiddleBoxCompat with WOLFSSL_TLS13_MIDDLEBOX_COMPAT
2023-07-11 07:53:56 +10:00
Sean Parkinson
ce02ad7347 SM cipher suite: fix name
Fix name of TLSv1.3 CCM cipher suite.
2023-07-11 07:30:44 +10:00
Andras Fekete
a317ac280c PR comments 2023-07-10 16:50:54 -04:00
Kareem
56328d845a Hitch code review feedback. 2023-07-10 10:06:12 -07:00
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
2426cf14ca Merge pull request #6583 from SparkiDev/certman_split
Moved CertManager APIs into own file
2023-07-10 09:20:09 -06:00
Andras Fekete
0efdf966d0 addressing PR comments 2023-07-10 11:14:07 -04:00
Juliusz Sosinowicz
d0b8b919df Always enable tls13MiddleBoxCompat with WOLFSSL_TLS13_MIDDLEBOX_COMPAT 2023-07-10 11:40:51 +02: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
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
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
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
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
Andras Fekete
266307da6c Add in ARIA wrappers
Address PR comments + other cleanup


Addressing PR comments


Minor change


Make sure the last line gets output as well


Add in ARIA SHA256 session to internal structure


Add in ARIA SHA384 session to internal structure


Add necessary function for ARIA to extract key


Fix unit tests


Rename HAVE_ARIAGCM to HAVE_ARIA


Move aria.* to wolfcrypt/port/aria


Separate out aria-crypt init functions


Adding in ECC+SHA callbacks


Avoid using AC_CHECK_FILE


Rename Aria to wc_Aria


Don't need special cases


Addressing PR comments


Code cleanup


C89 support


Remove TODO


Add documentation about buffer size


Clean up header files


Use ARIA_DEVID by default if available


Dummy update call to make MagicCrypto happy


Fix for detecting what algo type to use


Documentation


Use the appropriate sign/verify


Collect MagicCrypto functions together (and avoid leaks)


Fall back on other implementations on failure


Fix issue when compiling without CRYPTOCB


Addressing PR comments


Better cleanup


Addressing PR comments


Cleaner exit in case of error
2023-07-06 16:09:23 -04: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
fb0c769d6c Merge pull request #6578 from douzzer/20230705-analyzer-fixes
20230705-analyzer-fixes
2023-07-06 09:04:39 -07:00
jordan
67bef21185 Add LMS/HSS wolfCrypt hooks. 2023-07-06 10:55:53 -05: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