6700 Commits

Author SHA1 Message Date
Daniel Pouzzner
5d2610c96d wolfssl/wolfcrypt/sp_int.h and wolfcrypt/src/sp_int.c: add struct sp_int_minimal, with same structure as struct sp_int but only one digit, to allow error-free access to sp_ints allocated with ALLOC_SP_INT() with fewer than SP_INT_DIGITS digits, and use the new type in _sp_zero() and sp_init_size() to eliminate -Werror=array-bounds on _sp_zero() under gcc-13. 2022-09-15 13:16:27 -05:00
David Garske
2a96d62e43
Merge pull request #5573 from embhorn/zd14802
Add WOLFSSL_ATECC_TFLXTLS for Atmel port
2022-09-15 08:59:40 -07:00
JacobBarthelmeh
3cafde2519
Merge pull request #5589 from SparkiDev/sp_mac_m1_asm
SP; Mac M1 failure fix
2022-09-13 16:35:57 -06:00
Eric Blankenhorn
1a0073b558 Add WOLFSSL_ATECC_TFLXTLS for Atmel port 2022-09-13 11:04:58 -05:00
Sean Parkinson
38418b31f1
Merge pull request #5197 from JacobBarthelmeh/OCSP
RSA-PSS with OCSP and add simple OCSP response der verify test case
2022-09-13 15:10:00 +10:00
Sean Parkinson
99d60a0781 SP; Mac M1 failure fix
Give the compiler a hint that mask needs special attention.
2022-09-13 13:54:06 +10:00
JacobBarthelmeh
e867f0d312
Merge pull request #5574 from haydenroche5/ecc_nb_tls
Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
2022-09-12 16:24:00 -06:00
JacobBarthelmeh
2eee35ef8f
Merge pull request #5582 from SparkiDev/small_stack_cache_fix
Small Stack Cache: make work again
2022-09-12 09:53:10 -06:00
Sean Parkinson
e0a47ca6c1 Small Stack Cache: make work again
Fix Small Stack Cache option so that it works with various options
including ALT_ECC_SIZE.
Allow ALT_ECC_SIZE when SP math all or SP math is compiled in.
2022-09-12 10:52:34 +10:00
JacobBarthelmeh
fa6bc79f8b
Merge pull request #5578 from douzzer/20220909-fixes
20220909-fixes
2022-09-09 16:37:35 -06:00
JacobBarthelmeh
460b6f1ecc
Merge pull request #5577 from tmael/vx_entropy
Improves entropy with VxWorks
2022-09-09 15:51:24 -06:00
Tesfa Mael
82781043c4 Add entropy to VxWorks 2022-09-09 12:44:56 -07:00
Daniel Pouzzner
3bd91c6ab8 wolfcrypt/src/pkcs7.c: revert 57a7430b6a0, which broke SCEP use case, and redo using a simple stack variable initialization approach. 2022-09-09 10:09:14 -05:00
JacobBarthelmeh
200ca9db4b
Merge pull request #5572 from tim-weller-wolfssl/zd14615-config-updates
Configuration consistency fixes for RSA keys and way to force disable of private keys
2022-09-08 13:19:11 -06:00
Hayden Roche
226a8b676d Add support for non-blocking ECDHE/ECDSA in TLS/DTLS layer.
This requires the async code.
2022-09-08 11:34:59 -07:00
David Garske
e49efbc101
Merge pull request #5544 from haydenroche5/async_sw
Migrate async names from "test" to "software."
2022-09-08 10:18:26 -07:00
JacobBarthelmeh
f49d84e17a fix typo and pipe ocsp response creation to /dev/null 2022-09-08 09:02:31 -07:00
Tim Weller
1b90d4fad2 Configuration consistency fixes and addition of new config option to disable private key
Add way to disable private keys in wolfcrypt (settings). Make RSA integer usage match structure configuration.
2022-09-08 09:36:18 -05:00
JacobBarthelmeh
9d6e157fc5 add asn template version 2022-09-07 16:15:19 -07:00
Daniel Pouzzner
ef7377d64c fix whitespace and line length. 2022-09-07 15:30:32 -05:00
Daniel Pouzzner
57a7430b6a wolfcrypt/src/pkcs7.c: in wc_PKCS7_DecryptKtri(), refactor handling of OAEP keys to fix uninited value access detected by clang-analyzer-core.UndefinedBinaryOperatorResult; fix whitespace. 2022-09-07 15:14:26 -05:00
JacobBarthelmeh
28a82237d9 RSA-PSS signed OCSP responses 2022-09-07 13:12:43 -07:00
David Garske
9c88d8ac2c
Merge pull request #5547 from JacobBarthelmeh/mcux
Port to RT685 with FreeRTOS
2022-09-07 12:54:54 -07:00
Sean Parkinson
05634e286d SP math: fix build configuration with opensslall
./configure '--disable-shared' '--enable-keygen' '--enable-certgen'
'--enable-certreq' '--enable-certext' '--enable-ocsp' '--enable-crl'
'--enable-pwdbased' '--enable-opensslall' '--enable-pkcs7'
'--enable-pkcs12' '--enable-sp' '--enable-sp-math' '--disable-rsa'
'--disable-dh' '--enable-ecc'
2022-09-07 15:42:33 +10:00
David Garske
12680a967a
Merge pull request #5560 from douzzer/20220906-fixes
20220906-fixes
2022-09-06 17:56:33 -07:00
David Garske
602116c3f2
Merge pull request #5558 from embhorn/zd14776
Fix warning in DecodeAltNames
2022-09-06 16:00:02 -07:00
Chris Conlon
761fde31ad
Merge pull request #5478 from miyazakh/rsaesoaep 2022-09-06 15:45:40 -06:00
Daniel Pouzzner
bf29d6b2c7 wolfcrypt/test/test.c: refactor shake256_absorb_test() and shake256_test() to use a single buffer for "large_input", malloc()ed when WOLFSSL_SMALL_STACK, to stay within stack limits of all-max-func-stack-2k; move a couple declarations in openssl_test() to resolve declaration-after-statement. 2022-09-06 13:28:57 -05:00
David Garske
d72b401e8e
Merge pull request #5545 from icing/evp_chacha
Add ChaCha20 as available cipher in the EVP API.
2022-09-06 10:42:54 -07:00
Eric Blankenhorn
dcf215d52c Fix warning in DecodeAltNames 2022-09-06 11:33:30 -05:00
David Garske
7b0128f9ac
Merge pull request #5541 from SparkiDev/ecc_sign_k_nondyn
ECC sign_k: don't have it dynamically allocated
2022-09-06 07:52:45 -07:00
Stefan Eissing
5927c4063a Removing FIXME comments after the fixing has been done. doh. 2022-09-06 10:06:02 +02:00
Stefan Eissing
9f47999002 Add ChaCha20 as available cipher in the EVP API.
- wire the wc_ChaCha_* implementation into the EVP API
  as `wolfSSL_EVP_chacha20`
