Commit Graph

5679 Commits

Author SHA1 Message Date
Jacob Barthelmeh
ebde18af59 silence static analysis tool warning about null parameter after sanity check 2017-04-13 15:32:31 -06:00
Jacob Barthelmeh
620d21c850 fix scrypt test with no password 2017-04-13 15:06:26 -06:00
David Garske
3df47d57ab Fix error with armv8-aes wc_AesInit function using h instead of heap variable. (moved from PR #852). 2017-04-13 14:50:55 -06:00
David Garske
4c6a70861b Fix build errors with --enable-scrypt. 2017-04-13 09:37:48 -07:00
Daniele Lacamera
723ee69114 Fixed missing braces in wolfcrypt test 2017-04-13 15:31:50 +02:00
Daniele Lacamera
ef231a039d Updated to latest masterbranch 2017-04-13 15:28:19 +02:00
Go Hosohara
fe215c4a57 Fix DES_ecb_encrypt function in terms of reviewing point. 2017-04-13 12:31:52 +09: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
JacobBarthelmeh
3ac35ce3b3 Merge pull request #838 from SparkiDev/curve25519_51-bit
Curve25519 51-bit Implementation
2017-04-12 16:06:37 -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
dgarske
8ee9e4ff8b Merge pull request #851 from toddouska/nosessid
don't send session ID on server side if session cache is off unless w…
2017-04-12 14:50:43 -07:00
toddouska
3abcff4db5 Merge pull request #850 from JacobBarthelmeh/Testing
fix invalid check on unsigned type
2017-04-12 13:56:44 -07:00
toddouska
27d009475c Merge pull request #847 from dgarske/distro_options
Fixes for --enable-distro to include more features by default
2017-04-12 13:56:24 -07:00
toddouska
e1a53a6c36 Merge pull request #845 from SparkiDev/cert_file
Rename caCertFile
2017-04-12 13:55:56 -07:00
toddouska
4f7b27fc88 Merge pull request #844 from SparkiDev/size_t-printf
32-bit size_t and printf fix
2017-04-12 13:54:52 -07:00
toddouska
3810571e0d Merge pull request #715 from dgarske/async_intelqa
Intel QuickAssist (QAT) support and async enhancements/fixes
2017-04-12 13:54:19 -07:00
toddouska
b1d59a2334 don't send session ID on server side if session cache is off unless we're echoing session ID as part of session tickets 2017-04-12 10:54:19 -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
Jacob Barthelmeh
b510c8199e fix invalid check on unsigned type 2017-04-12 10:41:35 -06:00
Daniele Lacamera
df70b3c859 Removed empty ifdef 2017-04-12 12:50:17 +02:00
Daniele Lacamera
3e9a5fd433 Updated to latest masterbranch 2017-04-12 12:48:38 +02:00
Maxime Vincent
9ca49e7f56 Add more stubs for haproxy 2017-04-12 11:59:17 +02:00
Maxime Vincent
02513792b6 Make new function stubs public 2017-04-12 10:37:17 +02:00
David Garske
d0f31d4a30 Fix issue with wc_ecc_make_key where state failure can occur if the wc_ecc_init hasn’t been called on key prior. Now wc_ecc_make_key and wc_ecc_import_private_key (and _ex versions) can be called without having to call wc_ecc_init first. This keeps backwards compatibility. If async or static memory is desired then wc_ecc_init_ex must be called first. 2017-04-11 15:57:09 -07:00
David Garske
85bef98331 Fix wc_ecc_alloc_rs memset logic. Fix error handling in hmac.c for SHA224. Cleanup of the wc_DhGenerateKeyPair_Async function. Added comment about the “BuildTlsFinished” allocation for hash buffer. Fixed issue with example server that caused the benchmark script to fail in throughput mode. 2017-04-11 14:13:08 -07:00
Go Hosohara
0cebc2172c Fix WolfSSL_DES_ecb_encrypt(). 2017-04-12 00:03:35 +09:00
Go Hosohara
d399b51ba8 Fix WolfSSL_DES_ecb_encrypt(). 2017-04-11 23:49:10 +09:00
Daniele Lacamera
de017b0028 Added stubs required to compile HAPROXY 2017-04-11 16:03:08 +02:00
Daniele Lacamera
8f300515bd Grouped HAPROXY compatibility into WOLFSSL_HAPROXY flag
now haproxy compatible wolfssl builds with:

./configure --prefix=/usr --sysconfdir=/etc --disable-fastmath \
iam * ] 2:18 PM
    --disable-fasthugemath --disable-bump \
    --enable-opensslextra \
    --enable-keygen --enable-certgen \
    --disable-ntru --disable-examples \
    --enable-tlsx --enable-haproxy \
    --enable-savecert --enable-savesession --enable-sessioncerts \
    --enable-webserver --enable-sslv3 --enable-stunnel
