Commit Graph

980 Commits (e55ca1a8cf34c0e63c490e52c25a0921e2273ad6)

Author SHA1 Message Date
Juliusz Sosinowicz aea95232d1 WIP
Add EC_POINT conversion to BIGNUM (EC_POINT_point2bn)
Add setting affine coordinates for EC_POINT (EC_POINT_set_affine_coordinates_GFp)
Add bit clearing for BIGNUM (BN_clear_bit)
Add supporting unit tests in api.c
2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz 89e35e2547 openssh 8.1 compiles 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz b5c52d7c70 openssh WIP and some light refactoring 2020-02-18 21:37:06 +01:00
Juliusz Sosinowicz 41de1bb156 WIP 2020-02-18 21:36:26 +01:00
toddouska 2566986d41
Merge pull request #2632 from SparkiDev/sp_p384
Add support for P384 curve into SP
2020-02-17 11:46:09 -08:00
Sean Parkinson 8972bf6278 Add support for P384 curve into SP 2020-02-17 15:46:34 +10:00
Jacob Barthelmeh 8e1adb125c free existing cert store when setting a new one 2020-02-12 15:45:44 -07:00
Tesfa Mael e664a4f206 Review comments 2020-02-04 08:55:37 -08:00
Tesfa Mael b67fd249e2 Fix for cppcheck 2020-02-04 08:55:37 -08: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 4ee022f788
Merge pull request #2776 from julek-wolfssl/set_curve_groups_list
Add SSL_CTX_set1_groups_list and SSL_set1_groups_list APIs
2020-02-03 11:11:59 -08:00
Juliusz Sosinowicz e13d9f7f1b Add SSL_CTX_set1_groups_list and SSL_set1_groups_list APIs 2020-01-31 06:38:38 +01:00
Sean Parkinson 55ea2facdd Changes to clear issues raised by cppcheck 2020-01-30 14:24:32 +10:00
David Garske e183d95c86 Fix for moved file. 2020-01-29 07:22:07 -08:00
David Garske 0489cc97a8 Fix for `ProcessBuffer` with PEM private keys, where `PemToDer` call was only setting `eccKey`. Cleanup to use "keyFormat" OID sum. 2020-01-20 20:49:55 -08:00
David Garske 77426e78e1 Added test case for PKCS8 ED25519 encrypted private key. 2020-01-20 20:47:47 -08:00
toddouska 66daac4c94
Merge pull request #2709 from JacobBarthelmeh/Testing
set chacha20 similar to aes-ctr when handling leftover stream and add…
2020-01-17 15:05:24 -08:00
toddouska 204ef9543a
Merge pull request #2728 from ejohnstown/maint-x509
Maintenance: X509
2020-01-17 13:51:02 -08:00
David Garske 22f49d8597 Fixes for building with ECC sign/verify only. 2020-01-13 15:35:08 -08:00
John Safranek 8d1b20706c
Maintenance: X509
1. Add a test for the new alt name handling.
2. Added an API to set altnames in a WOLFSSL_X509 struct. Just adds
DNS_entries.
3. Removed the "static" from a bunch of constant byte arrays used inside
some of the ASN.1 code.
2020-01-10 20:26:35 -08:00
JacobBarthelmeh 6b4551c012
Merge pull request #2654 from cariepointer/qt-512-513
Add Qt 5.12 and 5.13 support
2020-01-10 17:34:23 -07:00
Jacob Barthelmeh 99d657af4f adjust test cases 2020-01-10 10:31:56 -07:00
Jacob Barthelmeh 0c25588ad1 adjust TEST_SMALL_CHACHA_CHUNKS size and add more tests 2020-01-09 17:13:57 -07:00
Jacob Barthelmeh 8e24bf6c2c add macro guard for optimized versions 2020-01-09 16:39:48 -07:00
JacobBarthelmeh 0ec7b311d8 set chacha20 similar to aes-ctr when handling leftover stream and add test case 2020-01-09 16:39:48 -07:00
Carie Pointer 47040f1dae EC_KEY_dup fixes 2020-01-09 14:35:57 -07:00
Carie Pointer b9c99709f7 Fixes from review 2020-01-08 12:48:01 -07:00
toddouska d257003341
Merge pull request #2711 from cconlon/copyright2020
update copyright to 2020
2020-01-07 08:40:15 -08:00
JacobBarthelmeh ce0475a8e0
Merge pull request #2689 from tmael/pkey_freeMutex
Free EVP ctx pkey
2020-01-06 23:15:00 +07:00
Chris Conlon 45c5a2d39c update copyright to 2020 2020-01-03 15:06:03 -08:00
toddouska abc96f20fb
Merge pull request #2696 from embhorn/cert_vfy_CB
CertManager verify callback
2019-12-30 11:57:44 -08:00
Tesfa Mael 4004963c6a test pkey references count 2019-12-30 09:31:23 -08:00
toddouska 78fa84be00
Merge pull request #2649 from SparkiDev/rsa_pubonly
Fix RSA public key only builds
2019-12-27 12:55:34 -08:00
toddouska dd28f26c44
Merge pull request #2699 from JacobBarthelmeh/Testing
big endian changes
2019-12-27 12:52:30 -08:00
Eric Blankenhorn 8580bd9937 CertManager verify callback
Execute verify callback from wolfSSL_CertManagerLoadCA
2019-12-26 09:29:03 -06:00
JacobBarthelmeh ac0acb3c37 fix for test case with big endian 2019-12-26 05:57:26 -07:00
Eric Blankenhorn b83804cb9d Correct misspellings and typos from codespell tool 2019-12-24 12:29:33 -06:00
Jacob Barthelmeh e1433867ce fix for expected nightly config test report 2019-12-20 09:46:12 -07:00
toddouska 3342a19e29
Merge pull request #2578 from cariepointer/ZD-9478-and-9479
Add sanity checks for parameters in wc_scrypt and wc_Arc4SetKey
2019-12-19 10:59:05 -08:00
toddouska 6922d7031c
Merge pull request #2685 from embhorn/coverity_fixes
Coverity fixes
2019-12-18 14:06:48 -08:00
Eric Blankenhorn 52893877d7 Fixes from review 2019-12-18 13:25:25 -06:00
toddouska f81ce71c25
Merge pull request #2660 from JacobBarthelmeh/Compatibility-Layer
add --disable-errorqueue option
2019-12-17 16:37:02 -08:00
Carie Pointer 5711d12364 Remove SSL_library_init() calls in unit tests to fix valgrind issues 2019-12-17 15:54:10 -07:00
Eric Blankenhorn 774a758f59 Fixes in test and example code 2019-12-17 15:56:40 -06:00
Tesfa Mael 88188b79e2 Fix mem leak 2019-12-16 18:03:11 -08:00
Jacob Barthelmeh 2e5258fe15 add --disable-errorqueue option 2019-12-11 11:19:58 -07:00
Carie Pointer 4511557f01 More jenkins test fixes 2019-12-09 15:57:53 -07:00
Carie Pointer 9ad970d8a4 Fixes for jenkins test failures 2019-12-09 14:04:52 -07:00
JacobBarthelmeh 05e672428d
Merge pull request #2645 from cconlon/cmsrsacb
CMS SignedData RSA sign callback for raw digest
2019-12-06 17:13:32 -07:00
Carie Pointer ee13dfd878 Add Qt 5.12 and 5.13 support
Co-Authored-By: aaronjense <aaron@wolfssl.com>
Co-Authored-By: MJSPollard <mpollard@wolfssl.com>
Co-Authored-By: Quinn Miller <quinnmiller1997@users.noreply.github.com>
Co-Authored-By: Tim Parrish <timparrish@users.noreply.github.com>
2019-12-06 14:27:01 -07:00
Chris Conlon 6081bdaad6 free PKCS7 before creating new in API test 2019-12-06 12:00:33 -07:00
Sean Parkinson 2528121925 Fix RSA public key only builds
Client side only and no client auth
2019-12-06 20:42:27 +10:00
toddouska 312d5c98b3
Merge pull request #2535 from julek-wolfssl/nginx-1.15
Nginx 1.15.0 & 1.16.1
2019-12-05 14:40:45 -08:00
toddouska a13ebf5258
Merge pull request #2543 from embhorn/zd5706
Update DoVerifyCallback to check verify param hostName and ipasc
2019-12-05 14:38:47 -08:00
Chris Conlon be97444d24 add api test for wc_PKCS7_SetRsaSignRawDigestCb() 2019-12-05 10:33:49 -07:00
Juliusz Sosinowicz 29a8262ea4 Only test X509_NAME_print_ex when defines enabled 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz 944d5e1045 Don't count null char in better way 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz 5f39e12b21 Fix leak in SSL_CTX_set0_chain 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz 8dde06bbca Fix compile errors 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz dd07344499 SSL_SESSION_dup 2019-11-27 17:46:15 +01:00
Juliusz Sosinowicz b71758895e Add support for SSL_CTX_set0_chain 2019-11-27 17:46:15 +01:00
toddouska 9b7cd6bdfd
Merge pull request #2613 from tmael/evp_aes_gcm
Set default IV length for EVP aes gcm
2019-11-26 15:18:27 -08:00
toddouska 9ecafa7afe
Merge pull request #2557 from tmael/cert_store_ls_x509
Retrieve a stack of X509 certs
2019-11-26 15:16:09 -08:00
Tesfa Mael 6c732725b0 Test evp aes gcm with default IV length 2019-11-20 16:37:15 -08:00
Tesfa Mael 520a032b71 Add show x509 test 2019-11-15 13:23:08 -08:00
Tesfa Mael 6ca12787ae retrieve a stack of X509 certs in a cert manager and a store ctx 2019-11-15 13:23:08 -08:00
David Garske 961f9c4ecc Cleanup for invalid use of `NO_SHA512` in api.c unit test. 2019-11-15 12:08:50 -08:00
David Garske 546442c130 Fix for CAVP test issue trying to use `AES_128_KEY_SIZE` and `AES_IV_SIZE`. 2019-11-12 09:43:09 -08:00
David Garske d17748b1ad Fix for `EC_GROUP_order_bits` and added unit test. 2019-11-11 14:58:23 -08:00
David Garske 2bae1d27a1 wolfSSL Compatibility support for OpenVPN
* Adds compatibility API's for:
	* `sk_ASN1_OBJECT_free`
	* `sk_ASN1_OBJECT_num`
	* `sk_ASN1_OBJECT_value`
	* `sk_X509_OBJECT_num`
	* `sk_X509_OBJECT_value`
	* `sk_X509_OBJECT_delete`
	* `sk_X509_NAME_find`
	* `sk_X509_INFO_free`
	* `BIO_get_len`
	* `BIO_set_ssl`
	* `BIO_should_retry` (stub)
	* `X509_OBJECT_free`
	* `X509_NAME_get_index_by_OBJ`
	* `X509_INFO_free`
	* `X509_STORE_get0_objects`
	* `X509_check_purpose` (stub)
	* `PEM_read_bio_X509_CRL`
	* `PEM_X509_INFO_read_bio`
	* `ASN1_BIT_STRING_new`
	* `ASN1_BIT_STRING_free`
	* `ASN1_BIT_STRING_get_bit`
	* `ASN1_BIT_STRING_set_bit`
	* `DES_check_key_parity`
	* `EC_GROUP_order_bits`
	* `EC_get_builtin_curves`
	* `EVP_CIPHER_CTX_cipher`
	* `EVP_PKEY_get0_EC_KEY`
	* `EVP_PKEY_get0_RSA`
	* `EVP_PKEY_get0_DSA` (stub)
	* `HMAC_CTX_new`
	* `HMAC_CTX_free`
	* `HMAC_CTX_reset`
	* `HMAC_size`
	* `OBJ_txt2obj`
	* `RSA_meth_new`
	* `RSA_meth_free`
	* `RSA_meth_set_pub_enc`
	* `RSA_meth_set_pub_dec`
	* `RSA_meth_set_priv_enc`
	* `RSA_meth_set_priv_dec`
	* `RSA_meth_set_init`
	* `RSA_meth_set_finish`
	* `RSA_meth_set0_app_data`
	* `RSA_get_method_data`
	* `RSA_set_method`
	* `RSA_get0_key`
	* `RSA_set0_key`
	* `RSA_flags`
	* `RSA_set_flags`
	* `RSA_bits`
	* `SSL_CTX_set_ciphersuites`
	* `SSL_CTX_set_security_level` (stub)
	* `SSL_export_keying_material` (stub)
	* `DSA_bits` (stub)
