Commit Graph

142 Commits (3b73c6e3ae2fd6444d1b9ea17c46bd26a7286acf)

Author SHA1 Message Date
David Garske 5a46bdf6f6 Added unit test for using encrypted keys with TLS. Only works with `--enable-des3`, since the keys are all encrypted with DES3 (also requires either `--enable-opensslextra or --enable-enckeys`). 2018-04-09 13:28:15 -07:00
David Garske dbb34126f6 * Added support for not loading a private key for server or client when `HAVE_PK_CALLBACK` is defined and the private PK callback is set. Tested with all cipher suites, TLS 1.2/1.3, client/server certs, RSA/ECC/ED25519.
* Added PK callback context tests for client/server examples (`SetupPkCallbackContexts`).
* Added new test define for `TEST_PK_PRIVKEY` to allows simulating hardware based private key.
* Added new test.h function for loading PEM key file and converting to DER (`load_key_file`).
* Added way to get private key signature size (`GetPrivateKeySigSize`).
* Added new ECC API `wc_ecc_sig_size_calc` to return max signature size for a key size.
* Added inline comments to help track down handshake message types.
* Cleanup of RSS PSS terminating byte (0xbc) to use enum value.
* Fixed bug with PK callback for `myEccVerify` public key format.
* Fixed bug with PK callback for ED25519 verify key buffer in DoServerKeyExchange.
2018-03-21 11:27:08 -07:00
David Garske d5cc3ca198 Disable TLS v1.0 by default. Added new `--enable-tlsv10` option to force enable (only works if --enable-oldtls is set, which is on by default). 2017-11-14 14:01:31 -08:00
Sean Parkinson 323db1a95d Fix no ECC builds with TLS13 code.
Fix tests so that having ECC disabled works as well.
Fix define protection for Draft 18 and HRR Cookie.
2017-10-24 09:11:24 -07:00
toddouska 8a01d725da Merge pull request #1177 from dgarske/certreq_tests
Testing improvements for cert gen and TLS cert validation
2017-10-24 08:21:37 -07:00
David Garske 911b6f95f8 Release v3.12.2 (lib 14.0.0). Updated copywright. 2017-10-22 15:58:35 -07:00
David Garske 024c8725ad Testing improvements for cert gen and TLS cert validation:
* Fixes to support certificate generation (`WOLFSSL_CERT_GEN`) without RSA enabled.
* Added new ECC CA for 384-bit tests.
* Created new server cert chain (ECC CA for 256-bit that signs server-ecc.pem)
* Created new `./certs/ecc/genecc.sh` script for generating all ECC CA's, generated server cert req (CSR), signing with CA and the required CRL.
* Moved the wolfCrypt ECC CA / ECC cert gen test into `ecc_test` as `ecc_test_cert_gen`.
* Refactor duplicate code that saves DER to disk, converts DER to PEM and saves PEM to disk into SaveDerAndPem function.
* Changed `ecc_test_make_pub` and `ecc_test_key_gen` to use XMALLOC for temp buffers (uses heap instead of stack).
* Cleanup to combine all certificate subject information into global `certDefaultName`.
* Updated cert request info to use wolfSSL instead of Yassl.
* Cleanup to combine keyUsage into `certKeyUsage` and `certKeyUsage2`.
* Re-number error codes in rsa_test.
* Moved the certext_test after the ecc_test, since it uses a file generated in `ecc_test_cert_gen`.
2017-10-19 16:17:51 -07:00
David Garske 6021c37ec7 Refactor `WOLF_SSL_` to `WOLFSSL_` (much better). 2017-10-11 09:10:43 -07:00
David Garske 6707be2b0e Added new `--disable-oldnames` option to allow for using openssl along-side wolfssl headers (without OPENSSL_EXTRA). Add `--enable-opensslcoexist` which makes sure `oldnames` is disabled. Refactor of `SSL_` to `WOLF_SSL_`. Refactor of `SHA`, `MD5`, `SHA224`, `SHA256`, `SHA512` and `SHA384` to `WC_` naming. 2017-10-11 09:10:42 -07:00
David Garske c03487d463 Fix for dynamic type of ED25519 key and PK_CALLBACK buffer not being free’d. Fix for portNumber stack var being used out of scope. 2017-07-25 15:07:58 -07:00
David Garske 47cc3ffdbc Fix build with either `NO_WOLFSSL_SERVER` or `NO_WOLFSSL_CLIENT` defined. 2017-06-26 23:05:32 -07:00
Sean Parkinson 613d30bcae ED25519 TLS support 2017-06-08 09:26:49 +10:00
Sean Parkinson 2b1e9973ec Add TLS v1.3 as an option 2017-05-04 14:51:30 -07: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
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 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
Jacob Barthelmeh 6732961e0d open test file in binary mode 2017-01-10 09:57:29 -07:00
John Safranek b994244011 Revising the Extended Master Secret support. Removing the dynamic
TLSX support for the extention and treating it like the Signature
and Hash algorithms extension. It is to be enabled by default and
the user can turn it off at run time or build time.
2016-09-11 18:05:44 -07:00
John Safranek e0a035a063 DTLS-SCTP Tests
1. Added a check to configure for SCTP availablility.
2. Added DTLS-SCTP to the cipher suite test.
2016-08-29 15:24:51 -07:00
David Garske 5b3a72d482 Cleanup of stdlib function calls in the wolfSSL library to use our cross-platform "X*" style macros in types.h. 2016-06-29 11:11:25 -07:00
Jacob Barthelmeh 2feee8856e revise static memory and update heap hint 2016-06-04 19:03:48 -06:00
Jacob Barthelmeh e99a5b0483 prepare for release v3.9.0 2016-03-17 16:02:13 -06:00
Jacob Barthelmeh dcfec3d2fa check for RSA and ECC before testing RSA signed ECC cert 2016-02-23 17:03:52 -07:00
Jacob Barthelmeh 3e860107f3 remove extra cert and key, plus add new test 2016-02-11 13:49:07 -07:00
David Garske 4ea76b8ac8 Fixes for warnings found using MinGW. Fixes for WOLFSSL_SOCKET_IS_INVALID and WOLFSSL_SOCKET_INVALID to use the SOCKET_T. 2016-02-08 15:44:22 -08:00
toddouska 049a4c6460 fix C++ mode warnings 2015-08-17 16:47:39 -07:00
toddouska 46e7e9acf9 disable SSLv3 by default 2015-08-12 16:39:13 -07:00
kaleb-himes 303fb2bb62 Option for no PSK Id Hint and test cases
update comment file reference
2015-07-31 22:00:28 -06:00
Jacob Barthelmeh 14723b7e65 QSH (quantum-safe handshake) extension 2015-07-07 09:55:58 -06:00
toddouska 473a120ba2 remove more stale cyassl headers 2015-02-25 13:34:29 -08:00
kaleb-himes a389620a29 Copyright (C) updates 2015-01-08 09:39:04 -07:00
kaleb-himes 639637278d CYASSL -> WOLFSSL macros 2015-01-07 13:17:57 -07:00
kaleb-himes 369a5f04a9 library wide licence update 2015-01-06 12:14:15 -07:00
toddouska 6175a2a20c cleanup fp cache on examples with thread local storage 2014-09-09 10:14:32 -07:00
toddouska 2c595139db fix tirtos merge 2014-09-08 19:40:03 -07:00
toddouska 34f2e51415 remove extra spaces from ti cyassl proper files 2014-05-09 11:55:59 -07:00
Vikram Adiga f643ca5f48 Added TI-RTOS support for CyaSSL tests 2014-05-08 15:52:20 -07:00
Chris Conlon be65f5d518 update FSF address, wolfSSL copyright 2014-04-11 15:58:58 -06:00
toddouska 7b00374930 fix -Wmissing-variable-declarations 2014-03-02 11:06:41 -08:00
toddouska 9c5ee66c8c fix -Wunused-macros 2014-03-02 10:59:03 -08:00
John Safranek f1c2250652 fix static analysis warning, g++ compile warning 2014-02-07 14:52:44 -08:00
Moisés Guimarães 5f3ee80407 added:
- max fragment length extension;
 - CyaSSL_SNI_GetRequest() to get client's request at server side;
 - Automated tests for SNI;
