Commit Graph

6721 Commits

Author SHA1 Message Date
David Garske
37be7a4800 Merge pull request #6567 from JacobBarthelmeh/vcpkg
fix warning for build with vcpkg
2023-07-17 08:47:15 -07: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
jordan
a747e7773c LMS: comments, SMALL_STACK, cleanup, etc. 2023-07-14 11:27:59 -05:00
JacobBarthelmeh
20115f0e23 Merge pull request #6619 from douzzer/20230714-asn-DecodeAuthKeyId-Wconversion-fix
20230714-asn-DecodeAuthKeyId-Wconversion-fix
2023-07-14 10:11:46 -06: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
e2833f99a3 wolfcrypt/src/asn.c: fix merge conflict between 648f474d83 and 2c9609039d, re -Wconversion in DecodeAuthKeyId(). 2023-07-14 09:53:54 -05:00
Sean Parkinson
a96983e6d3 Merge pull request #6612 from dgarske/entropy_memuse_win32
Add support for MemUse Entropy on Windows.
2023-07-14 10:54:51 +10: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
4862b57415 Simplify Windows Entropy_TimeHiRes, which just needs a precision timer to differentiate, not specific time. 2023-07-13 14:30:58 -07:00
David Garske
761a976d0c Add support for MemUse Entropy on Windows. 2023-07-13 12:56:13 -07: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
8c012b5df5 Merge pull request #6599 from SparkiDev/heapmath_mp_exptmod_fix
Heap Math exptmod: fixes for valid modulus checks
2023-07-12 16:57:51 -06:00
JacobBarthelmeh
cf15789c7f Merge pull request #6598 from SparkiDev/sm_update_3
EVP SM3: fix cast
2023-07-12 16:56:35 -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
Sean Parkinson
b18bc86ef8 Heap Math exptmod: fixes for valid modulus checks
mp_exptmod_base_2() uses Montogmery method and does not support even
modulus. Added check.
mp_exptmod_fast() uses Montogmery method when odd not when dr > 0.
Comment updated at call.
Reduce value of zero doesn't work for mp_reduece_2k. Changed setup of
use to check for zero and won't use it. Other methods won't work either.
2023-07-12 09:20:11 +10:00
Sean Parkinson
96f745af6f EVP SM3: fix cast
wc_Sm3Update takes a word32 for the size.
Others cases are using the OpenSSL compatibility API but SM3 APIs don't
exist in OpenSSL.
2023-07-12 08:05:03 +10:00
jordan
4c125ece77 LMS: cleanup INSTALL, and cap threads to 4. 2023-07-11 15:04:51 -05:00
Anthony Hu
0b18e250ed Merge pull request #6576 from iyanmv/liboqs-1.8
Rename sphincs algs to follow upstream
2023-07-11 14:56:49 -04:00
David Garske
8f36f78e6c Merge pull request #6400 from bandi13/ARIA-cipher
Aria cipher
2023-07-11 09:50:42 -07:00
Andras Fekete
ecc138fc6e Fixed g++ shortcomings 2023-07-11 09:26:39 -04:00
jordan
d7c3a176e2 LMS cleanup. 2023-07-10 23:43:07 -05:00
Andras Fekete
a317ac280c PR comments 2023-07-10 16:50:54 -04:00
David Garske
2299282fdd Merge pull request #6235 from kareem-wolfssl/hitch
Hitch
2023-07-10 11:46:57 -07:00
David Garske
e4c9a73296 Merge pull request #6587 from gojimmypi/ESP32WROOM-refactor
Espressif refactor WROOM32 ESP32
2023-07-10 11:46:10 -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
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
Andras Fekete
0a02218ba3 Clean up allocated memory on failure 2023-07-10 12:37:07 -04:00
Iyán Méndez Veiga
7c14ea67ae Rename sphincs algs to follow upstream
This also adds new keys for SPHINCS+. The reason is that SPHINCS+
was updated to 3.1 in liboqs (open-quantum-safe/liboqs/pull/1420),
and old keys are incompatible with the new implementation.

Keys were generated using the oqs-provider for OpenSSL 3

openssl genpkey \
    -provider default -provider oqsprovider \
    -algorithm sphincsshake128fsimple \
    -outform der \
    -out bench_sphincs_fast_level1_key.der

And certs_test.h was updated using xxd

xxd -i -c 10 -u bench_sphincs_fast_level1_key.der

This was repeated for the 6 variants of SPHINCS+ that wolfSSL supports.
2023-07-10 18:31:07 +02:00
Andras Fekete
299b4d8552 Make wc_BuildEccKeyDer non-static 2023-07-10 11:32:17 -04: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
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
7866a40d06 resolve kari decode without recipient certificate 2023-07-08 07:37:26 -07:00
gojimmypi
57546405c0 refactor WROOM32 ESP32 2023-07-07 15:47:00 -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
jordan
55bbd5865c LMS/HSS: cleanup, and safer write/read callbacks 2023-07-07 15:30:50 -05: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
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