* Changes to support password callback trial and NO_PASSWORD. Replaces PR #2505.
* Renamed `wolfSSL_SSL_CTX_get_client_CA_list` to `wolfSSL_CTX_get_client_CA_list`.
* Cleanup of "sk" compatibility.
2019-11-11 14:58:23 -08:00
Carie Pointer a2cdb87067 Add check for if length is <= 0 in wc_Arc4SetKey 2019-11-08 14:54:39 -07:00
Sean Parkinson c06efb6c1f Ensure space for name string. Reset policy count.
Only set the name string in one place, keeping a length of the name type
to copy. Also only move cert data index once.
Reset certificate extension policy number/count in case of malicious
cert with multiple policy extensions.
2019-11-07 13:51:50 +10:00
toddouska ba34b0d09f
Merge pull request #2547 from SparkiDev/rsa_pss_salt_len
Compile options for larger salt lengths in RSA-PSS
2019-11-06 13:03:15 -08:00
Eric Blankenhorn 16899b55b2 Fix for ARM platforms 2019-11-04 11:54:36 -06:00
Sean Parkinson 35ec2bc6d4 Compile options for larger salt lengths in RSA-PSS
Salt length larger than the hash size allowed in RSA-PSS.
Passing -2 to PSS pad function uses maximum salt length.
Passing -2 to PSS un-pad function makes it discover salt length.
2019-11-04 14:27:02 +10:00
Eric Blankenhorn 58d800fbb7 Adding support for IP address verification 2019-10-31 09:15:22 -05:00
toddouska 51e8abf126
Merge pull request #2531 from SparkiDev/nginx_unittest
Fix unittest to pass when compiling for NGINX
2019-10-28 11:27:22 -07:00
toddouska 28cc7daa68
Merge pull request #2511 from tmael/BN_bn2hex
Fix for hex digits with fastmath and normal integer
2019-10-23 15:10:40 -07:00
Sean Parkinson a3c09f6794 Fix unittest to pass when compiling for NGINX 2019-10-22 08:47:49 +10:00
Jacob Barthelmeh 497818525a check on keygen for make rsa key function 2019-10-21 14:54:17 -06:00
Jacob Barthelmeh 09a0859865 fix for fortress and no sha build with encrypted keys 2019-10-21 09:37:24 -06:00
Jacob Barthelmeh ea45da5fa8 change add_all_* to be evp table init and fix valgrind report 2019-10-20 01:13:43 -06:00
David Garske 0e73af8b88
Merge pull request #2515 from JacobBarthelmeh/Testing
Initial pass on test cycle
2019-10-17 16:02:17 -07:00
Jacob Barthelmeh b7d4c9f839 fix build with no server and enable all 2019-10-16 14:19:50 -06:00
Jacob Barthelmeh b4a3ad6e2d fix test case for enckeys + des3 with md5 disabled 2019-10-15 17:07:05 -06:00
Tesfa Mael 1267987c31 Review comment 2019-10-15 12:24:57 -07:00
Tesfa Mael 1a18e3bba8 Add leading zero padding for odd hex ASCII digits 2019-10-15 11:54:58 -07:00
JacobBarthelmeh 63e74554a8 fix for warning when using c++ compiler 2019-10-15 10:07:02 -07:00
Tesfa Mael 441f3a7f1f Add leading zero for odd number of hex digits 2019-10-14 16:43:45 -07:00
toddouska d30e4ac74f
Merge pull request #2499 from ejohnstown/sniffer-features
Sniffer Features
2019-10-14 15:35:55 -07:00
JacobBarthelmeh c3e99e1394
Merge pull request #2510 from tmael/bio_base64
Fix a return value from wolfSSL_BIO_BASE64_write()
2019-10-14 15:44:14 -06:00
toddouska df77088d5c
Merge pull request #2461 from kaleb-himes/ZD_5541_PathLenConstraint
addressing non RFC compliance in handling of pathLen constraint
2019-10-14 09:41:09 -07:00
Tesfa Mael ccc500e13f Correct return value from wolfSSL_BIO_BASE64_write() 2019-10-11 14:52:53 -07:00
kaleb-himes 9357db4d0c check value of ret in test cases 2019-10-11 15:27:15 -06:00
kaleb-himes 306b280ccd Add test cases and implement peer suggestions
Fix failing jenkins test cases

