20026 Commits

Author SHA1 Message Date
David Garske
a56fe30c2c Fixes and cleanups for Keil MDK examples. Combine duplicate user_settings.h. Use SP math all by default. Disable old/deprecated algorithms. Add CMSIS RTOS timer support for TLS and benchmark. 2023-06-22 16:48:17 -06:00
David Garske
3cb0b4ab29
Merge pull request #6410 from embhorn/zd15856
Update EBSNET port
2023-06-21 21:35:19 -07:00
David Garske
6697181081
Merge pull request #6500 from SparkiDev/tests_api_expect_4
Test api.c: change more tests to use Expect instead of Assert
2023-06-21 17:17:37 -07:00
David Garske
fb35526b73
Merge pull request #6528 from kareem-wolfssl/trustedCaKeys
Fix trusted_ca_keys, refactor MAX_X509_SIZE
2023-06-21 17:07:55 -07:00
Kareem
e6017dc546 Refactor MAX_X509_SIZE into a define so it can be overriden in build settings. 2023-06-21 15:35:29 -07:00
Kareem
75c8d87353 Fix trusted_ca_keys extension allowed logic. 2023-06-21 15:35:29 -07:00
Sean Parkinson
e467112a93 Test api.c: change more tests to use Expect instead of Assert
Changed EXPECT_DECL to start of as TEST_SKIPPED.
Modified other EXPECT macros appropriately.
Change test functions to not use 'res' when EXPECT_DECL is used.

memory.c:
  wc_MemFailCount_Init(): don't declare variable after a statement

conf.c:
wolfSSL_TXT_DB_read(): free the whole WOLFSSL_TXT_DB on failure
instead of just the memory
wolfSSL_CONF_add_string(): pop the value added into section->value
(sk) if it can't be pushed onto conf->data
  wolfSSL_NCONF_load(): free the new value if it wasn't able to be added

ocsp.c:
  wolfSSL_OCSP_cert_to_id():
free the decoded certificate if parsing failed (is freed after use
otherwise)
free the certificate id on failure and make it NULL and continue
freeing other variables

pk.c:
wolfSSL_RSA_set0_crt_params(): set dmp1, dmq1 and iqmp fields to NULL
if setting the internal failed - returns error and caller needs to free
the passed in BNs
wolfSSL_RSA_set0_factors(): set p and q fields to NULL if setting the
internal failed - returns error and caller needs to free the passed in
BNs
wolfSSL_RSA_set0_key(): set n, e abd d fields to NULL if setting the
internal failed - returns error and caller needs to free the passed in
BNs

x509.c:
wolfSSL_X509_set_serialNumber(): explicit NULL
checkwolfSSL_X509_REQ_add1_attr_by_NID(): check whether push succeeded
and on failure free attribute

asn.c:
ConfirmSignature(): for DSA, allocate separately to ensure no leak on
memory allocation failure.

dh.c:
wc_DhGenerateParams(): ensure tmp and tmp2 are able to be cleared on
error

evp.c:
wolfSSL_EVP_PKEY_CTX_add1_hkdf_info(): fix realloc use to no leak on
failure
  wolfSSL_EVP_CIPHER_CTX_iv_length(): handle ctx being NULL.
