19270 Commits

Author SHA1 Message Date
Daniel Pouzzner
21645460cd src/tls13.c: fix a readability-redundant-preprocessor in CheckPreSharedKeys(). 2023-02-16 23:37:43 -06:00
Sean Parkinson
26b7052b3f SP ECC sign: reject random k when r is 0
SP ECC signing code was generating signatures with r of 0.
This is not allowed by the algorithm description.
Retry sig gen when r is 0 like when s is 0.
2023-02-17 08:55:59 +10:00
David Garske
d488693f15 Allow #define HAVE_LIBZ support in user_settings.h. 2023-02-16 14:20:57 -08:00
David Garske
82d65481bb Fix for "expression must have a constant value" in tls13.c with GreenHills compiler. 2023-02-16 13:58:48 -08:00
kaleb-himes
b2caa5c5ae Fix invalid PP macro logic, guard under same conditions as internal.h 2023-02-16 14:40:43 -07:00
David Garske
0b31d5577c
Merge pull request #6098 from bandi13/moreDockerprograms
Some tests need these utilities
2023-02-16 13:28:02 -08:00
Andras Fekete
fdb0338473 Be more aggressive in killing processes 2023-02-16 09:55:52 -05:00
Andras Fekete
ff96150404 Some tests need these utilities 2023-02-16 09:51:46 -05:00
tim-weller-wolfssl
dea123f88e Minimal changes to avoid Out-of-Bounds write in ASN.1 parsing logic. Add unit tests for ParseCert() API passing badly formed ASN data (should error out gracefully). 2023-02-16 07:49:08 -06:00
David Garske
0a6dedab03
Merge pull request #6094 from SparkiDev/aes_gcm_stream_bench
AES GCM benchmark: separate aes-gcm streaming runs
2023-02-15 21:10:48 -08:00
David Garske
464c2d19dc
Merge pull request #6006 from SparkiDev/tls13_only_psk_dhe_ke
TLS 1.3 PSK: add option to require only PSK with DHE
2023-02-15 21:10:27 -08:00
Daniel Pouzzner
859b1ff398
Merge pull request #6093 from dgarske/fix_async
Fix issue with async and `WOLFSSL_CHECK_ALERT_ON_ERR`
2023-02-15 19:49:56 -06:00
Sean Parkinson
aaed553311
Merge pull request #6092 from dgarske/various
Various cleanups (STM docs, include case, make dist small script)
2023-02-16 11:23:51 +10:00
Kareem
1167ad623b Dynamic session cache: code review feedback 2023-02-15 17:38:14 -07:00
Sean Parkinson
85314e6ba5 ARMv7a neon configure.ac
Support other CPUs that start with armv7a.
2023-02-16 10:36:38 +10:00
Sean Parkinson
195ca1a20a AES GCM benchmark: separate aes-gcm streaming runs
Always to AES-GCM one-shot benchmark.
When WOLFSSL_AESGCM_STREAM, always perform AES-GCM streaming benchmark.
2023-02-16 09:37:00 +10:00
Sean Parkinson
b624fc8377 TLS 1.3 PSK: add option to require only PSK with DHE
Can specify only PSK without DHE.
Add only PSK with DHE.
2023-02-16 09:21:29 +10:00
David Garske
18bee3142d Fix to use the right cert/key in the API unit test if overridden. 2023-02-15 14:57:43 -08:00
David Garske
e8a26c673a Fix for async with WOLFSSL_CHECK_ALERT_ON_ERR. 2023-02-15 14:57:34 -08:00
David Garske
47801107da Fix to make sure API unit test always calls init/cleanup when not running all tests. 2023-02-15 14:24:22 -08:00
David Garske
5481a059c4 Fix wincrypt.h include header case when used with case sensitive file system. 2023-02-15 11:44:34 -08:00
David Garske
6ea3fe2f7a
Merge pull request #6089 from kaleb-himes/stunnel-5_67_support_fix
Fix unused variable warning when configuring with --enable-apachehttpd
2023-02-15 08:39:30 -08:00
Sean Parkinson
089ef86587
Merge pull request #6090 from douzzer/20230214-mollify-iso-c-pedantic
20230214-mollify-iso-c-pedantic
2023-02-15 17:04:07 +10:00
Daniel Pouzzner
ca87a99646 src/ssl.c and src/x509.c: use the customary function pointers (WOLFSSL_CRYPTO_EX_*()), not void *, in the arg lists of wolfSSL_CTX_get_ex_new_index() and wolfSSL_X509_get_ex_new_index(), to avoid "ISO C forbids passing argument ... between function pointer and ‘void *’";
move typedefs for WOLFSSL_CRYPTO_EX_*() from wolfssl/openssl/compat_types.h to wolfssl/wolfcrypt/types.h, grouped with the other EX_DATA-related typedefs, as they are needed whenever defined(HAVE_EX_DATA) regardless of openssl compatness;