Add detection for file size with static memory

Account for cert without pathLen constraint set including test cases

Resolve OCSP case and test where cert->pathLen expected to be NULL
2019-10-11 15:03:38 -06:00
kaleb-himes 9c5fd165d0 addressing non RFC compliance in handling of pathLen constraint 2019-10-10 16:45:29 -06:00
David Garske d781734b55
Merge pull request #2507 from cariepointer/apache_updates
Apache updates
2019-10-10 12:45:01 -07:00
Tesfa Mael e22563ed00 BIO chain test 2019-10-09 11:38:07 -07:00
Carie Pointer d89f9ddc42 Update X509V3_EXT_print for different extension types 2019-10-09 11:10:27 -07:00
Carie Pointer b247b4565c Fixes for build warnings with apache httpd 2019-10-07 11:15:55 -07:00
John Safranek a991cc42f4 Add function wolfSSL_get_cipher_name_iana_from_suite() a wrapper around
internal API GetCipherNameIana().
2019-10-04 14:54:17 -07:00
John Safranek 87a8447f0d 1. Added a tag for global variables in environments where they aren't
shared across threads by default.
2. Set the Trace file and flag up with the shared flag.
2019-10-04 14:54:17 -07:00
toddouska 30829cec09
Merge pull request #2482 from SparkiDev/cppcheck_fixes_1
Fixes from using cppcheck tool
2019-10-04 14:39:31 -07:00
Eric Blankenhorn f47a9c8b20 Add conditional to 64-bit tests 2019-10-04 09:41:48 -05: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 34e0eb498a Fix for `X509_set_subject_name` and `X509_set_issuer_name` API unit test macro enables. 2019-09-26 08:42:35 -07:00
David Garske 606b76d06e Fix for WPAS certificate size difference. Fix so BIO_METHOD is compatible. Moved BIO stuff into bio.h. 2019-09-26 08:42:35 -07:00
David Garske a5f9d38c0d Remove the BIO method custom... its not compat. Fix bio->ptr to be `void*`. 2019-09-26 08:42:35 -07:00
David Garske 872d222b59 * Adds the following openssl compatibility API's:
- SSL_CIPHER_get_id
  - SSL_CIPHER_get_rfc_name
  - SSL_get_cipher_by_value
  - X509_print_ex
  - X509_NAME_add_entry_by_NID
  - X509_time_adj
  - X509_time_adj_ex
  - DTLSv1_get_timeout
  - DTLSv1_handle_timeout
  - DTLSv1_set_initial_timeout_duration
  - SSL_CTX_set_current_time_cb
  - PEM_write_bio_RSA_PUBKEY
  - PEM_read_bio_RSA_PUBKEY
  - PEM_write_bio_PUBKEY
  - EVP_PKEY_missing_parameters
  - EVP_PKEY_cmp
  - BN_is_negative
  - BIO_set_retry_write
