643 Commits

Author SHA1 Message Date
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
b1ec15de3e Only try shutdown once in example 2020-04-01 17:48:17 -05:00
Eric Blankenhorn
3f7ce61dbd Updates from review 2020-04-01 11:14:25 -05:00
Hideki Miyazaki
99b9f46e58 fixed not working on mac
fixed case of -s or -c
2020-03-27 12:33:51 +09:00
Hideki Miyazaki
9fac21f463 replace the size at bench_embedded 2020-03-25 08:09:42 +09:00
Hideki Miyazaki
75eca61b3e address review comments 2020-03-24 20:35:21 +09:00
Hideki Miyazaki
7d4b4e4994 added dtls benchmark 2020-03-22 17:56:28 +09: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
toddouska
b7d0b81443
Merge pull request #2818 from dgarske/rsa_sha3only
RSA with SHA-3 only and RSA 4096-bit tests
2020-02-27 12:44:29 -08:00
David Garske
ef2c1ae738 Fix for examples/benchmark/tls_bench.c:114:20: error: unused variable 'kShutdown' with WOLFCRYPT_ONLY. 2020-02-23 19:01:46 -08:00
David Garske
418c508eba Fixes for SCTP example to check build options. 2020-02-19 12:28:49 -08: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
Chris Conlon
b29fe41a35
Merge pull request #2738 from SparkiDev/cppcheck_fixes_3
Changes to clear issues raised by cppcheck
2020-02-03 17:02:40 -07:00
toddouska
0551b1f2de
Merge pull request #2765 from SparkiDev/client_read_write
Client using common read and write func
2020-02-03 11:00:15 -08:00
Sean Parkinson
cc2bf03e73 Client using common read and write func 2020-02-03 09:17:27 +10: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
John Safranek
3bdb7d8188
Merge pull request #2761 from JacobBarthelmeh/Testing
add close on pre to echoserver example
2020-01-28 09:29:29 -08:00
Jacob Barthelmeh
d9253afc04 add close on pre to echoserver example 2020-01-22 16:23:46 -08:00
Takashi Kojo
37cad6e9ba %zu, pragma: not supported, 2020-01-22 08:12:51 +09:00
John Safranek
aabdec214e
MinGW uses the Win32 setsockopt() function which uses a char for
SO_REUSEADDR's option. Everything else uses an int.
2020-01-21 10:53:19 -08:00
John Safranek
23427085af
1. Add an indent to a new line in user settings.
2. Remove the execute bit from the changed files.
2020-01-20 12:30:32 -08:00
Takashi Kojo
a08ab1fc7a
fix mnGW error 2020-01-20 12:19:18 -08:00
Chris Conlon
45c5a2d39c update copyright to 2020 2020-01-03 15:06:03 -08:00
toddouska
4f71bcfa7c
Merge pull request #2704 from ejohnstown/renegotiation
Maintenance: Renegotiation
2019-12-30 16:45:31 -08:00
toddouska
deac82c8ed
Merge pull request #2683 from dgarske/various_items
Various cleanups and fixes
2019-12-27 13:53:39 -08:00
John Safranek
add7cdd4e2
Maintenance: Renegotiation
1. Found a corner case where secure renegotiation would fail trying to
inappropriately use a session ticket.
2. Explicitly split renegotiation into Rehandshake and SecureResume.
2019-12-26 16:39:44 -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
Eric Blankenhorn
774a758f59 Fixes in test and example code 2019-12-17 15:56:40 -06:00
David Garske
cb9f16d3cb Fix for proper sizing of in-memory buffer for TLS benchmarking (32 is not always the max digest size). 2019-11-18 10:34:15 -08:00
David Garske
0c2c4fd91b Improvements to tls_bench tool in wolfSSL lib for embedded use. 2019-11-15 12:09:19 -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
Jacob Barthelmeh
890eb415b1 fix for memory management on edge case with staticmemory 2019-11-05 15:13:26 -07:00
JacobBarthelmeh
bb6eeefe26 fix for build with --enable-all and gcc-9 on Linux 2019-10-15 09:56:26 -07:00
Sean Parkinson
901ee627fc Fixes from using cppcheck tool
Various fixes for uninitialized variable use.
sniffer.c: close file when seek fails
tls.c: fix QSH_GET_SIZE macro
wolfio.c: uIPGenerateCookie: use the parameter, _ctx, instead of self
referencing.
wolfssl_adds.c: check for equivalent to XBADFILE to indicate error.
SP: change right shift of signed value to unsigned
sp_int.h: define 128-bit types
types.h: change a XMALLOC define to not use (,,) - cppcheck doesn't like
it and is unnecessary.
2019-10-01 09:22:00 +10:00
David Garske
9d05e9c0b7 Fixes for minor nightly build tests. 2019-09-25 11:07:32 -07:00
John Safranek
b92509144b
Merge pull request #2475 from dgarske/qat_key
Fixes and improvements for async
2019-09-20 10:44:33 -07:00
cariepointer
2dafd2102c Add Apache HTTP Server compatibility and --enable-apachehttpd option (#2466)
* Added Apache httpd support `--enable-apachehttpd`.

* Added `SSL_CIPHER_get_version`, `BIO_new_fp`, `SSL_SESSION_print` and `SSL_in_connect_init` compatibility API's.

* Fix to expose `ASN1_UTCTIME_print` stub.

* Pulled in `wolfSSL_X509_get_ext_count` from QT.

* Added `X509_get_ext_count`, `BIO_set_callback`, `BIO_set_callback_arg` and `BIO_get_callback_arg`.

* Added `wolfSSL_ERR_print_errors`.

* Added `BIO_set_nbio` template.

* Fixes for building with Apache httpd.

* Added DH prime functions required for Apache httpd.

* Fix and move the BN DH prime macros.

* Fix for `SSL_CTX_set_tlsext_servername_arg` to have return code.

* Only add the `BN_get_rfc*_prime_*` macro's if older than 1.1.0.

* Added `ERR_GET_FUNC`, `SSL_CTX_clear_extra_chain_certs` prototypes.

* Added `wolfSSL_CTX_set_client_cert_cb` template and `OPENSSL_load_builtin_modules` stub macro.

* Added `X509_INFO` templates (`X509_INFO_new`, `X509_INFO_free`, `sk_X509_INFO_new_null`, `sk_X509_INFO_num`, `sk_X509_INFO_value`, `sk_X509_INFO_free`). Added `sk_X509_shift`.

* Added BIO_set_callback, BIO_get_callback, BIO_set_callback_arg, BIO_get_callback_arg

* add BIO_set_nbio, ERR_print_errors and tests

* add X509 INFO stack push function

* Add ASN1_UTCTIME_print and unit test

* Add X509_get_ext_count unit test

* initial commit of wolfSSL_PEM_X509_INFO_read_bio

* Added `sk_X509_NAME_new`, `sk_X509_NAME_push`, `sk_X509_NAME_find`, `sk_X509_NAME_set_cmp_func` and `sk_X509_NAME_free`. Grouped `sk_X509_NAME_*` functions.

* Cleanup sk X509 NAME/INFO pop free template.

* Advance openssl compatibility to v1.1.0 for Apache httpd. Added TLS version macros. Implemented sk X509 NAME/INFO pop and pop_free.

* Added `TLS_client_method` support.

* Added `SSL_get_server_tmp_key` and `EC_curve_nid2nist`.

* Added `SSL_CTX_set_min_proto_version` and `SSL_CTX_set_max_proto_version`. Fix for `BN_get_rfc*_prime_*` with the v1.1.0 change.

* add test cases for PEM_X509_INFO_read_bio

* Fixes for `BN_get_rfc*_prime_*` macros. Added template for `SSL_DH_set0_pqg`. Fix for `SSL_OP_NO_` to use Macro's (as is done in openssl). Added `SSL_set_verify_result`. Added stub for `OPENSSL_malloc_init`.

* Apache httpd compatibility functions. BIO setter/getters.

* implement ASN1_TIME_check and add test case

* add SSL_get_client_CA_list

* add initial implementation of wolfSSL_DH_set0_pqg

* Add apache support to OBJ_txt2nid and unit test, add stub for OBJ_create

* add X509_STORE_CTX_get1_chain, sk_free, sk_X509_dup

* Add sk_SSL_COMP_num and SSL_COMP struct

* implement and test of SSL_SESSION_print

* add SSL_CTX_set_client_cert_cb

* expand BIO_printf and add test case

* Added `OCSP_CERTID_dup`. Added `ASN1_TYPE`.

* add implementation for wolfSSL_get_server_tmp_key

* add wolfSSL_BIO_puts and test case

* Add X509_EXTENSION_get_object and X509_EXTENSION_get_data

* add helper for bio flag set and null x509 stack

* add test adn implementation for wolfSSL_i2d_PrivateKey

* Added `ASN1_OTHERNAME`, `ACCESS_DESCRIPTION` and `GENERAL_NAME`. Added `sk_ACCESS_DESCRIPTION_pop_free` and `ACCESS_DESCRIPTION_free` stubs.

* add wolfSSL_PEM_read_bio_ECPKParameters

* add BIO_vfree

* add X509_up_ref

* add X509_STORE_CTX_set_ex_data

* add _GNU_SOURCE macro and wolfSSL_EVP_read_pw_string

* add wolfSSL_EVP_PKEY_ref_up function

* X509_get_ext, X509V3_EXT_print, and d2i_DISPLAYTEXT stubs

* add X509_set_issuer_name

* add wolfSSL_sk_SSL_CIPHER_* functions and tests

* add prototype for sk_X509_EXTENSION and ACCESS_DESCRIPTION

* fix casting to avoid clang warning

* adjust test_wolfSSL_X509_STORE_CTX test case

* Added `OpenSSL_version`

* renegotiate functions and additional stack functions

* add aditional stub functions

* Add Apache httpd requirements for ALPN, CRL, Cert Gen/Req/Ext and SecRen. Fix for `sk_X509_INFO_new_null`.

* add ocsp stub functions

* Proper fix for `sk_X509_INFO_new_null`. Added templates for `X509_get_ext_by_NID` and `X509_add_ext`. Added templates for `ASN1_TIME_diff` and `ASN1_TIME_set`.

* x509 extension stack additions

* Fixed template for `OCSP_id_get0_info`.

* add X509 stub functions

* add X509_STORE_CTX_get0_store() and unit test

* Added `EVP_PKEY_CTX_new_id`, `EVP_PKEY_CTX_set_rsa_keygen_bits`, `EVP_PKEY_keygen_init`, `EVP_PKEY_keygen` and `BN_to_ASN1_INTEGER`.

* x509v3 stubs and req add extensions

* Add OBJ_txt2obj and unit test; add long name to wolfssl_object_info table for use by OBJ_* functions

* wolfSSL_set_alpn_protos implementation

* Added `EVP_SignInit_ex` and `TLS_server_method` implementation. Added stubs for  `RSA_get0_key` and `i2d_OCSP_REQUEST_bio`. Fix typo on `OCSP_response_create`. Fix warning in `wolfSSL_set_alpn_protos`.

* Added `X509_EXTENSION_free` stub. Fixed a few macro typos/adding missing.

* add X509_STORE_CTX_get0_current_issuer and unit test

* add OBJ_cmp and unit test

* add RSA_get0_key and unit test

* add OCSP_check_nonce

* Implement X509_set_notAfter/notBefore/serialNumber/version,X509_STORE_CTX_set_depth,X509V3_set_ctx.

* Modify wolfSSL_X509_set_notAfter/notBefore and add tests for each.

* Add test_wolfSSL_X509_set_version w/ fixes to _set_version and fix _set_notBefore/notAfter tests

* add OCSP_id_get0_info and unit test, move WOLFSSL_ASN1_INTEGER to asn_public.h from ssl.h

* inital implementation of wolfSSL_X509_sign

* add debugging messages and set data for BIO's

* Add i2d_OCSP_REQUEST_bio.

* implementation of some WOLFSSL_BIO_METHOD custom functions

* fix for ASN time structure and remove log node

* initial eNULL support and sanity checks

* fixes after rebasing code

* adjust test cases and ASN1_TIME print

* Various fixes for memory leaks

* Apache compatibility in CTX_set_client_CA_list for X509_NAME use; add X509_NAME_dup as supporting function

* Add initial X509_STORE_load_locations stub for Apache

* Updates to X509_get_ext_d2i to return GENERAL_NAME struct instead of ASN1_OBJECT for alternative names and add supporting GENERAL_NAME functions

* Add X509_STORE_load_locations implementation; add wolfSSL_CertManagerLoadCRL_ex; initial renegotiation fixes/updates

* Fix for freeing peer cert in wolfSSL_Rehandshake instead of FreeHandShakeResources during secure renegotiation

* Add X509_ALGOR and X509_PUBKEY structs for X509_PUBKEY_get0_param and X509_get_X509_PUBKEY implementation

* Initial implementation of wolfSSL_X509_get_X509_PUBKEY and wolfSSL_X509_PUBKEY_get0_param

* Add implementation for X509_get0_tbs_sigalg and X509_ALGOR_get0

* Add OBJ_nid2ln implementation

* Fix compile errors in tests/api.c for some build options

* Updates to X509_STORE_load_locations for non-CRL types; Add additional DETECT_CERT_TYPE enum and logic for detecting certificate type in ProcessFile

* Add X509_STORE_load_locations unit test and minor error handling fixes

* Add unit test for X509_sign

* Set correct alert type for revoked certificates; add/fix a few WOLFSSL_ENTER messages

* Add X509_ALGOR member to X509 struct; refactoring and unit tests for wolfSSL_X509_ALGOR_get0 and wolfSSL_X509_get0_tbs_sigalg

* Add X509_PUBKEY member to X509 struct; refactoring and unit tests for wolfSSL_X509_get_X509_PUBKEY and wolfSSL_X509_PUBKEY_get0_param

* Stack fixes after rebase

* Secure renegotiation refactoring: add ACCEPT_BEGIN_RENEG to AcceptState for use in wolfSSL_SSL_in_connect_init; free old peer cert when receiving new cert to fix memory leak

* Move enc-then-mac enable option in configure.ac for apache httpd compatibility

* Simplify wolfSSL_SSL_in_connect_init logic

* Remove unneeded wolfSSL_CertManagerLoadCRL_ex

* Fixes for jenkins test failures

* SSL_get_secure_renegotiation_support for print statement in Apache
2019-09-19 17:11:10 -07:00
toddouska
c16b02a265
Merge pull request #2471 from dgarske/test_date_override
Fix for verify callback override not adding to trusted CA list
2019-09-19 13:54:24 -07:00
David Garske
6aecdf59c1 Fixes for async build and tests. 2019-09-19 12:30:05 -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