2023-06-22 08:21:17 +10:00
Eric Blankenhorn
53fe93430e Update EBSNET port 2023-06-21 15:52:42 -05:00
David Garske
8473275fc6
Merge pull request #6529 from kareem-wolfssl/openwrt21.02Fix
Workaround for removed kmods repo in OpenWRT 21.02.
2023-06-21 13:19:40 -07:00
JacobBarthelmeh
2d28b492b0
Merge pull request #6501 from dgarske/ecc_comp
Fix for SP math all and ECC with compressed keys (missing sp_add_d)
2023-06-21 12:01:06 -07:00
Kareem
9f24217e26 Workaround for removed kmods repo in OpenWRT 21.02. 2023-06-21 11:53:30 -07:00
David Garske
1bff338e37
Merge pull request #6507 from bandi13/fix_certs_ocsp_renewcerts
Fix certs ocsp renewcerts
2023-06-21 11:26:59 -07:00
David Garske
9204101e94
Merge pull request #6517 from douzzer/20230615-opensslextra-wolfSSL_ERR_reason_error_string
20230615-opensslextra-wolfSSL_ERR_reason_error_string
2023-06-21 11:06:51 -07:00
David Garske
aaf2408851
Merge pull request #6504 from SparkiDev/bench_embedded_scrypt
test.c, scrypt: bench embedded reduce heap usage
2023-06-21 11:06:26 -07:00
David Garske
0e2c32f726
Merge pull request #6505 from SparkiDev/alt_ecc_cryptocb
ECC, ALT_ECC_SIZE, CryptoCB: ensure err is 0 in _ecc_make_key_ex
2023-06-21 11:05:53 -07:00
David Garske
70c3e84735
Merge pull request #6503 from SparkiDev/mp_test_tfm_mips
TFM: fix big endian reading a zero length buffer
2023-06-21 11:05:40 -07:00
David Garske
3b3c175af0
Merge pull request #6521 from ejohnstown/readme
Update Readme
v5.6.3-stable
2023-06-18 21:16:56 -07:00
John Safranek
c322e1f7f8
update readme 2023-06-18 20:24:28 -07:00
David Garske
d967aae501
Merge pull request #6518 from ejohnstown/release-5.6.3
Release 5.6.3
2023-06-16 12:08:23 -07:00
John Safranek
42e934b251
Update read-me and change-log for the release. 2023-06-16 09:47:35 -07:00
David Garske
4741a0b696
Merge pull request #6508 from JacobBarthelmeh/fuzzing
sanity check on send fatal alert return
2023-06-15 20:13:49 -07:00
David Garske
78b78428e7
Merge pull request #6512 from SparkiDev/math_enc_mem_exptmod
Math, Encrypted Memory: mod exp fix
2023-06-15 19:52:41 -07:00
Sean Parkinson
e17f86d145 TFM: fix big endian reading a zero length buffer
Bail early as big endian implementation doesn't handle it.
2023-06-16 10:58:51 +10:00
Sean Parkinson
beef8b0014 outputBuffer - use idx field
dtls13.c:
Change end of outputBuffer data calculations to use function
GetOutputBuffer().
  Use idx when calculating unused byte count of outputBuffer.

internal.c:
Change end of outputBuffer data calculations to use function
GetOutputBuffer().
  Use GetOutputBuffer() to calculate end of data in outputBuffer.
  GrowOutputBuffer():
Calculate new size to allocate to include already written data in
case of static buffer.
    Copy all data including already written count (idx).
  CheckAvailableSize():
    Don't subtract idx from length when checking MTU size.
Do subtract idx from bufferSize to determine count of unused bytes
in outputBuffer.
2023-06-16 10:29:52 +10:00
Sean Parkinson
a1e8aa7269 test.c, scrypt: bench embedded reduce heap usage
Don't do scrypt test cases that allocate 1MB of memory when
BENCH_EMBEDDED is defined.
2023-06-16 10:16:34 +10:00
Daniel Pouzzner
970663f8a1 in wolfSSL_ERR_reason_error_string(), unconditionally convert positive error codes to negative, and in switch(), match against negated values of OpenSSL positive codes like WOLFSSL_ERROR_WANT_READ. fixes #6514 2023-06-15 17:42:03 -05:00
Sean Parkinson
7153dd70a6 Math, Encrypted Memory: mod exp fix
The modular exponentiation implementations in sp_int.c and tfm.c are not
safe when using Encrypted Memory.
Cannot have two pieces of memory where one changes and the other doesn't
based on private value.
Use extra variable to hold the two new values and assign them both back
at the same time in a safe manner.

