Commit Graph

1026 Commits (f91dcb950c26030f8dc83921c0f9e16c3d11ada7)

Author SHA1 Message Date
Jacob Barthelmeh df0d5f3b08 add EVP_aes_*_ofb implementation and tests, add support for inline with OFB 2020-02-20 17:28:32 -06:00
Jacob Barthelmeh e837894578 add AES-OFB mode 2020-02-20 17:28:32 -06:00
Juliusz Sosinowicz fbedabe601 OpenSSH changes
- increase FP_MAX_BITS for OpenSSH
- Add helpful loggin API (names are self-explanatory)
-- wolfSSL_GetLoggingCb
-- WOLFSSL_IS_DEBUG_ON
- Define WOLFSSL_EC_METHOD as an alias of WOLFSSL_EC_GROUP
- Add wolfSSL_EC_GROUP_method_of which really just returns the group itself
- Add wolfSSL_EC_METHOD_get_field_type which gets the curve type of the WOLFSSL_EC_GROUP(remember that WOLFSSL_EC_METHOD is an alias of WOLFSSL_EC_GROUP for now)
- Modify Base64_Decode so that it accepts arbitrary PEM line length
- Modify PemToDer so that it accepts private keys with a custom -----BEGIN * PRIVATE KEY----- header
2020-02-18 21:37:06 +01:00
Chris Conlon b29fe41a35
Merge pull request #2738 from SparkiDev/cppcheck_fixes_3
Changes to clear issues raised by cppcheck
2020-02-03 17:02:40 -07:00
Sean Parkinson 55ea2facdd Changes to clear issues raised by cppcheck 2020-01-30 14:24:32 +10:00
David Garske 5677a96c80 Fixes to resolve `openssl_pkey1_test` with updated test buffer sizes. 2020-01-29 06:51:47 -08:00
David Garske 5aabebddd8 Fix more 3072-bit cert buffer edge case builds (certext/certgen). 2020-01-29 06:43:35 -08:00
David Garske 3f1c3392e5 Fixes for build with opensslextra and 3072-bit cert buffers. Adds 3072-bit RSA public key der. Eliminates duplicate 3072-bit client cert/key. 2020-01-29 06:37:06 -08:00
toddouska 945d34533c
Merge pull request #2727 from JacobBarthelmeh/Windows
update to ECC key parsing custom curves for Windows
2020-01-23 13:57:06 -08:00
David Garske b022b651b3 wolfCrypt test fixes for hard coded "256" byte buffers to support 3072-bit RSA. Requires PR #2755 2020-01-22 10:04:53 -08:00
David Garske e3e862c8b6 Test case fixes for sig wrapper test and DH. 2020-01-21 22:25:11 -08:00
David Garske 4d9dbc9ec3 Adds 3072-bit RSA tests using `USE_CERT_BUFFERS_3072`. 2020-01-21 22:16:54 -08:00
toddouska 66daac4c94
Merge pull request #2709 from JacobBarthelmeh/Testing
set chacha20 similar to aes-ctr when handling leftover stream and add…
2020-01-17 15:05:24 -08:00
David Garske 989f3d3684 Fix for FREE_VAR call on `sharedA`. 2020-01-14 14:35:20 -08:00
David Garske 22f49d8597 Fixes for building with ECC sign/verify only. 2020-01-13 15:35:08 -08:00
David Garske 8974827fbe Added `WOLFSSL_ECC_CURVE_STATIC` build option to allow using fixed arrays for ECC parameters. This is enabled by default on Windows. Fixed several compiler warnings. Fixed build macro for `key->deallocSet`. 2020-01-13 07:15:17 -08:00
JacobBarthelmeh 6b4551c012
Merge pull request #2654 from cariepointer/qt-512-513
Add Qt 5.12 and 5.13 support
2020-01-10 17:34:23 -07:00
Jacob Barthelmeh 99d657af4f adjust test cases 2020-01-10 10:31:56 -07:00
Jacob Barthelmeh 0c25588ad1 adjust TEST_SMALL_CHACHA_CHUNKS size and add more tests 2020-01-09 17:13:57 -07:00
toddouska 51f44cb09b
Merge pull request #2719 from dgarske/nxp_k64_mmcau
Fixes for NXP K64
2020-01-09 14:57:11 -08:00
toddouska 99045a2fea
Merge pull request #2723 from SparkiDev/rsa_vfy_only_fix
Rsa vfy only fix
2020-01-09 14:55:10 -08:00
toddouska 11a0b117f8
Merge pull request #2706 from dgarske/chapoly_aead_iuf
New API's for ChaCha20/Poly1305 AEAD init/update/final
2020-01-09 14:49:26 -08:00
Sean Parkinson b27ec58d20 Fix RSA verify only build 2020-01-08 10:18:37 +10:00
David Garske acfe9717f8 Fix for K64 MMCAU with `WOLFSSL_SMALL_STACK_CACHE`. Moved random test prior to cipher tests (was getting called first time in GMAC test). 2020-01-07 05:39:17 -08:00
David Garske d68d5229e1 Refactor `wc_ChaCha20Poly1305_Encrypt` and `wc_ChaCha20Poly1305_Decrypt` to use the new `ChaChaPoly_Aead` context and init/update/final functions. 2020-01-06 17:07:09 -08:00
Chris Conlon 45c5a2d39c update copyright to 2020 2020-01-03 15:06:03 -08:00
David Garske bff6dcec24 Added support for AAD calc only. Allows Init, UpdateAad and Final sequence. Verfied again with customer test cases. 2019-12-31 08:25:23 -08:00
David Garske f01999b322 Peer review feedback. 2019-12-31 08:08:33 -08:00
David Garske b901a2cd35 Use `byte` for bit-field. Line length cleanup. 2019-12-30 18:05:25 -08:00
David Garske 1ee9d182cf New API's for ChaCha20/Poly1305 AEAD init/update/final:
* Provides a context for AEAD to allow "chunked" updates of data then a final calculation for the authentication tag.
* New API's are on by default and can be disabled using NO_CHACHAPOLY_AEAD_IUF.
2019-12-30 15:20:55 -08:00
toddouska deac82c8ed
Merge pull request #2683 from dgarske/various_items
Various cleanups and fixes
2019-12-27 13:53:39 -08:00
toddouska 95daec5326
Merge pull request #2633 from tmael/cc_310
Update Cryptocell readme
2019-12-27 12:58:19 -08:00
toddouska 78fa84be00
Merge pull request #2649 from SparkiDev/rsa_pubonly
Fix RSA public key only builds
2019-12-27 12:55:34 -08:00
toddouska dd28f26c44
Merge pull request #2699 from JacobBarthelmeh/Testing
big endian changes
2019-12-27 12:52:30 -08:00
Eric Blankenhorn b83804cb9d Correct misspellings and typos from codespell tool 2019-12-24 12:29:33 -06:00
JacobBarthelmeh ca59bc2d16 big endian changes 2019-12-23 12:33:59 -07:00
toddouska 6922d7031c
Merge pull request #2685 from embhorn/coverity_fixes
Coverity fixes
2019-12-18 14:06:48 -08:00
David Garske 22f0b145d3 Various cleanups and fixes:
* Fix for key gen macro name in benchmark.c
* Fix for possible RSA fall-through warning.
* Fix for building `WOLFSSL_STM32_PKA` without `HAVE_ECC`.
* Added option to build RSA keygen without the DER to PEM using `WOLFSSL_NO_DER_TO_PEM`.
* Added options.h includes for test.c and benchmark.c.
* Added printf warning on the math size mismatch in test.c.
* Added support for benchmarking larger sizes.
* TLS benchmarks for HiFive unleashed.
2019-12-18 07:09:26 -08:00
Tesfa Mael 69a0c1155f Review comment 2019-12-17 17:36:38 -08:00
Eric Blankenhorn af5c98a6a8 Fixes in wolfCrypt test 2019-12-16 10:22:42 -06:00
David Garske f2115b2c2b
Merge pull request #2652 from ejohnstown/maintenance-error
Maintenance: Error Strings
2019-12-13 15:03:32 -08:00
tmael 8450c4ae39
Merge pull request #2643 from ejohnstown/maintenance-prime
Maintentance: Prime
2019-12-06 18:50:51 -08:00
Carie Pointer ee13dfd878 Add Qt 5.12 and 5.13 support
Co-Authored-By: aaronjense <aaron@wolfssl.com>
Co-Authored-By: MJSPollard <mpollard@wolfssl.com>
Co-Authored-By: Quinn Miller <quinnmiller1997@users.noreply.github.com>
Co-Authored-By: Tim Parrish <timparrish@users.noreply.github.com>
2019-12-06 14:27:01 -07:00
John Safranek 19a4371d48
Maintenance: Error Strings
1. One of the error string was >80 bytes long. Shortened it.
2. The function that copies an error string to an output array needs to
ensure the string is still null terminated.
3. Added a check to the wolfCrypt test to see that error strings aren't
>= 80 bytes long.
2019-12-06 09:53:39 -08:00
Sean Parkinson 2528121925 Fix RSA public key only builds
Client side only and no client auth
2019-12-06 20:42:27 +10:00
toddouska bd8a612d6c
Merge pull request #2624 from ejohnstown/maintenance-ASN1
Maintenance: ASN.1
2019-12-05 16:16:42 -08:00
toddouska 6d40c20f2c
Merge pull request #2609 from JacobBarthelmeh/Compatibility-Layer
Fix for EVP CipherUpdate decrypt and add test case
2019-12-05 16:12:26 -08:00
John Safranek 2c0fda4168
Maintentance: Prime
1. Revisited the option enables around the wolfCrypt prime test. Added a
check for key generation to the check for public MP.
2019-12-05 12:23:42 -08:00
Tesfa Mael 4f8a37ef7b Remove wc_RsaSSL_VerifyInline from Cryptocell 2019-12-05 10:40:21 -08:00
John Safranek 44fc3e14b1
Maintenance: ASN.1
1. Fix some preprocessor flag checking for function EncodePolicyOID. It
also needs to be available for OpenSSL Compatibility.
2. Fix for a name string for a test that can get left in or out
incorrectly.
2019-12-04 10:26:37 -08:00
toddouska e1ebb39296
Merge pull request #2618 from ejohnstown/maintenance-prime
Maintenance: Prime
2019-11-27 14:06:23 -08:00
toddouska ff85cc7740
Merge pull request #2622 from SparkiDev/ber_to_der_rework
Rework BER to DER to not be recursive
2019-11-27 14:05:36 -08:00
Sean Parkinson 776f4af7f6 Rework BER to DER to not be recursive 2019-11-27 10:20:32 +10:00
John Safranek 55540c6bd3
Replace a compile option check around some filenames for certificate testing. 2019-11-25 16:13:01 -08:00
John Safranek 3432a8a1fc
Maintenance: Prime
1. Prime test should return NO for 1. (ex function, normal math and fast
math)
2. Call mp_init() on the k value for the primality test case in the
wolfCrypt test.
2019-11-22 13:02:59 -08:00
John Safranek 481da3dcc1
Maintenance: Prime
1. Added a test case for checking "1" as a prime number to the wolfCrypt
test.
2. Allow the wolfCrypt prime test for SP builds.
3. Modify the prime test to use mp_mul rather than mp_mul_d, as the SP
math library doesn't export sp_mul_d.
2019-11-22 11:39:19 -08:00
David Garske ffb3dfd6ec Fixes for minor test.c build configuration issues. 2019-11-22 07:01:10 -08:00
Jacob Barthelmeh 1eb1755f07 add another evp decrypt test case 2019-11-20 12:29:22 -07:00
toddouska 1ba366920c
Merge pull request #2581 from SparkiDev/ecc_fixes_add
Add deterministic ECDSA sig gen. Fix corner cases for add point.
2019-11-20 09:12:28 -08:00
toddouska 5de27443d0
Merge pull request #2596 from dgarske/mqx_fio_cleanup
Support for MQX 5.0 and cleanup of the MQX includes
2019-11-19 11:49:03 -08:00
toddouska c6dac64438
Merge pull request #2594 from ejohnstown/maintenance-BLAKE2
Maintenance BLAKE2
2019-11-18 17:05:01 -08:00
David Garske 1542482cd5 Cleanup of the MQX file headers for STDIO. Cleanup of fio.h and nio.h includes to use wc_port.h. ZD 9453. 2019-11-18 12:14:34 -08:00
David Garske b780982aa4 Adds "devId" crypto device and "heap" context for Hash wrappers and PBKDF
* Adds new hash wrapper init `wc_HashInit_ex`.
* Adds new PBKDF2 API `wc_PBKDF2_ex`.
ZD 9494 (using PBKDF2)
2019-11-18 11:26:56 -08:00
John Safranek 14c986360d
Maintenance BLAKE2
1. Remove BLAKE2 support from HMAC.
2. Update doxy header for HMAC with removal of BLAKE2 and addition of SHA-3.
2019-11-18 10:45:30 -08:00
Sean Parkinson cc880e39ae Add deterministic ECDSA sig gen. Fix corner cases for add point.
In verify, two points are added and they may either be the same point
(different z) or result in infinity.
If they are the same point then a double needs to be performed instead.
Detection of infinity added.
Calculation of wc_ecc_sig_size fixed to handle wehn there are more bits
in the order than in the modulus.
2019-11-14 12:49:45 +10:00
toddouska 76e7e7349b
Merge pull request #2575 from tmael/valgrind_dhtest
Fix memory leak in dh_test
2019-11-13 11:28:04 -08:00
toddouska 46bc8e092a
Merge pull request #2582 from ejohnstown/abi-current
ABI
2019-11-13 11:24:45 -08:00
John Safranek 682cf6deac
wolfSSL ABI
Hide the RNG and ecc_key allocators from FIPS mode builds.
2019-11-11 15:16:39 -08:00
Tesfa Mael 68e4014c3f memset DhKeys 2019-11-11 09:43:10 -08:00
Tesfa Mael 99ee4a407d Fix mem leak for valgrind 2019-11-08 12:09:46 -08:00
John Safranek c69b6fb6d1
wolfSSL ABI
1. Add a blank #define WOLFSSL_ABI to tag functions as part of the ABI
to remind developers there are rules about those functions specifically.
2. Added allocators and deallocators for WC_RNG objects and ecc_key
objects so they don't have to be used on the stack.
3. Add tests for the new allocators.
2019-11-07 13:03:12 -08:00
David Garske 0fe5d40507
Merge pull request #2568 from aaronjense/iar-build-fix
Fix changed sign warning for IAR build
2019-11-06 15:47:15 -08:00
toddouska ba34b0d09f
Merge pull request #2547 from SparkiDev/rsa_pss_salt_len
Compile options for larger salt lengths in RSA-PSS
2019-11-06 13:03:15 -08:00
Aaron Jense ea77cd743e Fix changed sign warning for IAR build 2019-11-06 09:59:31 -08:00
Sean Parkinson 35ec2bc6d4 Compile options for larger salt lengths in RSA-PSS
Salt length larger than the hash size allowed in RSA-PSS.
Passing -2 to PSS pad function uses maximum salt length.
Passing -2 to PSS un-pad function makes it discover salt length.
2019-11-04 14:27:02 +10:00
Sean Parkinson 7623777857 Add scrypt API that takes iterations rather than cost
iterations = 1 << cost but matches APIs in other products and standard
2019-11-01 10:15:42 +10:00
David Garske 6bc16a4acb
Merge pull request #2532 from aaronjense/mp-public-defines
Fix for configure used in wolfssl-examples/signature/rsa_vfy_only.…
2019-10-29 08:46:03 -07:00
toddouska 140796d2aa
Merge pull request #2504 from ejohnstown/sync-octeon
Synchronous OCTEON Sniffer Support
2019-10-28 12:25:57 -07:00
Aaron Jense 34c37c58f4 Fixes for configure used in wolfssl-examples/signature/rsa_vfy_only and fix for wrong WOLFSSL_MP_PUBLIC defines.
./configure CFLAGS=-DWOLFSSL_PUBLIC_MP --disable-asn --disable-filesystem --enable-static --enable-shared --enable-cryptonly --enable-sp=smallrsa2048 --enable-sp-math --disable-dh --disable-ecc --disable-sha224 --enable-rsavfy
2019-10-28 09:50:59 -06:00
David Garske b80b10b980
Merge pull request #2498 from danielinux/stm32wb55
Support for STM32_PKA accelerator
2019-10-24 15:41:08 -07:00
Daniele Lacamera 025754e774 Fixed alignment/padding for hash. ECC tests passing on target. 2019-10-24 20:32:47 +02:00
John Safranek 17f44d4d29
OCTEON Sync
1. Add attributes to the OCTEON functions so they aren't optimized.
2. Disable the same test cases for OCTEON as we do QAT in sync.
2019-10-24 10:00:20 -07:00
John Safranek b8f4b1a712 QAT Header Hiding
For the sync QAT, the QAT headers are included into the library after it
has been built and is being used. The actual headers should only be used
when building wolfSSL and should be hidden from the user.
1. Most of the functions in the sync QAT and OCTEON headers don't need
to be exported. Move all of that into the source files. Only export the
init and deinit functions.
2. Remove inline from the OCTEON support functions.
3. Remove the AES-ECB files for sync OCTEON as unused.
4. Configure defaults to OCTEON2 build, can be overridden with variable.
2019-10-23 09:58:11 -07:00
John Safranek 1ad23334bf Sync Sniffer API Cleanup
1. Switched the IntelQa sync API back to local.
2. Added two functions to setup and cleanup the IntelQA device.
3. Changed the Octeon functions to match the IntelQa functions.
4. Updated sniffer, wolfcryptest, and benchmark.
2019-10-23 09:58:11 -07:00
John Safranek 54f0b1a44a Sync QAT Fixes
1. The QAT callback's worker functions need to copy the IV into the AES IV register. QAT doesn't update it automatically.
2. Update the GMAC test to set its device to INVALID_DEVID.
3. Always allocate NUMA buffers before running crypto operation and store the results.
4. The QAT does not like non-multiple of 4 iv lenths, and aad lengths. Or 0. Remove a few test cases for those.
5. QAT wasn't getting a pointer to store the auth tag for GCM. Then store it.
2019-10-23 09:58:11 -07:00
John Safranek 825f311959 add OCTEON and QAT to wolfCrypt test, update SHA-1 to reset ret when it will do the software sha 2019-10-23 09:58:10 -07:00
Jacob Barthelmeh 09a0859865 fix for fortress and no sha build with encrypted keys 2019-10-21 09:37:24 -06:00
David Garske 5c07391f1b Various fixes for asynchronous mode:
* Fix for AES CBC issue with IV (QAT only).
* Fix for test cases with QAT.
* Remove poorly placed debug for AES CFB.
2019-10-15 11:18:55 -07:00
Jacob Barthelmeh d7fe000cfe M68K (coldfire MCF5441X) wolfcrypt build and examples
fix for make dist and cleanup makefile

