3735 Commits

Author SHA1 Message Date
toddouska
a1489d981c
Merge pull request #2930 from JacobBarthelmeh/SanityChecks
check on tag length for AES-CCM
2020-04-30 14:51:20 -07:00
Jacob Barthelmeh
505fbed4df fix AES-CCM tag size check on decryption 2020-04-29 15:15:54 -06:00
Sean Parkinson
e9b433a998
Merge pull request #2928 from julek-wolfssl/evp-aes-gcm-fix
Fix AES-GCM in EVP layer to have compatiblity with OpenSSL
2020-04-29 09:00:04 +10:00
Jacob Barthelmeh
b73e52f33f move AES-CCM tag check into a local function 2020-04-28 14:46:06 -06:00
toddouska
f770d28ff0
Merge pull request #2916 from dgarske/testfixes
Improvements to ECC key decode and tests
2020-04-28 09:57:44 -07:00
toddouska
cb6fc56f3b
Merge pull request #2921 from dgarske/fixes_g++
Fixes for G++ and enable-all
2020-04-28 09:51:34 -07:00
Juliusz Sosinowicz
c02c408409 Only 80 characters a line 2020-04-28 12:38:02 +02:00
Jacob Barthelmeh
c85a53c631 add macro guard for fips and selftest builds 2020-04-27 15:36:53 -06:00
David Garske
6185e0f477 Remove execute bit on files. 2020-04-27 11:16:02 -07:00
David Garske
327cdefc24 Fix for SP math with RSA_LOW_MEM, which was broken in PR #2892. 2020-04-27 08:59:54 -07:00
Juliusz Sosinowicz
01a6dded72 Fix AES-GCM in EVP layer to have compatiblity with OpenSSL
- Tag checking in AES-GCM is done in Final call
- Reset `WOLFSSL_EVP_CIPHER_CTX` structure after Final call
- Don't zero `ctx->authTag` struct in Init call so that user can get the AES-GCM tag using `EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, AES_BLOCK_SIZE, tag)`
- `ctx->authTag` is only zeroed before authenticated, non-confidential data Update call since this means we are entering a new Udate-Final cycle. This doesn't need to be done in the decrypt case since the tag should be supplied by the user before the final call using `EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, AES_BLOCK_SIZE, tag)`
2020-04-27 15:52:01 +02:00
David Garske
1e726e19a4 Fix for XMALLOC cast. 2020-04-27 06:48:41 -07:00
David Garske
3c93a7b757 Fix Value stored to 'ret' is never read. 2020-04-24 11:31:12 -07:00
David Garske
a4caa42793 Improve the Base64 line size for NO_ASN case. Fix report of unread ret. 2020-04-24 11:26:55 -07:00
David Garske
cfc0aeb857 Fix for RSA and KeyGen only in test.c. 2020-04-24 08:56:31 -07:00
David Garske
41fc208195 Fixes for isHMAC checks. 2020-04-24 08:51:56 -07:00
David Garske
5fa7bb5b9f Fix possible unused args. 2020-04-24 07:48:41 -07:00
David Garske
6d025f8c0f Refactor of the EVP macType to use enum wc_HashType to resolve issues with invalid casting. 2020-04-24 07:43:44 -07:00
David Garske
28b686a8ca * Exposed useful sizes MAX_X509_HEADER_SZ and PEM_LINE_SZ
* Refactor the PEM saving code in `test.c`, so its not using large 4K buffer and calculates based on DER.
* Enable ECC key generation test even without `WOLFSSL_KEY_GEN`.
* Added `ECC_KEYGEN_SIZE` macro for ECC key generation testing.
* Refactor ECC DER key generation to use `ECC_BUFSIZE`.
2020-04-23 16:11:54 -07:00
David Garske
81f959336b Added support for important private key DER using wc_EccPublicKeyDecode. Added ECC key generation and decode test case. 2020-04-23 16:07:43 -07:00
David Garske
5376763638
Merge pull request #2913 from SparkiDev/sp_cortexm4_ecc
Improve performance of SP Cortex M asm
2020-04-23 09:47:05 -07:00
toddouska
7318121d3a
Merge pull request #2915 from dgarske/async_v4.4.0
Fixes for async release v4.4.0
2020-04-23 09:26:08 -07:00
toddouska
54aa50e628
Merge pull request #2912 from SparkiDev/sp_movbe
Only use Intel instruction movbe when available
2020-04-23 09:25:02 -07:00
Sean Parkinson
7a0cbe084e Improve performance of SP Cortex M asm 2020-04-23 11:05:42 +10:00
John Safranek
a064cb3943 Fix a couple of wolfCrypt test issues found during the long release build test. 2020-04-22 11:30:57 -07:00
David Garske
36a556f927 Resolve issues with the openssl compatibility CRYPTO_malloc and CRYPTO_free. 2020-04-22 10:15:16 -07:00
John Safranek
bf680b4a92
Fix for QAT with Shake256. Fix for XFREE missing semicolon. 2020-04-21 10:38:27 -07:00
John Safranek
ccd096e1bb
Memory Leak Fix
1. In `wolfSSL_d2i_DHparams()`, when setting the internal key on a
   WOLFSSL_KEY, set the flag inSet.
