Commit Graph

6645 Commits (565d1b33e5c9a52a0c2752f5ea80f6ca29b08cd1)

Author SHA1 Message Date
David Garske f4191a102b
Merge pull request #5304 from SKlimaRA/SKlimaRA/cert-pathlen
drafted pathlen for cert struct
2022-07-20 07:54:13 -07:00
David Garske aab2459d1f
Merge pull request #5372 from JacobBarthelmeh/copyright
update copyright year to 2022
2022-07-20 07:52:05 -07:00
David Garske c029b23043
Merge pull request #5308 from SparkiDev/ecies_gen_iv
ECIES: Google Pay generates IV and places it before msg
2022-07-20 06:46:14 -07:00
Andrew Hutchings ea34fb1643 Add ECC private key insertion for SE050
This adds a utility function which allows an ECC private key to be
inserted into the SE050's permanent storage.
2022-07-20 10:45:26 +01:00
Stanislav Klima 66c5a947fd XSTRNCPY, fixed typos 2022-07-20 08:56:59 +02:00
Sean Parkinson 09bba3510f ECIES: Google Pay ECIES
Generates IV and places it before msg
Uses 12 byte IV with AES-CTR
Add API to explicitly set KDF salt.
2022-07-20 09:30:47 +10:00
Jacob Barthelmeh 8eaa85e412 update copyright year to 2022 2022-07-19 10:44:31 -06:00
Eric Blankenhorn 8b904e9082 Fix for build with NO_TLS 2022-07-19 11:12:18 -05:00
Stanislav Klima 3d721bd533 more WOLFSSL_CERT_EXT 2022-07-19 11:00:36 +02:00
Stanislav Klima 6ce5f645f3 added ASN template code and WOLFSSL_CERT_EXT, still missing testcase 2022-07-19 10:38:47 +02:00
David Garske feb3f889af
Merge pull request #5369 from embhorn/zd14522
Fix var init in wc_ecc_shared_secret
2022-07-18 14:17:53 -07:00
Chris Conlon c63abe398f
Merge pull request #5321 from miyazakh/tsip_add_usecase 2022-07-18 09:35:43 -06:00
Eric Blankenhorn f55fe7fccd Fix var init in wc_ecc_shared_secret 2022-07-18 09:13:07 -05:00
Andrew Hutchings 8a757ef7cf
Merge pull request #5363 from dgarske/se050_curve25519
Fixes for SE050 Curve25519 endianness
2022-07-15 08:49:27 +01:00
Hideki Miyazaki 15725400a7
addressed review comments 5 2022-07-15 13:46:30 +09:00
David Garske dec8a7fd93 Fixes for SE050 Curve25519 endianness (SDK assumes little endian). Fix for ECC `se050_ecc_shared_secret` use of wrong pointer on error handle free. 2022-07-14 15:34:50 -07:00
David Garske 6cc2665a81
Merge pull request #5358 from SparkiDev/sp_int_armv6
SP int ARM32: replace clz instruction when not supported
2022-07-14 15:32:00 -07:00
JacobBarthelmeh abba59f735 order of array of names for asn template build 2022-07-14 13:15:59 -07:00
JacobBarthelmeh 8862e1f8cf resolve name conflict 2022-07-14 09:41:36 -07:00
Hideki Miyazaki fd885d89eb
Added multi thread use case
Improve not to use forward declaration struct definition

 - include ssl.h rather than forward declaration struct to resolve struct name
 - to include ssl.h, it needs to avoid cyclic reference for crypt structure. therefore, Sha and Aes definitions are moved to another header file
