310 Commits

Author SHA1 Message Date
toddouska
7f01aa917a Merge pull request #930 from dgarske/fix_win
Fixes for building AES key wrap and PKCS7 on Windows
2017-05-19 08:16:21 -07:00
David Garske
d61e0243a3 Fixes for building AES key wrap and PKCS7 on Windows. Cleanup snprintf to use XSNPRINTF and changed so define is always setup. 2017-05-18 14:44:19 -07:00
Jacob Barthelmeh
548c01ce54 updated static memory feature with pkcs7 2017-05-18 09:31:09 -06:00
Jacob Barthelmeh
66e086a0bf check return value of test case 2017-05-12 16:40:37 -06:00
David Garske
c0c98c8f64 Fixes to address build warnings for GCC 7. Used -Wimplicit-fallthrough=0 to suppress all switch fall-through warnings. 2017-05-11 15:12:16 -07:00
toddouska
5c652e398f Merge pull request #896 from dgarske/async_cleanups
Fixes for async and smallstack
2017-05-11 13:05:25 -07:00
David Garske
2e016f3b25 Refactor of the rsa_test and dh_test to better handle cleanup. 2017-05-08 12:30:54 -07:00
David Garske
17587d38f8 Fix for new AES 192/256 tests to handle async wait. 2017-05-06 00:28:01 -04:00
David Garske
fdb46ac24c Fix typo with blake2b_test return code. 2017-05-05 11:11:17 -07:00
David Garske
0ca2d7c137 Renumbered return values. 2017-05-04 14:53:39 -07:00
Jacob Barthelmeh
dbb67d8582 warnings for builds of haproxy, nginx, and leanpsk 2017-05-02 14:29:53 -06:00
Chris Conlon
8d032081ae Merge pull request #767 from shihrer/hexiwear_pr
Hexiwear changes and KDS Project for Hexiwear platform
2017-05-02 07:31:41 -06:00
toddouska
1a0b408658 Merge pull request #883 from dgarske/fixes_coverity
Fixes for coverity scan
2017-05-01 16:30:04 -07:00
David Garske
db63fe83d4 Initial pass at fixes for coverity scan. 2017-04-28 14:59:45 -07:00
David Garske
053594eb98 Workaround for expected failed RSA operations in test.c not failing for Cavium Nitrox V. 2017-04-27 14:21:38 -07:00
David Garske
d612b827b7 Fixes for build warnings on Windows. Fix PKCS7 to use const for byte array declaration. Cleanup of the pkcs7 MAX_PKCS7_DIGEST_SZ. Fix for unsigned / signed comparison warning for pkcs7_load_certs_keys in test.c. Fix for cast warning from word16 to byte in asn.c. Fix for build error with io.h refactor for InTime RTOS. 2017-04-26 09:40:33 -07:00
David Garske
5a77eaa579 Fix issue with XFREE in asn.c using invalid heap pointer. Fix issue with bad variable names and missing asterisk in test.c pkcs7_load_certs_keys. 2017-04-26 08:45:05 -07:00
Nickolas Lapp
a8eb2614f6 Update reference for aes192/256 test to remove bad url and give specific
NIST reference document.
2017-04-19 13:13:34 -06:00
Nickolas Lapp
344c0ec747 Merge branch 'master' of github.com:wolfSSL/wolfssl 2017-04-19 10:10:23 -06:00
toddouska
5b82c2f6ec Merge pull request #853 from JacobBarthelmeh/Windows
testsuite time check on Windows system and fix dh_test if statement
2017-04-18 14:57:53 -07:00
Chris Conlon
bab3fd5925 fix clang/scan-build warnings for PKCS7 2017-04-17 14:23:37 -06:00
Chris Conlon
4f26e0341b allow different hashes with PKCS7 SignedData, cleanup conditional builds 2017-04-17 09:46:26 -06:00
Michael
b08e5f3b82 Merge branch 'master' into hexiwear_pr 2017-04-14 12:03:42 -06:00
Jacob Barthelmeh
53eca92cc0 change type for test instead and add RSA blinding check 2017-04-14 12:02:49 -06:00
Michael Shihrer
21d2becd6b Modified settings.h to allow building on KSDK 1.3, modified test.c and benchmark.c to work with KSDK, added KDS project for building wolfSSL for Hexiwear 2017-04-14 12:02:28 -06:00
Chris Conlon
74aafb1679 add PKCS7 SignedData with ECDSA 2017-04-14 09:29:22 -06:00
Nickolas Lapp
460197a5e0 Add aes192 and aes256 tests
Fix bug with AES decrypt for non-128 bit sizes on STM32F4 hardware
crypto
2017-04-12 20:09:47 -06:00
Jacob Barthelmeh
26c8958d1e testsuite time check on Windows system and fix dh_test if statement 2017-04-12 15:56:45 -06:00
toddouska
e1a53a6c36 Merge pull request #845 from SparkiDev/cert_file
Rename caCertFile
2017-04-12 13:55:56 -07:00
David Garske
11133e578d Fixes and cleanups based on feedback from Sean. Added ifdef checks around WC_PENDING_E code to reduce code size for non-async builds. Cleanup accumulative result code checking in SSL_hmac. Cleanup of the RSA async state advancement. 2017-04-12 10:07:38 -07:00
David Garske
c1640e8a3d Intel QuickAssist (QAT) support and async enhancements/fixes:
* Adds ./configure "--with-intelqa=../QAT1.6”, port files, memory management and README.md (see wolfcrypt/src/port/intel/).
* Added Intel QAT support for RSA public/private (CRT/non-CRT), AES CBC/GCM, ECDH/ECDSA, DH, DES3, SHA, SHA224, SHA256, SHA384, SHA512, MD5 and HMAC.
* wolfSSL async enabled all client and server: PKI, Encrypt/Decrypt, Hashing/HMAC and Certificate Sign/Verify.
* wolfSSL async support in functions: Encrypt, Decrypt, VerifyMAC, BuildMessage, ConfirmSignature, DoCertificate, ParseCertRelative, and MakeSignature.
* wolfCrypt test and benchmark async support added for all HW acceleration.
* wolfCrypt benchmark multi-threading support.
* Added QuickAssist memory overrides for XMALLOC, XFREE and XREALLOC. XREALLOC determines if existing pointer needs reallocated for NUMA.
* Refactor to make sure “heap” is available for async dev init.
* Added async support for all examples for connect, accept, read and write.
* Added new WC_BIGINT (in wolfmath.c) for async hardware support.
* Added async simulator tests for DES3 CBC, AES CBC/GCM.
* Added QAT standalone build for unit testing.
* Added int return code to SHA and MD5 functions.
* Refactor of the async stack variable handling, so async operations have generic args buffer area and cleanup function pointer.
* Combined duplicate code for async push/pop handling.
* Refactor internal.c to add AllocKey / FreeKey.
* Refactor of hash init/free in TLS to use InitHashes and FreeHashes.
* Refactor of the async event->context to use WOLF_EVENT_TYPE_ASYNC_WOLFSSL for WOLFSSL* and WOLF_EVENT_TYPE_ASYNC_WOLFCRYPT for WC_ASYNC_DEV*.
* Suppress error message for WC_PENDING_E.
* Implemented "wolfSSL_EVP_MD_CTX_init" to do memset.
* Cleanup of the openssl compat CTX sizes when async is enabled.
* Cleanup of AES, DES3, DH, SHA, MD5, DES3, DH, HMAC, MD5 for consistency and readability.
* Cleanup of the OPAQUE_LEN.
* Cleanup to use ENCRYPT_LEN instead of sizeof(ssl->arrays.preMasterSecret).
* Changed ssl->arrays.preMasterSecret to use XMALLOC (accelerates HW operations)
* Reduce verbosity with debug enabled for "GetMyVersion", "wolfSSL Using RSA OAEP padding" and "wolfSSL Using RSA PKCSV15 padding".
* Updated RSA un-padding error message so its different than one above it for better debugging.
* Added QAT async enables for each algorithm.
* Refactor of the async init to use _ex.
* Added WC_ASYNC_THRESH_NONE to allow bypass of the async thresholds for testing.
* Reformatted the benchmark results:
PKI: "RSA 2048 private HW 18522 ops took 1.003 sec, avg 0.054 ms, 18467.763 ops/sec"
Crypto/Hashing: SHA-256 SW 350 megs took 1.009 seconds, 346.946 MB/s Cycles per byte = 9.87
* Added min execution time for all benchmarks.
* Moved wc_*GetHash and wc_*RestorePos to appropriate files so use of isCopy flag is local.
* Fix for ECC sign status sometimes being invalid due to uninitialized ECC digest in benchmark.
* Added new DECLARE_VAR/FREE_VAR and DECLARE_ARRAY/FREE_ARRAY macros for helping setup test/benchmark variables to accelerate async.
* Added NO_SW_BENCH option to only run HW bench.
* Added support for PRNG to use hardware SHA256 if _wc devId provided.
* Fix to prevent curve tests from running against wrong curve sizes. Changed wc_ecc_set_curve to match on exact size.
* Added the wc_*GetHash calls to the wolfCrypt tests.
* Added async hardware start/stop to wolfSSL init/cleanup.
* Refactor to add wc_*Copy for hashing context (for async), which replaces wc_*RestorePos.
* Fixes for building with TI hashing (including: SHA224, missing new API’s and building with dummy build for non hw testing). Note: We need to add build test for this `./configure CFLAGS="-DWOLFSSL_TI_HASH -DTI_DUMMY_BUILD”`.
* Added arg checks on wc_*GetHash and wc_*Copy.
* Cleanup of the BuildMD5, BuildSHA, BuildMD5_CertVerify and BuildSHA_CertVerify functions.
* Added new ./configure --enable-asyncthreads, to allow enable/disable of the async threading support. If --enable-asynccrypt set this will be enabled by default if pthread is supported. Allows multi-threaded benchmarks with async simulator.
* Added checks for all hashing to verify valid ->buffLen.
* Fix for SHA512 scan-build warning about un-initialized “W_X”.
* Fix for valgrind un-initialized use of buffer in AllocDer (der->buffer) and BuildTlsFinished handshake_hash.
* Refactor of the benchmarking to use common function for start, check and finish of the stats.
* Fixed issue with ECC cache loading in multi-threading.
* Fix bug with AESNI not aligned code that assumes XMALLOC is 16-byte aligned.
* Added new WC_ASYNC_NO_… options to allow disabling of individual async algorithms. New defines are: WC_ASYNC_NO_CRYPT, WC_ASYNC_NO_PKI and WC_ASYNC_NO_HASH. Additionally each algorithm has a WC_ASYNC_NO_[ALGO] define.
* Added “wolfSSL_GetAllocators” API and fixed the wolfCrypt memcb_test so it restores callback pointers after test is complete (fixes issue with using custom allocators and test breaking it).
2017-04-10 14:45:05 -07:00
Sean Parkinson
5edcf685ca Rename caCertFile 2017-04-10 10:38:16 +10:00
toddouska
2b443a79f2 Merge pull request #836 from dgarske/stack_check_free
Fix leak in StackSizeCheck and build error with debug enabled
2017-04-07 09:35:01 -07:00
David Garske
2c13ea9a67 Cleanup name conflicts with test.h cert files (by adding “File” to end). Fix memory leak in ecc_test_buffers function. 2017-04-06 15:54:59 -07:00
dgarske
9ef26679df Merge pull request #833 from SparkiDev/asn_func
ASN Code Rework
2017-04-06 12:47:40 -07:00
David Garske
d648d4f6c7 Fix leak in StackSizeCheck. Fix build error with debug enabled and stack size check. 2017-04-05 14:24:55 -07:00
toddouska
59dc839341 Merge pull request #819 from dgarske/test_static_fixes
Fixes for wolfCrypt test/benchmark with static memory
2017-04-03 15:25:45 -07:00
Sean Parkinson
fd9e41dd99 ASN functions added to simplify code
Functions to get and set different ASN.1 tags have been added.
The functions are used in the asn.c file to simplify the code and ensure
all checks are done.
2017-04-03 16:56:21 +10:00
David Garske
c532819659 Fixes for building with “CUSTOM_RAND_GENERATE_BLOCK”. Removed seed as backup RNG source. Fixed building on embedded system with time_t not defined (test.c should use long for asn_test). 2017-03-31 13:16:21 -07:00
David Garske
5e3d8e705e Fix RNG issue with Intel RDRAND and RDSEED accelerations not being used because HAVE_HASHDRBG was always being defined if !WOLFSSL_FORCE_RC4_DRBG. Added new --enable-intelrand option to indicate use of RDRAND preference for RNG source (if RDRAND not supported by CPU then HASHDRBG will be used). The --enable-intelasm option enables the RDSEED support for seeding HASHDRBG if CPU supports it. Allow use of seed as RNG source if --disable-hashdbrg (shows build warning). Cleanup to remove old ARC4 RNG support. Fixed random_test return code with !HAVE_HASHDRBG. Cleanup of ./configure --help alignment. 2017-03-31 13:16:21 -07:00
David Garske
34a4f1fae0 Move wolfCrypt test/benchmark to move static memory pool to global (not in stack). Fix wolfCrypt test wc_InitRng to use _ex with HEAP_HINT (when not FIPS). Added ability to use HAVE_STACK_SIZE with wolfCrypt test and benchmark. Cleanup of the benchmark_test function main wrapper. 2017-03-31 13:11:23 -07:00
toddouska
ccad9f5575 Merge pull request #818 from dgarske/tkernel_port
TKernel port
2017-03-31 10:10:26 -07:00
Jacob Barthelmeh
5c2b5f86b9 testing buffer size with const DH and remove redeclaration of WOLFSSL_CRL 2017-03-30 10:53:13 -06:00
David Garske
36d9504bc3 Added NO_WRITE_TEMP_FILES option to prevent writing temp files during wolfCrypt test. 2017-03-28 19:37:55 -07:00
David Garske
75abeaecfc Updates for TKernel port (WOLFSSL_uTKERNEL2). Added support for InterNiche prconnect_pro using WOLFSSL_PRCONNECT_PRO. Cleanup the min/max functions. Add NO_STDIO_FGETS_REMAP to not include the fgets remap for WOLFSSL_uTKERNEL2. Fix TFM build warning. Added HAVE_POCO_LIB. Added wolfCrypt test temp cert path for WOLFSSL_uTKERNEL2 = /uda/. Added WOLFSSL_CURRTIME_REMAP for benchmark to allow different function name to be used for system which have a conflicting name. Add ability to use normal malloc/free with WOLFSSL_uTKERNEL2 using NO_TKERNEL_MEM_POOL. Added new XMALLOC_OVERRIDE to allow custom XMALLOC/XFREE/XREALLOC macros. Move CUSTOM_RAND_GENERATE up in RNG choices. Rename tls.c STK macros due to conflict. 2017-03-28 19:10:19 -07:00
kaleb-himes
2bcb8e53fc Address case from review 2017-03-27 16:53:13 -06:00
kaleb-himes
00ca1dcbb7 Fix for: 'Fix for build error with unused eccCaKeyFile' 2017-03-24 14:01:06 -06:00
toddouska
a6ecf793ba Merge pull request #806 from dgarske/tfm_heap_reduce
Reduce heap usage with fast math when not using ALT_ECC_SIZE
2017-03-21 15:21:09 -07:00
dgarske
360fb2db0a Merge pull request #808 from kojo1/TrialProj
eccCaKeyFile in RSA/ECC test
2017-03-21 15:21:00 -07:00
toddouska
3e2fe536ad Merge pull request #809 from JacobBarthelmeh/Testing
test case when not using RSA blinding
2017-03-21 15:18:53 -07:00