2013-06-19 15:45:06 -03:00
toddouska f535e5428e make sure all tests/examples *.c use settings.h correctly 2013-04-10 12:17:23 -07:00
John Safranek 547872683f adjustments to the example tests for Windows 2013-03-27 10:22:50 -07:00
John Safranek 7d287a6ba9 modified test port number to allow concurrent testing 2013-03-26 22:00:39 -07:00
John Safranek 7279d3bf85 passed the -d and -N flags into the test executor 2013-03-25 08:41:44 -07:00
toddouska dbe83c7405 fix typos 2013-03-12 15:56:58 -07:00
toddouska 86f7d48c7e fix comment set but unused new gcc warning 2013-03-12 09:52:16 -07:00
toddouska 6773287895 add --enable-des3 and build, no strnstr in tests 2013-03-12 09:46:15 -07:00
toddouska 7914938e60 --enable-md5 and build, needs NO_OLD_TLS, suite test version check 2013-03-11 17:37:08 -07:00
toddouska 6b67d5e931 even cleaner output 2013-03-11 12:12:04 -07:00
toddouska ebf25c5c4b cleanup suite test output 2013-03-11 12:09:49 -07:00
toddouska d1277b1343 cleanup not supported suite test output to 1 warning 2013-03-11 12:02:22 -07:00
toddouska b24f7f502c consolidate suite tests into normal and dtls files 2013-03-11 11:46:28 -07:00
toddouska 3f4c570aa1 have suite tests self repeat non blocking 2013-03-11 11:07:46 -07:00
toddouska 7ce9315173 Merge branch 'master' of github.com:cyassl/cyassl 2013-03-11 11:00:47 -07:00
toddouska 47e7e27bb2 add cipher suite check to suite tests to make adding test cases easier 2013-03-11 10:59:08 -07:00
John Safranek 20e4889092 Merge branch 'dtls'
Conflicts:
	src/ssl.c
