Commit Graph

10048 Commits

Author SHA1 Message Date
David Garske
4c709f1f2c Improvements to SHA-1, SHA-256 and MD5 performance:
* Added detection for buffer alignment to avoid memcpy.
* Added MD5 and SHA-1 support for XTRANSFORM_LEN to process blocks.
* Cleanups for consistency between algorithms and code commenting.
* Enhancement for NXP MMCAU to process more than one block at a time.
* Improved MMCAU performance: SHA-1 by 35%, SHA-256 by 20% and MD5 by 78%.

```
NXP K64 w/MMCAU after:

MD5                  8 MB took 1.000 seconds,    7.910 MB/s
SHA                  4 MB took 1.005 seconds,    3.644 MB/s
SHA-256              2 MB took 1.006 seconds,    2.306 MB/s

NXP K64 w/MMCAU before:
MD5                  4 MB took 1.004 seconds,    4.450 MB/s
SHA                  3 MB took 1.006 seconds,    2.670 MB/s
SHA-256              2 MB took 1.008 seconds,    1.913 MB/s
```
2019-09-26 11:32:59 -07:00
Sean Parkinson
4a6925e2ef
Merge pull request #2480 from dgarske/nightly_20190925
Fixes for minor build issues
2019-09-26 17:34:21 +10:00
Jacob Barthelmeh
f1b68873ef add check on dependencies for tests 2019-09-26 11:43:12 +07:00
David Garske
02c5d36f72 Fixes for --enable-opensslextra or --enable-opensslall with NO_WOLFSSL_CLIENT or NO_WOLFSSL_SERVER defined. 2019-09-25 20:11:54 -07:00
David Garske
9d05e9c0b7 Fixes for minor nightly build tests. 2019-09-25 11:07:32 -07:00
David Garske
bcd8a521f5
Merge pull request #2479 from tmael/aes_gcm
Initialize AES GCM set key
2019-09-20 14:34:25 -07:00
Tesfa Mael
74386fd0d0 Initialize GCM AAD in case wc_AesInit() wasn't called 2019-09-20 12:04:33 -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
Tesfa Mael
54cdab8005 Initialize AES GCM set key 2019-09-20 10:17:08 -07:00
Chris Conlon
8636bac12f
Merge pull request #2478 from miyazakh/fix_iar_build
Fix build failure on IAR EWRX
2019-09-20 09:01:56 -06:00
Sean Parkinson
3f10a37eda
Merge pull request #2477 from dgarske/keil_sp
Fixes for using Keil with single precision math.
2019-09-20 10:42:46 +10:00
David Garske
d762d2fa5d
Merge pull request #2450 from aaronjense/microsoft-azure-sphere
Visual Studio Solution for Azure Sphere Devices
2019-09-19 17:13:46 -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
Hideki Miyazaki
2f818f9508 Fix build failure on IAR EWRX 2019-09-20 09:07:51 +09:00
Sean Parkinson
dfc00bf057
Merge pull request #2476 from dgarske/pkcb_tls13
Fix for TLS v1.3 and PK callbacks
2019-09-20 08:10:43 +10:00
David Garske
3b6112e317 Fixes for using Keil with single precision math. 2019-09-19 14:34:30 -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
Chris Conlon
33a83cdba0
Merge pull request #2436 from miyazakh/Renesas_TSIP_Port
Support renesas tsip
2019-09-19 14:44:33 -06:00
toddouska
2dbf3f81fc
Merge pull request #2474 from SparkiDev/sp_int_prime
Add support for prime checking to sp_int.c
2019-09-19 13:44:22 -07:00
toddouska
fd1d65c4f9
Merge pull request #2470 from SparkiDev/build-fixes
Fixes from overnight build failures
2019-09-19 13:38:25 -07:00
toddouska
cc452adff1
Merge pull request #2465 from JacobBarthelmeh/Fuzzer
sanity check on length before read
2019-09-19 13:34:42 -07:00
David Garske
523b1801ed Cleanup of the wc_ecc_sign_hash function to separate the async logic. This improves the ECC r/s local case to appease static analyzers. Fixes https://github.com/wolfSSL/wolfssl/issues/2342. 2019-09-19 13:33:02 -07:00
John Safranek
ab86e78cbe
Merge pull request #2458 from JacobBarthelmeh/Certs
macro guards for re-defines
2019-09-19 12:54:26 -07:00
David Garske
6aecdf59c1 Fixes for async build and tests. 2019-09-19 12:30:05 -07:00
David Garske
ae25027135 Fix for TLS v1.3 and PK callbacks. 2019-09-19 12:07:14 -07:00
David Garske
1493b94b27 Eliminate async NUMA allocation for wc_ecc_gen_k. Additional DECLARE_VAR checks. Improve mp_rand to avoid alloc in async case. 2019-09-19 11:34:59 -07:00
Jacob Barthelmeh
f532143094 adjust CheckASNTag to be GetASNTag 2019-09-19 02:09:51 -06:00
Hideki Miyazaki
5c5aa45a5e addressed review comments
tsip_usable() reconstruction
2019-09-19 14:35:23 +09:00
Hideki Miyazaki
a37b604da9 addressed review comments 2019-09-19 11:18:52 +09:00
Hideki Miyazaki
63d61c490d addressed review comments 2019-09-19 11:18:52 +09:00
Hideki Miyazaki
a6b2d1621b Free memory for a msg buffer when calling wc_ShaxxxFree() 2019-09-19 11:18:52 +09:00
Hideki Miyazaki
778a2065ab Replaced key information by dummy data 2019-09-19 11:18:52 +09:00
Hideki Miyazaki
cb0184fe98 update Readme, added file header etc 2019-09-19 11:18:52 +09:00
Hideki Miyazaki
a292e69d3f update readme 2019-09-19 11:18:52 +09:00
Hideki Miyazaki
5c6f6fdb7d Renesas TSIP Support
merged from private repo

