19082 Commits

Author SHA1 Message Date
Sean Parkinson
20ae076b80 integer.c: fast mod reduce fix
When using small stack, not enough memory uas being allocated in
fast_mp_montgomery_reduce().
Allocate the required space and memset all used memory.
2023-02-07 11:29:53 +10:00
David Garske
2448adf68b
Merge pull request #6051 from philljj/zd15531
Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
2023-02-06 12:46:21 -08:00
David Garske
cc037447dd
Merge pull request #6062 from bandi13/disableOpenWrtSnapshot
Disable latest OpenWrt test
2023-02-06 08:06:31 -08:00
Andras Fekete
dc08ecf287 Disable latest OpenWrt test 2023-02-06 11:03:41 -05:00
David Garske
8a212ec351
Merge pull request #6042 from SparkiDev/ec_point_set
EC OpenSSL compat: validate point after setting
2023-02-06 07:14:19 -08:00
Sean Parkinson
c9fefe660f EC OpenSSL compat: validate point after setting
wolfSSL_EC_POINT_set_affine_coordinates_GFp wasn't checking the point is
valid for the curve. Added call to check point when setting.
Made check available for opensslextra.
Fixed test to have valid ordinates to set.
2023-02-06 12:22:17 +10:00
David Garske
a8c2a9aeab
Merge pull request #6040 from SparkiDev/sp_invmod_mont_ct_err
SP int: sp_invmod_mont_ct check err before setting
2023-02-05 14:17:51 -08:00
David Garske
3cdda2adf0
Merge pull request #6056 from ejohnstown/ssh-kdf-inlines
Build Fixes
2023-02-04 10:37:16 -08:00
David Garske
a4ffe085a0
Merge pull request #6052 from rizlik/fix_ret_create
fix: propagate WOLFSSL_TICKET_RET_CREATE from DoDecryptTicket()
2023-02-03 17:32:26 -08:00
John Safranek
8e57ff08ab
Build Fixes
./configure --enable-wolfssh --enable-cryptonly \
        --disable-asn --disable-rsa --disable-ecc
./configure --disable-asn --disable-rsa --disable-ecc --enable-psk
./configure --enable-cryptonly --disable-asn --disable-rsa --disable-ecc

1. Fails compiling the KDF file, can't find c32toa inline function.
2. In configure, move the check for ECC when ASN is disabled up to the
   other ASN checks. It also needs to be checked with cryptonly is
   disabled.
2023-02-03 16:09:27 -08:00
Marco Oliverio
a9ffbae7af test: add test to check new ticket is created when resuming 2023-02-03 22:16:06 +00:00
David Garske
646b363e49
Merge pull request #6053 from JacobBarthelmeh/freebsd
fix DTLS test case for when able to read peers close notify alert
2023-02-03 14:10:33 -08:00
David Garske
c6018b837d
Merge pull request #6050 from JacobBarthelmeh/time
fix warning if ltime is unsigned
2023-02-03 11:06:17 -08:00
JacobBarthelmeh
f55f9bfd36 fix DTLS test case for when able to read peers close notify alert 2023-02-03 11:05:56 -08:00
David Garske
29c884eafd
Merge pull request #6045 from JacobBarthelmeh/PKCS7
add sequence around algo parameters with authenvelop
2023-02-03 10:29:19 -08:00
David Garske
1027c0667a
Merge pull request #6049 from SparkiDev/sp_int_used_size
SP int: make used and size fields unsigned
2023-02-03 09:38:40 -08:00
Marco Oliverio
a2bf82397a fix: propagate WOLFSSL_TICKET_RET_CREATE from DoDecryptTicket() 2023-02-03 17:33:24 +00:00
jordan
f61dce8746 Fix wolfSSL_ASN1_INTEGER_to_BN for negative values
Added mp_setneg for ZD#15531.
2023-02-03 08:51:46 -06:00
Jacob Barthelmeh
d184a17644 fix warning if ltime is unsigned 2023-02-03 07:43:08 -07:00
Sean Parkinson
3455e726f9 SP int: make used and size fields unsigned
used and size have no reason to be negative - change type.
Change code to match unsigned change. Mostly change variables to be
unsigned where possible.
integer.c: Only have mp_rand_prime available when needed and
mp_prime_is_prime_ex is available.
Fixes from regression testing.
2023-02-03 17:09:56 +10:00
David Garske
ef266d7e0b
Merge pull request #6047 from SparkiDev/refinc_ret_check
Ref counting: rework for static analysers
2023-02-02 18:46:34 -08:00
David Garske
8ecf6f3381
Merge pull request #6046 from ejohnstown/srtp-marshal
SRTP Marshaling
2023-02-02 18:03:31 -08:00
Sean Parkinson
f6da3a26ac Ref counting: rework for static analysers
When always reference counting APIs always return 0 don't check return
value for error.
Reference decrement set isZero to false on error.
2023-02-03 10:13:32 +10:00
John Safranek
ca999f932c
SRTP Marshaling
1. Changed the loop over the SRTP setting bitfield when it is encoded
   for the TLS extension.
