Commit Graph

7383 Commits

Author SHA1 Message Date
Daniel Pouzzner
f2c97d5d35 fixes for various wolfcrypt -Wconversions visible only on compilers that promote byte and word16 to signed int, then warn of a sign conflict when an intrinsically safe result is assigned back to the original type. 2023-05-09 23:55:08 -05:00
David Garske
62a4329f8e Merge pull request #6379 from SparkiDev/sp_int_gcd_fix
SP int; fix sp_gcd error checking
2023-05-07 12:11:29 -07:00
Sean Parkinson
d342e341d8 SP int; fix sp_gcd error checking
r can be as large as the smaller of a and b.
Fix sign check.
Add comments as to what GCD does.
2023-05-05 09:11:47 +10:00
Sean Parkinson
55a91c2b55 Minor fixes
configure.ac: Don't use == in test.
client.c: Merge string to one line.
asn.c/asn_public.h:
  fix conversion warnings/errors.
  wc_Asn1_Print no longer public and doesn't need to check for NULL.
  wc_Asn1_PrintAll check all pointer parameters for NULL.
2023-05-05 08:43:50 +10:00
David Garske
6e572cc91d Merge pull request #6352 from SparkiDev/asn1_print
ASN.1 print utility: asn1
2023-05-04 10:55:47 -07:00
David Garske
4cdf32e497 Merge pull request #6333 from SparkiDev/memusage_6
Memory usage improvements
2023-05-04 09:14:24 -07:00
gojimmypi
82e502d8a2 WOLFSSL_SP_INT_NEGATIVE declaration for all Espressif chipsets (#6374)
* WOLFSSL_SP_INT_NEGATIVE declaration for all Espressif chipsets
* correct naming for WOLFSSL_SHA384 on ESP32-C3
2023-05-04 08:04:25 -07:00
Sean Parkinson
d2afe9e5e0 Memory usage improvements
ECC: make private key field 'k' able to be smaller when ALT_ECC_SIZE is
defined.
WOLFSSL_SMALL_STACK_CACHE: allocate temps using new macros.
2023-05-04 10:26:57 +10:00
Sean Parkinson
9cdee20a7d ASN.1 print: implementation to parse and print added
New API to parse and print DER/BER data from a buffer.
Add an example to parse DER, Base64 and PEM files and print out ASN.1 items.
2023-05-04 09:57:44 +10:00
John Bland
6369b1e9ec Merge pull request #6371 from dgarske/lowres
Fixes and improvements for building with low footprint
2023-05-03 19:33:53 -04:00
JacobBarthelmeh
f05543c9e5 Merge pull request #6370 from SparkiDev/sp_int_copy_change
SP int: _sp_copy don't check a == b, change calls to _sp_copy
2023-05-03 08:30:55 -06:00
David Garske
4b90afa37b Provide way to disable ASN but have wc_RsaPublicKeyDecodeRaw, which doesn't need ASN.1 parsing. 2023-05-02 18:10:25 -07:00
David Garske
61dfbf5ef2 Fixes and improvements for building with low footprint. Fix for ASN template with RSA verify only (was missing mp_leading_bit). Fix to allow disabling DRBG with crypto callbacks enabled. Updated the wolfTPM user_settings.h template with low resource option. 2023-05-02 16:51:41 -07:00
Sean Parkinson
1a8f09d013 Merge pull request #6320 from JacobBarthelmeh/curl
smaller sized build with curl
2023-05-03 07:46:29 +10:00
Sean Parkinson
c3a8476b95 SP int: _sp_copy don't check a == b, change calls to _sp_copy
Simplify code to make it easier for software analysers.
Reduce work done by using _sp_copy instead of sp_copy where possible.
2023-05-03 07:44:28 +10:00
JacobBarthelmeh
58b996353b Merge pull request #6266 from dgarske/zd15938_async_ecc
Fix for async ECC shared secret state
2023-05-02 12:01:31 -06:00
JacobBarthelmeh
06d5897233 Merge pull request #6362 from dgarske/stm32_hash
Improved fix for STM32 hashing on U5
2023-05-01 16:30:57 -06:00
David Garske
72ffa743a0 Fix for async ECC shared secret. ZD 15938 2023-05-01 15:30:03 -07:00
JacobBarthelmeh
ef955c620f refactor evp.c to group all MD digest functions togther 2023-05-01 13:23:48 -07:00
David Garske
7576380635 Improved fix for STM32 hashing on U5 2023-05-01 13:13:00 -07:00
Kareem
f6cdcfcf9f Fix wc_PeekErrorNodeLineData not unlocking error queue on error. 2023-04-28 16:35:49 -07:00
JacobBarthelmeh
6b2aca1418 Merge pull request #6347 from SparkiDev/sp_int_armv6_clz
SP int ARMv6: clz not available, correct #if
2023-04-28 09:43:58 -06:00
Sean Parkinson
f8559b745e Merge pull request #6351 from douzzer/20230427-linuxkm-simd-fixes
20230427-linuxkm-simd-fixes
2023-04-28 11:20:20 +10:00
Daniel Pouzzner
448f1ec9e7 linuxkm: in {save,restore}_vector_registers_x86(), check if vector register file has already been saved and invalidated, and if so, inhibit the kernel_fpu_{begin,end}() wrap and instead just use preempt_{disable,enable}() wraps. 2023-04-27 17:48:32 -05:00
Daniel Pouzzner
8a89303b49 wolfcrypt/test/test.c: add TEST_FAIL() macro (counterpart to incumbent TEST_PASS()), by default same as incumbent functionality, but #ifdef TEST_ALWAYS_RUN_TO_END, print errors as they occur but continue to end. 2023-04-27 17:46:56 -05:00
Kareem
1172354664 Fix PowerPC inline assembly on old GNU as. It does not like an empty clobbered register line, so simply omit the line. 2023-04-27 14:54:51 -07:00
JacobBarthelmeh
7b52913451 Merge pull request #6345 from kareem-wolfssl/zd16035
Fix getting key size in stm32_ecc_sign_hash_ex.
2023-04-27 13:32:47 -06:00
JacobBarthelmeh
bbad64649b Merge pull request #6340 from SparkiDev/minor_fixes_1
Minor fixes
2023-04-27 10:02:06 -06:00
Sean Parkinson
d901433999 SP int ARMv6: clz not available, correct #if
Checking for architecture less than 7 to use clz instruction when clz is
only guaranteed to be available in 7 or more. Reverse logic.
2023-04-27 09:41:31 +10:00
JacobBarthelmeh
ca4a17ebf6 Merge pull request #6339 from SparkiDev/asn_orig_ocsp_fix
ASN original, OCSP: fix maximum size calc to GetDateInfo
2023-04-26 16:36:55 -06:00
Kareem
e7e2713bba Fix getting key size in stm32_ecc_sign_hash_ex. 2023-04-26 15:00:59 -07:00
JacobBarthelmeh
ccb9bdd903 set dev ID with signature check (#6318)
* set dev ID with signature check

* refactor devId use and add API to set devId in WOLFSSL_CERT_MANAGER structure

* add api.c call to set devid with WOLFSSL_CERT_MANAGER

* resolving devID CRL issue and CM pointer

* add device find callback

* add simple test case
2023-04-26 11:19:00 -07:00
David Garske
3556b7adb7 Merge pull request #6338 from JacobBarthelmeh/certs
revert WOLFSSL_NO_ASN_STRICT macro guard
2023-04-26 11:16:04 -07:00
JacobBarthelmeh
32c6a66a4e Merge pull request #6341 from douzzer/20230425-analyzer-coddling
20230425-analyzer-coddling
2023-04-26 11:22:23 -06:00
Chris Conlon
4526df6d78 Merge pull request #6199 from JacobBarthelmeh/PKCS7
add messageDigest attribute if adding any custom signed attributes
2023-04-26 09:23:22 -06:00
Daniel Pouzzner
5538d65a79 wolfcrypt/src/asn.c: add to DecodeCertInternal() a workaround for an apparent clang-tidy bug, gated on WOLFSSL_CLANG_TIDY, and add a missing cast to mollify -Wconversion;
wolfssl/wolfcrypt/sp_int.h: refactor MP_INT_SIZEOF() using sizeof(sp_int_minimal) and addition, rather than sizeof(sp_int) and subtraction, for clarity and analyzer mollification.
2023-04-26 00:05:37 -05:00
Sean Parkinson
5b0c017a94 ASN original, OCSP: fix maximum size calc to GetDateInfo
GetDateInfo called with a local index (reset to 0) but size is of
original buffer. Subtract the index into original buffer from size to
get size available for parsing.
2023-04-26 11:18:29 +10:00
Sean Parkinson
a5a4c71121 Minor fixes
EncryptContent() - id not initialized
sp_int.c: cast count to int to ensure same type comparison with i.
2023-04-26 11:05:07 +10:00
Sean Parkinson
c4233e7aec Merge pull request #6288 from JacobBarthelmeh/Testing
avoid callback buffer overwrite with sha512_224 and remove min from w…
2023-04-26 08:36:20 +10:00
Sean Parkinson
7fb9540176 Merge pull request #6337 from JacobBarthelmeh/fuzzing
add sanity check on PKCS7 index value
2023-04-26 08:33:25 +10:00
JacobBarthelmeh
71f71074f8 revert WOLFSSL_NO_ASN_STRICT macro guard 2023-04-25 13:32:19 -07:00
Jacob Barthelmeh
bbe9c694a6 more specific naming for attribute types 2023-04-25 13:56:29 -06:00
JacobBarthelmeh
d701a0a06e add sanity check on PKCS7 index value 2023-04-25 08:30:33 -07:00
JacobBarthelmeh
57de292d19 add guard for random with CAAM + MQX 2023-04-24 16:29:22 -07:00
JacobBarthelmeh
a991ce1a6b Merge pull request #6327 from SparkiDev/memusage_5
Memory usage improvements
2023-04-24 16:42:56 -06:00
JacobBarthelmeh
e1d1bef085 Merge pull request #6321 from SparkiDev/sp_int_missing_brace
SP int: missing brace
2023-04-24 10:00:39 -06:00
Sean Parkinson
2d06718857 Memory usage improvements
TLS 1.3 Server: don't cache the messages for Ed25519/Ed448 when doing
TLS 1.3.

ASN DecodeCertInternal: Call GetCertName for issuer and subject after
freeing the dataASN.
2023-04-24 11:12:00 +10:00
Sean Parkinson
865581704e Merge pull request #6312 from philljj/zd15961
Fix out-of-bounds write in fp_mod_2d.
2023-04-24 08:03:02 +10:00
JacobBarthelmeh
60d059fc9e Merge pull request #6305 from SparkiDev/sp_radix_size_stack_fix
SP int: sp_radix_size when radix 10 fix temp size
2023-04-21 09:59:56 -06:00
JacobBarthelmeh
e194c90b3e Merge pull request #6326 from SparkiDev/ecc_key_max_bits_fix
ECC: max bits for a key must handle order as well
2023-04-21 09:47:42 -06:00