removed unneccessary #include
make line as 80 characters
added simple tls server
Disable TLS-linked API use when being SERVER SIDE, still use certificate verify API
Added utility tools, generate signature arrays etc
added vars to store tsip hmac keys
fix build failure when disabling dc_printf
2019-09-19 11:18:52 +09:00
Sean Parkinson
0bc16d47e2 Add support for prime checking to sp_int.c
This allows SP to support:
- DH parameter checking
- DH parameter generation
- RSA key generation
Improved performance of sp_mod operation.
Reworked some functions to have one exit point (return statement).
Fixed sp_sub_d().
Changed tests to perform 2048-bit RSA key generation only when using SP
math.

Fixed Intel x86_64 C file to not have DH specific functions available
unless WOLFSSL_HAVE_SP_DH is defined.
Fixed tfm to return an error when t is not the correct size in
fp_isprime_ex().
2019-09-19 09:08:15 +10:00
Aaron Jense
bdbe0943cf Add function to print network interface and IP Address 2019-09-18 19:57:19 +01:00
Aaron Jense
4ef8f53c9e PR Review Changes
1. Add more documentation
2. Add cleanup functions for client and server before return
3. Add the ability for client to use a hostname for SERVER_IP
2019-09-17 14:59:43 -06:00
toddouska
946a0f593f
Merge pull request #2472 from SparkiDev/enc_then_mac_fix
Enc-Then-MAC: when message size is less than digest size return error
2019-09-17 08:57:26 -07:00
Chris Conlon
f0e774d1e1
Merge pull request #2420 from kojo1/KDS-proj
add KDS sample project
2019-09-17 11:53:04 -04:00
Chris Conlon
bdad0fa53f
Merge pull request #2443 from miyazakh/fix_esp_examples
Fixed examples for esp-idf
2019-09-17 11:47:39 -04:00
David Garske
0e5de0c076 Fix to only AddCA when its CA type and veryNone is not set. 2019-09-17 07:56:02 -07:00
Sean Parkinson
2c2907c2a5 Enc-Then-MAC: when message size is less than digest size return error 2019-09-17 11:23:43 +10: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
Jacob Barthelmeh
708556d5c7 adjust sha3 typedef 2019-09-16 10:40:56 -06:00
Jacob Barthelmeh
3b7b81fea7 add local CheckASNTag function 2019-09-15 23:06:11 -06:00
David Garske
326f02d76d Fix for buffer overrun check logic. 2019-09-15 23:04:13 -06:00
Jacob Barthelmeh
e6c48327c1 sanity check on length before read 2019-09-15 23:04:13 -06:00
Sean Parkinson
000fc64f27 Fixes from overnight build failures
ssl.c: Certificate store fields freed without being NULLed and then
freed again.
integer.c: Compiler complained that a->dp may be NULL in mp_set_bit when
setting bit.
pkcs12.c: ret is zero after GetLength and this is an error but data is
freed only when ret != 0.
pkcs7.c: derArr was not zeroized for full allocated size.
2019-09-16 10:21:08 +10:00
toddouska
9d69f17f17
Merge pull request #2468 from tmael/RSA_inline
Fix for RSA inline
2019-09-13 13:46:33 -07:00