2022-07-14 17:25:21 +09:00
Andrew Hutchings 3f390efb24 Missed a small part of my original SE050 sign fix
Empty keyId handling now exists so we shouldn't return `BAD_FUNC_ARG`.
2022-07-14 07:47:33 +01:00
Andrew Hutchings c211b90aab
Merge pull request #5357 from dgarske/se050_fixes
Fixes for SE050 ED25519 private key loading and Curve25519/ECC handle leak
2022-07-14 07:14:54 +01:00
Jacob Barthelmeh f6c4e295b1 add more subject name support and expande REQ attributes creation support 2022-07-13 22:02:49 -07:00
Sean Parkinson b69af856de Ed ASN template: change for IMPLICIT public key in private key
Fix KATs in test.c to match new expected format.
2022-07-14 10:19:43 +10:00
Sean Parkinson 33b3ebb1e9 SP int ARM32: replace clz instruction when not supported 2022-07-14 09:37:28 +10:00
David Garske 2d5bc72c9b Fixes for ED25519/ED448 private key with public key export (RFC8410). Added length only support. 2022-07-13 16:17:08 -07:00
David Garske 586ae71dac Fixes for SE050 ECC and Curve25519 with TLS. 2022-07-13 10:50:10 -07:00
Stanislav Klima 1b6ce6150e unsigned pathlen 2022-07-13 09:07:02 +02:00
Sean Parkinson 96fe356dd8 SP math
Enable ForceZero for SP math and all RSA.
Disable use of 128-bit type in SP unless WOLFSSL_UINT128_T_DEFINED is
defined.
2022-07-13 14:54:34 +10:00
Daniel Pouzzner dc231dc099 peer review: add explanatory comment for printf() macro in test.c; rearrange test.h to avoid awkward forward declaration and add some topical grouping. 2022-07-12 18:19:52 -05:00
Daniel Pouzzner b64949d564 wolfcrypt/benchmark/benchmark.c: fix gating for #include <errno.h>, and add #include <unistd.h> for _exit(). 2022-07-11 23:15:43 -05:00
Daniel Pouzzner ccc5952369 global fixup to check or explicitly ignore return values from failable library/system calls that weren't already being checked;
add wolfCrypt error codes IO_FAILED_E "Input/output failure" and SYSLIB_FAILED_E "System/library call failed";

tests/api.c and tests/unit.c: flush stdout for error message in Fail() macro, add fflush(stdout) after printf()s, print success message at end of unit_test(), and send several error messages to stderr instead of stdout;

wolfcrypt/test/test.c: add fallthrough macro definition of printf() that pairs it with fflush(stdout);

unit.h: in definition of macro AssertPtr(), add PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\"");

sp_int.c: refactor several lingering instances of "if (0) { ... }" code pattern to #if 0 ... #endif.
2022-07-11 22:28:09 -05:00
David Garske e30899b676
Merge pull request #5334 from LinuxJedi/se050-fixes
Fixes to SE050 port
2022-07-11 16:15:08 -07:00
JacobBarthelmeh 983b9fc5fb
Merge pull request #5343 from dgarske/ecc_oid_coding
Fixes for ECC OID encoding/decoding
2022-07-08 15:38:47 -06:00
David Garske 4892435004 Fix for `wc_ecc_get_curve_id_from_oid` with combinations of `HAVE_OID_ENCODING` and `HAVE_OID_DECODING`. Fix in `SetCurve` for unused `outSz` with `HAVE_OID_ENCODING`. 2022-07-08 13:00:09 -07:00
David Garske 03a32250da Fix for KCAPI HMAC forcing use of software for HKDF. 2022-07-08 09:06:30 -07:00
David Garske 3d124c093e Fix PK function name in log. Remove the ECC logging (spams benchmark with `--enable-debug`). 2022-07-08 09:06:08 -07:00
David Garske c9e9a421e9
Merge pull request #5336 from SparkiDev/aes_ctr_opt
AES-CTR: improve performance when multiple blocks
2022-07-07 21:51:08 -07:00
Sean Parkinson 2bfac42d65 AES-CTR: improve performance when multiple blocks
When in and out aren't the same pointer, for multiples of block size
input:
  - generate the counters into the output buffer
  - encrypt output buffer
  - XOR in the input