2. Not a leak, but in `wolfSSL_EVP_PKEY_set1_DH()`, only allocate one
   buffer to store the flat key. Saves an alloc, memcpy, and free.
2020-04-21 10:21:59 -07:00
John Safranek
61f3783111
Fixes to test.c for the following build configurations:
1. ./configure --disable-rsa --enable-certgen --enable-certreq
2. ./configure --disable-ecc --enable-pkcs7
2020-04-21 10:21:59 -07:00
John Safranek
7cbf496329
Encrypt key requirements check
The file wc_encrypt.c offers a function named wc_CryptKey(), which
requires PWDBASED and ASN. Added the check for ASN.
2020-04-21 10:21:58 -07:00
Jacob Barthelmeh
231c488ddf check on tag length for AES-CCM 2020-04-20 13:44:41 -06:00
JacobBarthelmeh
0cfde0794b
Merge pull request #2848 from julek-wolfssl/wpa-supplicant-openssl-compat
Added partial support for wpa_supplicant, hostapd, and cjose:
2020-04-20 12:17:55 -06:00
Sean Parkinson
75c14e4c8e Only use Intel instruction movbe when available 2020-04-20 09:09:45 +10:00
John Safranek
f87f09fcd7
Merge pull request #2910 from embhorn/zd10169
Fix forbidden iv length 0 with AES-GCM
2020-04-16 16:01:03 -07:00
Eric Blankenhorn
6b3642db36 Fix forbidden iv length 0 with AES-GCM 2020-04-16 13:48:56 -05:00
Juliusz Sosinowicz
dd68074104 Fix merge issues 2020-04-16 10:09:15 +02:00
Sean Parkinson
da5d9a923b SP ARM64 - use fewer registers in mont_reduces 2020-04-16 09:20:04 +10:00
Juliusz Sosinowicz
36403c1dad Merge remote-tracking branch 'wolfSSL/master' into wpa-supplicant-openssl-compat 2020-04-15 16:55:03 +02:00
Juliusz Sosinowicz
1d3fd5cd07 Code review
- make `wc_ecc_export_point_der_compressed` a local function
- use `int` for `shortKeySize` in `wc_ecc_import_point_der_ex`
- check for null return value from `wolfSSL_OBJ_nid2obj` and `wolfSSL_d2i_PUBKEY`
- add comments to `ssl.c`
- check `lnlen` in `wolfSSL_OBJ_ln2nid`
2020-04-15 12:53:38 +02:00
Eric Blankenhorn
d9472b895f Fix conflicts after rebase 2020-04-14 15:24:52 -05:00
Eric Blankenhorn
1487917214 Fix EVP_MD_CTX_type to return NID 2020-04-14 14:27:21 -05:00
toddouska
9c1b90170a
Merge pull request #2903 from SparkiDev/test_4096
Fix testing using 4096 bits keys and parameters
2020-04-14 09:25:00 -07:00
toddouska
06c6e583c8
Merge pull request #2891 from julek-wolfssl/refactor-evp-functions
Move EVP functions to evp.c
2020-04-14 09:22:51 -07:00
Juliusz Sosinowicz
dad0bc0159 Keep compatibility with old OPENSSL_EXTRA_X509_SMALL functions 2020-04-14 12:52:23 +02:00
Juliusz Sosinowicz
0b3a331265 Revert wc_OBJ_sn2nid 2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
20e669a65a New API
Add `wc_ecc_import_point_der_ex` for correct importing DER ECC point and keep `wc_ecc_import_point_der` old functionality
2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
18093a6b0b Code review changes
- Don't include `ENABLED_OPENSSLALL` with `ENABLED_WPAS`
- Return length in `wolfSSL_i2d_DHparams`
- Implement `wolfSSL_EC_POINT_mul` with independent multiplication and addition if `ECC_SHAMIR` not defined
- Implment `ASN1_SIMPLE` without `offsetof` by using a dummy struct
- Style fixes
2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
9722082372 Fix nid2* and *2nid functions 2020-04-14 11:48:14 +02:00
Juliusz Sosinowicz
680a481e61 Test fixes
Remove redundant macros
2020-04-14 11:45:32 +02:00
Juliusz Sosinowicz
9ced70edc1 Test fixes
Free `x509->key.pkey` in `FreeX509
Fix type conversions
Fix memory leaks and use of uninitialized memory
2020-04-14 11:45:32 +02:00