add aes file to Makefile

macro guards and entropy warning

add AES to build
2019-10-11 14:56:34 -06:00
Sean Parkinson 901ee627fc Fixes from using cppcheck tool
Various fixes for uninitialized variable use.
sniffer.c: close file when seek fails
tls.c: fix QSH_GET_SIZE macro
wolfio.c: uIPGenerateCookie: use the parameter, _ctx, instead of self
referencing.
wolfssl_adds.c: check for equivalent to XBADFILE to indicate error.
SP: change right shift of signed value to unsigned
sp_int.h: define 128-bit types
types.h: change a XMALLOC define to not use (,,) - cppcheck doesn't like
it and is unnecessary.
2019-10-01 09:22:00 +10:00
John Safranek b92509144b
Merge pull request #2475 from dgarske/qat_key
Fixes and improvements for async
2019-09-20 10:44:33 -07:00
Chris Conlon 33a83cdba0
Merge pull request #2436 from miyazakh/Renesas_TSIP_Port
Support renesas tsip
2019-09-19 14:44:33 -06:00
toddouska 2dbf3f81fc
Merge pull request #2474 from SparkiDev/sp_int_prime
Add support for prime checking to sp_int.c
2019-09-19 13:44:22 -07:00
David Garske 6aecdf59c1 Fixes for async build and tests. 2019-09-19 12:30:05 -07:00
Hideki Miyazaki 5c6f6fdb7d Renesas TSIP Support
merged from private repo