Faster than encrypting a block at a time.
2022-07-08 09:56:20 +10:00
Sean Parkinson 70b9833e98 ECC import and export fixes
On raw import, don't import ordinates that are larger than the curve
size.
On export of compressed point, don't export ordinate if it is larger
than the curve size.
2022-07-08 08:54:53 +10:00
Chris Conlon 5e453ad932
Merge pull request #5323 from SparkiDev/sha512_arm32_asm_align 2022-07-07 09:47:37 -06:00
Andrew Hutchings 34d897e433 Fixes to SE050 port
This fixes the following things:

* Memory leaks in SE050 SHA messages
* Add key to SE050 for ECC sign hash function
* Remove circular include
* Correct prototype for `se050_hash_final`
* A few defined check fixes
2022-07-07 16:11:54 +01:00
David Garske a771baf551
Merge pull request #5332 from SparkiDev/memusage_fix_2
SP math: fix configure.ac to allow its use
2022-07-07 07:40:13 -07:00
Daniel Pouzzner 2111d6b179
Merge pull request #5322 from SparkiDev/sp_math_all_arm32_div_word_fix
SP math all: fix div word for ARM32
2022-07-06 22:18:07 -05:00
Sean Parkinson 74baa0dafa SP math: fix configure.ac to allow its use
Choosing SP and SP math was resulting in only integer.c being used.
Fixed now.
Reorder realloc calls for memory logging to ensure scripts can match
allocate and free calls.
2022-07-07 12:16:12 +10:00
Sean Parkinson 992c7b3b6f SP math all: fix div word for ARM32
Fixup sp_mulmod NULL access.
2022-07-07 08:56:31 +10:00
Daniel Pouzzner 82b1dc0cd0 wolfcrypt/src/asn.c: move final return in DecodeECC_DSA_Sig() outside the NO_STRICT_ECDSA_LEN gate, to avoid no-return-from-non-void. 2022-07-06 17:39:59 -05:00
Daniel Pouzzner 7c49449a79 wolfcrypt/src/port/arm/armv8-sha512.c: gate out Sha512_Family_GetHash() in builds that have 224 and 256 bit hashes gated out, to fix unused function warning. 2022-07-06 17:35:15 -05:00
David Garske a7fa7875e4
Merge pull request #5244 from julek-wolfssl/wpas-dpp
Support for new DPP and EAP-TEAP/EAP-FAST in wpa_supplicant
2022-07-06 11:35:52 -07:00
David Garske e92034cf6f
Merge pull request #5274 from JacobBarthelmeh/Certs
remove subject/issuer email from altEmailNames list
2022-07-06 10:48:21 -07:00
gojimmypi 8bb6ff8dbb Espressif HW acceleration update & cleanup 2022-07-06 09:30:49 -07:00
Sean Parkinson 8b73feb8ef SHA-512 ARM NEON: ensure data being hashed is 64-bit aligned 2022-07-06 16:18:18 +10:00
Jacob Barthelmeh ff6edbff94 refactor name constraint checks 2022-07-05 17:20:50 -06:00
David Garske 08488b0fae
Merge pull request #5318 from embhorn/gh5314
Fix typos and bad macro names
2022-07-05 12:34:35 -07:00
John Safranek ded3f4e9b6
Merge pull request #5284 from julek-wolfssl/dtls-good-ch-cb
DTLS 1.3: additions for event driven server in wolfssl-examples
2022-07-05 10:14:59 -07:00
David Garske 1c009e8f91
Merge pull request #5311 from SparkiDev/ed_check_pubkey
Ed25519/Ed448: assume public key is not trusted
2022-07-05 09:25:50 -07:00
Eric Blankenhorn 394f36a0d7 Fix typos and bad macro names 2022-07-05 10:31:11 -05:00
Juliusz Sosinowicz 4caffee590 ForceZero the private key on import error 2022-07-05 13:44:31 +02:00
Juliusz Sosinowicz 8e84560f71 CSR: confirm the signature when verify == VERIFY 2022-07-05 08:49:00 +02:00
Juliusz Sosinowicz ee3636f2e7 wc_EccPublicKeyToDer_ex: exporting the public key in compressed form 2022-07-05 08:48:18 +02:00
Juliusz Sosinowicz 448cde5a4b Support for new DPP in wpa_supplicant
- Add null check to asn template code in MakeCertReq and test
- ENABLED_ECCCUSTCURVES can also be "all"
2022-07-05 08:48:18 +02:00
Sean Parkinson 4a962b7fb2 Ed25519/448: improvements
Check lengths of buffers in import functions.
priv/pub key set flag set on success only.
2022-07-05 09:02:05 +10:00
Andrew Hutchings f8c67345d6 Use the correct mutex type for embOS
OS_MUTEX_Lock() is acutally a non-blocking mutex lock, for
wc_LockMutex() we need a blocking mutex. Switch to this.
2022-07-04 15:59:36 +01:00
Juliusz Sosinowicz c6aa4fc526 DTLS 1.3: allow the server to operate without maintaining state 2022-07-04 11:08:39 +02:00
Daniel Pouzzner b16c2a2aef fix clang-analyzer-deadcode.DeadStores in sp_div(). 2022-07-01 23:49:58 -05:00
Daniel Pouzzner 5819332f89
Merge pull request #5312 from dgarske/fips_v5dev
FIPS in core hash using SHA2-256 and SHA2-384
2022-07-01 23:25:52 -05:00
David Garske b9be5c2c24 Update to FIPS v5-ready will use latest master. Support for FIPS in core hash using SHA2-256 and SHA2-384 in fips_test.h. Fixes for `MATH_INT_T`. Fix `error: ‘tls13_kdf_test’ declared ‘static’ but never defined`. 2022-07-01 15:40:21 -07:00
David Garske bb68766bda For ED255219 and ED448 if importing private only and public key is already set then check it. 2022-07-01 14:13:45 -07:00
Kareem 90749b7f88 Don't declare tls13_kdf_test if TLS 1.3 is not enabled, to avoid unused function warning. 2022-07-01 13:22:16 -07:00
Kareem 96aedc2f47 Fix SetCurve max sizes. Add fix for potentially uninitialized type in ProcessReplyEx. 2022-07-01 13:18:33 -07:00
Kareem 7a7d8d170d Pass in and check output length in SetCurve. 2022-07-01 13:18:33 -07:00
David Garske bd75e1d6a4
Merge pull request #5307 from kareem-wolfssl/miscfixes2
Fix a couple of STM32 bugs, and add some missing mutex frees.
2022-07-01 09:46:22 -07:00
David Garske 0459e83a59
Merge pull request #5310 from SparkiDev/memusage_fix_1
TLS memusage: reduce usage
2022-07-01 09:13:05 -07:00
Sean Parkinson 2c943282f0 Ed25519/Ed448: assume public key is not trusted
In defense against attack, assume the imported public key is not trusted
and check it matches the private key if set.
Added APIs that allow application to explicitly trust public key.
Original APIs default to not trusting public key.
2022-07-01 09:05:43 -07:00
Sean Parkinson b9a8f18a97
Merge pull request #5300 from douzzer/20220629-multi-test-fixes
20220629-multi-test-fixes
2022-07-01 16:22:05 +10:00
Sean Parkinson 7d58dc5678 TLS memusage: reduce usage
Reduce the amount allocated to reduce maximum overall dynamic memory
usage.
Rework ServerKeyExchange by extracting the handling of the signed data.
2022-07-01 14:24:59 +10:00
Kareem 7555cd0685 Fix a couple of STM32 bugs, and add some missing mutex frees. 2022-06-30 16:11:16 -07:00
David Garske 402a4dafd4
Merge pull request #5306 from kareem-wolfssl/ltc_ed235519
Fix missing return checks in KSDK ED25519 code.
2022-06-30 16:06:45 -07:00
Daniel Pouzzner b7ec529f61 wolfcrypt/src/siphash.c: in wc_SipHash(), use FALL_THROUGH macro, not /* fall-through */. 2022-06-30 17:07:35 -05:00
Chris Conlon 867a1f7afa
Merge pull request #5289 from TakayukiMatsuo/tls13 2022-06-30 15:49:53 -06:00
Kareem 13beadbfc3 Fix missing return checks in KSDK ED25519 code. 2022-06-30 13:35:00 -07:00
Stanislav Klima 26a62b4b9e drafted pathlen for cert struct 2022-06-30 17:16:10 +02:00
TakayukiMatsuo ba19737627 Add support for TLS1.3 2022-06-30 23:00:05 +09:00
David Garske e8e35c9a92
Merge pull request #5301 from SparkiDev/aes_gcm_word_ct
AES-GCM: make word implementation of GMULT constant time
2022-06-29 20:26:33 -07:00
Sean Parkinson 8b93d4510d AES-GCM: make word implementation of GMULT constant time
If performance is impacted then define: AES_GCM_GMULT_NCT
2022-06-30 09:29:04 +10:00
Sean Parkinson 0159f17692 SP int math; submod fix
Fix for sp_submod() to reduce by modulus when a or b are equal to
modulus as well as when greater.
2022-06-30 08:53:25 +10:00
Daniel Pouzzner 5adf7e4eb7 wolfcrypt/src/asn.c wc_BuildEccKeyDer(): fix for clang-analyzer-deadcode.DeadStores. 2022-06-28 19:14:58 -05:00
Daniel Pouzzner 90aaeb283e wolfcrypt/src/siphash.c: add missing !WOLFSSL_NO_ASM clause in gate around inline asm. 2022-06-28 18:19:58 -05:00
Daniel Pouzzner ce61653a9a wolfcrypt/src/asn.c: fixes for ARM portability (GetASN_Items()), unintended fallthrough (OidFromId()), and uninitialized variable (DecodeSubjInfoAcc()). 2022-06-28 18:18:42 -05:00
David Garske f51c29d3ca
Merge pull request #5293 from SparkiDev/asnt_setecc
ASN template: Handle HAVE_OID_ENCODING
2022-06-28 15:45:13 -07:00
Sean Parkinson 092b37f709
Merge pull request #5287 from haydenroche5/aes_ctr_clear_left_on_iv_set
Clear the leftover byte count in Aes struct when setting IV.
2022-06-29 08:30:01 +10:00
David Garske 741393e84f
Merge pull request #5291 from kaleb-himes/FRDM-K64-Fixes
Add necessary includes for cross-builds
2022-06-28 09:35:06 -07:00
David Garske d4d7e2e5f2
Merge pull request #5294 from SparkiDev/sp_math_all_no_128bit
SP math all: don't use sp_int_word when SQR_MUL_ASM available
2022-06-28 07:38:42 -07:00
Sean Parkinson 22336d30e5 SP math all: don't use sp_int_word when SQR_MUL_ASM available
1. _WIN64 doesn't have 128-bit type but now can use 64-bit sp_int_digit
when assembly code snippets are being used.
2. Fix sp_div() to support values closer to maximum size.
3. Fix builds to work for more configurations.
4. Have ECC uncompressed code keep intermediate values in range of
maximum (x^3 calculation fixed).
5. Fix configuation.ac's check of FIPS for using signed SP Math All.
Default now not signed as intended.
2022-06-28 15:51:53 +10:00
Sean Parkinson 3c3a90c988 ASN template: Handle HAVE_OID_ENCODING
When HAVE_OID_ENCODING is defined, the named curve OID is encoded rather
than the full OID.
Use SetCurve to get the OID encoding in ASN template implemenation.
2022-06-28 09:04:42 +10:00
kaleb-himes 9d11e9092f Add necessary includes for cross-builds 2022-06-27 13:50:27 -06:00
David Garske 94e7eacc5f
Merge pull request #5072 from JacobBarthelmeh/Compatibility-Layer
add support for importing private only EC key to a WOLFSSL_EVP_PKEY s…
2022-06-27 12:34:00 -07:00
David Garske 456e463640
Merge pull request #5283 from SparkiDev/sp_arm32_asm_rework
SP ASM ARM32: reworked generation using common asm ruby code
2022-06-27 09:17:20 -07:00
David Garske b84b808b1b
Merge pull request #5167 from ejohnstown/cac-ext
Add support for some FPKI certificate cases, UUID, FASC-N, PIV extension
2022-06-27 09:06:15 -07:00
Sean Parkinson 999fa8394e SP ASM ARM32: reworked generation using common asm ruby code
Add support for ARMv6 and ARMv3.
2022-06-27 11:19:50 +10:00
Hayden Roche 10dfd8d129 Clear the leftover byte count in Aes struct when setting IV.
Setting the key already does this. The same needs to be done when setting the
IV.
2022-06-26 15:56:05 +04:00
Daniel Pouzzner 9211825121 sp_int.c: fix refactor of undefined-semantics shift in _sp_mul(). 2022-06-24 18:04:51 -05:00
Jacob Barthelmeh 49740c5543 initialize variables 2022-06-24 15:21:20 -06:00
Daniel Pouzzner 047c662af8 fix math errors unmasked by change to sp-math-all as default math back end. 2022-06-24 15:56:54 -05:00
Jacob Barthelmeh 1977a13754 improve comment for FPKI additions 2022-06-24 12:04:26 -06:00
David Garske 00b82888bc
Merge pull request #4759 from dgarske/sp_math_default
Enable wolfSSL SP Math all (sp_int.c) by default
2022-06-23 16:14:54 -07:00
Jacob Barthelmeh 43e11ec756 improve comments for subject name email matching 2022-06-23 15:52:28 -06:00
JacobBarthelmeh 4de90efbe2 clear out PKEY when setting new key 2022-06-23 14:21:53 -07:00
Jacob Barthelmeh 79ea30a957 memory free on failure, spelling, better function name 2022-06-23 13:40:45 -06:00
David Garske 78d3284c3c Fix for FIPS 140-2 and older ACVP math selection. Fix for building with "--disable-sp-math-all --disable-fastmath". Fix for building SAKKE with `HAVE_WOLF_BIGINT`. 2022-06-23 11:10:44 -07:00
Sean Parkinson ee12c12e98 Fixes required to make SP Math default
fasthugemath means turn on fastmath
Use sp_int_digit and not sp_digit in sp_int.c.
test.c needs to use large static buffer when SP Math used like fastmath.
When building static memroy, SP math all without WOLFSSL_SP_NO_MALLOC is
a valid configuration.
Fix freeing of bigint in sp_int.c.
Cast x to a signed value to negate and then back to unsigned. (For
Windows builds.)
Remove warning about empty file on Windows about integer.obj.
Allow RSA verify only and RSA public only to be used with other public
key algorithms.
If building for FIPS, then older versions of RSA and ECC require SP Math
to support negative numbers.
Get old FIPS files building with SP int.
Disallow --enable-sp-math and --enable-sp-math-all.
When just --enable-sp-math on configuration line then disable SP Math
all.
2022-06-23 14:15:54 +10:00
Sean Parkinson 8d804f6378
Merge pull request #5260 from dgarske/sp_ecc_nb_hash
Fix for SP math ECC non-blocking to always check `hashLen`
2022-06-23 07:59:28 +10:00
Jacob Barthelmeh 7d62fd09e4 remove subject/issuer email from altEmailNames list 2022-06-21 16:59:36 -06:00
David Garske 74d692d6d5 Fix for SP math ECC non-blocking to always check `hashLen`. ZD14141 2022-06-21 15:54:01 -07:00
Chris Conlon 9e1ecf3fb5
Merge pull request #5194 from TakayukiMatsuo/heaphint 2022-06-21 16:39:07 -06:00
Chris Conlon bd536d3c9d
Merge pull request #5229 from miyazakh/sce_example_update 2022-06-21 16:33:54 -06:00
Daniel Pouzzner 69ca1d37c0 fixes for defects identified by wolfssl-multi-test: whitespace, missing void in arg lists, and -Wunused-but-set-variable found by clang-15 (prerelease). 2022-06-20 10:54:55 -05:00
Sean Parkinson 59e19cfd6c
Merge pull request #5258 from dgarske/stm32u5_bench
Fixes for STM32 Hash/PKA and additional benchmark
2022-06-20 08:33:25 +10:00
David Garske 390908bccc
Merge pull request #5236 from SparkiDev/mem_zero
Check memory is zeroized
2022-06-17 12:01:34 -07:00
David Garske 92fcea39db Fix for DES3 with STM32 and `STM32_CRYPTO_AES_ONLY` (broken in #5223) . Add U5 PKA support and benchmarks. Fix MD5 with `OPENSSL_EXTRA` and `HAVE_MD5_CUST_API`. 2022-06-17 11:50:29 -07:00
David Garske 9c5821569f For STM32 hashing to wait for hash done on block size + 1 word. Updated the STM32U5 benchmarks. Added note about new GCM_TABLE_4BIT. 2022-06-17 09:07:45 -07:00
David Garske e34dda9383 Fix to expose the RSA public DER export function with certgen. The core function `SetRsaPublicKey` was being compiled, but the wrappers `wc_RsaKeyToPublicDer` and `wc_RsaKeyToPublicDer_ex` were not included. 2022-06-16 16:36:17 -07:00
Hideki Miyazaki fe8169c830
Add multi thread use case for RA6M4
fix devId conflict while using multi threads

update README

Fix TSIP examples bcause of updating user context
2022-06-17 07:44:12 +09:00
Sean Parkinson 2834c22ce0
Merge pull request #5204 from lealem47/basicConst
Encoding the X509 Basic Constraint when CA:FALSE
2022-06-17 08:33:57 +10:00
David Garske 8c0157c035
Merge pull request #5253 from rizlik/clang_uninit
kdf: fix clang uninitialized.Assign
2022-06-16 11:06:43 -07:00
John Safranek 8f7db87f01
Merge pull request #5249 from dgarske/rsa_ifc
Cleanup the RSA consistency check
2022-06-16 09:14:08 -07:00
Lealem Amedie 5e63740c6c Ensuring that X509 Basic Constraint is set when CA:FALSE 2022-06-16 08:46:52 -07:00
Marco Oliverio 621f4f14af kdf: fix clang uninitialized.Assign
commit f1ce0cc95d tigger static analyzer warnings
about unitialized assign.
2022-06-16 13:55:46 +02:00
David Garske 6d2a41b9fd Enable wolfSSL SP Math all (sp_int.c) by default. If `--enable-fastmath` or `USE_FAST_MATH` is set the older `tfm.c` fast math will be used. To use the old `integer.c` heap math use `--enable-heapmath` or `USE_INTEGER_HEAP_MATH`. 2022-06-16 10:57:30 +10:00
Sean Parkinson 8145ee6cef TFM: mp_exptmod_ex didn't handle exceptional cases
fp_exptmod_ex() changed to match execptional case handling in
fp_exptmod().
2022-06-16 10:47:00 +10:00
Sean Parkinson 1b29f7353a Check memory is zeroized
Add a define WOLFSSL_CHECK_MEM_ZERO to turn on code that checks that
memory that must be zeroized before going out of use is zero.
Everytime sensitive data is put into a allocated buffer or stack buffer;
the address, its length and a name is stored to be checked later.
Where the stack buffer is about to go out of use, a call is added to
check that the required parts are zero.

wc_MemZero_Add() adds an address with length and name to a table of
addressed to be checked later.
wc_MemZero_Check() checks that the memory associated with the address is
zeroized where required.
mp_memzero_add() adds mp_int's data pointer with length and name to
table.
mp_memzero_check() checks that the data pointer is zeroized where
required.

Freeing memory will check the address. The length was prepended on
allocation.
Realloction was changed for WOLFSSL_CHECK_MEM_ZERO to perform an
allocate, check, copy, free.
2022-06-16 10:22:32 +10:00
David Garske 7e1549c684 Cleanup the RSA consistency check. Should only be enabled for FIPS v2 (3389), FIPS v5 or later. Can be forcefully enabled for non-FIPS using `WOLFSSL_RSA_KEY_CHECK`. The existing `WOLFSSL_NO_RSA_KEY_CHECK` macro will also disable it. This change was introduced in PR #4359. 2022-06-15 14:46:23 -07:00
David Garske fb704774a0
Merge pull request #4907 from rizlik/dtls13
DTLSv1.3 support
2022-06-15 13:57:02 -07:00
David Garske dab0d5a7b0
Merge pull request #5240 from SparkiDev/sp_armv6
SP ARM32: support for arch with no ldrd/strd and clz
2022-06-15 11:28:30 -07:00
Marco Oliverio 9d22e11776 misc.c: introduce w64wrapper to handle 64bit numbers
as word64 is not always available, introduce an abstract type and companion
operations. They use a word64 if available and fallback on word32[2] otherwise.
2022-06-15 10:46:42 -07:00
Sean Parkinson e073500e8e SP ARM32 ASM: Improve performance of P-256 mont mul/sqr 2022-06-15 16:39:13 +10:00
Sean Parkinson af4fff80db SP ARM32: support for arch with no ldrd/strd and clz
Defined WOLFSSL_SP_ARM_ARCH to be less than 7 to use alternative
instructions.
2022-06-15 12:07:49 +10:00
Sean Parkinson f1ce0cc95d Memory zeroization fixes
Zeroize secrets in stack buffers and allocated memory.
mp_forcezero to ensure private MP integers are zeroized.
Fix whitespace and add some comments.
2022-06-15 11:26:11 +10:00
Sean Parkinson ed5470c991
Merge pull request #5239 from dgarske/asn_decode_ext
Fix for ASN template parsing of extended key usage
2022-06-15 09:29:44 +10:00
David Garske ed6c9639d6
Merge pull request #5243 from douzzer/20220614-multi-test-fixups
20220614-multi-test-fixups
2022-06-14 16:11:44 -07:00
Daniel Pouzzner f414e65d4b linuxkm: eliminate duplicative WOLFSSL_KTHREADS macro (just use WOLFSSL_LINUXKM). 2022-06-14 12:45:30 -05:00
David Garske 7a25b9cd85
Merge pull request #5241 from SparkiDev/wycheproof_sp_arm64_asm
SP ASM: fixes for Wycheproof tests
2022-06-14 09:08:15 -07:00
David Garske fb10c90935 Fix for Cube HAL v2 back-to-back DES/DES3. Whitespace. Enable the new FIFO 16 block logic for all hardware that supports it. 2022-06-14 11:48:51 +02:00
David Garske c52c2e5dfb Fixes for STM32H7 hash and crypto. 2022-06-14 11:48:51 +02:00
David Garske ad3f7e1de2 The STM32U5 does not support DES3 or AES 192-bit (only 128/256 bit) 2022-06-14 11:48:51 +02:00
David Garske 502cbc3847 Fix for STM32U5 hash/crypto support. ZD 14305. 2022-06-14 11:48:51 +02:00
Sean Parkinson 013066ca06 SP ASM: fixes for Wycheproof tests
ARM64 ASM: Fix P256 Montogomery Reduce.
Fix div to handle large dividend word.
2022-06-14 16:11:46 +10:00
David Garske c0f49b57e1 Fix for ASN template parsing of `DecodeExtKeyUsage`. ZD 14344. 2022-06-13 16:50:20 -07:00
David Garske af3a55a94c
Merge pull request #5220 from kaleb-himes/ZD14318
Resolves inter-library API conflict reported in ZD14318
2022-06-13 14:28:13 -07:00
David Garske f401a3b53d
Merge pull request #5232 from cconlon/june10
test/benchmark.c: rename Android tag, reset vars in memcb_test()
2022-06-13 14:24:17 -07:00