John Safranek
6d1a11eefb
Clang static analysis found a potential issue when checking an ECC key
...
when the curve cache is enabled. There was a chance it could dereference
NULL. Added some error checks to fix it.
2019-03-29 13:35:27 -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
toddouska
0d48a4a1a7
Merge pull request #2133 from dgarske/fixes_16bit
...
Fixes for data types, cast warnings and shift operations when using 16-bit platform
2019-03-12 16:53:27 -07:00
David Garske
3d9c660688
Refactor of the ECC crypto callback return code handling.
2019-03-11 08:28:45 -07:00
David Garske
99b5188ee9
Fix for missing curve specs when using ATECC due to PR ( https://github.com/wolfSSL/wolfssl/pull/2115 ).
2019-03-04 09:48:33 -08: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
David Garske
2bb5dd710c
Fix for curve load failure leak.
2019-02-25 15:19: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
712ecabf36
Fix for ECC sign with hardware to ensure the input is truncated to the key order.
2019-02-22 15:30:52 -08:00
toddouska
272181bc2e
Merge pull request #2086 from dgarske/atecc_makekey
...
Fix for ATECC make key case when `curve_id == 0`
2019-02-13 09:52:54 -08:00
David Garske
acb983a154
Fix for ATECC make key case when curve_id == 0 (default). ZD 4383
2019-02-12 08:34:34 -08:00
Sean Parkinson
e86aae00ed
Change to allow setting of devId for private key
2019-02-11 12:37:44 +10:00
David Garske
7c4fa33937
Improve the error handling for non ECC_SECP256R1 curve in wc_ecc_make_key_ex.
2019-01-22 14:04:18 -08:00
Daniele Lacamera
501a3a287b
Allow ECC Verify-only operations with NO_ASN and SP_MATH
2019-01-21 07:11:35 +01: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
David Garske
61757c83eb
Fix double free with ./configure --enable-asynccrypt --enable-smallstack.
2018-12-21 15:45:33 -08:00
David Garske
a936c609f3
Fixes for ATECC508A/608A CryptoAuthLib demo.
2018-12-10 11:40:37 -08: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
e9a10e3614
Scan-build fix for possible case where r and s aren't initalized for wc_ecc_verify_hash.
2018-11-08 15:40:06 -08:00
toddouska
144ff68cfb
Merge pull request #1882 from SparkiDev/pkcs11_lib
...
Improvements for PKCS#11 library
2018-11-06 08:53:57 -08:00
Jacob Barthelmeh
a953a3141e
infer and g++ build fixes
2018-11-01 09:59:35 -06:00
Sean Parkinson
7551e49fed
Improvements for PKCS#11 library
2018-10-18 17:31:17 +10:00
toddouska
7391f4db90
Merge pull request #1815 from dgarske/atecc508_fixes
...
Fixes for ATECC508A
2018-10-17 08:35:09 -07:00
David Garske
bb737ec99d
Fixes for building against latest CryptoAuthLib. Refactor to eliminate the atcatls function calls, since these have been removed from latest CryptoAuthLib. Cleanup of the slot assignment handling.
2018-10-15 14:17:43 -07:00
David Garske
c51c607e96
Fix to use inLen for raw public key copy. No need to throw an error for other curve types as this function may be used for software only import/export. In the TLS case with only SECP256R1 there are other places where an error will be thrown.
2018-10-15 14:17:42 -07:00
David Garske
53c2264327
Fix for checking the inLen when setting raw public key len for hardware. Finished the ATECC508A ECC functions to support native TLS with the WOLFSSL_ATECC508A option and SECP256R1. Added slot type for alloc/free. Added helper functions for setting the PK callbacks and custom content. Updated the README.md with build options. Added support for overriding the ATECC_MAX_SLOT. Added overridable define for encryption slot number ATECC_SLOT_I2C_ENC. Added new build option WOLFSSL_ATECC_PKCB for using just the reference PK callbacks.
2018-10-15 14:17:42 -07:00
David Garske
e78ddfce75
Fix for wc_ecc_import_x963_ex to handle ATECC508A raw public key. Cleanup of the ATECC508A encryption key support. Added new macro ATCA_TLS_GET_ENC_KEY to allow setting your own function at build-time for getting the encryption key.
2018-10-15 14:17:42 -07:00
David Garske
6fbeae8f11
Fixes for building with WC_ASYNC_NO_SHA256. Improvements with WC_ASYNC_NO_HASH or WC_ASYNC_ENABLE_ECC to avoid unnecessary memory allocations.
2018-10-12 10:44:26 -07:00
Tesfa
f83ea9a9d5
Fixed MINGW32 build errors
2018-10-03 13:58:51 -07:00
Sean Parkinson
8a5a03ea35
Support for PKCS#11
...
Support for RSA, ECDSA and AES-GCM operations.
2018-09-24 08:41:25 +10:00
Sean Parkinson
783c4a0c5e
Make ALT_ECC_SIZE with SP work
...
Change to more relevant dynamic types in SP also.
2018-08-22 16:02:51 +10:00
Aaron Jense
93546694ca
modify for readability
2018-08-16 17:04:32 -06:00
Aaron Jense
aeb9ab8aea
Combine if statements
2018-08-16 16:25:53 -06:00
Aaron Jense
eb08c6f6fc
Fix error with wolfCrypt-JNI having ECC_PRIVATEKEY_ONLY and d != NULL
2018-08-16 15:29:46 -06:00
David Garske
cdff2869c2
Fixes for building with WC_NO_RNG (applies to wolfCrypt only builds). Tested with ./configure --enable-cryptonly CFLAGS="-DWC_NO_RNG" && make.
2018-08-14 18:53:25 -06:00
David Garske
be33e69b22
Refactor to rename wc_ecc_export_int to wc_export_int for generic API for exporting an mp_int as hex string or unsigned bin.
2018-08-14 12:17:20 -06:00
David Garske
c073aee87c
Added new ECC export API's to support export as hex string. New API's are wc_ecc_export_ex and wc_ecc_export_int. For hex string use ECC_TYPE_HEX_STR as encType arg. Refactor to reduce duplicate code. Build fixes for NO_ECC_KEY_EXPORT.
2018-08-14 12:05:22 -06:00
David Garske
0f86494161
* Added support for STM32L4 AES hardware crypto.
...
* Added reference PK callbacks functions for ECC sign, verify and shared secret used by TLS in `wolfcrypt/src/port/st/stsafe.c`.
* Fix for wolfcrypt_test to not require args to be provided.
* Fix for wolfCrypt `ecc_test_buffers` to poperly init ecc_key (resolves devId issue).
* Fix for STM32 AES CBC Decrypt with CubeMX, which was not capturing the first input block for next IV.
* Refactor to combine STM32 hardware init code.
2018-07-30 13:58:19 -07:00
David Garske
efbabbfb29
Further improvements to hashing code to make sure wc_*Free is always called including wc_HashFree. Added new defines to disable PIC32MZ hardware features using NO_PIC32MZ_HASH, NO_PIC32MZ_RNG and NO_PIC32MZ_CRYPT.
2018-07-26 14:41:30 -07:00
Sean Parkinson
06b888a997
Fix for RSA_LOW_MEM and other configurations
...
Also cast return of XMALLOCs.
2018-07-23 08:47:11 +10:00
John Safranek
c9434c5ad8
FIPS build and ECC fixes
...
1. The fips-check script was missing the ecc file when building the FIPSv2 test directory. The correct file was sent in for testing.
2. When building with ECC import validation enabled, one usage of the ALLOC_CURVE_SPECS macro had an extra parameter. (copy-and-paste error)
2018-07-19 10:02:14 -07:00
Sean Parkinson
e6c22fbd85
Small stack support in ECC
...
Small stack builds now dynamically allocate large stack variables.
Cache option added to avoid repeated allocation of temporaries in add
points, double point and map.
Cached memory allocated in mulmod and mul2add.
2018-07-17 16:39:53 +10:00
Chris Conlon
cadd556b3a
cast result of bitwise not back to original type to prevent compiler warnings
2018-07-12 13:46:55 -06:00
Chris Conlon
0f2b5ca181
fixes for MQX classic 4.0 with IAR-EWARM
2018-07-11 10:54:24 -06:00
toddouska
5d767aa004
Merge pull request #1641 from ejohnstown/rename-inline
...
Rename INLINE
2018-06-27 09:34:41 -07:00
John Safranek
586874b997
Rename INLINE
...
1. Renamed the macro INLINE as WC_INLINE.
2. For FIPS and the "selftest" build, define INLINE as WC_INLINE. Allows the FIPS code to work unchanged.
2018-06-26 15:17:46 -07:00
toddouska
d9b5948947
Merge pull request #1605 from dgarske/asyncfsanitize
...
Fixes for async to resolve runtime fsanitize issues
2018-06-26 14:27:07 -07:00
John Safranek
e6c7952f50
Merge master into fipsv2. Resolved a conflict in api.c.
2018-06-22 09:52:26 -07:00
David Garske
64ba151c35
Experimental fixes for async to resolve runtime fsanitize issues with invalid memory access due to attempting realloc on non NUMA type. Tested with ./configure --with-intelqa=../QAT1.6 --enable-asynccrypt CC="clang -fsanitize=address" --enable-debug --disable-shared --enable-trackmemory CFLAGS="-DWOLFSSL_DEBUG_MEMORY -DWOLFSSL_DEBUG_MEMORY_PRINT" && make and sudo ./tests/unit.test.
2018-06-22 09:30:25 -07:00
David Garske
5b2bb44bc8
Fixes for build with WOLFSSL_ATECC508A defined.
2018-06-13 20:10:01 -07:00