removed unneccessary #include
make line as 80 characters
added simple tls server
Disable TLS-linked API use when being SERVER SIDE, still use certificate verify API
Added utility tools, generate signature arrays etc
added vars to store tsip hmac keys
fix build failure when disabling dc_printf
2019-09-19 11:18:52 +09:00
Sean Parkinson 0bc16d47e2 Add support for prime checking to sp_int.c
This allows SP to support:
- DH parameter checking
- DH parameter generation
- RSA key generation
Improved performance of sp_mod operation.
Reworked some functions to have one exit point (return statement).
Fixed sp_sub_d().
Changed tests to perform 2048-bit RSA key generation only when using SP
math.

Fixed Intel x86_64 C file to not have DH specific functions available
unless WOLFSSL_HAVE_SP_DH is defined.
Fixed tfm to return an error when t is not the correct size in
fp_isprime_ex().
2019-09-19 09:08:15 +10:00
Hideki Miyazaki 82d531562c Fixed build warnings due to esp-idf update
Fixed server application TLS communicatio failure
2019-09-09 08:25:02 +09:00
toddouska b19e785c2c
Merge pull request #2418 from dgarske/sha3_keccak256
Added support for older KECCAK256
2019-09-03 15:42:05 -07:00
toddouska 492ce6ac91
Merge pull request #2414 from dgarske/pkcs8_asn1
Added support for loading a PKCS8 ASN.1 formatted private key
2019-09-03 15:36:31 -07:00
John Safranek 2ba6c66d44 Fix ECC key load test
When using the configure options '--enable-certgen --enable-certext CPPFLAGS=-DWOLFSSL_VALIDATE_ECC_IMPORT', the ecc_decode_test() will fail the "good" test case. It is using the point (1, 1) in the test, and that fails the key validation. Changed the good key to one of the keys we have in the certs directory. The additional validation checks that the point is on the curve, and is validated in FIPS mode.
2019-08-22 14:18:59 -07:00
David Garske 154930d128 Added support for older KECCAK256 used by Ethereum. Uses existing hash flag API's.
To use add build flag `CFLAGS="-DWOLFSSL_HASH_FLAGS"`.

