541 Commits

Author SHA1 Message Date
toddouska
d7ecdf110e
Merge pull request #2013 from dgarske/tls_bench
Enhancements to the TLS benchmark tool
2019-01-16 10:30:55 -08:00
Jacob Barthelmeh
6ac384793f memory management with OCSP requests 2019-01-14 09:49:50 -07:00
David Garske
a4a6895900 Fix for scan-build "Value stored to 'err' is never read`" 2019-01-11 09:42:41 -08:00
David Garske
6eea924a5c Fix for non-blocking read timeout. 2019-01-11 08:45:34 -08:00
David Garske
3f46250994 Fix to timeout after 10 seconds in non-blocking mode if connect does not complete. 2019-01-10 17:12:37 -08:00
David Garske
003360237f Fixes for building with NO_WOLFSSL_SERVER. Minor test.h cleanups. 2019-01-07 10:08:16 -08:00
David Garske
f3c08ae8b9 Better fixes for ret unused. 2019-01-03 12:42:31 -08:00
David Garske
ff0a4eb69a Fix for float compare warning. Minor cleanups. 2019-01-03 11:40:04 -08:00
David Garske
a7251e4158 Fixes for minor Jenkins build warnings. 2019-01-03 11:22:01 -08:00
David Garske
ef916f2c55 Enhancements to the TLS benchmark tool:
* Added support for running as only Client (`-c`) or Server (`-s`).
* Added support for using sockets (in addition to in memory mode `-m`).
* Fixed support for 16KB test packet (memory version needed TLS header space). Changed to default to 16KB.
* Fixed so transfer is done on each connection and there is not transfer limit (instead "shutdown" message is used).
* Made pthread support optional and based on HAVE_PTHREAD.
* Tested non-blocking support with sockets or shared memory.

To use with localhost sockets and threading use `./examples/benchmark/tls_bench`
To use with threading and in-memory use `./examples/benchmark/tls_bench -m`
To use as separate server client applications with localhost sockets use: `./examples/benchmark/tls_bench -s` and `./examples/benchmark/tls_bench -c` in separate terminals.