2017-04-11 14:18:41 +02:00
dgarske
213afe18c3 Merge pull request #842 from JacobBarthelmeh/Testing
fix c32toa needed with --enable-session-ticket
2017-04-10 19:10:35 -07:00
David Garske
eb1a191fd2 Refactor to add the wc_HmacInit and wc_HmacFree calls. 2017-04-10 14:47:08 -07:00
David Garske
e419a6f899 Fixes and cleanups based on feedback from Sean. 2017-04-10 14:47:07 -07:00
David Garske
62e7dc87c3 Fix merge error with verify callback and totalCerts. 2017-04-10 14:45:05 -07:00
David Garske
56a1618ba0 Fixes to a few things based on peer review. 2017-04-10 14:45:05 -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
David Garske
dc65a9a277 Distro fix to enable SHA224 by default. Was causing Debian build error since SHA224 is enabled by default only for the x86_64 architecture. Updated --enable-distro option to include new features for aeskeywrap, x963kdf and scrypt. Changed the ECC custom curve option to enable all curve types when used with distro. 2017-04-10 11:45:26 -07:00
Go Hosohara
dccff615d5 Add wolfSSL_DES_ecb_encrypt() encrypt/decrypt parameter check. 2017-04-10 16:19:44 +09:00
Go Hosohara
97c22c88d8 Add test result message for test_wolfSSL_DES_ecb_encrypt(). 2017-04-10 15:37:47 +09:00
Go Hosohara
27c6625bfe Fix #ifdef in WolfSSL_DES_ecb_encrypt and test_WolfSSL_DES_ecb_encrypt. 2017-04-10 14:44:48 +09:00
Sean Parkinson
5edcf685ca Rename caCertFile 2017-04-10 10:38:16 +10:00
Sean Parkinson
335b6d41c1 32-bit size_t and printf fix 2017-04-10 10:26:36 +10:00
Sean Parkinson
cbe46f8d74 Include new file in dist 2017-04-10 08:30:44 +10:00
Go Hosohara
b19cf2cfb8 Add test_wolfSSL_DES_ecb_encrypt() 2017-04-08 17:03:58 +09:00
toddouska
e8971c361a Merge pull request #830 from kaleb-himes/suite-typo
Fixes for using default ciphers
2017-04-07 17:20:54 -07:00
kaleb-himes
8953ed9f30 DTLS update per RFC 6347 Section 4.2.3 2017-04-07 14:26:33 -06:00
jrblixt
3478c9b937 Added return checks to src/keys.c. 2017-04-07 14:15:53 -06:00
Jacob Barthelmeh
80d88b9421 fix c32toa needed with --enable-session-ticket 2017-04-07 11:46:27 -06:00
David Garske
4ff2903b55 Fix to allow anonymous ciphers to work with the new default suite testing. 2017-04-07 10:20:41 -07:00
David Garske
eb40175cc6 Fix to calc BuildSHA_CertVerify if WOLFSSL_ALLOW_TLS_SHA1. Fix to add check for DTLS to not allow stream ciphers. Removed the RC4 tests from the test-dtls.conf. Added support for using default suites on client side. Switched the arg to “-H”. Cleanup of the example server/client args list. Fixes for build with “--disable-sha”. 2017-04-07 10:20:41 -07:00
David Garske
6a1ae7ee5b Fix on server side to make sure SHA hash is setup even with NO_OLD_TLS. Fix to initialize hsHashes to zero. Fix in PickHashSigAlgo to not default to SHA if NO_OLD_TLS is defined (unless WOLFSSL_ALLOW_TLS_SHA1 is set). Fix to allow pre TLS 1.2 for “AES128-SHA256” and “AES256-SHA256”. 2017-04-07 10:20:18 -07:00