2023-02-02 14:51:12 -08:00
JacobBarthelmeh
9e9315f480 add sequence around algo parameters with authenvelop 2023-02-02 10:54:38 -08:00
David Garske
a4f55b01d6
Merge pull request #6041 from JacobBarthelmeh/seco
Fix to mask the argument for enc/dec flag used with GCM/CCM in CAAM+SECO build
2023-02-02 08:32:48 -08:00
Sean Parkinson
447991a9c2
Merge pull request #5949 from JacobBarthelmeh/Testing
add pragram around sanity check for vcpkg build warning
2023-02-02 10:34:14 +10:00
Sean Parkinson
55d43a46b8 SP int: sp_invmod_mont_ct check err before setting
Two places in sp_invmod_mont_ct were not checking err is set before
performing a new operation and setting err. Change to check error before
performing operation.
2023-02-02 08:45:45 +10:00
JacobBarthelmeh
d76195c52a add fix GCM use with CAAM SECO 2023-02-01 14:42:39 -08:00
David Garske
087e2dc22a
Merge pull request #6037 from douzzer/20230131-fixes-evp-af-alg
20230131-fixes-evp-af-alg
2023-02-01 07:09:02 -08:00
Daniel Pouzzner
a8a61fe6b7 evp.c: fix gating in wolfSSL_EVP_CIPHER_CTX_cleanup() to avoid switch-unreachable; also fix indentation. 2023-02-01 01:29:36 -06:00
Daniel Pouzzner
38c057a084 fix resource leak (missing calls to wc_AesFree()) in wolfSSL_EVP_CIPHER_CTX_cleanup();
fix file descriptor leaks in AF_ALG code, and fix return codes (WC_AFALG_SOCK_E, not -1) in afalg_aes.c;

fixes for sanitizer-detected forbidden null pointer args in AfalgHashUpdate() and AfalgHashCopy();

fixes for resource leaks in api.c test_wolfSSL_AES_cbc_encrypt() (missing wc_AesFree()s);

fixes for resource leaks in test.c openssl_test() (missing wolfSSL_EVP_CIPHER_CTX_cleanup());