* Improvements to the notBefore and notAfter date handling.
* Improvements to BIO and BIO_METHOD
  - Moved structure to public area to allow for dereferencing
  - Renamed members to provide compatibility.
  - Added support for custom BIO methods for read/write.
* Added advanced openssl compatibility test cases for key and certificate generation.
* Fix for `ASN1_STRING_set` to allow NULL data.
* Fix to populate public key information on `EVP_PKEY_assign_RSA` and `EVP_PKEY_assign_EC_KEY`.
* Fix naming for `X509_get_notBefore` and `X509_get_notAfter` functions.
* Added `wc_EccPublicKeyDerSize`.
* Improvements to `wc_RsaPublicKeyDerSize`, so dummy memory doesn't have to be allocated.
* Made the `wc_*PublicKeyDerSize` functions public.
* Eliminate use of snprintf for UTC to generalized time conversion in `wolfSSL_ASN1_TIME_to_generalizedtime`.
2019-09-26 08:42:35 -07: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
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
David Garske 6aecdf59c1 Fixes for async build and tests. 2019-09-19 12:30:05 -07: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
toddouska d6685edfa0
Merge pull request #2440 from SparkiDev/tlsfuzzer_fixes
Fixes for fuzz testing
2019-09-05 09:01:10 -07:00
toddouska eaeaaf12c1
Merge pull request #2446 from SparkiDev/gplusplus_fix_1
Fixes for g++ compilation
2019-09-04 16:28:42 -07:00
Sean Parkinson 56df8162bd Fixes for g++ compilation 2019-09-04 10:09:36 +10:00
toddouska 492ce6ac91
Merge pull request #2414 from dgarske/pkcs8_asn1
Added support for loading a PKCS8 ASN.1 formatted private key
2019-09-03 15:36:31 -07:00
Sean Parkinson 60befc82c5 Fixes for fuzz testing
Changes
- Don't ignore decryption errors when doing TLS 1.3 and after Client
Finished.
- Put out an alert when TLS 1.3 decryption fails.
- Properly ignore RSA pss_pss algorithms when checking for matching
cipher suite.
- Check X25519 public value before import in TLS v1.2-
- REcognise TLS 1.3 integrity-only cipher suites as not negotiable with
TLS 1.2-.
- Send decode_error alert when bad message data in CertificateVerify.
- Negotiate protocol version in TLS 1.3 using extension and keep
decision when using TLS 1.2 parsing.
- Must have a signature algorithms extension in TLS 1.3 if not doing
PSK.
- More TLS v1.3 alerts.
- MAX_PSK_ID_LEN needs to be modified at compile time for tlsfuzzer to
work.
- change the good ecc public key to be a real public key when compiled
to check imported public keys
- Fix early data in TLS 1.3
- Make max early data size able to be changed at compile time - default
4K but fuzzer sends 16K
- Fix HRR, PSK and message hashes: Don't initialize hashes in parsing
ClientHello as need to keep hash state from previous ClientHello and
HelloRetryRequest
2019-09-02 08:58:14 +10:00
toddouska adc548fc61
Merge pull request #2428 from ejohnstown/ecckey-test-fix
Fix ECC key decode test
2019-08-30 11:07:00 -07:00
tmael b8d2ccee83
Merge branch 'master' into phase2_compatibility_APIs 2019-08-29 09:16:41 -07:00
toddouska 9034e3a0fe
Merge pull request #2432 from embhorn/api_p2
Adding compatibility API phase 2
2019-08-29 09:05:01 -07:00
JacobBarthelmeh 411f15bec3
Merge pull request #2429 from cconlon/cmssig
Add internal PKCS7 content digest check
2019-08-28 09:41:10 -06:00
Eric Blankenhorn 0c9ba1b361 Adding compatibility API phase 2 2019-08-28 09:29:49 -05:00
John Safranek 7fcb85b743 ECC-FP Cache Memory Leak
Each test case for ECC should be cleaning up the FP cache if it uses
the cache. Only a couple cases were getting freed.
2019-08-27 14:43:25 -07:00
toddouska a49f447e47
Merge pull request #2413 from dgarske/load_ca_nodate
Refactor of the verify option for processing X.509 files
2019-08-27 13:20:30 -07:00
Tesfa Mael 00dadafddb Add HAVE_FAST_RSA around RSA_print() 2019-08-26 16:54:10 -07:00
Tesfa Mael 9b3fee223f Typecast to correct type 2019-08-26 14:17:13 -07:00
Tesfa Mael 6311ae425c RSA_generate_key() needs WOLFSSL_KEY_GEN 2019-08-26 13:47:54 -07:00
Tesfa Mael 5e28dd94a2 OpenSSL compatible APIs:
ASN1_STRING_type
EVP_aes_128_gcm
EVP_CIPHER_CTX_ctrl
EVP_PKEY_sign
EVP_PKEY_sign_init
RSA_print
RSA_NO_PADDING
RSA_PKCS1_PSS_PADDING
2019-08-26 12:20:18 -07:00
Chris Conlon 61d01ab7f3 add unit test for PKCS7 invalid detached content 2019-08-26 09:43:20 -06:00
toddouska 2c97b040ff
Merge pull request #2419 from dgarske/ctx_sec_reneg
Adds use secure renegotiation at CTX level
2019-08-23 12:55:30 -07:00
David Garske 67c3751836 Adds new `wolfSSL_CTX_UseSecureRenegotiation` API for setting secure renegotiation at the WOLFSSL_CTX level. 2019-08-20 16:43:28 -07:00
David Garske 24bfea1ad2 Fixes for various build options (!NO_RSA, HAVE_ECC, NO_PKCS8, NO_PKCS12). Added new `NO_CHECK_PRIVATE_KEY` to allow reduce code size when not required. 2019-08-20 10:38:08 -07:00
David Garske 644e7a8f45 Fixes for PKCS8 w/wo encryption as DER/ASN.1. Fixes for building with `--disable-oldnames`. Fix to enable the PKCS8 enc test without openssl comat. Added additional PKCS8 tests. 2019-08-19 16:27:46 -07:00
Jacob Barthelmeh 01a3b59e28 fix cast and initialization of variable 2019-08-19 14:54:53 -06:00
David Garske 3e1c103c78 Added support for loading a PKCS8 ASN.1 formatted private key (not encrypted). 2019-08-16 16:09:00 -07:00
David Garske 586b74b05f Refactor of the verify option for processing X.509 files. Adds support for ignoring date checks when loading a CA using the `WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY` flag on `wolfSSL_CTX_load_verify_buffer_ex` and `wolfSSL_CTX_load_verify_locations_ex`. 2019-08-16 15:19:55 -07:00
Jacob Barthelmeh 487e66394e adjust wc_i2d_PKCS12 API 2019-08-16 15:19:33 -06:00
toddouska 489af0cd2b
Merge pull request #2386 from SparkiDev/tls13_integ_only
TLS 1.3 and Integrity-only ciphersuites
2019-08-15 16:02:12 -07:00
toddouska b06dbf16c2
Merge pull request #2397 from JacobBarthelmeh/PKCS7
updates to CMS and callback functions
2019-08-15 15:56:41 -07:00
Eric Blankenhorn 1b841363cc Adding tests 2019-08-15 12:27:23 -05:00
Eric Blankenhorn b2b24a06f3 Adding API 2019-08-14 15:09:17 -05:00
Eric Blankenhorn 48fa6a458c Adding compatibility API phase 1 2019-08-13 17:09:56 -05:00
Tesfa Mael 1371fc8327 Review comments 2019-08-06 13:23:18 -07:00
Tesfa Mael eccc85b9fa Add NO_RSA conditional 2019-08-05 17:51:31 -07:00
Tesfa Mael f5f5947616 New OpenSSL compatible APIs:
wolfSSL_PEM_write_bio_PKCS7
wolfSSL_PKCS7_SIGNED_new
wolfSSL_X509_subject_name_hash
wolfSSL_CTX_use_PrivateKey_ASN1
wolfSSL_get0_param
wolfSSL_X509_VERIFY_PARAM_set1_host
2019-08-05 17:35:37 -07:00
Jacob Barthelmeh 99ddf65a96 add decrypt callback to wc_PKCS7_DecodeEnvelopedData 2019-08-05 10:49:15 -06:00
David Garske e83116fc0b Resolution for FIPS/CAVP build errors where `wc_ecc_get_curve_params` is not present in older wolfSSL versions. 2019-08-02 13:25:11 -07:00
David Garske d1fbdb3ddf Added API unit test for `wc_ecc_get_curve_params`. 2019-08-02 06:20:14 -07:00
Sean Parkinson 51dfc35aac TLS 1.3 and Integrity-only ciphersuites 2019-08-02 11:00:18 +10:00
Jacob Barthelmeh 589b056ecb update gitignore and location of test cleanup 2019-07-23 09:27:39 -06:00
Jacob Barthelmeh aec980b803 fix for initialize PKCS7 structure with signer 2019-07-19 16:23:14 -06:00
John Safranek 3aad9a2673 FIPS Macro Fix
In a couple places the label WOLFSSL_FIPS was getting checked. Changed
to the correct HAVE_FIPS instead.
2019-07-17 15:35:12 -07:00
John Safranek c3c705f82b FIPS, HMAC, and PKCS8
One of the tests for PKCS8 depended on keys encrypted with a password
that has only 8 letters. HMAC in FIPS mode requires a minimum of 12
bytes. Disabled that test case when FIPS is enabled. All components do
get tested just not all together in that case.
2019-07-17 15:35:12 -07:00
JacobBarthelmeh 8bf8fcca60
Merge pull request #2352 from dgarske/async_v4.1
Fixes for Asynchronous support in v4.1
2019-07-16 17:32:18 -06:00
David Garske 7b021d68c3 Fixes for asynchronous support in v4.1:
* Fixes PK callback null dereference.
* Fixes `DoCertificateVerify` verify handling.
* Fixes build issue with API tests.
2019-07-16 11:56:02 -07:00
Chris Conlon 2e308ea82c
Merge pull request #2260 from JacobBarthelmeh/PKCS7
PKSC7 firmware revision + callback / get SID
2019-07-16 10:51:38 -06:00
toddouska d620433d1d
Merge pull request #2209 from tmael/maintenanceDefects
Increased ciphers buffer size for testsuite and ECC API for getting curve from dp
2019-07-15 16:49:13 -07:00
Jacob Barthelmeh 6e6c93624a free test RSA key after use 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh 60fc9b3a1d add test for manual verify 2019-07-15 12:32:19 -06:00
Jacob Barthelmeh d33a95352a fix check on ret value and add test case 2019-07-15 12:32:19 -06:00
toddouska baf65f4f43
Merge pull request #2327 from JacobBarthelmeh/Compatibility-Layer
add wolfSSL_PEM_write_DHparams implementation
2019-07-08 12:58:10 -07:00
toddouska 2a4b935e07
Merge pull request #2299 from JacobBarthelmeh/DTLS-MultiCore
DTLS export/import state only
2019-07-08 12:47:13 -07:00
Jacob Barthelmeh ab9d89cb31 cast on return and move location of function declaration 2019-07-03 15:20:08 -06:00
Jacob Barthelmeh 02871d5ed4 add test case for wolfSSL_PEM_write_DHparams 2019-07-03 13:32:21 -06:00
Chris Conlon f51a8fffde
Merge pull request #2265 from JacobBarthelmeh/Testing
fix check on ret value and add test case
2019-06-27 14:02:01 -06:00
Jacob Barthelmeh cb4f9afd6d free memory in test case 2019-06-25 15:24:39 -06:00
Jacob Barthelmeh 0e3881d418 add test case for state only export on DTLS session 2019-06-24 16:08:12 -06:00
David Garske dd9dd6306e API unit test fix to remove improperly placed `wolfSSL_Cleanup()` call in `test_for_double_Free`. This caused erronous report with `fsanitize=address`. 2019-06-18 16:22:19 -07:00
Tesfa Mael 25aeb8238e Addressed review comment about id being undefined 2019-06-04 16:05:57 -07:00
Jacob Barthelmeh 9fbe471156 fix check on ret value and add test case 2019-06-03 07:52:50 +07:00
Jacob Barthelmeh 88bf5d9676 add sanity check on buffer index and regression tests
macro guards on use case and adjustment for memory size