properly gate wolfSSL_CTX_get_ex_new_index() and wolfSSL_X509_get_ex_new_index() prototypes on defined(HAVE_EX_DATA).
2023-02-14 19:28:40 -06:00
David Garske
7e582932f3 Improve documentation for STM32 PKA support. 2023-02-14 14:27:05 -08:00
David Garske
100ec1e7e6 Fix ./scripts/makedistsmall.sh for Docker and RTOS. 2023-02-14 14:25:40 -08:00
Kaleb Himes
dead56b3cb
Merge pull request #6086 from julek-wolfssl/explicit-rwlock
Make rwlock an explicit enable option
2023-02-14 15:04:13 -07:00
kaleb-himes
2719943ffd Fix unused variable warning when configuring with --enable-apachehttpd 2023-02-14 14:25:57 -07:00
Juliusz Sosinowicz
0cedc4e1ac
stunnel 5.67 support (#6020)
* stunnel 5.67 support

- ssl->session->ticketAdd may be set when parsing a ticket before PSK
- PSK binders should be calculated based on ciphersuite associated with PSK
- Add option to prioritise PSK order instead of ciphersuite order
- Update ctx->method->version when using Set_CTX_max_proto_version API
- Simplify wolfSSL_parse_cipher_list
  - Keep copy of old list and then add in the previous ciphersuites depending on whether we are doing only TLS 1.3 ciphersuites or not
- Specify CRL revocation in alert
  - Match reason string to match OpenSSL
- Add support for external data callbacks for WOLFSSL_SESSION

* Upref the session for stunnel instead of duplicating it

* Add small stack option for wolfSSL_parse_cipher_list
2023-02-14 09:38:28 -08:00
tmael
c4fa013800
Fix for BIO_reset() (#5887)
* Fix for BIO_reset
* Introduced BIO_FLAGS_MEM_RDONLY
2023-02-14 08:54:25 -08:00
Juliusz Sosinowicz
bcfd5fb66b Make rwlock an explicit enable option 2023-02-14 13:55:59 +01:00
Sean Parkinson
2fe34facba
Merge pull request #6084 from philljj/zd15607
Check keyLen matches cipher in wolfSSL_CMAC_Init.
2023-02-14 12:51:20 +10:00
David Garske
6e21b8c907
Merge pull request #6085 from anhu/env_shell
Invoke shell for shell scripts.
2023-02-13 14:53:47 -08:00
gojimmypi
ed79545a27
Espressif examples run with local wolfSSL (no setup!) (#6018)
* Espressif examples run with local wolfSSL (no setup!)
* include.am Espressif local no-setup component files
* cleanup Espressif Example CMakeLists.txt, use function
* multiple wolfSSL installs is now a fatal Espressif build error
* Examples no longer need setup
* CompileAll builds local examples, not IDF_PATH ones
* Espressif compileAllExamples both local & ESP-IDF components
* add wolfssl_test_idf test project
* move VisualGDB projects to subdirectories
* move VisualGDB wolfssl_server to subdirectory
* update include.am for moved VisualGDB project files
2023-02-13 14:37:56 -08:00
David Garske
6877c98d82
Merge pull request #6081 from douzzer/20230211-wolfcrypttest-fixes
20230211-wolfcrypttest-fixes
2023-02-13 14:28:43 -08:00
Anthony Hu
eedc8fa0b3 Invoke shell for shell scripts. 2023-02-13 15:58:15 -05:00
Daniel Pouzzner
a945017a88 wolfcrypt/test/test.c: around ecc_ctx_kdf_salt_test(): fix fips gating, fix length handling for "message", fix memory leaks;
in crypto_ecc_verify(), crypto_ecc_sign(), ecc_test_nonblock_dhe(), and ecc_test_nonblock_ecdsa(), add codepoint-specific retvals.
2023-02-13 14:21:50 -06:00
David Garske
405b98aaa4
Merge pull request #6078 from SparkiDev/rsapss_openssl_compat
X509 RSA PSS: fixes for OpenSSL compat layer
2023-02-13 08:43:10 -08:00
Daniel Pouzzner
295da3232a
Merge pull request #6082 from SparkiDev/asn_dsa_mp_int_leak
ASN template, DSA: Clear the mp_int before re-reading data
2023-02-12 22:28:11 -06:00
Sean Parkinson
0a8753d2b2 ASN template, DSA: Clear the mp_int before re-reading data
Make sure the mp_int is cleared so that any exisiting bigint is freed.
Tidy up api.c code.
2023-02-13 11:08:18 +10:00
jordan
909aa86d2d Check keyLen matches cipher in wolfSSL_CMAC_Init.
Fixes ZD15607.
2023-02-12 18:26:40 -06:00
Kareem
5a77db3f20 Add dynamic session cache which allocates sessions from the heap. 2023-02-10 14:18:03 -07:00
tmael
55a7e24cfe
Support pthread_rwlock (#5952)
* Support rwlock

* Fix typo, ENABLE_SESSION_CACHE_ROW_LOCK with TITAN_SESSION_CACHE

* Implement read lock

- Use read lock for the SessionCache
- Don't copy the

* TLS 1.3: Don't push ticket to cache if we don't retrieve from it

* Detect rwlock support with PTHREAD_RWLOCK_INITIALIZER

* Implement explicit rwlocks

- Mutex's still necessary for signals. Implement explicit rwlocks and we can migrate critical mutexs to rwlocks when necessary.

* Remove WOLFSSL_USE_RWLOCK guard around mutex condLock

* condLock not necessary after all

* Use configure.ac to check for pthread_rwlock_destroy support

* Can't include config.h in wc_port.h as that breaks make distcheck

* Check for pthread_rwlock_t to determine if rwlock is available

* Code review

---------

Co-authored-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2023-02-10 10:42:38 -08:00
John Bland
338d8db274
Ecc ctx state fix (#6077)
* set the client state correctly when wc_ecc_ctx_set_kdf_salt is called
* add test that covers wc_ecc_ctx_set_kdf_salt
* use shared key and smallstack to reduce test stack usage
2023-02-10 10:05:52 -08:00
philljj
5b8fda1ac6
Fix overflow in fp_to_unsigned_bin_len length check. (#6075)
* Fix overflow in fp_to_unsigned_bin_len length check.
* Add a second check when i == a->used - 1.
2023-02-10 08:46:37 -08:00
TakayukiMatsuo
0c771a93dc Improve TLS1.2 client authentication to use TSIP 2023-02-10 16:16:25 +09:00
Daniel Pouzzner
c2384674d8
Merge pull request #6079 from SparkiDev/aes-ecb-len-aesni
AES ECB/CTR/XTS: enable AES-NI usage
2023-02-09 21:17:50 -06:00
Sean Parkinson
b359dd27e4 AES ECB/CTR/XTS: enable AES-NI usage
Perform multiple blocks of encryption/decryption in assembly call with
ECB.
This improves performance of ECB, CTR and XTS on Intel x64.
2023-02-10 11:14:06 +10:00
Sean Parkinson
9750fc4485 X509 RSA PSS: fixes for OpenSSL compat layer
Add NIDs for RSA-PSS to OpenSSL compat layer.
Have wc_RsaPublicKeyDecode call wc_RsaPublicKeyDecode_ex where logic for
RSA-PSS handling is already done.
2023-02-10 10:25:49 +10:00
Hideki Miyazaki
d336e22b85
Allow reading ENC EC PRIVATE KEY as well via wolfSSL_PEM_read_bio_ECPrivateKey (#6055)
* fix qt qsslkey unit test
2023-02-09 14:48:52 -08:00