also some local fixes for bugprone-signed-char-misuse, readability-redundant-preprocessor, and clang-diagnostic-strict-prototypes, in src/pk.c and src/ssl.c.
2023-02-01 00:49:34 -06:00
Anthony Hu
462f76c1ff
Merge pull request #6033 from dgarske/stm32_fixes
Fixes and cleanups for STM32
2023-01-31 12:13:13 -05:00
David Garske
9defb9a356
Merge pull request #6035 from gojimmypi/PK_SSL_init_vars
Initialize `OPENSSL_ALL` local size / length / type vars
2023-01-31 09:09:18 -08:00
David Garske
9b6e787071
Merge pull request #6034 from gojimmypi/Espressif_fix_6024
ESP32 SHA384 fixes
2023-01-31 09:08:54 -08:00
David Garske
934d8e274f
Merge pull request #5926 from SparkiDev/openssl_ec_api_rework
EC OpenSSL compat: rework EC API
2023-01-31 09:08:26 -08:00
gojimmypi
b10adae48f Initialize OPENSSL_ALL local size / length / type vars 2023-01-30 17:30:56 -08:00
gojimmypi
53d6e79f89 ESP32 SHA384 fixes 2023-01-30 16:58:57 -08:00
David Garske
2d03a052e1 Fixes and cleanups for STM32:
* Fix for STM32 Hash peripherals (like on F437) with FIFO depth = 1.
* Cleanups for `XREALLOC` and new `WOLFSSL_NO_REALLOC` to force undef of `XREALLOC`.
* Change STM32 Cube to default to `NO_TLS_UART_TEST`.
2023-01-30 16:44:47 -08:00
Sean Parkinson
7691cd4b45 EC OpenSSL compat: rework EC API
Reworked the implementations of the EC APIs including:
wolfSSL_EC_curve, wolfSSL_EC_METHOD, wolfSSL_EC_GROUP,
wolfSSL_EC_POINT, wolfSSL_EC_KEY, wolfSSL_ECDSA_SIG, wolfSSL_ECDSA and
wolfSSL_ECDH.

Added support for EC parameters to PEM decoding.

EccEnumToNID() moved out of wolfCrypt - it maps NIDs defined in
wolfssl/openssl/ec.h to those in wolfssl/wolfcrypt/ecc.h.
Moved wc_OBJ_sn2nid() out of wolfCrypt - implementation uses
EccEnumToNID().

Changed reference counding to use wolfSSL_Ref.

Added tests to api.c that increase coverage of EC APIs.
2023-01-31 10:19:57 +10:00
David Garske
08538b69f3
Merge pull request #6016 from SparkiDev/sp_dh_agree_uinit
DH and SP: sp_DhExp_* called with uninitialized outLen
2023-01-30 15:56:46 -08:00
David Garske
66532ed052
Merge pull request #6032 from anhu/braces
Closing and opening scope around case statement.
2023-01-30 15:08:02 -08:00
David Garske
daa82e4653
Merge pull request #6030 from SparkiDev/sp_ecc_p256_arm64
SP Aarch64 ECC P256: mont reduce fix
2023-01-30 15:07:29 -08:00
Sean Parkinson
7cdf5c7956 SP Aarch64 ECC P256: mont reduce fix
For Montgomery Reduction of P256: Don't set x10 and x11 to words of mu
<< 32. x11 is needed later and there are plenty of registers.
2023-01-30 11:14:12 -08:00
David Garske
420f2f45c1
Merge pull request #6019 from SparkiDev/sp_arm64_cc
SP Aarch64: conditional changed in asm needs "cc"
2023-01-30 11:06:53 -08:00
Anthony Hu
242dcb0141 Closing and opening scope around case statement.
Related: ZD 15451
2023-01-30 13:45:03 -05:00
András Fekete
414c72adbc
Fix workflow concurrency (#6031)
* First test of the consolidated workflows
Co-authored-by: Andras Fekete <andras@wolfssl.com>
2023-01-30 10:10:54 -08:00
András Fekete
d72ea6101f
Merge pull request #6027 from SparkiDev/sp_int_div_small
SP int: div small static code analysis change
2023-01-30 10:34:05 -05:00
Sean Parkinson
0e16d2919f
Merge pull request #6022 from douzzer/20230127-fixes
20230127-fixes
2023-01-30 08:46:42 +10:00
Sean Parkinson
08afe6a404 SP int: div small static code analysis change
_sp_div_small: Make it explicit as possible that we only want the bottom
digit of the product subtracted from the bottom word of t. Top digit is
unnecessary and more cycles used if calculated.
2023-01-30 08:40:45 +10:00