- follow IV conversions of OpenSSL
- add test case
- have QUIC support use this for header protection when
  CHACHA20_POLY1305 has been negotiated in the handshake.
2022-09-06 10:06:02 +02:00
David Garske
31b8edd192
Merge pull request #5552 from SparkiDev/ed_make_key_fixes
Ed make public key wasn't checking whether private key set
2022-09-05 16:13:41 -07:00
Sean Parkinson
f153e65102 SHA-3: check BMI1 availablity for ASM
Added benchmarking of SHAKE128 and SHAK256.
2022-09-05 14:11:02 +10:00
Sean Parkinson
f807c70637 Ed make public key wasn't checking whether private key set
Ed25519 and Ed448 make public key APIs now check whether the private key
was set.
The private key and public key flags setting and clearing also updated.
Testing of unset private key and calling make public key added for
Ed25519 and Ed448.
2022-09-05 12:21:51 +10:00
Sean Parkinson
4ac113d135 ECDSA sign_k allocated when not WOLFSSL_NO_MALLOC
Fix up other WOLFSSL_NO_MALLOC issues.
2022-09-05 10:56:17 +10:00
David Garske
aa036b6ea4
Merge pull request #5532 from anhu/sphincs
Add sphincs to wolfCrypt.
2022-09-02 11:56:11 -07:00
David Garske
4a8a11315b
Merge pull request #5536 from SparkiDev/sha3_x64
SHA-3 improvements
2022-09-02 09:46:14 -07:00
Anthony Hu
10ce703d71 Add sphincs to wolfCrypt.
Note that we will not support sphincs in TLS so nothing above wolfcrypt changes.
2022-09-02 11:53:55 -04:00
Hayden Roche
959386422e Migrate async names from "test" to "software."
See async PR 52.
2022-09-01 17:53:18 -07:00
Sean Parkinson
cef590131a ECC sign_k: don't have it dynamically allocated 2022-09-02 09:18:42 +10:00
Stefan Eissing
65ca72c5a2
Improve EVP support for CHACHA20_POLY1305 (#5527)
* Add test case for OpenSSLs capability to init a evp context partially in several calls.
* EVP handling of CHACHA20_POLY1305 improvment
- save key at ctx for Init()s without IV
- reuse stored key for Init()s with new IV, reusing ctx
- free and zero key on ctx clenaup
* Adding type cast to XMALLOC to force compiler compatibility.
* EVP: using same DYNAMIC_TYPE in alloc and free of chacha20_poly1305 key.
Co-authored-by: Stefan Eissing <stefan.eissing@greenbytes.de>
2022-09-01 13:23:42 -07:00
David Garske
0222833f7e
Merge pull request #5535 from douzzer/20220831-analyzer-coddling
20220831-analyzer-coddling
2022-09-01 07:40:11 -07:00
Daniel Pouzzner
8ccef9f0d3
Merge pull request #5531 from embhorn/zd14665
Check return from call to wc_Time
2022-09-01 09:35:49 -05:00
Sean Parkinson
ce8959ea77 SHA-3 improvements
Add x86_64 assembly code:
  - BMI2
  - AVX2 (using ymm, slower than BMI2)
  - AVX2 of 4 similtaneous hashes
Add SHAKE128 functions and tests.
Add Absorb and Squeeze functions for SHAKE128 and SHAK256 and tests.
Add doxygen for SHA-3 and SHAKE functions.
Update other generated x86_64 assembly files to include settings.h.
2022-09-01 17:11:58 +10:00
Daniel Pouzzner
ea3959f2f6 analyzer coddling:
in api.c test_wolfSSL_dtls12_fragments_spammer(), inhibit clang-analyzer-deadcode.DeadStores;

in asn.c ParseCRL_Extensions() old (!WOLFSSL_ASN_TEMPLATE) version, fix bounds check to prevent overshift;

in misc.c ctMaskCopy(), use `*(x + i)`, not x[i], to tiptoe around cppcheck-2.9 objectIndex bug.
2022-08-31 22:56:08 -05:00
David Garske
fe583faf32
Merge pull request #5501 from haydenroche5/ecc_non_block
Add support for non-blocking ECC key gen and shared secret gen for P-256/384/521.
2022-08-31 18:31:28 -07:00
Hayden Roche
41207f5d9b Add support for non-blocking ECC key gen and shared secret gen for
P-256/384/521.

New functions:

- sp_ecc_make_key_256_nb
- sp_ecc_make_key_384_nb
- sp_ecc_make_key_521_nb
- sp_ecc_secret_gen_256_nb
- sp_ecc_secret_gen_384_nb
- sp_ecc_secret_gen_521_nb

This commit also tweaks the testing for ECDSA testing in test.c. Instead of
testing with one of P-256/384/521, we test with all that are available.
2022-08-31 14:34:26 -07:00
Eric Blankenhorn
5a25525b2e Check return from call to wc_Time 2022-08-31 15:20:07 -05:00