Commit Graph

16333 Commits

Author SHA1 Message Date
David Garske
d1267b5203 Merge pull request #4805 from SparkiDev/ecies_aes_ctr
ECIES: add support for more encryption algorithms
2022-02-10 07:04:24 -08:00
Sean Parkinson
e50f661639 ECIES: add support for more encryption algorithms
Add support to ECIES for AES-256-CBC, AES-128-CTR, AES-256-CTR.
Added new API wc_ecc_ctx_set_algo() that sets the encryption, KDF and
MAC algorithms.
Cleanup formatting of ECIES code.
2022-02-10 09:54:22 +10:00
David Garske
cba262440a Merge pull request #4842 from SparkiDev/sha3_arm_fixup
ARMASM, SHA-3: fixup when not using crypto instructions
2022-02-09 10:20:46 -08:00
Chris Conlon
bee025842e Merge pull request #4828 from TakayukiMatsuo/rtos 2022-02-09 09:37:47 -07:00
tmael
0d5edfadcb Merge pull request #4837 from SparkiDev/sp_c_config
SP C: when sp_c32.c ad sp_c64.c are included in build changed
2022-02-09 07:51:20 -08:00
Eric Blankenhorn
c472b3582e Merge pull request #4839 from douzzer/20220207-clang-tidy-15
20220208 clang-tidy-15 fixes etc.
2022-02-09 08:36:18 -06:00
Sean Parkinson
343cb0da23 SP C: when sp_c32.c ad sp_c64.c are included in build changed
When compiling with the CFLAG -m32, sp_c32.c is used and not sp_c64.c.
The build system cannot detect that this is a 32-bit platform and to use
sp_c32.c.

The SP code detects which implementaiton to use and sets defines that
enable the code in sp_c32.c or sp_c64.c.

ENABLED_64BIT, 64-bit platform, was on by default, which is not always
true.
By making ENABLED_64BIT not default then the decision of which SP C
files to include in the build had to change to not being the other.
That is, sp_c64.c is not included when the configuration line explicitly
enables 32bit and sp_c32.c is not include when the configuration line
explicitly enables 64bit.
2022-02-09 15:56:57 +10:00
Sean Parkinson
b436262cdf ARMASM, SHA-3: fixup when not using crypto instructions 2022-02-09 09:36:00 +10:00
John Safranek
49defbd2cc Merge pull request #4836 from embhorn/zd13634
Remove deprecated VS solution
2022-02-08 15:18:21 -08:00
Sean Parkinson
67b2a1be40 Merge pull request #4831 from dgarske/zd13571_2
Improve the client certificate checking logic
2022-02-09 08:27:03 +10:00
TakayukiMatsuo
1bd4cb4eee Modify example app to work with FreeRTOS+IoT 2022-02-09 07:18:39 +09:00
Chris Conlon
34946c2440 Merge pull request #4832 from TakayukiMatsuo/rose 2022-02-08 14:54:47 -07:00
Daniel Pouzzner
74408e3ee3 fixes for whitespace, C++ warnings, and LLVM 15 clang-tidy defects/carps:
* whitespace in src/ssl.c, tests/api.c, wolfssl/openssl/fips_rand.h.

* clang-analyzer-core.StackAddressEscape from llvm-15 clang-tidy, in tests/suites.c:execute_test_case().