gcc-8 warning fix

adjustement to default memory bucket sizes
2019-05-14 15:55:24 -06:00
toddouska 5e343b8e7e
Merge pull request #2201 from dgarske/siglen
Improvements to the maximum ECC signature calculations
2019-05-01 15:42:12 -07:00
David Garske 86101468fc Fixes for know wolfSSL build issues in the following cases:
* Fixes for building wolfSSL from GitHub sources download, where .git does exist. The autogen.sh still needs to "touch" files for the build to work.
* Fix for FIPS case where `wc_RsaSetRNG` is not available.
* Added new `./configure --enable-usersettings` option to not populate the Makefile with build options and instead define `WOLFSSL_USER_SETTINGS` and expect a user provided `user_settings.h` file.
* Fix for `HAVE___UINT128_T` to match config.h generated value to eliminate warning.
2019-04-30 11:45:48 -07:00
Tesfa Mael dfde631cb2 Free key at the end of the test 2019-04-24 11:49:53 -07:00
Tesfa Mael edef75c70f Wrapped new unit test API with FIPS macros 2019-04-24 10:02:20 -07:00
Tesfa Mael 6b51f2d5b2 Added unit test for wc_ecc_get_curve_id_from_dp_params 2019-04-23 16:45:52 -07:00
Jacob Barthelmeh 29101a29c9 free key in test case, initialize variables fix, macro guard on iana use 2019-04-19 09:47:15 -06:00
Jacob Barthelmeh ec2849b885 macro guard on EncodePolicyOID use 2019-04-18 14:56:24 -06:00
Jacob Barthelmeh efc96e40d1 add test cases 2019-04-18 10:41:51 -06:00
Chris Conlon e4555b5bf5 add wolfTLSv1_3_method() 2019-04-18 09:31:01 -06:00
David Garske bd618970c1 Fixed API unit test for `wc_ecc_sig_size` to allow smaller result. 2019-04-12 12:36:20 -07:00
toddouska b224f6fac9
Merge pull request #2181 from JacobBarthelmeh/Compatibility-Layer
update wolfSSL_i2d_RSAPrivateKey function
2019-04-03 09:16:10 -07:00
Hideki Miyazaki 6968797848 fixed jenkins test failure 2019-03-30 01:35:35 +09:00
Hideki Miyazaki 1c22f14d1c added unit test for session resumption re-using WOLFSSL obj 2019-03-29 20:13:41 +09:00
Jacob Barthelmeh b599dc2b9d update wolfSSL_i2d_RSAPrivateKey function 2019-03-28 14:15:57 -06:00
John Safranek 9ea2dbea95
Merge pull request #2172 from dgarske/atecc
Fixes for ATECC support
2019-03-28 10:36:54 -07:00
JacobBarthelmeh 8c6316eb9c
Merge pull request #2179 from kojo1/X509_STORE_CTX
X509_STORE_CTX_free compatibility
2019-03-27 17:17:26 -06:00
John Safranek f493ff859c
Merge pull request #2178 from JacobBarthelmeh/Testing
add guard on test case for pkcs7 with no aes
2019-03-25 09:42:54 -07:00
JacobBarthelmeh 6b325929e5
Merge pull request #2175 from kojo1/BN_init
add BN_init
2019-03-25 09:04:36 -06:00
Takashi Kojo 3e42c6edcd remove sk_X509_free for compatibility 2019-03-24 16:57:08 +09:00
Jacob Barthelmeh 3d747f7c87 add guard on test case for pkcs7 with no aes 2019-03-22 15:56:05 -06:00
David Garske f66aa60385 Fix for build warning with x/y always true when not building with ALT_ECC_SIZE. Fix for build error with undefined `wc_ecc_sign_hash_ex` when building ATECC and `WOLFSSL_PUBLIC_MP`. 2019-03-21 09:13:39 -07:00
Takashi Kojo 384b240ea2 minor fix in test_wolfSSL_BN(), api.c 2019-03-17 13:37:17 +09:00
Takashi Kojo 6a3eccd344 add BN_init, working with tfm, only. 2019-03-17 13:28:04 +09:00
John Safranek 1ac74b0061 Release Fixes
1. Added some typecasting for g++ v8 permissive pointer use errors with void*.
2019-03-15 16:26:11 -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 0ef4b7e933
Merge pull request #2164 from JacobBarthelmeh/PKCS7
adjust location of where PKCS7 content is saved
2019-03-15 09:40:17 -07:00