Alternative implementations used when WC_PROTECT_ENCRYPTED_MEM is
defined.
2023-06-16 07:28:47 +10:00
JacobBarthelmeh
5b81dc47d2 adjust location used for writing to output buffer 2023-06-14 21:01:12 -07:00
JacobBarthelmeh
0a860c793f adjust test case to handle error of peer closing down 2023-06-14 12:21:52 -07:00
JacobBarthelmeh
9e0c13bbdb sanity check on send fatal alert return 2023-06-14 11:08:56 -07:00
Andras Fekete
76cf3d61a0 Calling 'nc' makes the server unresponsive 2023-06-14 09:54:23 -04:00
Andras Fekete
20df12e5f7 This should add a check to make sure the server is up before connecting 2023-06-14 09:20:06 -04:00
Sean Parkinson
82cc988226
Merge pull request #6495 from JacobBarthelmeh/build
update check for stdatomic header file
2023-06-14 14:00:04 +10:00
Sean Parkinson
cdb3d6df40
Merge pull request #6502 from JacobBarthelmeh/release
prepare for 5.6.3
2023-06-14 13:59:41 +10:00
Sean Parkinson
0db49ef83a ECC, ALT_ECC_SIZE, CryptoCB: ensure err is 0 in _ecc_make_key_ex
When CryptoCB is used and the key gen operation is not implemented, err
is CRYPTOCB_UNAVAILABLE and needs to be reset to 0.
2023-06-14 10:12:04 +10:00
JacobBarthelmeh
72536e0e10 prepare for 5.6.3 2023-06-13 14:47:06 -06:00
David Garske
fe7502a50e Fix for SP math all and ECC with compressed keys (missing sp_add_d). Reproduce using: ./configure --disable-rsa --disable-dh --enable-compkey --disable-pkcs12 && make. 2023-06-13 11:39:24 -07:00
Eric Blankenhorn
58c1c0c31b
Merge pull request #6499 from douzzer/20230612-windows-fixes
20230612-windows-fixes
2023-06-13 12:32:01 -05:00
Daniel Pouzzner
03a6eed037 wolfcrypt/src/{aes.c,blake2b.c,siphash.c}: fix W64LIT() arguments to not have improper 'U' suffix;
wolfssl/wolfcrypt/types.h: add 'U' suffix to W64LIT() macro defs, and add SW64LIT() macro defs (not yet used anywhere);

wolfcrypt/src/asn.c: add !WOLFSSL_ECC_CURVE_STATIC gate around DataToHexStringAlloc() to resolve -Wunused;

wolfcrypt/src/ecc.c: guard against zero-valued "len" arg to wc_ecc_get_curve_id_from_oid();

wolfcrypt/src/wc_port.c: fix several argument implicit sign changes in USE_WINDOWS_API paths;

wolfssl/wolfcrypt/ecc.h: remove const attribute from inline buffers in WOLFSSL_ECC_CURVE_STATIC struct ecc_set_type.
2023-06-12 23:15:08 -05:00
JacobBarthelmeh
47036d0166 update check for stdatomic header file 2023-06-12 13:48:24 -06:00
JacobBarthelmeh
9ffa9faecd
Merge pull request #6491 from ejohnstown/fix-imp-conv
Implicit Type Conversion Fix
v5.6.2-stable
2023-06-09 13:19:18 -06:00
John Safranek
7b0283fa04
Implicit Type Conversion Fix
1. Typecast the return of strlen() to int for the variable used.
2023-06-09 11:13:44 -07:00
John Safranek
a56070cd70
Merge pull request #6490 from JacobBarthelmeh/release
Prepare for release 5.6.2
2023-06-09 11:00:10 -07:00
JacobBarthelmeh
353a2926b6 add check for stdatomic.h 2023-06-09 09:52:01 -07:00
JacobBarthelmeh
032ac405db prepare for release 5.6.2 2023-06-09 05:51:18 -07:00
JacobBarthelmeh
c59cc92379
Merge pull request #6488 from douzzer/20230608-linuxkm-__is_constexpr
20230608-linuxkm-__is_constexpr
2023-06-08 14:48:19 -06:00
Daniel Pouzzner
e35cb5bc3d linuxkm/linuxkm_wc_port.h: override definition of __is_constexpr() from /usr/src/linux/include/linux/const.h with warning-free __builtin_constant_p(). 2023-06-08 14:43:05 -05:00
John Safranek
3f1dd32f4e
Merge pull request #6487 from JacobBarthelmeh/fuzzing
sanity check on socket return value for timeout with DTLS13
2023-06-08 10:41:41 -07:00
JacobBarthelmeh
0d591f1111
Merge pull request #6485 from SparkiDev/coverity_api_c_fixes
Coverity fixes: api.c
2023-06-08 09:25:08 -06:00
Sean Parkinson
897a865090
Merge pull request #6477 from JacobBarthelmeh/stm32
add sanity check on hash size with STM32 port
2023-06-08 22:21:19 +10:00