* bugprone-suspicious-memory-comparison from llvm-15 clang-tidy, in src/internal.c:DoSessionTicket() and src/ssl.c:wolfSSL_sk_push().
2022-02-08 15:20:22 -06:00
David Garske
ed1fc9fc51 Merge pull request #4833 from SparkiDev/sha3_arm_crypto
SHA-3, ARM64: add assembly support for crypto instructions
2022-02-08 11:05:35 -08:00
Daniel Pouzzner
3ee6e93590 Merge pull request #4838 from SparkiDev/g++_fix_4
Rework functions to avoid warning with g++
2022-02-08 10:20:58 -06:00
Daniel Pouzzner
1f69c52ce8 Merge pull request #4830 from dgarske/no_hmac
Fixes for building without HMAC
2022-02-07 22:26:38 -06:00
Sean Parkinson
d2307186d9 Rework functions to avoid warning with g++ 2022-02-08 12:36:36 +10:00
Sean Parkinson
0042a2594c SHA-3, ARM64: add assembly support for crypto instructions
Add ability to compile ARM assembly from inline C code.
2022-02-08 12:21:38 +10:00
David Garske
b60d2dccce Include the havePeerCert argument in the check. 2022-02-07 16:31:50 -08:00
Eric Blankenhorn
5e5a389afb Remove deprecated VS solution 2022-02-07 17:14:41 -06:00
David Garske
d0246a280d Merge pull request #4834 from anhu/guard_wc_PKCS7_SetPassword
Fix tests to properly gate on ! NO_PWDBASED && ! NO_SHA
2022-02-07 15:12:22 -08:00
David Garske
56c562a516 Fixes for building with ./configure --enable-opensslextra --enable-cryptonly CFLAGS="-DNO_HMAC" && make. Found this testing a customers configuration with latest. Also fixes some trailing whitespace. 2022-02-07 15:10:21 -08:00
David Garske
d085984103 Merge pull request #4829 from kosmas-valianos/kTLS
Expose Sequence Numbers so that Linux TLS (kTLS) can be configured
2022-02-07 14:55:07 -08:00
TakayukiMatsuo
5361c0bda0 Update signature as the certificate is renewed 2022-02-08 07:31:50 +09:00
Anthony Hu
e47dd675af Fix tests to properly gate on ! NO_PWDBASED && ! NO_SHA 2022-02-07 14:44:26 -05:00
David Garske
dd2e0064b2 Merge pull request #4827 from SparkiDev/sp_int_dw_asm
SP math, Aarch64, ARM32: div word asm fixup
2022-02-07 11:32:14 -08:00
David Garske
54e7db0a9a Merge pull request #4739 from rizlik/psa
support Platform Security Architecture (PSA) API
2022-02-07 10:40:21 -08:00
Chris Conlon
4c8f0709fc Merge pull request #4720 from dgarske/fips_compat 2022-02-07 09:56:24 -07:00
David Garske
3cdb1c639d Improve the client certificate checking logic. Make sure calling wolfSSL_CTX_mutual_auth is also checked. 2022-02-07 08:09:38 -08:00
David Garske
3d85a9690f Merge pull request #4819 from lealem47/hashMismatch
Fix for OpenSSL x509_NAME_hash mismatch
2022-02-07 08:08:49 -08:00
Kosmas Valianos
30b35acd39 Expose Sequence Numbers so that Linux TLS (kTLS) can be configured 2022-02-07 09:30:59 +01:00
Sean Parkinson
f6d79ff598 Merge pull request #4813 from dgarske/zd13571
Fix for mutual authentication to prevent mismatch of certificate and sigalgo
2022-02-07 11:00:04 +10:00
Lealem Amedie
f9ff551992 Fix for OpenSSL x509_NAME_hash mismatch 2022-02-04 16:59:51 -08:00
David Garske
1f8ff7d9fe Merge pull request #4822 from embhorn/zd13613
Fix warnings in VS
2022-02-04 15:37:31 -08:00
Marco Oliverio
2077184953 psa: add compile-time error if builded with crypto cb 2022-02-04 21:45:38 +01:00
Marco Oliverio
b8635efda7 psa: add README.md and doxygen header 2022-02-04 21:45:38 +01:00
Marco Oliverio
0cb2cc1705 psa: support pk callbacks for ECDSA, ECDH, HKDF 2022-02-04 21:45:38 +01:00
Marco Oliverio
630b244cee psa: introduce global lock 2022-02-04 21:45:38 +01:00
Marco Oliverio
a7165907da psa: support AES 2022-02-04 21:45:38 +01:00
Marco Oliverio
9ccfc81f26 psa: support PSA SHA1/SHA256/SHA224 2022-02-04 21:45:38 +01:00
Marco Oliverio
06915b6fa3 psa: support PSA random generator 2022-02-04 21:45:38 +01:00
David Garske
08047b2d95 Add checking to make sure key is present in all cases. Explicitly set validSigAlgo to zero with comment to clarify the default assumption. 2022-02-04 11:47:06 -08:00
David Garske
2d184348fb Merge pull request #4825 from embhorn/gh4815
Fix wolfSSL_PEM_X509_INFO_read with NO_FILESYSTEM
2022-02-04 10:42:40 -08:00
David Garske
327e35fc25 Merge pull request #4826 from haydenroche5/evp_aes_gcm_iv_bug
Fix IV length bug in EVP AES-GCM code.
2022-02-04 10:38:02 -08:00
Hayden Roche
d1ca8fc673 Merge pull request #4821 from elms/cmake/help_cleanup 2022-02-04 09:37:39 -08:00
Marco Oliverio
08fbcf5eae autoconf: add PSA options 2022-02-04 12:12:04 +01:00
Sean Parkinson
bd1b58dd7f SP math, Aarch64, ARM32: div word asm fixup
ASM code is dividing by top half of divisor. If this value is very small
then bad results are calculated.
Moved the divisor up by a quarter of the width if top quarter of divisor
is 0.
2022-02-04 11:59:31 +10:00
Hayden Roche
b850cc89b0 Fix IV length bug in EVP AES-GCM code.
In `wolfSSL_EVP_CipherInit`, `ctx`'s `ivSz` field isn't being accounted for.
A common OpenSSL EVP AES-GCM flow looks like this:

- `EVP_CIPHER_CTX_new`
- `EVP_EncryptInit_ex`
- `EVP_CIPHER_CTX_ctrl` with command `EVP_CTRL_GCM_SET_IVLEN` to set the IV
length to 16 (AES block size) instead of the default 12
- `EVP_EncryptInit_ex` again to set the key and IV
- `EVP_EncryptUpdate` however many times
- `EVP_EncryptFinal`

In fact, we test this flow in our unit test `test_wolfssl_EVP_aes_gcm`. However,
in our implementation, the second call to `EVP_EncryptInit_ex` unconditionally
resets the IV length back to 12. This doesn't cause a test failure because
decryption has the same problem, so both sides of the equation have the same
wrong view of the IV.

The solution is to preserve the IV length in wolfSSL_EVP_CipherInit if ctx->ivSz
is non-zero. Otherwise, use the default of 12 (`GCM_NONCE_MID_SZ`).

This was discovered by a user migrating to the compatibility layer. As I
mentioned, it isn't exposed by our testing. It is exposed if you try to use the
same key and IV with OpenSSL and compare the resulting ciphertext with wolfSSL.
They won't be the same and thus won't interoperate.
2022-02-03 17:40:26 -08:00
Eric Blankenhorn
a0444bf72f Fix wolfSSL_PEM_X509_INFO_read with NO_FILESYSTEM 2022-02-03 16:52:08 -06:00
Eric Blankenhorn
7b2e457d04 Fix VS unreachable code warning 2022-02-03 15:53:35 -06:00