Commit Graph

335 Commits

Author SHA1 Message Date
David Garske
2efa7d5b8b Fix for verify callback override, peerVerifyRet code on success and ensuring DOMAIN_NAME_MISMATCH error gets passed down in ECDSAk case. Added unit test case to verify callback override works. Fixes issue #905 and issue #904. Fix for async build goto label typo. 2017-05-11 12:23:17 -07:00
Sean Parkinson
2b1e9973ec Add TLS v1.3 as an option 2017-05-04 14:51:30 -07:00
David Garske
9491027c85 Fixes for coverity scan (part 2). 2017-05-01 16:34:24 -07:00
Daniele Lacamera
7058211860 Merge from latest masterbranch 2017-04-24 06:18:44 +02:00
JacobBarthelmeh
3600371abf Merge pull request #848 from ghoso/des_ecb_encrypt_impl
openSSL compatibility API
2017-04-21 14:05:22 -06: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
Daniele Lacamera
3e9a5fd433 Updated to latest masterbranch 2017-04-12 12:48:38 +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
David Garske
e419a6f899 Fixes and cleanups based on feedback from Sean. 2017-04-10 14:47:07 -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
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
Go Hosohara
b19cf2cfb8 Add test_wolfSSL_DES_ecb_encrypt() 2017-04-08 17:03:58 +09: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
b14da2622e Fix InitSuites to allow old TLS for DHE_RSA with AES 128/256 for SHA256. Reverted changes to test.conf and test-dtls.conf. 2017-04-07 10:20:18 -07:00
David Garske
4dcad96f97 Added test for server to use the default cipher suite list using new “-U” option. This allows the InitSuites logic to be used for determining cipher suites instead of always overriding using the “-l” option. Now both versions are used, so tests are done with wolfSSL_CTX_set_cipher_list and InitSuites. Removed a few cipher suite tests from test.conf that are not valid with old TLS. These were not picked up as failures before because wolfSSL_CTX_set_cipher_list matched on name only, allowing older versions to use the suite. 2017-04-07 10:20:18 -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
toddouska
c8400e9ff1 Merge pull request #824 from dgarske/fix_asn_confirm_sig
Fix for return code checking on ConfirmSignature
2017-04-05 16:58:47 -07:00
David Garske
3328b4d38b Cleanup the unit test naming for new signature failure tests. 2017-04-05 11:24:22 -07:00
Chris Conlon
0c61a5b1fd add invalid test case for wc_ecc_get_curve_id_from_params() 2017-04-05 11:18:47 -06:00
Chris Conlon
e101dfa26e add wc_ecc_get_curve_id_from_params() 2017-04-04 14:49:46 -06:00
David Garske
2aa523e0ea Added API unit test for certificate validation failure using corrupted signature in cert. 2017-04-04 11:15:32 -07:00
Chris Conlon
61d82790e4 add ECC helpers to get size and id from curve name 2017-03-30 11:32:56 -06:00
Chris Conlon
efc2bb43d2 add wc_GetPkcs8TraditionalOffset() 2017-03-16 15:14:20 -06:00
David Garske
da5825b94d Normal math speed-up to not allocate on mp_int and defer until mp_grow. Added memory tracker support to ./tests/unit.test. Fix memory leak with curve cache enabled, by adding to wolfSSL_Cleanup. 2017-02-21 13:59:38 -08:00
Jacob Barthelmeh
6a6e61f1d8 wolfCrypt cleanup in test.c moved and add wolfSSL init to testsuite with single threaded 2017-02-08 18:52:16 -07:00
toddouska
ef38ab8fc5 Merge pull request #701 from JacobBarthelmeh/mutex
better compatibility with printing errors to a file
2017-02-08 11:12:17 -08:00
Jacob Barthelmeh
0f91542cf4 add peek error node function to make use of debug mutex 2017-02-03 11:52:36 -07:00
Jacob Barthelmeh
6732961e0d open test file in binary mode 2017-01-10 09:57:29 -07:00
Jacob Barthelmeh
dcb9ef6651 better compatibility with printing errors to a file 2017-01-06 14:29:16 -07:00
Jacob Barthelmeh
d3604f1061 run peek last error line test only when NO_OLD_TLS is not defined 2017-01-06 13:22:49 -07:00
John Safranek
dd737ca103 Merge pull request #618 from kojo1/openssl-ex
Openssl Extra
2017-01-03 12:40:51 -08:00
dgarske
11775acb86 Merge pull request #691 from JacobBarthelmeh/Windows
random port for MinGW with unit tests
2017-01-03 11:46:33 -08:00
Jacob Barthelmeh
5abfe9d1cf random port for MinGW with unit tests 2016-12-29 11:05:10 -07:00
Jacob Barthelmeh
6c90f097ca remove extra white space 2016-12-28 15:40:34 -07:00
Jacob Barthelmeh
f60cb08c29 macro and tests for get_passwd_cb functions 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
1326fe1b0d return values of DES set key and return block size for EVP block_size getter function 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
091fc10147 adjust read ahead, some sanity checks and rebase 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
aabe456592 sanity checks, remove some magic numbers, TLS read ahead 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
f7737fdc55 expand BIO compatibility 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
2b3438e11b pem x509 read from bio and bio set fd 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
64a3333870 adjust wolfSSL_set_options and test case 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
2daeecdb90 BIO s_socket and BN mod exp 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
e741a24089 add get last error and line function, fix ASN1 object redeclaration 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
1d0fc83d40 function to add X509 to cert chain 2016-12-28 14:45:29 -07:00
Takashi Kojo
280f5cb542 fix int long type mismatch 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
1704a8d683 expand compatibility layer with write bio function 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
781c7d0055 check for user RSA 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh
7e91838d4a memory management and add to compatibility layer 2016-12-28 14:45:29 -07:00