Example:

```c
wc_Sha3_SetFlags(&sha, WC_HASH_SHA3_KECCAK256);
```
2019-08-20 16:14:37 -07:00
David Garske 24bfea1ad2 Fixes for various build options (!NO_RSA, HAVE_ECC, NO_PKCS8, NO_PKCS12). Added new `NO_CHECK_PRIVATE_KEY` to allow reduce code size when not required. 2019-08-20 10:38:08 -07:00
David Garske 3e1c103c78 Added support for loading a PKCS8 ASN.1 formatted private key (not encrypted). 2019-08-16 16:09:00 -07:00
Sean Parkinson 2a22179068 Specialized mod exponentiation for base 2 in tfm.c and integer.c 2019-08-02 15:50:08 +10:00
toddouska 4f0fd2c2f9
Merge pull request #2302 from SparkiDev/ecc_pubkey_check
Add checks of public key for ECC and curve25519
2019-08-01 11:50:02 -07:00
toddouska d4ab1c7e86
Merge pull request #2383 from SparkiDev/sp_dh_2
Special implementation of mod exp when base is 2 in SP
2019-07-30 16:02:38 -07:00
David Garske e3653a7a07 Various spelling corrections. 2019-07-29 08:14:07 -07:00
Sean Parkinson 23af4e92f3 Special implementation of mod exp when base is 2 in SP 2019-07-29 12:58:07 +10:00
Sean Parkinson 4778dac49f Add checks of public key for ECC and curve25519 2019-07-29 10:42:44 +10:00
Jacob Barthelmeh 7e79e3a6bf fix for build with disable filesystem 2019-07-17 16:28:58 -06:00
Jacob Barthelmeh f63656f18b macro guard on test case with disable AES 2019-07-17 15:22:29 -06:00
Chris Conlon 2e308ea82c
Merge pull request #2260 from JacobBarthelmeh/PKCS7
PKSC7 firmware revision + callback / get SID
2019-07-16 10:51:38 -06:00
Jacob Barthelmeh a25d04044a save rid for kari callback 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh d7a86de969 add wrap CEK callback, test, and adjustment for fwWrappedFirmwareKey 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh 84653a7fb5 improvements on test code 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh a7a51d8f33 scan-build warnings / fixes 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh ab0029f9ac add setter function for ctx and pkcs7 callback, add test cases 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh 051112a101 adjust time.h for port due to tm struct change 2019-07-12 13:55:04 -06:00
kaleb-himes d7b50874f6 Fix leak in dh_test 2019-07-10 13:28:00 -06:00
toddouska d824b78af0
Merge pull request #2323 from dgarske/various_fixes
Various fixes, improvements to build options for reduced code size and static benchmarks
2019-07-08 13:02:22 -07:00
David Garske 011fa6bafd Added PBKDF2 benchmark. Benchmark improvements to capture results in static buffer (helps benchmarking on systems without printf support). Added benchmark "-print" option to show summary. Added wolfCrypt test version header. 2019-07-05 11:29:14 -07:00
David Garske d5f3fa2ff8 Added DES3 Crypto callback support. 2019-07-02 10:15:53 -07:00
Sean Parkinson ee023c6bf4 Simple checks of DH public value from peer.
Add test for wc_DhCheckPubValue
2019-06-25 11:12:33 +10:00
toddouska 15552be934
Merge pull request #2280 from cconlon/selftestccm
CAVP self test build fixes for AES-CCM and PKCS7
2019-06-24 15:55:18 -07:00
Sean Parkinson 71cb117dda Better length checks when parsing ASN.1 certificates 2019-06-19 10:05:21 +10:00
Chris Conlon c2032c64d2 CAVP self test build fixes for AES-CCM and PKCS7 2019-06-18 08:29:49 -07:00
Sean Parkinson a4bdfbf953 Fix for small stack in test.c 2019-06-14 08:43:36 +10:00
Sean Parkinson 102ecac70c
Merge pull request #2237 from julek-wolfssl/proper-arm-chacha-poly1305
ARM Chacha20 assembly code
2019-06-12 22:21:47 +10:00
John Safranek 01ad44feef
Merge pull request #2276 from kaleb-himes/BOTH_FIPS_VERSION_TESTING
Adjustment to test.c for merge of WCv4.0.1 changes
2019-06-11 13:21:42 -07:00
David Garske 24042c973a
Merge pull request #2259 from tmael/port_SiFive_RISCV
Added support for RISC-V SiFive HiFive Freedom platforms
2019-06-10 20:38:43 -07:00
toddouska 1f0a46331b
Merge pull request #2270 from dgarske/stsafe_tls
STSAFE Improvements to support Crypto Callbacks
2019-06-10 13:34:20 -07:00
Juliusz Sosinowicz a48981c3c6 Chacha20 ARM optimization 2019-06-10 19:21:46 +02:00
kaleb-himes c5aa13021a Adjustment to test.c for merge of WCv4.0.1 changes 2019-06-07 16:09:35 -06:00
toddouska 02c2782e39
Merge pull request #2272 from JacobBarthelmeh/SanityChecks
remove store of last block w/o padding and adjust padding last block case
2019-06-07 10:29:29 -07:00
Jacob Barthelmeh 87d24f4488 add additional test case for evp 2019-06-06 16:14:00 +07:00
Hideki Miyazaki 64b8af728b skip mutex lock after free 2019-06-06 11:06:29 +09:00
David Garske 074e770c98 * Fix to ensure user_settings.h can be included for bio.c and evp.c when IDE or compiler tries to build it directly. Allows for wildcard .c include along with `WOLFSSL_IGNORE_FILE_WARN`.
* Fix for building SP cortex M without RSA.
* Fix for type-cast warning with STSAFE-A100.
* Improved the RNG seed test to prevent type-case warning.
2019-06-04 15:57:31 -07:00
toddouska 7624d90590
Merge pull request #2258 from dgarske/no_stdlib
Improvements for no standard lib and no malloc/free builds
2019-05-31 14:59:33 -07:00
Tesfa Mael 87fb9f73e9 Added RISC-V SiFive FE310 support
Added freedom-e-sdk based makefile
Updated ecc test code to not allocate more memory than requried
Run wolfcrypt and benchmark tests on the SiFive HiFive1 targets
2019-05-28 17:48:36 -07:00
David Garske 5ea13a09f6 Adds Blake2s support (--enable-blake2s), which provides 32-bit Blake2 support. 2019-05-28 10:30:19 -07:00
David Garske f26a9589ff Added support for printf override using XPRINTF for wolfCrypt test/benchmark. Added ability to override snprintf with XSNPRINTF. If `STRING_USER` is defined no standard lib `<string.h>` or `<stdio.h>` will be included. 2019-05-23 22:03:38 -06:00
David Garske a89a2839de Fixes for building with `WOLFSSL_NO_MALLOC`. Fixes for static memory in bench embedded case. Added support for elimination of XMALLOC/XFREE when building with `NO_WOLFSSL_MEMORY` and `WOLFSSL_NO_MALLOC`. If used with `WOLFSSL_MALLOC_CHECK` will trap failures with `malloc_check` 2019-05-23 22:00:41 -06:00
David Garske 10dde24363 Added support for `SHOW_CERTS` with `OPENSSL_EXTRA_X509_SMALL` for embedded debugging of certs. Minor build warning fixes with `OPENSSL_EXTRA` and `STM32_HASH` on IAR. 2019-05-14 09:24:59 -07:00
Sean Parkinson dc98832757 Add more tests for Ed25519ctx and Ed25519ph 2019-05-01 09:24:08 +10:00
Sean Parkinson 9d736898cc Support Ed25519 sign/verify algorithms ctx and ph 2019-04-30 16:57:20 +10:00
toddouska 12a7c32530
Merge pull request #2170 from tmael/nRF52840CryptoCell
Initial CryptoCell-310 support on nRF52840
2019-04-24 11:09:46 -07:00
Jacob Barthelmeh 2a6ab9549b add macro guards 2019-04-23 13:51:58 -06:00
David Garske 6c65550eab Added CryptoCell-310 support
- SHA-256
- AES CBC
- CryptoCell 310 RNG
- RSA sign/verify and RSA key gen
- RSA encrypt/decrypt, decrypt inline
- ECC sign/verify/shared secret
- ECC key import/export and key gen pairs
- Hardware RNG and RTC of nRF52840 for benchmark timing source
- readme doc
2019-04-23 10:04:41 -07:00
David Garske 2c5f268f16 Port for Telit IoT AppZone SDK
* Added new `WOLFSSL_TELIT_M2MB` build option to enable support for RNG, Time, Mutex, FileSystem and Directory.
* Added `XTIME_MS` macro to simplify the tls13.c layer time requirement.
* Cleanup of the wolfCrypt benchmark and test printf remapping.
* Added wolfCrypt optional memory test enabled with `COMPLEX_MEM_TEST`.
* Added wolfCrypt test / benchmark feature for allowing "sleep" between long operations using `TEST_SLEEP()`.
* Fix for extern with `sp_ModExp_2048` when building with `--cpp` option.
2019-04-08 06:43:25 -07:00
Sean Parkinson cc5ba81245 SHA-3 support in Hash 2019-04-05 14:52:23 +10:00
David Garske 26cbfcdee0 Fix for AES GCM decrypt test with Async. 2019-04-01 05:58:44 -07:00
David Garske 1906179a1b Fix for `HAVE_ECC_CDH` wolfCrypt test with async using the wrong size for x and y. With async the `sizeof(sharedA) == 8` and it should be `ECC_SHARED_SIZE`. 2019-03-28 18:48:32 -07:00
Sean Parkinson b40e0888ad Fixes for different build configurations 2019-03-26 08:06:19 +10:00
Sean Parkinson b24e122a0d Fixes for RSA verify only builds 2019-03-26 08:06:19 +10:00
John Safranek 22b2ae7358 Release Fixes
1. Fix for the enable-afalg option from Jacob Barthelmeh.
2. Client fix for enable-sp+enable-sp-math option from David Garske.
3. Added a couple of typecasts to some mallocs.
4. Modified the option guard for the mask member of Options for the webserver build.
5. Added some more padding to the opaque structures used for SHA_CTX and AES_KEY.
6. Added WOLFSSL_API to the stack logging functions.
2019-03-19 13:55:17 -07:00
John Safranek 246c444b93 Updates for v4.0.0
Update the copyright dates on all the source files to the current year.
2019-03-15 10:37:36 -07:00
John Safranek 27ea9d9bce Configure Fixes
1. The combination enable-all and disable-rsa breaks some of the
testing. Added the NO_RSA guards as appropriate.
2. Disabled the OCSP stapling and CRL tests when RSA is disabled as they
use test certificates with RSA keys.
2019-03-13 17:54:33 -07:00
toddouska 696fe47de2
Merge pull request #2125 from embhorn/zd4297
Decoded cert cache feature
2019-03-12 14:02:47 -07:00
Eric Blankenhorn 2b59aefe80 Update from review 2019-03-11 18:14:37 -05:00
Eric Blankenhorn 8b6bd306f3 Update from review 2019-03-11 18:03:29 -05:00
toddouska 436a46a9f4
Merge pull request #2131 from dgarske/qat_v3.15.8
Fix for async wolfCrypt test with AES GCM.
2019-03-11 15:50:57 -07:00
toddouska c0ee01bbf6
Merge pull request #2123 from dgarske/stm32_gcm
Fixes for STM32 AES GCM
2019-03-11 12:53:27 -07:00
Kaleb Himes 1dcd6b92a0 Fix leak in wolfcrypt test app detected w/ WC_RSA_NO_PADDING set (#2145)
Fix leak in wolfCrypt test with `WC_RSA_NO_PADDING`
2019-03-08 14:13:38 -08:00
Chris Conlon da27a4da10
Merge pull request #2119 from jrblixt/feature-WICED-Studio-v6_1-PR02262019
Feature wiced studio v6 1 pr02262019
2019-03-04 17:45:42 +01:00
David Garske e87433e2b6 Fix for async wolfCrypt test with AES GCM. 2019-03-01 09:56:38 -08:00
Eric Blankenhorn e8c3e8dd63 Decoded cert cache feature 2019-02-28 16:59:19 -06:00
toddouska 8f3f27065c
Merge pull request #2114 from dgarske/qat_bench
Fixes and improvements for async / QuickAssist
2019-02-27 14:49:32 -08:00
toddouska b830447690
Merge pull request #2113 from JacobBarthelmeh/Testing
EVP decrypt with padding fix
2019-02-27 14:35:57 -08:00
David Garske 164eb30732 Fixes for STM32 AES GCM. Hardware does not correctly compute authTag if input is not a multiple of block size, so fall-back to software for tag only. Hardware also only supports IV of 12 or 16 bytes, so fall-back to software in those cases. ZD 4712 2019-02-27 11:07:03 -08:00
Jacob Barthelmeh b33023df2f fix setting outlen with wolfSSL_EVP_CipherUpdate decryption 2019-02-26 15:27:25 -07:00
jrblixt 8a47af0edc Added benchmark tests to WICED wolfcrypt test app.
Updated the user_settings.h loc per David.
TLS13; SNI; MAX_FRAG
Configure for wolfCrypt bench.
Update README.
2019-02-26 10:37:58 -07:00
Kiwamu Okabe 95658be0ce WICED wolfCrypt-TLS_cli_srv-Https_cli 2019-02-26 10:37:48 -07:00
David Garske 9a129e89c1 Fixes for building with no filesystem and `--enable-testcert` or `WOLFSSL_TEST_CERT`. Fixes nightly expected configurations test. 2019-02-26 09:36:31 -08:00
David Garske b45241f6f8 Fix to use QAT for ECC sign and verify when SP is enabled and key was initialized with devId. Fixes issues with wolfCrypt test and QAT not properly calling "again" for the ECC sign, verify and shared secret. 2019-02-25 14:51:15 -08:00
David Garske 9ff976a6e1 Fixes for wolfCrypt test with asynchronous support enabled and `--enable-nginx`. 2019-02-22 13:47:34 -08:00
Jacob Barthelmeh 8b0bcdaf29 EVP decrypt with padding fix 2019-02-22 10:05:15 -07:00
David Garske 289f51a77d Fixes for various spelling errors. 2019-02-21 13:29:44 -08:00
Sean Parkinson 5e1eee091a Add threaded samples using buffers and sockets 2019-02-19 11:47:45 +10:00
Sean Parkinson 3366acc9ce Zephyr port of crypto 2019-02-19 11:47:44 +10:00
David Garske eb8a2f3a03 Minor fixes to CryptoCb wolfCrypt test for AES test and hash support for update/final in same callback. 2019-02-12 16:03:10 -08:00
David Garske 88d3abb1e6 Added Crypto callback HMAC support. 2019-02-12 16:03:10 -08:00
Sean Parkinson 47922a4d87 Support in SSL for setting a private key id
Works with PKCS #11 to use key on device.
2019-02-11 10:38:38 +10:00
toddouska 4a5652f318
Merge pull request #2061 from SparkiDev/x86_asm_not_in_c
Pull out x86_64 ASM into separate files
2019-02-01 10:01:34 -08:00
toddouska 1258467b0a
Merge pull request #2054 from SparkiDev/pkcs11_rng
Add support for random and getting entropy (seed) with PKCS#11
2019-02-01 09:59:12 -08:00
toddouska 4a177a8a30
Merge pull request #1997 from tmael/portingDeos
Initial Deos RTOS port
2019-02-01 09:56:55 -08:00
Sean Parkinson 7822cef1ac Pull out x86_64 ASM into separate files 2019-01-29 13:08:24 +10:00
Sean Parkinson 743f8b576f Add support for random and getting entropy (seed) with PKCS#11
Getting the seed from a device has been added.
If the HASH_DRBG is available, PKCS#11 will be used for generating the
seed.
Otherwise, all generated random data will come from PKCS#11 device.
2019-01-25 08:01:30 +10:00
Jacob Barthelmeh 253915866d make build more modular 2019-01-18 16:25:24 -07:00
Jacob Barthelmeh f0a3045d62 af_alg sha3 addition
hardware acceleration with RSA

add AES-GCM hardware acceleration

refactor setting RSA IV flag

check and set AF_ALG flags

fix for default AF_ALG use

set buffer alignment with Xilinx RSA

macro guard after rebase

use ALIGN64

clean up test cases
2019-01-18 16:25:24 -07:00
Tesfa Mael 739b57c753 Initial Deos RTOS port
- Added support for Deos with no file system
- Implemented a custom malloc since reusing and freeing memory is disallowed in avionics and mission critical applications.
- Added TLS client and server example with a TCP setup mailbox transport
- Timer starts at an offset of CURRENT_UNIX_TIMESTAMP specified by the user
- Uses rand_r() as a pseudo random number generator and uses the current time in seconds as a seed
- Uses strnicmp for XSTRNCASECMP instead of strncasecmp
- a readme doc included
2019-01-18 14:46:39 -08:00
David Garske ee45cfdbcb Refactor and rename of cryptodev to cryptocb. Refactor API names from `wc_CryptoDev` to use `wc_CryptoCb`. Backwards compatibility is retained for anyone using old `WOLF_CRYPTO_DEV` name. Added comment about fall-through case when CryptoCb return `NOT_COMPILED_IN`. 2019-01-17 11:01:14 -08:00
toddouska 32ed53a991
Merge pull request #2012 from dgarske/cryptocb_sym
Added CryptoDev callback support for AES CBC, SHA1/SHA256 and RNG
2019-01-16 10:41:49 -08:00
David Garske 3c2aa60862 Fix to allow RSA public only to build without verify only. 2019-01-11 21:11:40 -08:00
David Garske ebc9533bc7 Fixes and improvements to the new Crypto callback code for AES and Hashing. 2019-01-09 17:39:05 -08:00
David Garske ba0d488807 Added RNG Crypto callback support. 2019-01-09 14:36:40 -08:00
David Garske 1201ffb13f Added CryptoDev callback support for AES CBC and SHA1/SHA256. 2019-01-02 14:34:26 -08:00
David Garske 5cb5b510ab Added blocking support for PKCS 7 with async. Fix for RSA async key gen in wolfCryp test. 2018-12-27 11:07:07 -08:00
toddouska 3eff20904a
Merge pull request #1991 from dgarske/rsa_nb_time
Adds RSA non-blocking time support
2018-12-21 15:58:54 -08:00
Jacob Barthelmeh 165a80d02d fix for build with cryptonly + rsapub 2018-12-19 15:30:22 -07:00
Jacob Barthelmeh 92d59c7df4 fix for cryptonly + rsavfy build 2018-12-19 14:36:32 -07:00
David Garske 413506f2b5 Adds new `wc_RsaSetNonblockTime` API and `WC_RSA_NONBLOCK_TIME` build option. This new function configures the maximum amount of blocking time in microseconds. It uses a pre-computed table along with the CPU speed in megahertz to determine if the next operation can be completed within the maximum blocking time provided. 2018-12-19 13:15:41 -08:00
Jacob Barthelmeh fc926d3c61 fixes from infer testing 2018-12-19 11:56:29 -07:00
David Garske c23489e6ed Added support for QAT RSA Key Generation. 2018-12-17 12:54:33 -08:00
toddouska 2ef8be2718
Merge pull request #1968 from dgarske/fixes_stm32cube_aes
Fixes for STM32 AES GCM crypto hardware acceleration
2018-12-12 14:52:35 -08:00
toddouska bdf447cec9
Merge pull request #1966 from cconlon/wctestbench
add define to use test/benchmark.h without path prefix
2018-12-12 14:50:32 -08:00
toddouska 3f7ced3ed5
Merge pull request #1960 from SparkiDev/sp_rsavfy
Allow a very small build based on SHA-256 and RSA verify
2018-12-12 14:49:42 -08:00
Eric Blankenhorn cbc8f4ce38 Fix failing nightly tests 2018-12-12 09:48:34 -06:00
Eric Blankenhorn 1c0fa6fb58 Code coverage tests and fixes - default config 2018-12-11 08:56:21 -06:00
David Garske 6552455968 Minor improvements to the STM32 CubeMX AES-GCM logic. 2018-12-10 11:40:06 -08:00
Sean Parkinson c122f6082f Allow a very small build based on SHA-256 and RSA verify 2018-12-10 08:48:01 +10:00
David Garske 0a725f4d56 Fixes for AES with STM32 crypto hardware:
* Fixes to ensure the "const" input buffer is not modified for AES GCM calls with STM32 hardware crypto.
* Improvements to allow AES GCM hardware acceleration for inputs that are not a multiple of AES block size.
* Switched the wolfCrypt test for STM32_CRYPTO to use the standard AES GCM tests with 12-byte IV and less than 16-byte auth data.
* Fixes for building with the standard peripheral library.
* Fixes for building with `NO_AES_DECRYPT`.
`./configure --enable-debug --disable-shared --enable-cryptonly CFLAGS="-DNO_AES_DECRYPT"`
2018-12-07 17:23:38 -08:00
Chris Conlon d662291b3d add define to use test/benchmark.h without path prefix 2018-12-07 10:27:51 -07:00
Chris Conlon 60a424d4e9 CAVP selftest fix for wc_RsaPSS_CheckPadding_ex() in test.c 2018-12-04 15:19:08 -08:00
toddouska 4afa0f72fe
Merge pull request #1926 from cconlon/cms2
CMS expansion, SignedData detached signature support
2018-11-26 13:22:26 -08:00
toddouska f11809aa62
Merge pull request #1923 from JacobBarthelmeh/Testing
cast to resolve warning, check size of time_t, and check for null tes…
2018-11-21 10:17:23 -08:00
toddouska 73dbd15b2b
Merge pull request #1896 from SparkiDev/openssl_extra2
More OpenSSL API support
2018-11-21 10:16:37 -08:00
Sean Parkinson 95bd340de5 Add support for more OpenSSL APIs
Add support for PEM_read and PEM_write
Add OpenSSL PKCS#7 signed data support
Add OpenSSL PKCS#8 Private key APIs
Add X509_REQ OpenSSL APIs
2018-11-20 07:54:24 +10:00
Hideki Miyazaki bc09f4bd30 Porting wolfssl into ESP-IDF development framework 2018-11-17 09:36:09 +09:00
Chris Conlon e756c5ffc9 use devId variable in test.c for PKCS7 examples 2018-11-16 15:54:32 -07:00
Chris Conlon 4295db218a add CMS SignedData support for detached signatures 2018-11-16 15:54:32 -07:00
Jacob Barthelmeh c307fd7af4 additional macro guards for disabling aescbc with opensslextra 2018-11-15 13:40:04 -07:00
Jacob Barthelmeh 0f4a06594e cast to resolve warning, check size of time_t, and check for null test case 2018-11-12 16:02:33 -07:00
David Garske 9f6167872f Fixes for additional use of unititlized variable with async for AES and DH. 2018-11-08 15:56:51 -08:00
David Garske fcb40570e2 Fixes for warnings with possible use of uninitialized variable in async with DES3 and AES. 2018-11-08 15:39:52 -08:00
JacobBarthelmeh 196791390b
Merge pull request #1911 from kaleb-himes/CRYPT_LOGIC_UPDATES-R2
Fix pre-processor checks in wolfCrypt test for unique configuration
2018-11-07 10:22:03 -07:00
Chris Conlon cc32466603 build fix for test.c when disabling CMS EncryptedData content type 2018-11-06 18:35:13 -08:00
Chris Conlon 9bef9bad8e PKCS7/CMS build fixes when disabling individual AES sizes 2018-11-06 18:35:13 -08:00
Chris Conlon 4d9375b862 PKCS7/CMS build fixes when disabling AES 2018-11-06 18:35:13 -08:00
Chris Conlon 004b0d3793 PKCS7/CMS build fixes when disabling RSA, ECC, or AES-GCM/CCM 2018-11-06 18:35:12 -08:00
Jacob Barthelmeh b3506c836c remove content type restriction and fix build with compkey 2018-11-06 18:35:12 -08:00
Jacob Barthelmeh 752259e343 first addition of decode enveloped stream 2018-11-06 18:35:12 -08:00
Jacob Barthelmeh 5525f59852 first addition of verify sign stream data 2018-11-06 18:35:12 -08:00
Jacob Barthelmeh 5d8f59d83b initial AuthEnvelopedData stream and add debug messages 2018-11-06 18:35:12 -08:00
Chris Conlon d69a3c1092 add single-shot API for generating CMS Signed Encrypted Compressed FirmwarePkgData 2018-11-06 18:35:12 -08:00
Chris Conlon c9f75fe7b4 add test cases for CMS Signed-Encrypted and Signed-Compressed FirmwarePkgData to test.c 2018-11-06 18:35:12 -08:00
Jacob Barthelmeh 83a150c4df stream of PKCS7 decode encrypted 2018-11-06 18:35:12 -08:00
Chris Conlon 40ef246b1f add CMS AuthEnvelopedData support for unauthAttrs 2018-11-06 18:35:12 -08:00
Chris Conlon 4315384051 update test.c error returns for PKCS7 2018-11-06 18:35:12 -08:00
Chris Conlon 06a6f8400b add CMS AuthEnvelopedData support for authAttrs 2018-11-06 18:35:12 -08:00
Chris Conlon bc94cdc11b add CMS AuthEnvelopedData content type support 2018-11-06 18:35:12 -08:00
Chris Conlon a4da14f4b0 allow CMS CompressedData to be disabled with NO_PKCS7_COMPRESSED_DATA 2018-11-06 18:35:12 -08:00
Chris Conlon 75349bbba5 add support for SubjectKeyIdentifier to KTRI CMS RecipientInfo types 2018-11-06 18:35:12 -08:00
Chris Conlon 794137c20c add CMS EnvelopedData OtherRecipientInfo support 2018-11-06 18:35:12 -08:00
Chris Conlon 85e0c203ea ignore pkcs7 test files 2018-11-06 18:35:12 -08:00
Chris Conlon 13b30a6a21 add CMS EnvelopedData PasswordRecipientInfo support 2018-11-06 18:35:12 -08:00
Chris Conlon dbb5bb7570 add CMS EnvelopedData KEKRecipientInfo support 2018-11-06 18:35:12 -08:00
Chris Conlon ec07fe492e misc CMS fixes from review and valgrind 2018-11-06 18:35:11 -08:00
Chris Conlon 7841434744 add support for multiple certificates in CMS SignedData certificates field 2018-11-06 18:35:11 -08:00
Chris Conlon ce1381dc9a add contentType check to CMS compressed tests 2018-11-06 18:35:11 -08:00
Chris Conlon 6a06a3b63b add CMS CompressedData test using FirmwarePkgData 2018-11-06 18:35:11 -08:00