2013-03-08 17:45:35 -08:00
John Safranek 73f0395ca9 added psk-dtls test cases 2013-03-08 17:35:03 -08:00
John Safranek e1a73c1769 added more dtls test cases 2013-03-08 17:19:04 -08:00
John Safranek 43ed4a7424 added test cases and fixed a bug with AEAD ciphers with DTLSv1.2. 2013-03-07 22:52:51 -08:00
toddouska 85b3346bbf NO_RSA build, cipher suite tests need work for this build optoin, ssn2 2013-03-07 17:44:40 -08:00
John Safranek 01e9a246cd added build test cases for ECC-SHA384 test suites. 2013-03-04 17:14:19 -08:00
toddouska a8f6baf37c repeat each cipher suite test with client cert request off 2013-02-18 14:12:03 -08:00
toddouska 62ef5de25c scan build fixes 2013-02-14 14:09:41 -08:00
toddouska 44e0d7543c change copyright name with name change 2013-02-05 12:44:17 -08:00
toddouska f4f13371f9 update copyright date 2013-02-04 14:51:41 -08:00
John Safranek 6616975f81 added AES-CCM-8 ECC cipher suites, and more test cases 2013-01-21 15:19:45 -08:00
John Safranek a453ccba57 Added TLS support for Camellia 2013-01-21 10:53:42 -08:00
John Safranek ccff37f4b1 added TLS support for AES-CCM-8 2013-01-15 15:20:30 -08:00
John Safranek f8f7f69f48 compile option to leave out MD5 and SSL code 2012-11-26 18:40:43 -08:00
toddouska d732a2ef07 make suite test file name input arg longer 2012-10-31 15:25:39 -07:00
John Safranek 174618ebfb added build option for leanPSK 2012-10-29 15:39:42 -07:00
toddouska aef97af361 make rabbit optional with configure option 2012-10-22 17:28:46 -07:00
John Safranek a92b639155 add optional null cipher support for RSA 2012-10-19 20:52:22 -07:00
John Safranek 346a52a58c add optional null cipher support for PSK 2012-10-19 10:37:21 -07:00
toddouska 4e19c234f4 fix new warnings on linux64 2012-09-21 13:29:04 -07:00
toddouska 7716da0881 warn fix 2012-09-20 15:39:15 -07:00
Brian Aker 5fce4edb68 This adds more compiler hardening flags (and fixes all of the issues
found in the process).
2012-09-19 23:38:41 -07:00
toddouska 73349ec0d3 add DTLS basic cipher suite tests 2012-08-08 17:09:09 -07:00
toddouska 16ac91e6de add aesgcm ecc cipher suite tests 2012-08-08 15:57:18 -07:00
toddouska 17a92e76d3 add aesgcm openssl, and fix requires to use our local enum for aesgcm 2012-08-08 15:37:00 -07:00
toddouska 6defed64cd add basic aescgm cipher suite tests 2012-08-08 15:22:41 -07:00
toddouska 169331cf81 add ecc dhe cipher suite tests, static next 2012-08-07 18:09:03 -07:00
toddouska c4674c0cc3 add ntru cipher suite tests 2012-08-07 17:18:56 -07:00
toddouska a7aaf4fcaf add psk cipher suite tests 2012-08-07 17:01:59 -07:00
toddouska 8bfd6c0e7e add hc128 cipher suite tests 2012-08-07 16:53:50 -07:00
toddouska efb6932d8e add client test harness parsing, may use different certs/keys/CAs etc 2012-08-07 15:06:53 -07:00
toddouska 706bd8a910 add cipher suite client/server driver 2012-08-06 17:14:31 -07:00
John Safranek b83e1765da adding scriptable suite test to the unit test 2012-08-03 23:19:24 -07:00
toddouska 8d514b23b6 unit tests file layout 2011-12-14 09:09:12 -08:00