15014 Commits

Author SHA1 Message Date
John Safranek
4380e8b94a
Merge pull request #4391 from JacobBarthelmeh/Sniffer
add sanity check on buffer size
2021-09-16 09:36:48 -07:00
John Safranek
3503be2c13
Merge pull request #4362 from JacobBarthelmeh/wolfCLU
add wolfclu enable option and remove test macro guard
2021-09-15 13:57:50 -07:00
John Safranek
71e8d3ca3c
Merge pull request #4358 from SparkiDev/arm_sha512_crypto
AARCH64 SHA512: implementation using crypto instructions added
2021-09-15 09:51:09 -07:00
Juliusz Sosinowicz
4ad8b07c1c
wolfSSL_PEM_write_bio_PUBKEY needs to write only the public part (#4354)
* `wolfSSL_PEM_write_bio_PUBKEY` needs to write only the public part

The `wolfSSL_PEM_write_bio_PUBKEY` output can't contain the private portion of the key. This output could be used to distribute the public key and if it contains the private part then it gets leaked to others.

* Add heap hint to `wolfSSL_RSA_To_Der`

* Correct function name in logs
2021-09-15 17:34:43 +10:00
Sean Parkinson
17c2e9e1cd AARCH64 SHA512: implementation using crypto instructions added
Use --enable-armasm=sha512-crypto or define WOLFSSL_ARMASM_CRYPTO_SHA512
to use SHA512 cryptographic instructions.
Checks system register for the feature before using the SHA512
instructions.
Added SHA512 input data alignment test.
Add support for SHA512/224 and SHA512/256 to ARM port.
2021-09-15 12:05:48 +10:00
David Garske
d86aed210b
Merge pull request #4398 from SparkiDev/cppcheck_fixes_7
cppcheck fixes and a config fix
2021-09-14 18:19:30 -07:00
Hideki Miyazaki
d9767207b7
call alpn selection call-back at server side only (#4377)
* call alpn selection call-back at server side only

* addressed review comment

* addressed jenkins failure
2021-09-15 10:02:18 +10:00
David Garske
3c21996002
Merge pull request #4353 from SparkiDev/pkcs11_static_link
PKCS #11: support static linking with PKCS #11 library
2021-09-14 15:26:52 -07:00
David Garske
4be3b2b351
Merge pull request #4401 from embhorn/gh4400
Fix overflow check in ClientMemSend
2021-09-14 12:20:32 -07:00
David Garske
9c3d3ffcd2
Merge pull request #4396 from kabuobeid/iotsafe_header
Fix exporting iotsafe functions by adding missing include in iotsafe.c.
2021-09-14 10:01:44 -07:00
Eric Blankenhorn
2274d0b773 Fix overflow check in ClientMemSend 2021-09-14 11:17:01 -05:00
Sean Parkinson
142c7a9892 cppcheck fixes and a config fix
./configure --disable-rsa --disable-ecc --disable-dsa
--enable-curve25519 --disable-ed25519 --disable-curve448
--disable-ed448 --enable-cryptonly

suites.c, testsuite.c: ensure port is an integer for snprintf.

unit.c: make memFailCount an integer for printf.

aes.c:
  Reduce variable scope.
  Check aes is not NULL before use in GHASH implementations.
XTS check sz is greater than or equal to a AES_BLOCK_SIZE rather than
0 as another block is processed.
  wc_AesXtsEncrypt, wc_AesXtsEncrypt - simplify braces and ifdefs
wc_AesEcbEncrypt - subtracting from sz is unnecessary as is unused
after.

asn.c:
StoreKey, StoreEccKey - compiler doesn't see ret != 0 when publicKey
is NULL.
  DecodeAuthInfo - count is not used when after break.
  DecodeSubtree - don't use min and max as variables (already macros).
SetEccPublicKey - initialize pubSz and set sz regardless for
compiler's sake.
wc_EncodeName_ex - use unique variable 'namesASN'; ret isn't set after
last check.
SetEccPublicKey - simplify code by using else rather than check ret
wasn't set.
  DecodeAsymKey - ret not modified in non-template implementaiton.
  SetAsymKeyDer - ret still at initialized value here.
DecodeResponseData - ensure dataASN is freed when single->next->status
failed to allocate.

test.c:
  curve255519_der_test() can't be compiled when NO_ASN is defined.

types.h:
  cast to the appropriate type in EXIT_TEST
test.h
don't return anything when THREAD_RETURN is void and EXIT_TEST is for
threading with stack size.
2021-09-14 16:08:26 +10:00
Hideki Miyazaki
ab3bbf11e9
add ASN1_R_HEADER_TOO_LONG case (#4392)
* add ASN1_R_HEADER_TOO_LONG case

* addressed review comments
2021-09-14 12:32:30 +10:00
TakayukiMatsuo
c8bcfe4763
Add implementation to make wolfSSL_BIO_flush work for WOLFSSL_BIO_FILE (#4395) 2021-09-14 10:08:55 +10:00
Kareem
39ce723577 Fix exporting iotsafe functions by adding missing include in iotsafe.c. 2021-09-13 16:45:18 -07:00
Hideki Miyazaki
4d49ab6342
add store finished message on Tls13 (#4381)
* add to store finished message on Tls13

* addressed jenkins failure

* jenkins failures

sanity check for size before copying memory

* remove check of finishSz

* addressed review comments
2021-09-14 09:22:16 +10:00
David Garske
a65ab0c4af
Merge pull request #4189 from SparkiDev/sp_calc_vfy_check_ret
SP ECC: calc vfy point not check mod_inv return
2021-09-13 11:17:50 -07:00
David Garske
f08b1c49a9
Merge pull request #4371 from anhu/doc_update
Documentation fixup to reflect that we will error out if you set a ba…
2021-09-13 11:14:25 -07:00
Jacob Barthelmeh
f06414903c fix for scan build warning and better check on size 2021-09-13 09:35:55 -06:00
David Garske
f64c22839e
Merge pull request #4380 from SparkiDev/fp_submod_ct_overflow
TFM: check size of inputs
2021-09-13 07:56:54 -07:00
David Garske
05ed3dc9ea
Merge pull request #4387 from SparkiDev/popen_host
Get host name: add code to use popen and the command 'host'
2021-09-13 07:55:45 -07:00
David Garske
51c1f27065
Merge pull request #4393 from SparkiDev/srp_test_1536
SRP test; increase size of N
2021-09-13 07:29:59 -07:00
David Garske
bce2c010de
Merge pull request #4394 from SparkiDev/regression_fixes_2
Fixes for configurations and a cppcheck fix
2021-09-13 07:22:24 -07:00
Sean Parkinson
c42573096a Fixes for configurations and a cppcheck fix
configure --disable-shared --enable-opensslextra --enable-dsa
--enable-curve25519 --enable-ed25519 --enable-curve448 --enable-ed448
--enable-ocsp --enable-all --enable-asn=template
  GetCertName() sets raw in ASN template code too.
  GetBasicDate() not needed for template ASN.
SetAsymKeyDer() ASN template version now returns 0 when output is NULL
too.

./configure '--disable-shared' '--enable-curve25519' '--enable-ed25519'
'--disable-rsa' '--disable-ecc'
  SetBitString() is needed now.

Close the file before return in wolfSSL_save_session_cache() and
wolfSSL_restore_session_cache().
2021-09-13 10:25:19 +10:00
Sean Parkinson
33028de0de SRP test; increase size of N
SHA512 digest was sometimes too big for the 1024-bit N.
Increase N to 1536 bits to ensure no intermittent fails.
2021-09-13 09:18:26 +10:00
JacobBarthelmeh
4bd87a0c41
sanity check on pkcs7 input size (#4386) 2021-09-13 08:34:23 +10:00
Jacob Barthelmeh
602ec188ad sanity checks on ed25519 private key decode 2021-09-10 21:51:18 -06:00
Jacob Barthelmeh
ae4766ae96 add sanity check on buffer size 2021-09-10 16:49:42 -06:00
David Garske
42db91e454
Merge pull request #4389 from SparkiDev/sha512_rework
SHA512: Tidy up and have Sha512_224/256 FinalRaw return smaller digest
2021-09-10 13:01:08 -07:00
Jacob Barthelmeh
93d805352f move setting of ENABLED_MD5 2021-09-10 12:17:11 -06:00
Sean Parkinson
cd8bff272c SHA512: Tidy up and have Sha512_224/256 FinalRaw return smaller digest
Make code cleaner by passing in parameters instead of determining from
type.
Remove trailing whitespace.
2021-09-10 09:52:01 +10:00
Eric Blankenhorn
5e3f7d8778
Add return value checking for FREESCALE_RNGA (#4388) 2021-09-10 08:52:34 +10:00
elms
98f286d8cb
Consistent return value from SSL_CTX_load_verify_locations{,_ex} (#4341)
On any failure, return `WOLFSSL_FAILURE`

If there was a failure and a successful processing of certs from the
same directory, the return value depended on the last cert processed
which not guarenteed to be the same order. If the last cert load
failed, it would return the specific wolfSSL error code. If it
succeeded, then WOLFSSL_FAILURE would be returned as a generic failure
due to a previous cert error.
2021-09-10 08:45:13 +10:00
Eric Blankenhorn
649aa9c95f
Add error handling to wolfSSL_BIO_get_len (#4385) 2021-09-10 08:15:30 +10:00
Sean Parkinson
72486333c3 Get host name: add code to use popen and the command 'host'
When compiling for QEMU, the gethostbyname call doesn't have access to
the OS DNS.
Implemented a lookup of hostname that uses the system command host.

Fix for QEMU Aarch64 where 'char' is unsigned and the -1 return is being
converted to 255 in wolfSSL_OPENSSL_hexchar2int().

Test TLSv1.3 with www.google.com if wolfSSL supports it.

CMAC: cannot cast size_t* to word32* when big-endian.

SP math all: Random prime - munge bits before moving them around for
big-endian.

BIO, no filesystem: Allow BIO_prinf to be used with mem BIO.
2021-09-09 18:32:19 +10:00
Sean Parkinson
89dd1a65ca TFM: check size of inputs
fp_submod_ct and fp_addmod_ct need modulus (c) words plus one.
Check that the modulus length is valid for fixed data array size.
Improved fp_submod_ct to only use as many words as necessary.
Added comments to fp_submod_ct and fp_addmod_ct.
2021-09-09 09:20:11 +10:00
JacobBarthelmeh
934b0ab572
free structure on error case (#4383) 2021-09-09 08:07:22 +10:00
David Garske
b6665df6a8
Fixes for sniffer handling of TCP spurious retransmission (#4372)
* Fix for sniffer to better handle spurious retransmission edge case. ZD 12852

* Fix for sniffer to not send alerts during application data processing.

* Fix for missing semi-colon on XFREE.

* Fix for `bench_stats_print` with stack variable name used in `bench_ecc`. Improve benchmark thread cleanup, CPU count calcuation and stat blocking logic.
2021-09-08 09:40:58 +10:00
JacobBarthelmeh
078e0a7379
add unlock of mutex in fail cases (#4378) 2021-09-08 08:51:34 +10:00
Hideki Miyazaki
a118de1043
copy sessionCtxSz (#4375) 2021-09-08 08:03:35 +10:00
David Garske
3ca1900528
Merge pull request #4379 from haydenroche5/cmake
Fix issue with CMake build where CMAKE_C_FLAGS is empty.
2021-09-07 14:15:18 -07:00
Hayden Roche
93d3739ae7 Fix issue with CMake build where CMAKE_C_FLAGS is empty. 2021-09-07 12:11:43 -07:00
Hideki Miyazaki
51a2f9de17
return value convention on compatibility layer (#4373)
* return value convention

* addressed review comments

* addressed review comment part2

* fix jenkins failures
2021-09-07 08:15:08 +10:00
Hideki Miyazaki
d4387493fb
keep CRLInfo at own cert memory (#4374) 2021-09-07 08:11:29 +10:00
Anthony Hu
10a4cfae9d Documentation fixup to reflect that we will error out if you set a bad group identifier 2021-09-03 12:46:44 -04:00
Jacob Barthelmeh
4844f7598e account for 32bit build with ed25519 2021-09-03 10:03:37 -06:00
TakayukiMatsuo
90116a2873
Add support for wolfSSL_EVP_PBE_scrypt (#4345) 2021-09-03 15:49:02 +10:00
David Garske
35cef831bf
Fix for missing heap hint with RSA PSS and WOLFSSL_PSS_LONG_SALT (#4363)
* Fix for missing heap hint with RSA PSS and `WOLFSSL_PSS_LONG_SALT`. This fix will only allocate buffer if it exceeds the local buffer. Added `wc_RsaPSS_CheckPadding_ex2` to support heap hint if required. Fixed asn.c build issue with `NO_CERTS`. Fixed several spelling errors in asn.c. ZD12855.

* Improve the dynamic memory NULL checking in `wc_RsaPSS_CheckPadding_ex2` with `WOLFSSL_PSS_LONG_SALT` defined.
2021-09-03 15:42:31 +10:00
David Garske
a3ee84bf6d
Merge pull request #4355 from anhu/check_support_of_group
BUGFIX: Its possible to send a supported group that is not supported.
2021-09-02 20:03:32 -07:00
David Garske
43cb7d5ada
Merge pull request #4368 from haydenroche5/cmake
Make sure CMAKE_C_FLAGS gets parsed for defines to add to options.h.
2021-09-02 20:01:08 -07:00