```
./examples/benchmark/tls_bench -?
tls_bench 3.15.7 NOTE: All files relative to wolfSSL home dir
-?          Help, print this usage
-c          Run as client only, no threading and uses sockets
-s          Run as server only, no threading and uses sockets
-h          Host (default localhost)
-P          Port (default 11112)
-e          List Every cipher suite available
-i          Show peer info
-l <str>    Cipher suite list (: delimited)
-t <num>    Time <num> (seconds) to run each test (default 1)
-p <num>    The packet size <num> in bytes [1-16kB] (default 16384)
-v          Show verbose output
-d          Enable debug messages
-T <num>    Number of threaded server/client pairs (default 1)
-m          Use local memory, not socket
```
2019-01-03 10:57:39 -08:00
David Garske
2351047409 Fixes for various scan-build reports. 2018-12-27 11:08:30 -08:00
David Garske
00dd222aa5 Fix for example client with -X external tests to not disable for PSK build unless usePsk is set. Resolves issue with external tests being skipped if building with PSK enabled. 2018-12-21 08:21:59 -08:00
Jacob Barthelmeh
48c267dda8 fix warning with secure-renegotiation build and error with ntru build 2018-12-19 15:47:43 -07:00
John Safranek
b145aab6b2 Server Side Renegotiation
1. Fix testing issue with a client using the SCSV cipher suite to indicate desire for renegotiation.
2. Add indication to both the server and client examples that the renegotiation was successful.
2018-12-05 13:08:24 -08:00
John Safranek
0abf7c4997 Server Side Secure Renegotiation
1. Add the server side renegotiation flag to the secure renegotiation option.
2. Changed the AddEmptyNegotiationInfo so it doesn't create an extension, just adds a reply if SCR is enabled.
3. Fix the server's reaction to the client sending the SCR extension.
2018-12-05 13:08:24 -08:00
John Safranek
d168d60ade Server Side Secure Renegotiation
1. Add enables to the example server for turning on secure renegotiation.
2. Add encryption assists to the handhshake message handler functions.
3. Add a hello request message function. Includes handshake timing pre/postambles.
2018-12-05 13:08:24 -08:00
John Safranek
a55f11cdd8 DHE Speed Up
1. Also apply the setting to the client side.
2. Updated the server and client command line options to use "-2" for disabling the DHE check.
2018-12-03 13:56:14 -08:00
John Safranek
564a1ee499 Make the skip DH test flag build-conditional. 2018-11-30 09:19:11 -08:00
John Safranek
ff1a1dc5d5 DHE Speed Up
When loading DH domain parameters into a CTX, test the prime
immediately. When loading them into a session, test the prime right
before using it during the handshake. Sessions that get their prime from
their context do not need to test their prime. Added a function to
disable testing the prime in a session. The goal is to speed up testing
as every single test case loads DH parameters whether they are used or
not.
2018-11-29 17:04:04 -08:00
Takashi Kojo
a203cd4901 NO_MULTIBYTE to NO_MULTIBYTE_PRINT 2018-11-29 07:04:01 +09:00
Takashi Kojo
0e94ae529c Rollback stacing 2018-11-29 06:52:43 +09:00
Takashi Kojo
c529e011a7 NO_MULTIBYTE for multibyte non-supported IDEs 2018-11-26 08:11:31 +09:00
Sean Parkinson
95bd340de5 Add support for more OpenSSL APIs
Add support for PEM_read and PEM_write
Add OpenSSL PKCS#7 signed data support
Add OpenSSL PKCS#8 Private key APIs
Add X509_REQ OpenSSL APIs
2018-11-20 07:54:24 +10:00
David Garske
d5dddd2b29 Fix for unused useSupCurve in example client with --disable-ecc. 2018-11-08 15:43:18 -08:00
Jacob Barthelmeh
2468a19c82 static analysis fix on non default build and g++ warning 2018-11-07 14:50:07 -07:00
kaleb-himes
bc2bb78010 Fix -x option in server to continue in event of error (R) 2018-11-06 14:09:46 -07:00
David Garske
86758f9640 Fixes for key size detection when using PK callbacks (HSM) and no private key has been loaded (affects HAVE_PK_CALLBACKS on server side only when no dummy private key is loaded). Fix for possible leak during ECC min key size failure with small stack. Added new API wc_RsaPublicKeyDecode_ex for parsing an RSA public key for the modulus and exponent. Changed wolfSSL_CTX_SetTmpEC_DHE_Sz to support a size == 0 for using the long-term private key's size. Changed ECDHE_SIZE so it can be overridden and build-time. Added tests for wolfSSL_CTX_SetTmpEC_DHE_Sz and wolfSSL_SetTmpEC_DHE_Sz. 2018-10-25 09:15:23 -07:00
toddouska
0eb115e7a1
Merge pull request #1884 from kaleb-himes/ECC_DISABLED_TEST_FIX
Fixes to resolve skipped tests with ECC disabled
2018-10-24 09:30:47 -07:00
Sean Parkinson
7586e1df42 Only do early data in initial handshake when using PSK 2018-10-24 09:47:30 +10:00
Hideki Miyazaki
6953677a8f Keep the max line length to 80 2018-10-20 17:15:17 +09:00
Hideki Miyazaki
a27b4c2efb Added Japanese message into the examples client and server 2018-10-20 13:40:01 +09:00
David Garske
4a4ae446aa Fix for unit.test fails with -H verifyFail. 2018-10-18 11:58:00 -07:00
David Garske
d7d102d90a Added cipher suite unit tests for max fragment options 1-6 for TLS v1.2 and DTLS v1.2. Fix for client usage comment for max fragment. 2018-10-16 16:47:24 -07:00
David Garske
4adaeb8585 Added new 256-byte max fragment option WOLFSSL_MFL_2_8. 2018-10-15 17:06:21 -07:00
David Garske
0293686990 Added example client/server support for loading certificate and private key into WOLFSSL object using -H loadSSL. Added load_ssl_buffer function to load buffers into WOLFSSL objects. Changed wolfSSL_get_SSL_CTX API to always be exposed. Added TEST_LOAD_BUFFER build option to use the load_buffer and load_ssl_buffer calls for example client/server. 2018-10-09 12:54:41 -07:00
David Garske
bbdb17975c Adds build option WOLFSSL_EITHER_SIDE for deferring the "side" of the TLS session until first connect or accept. Added the DTLS generic v1.0 and v1.2 methods for "either" side. Added "either" methods unit tests. Added "either" -v e support to example client/server. Fix to expose wolfSSL_use_certificate_file and wolfSSL_use_PrivateKey_file without OPENSSL_EXTRA. Cleanup of the methods for (void)heap and log messages. Spelling fixes. 2018-10-04 15:47:50 -07:00
David Garske
24f9f12844 Fix for the curve logic to pick the hightest strength, not just the default 256-bit. Added test for setting user curve. ./examples -H useSupCurve. 2018-09-21 09:27:48 -07:00
kaleb-himes
4f6ee556dc Refactor the cert renewal scripts with error handling
Portability updates
2018-09-19 14:47:21 -06:00
Chris Conlon
085daa78cd
Merge pull request #1833 from dgarske/norng_fixes
Fixes for building without RNG enabled
2018-09-18 14:52:21 -06:00
David Garske
77cd361bca Fixes for building with WC_NO_RNG. 2018-09-13 13:23:55 -07:00
John Safranek
b330c6e035
Merge pull request #1801 from kaleb-himes/OCSP-GLOBALSIGN-FIXr2
Address issues when testing with WOLFSSL_OCSP_TEST set
2018-09-12 11:36:41 -07:00
kaleb-himes
3729b12fae Address issues when testing with WOLFSSL_OCSP_TEST set 2018-08-30 14:44:49 -06:00
David Garske
3d0d10345a Added test cases for ensuring forced error fails on client and server. Added test cases to ensure bad certificate can be overriden. 2018-08-30 11:17:21 -07:00
Sean Parkinson
487c60df78 Fixes to work when compiled with TLS 1.3 only
TLS 1.3 Early Data can be used with PSK and not session tickets.
If only TLS 1.3 and no session tickets then no resumption.
External sites don't support TLS 1.3 yet.
2018-08-28 15:37:15 +10:00
John Safranek
4eb0d32fa8 Patches
1. Define Timeval in callbacks.h if the file sys/time.h is missing.
2. When picking the correct strtok() function, take into account MINGW64.
3. In the example server, changed the call to SSL_accept_ex() as it doesn't exist. Using wolfSSL_accept_ex(). Only a problem when setting WOLFSSL_CALLBACKS.
4. PickHashSigAlgo() is missing a ; when WOLFSSL_CALLBACKS is set.
2018-08-24 11:46:02 -07:00
Sean Parkinson
506c858ed6 Add memory usage tracking and logging
Add WOLFSSL_MEMORY_TRACKING to report allocations and frees with the
type.
Fix places where memory can be freed earlier.
2018-08-21 08:54:57 +10:00
toddouska
0f539616be
Merge pull request #1766 from JacobBarthelmeh/UnitTests
cleanup with test cases and access to FP_MAX_BITS
2018-08-20 09:19:14 -07:00
toddouska
555714afa3
Merge pull request #1764 from SparkiDev/tls13_psk_cb
Separate PSK callback for TLS 1.3
2018-08-20 09:17:01 -07:00
Jacob Barthelmeh
ed9aaa93f4 include tfm in example client for veiwing FP_MAX_BITS 2018-08-17 11:06:40 -06:00
Sean Parkinson
f1222c3f9f Separate PSK callback for TLS 1.3
It is highly recommended that the PSK be different for each protocol.
Example callback already returns a different key for TLS 1.3.
New callback includes the ciphersuite, as a string, to use with the key.
2018-08-17 10:18:28 +10:00