Commit Graph

6621 Commits

Author SHA1 Message Date
Juliusz Sosinowicz
0dbd0ffb4e Merge pull request #5483 from embhorn/zd14659 2022-08-22 14:28:29 +02:00
David Garske
1d0e83bd1a Merge pull request #5474 from julek-wolfssl/zd14644-2
Match OpenSSL self signed error return.
2022-08-19 06:46:26 -07:00
Eric Blankenhorn
3d8562f07b Fixes for build and runtime issues 2022-08-19 08:12:04 -05:00
David Garske
b9c9ad0339 Fixes for RSA PSS with --enable-asynccrypt in ConfirmSignature. 2022-08-17 08:20:06 -07:00
Juliusz Sosinowicz
008e947fec Match OpenSSL self signed error return.
OpenSSL compat expects ASN_SELF_SIGNED_E when a self signed cert can't be verified. This is useful when translating the error with GetX509Error into a X509_V_ERR_* error.
2022-08-17 12:40:16 +02:00
John Safranek
be2a6cbeb9 Merge pull request #5420 from Uriah-wolfSSL/ms_abi
Ms abi
2022-08-16 09:21:14 -07:00
David Garske
55eb460d1a Merge pull request #5403 from SparkiDev/ecc_import_priv_order
ECC import priv: validate priv is less than order
2022-08-15 21:36:46 -07:00
Anthony Hu
52ed047a44 Fix a mismatched decl and impl 2022-08-15 12:13:05 -04:00
Sean Parkinson
23a01b3276 SP: CT from_mp when sp_digit bits equal mp_digit bits.
Made constant time copy of values from an mp_int int array of sp_digit.
Stops OOB writes when mp_int is bigger than it should be.
2022-08-15 09:02:24 -07:00
Anthony Hu
5e7cff71fd Initialize the Enc memberss of CertName struct.
Tested by reproducing the problem in an example and confirming fix makes problem
go away.
2022-08-15 11:43:33 -04:00
Uriah Pollock
7e00b32c71 Corrected line spacing incorrect arg passings. 2022-08-14 20:16:42 -05:00
Daniel Pouzzner
b4f1b6d04d fix whitespace and C++-style comments. 2022-08-12 15:18:27 -05:00
David Garske
60437bba6e Merge pull request #5378 from anhu/dilithium
Initial commit to add Dilithium NIST PQC winner.
2022-08-12 09:29:42 -07:00
Chris Conlon
c66a21c40a Add Zephyr support for nRF5340 with CryptoCell-312, PSA Crypto fixes (#5418)
* PSA: set AES key bits, define PSA_ALG_NONE/PSA_KEY_ID_NULL if needed
* Zephyr: add TimeNowInMilliseconds() for tls13.c, clock_settime() for test.c, update CMakeLists.txt
* Skip including unistd.h for Zephyr in benchmark.c
* Zephyr: update README, add nRF5340dk support to wolfssl_test sample app
* Zephyr: add wolfCrypt benchmark sample app
* Zephyr: add nRF5340 support to tls_thread sample app
* PSA: use specific hash algo with psa_sign/verify_hash()
* Zephyr: add support for PSA Crypto API with PK callbacks to wolfssl_tls_threaded sample app
* Zephyr: add new files to zephyr/include.am
2022-08-11 17:42:05 -07:00
Anthony Hu
82a900b438 Initial commit to add Dilithium NIST PQC winner.
Also:

* added HAVE_FALCON guards as needed.
* corrected minor falcon bugs as I found them.
* handling OID sum collision between DILITHIUM_LEVEL5 and DILITHIUM_AES_LEVEL3

Tested with the following commands:

examples/server/server -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

examples/client/client -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

with permutations of SHAKE,AES variants and levels 2,3,5
2022-08-11 11:38:31 -04:00
David Garske
5e6c45a6fb Merge pull request #5397 from SparkiDev/cert_rsa_pss
Certs with RSA-PSS sig
2022-08-11 08:19:12 -07:00
Sean Parkinson
fb531dacc2 Certs with RSA-PSS sig
Add support for parsing and verifying certificates with RSA-PSS
signatures. Including check PSS parameters in key with those in
signature algorithm.
Add support for parsing private RSA PSS key.
Add support for parsing public RSA PSS key.
2022-08-11 09:43:01 +10:00
Daniel Pouzzner
f771181e1a fixes for issues introduced in #5384:
added numerous missing _SMALL_STACK code paths (PK objects on the stack);

in settings.h, enable WOLFSSL_SMALL_STACK_STATIC by default when WOLFSSL_SMALL_STACK is defined (NO_WOLFSSL_SMALL_STACK_STATIC to override);

fixes for unsafe strcat()s in tests/quic.c;

fix for unsafe macro WOLFSSL_IS_QUIC();

fix to exclude quic from enable-all when enable-linuxkm (quic needs opensslextra, and opensslextra currently only works in-kernel in cryptonly builds);

fix for signed/unsigned clash in wolfSSL_quic_receive().
2022-08-10 13:33:56 -05:00
Uriah Pollock
5049b16325 Param correction. 2022-08-08 19:43:54 -05:00
Uriah Pollock
f8c9393235 Added ABI tags for certs, wc_CertNew(), wc_CertFree()
wc_CertNew() and wc_CertFree() is for use by ABI type aplications, and
others, for having wolfCrypt perform the new/free of the certification
structure w/o the application needing too, and more importantly, needing
to contain knowledge of the structure.
2022-08-08 18:12:06 -05:00
Chris Conlon
e3310984b6 Merge pull request #5443 from TakayukiMatsuo/doalert 2022-08-08 15:22:18 -06:00
Chris Conlon
039bf721c4 Merge pull request #5440 from miyazakh/sce_compile_failure 2022-08-08 10:36:15 -06:00
Uriah Pollock
b0aaf4a23d Minor ABI updates. 2022-08-08 10:16:05 -05:00
Uriah Pollock
c9c19c82b3 Added next set of ABI for ECC APIs 2022-08-08 09:08:24 -05:00
Uriah Pollock
b200d65a6a Added new ABI reference hooks. This is round two, more to come. 2022-08-08 09:08:23 -05:00
Uriah Pollock
46f423b8b9 Added ABI macros for managing interface changes 2022-08-08 09:08:23 -05:00
TakayukiMatsuo
9fd56c9c5c Changes in response to other PRs 2022-08-08 02:10:14 +09:00
Hayden Roche
3bf21b5a05 Expand error queue usage with new macro WOLFSSL_ERROR_VERBOSE.
We have users who need to debug errors coming out of libwolfssl in production,
where --enable-debug isn't an option. Our error queue implementation is the
solution, but our usage of WOLFSSL_ERROR isn't consistent. This commit greatly
expands our usage of WOLFSSL_ERROR. There are too many error cases to tackle
all at once, and not all error cases are particularly meaningful or likely to be
hit in regular operation of the library. I've tried to focus on errors that
users are likely to hit, and I've chosen to ignore things like the mountain of
BUFFER_E and BAD_FUNC_ARG cases (for the most part). I've also tried to expand
WOLFSSL_ERROR usage in files where we haven't been using it historically
(e.g. aes.c), so the pattern is now there for other developers to follow. In
order to prevent these additions from exploding the size of libwolfssl, they're
all behind a new macro, WOLFSSL_ERROR_VERBOSE. If WOLFSSL_VERBOSE_ERRORS is
defined, WOLFSSL_ERROR_VERBOSE just maps to WOLFSSL_ERROR.
2022-08-05 10:32:18 -07:00
Hideki Miyazaki
f30b3f1163 fix compile error 2022-08-05 16:00:09 +09:00
Daniel Pouzzner
9d5e633a96 wolfcrypt/src/pkcs12.c: add WOLFSSL_SMALL_STACK path in freeDecCertList(). 2022-08-04 11:16:47 -05:00
Daniel Pouzzner
d7e33b3293 wolfcrypt/src/asn.c: fix null pointer deref in SetReqAttribSingle() (clang-analyzer-core.NonNullParamChecker). 2022-08-04 11:12:09 -05:00
Sean Parkinson
9ea3e173d0 Merge pull request #5277 from JacobBarthelmeh/req_attr
expand subject name and req attribute support
2022-08-04 14:32:14 +10:00
David Garske
2c2a7750a4 Merge pull request #5414 from darktohka/feature/chacha20-poly1305-evp
Integrate chacha20-poly1305 into the EVP interface
2022-08-03 18:21:17 -07:00
Sean Parkinson
e32cfb79e5 Merge pull request #5419 from dgarske/aurix
Support for Infineon AURIX IDE and minor compiler warnings.
2022-08-04 08:01:57 +10:00
David Garske
3f07900c1b Merge pull request #5432 from embhorn/zd14172
Fix dead code warnings and build error
2022-08-03 15:01:20 -07:00
David Garske
0c1add08e3 Merge pull request #5416 from darktohka/feature/chacha20-outl-bytes
Ensure ChaCha20 updates out length during cipher update
2022-08-03 07:26:02 -07:00
Eric Blankenhorn
ecdccb6180 Fix build error with WOLFSSL_AES_DIRECT 2022-08-03 09:09:28 -05:00
Eric Blankenhorn
f713c75a73 Fix dead code warnings in evpCipherBlock and wc_CryptKey 2022-08-03 08:08:00 -05:00
David Garske
53e0483e47 Support for Infineon AURIX IDE. Fixes for Aurix compiler warnings. 2022-08-02 16:53:47 -07:00
JacobBarthelmeh
99ed727179 add WOLFSSL_CERT_NAME_ALL macro guard and new values to set subject 2022-08-01 10:52:09 -07:00
David Garske
da422eb422 Merge pull request #5406 from SparkiDev/mp_int_size
Maths bit size: ensure size is right
2022-07-28 15:36:58 -07:00
David Garske
d568e8c893 Merge pull request #5413 from SparkiDev/x509_san_crit
ASN template: allow SAN to be critical
2022-07-28 15:14:23 -07:00
David Garske
ac85000a02 Merge pull request #5415 from douzzer/20220728-fixes
20220728-fixes
2022-07-28 12:48:40 -07:00
David Garske
fde2097503 Merge pull request #5405 from SparkiDev/clang-x86
TFM: change inline x86 asm code to compile with clang
2022-07-28 08:42:17 -07:00
Disyer
e599bb5048 Mark chacha20-poly1305 as an AEAD cipher 2022-07-28 18:36:52 +03:00
Disyer
e8febaf414 Ensure ChaCha20 updates out length during cipher update 2022-07-28 18:06:41 +03:00
Daniel Pouzzner
545ba58cc0 sp_int.c sp_div(): add missing (err == MP_OKAY) clause to fix null ptr deref. 2022-07-28 09:28:36 -05:00
Daniel Pouzzner
3ac04fa3ee wolfcrypt/benchmark/benchmark.c: fix gating for #include <unistd.h>. 2022-07-28 09:28:36 -05:00
Disyer
52cc73a6a4 Integrate chacha20-poly1305 into the EVP interface 2022-07-28 13:01:35 +03:00
Sean Parkinson
70c38f2183 Cert: SAN extension critical
Add field to Cert to indicate SAN extension is critical.
Handle the field being set when encoding.
2022-07-28 14:16:56 +10:00