Commit Graph

556 Commits (devin/1739556249-pem-hash-algorithm)

Author SHA1 Message Date
David Garske 4e637ddf10 Cleanup on example client/server messages and sizes. Original PR #3023 caused sending extra null characters in normal (non HTTP) example cases. 2020-07-21 13:34:25 -07:00
David Garske 1b051d9c5b TLS v1.3 sniffer support:
* Added TLS v1.3 sniffer support using static ephemeral key.
* Add support for using a static ephemeral DH and ECC keys with TLS v1.3 using `WOLFSSL_STATIC_EPHEMERAL`.
* Adds new API's `wolfSSL_CTX_set_ephemeral_key` and `wolfSSL_set_ephemeral_key`.
* Expanded TLS extension support in sniffer.
* Refactor of the handshake hashing code.
* Added parameter checking to the TLS v1.3 key derivations (protects use of "DoTls13Finished" if handshake resources have been free'd).
* Added support for loading DH keys via `wc_DhImportKeyPair` and `wc_DhExportKeyPair`, enabled with `WOLFSSL_DH_EXTRA`.
* Added sniffer documentation `sslSniffer/README.md`.
2020-07-17 15:22:35 -07:00
toddouska fbe0c8cba7
Merge pull request #3122 from JacobBarthelmeh/Compatibility-Layer
fix X509 multiple OU's and refactor
2020-07-15 15:06:22 -07:00
toddouska 925e9d9213
Merge pull request #3075 from julek-wolfssl/dtls-no-cookie
DTLS session resumption fixes
2020-07-15 14:07:34 -07:00
Jacob Barthelmeh 173b9833fc fixes for edge build cases and static memory 2020-07-14 09:07:23 -06:00
JacobBarthelmeh 26f0a74d29
Merge pull request #3023 from kaleb-himes/GH2998-REWORK
cleanup GET messages
2020-06-25 10:22:09 -06:00
David Garske 667d9ca896 Fix to catch the issue in this PR with alt cert chains, which only happens if the verify callback is used and the chain is long enough. Cleanup of the myVerify callback to allow specific actions. Fix the suites.c to not crash if no newline at end of file. Added helpful debug message to show that a CA was found. 2020-06-18 09:26:50 -07:00
Juliusz Sosinowicz 03c5359fcd Add session resumption testing for DTLS 2020-06-18 14:18:02 +02:00
Juliusz Sosinowicz 7b604ad714 WIP 2020-06-12 11:36:43 +02:00
David Garske fb5c9e5268 Adjust static memory case with TLS v1.3 enabled. 2020-06-05 11:11:23 -07:00
David Garske dffc677561 Fix for TLS v1.3 with `--enable-sniffer`. 2020-06-04 16:42:40 -07:00
David Garske 1d01b87741 Fix to detect if `NO_CERTS` / `--disable-asn` is used in `scripts/tls13.test`. 2020-06-04 16:08:08 -07:00
David Garske 3b63e55a68 Fix for TLS v1.3 PSK tests work with additional cipher suites (not just `TLS13-AES128-GCM-SHA256`) and the echo server/client. 2020-06-04 15:31:18 -07:00
kaleb-himes 923fc30043 Change to memcpy 2020-06-03 17:36:40 -06:00
kaleb-himes 8c3f7a77ca cleanup GET messages 2020-06-03 16:53:36 -06:00
toddouska cf8459e518
Merge pull request #2892 from SparkiDev/cppcheck_fixes_4
Fixes from cppcheck
2020-04-09 16:01:11 -07:00
Sean Parkinson 411aee6e05 Fixes from cppcheck
Added PRIVATE_D version of rsa private key operation for SP
implementation for specific platforms.
WC_NO_RNG results in warnings when RNG calls don't do anything.
Added ifdef checks for variables not used otherwise.
Remove superfluous if statements like when checking ret == 0.
Change names of globals that are generic and are used locally before
global definition.
Remove definition of variable len that isn't used except as a
replacement for sz which is parameter.
Don't subtract two variables when one has just been assigned the value
of the other.
Fix shifting of signed value.
Fix parameter checking in aes.c and des3.c for platform specific code.
2020-04-08 09:46:22 +10:00
toddouska 65cf5a0d46
Merge pull request #2802 from embhorn/zd9764
Fix for bidirectional shutdown
2020-04-07 13:03:54 -07:00
Eric Blankenhorn 3f7ce61dbd Updates from review 2020-04-01 11:14:25 -05:00
Sean Parkinson 8cccb9008b Change to work for other TLS versions
Send alert when client doesn't send a certificate on request.
2020-03-02 08:50:57 +10:00
Sean Parkinson 6334dd9cb0 Allow mutual authentication to be required for TLS 1.3 2020-03-02 08:50:57 +10:00
Sean Parkinson 2c6eb7cb39 Add Curve448, X448, Ed448 implementations 2020-02-28 09:30:45 +10:00
Eric Blankenhorn 41d3ba0efa Tests and examples for bidirectional shutdown 2020-02-17 16:47:47 -06:00
toddouska b038e2e8f0
Merge pull request #2771 from JacobBarthelmeh/Windows
change public Timeval to WOLFSSL_TIMEVAL
2020-02-13 09:38:42 -08:00
Jacob Barthelmeh 3c077a3cef add NO_OLD_TIMEVAL_NAME macro for backwards compatibility 2020-02-07 11:56:30 -07:00
Sean Parkinson 55ea2facdd Changes to clear issues raised by cppcheck 2020-01-30 14:24:32 +10:00
Jacob Barthelmeh a9e9120fa0 change public Timeval to WOLFSSL_TIMEVAL 2020-01-28 17:11:46 -07:00
Takashi Kojo 37cad6e9ba %zu, pragma: not supported, 2020-01-22 08:12:51 +09:00
Chris Conlon 45c5a2d39c update copyright to 2020 2020-01-03 15:06:03 -08:00
toddouska deac82c8ed
Merge pull request #2683 from dgarske/various_items
Various cleanups and fixes
2019-12-27 13:53:39 -08:00
Eric Blankenhorn b83804cb9d Correct misspellings and typos from codespell tool 2019-12-24 12:29:33 -06:00
David Garske 22f0b145d3 Various cleanups and fixes:
* Fix for key gen macro name in benchmark.c
* Fix for possible RSA fall-through warning.
* Fix for building `WOLFSSL_STM32_PKA` without `HAVE_ECC`.
* Added option to build RSA keygen without the DER to PEM using `WOLFSSL_NO_DER_TO_PEM`.
* Added options.h includes for test.c and benchmark.c.
* Added printf warning on the math size mismatch in test.c.
* Added support for benchmarking larger sizes.
* TLS benchmarks for HiFive unleashed.
2019-12-18 07:09:26 -08:00
kaleb-himes 5ce88b5086 seperate sanity checks on size and rnd allocation 2019-11-07 13:12:17 -07:00
kaleb-himes ad192786b1 Remove double assignment to pt caught by scan-build test 2019-11-07 11:35:36 -07:00
kaleb-himes e24059691c Address logical fallacies and syntax issues in example server, addresses GH issue #2559 2019-11-07 10:30:12 -07:00
David Garske 9d05e9c0b7 Fixes for minor nightly build tests. 2019-09-25 11:07:32 -07:00
David Garske b7c08988dc Fix for verify callback override of intermediate CA provided by peer not being added to trusted CA list.
Feature: Added support for testing date override at build-time using `TEST_BEFORE_DATE`.

```
./examples/server/server -H overrideDateErr -A ./certs/ca-cert.pem -k ./certs/server-key.pem -c ./certs/intermediate/server-chain.pem &
./examples/client/client -D -A ./certs/ca-cert.pem -k ./certs/client-key.pem -c ./certs/intermediate/client-chain.pem
```
2019-09-16 14:47:55 -07:00
Sean Parkinson 24e98dd05e Add support for Encrypt-Then-MAC to TLS 1.2 and below
An extension is used to indicate that ETM is to be used.
Only used when doing block ciphers - HMAC performed on encrypted data.
2019-08-29 09:00:30 +10:00
David Garske b4673344c0 Adds new `wc_ecc_get_curve_params` API for getting the `ecc_set_type` params for a curve index. Fix for example client and server using wrong macro for detecting ECC 256-bit enabled. 2019-08-02 05:50:00 -07:00
Sean Parkinson 373bbf6660 Changes to server example for fuzz testing 2019-07-01 13:35:33 +10:00
David Garske 364bf50a94 Fixed example server to not try and write on failure. 2019-04-11 11:30:41 -07:00
John Safranek fbfd7a4dea Release Fixes
1. Rearrange the deprecation cryptodev option so it doesn't overwrite the cryptocb option, and so it doesn't break its case in the build-test.
2. Fix the content length in the sample HTTP used by the example server.
3. Disable OCSP stapling in the example server if RSA is disabled.
4. Fix a variable in asn.c that was declared in the middle of its scope.
5. Retag the xmalloc, xrealloc, xfree functions used in the memory test as WOLFSSL_API like all the other allocators, instead of extern.
2019-03-20 11:01:24 -07:00
John Safranek 246c444b93 Updates for v4.0.0
Update the copyright dates on all the source files to the current year.
2019-03-15 10:37:36 -07:00
John Safranek 27ea9d9bce Configure Fixes
1. The combination enable-all and disable-rsa breaks some of the
testing. Added the NO_RSA guards as appropriate.
2. Disabled the OCSP stapling and CRL tests when RSA is disabled as they
use test certificates with RSA keys.
2019-03-13 17:54:33 -07:00
John Safranek 201c85478e Move the -5 option text into the localization array and add a Japanese translation. 2019-03-11 12:42:13 -07:00
John Safranek a1ed8e7a67 Fix a fall-through bug in the server options parsing around a new
option.
2019-03-11 12:36:58 -07:00
John Safranek b7663a940e Trusted CA Key Indication Extension
Added an API for enabling the Trusted CA Key Indication extension from
RFC6066 section 6. If the server doesn't have a match for the client,
the client will abandon the session.
2019-03-11 12:35:12 -07:00
David Garske 0e962aa6e5
Merge pull request #2130 from jrblixt/feature-WICED6_1-serverChange
examples server HTTP update needed for WICED HTTP parser.
2019-03-06 16:46:36 -08:00
Chris Conlon d699b65a25
Merge pull request #2026 from kojo1/mdk-CMSISv2
MDK CMSIS RTOSv2
2019-03-06 09:36:49 -07:00
jrblixt 222f9f4f47 Adjust count. 2019-03-01 20:04:20 -07:00
jrblixt 5f332fa29e review changes. 2019-03-01 14:06:27 -07:00
Sean Parkinson 8bb4e23f8d Various improvements for testing
Fix wc_ecc_fp_free() to be called when using HAVE_STACK_SIZE.
Increase size of replyin client.c so all HTTP reply is displayed.
Fix api.c to support only Ed25519 (not RSA and ECC)
Fix suites.c to detect when CA for client won't work (Ed25519 only)
For Static Memory add debugging and small profile.
Also allow realloc to be called with NULL.
Add more Ed25519 certs and keys.
Fix names of Ed25519 filenames for client and server.
Do NOT turn on ECC_SHAMIR by default with lowresource.
Enable WOLFSSL_STATIC_MEMORY_SMALL if low resource and no RSA.
2019-02-22 17:14:19 +10:00
Hideki Miyazaki b68eab6450 fixed to take additioanl option for -? 2019-02-21 13:44:08 +09:00
jrblixt 6c3ed46542 examples server HTTP update. 2019-02-15 15:45:30 -07:00
Takashi Kojo f8ff68ca7a Merge branch 'master' of https://github.com/wolfssl/wolfssl 2019-02-03 16:19:59 +09:00
John Safranek cc3c2ef683 DTLS Nonblocking Updates
Add command line option to the example server to fake a write block on a
specified DTLS sequence number in epoch 0.
2019-01-18 09:15:11 -08:00
John Safranek 8356c3d7e2 DTLS Nonblocking Updates
1. Add a second select for tx.
2. Revised tcp_select to work for either rx or tx.
3. Updated client and server to use new tcp_select_tx() for checking the
tx socket if the nonblocking connect/accept would block on transmit.
2019-01-18 09:15:11 -08:00
Jacob Barthelmeh 6ac384793f memory management with OCSP requests 2019-01-14 09:49:50 -07:00
Takashi Kojo cca27f6724 examples/celient.c, server.c: removing unused headers 2019-01-12 07:29:19 +09:00
David Garske 2351047409 Fixes for various scan-build reports. 2018-12-27 11:08:30 -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
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
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 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
kaleb-himes 4f6ee556dc Refactor the cert renewal scripts with error handling
Portability updates
2018-09-19 14:47:21 -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
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 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
David Garske 4eff7b641b First pass at bugs found with `./scripts/memtest.sh`. Fixes for NULL pointer checks, making sure free'd pointers are reset, making sure pointers are initialized and making sure memory is always free'd. Fix for TicketInit() which was using non-thread safe RNG and key_ctx. Fix for possible double free case in `wolfSSL_PEM_read_X509_CRL`. 2018-07-30 13:53:54 -07:00
David Garske 2c3475c1d6 Added new build option `--enable-memtest` or `WOLFSSL_FORCE_MALLOC_FAIL_TEST` which enables random malloc failures for testing. This test supresses the `abort()` calls to detect seg faults. A new script `./scripts/memtest.sh` starts the test. If an issue is found it can be reviewed with the `./scripts/memtest.txt` log and reproduced using the seed printed at top of unit test as `--- RNG MALLOC FAIL AT 295---` and rerun using `./tests/unit.test 295`. 2018-07-30 13:53:35 -07:00
Sean Parkinson 6d3e145571 Changes to build with X25519 and Ed25519 only
Allows configurations without RSA, DH and ECC but with Curve25519
algorithms to work with SSL/TLS using X25519 key exchange and Ed25519
certificates.
Fix Ed25519 code to call wc_Sha512Free().
Add certificates to test.h and fix examples to use them.
2018-07-23 10:20:18 +10:00
John Safranek e6c7952f50 Merge master into fipsv2. Resolved a conflict in api.c. 2018-06-22 09:52:26 -07:00
Sean Parkinson a03c15e598 Allow NO_WOLFSSL_CLIENT/SERVER to compile and pass tests 2018-06-13 11:42:16 +10:00
John Safranek 5e516cc2e0 Merge branch 'master' into fipsv2 2018-06-12 10:10:50 -07:00
Sean Parkinson b7caab938e Fix post authentication for TLS 1.3 2018-06-12 09:49:23 +10:00
John Safranek a6dd93aa2e Removed replaced the last two references to "CYASSL" macros with "WOLFSSL" in the example server. 2018-06-06 13:14:06 -07:00
John Safranek 7e9a32fffd FIPS Revalidation
Merge branch 'master' into fipsv2. Using a merge instead of a rebase to retain commit IDs and tags.
2018-06-06 12:43:15 -07:00
Sean Parkinson ba8e441e53 Allow TLS 1.2 to be compiled out. 2018-05-25 11:00:00 +10:00
toddouska 453daee965
Merge pull request #1523 from SparkiDev/ed25519_key
Allow Ed25519 private-only keys to work in TLS
2018-05-24 09:56:17 -07:00
John Safranek 0315b378f5 Fix TCP with Timeout
Updated example client and server to use the new wolfSSL_dtls_set_using_nonblock() function.
2018-05-23 16:07:45 -07:00
Sean Parkinson 58f523beba Allow Ed25519 private-only keys to work in TLS
Change Ed25519 in TLS 1.2 to keep a copy of all the messages for
certificate verification - interop with OpenSSL.
2018-05-24 08:43:28 +10:00
John Safranek 3685b7b176 Test Fixes
1. AesGcmEncrypt_ex requires the RNG, remove function if RNG disabled.
2. Fix a couple function name changes in the example server.
3. Removed the old FIPS wrapping added to dh.h, was redundant.
4. Move include of random.h in the aes.h file.
5. Fix where ecc.c was being left out of old FIPS builds.
6. Exclude the AES-GCM internal IV test case when building without the RNG.
7. Fix api test where AES-GCM Encrypt was called with a too-long IV in old FIPS mode. Non-FIPS and new FIPS are allowed longer IVs.
2018-05-16 15:47:12 -04:00
John Safranek f6fe3744a7 FIPS Update
1. Moved the rest of the FIPS algorithms to FIPSv2.
2. Updated the fips-check and autogen scripts.
3. Updated the automake include for the crypto files.
4. Updated the example server to use the wolfSSL API and wolfSSL-based OpenSSL compatibility layer.
5. Added error code for the SHA-3 KAT.
6. Updated an test case in the API test for AES-GCM encrypt that is now considered a success case, but the FIPS mode was still treating as a failure.
2018-05-16 15:47:12 -04:00
David Garske 3fd47bdff3 Fix for example client/server with `-H exitWithRet` option to make sure all cleanup is performed. Resolves valgrind report due to `TicketCleanup()` not being called. 2018-05-03 13:39:37 -07:00
David Garske 325402cf5a Minor fix for the expected failure case use of `ssl` after free. Renamed `skipExit` to `exitWithRet`. 2018-05-03 10:02:59 -07:00
David Garske 89a4c98670 * Added support for expected fail test cases with example client/server and suites unit test.
* Added test for certificate with bad alt name containing a null character mid byte stream.
* Fix for issue with suites unit test where last arg in file doesn't conain data for a param, causing it to skip test.
* Fix for last test in tests/test.conf not being run for `TLSv1.2 RSA 3072-bit DH 3072-bit`.
* Moved the `tls-cert-fail.test` tests into the new expected failure suite test (`./tests/test-fails.conf`). Now it explicilty checks RSA and ECC for the no signer and no sig tests.
2018-05-03 09:40:51 -07:00
toddouska 5c61810d4d
Merge pull request #1497 from SparkiDev/tls13_draft28
Tls13 draft28
2018-04-25 10:17:37 -07:00
thivyaashok 7d425a5ce6 Added support for an anonymous cipher suite (#1267)
* Added support for cipher suite TLS_DH_anon_WITH_AES256_GCM_SHA384
* Added test cases for verification of anonymous cipher suite
2018-04-20 10:35:37 -07:00
Sean Parkinson 94157634e1 TLS 1.3 fixes/improvements
Support Draft 28: able to compile code to return BAD_BINDER if no PSKs
match and certificates not to be used.
Change key share implementation to use server preference - server now
checks each client key share's group is in supported_groups extension.
Client and server examples modified to support server preference.
Application can set client's and server's supported groups by rank.
Server's supported groups is sent back in encrypted_extensions if
preferred group is not in client's list - able to be turned off at
compile time.
Application can query server's preferred group from client.
Able to compile using 0x0304 as version instead of draft version.
Fix state machine in TLS 1.3 to support unexpected hello_retry_request.
Also fixes non-blocking.
Fix resumption to use the named group from session.
Fix named group in session structure to be a 2-byte field.
Better detection of errors in message flow.
Fix DoTls13ClientHello when downgrading - don't do TLS 1.3 things.
Not downgrading on client fixed.
Downgrade protocol version from TLS 1.3 when not TLS 1.3 ciphersuite.
Get downgrading from TLS 1.3 and resumption working.
Change earlyData value to an enum.
Support no extensions data (as opposed to zero length extension data) in
TLS 1.3 ClientHello.
Check PSK cipher suite is available to both client and server before
using.
Check first PSK identity chosen when server says it is using early data
at client.
Check PSK extension is last in client_hello on server.
Check the PSK cipher suite to use is supported on client.
Check the returned cipher suite for pre-shared keys is the same as
client expects.
Send alert decrypt_error when verification fails in certificate_verify
or finished message doesn't match calculated value.
Fail when certificate messages recieved in handshake when using PSK.
Validate on the server that EndOfEarlyData message has been recieved
before finished message when server sent EarlyData extension.
2018-04-20 09:44:02 +10:00
Sean Parkinson 9600266483 WOLFSSL_FUNC_TIME changes
Warning in code about using this define.
Remove usage of WOLFSSL_FUNC_TIME from server.c.
2018-04-13 12:13:31 +10:00
Sean Parkinson 0b47811c46 Changes for interop and performance
Changes made to test.h to allow interop of PSK with OpenSSL.
Changes to allow server to pre-generate key share and perform other
operations at later time.
Fix ChaCha20 code header to have bigger state to support assembly code
for AVX1.
Fix Curve25519 code to use define instead.
Change Curve25519 to memset all object data on init.
Change Poly1305 to put both sizes into one buffer to avoid a second call
to wc_Poly1305Update().
Added WOLFSSL_START and WOLFSSL_END API and calls to show time of
protocol message function enter and leave to analyse performance
differences.
Moved Curve25519 code in KeyShare extension out of general ECC code.
2018-04-13 12:01:20 +10:00
David Garske 6de8348918 Fixes for various build configurations. Added `--enable-enckeys` option to enable support for encrypted PEM private keys using password callback without having to use opensslextra. Moved ASN `CryptKey` function to wc_encrypt.c as `wc_CryptKey`. Fixup some missing heap args on XMALLOC/XFREE in asn.c. 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 fa73f7bc55 Fix for handling OCSP with non-blocking. The HashInput function was being called on the re-entry, which produced a bad mac response from server. Also cleanup for some of the WC_PENDING_E logic for the non-async cases to reduce code size. 2018-03-16 12:05:07 -07:00
Sean Parkinson da4024b46a Fix downgrading from TLS v1.3 to TLS v1.2
Fix handling of ServerHello in TLS v1.3 to support TLS v1.2 when
downgrading.
Added support in client and server examples for using downgrade method:
wolfSSLv23_client_method_ex() or wolfSSLv23_server_method_ex().
Add tests, using downgrade version, of client or server downgrading from
TLS v1.3 to TLS v1.2.
2018-02-22 12:48:50 +10:00
Takashi Kojo 8c000c05ee refactor MDK options in client/server.c 2018-01-11 06:55:50 +09:00
dgarske 8c15c65343
Merge pull request #1216 from abrahamsonn/windows-errors
Windows errors
2017-11-21 15:21:14 -08:00
abrahamsonn f17470b42b Added more of the requested changes & made an attempt to remove merge conflicts 2017-11-14 15:05:32 -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
David Garske 6369794b6f Fixes for static memory with `-r` session resumption option on client. Fix for possible failed InitSSL cleanup using NULL ssl->ctx for static memory. 2017-11-02 09:48:43 -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 c9558ee27b Updated a few more old names. Added PR for new configs to Jenkins. 2017-10-18 10:38:27 -07:00
David Garske 3d7e86f08d Added missing API's for disabling OCSP stapling. Added OCSP stapling enable/disable for WOLFSSL. 2017-10-17 13:52:05 -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
John Safranek 36a539760a DTLS Bad MAC Checks
1. Make the decrypt and verify MAC failure cases behave the same with
   respect to DTLS messages. It should pretend the message never happened.
2. Allow the echoclient to survive the echoserver sending a message with
   a bad MAC.
3. Allow the server to survive the client sending a message with a bad MAC.
2017-07-31 13:54:53 -07:00
John Safranek 431a0cbea9 Multicast
1. Since multicast's only cipher suite uses null cipher
   automatically enable it.
2. Add options to example client and server to start
   testing multicast API. (Uses TLS over TCP.)
3. Updates to use the forced secrets set by API.
2017-07-19 13:31:39 -07:00
toddouska 19787e6d4f don't treat peer closed / zero return as hard error in example servers 2017-07-12 14:15:16 -06:00
Sean Parkinson 5bddb2e4ef Changes for Nginx
Support TLS v1.3 clients connecting to Nginx.
Fix for PSS to not advertise hash unless the signature fits the private
key size.
Allow curves to be chosen by user.
Support maximum verification depth (maximum number of untrusted certs in
chain.)
Add support for SSL_is_server() API.
Fix number of certificates in chain when using
wolfSSL_CTX_add_extra_chain_cert().
Allow TLS v1.2 client hello parsing to call TLS v1.3 parsing when
SupportedVersions extension seen.
Minor fixes.
2017-07-04 09:37:44 +10:00
toddouska c748d9dae9 Merge pull request #998 from dgarske/fix_no_server_or_client
Fix build with either `NO_WOLFSSL_SERVER` or `NO_WOLFSSL_CLIENT` defined
2017-06-28 10:30:08 -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 7aee92110b Code review fixes
Also put in configuration option for sending HRR Cookie extension with
state.
2017-06-27 08:52:53 +10:00
Sean Parkinson 9ca1903ac5 Change define name for sending HRR Cookie 2017-06-27 08:37:55 +10:00
Sean Parkinson 8bd6a1e727 Add TLS v1.3 Cookie extension support
Experimental stateless cookie
2017-06-26 16:41:05 +10:00
Kincade Pavich fbc4123ec0 Added `-x` option to allow example server to continue running when errors occur. 2017-06-22 21:19:59 -07:00
Sean Parkinson 350ce5fcef TLS v1.3 0-RTT 2017-06-21 08:35:28 +10:00
Sean Parkinson 89e6ac91bf Improve PSK timeout checks
Post-handshake Authentication

Fix KeyUpdate to derive keys properly

Fix supported curves (not checking ctx extensions)
2017-06-14 11:28:53 -07:00
Sean Parkinson 5d5ff56336 External PSK working in TLS13 2017-06-07 17:20:22 +10:00
Jacob Barthelmeh 4737b97503 add trackmemory enable option 2017-05-18 16:46:56 -06:00
David Garske efb4b3c183 Fix for unit test with non-blocking set. 2017-05-04 14:51:31 -07:00
Sean Parkinson 2b1e9973ec Add TLS v1.3 as an option 2017-05-04 14:51:30 -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
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 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 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
Sean Parkinson e6434f380b Get Nginx working with wolfSSL 2017-03-01 08:38:54 +10:00
Jacob Barthelmeh ff05c8a7a5 expanding compatibility layer 2016-12-28 14:45:29 -07:00
Jacob Barthelmeh 79472e11a1 add bio.c to dist and implement wolfSSL_check_private_key , wolfSSL_get_server_random 2016-12-28 14:44:05 -07:00
Jacob Barthelmeh f2f52c3ec9 add more compatiblity functions 2016-12-28 14:44:05 -07:00
David Garske 039aedcfba Added "wolfSSL_use_certificate_chain_buffer_format". Added "wolfSSL_SESSION_CIPHER_get_name" to get cipher suite name using WOLFSSL_SESSION*. Moved the "wolfSSL_get_cipher_name_from_suite" function to internal.c. Added new server-cert-chain.der, which is combination of ca-cert.der and server-cert.der. Enhanced load_buffer to detect format using file extension. Can test use of DER cert chain with NO_FILESYSTEM defined using "./examples/server/server -c ./certs/server-cert-chain.der -k ./certs/server-key.der". 2016-11-30 16:26:02 -08:00
toddouska 092916c253 Merge pull request #536 from ejohnstown/dtls-sctp
DTLS over SCTP
2016-08-30 13:09:40 -07:00
David Garske 2ecd80ce23 Added support for static memory with wolfCrypt. Adds new "wc_LoadStaticMemory" function and moves "wolfSSL_init_memory_heap" into wolfCrypt layer. Enhanced wolfCrypt test and benchmark to use the static memory tool if enabled. Added support for static memory with "WOLFSSL_DEBUG_MEMORY" defined. Fixed issue with have-iopool and XMALLOC/XFREE. Added check to prevent using WOLFSSL_STATIC_MEMORY with HAVE_IO_POOL, XMALLOC_USER or NO_WOLFSSL_MEMORY defined. 2016-08-29 10:38:06 -07:00
John Safranek 46e92e0211 DTLS-SCTP example client and server
1. Update the example client and server to test DTLS-SCTP.
2. Modify the test.h functions for setting up connections to allow
for a SCTP option.
3. Update other examples to use the new test.h functions.
4. Removed some prototypes in the client header file were some functions
that should have been static to the client.c file and made them static.
2016-08-26 19:58:36 -07:00
David Garske 17a34c5899 Added asynchronous wolfCrypt RSA, TLS client and Cavium Nitrox V support. Asynchronous wolfSSL client support for "DoServerKeyExchange", "SendClientKeyExchange", "SendCertificateVerify" and "DoCertificateVerify". Fixes for async DTLS. Refactor of the wolf event and async handling for use in wolfCrypt. Refactor of the async device support so its hardware agnostic. Added Cavium Nitrox V support (Nitrox tested using SDK v0.2 CNN55XX-SDK with new configure "--with-cavium-v=/dir" option). Moved Nitrox specific functions to new port file "port/cavium/cavium_nitrox.c". RSA refactor to handle async with states. RSA optimization for using dpraw for private key decode. Use double linked list in wolf event for faster/cleaner code. Use typedef for wolf event flag. Cleanup of the async error codes. wolfCrypt test and benchmark support for async RSA. Asynchronous mode enabled using "./configure --enable-asynccrypt". If no async hardware is defined then the internal async simulator (WOLFSSL_ASYNC_CRYPT_TEST) is used. Note: Using async mode requires async.c/h files from wolfSSL. If interested in using asynchronous mode please send email to info@wolfssl.com. 2016-08-15 13:59:41 -06:00
Jacob Barthelmeh e8f7d78fc4 add helper functions for choosing static buffer size 2016-07-21 12:11:15 -06:00
John Safranek 2f9c9b9a22 Add cipher suite ECDHE-ECDSA-AES128-CCM
1. Added the usual cipher suite changes for the new suite.
2. Added a build option, WOLFSSL_ALT_TEST_STRINGS, for testing
   against GnuTLS. It wants to receive strings with newlines.
3. Updated the test configs for the new suite.

Tested against GnuTLS's client and server using the options:

    $ gnutls-cli --priority "NONE:+VERS-TLS-ALL:+AEAD:+ECDHE-ECDSA:+AES-128-CCM:+SIGN-ALL:+COMP-NULL:+CURVE-ALL:+CTYPE-X509" --x509cafile=./certs/server-ecc.pem --no-ca-verification -p 11111 localhost
    $ gnutls-serv --echo --x509keyfile=./certs/ecc-key.pem --x509certfile=./certs/server-ecc.pem --port=11111 -a --priority "NONE:+VERS-TLS-ALL:+AEAD:+ECDHE-ECDSA:+AES-128-CCM:+SIGN-ALL:+COMP-NULL:+CURVE-ALL:+CTYPE-X509"

To talk to GnuTLS, wolfSSL also needed the supported curves option
enabled.
2016-06-13 14:39:41 -07:00
Jacob Barthelmeh 3d3591a227 typdef gaurd / error out on bad mutex init / handle no maxHa or maxIO set 2016-06-10 14:13:27 -06:00
Jacob Barthelmeh ea3d1f8e17 extended method function 2016-06-09 23:41:51 -06:00
Jacob Barthelmeh 8be5409bc5 static method func / ocsp callbacks / heap test / alpn free func / remove timing resistant constraint 2016-06-09 11:36:31 -06:00
Jacob Barthelmeh e214086dce tlsx with static memory / account for session certs size 2016-06-08 09:18:43 -06:00
Jacob Barthelmeh 2feee8856e revise static memory and update heap hint 2016-06-04 19:03:48 -06:00
Jacob Barthelmeh 104ff12e76 add staticmemory feature 2016-06-04 19:01:23 -06:00
Chris Conlon 8f3e1165a1 add Whitewood netRandom client library support 2016-05-05 15:31:25 -06:00
Kaleb Himes b2af02a783 Merge pull request #383 from kojo1/MDK5
fixes for MDK5 compiler
2016-04-26 16:11:59 -06:00
Jacob Barthelmeh 77a9343973 use short for RSA min key size and check casts 2016-04-22 12:56:51 -06:00
Jacob Barthelmeh 1dac3841ca change type to short for comparision and up default min size 2016-04-20 15:44:45 -06:00
Jacob Barthelmeh 3129bb22cd minimum ECC key size check at TLS/SSL level 2016-04-19 15:50:25 -06:00
toddouska 117231c0e3 Merge pull request #387 from JacobBarthelmeh/RSA-min
add check for min RSA key size at TLS/SSL level
2016-04-19 13:57:26 -07:00
toddouska 0dbdc8eab0 Merge pull request #372 from dgarske/mingwfixes
MinGW fixes
2016-04-18 12:50:13 -07:00
Jacob Barthelmeh c9891567e8 add check for min RSA key size at TLS/SSL level 2016-04-14 13:35:49 -06:00
Takashi Kojo cab1ebf2d6 move MDK5 current_time to test.h 2016-04-14 18:47:16 +09:00
Takashi Kojo 35c5353698 fixed current_time argument 2016-04-14 16:26:51 +09:00
Takashi Kojo cfd5af341b fixed test.c compile error and server.c/client.c/ssl.c warnings with MDK5 compiler. 2016-04-12 11:05:30 +09:00
kaleb-himes 1b7cd5cb06 consolidate handling of dead assignment warnings 2016-04-11 13:39:44 -06:00
kaleb-himes c6e9021732 scan-build warnings related to enable-psk, disable-asn,rsa,ecc 2016-04-11 11:13:26 -06:00
David Garske 993972162e MinGW fixes, server port assigning cleanup and ping test cleanup. Fixes issue with visibility detection with MinGW. The visibility.m4 script was not actually trying to call the hidden function, which caused MinGW to detect improperly that visibility was supported. Fix for bogusFile on Windows build. Fixes to build warnings for unused variable 'res' and signed/unsigned comparison for sizeof min(). Cleanup of the server side port assignment to allow use with Windows/MinGW/Cygwin. If Windows uses new GetRandomPort() function in test.h to get port in in the 49152 - 65535 range. If *nix then uses the tcp_listen returned port. Otherwise uses the default wolfSSLPort. Refactor of the ping test code to use common file and properly handle ping count differences (Windows "-c" vs. *Nix style "-n"). Workaround for MinGW and cyassl/options.h getting file permissions error. Added non-fatal compile warning if using MinGW that "strtok_s" might be missing along with a link to public domain source that can be used. 2016-04-08 11:48:14 -06:00
Jacob Barthelmeh 85a9c55048 fix c89 build on windows 2016-04-06 11:16:40 -06:00
toddouska 63b1282e67 Merge pull request #335 from dgarske/asynccrypt
Asynchronous crypto and wolf event support
2016-03-30 20:12:41 -07:00
David Garske 4472152b18 Added new "wolfSSL_poll" which filters event queue by ssl object pointer. Changed wolfSSL_CTX_poll to support using WOLF_POLL_FLAG_PEEK flag to peek at events and return count. Removed "wolfssl_CTX_poll_peek". Switched the examples (test.h AsyncCryptPoll) to use just the WOLFSSL object and call new wolfSSL_poll. Added warning when using the "--enable-asynccrypt" option to make sure users know they need real async.c/.h files. 2016-03-30 15:15:38 -07:00
Jacob Barthelmeh 696169634e check return value of wolfSSL_set_fd 2016-03-25 13:59:04 -06:00
Jacob Barthelmeh e99a5b0483 prepare for release v3.9.0 2016-03-17 16:02:13 -06:00
David Garske e1787fe160 Added "--enable-asynccrypt" option for enabling asynchronous crypto. This includes a refactor of SendServerKeyExchange and DoClientKeyExchange to support WC_PENDING_E on key generation, signing and verification. Currently uses async simulator (WOLFSSL_ASYNC_CRYPT_TEST) if cavium not enabled. All of the examples have been updated to support WC_PENDING_E on accept and connect. A generic WOLF_EVENT infrastructure has been added to support other types of future events and is enabled using "HAVE_WOLF_EVENT". Refactor the ASN OID type (ex: hashType/sigType) to use a more unique name. The real "async.c" and "async.h" files are in a private repo. 2016-03-17 13:31:03 -07:00
Jacob Barthelmeh 060e278559 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into Certs 2016-03-11 23:48:39 -07:00
David Garske 0ed26ad262 Updated build for "leantls" to support building only the client, by splitting BUILD_EXAMPLES into 3 parts (BUILD_EXAPLE_SERVERS, BUILD_EXAMPLE_CLIENTS and BUILD_TESTS). This allows the make check to perform the external tests to validate the client only "leantls" configuration option. 2016-03-08 08:35:28 -08:00
Jacob Barthelmeh aab44eb26b adjest example server PSK plus flag 2016-03-02 15:43:17 -07:00
Jacob Barthelmeh d969e2ba11 automated test for trusted peer certs 2016-03-02 11:42:00 -07:00
Jacob Barthelmeh 05d2cec7c1 addition to api tests and refactor location of trusted peer cert check 2016-03-02 11:35:03 -07:00
Jacob Barthelmeh 7df22ee210 Trusted peer certificate use 2016-03-02 11:22:34 -07:00
Jacob Barthelmeh ff7a9d9f78 option for fail on no peer cert except PSK suites 2016-02-10 13:26:03 -07:00
David Garske 2db6246abc Fixed typo with testsuite preprocessor. Added missing chacha.c, chacha20_poly1305.c, pkcs7.c and poly1305.c. Also added the IDE/WIN/user_settings.h to the project so its easy to find. 2016-02-04 11:19:51 -08:00
David Garske ebd14a657d Added signature.c to Visual Studio project files. Added new "IDE/WIN/user_settings.h" which contains all the defines for the various Windows Visual Studio projects. Moved the settings into this new file and added the WOLFSSL_USER_SETTINGS and CYASSL_USER_SETTINGS macros and include path to IDE/WIN to all project files. This allows the settings (defines) to be adjusted in a single place for Win VS. 2016-01-29 14:29:31 -08:00
Moisés Guimarães ec9d23a9c3 Merge branch 'csr' 2015-12-28 19:38:04 -03:00
toddouska 2d33380abc Merge pull request #225 from JacobBarthelmeh/master
help message to use NTRU key in example server
2015-12-28 11:56:13 -08:00
John Safranek 92cb8eee61 revise the comments about port 0 use in the example client and server 2015-12-24 15:42:52 -08:00
John Safranek 4b836f8476 added note to client and server regarding port 0 2015-12-23 12:20:53 -08:00
toddouska 22385f2b39 add random ports for all make check scripts, unique ready file 2015-12-22 14:35:34 -08:00
Jacob Barthelmeh 0721b79282 help message to use NTRU key in example server 2015-12-22 11:51:26 -07:00
John Safranek 917edc5f18 Merge pull request #218 from toddouska/ssl3-aes256
add aes256 key derivation to ssl3
2015-12-17 18:30:23 -08:00
Chris Conlon b89354880f switch pragma once uses, causes warnings on some compilers 2015-12-17 13:19:17 -07:00
toddouska e503b89ca1 allow sniffer build with -v 0 examples to work 2015-12-17 12:10:22 -08:00
Takashi Kojo 4217ef5475 fixed mdk4 macro control in example server/client, echoserver/client 2015-11-27 11:31:12 +09:00
toddouska 32b2d7f9e4 have calling thread wait for crl monitor thread to setup for simpler cleanup 2015-11-23 14:15:12 -08:00
toddouska 806a2748bf Merge pull request #189 from lchristina26/master
Updates for Wind River WORKBENCH/ VxWorks Compatibility
2015-11-12 13:33:27 -08:00
lchristina26 db6920d372 updates for vxworks compatibility 2015-11-12 13:33:47 -07:00
kaleb-himes e9348635a0 SAFESEH:NO in DLL Debug|Win32 2015-11-09 15:11:58 -07:00
Moisés Guimarães 21d70636dc Merge branch csr into 'master' 2015-11-02 15:51:01 -03:00
toddouska e76f95465d Merge pull request #170 from dgarske/master
Fixes initialization of the Crypto HW protection, which could leak a …
2015-10-29 13:56:18 -07:00
lchristina26 723fc3761b Example client/server compatible with VxWorks 2015-10-29 13:39:02 -06:00
David Garske f977caa492 Cleanup of the test code that looks for the WolfSSL root directory. Now it tries to open the certs/ntru-cert.pem file in each directory up (limited to 5) until it opens it. 2015-10-28 23:54:08 -07:00
toddouska 542b59d90a Merge pull request #150 from JacobBarthelmeh/master
Intel RSA IPP plug in
2015-10-27 16:57:32 -07:00
Nickolas Lapp b7848481a3 Fixed gcc variable-mayble-uninitialized warning 2015-10-27 16:42:19 -06:00
Jacob Barthelmeh c132f9887e Merge branch 'master' of https://github.com/wolfSSL/wolfssl 2015-10-19 13:56:39 -06:00
Jacob Barthelmeh ee5a11b8d9 Add Intel IPP crypto for RSA
add user-crypto makefile

update README for IPP crypto

place user crypto in wolfcrypt and use autotools

adjust distributed files

move openssl compatibility consumption

auto use IPP RSA -- IPP directory containing shared libraries local

return value of wolfSSL_BN and formating of debug

openssh testing

make sure IPP not built when fips is

ipp init to select correct optimizations -- static libraries on linux -- fast-rsa disabled by default

try to only set library once

only use static IPP if fast rsa is enabled

make print out for user crypto more pretty
2015-10-19 13:51:49 -06:00
toddouska 4141ea8f83 example server to use cstd free for all build options 2015-10-16 14:05:37 -07:00
Ludovic FLAMENT 9ef43910ed Merge branch 'master' of https://github.com/wolfssl/wolfssl 2015-10-16 07:46:51 +02:00
Ludovic FLAMENT d4f3419758 ALPN : add function to get in a server the list of supported protocols sent by the client. 2015-10-15 14:59:35 +02:00
Ludovic FLAMENT ee8537fb6d Merge branch 'master' of https://github.com/wolfssl/wolfssl 2015-10-14 20:53:30 +02:00
Ludovic FLAMENT 10f5154389 ALPN : add option to continue in case of client/server protocol mismatch (like OpenSSL) 2015-10-13 09:38:40 +02:00
Ludovic FLAMENT bf3b0a228d add support for Application-Layer Protocol Name (RFC 7301) in the TLS extensions 2015-10-09 15:18:41 +02:00
John Safranek 329e6a6207 update the example server and echoserver to correctly generate the DTLS cookie 2015-09-15 17:23:52 -07:00
toddouska 09b2da799f Merge pull request #125 from kojo1/MDK4
MDK4 name change
2015-08-14 14:59:25 -07:00
toddouska 46e7e9acf9 disable SSLv3 by default 2015-08-12 16:39:13 -07:00
Takashi Kojo 30f6bc1e27 MDK4, wolfSSL name change 2015-08-12 16:45:40 +09:00
toddouska 37ba6aeee7 fix psk no identify hint example logic 2015-08-03 09:32:51 -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 df8b48cd0f NTRU suites from earlier code 2015-07-11 12:52:22 -06:00
Jacob Barthelmeh 14723b7e65 QSH (quantum-safe handshake) extension 2015-07-07 09:55:58 -06:00
John Safranek 64602d1969 added check for allowed minimum DH key size 2015-05-21 10:11:21 -07:00
toddouska 8ff17b66f3 add session tickets to echoserver example too 2015-05-18 09:13:34 -07:00
toddouska 74cc2274fa add tiket key cleanup to help valgrind 2015-05-15 15:30:29 -07:00
toddouska 2212381925 add session ticket key returns for reject and use but create 2015-05-15 14:58:16 -07:00
toddouska f6d12bfc37 initial server side session ticket support 2015-05-15 12:51:44 -07:00
toddouska dde4b29462 add handshake done callback with ability to end connection 2015-05-09 11:04:47 -07:00
toddouska d927aa4334 add resume test to example server and script test 2015-04-28 12:21:54 -07:00
toddouska 86f2b9a98f turn off DTLSv1 functions for disable old tls 2015-04-08 13:29:25 -07:00
Chris Conlon 4e6f619302 Merge pull request #46 from jay/add-dll-config-to-vcxproj
build: Add DLL configurations to wolfssl64.sln and all vcxproj files
2015-04-06 09:05:06 -06:00
toddouska 869aeee6cb allow sniffer play nice in ecc build 2015-04-01 12:14:48 -07:00
Jay Satiro b8b13ad9e9 build: Revert using MSBuild property files to auto-detect platform toolset
Prior to this change I had added a .props file for each .vcxproj to
use MSBuild's $(DefaultPlatformToolset) as the the default for
$(PlatformToolset). Typically that configuration allows for the
appropriate toolset to be used no matter which version of VS2010+
the wolfssl64.sln and project files are opened in. Problem is when an
MSBuild was used from the command line to build the solution it got the
$(DefaultPlatformToolset) from a property file based on the solution
header (currently "Format Version 12.00" which maps to Visual Studio
2012) instead. Another side effect was it set the VisualStudioVersion
to 11.0 (n - 1; n in this case 12.0) which was incorrect.

To remedy the above this change reverts back to the old PlatformToolset
method where the v110 toolset (Visual Studio 2012) is specified in every
configuration in every vcxproj. The user will have to specify explicitly
a different toolset to override it (either via command line or the GUI)
if they are not using VS2012.

VS2010 example:
msbuild -p:Configuration="Debug" wolfssl64.sln -p:PlatformToolset=v100
2015-04-01 02:05:15 -04:00
toddouska c9a0c9a797 fix some psk warnings 2015-03-27 19:20:31 -07:00
toddouska 495fbe087e allow dh to be used w/o certs and asn 2015-03-27 14:28:05 -07:00
Jay Satiro 6e14362940 build: Add DLL configurations to wolfssl64.sln and all vcxproj files
- Remove extern from declspec in WOLFSSL_API macro.

- Add a property file to *.vcxproj so that $(DefaultPlatformToolset) is
available.

- Remove the specified platform toolset (VS 2012) in *.vcxproj.

This change allows the projects to use $(DefaultPlatformToolset) so that
they will be built using the default platform toolset for whatever
version of Visual Studio 2010+ that loads them.

- Add DLL Release and DLL Debug configurations to *.vcxproj except for
sslSniffer.vcxproj.

The sniffer uses internal library components that aren't exposed in the
wolfSSL DLL so it can only be built by linking to CyaSSL's static lib.

- Change intermediate output directory of obj files to
<current-dir-setting>\obj\.

The purpose of this change is to separate the output files from the
intermediate files because sometimes they can end up in the same dir.
2015-03-23 02:12:01 -04:00
toddouska 64d83c39a0 Merge https://github.com/kaleb-himes/wolfssl into kaleb-master 2015-03-18 14:25:31 -07:00
kaleb-himes fd772bb434 MSVS warning fixes for all solutions 2015-03-18 10:42:10 -06:00
toddouska b7b655b8bf fix example server memory tracker 2015-03-07 12:00:27 -08:00
toddouska 473a120ba2 remove more stale cyassl headers 2015-02-25 13:34:29 -08:00
kaleb-himes 40d51f13ce ntru neo.lib -> NtruEncrypt_DLL.lib 2015-02-24 13:44:15 -07:00
kaleb-himes de2115b140 shutdown shadows global in sys/socket.h line 576 renamed wc_shutdown 2015-02-18 08:00:25 -07:00
toddouska 5f3b1d90b6 fix shutdown returns 2015-02-16 14:23:33 -08:00
lchristina26 db5a95b370 add option for bidirectional shutdown 2015-01-30 08:41:34 -07:00
kaleb-himes b0e88e32ff Error printouts name changed 2015-01-20 12:36:20 -07:00
kaleb-himes 53d65de105 visual studio project paths updated 2015-01-13 15:30:57 -07:00
Jacob Barthelmeh d366599285 adding comment to header and _fips to c files 2015-01-08 10:42:01 -07:00
kaleb-himes a389620a29 Copyright (C) updates 2015-01-08 09:39:04 -07:00