Commit Graph

1193 Commits (75c062a2984f70d15f675086c29cd8037cc24d7d)

Author SHA1 Message Date
Juliusz Sosinowicz 77969ae042 Buffer AAD in wolfSSL_EVP_CipherUpdate_GCM so that whole value is hashed 2020-09-22 21:58:57 +02:00
Ethan Looney 53b82fccdb Fixed valgrind issues -2 2020-09-22 13:26:52 -06:00
Jacob Barthelmeh cb3338bd57 fix WOLFSSL_X509_NAME parse of empty feild and add test case 2020-09-21 18:44:13 -06:00
Sean Parkinson f4db9c8986 Test wolfSSL_HMAC with SHA-3
Add more support for HMAC with SHA-3.
2020-09-22 09:39:09 +10:00
Takashi Kojo 83cdd1c314 fix NO_DH guard 2020-09-22 07:30:21 +09:00
Daniel Pouzzner a1d231b4dc tests/api.c:test_wolfSSL_ERR_print_errors(): add missing gating on !defined(NO_ERROR_STRINGS). 2020-09-17 12:03:44 -05:00
Daniel Pouzzner cc1d016d1e configure.ac: define BUILD_TESTS as ENABLED_EXAMPLES, rather than ENABLED_EXAMPLES && !ENABLED_LEANTLS; add missing preprocessor gating in tests/api.c test_wolfSSL_EVP_Digest() and test_wolfSSL_i2d_PrivateKey(). 2020-09-17 12:03:44 -05:00
toddouska a3fca7f593
Merge pull request #3247 from JacobBarthelmeh/Compatibility-Layer
Compatiblity Layer Fixes for serial number / ASN1 time / and order of name components
2020-09-16 14:53:51 -07:00
Ethan Looney da4478bdf1 Fixed valgrind issues 2020-09-15 12:58:52 -06:00
Ethan Looney a466a57f1d Added fips check and cast variable to word32 2020-09-11 14:28:10 -06:00
Ethan Looney 7dce2e7f2c Added unit tests for RSA.c 2020-09-10 14:47:51 -06:00
toddouska 7fd51cf9d9
Merge pull request #3267 from SparkiDev/no_client_auth
Get builds with WOLFSSL_NO_CLIENT_AUTH compiling and testing
2020-09-03 15:55:38 -07:00
toddouska db805524de
Merge pull request #3248 from SparkiDev/aes_cbc_oob
AES-CBC check for input size of 0
2020-09-03 13:40:34 -07:00
Jacob Barthelmeh 682b1468b8 free test certificate when test is done 2020-09-02 16:05:05 -06:00
toddouska b3acd57de5
Merge pull request #3254 from dgarske/leaks
Fixes valgrind leak reports (related to small stack cache)
2020-09-02 10:44:49 -07:00
toddouska 9268de229a
Merge pull request #3266 from dgarske/unit_test
Fix for DH compute key compatibility function failure
2020-09-02 10:23:23 -07:00
JacobBarthelmeh 914905f1bc
Merge pull request #3193 from embhorn/zd10457_b
Fix CheckHostName matching
2020-09-02 10:36:02 -06:00
Jacob Barthelmeh fd2074da00 fix for order of components in issuer when using compatiblity layer api to generate cert 2020-09-01 09:27:45 -06:00
Sean Parkinson 89b9a77eca Get builds with WOLFSSL_NO_CLIENT_AUTH compiling and testing
Fix build for no client or server and no client auth.
Fix tests to detect when no client auth compiled and test is trying to
do client auth.
2020-09-01 15:27:46 +10:00
David Garske c587ff72d2 Fix for occasional unit.test failure in `test_wolfSSL_EVP_PKEY_derive`. 2020-08-31 14:04:51 -07:00
Ethan Looney 568184f53f Changed len from hardcoded value to sizeof oid 2020-08-31 13:42:23 -06:00
Ethan Looney c8d93d4d5e Added ecc.c unit tests to api.c 2020-08-31 13:42:23 -06:00
Eric Blankenhorn ea5c290d60 Fix CheckHostName matching 2020-08-26 14:03:17 -05:00
David Garske 1b2b3de2c9 Fixes for missing free calls on hash tests. 2020-08-26 09:48:46 -07:00
David Garske 6d5731b8e9 Fixes for HMAC_CTX cleanup not being called to free SHA2 resources with `WOLFSSL_SMALL_STACK_CACHE`. Added return code checking and cleanup for `openssl_test`. 2020-08-26 09:45:26 -07:00
Jacob Barthelmeh bc58dde700 fix for serial number containing 0's and for RNG fail case 2020-08-26 00:03:39 -06:00
Sean Parkinson 3a25faea60 AES-CBC check for input size of 0
Don't need to do anything when size is 0.
2020-08-25 13:36:45 +10:00
Jacob Barthelmeh c7136498ec add test case 2020-08-24 17:19:03 -06:00
David Garske 3fbaccc8a1 Fix for API unit test `test_wolfSSL_X509_sign`, which can have a varying length depending on if MSB is set. About 1 in 200 tests would fail. 2020-08-20 15:33:28 -07:00
David Garske 1d55b2f526 Fixes for several memory leaks related to `HAVE_WOLF_BIGINT`. 2020-08-20 14:25:06 -07:00
toddouska 028bddd7ab
Merge pull request #3215 from ejohnstown/release-4.5.0
Release Update
2020-08-17 13:51:23 -07:00
John Safranek 3f6861ee82
FIPS Ready Fix with ECC Timing Resistance
Commit 6467de5 added some timing resistance to ECC shared secret
agreement. It involved adding an RNG object to the ecc keys so
a random z value can be added to the mix. The older FIPS release
has ECC outside the boundary, so it uses the new ECC code. FIPSv2
has ECC inside the boundary, but all the TLS code checks for that
version of FIPS and leaves out the calls to the new functions as
it is using an older version of ecc.c. FIPS Ready uses the latest
version of ecc.c but compiles as FIPSv2. So, the code outside of
the crypto layer is treating ECC as FIPSv2 and not calling the new
functions, but the crypto layer assumes the RNG should be present,
and errs out on testing.
1. Added a separate option for FIPS Ready to the enable-fips
   configure option. `--enable-fips=ready`. It will treat FIPS
   Ready as the next kind of FIPS release. FIPS Ready will be
   treated like FIPS v3 in the build.
2. Changed the C preprocessor checks for FIPS version 2 to be
   checks for not version 2, with respect to ECC Timing Resistance
   and FIPS builds.
2020-08-14 10:54:55 -07:00
Sean Parkinson bc74bfebdd Fixes from C++ and address access checking
Fix access of table for cache resistance.
Don't name variable public or private.
Cast from void*
2020-08-13 15:19:49 +10:00
toddouska fa146870bd
Merge pull request #3155 from julek-wolfssl/openssh-fixes-cherry-picked
Additional OpenSSL compat stuff for OpenSSH
2020-08-11 16:32:31 -07:00
toddouska 532c2f50e8
Merge pull request #3083 from julek-wolfssl/openssl-compat-X509V3_EXT_i2d
Implement more OpenSSL compatibility functions
2020-08-11 15:01:41 -07:00
Sean Parkinson 6467de5a88 Randomize z ordinates in scalar mult when timing resistant
An RNG is required for shared secret calculation now.
Use wc_ecc_set_rng() to set an RNG against the ECC object.
ECC verification does not need timing resistance and does not randomize
z ordinates.
2020-08-11 16:12:47 +10:00
Juliusz Sosinowicz 55d4817956 Jenkins fixes 2020-08-10 12:39:16 +02:00
Sean Parkinson 7bb2a69161 Fix memory leak in api.c
When testing wc_ecc_import_raw(), the mp_int's in the ecc object are
initialized.
For small math, this throws away the allocated buffer.
Must free the object before importing.
2020-08-10 12:42:46 +10:00
Sean Parkinson 920c97963c Fix Jenikins failure - ToTraditional not declared
./configure --disable-asn --disable-ecc -disable-rsa --enable-psk
--enable-testcert
2020-08-10 10:57:07 +10:00
David Garske c0a664a8e5
Merge pull request #3200 from douzzer/20200805
Add an error-checking wc_curve25519_make_pub() routine to the API for use by Wireguard
2020-08-07 16:32:52 -07:00
toddouska 1724347f7a
Merge pull request #3091 from julek-wolfssl/sess-serialization
Expose session serialization outside of `OPENSSL_EXTRA`
2020-08-07 15:41:27 -07:00
toddouska 17cc941b29
Merge pull request #3195 from SparkiDev/sp_ecc_cache
SP ECC Cache Resitance
2020-08-07 15:35:06 -07:00
JacobBarthelmeh dd6238fb77
Merge pull request #3174 from embhorn/zd10655
Fix CheckAltNames to handle IP type
2020-08-07 16:04:56 -06:00
Chris Conlon b03e1dd2a9
Merge pull request #3197 from ethanlooney/19th_branch
Added asn.c unit tests
2020-08-07 09:25:50 -06:00
Eric Blankenhorn 064bfa583d Fix CheckAltNames to handle IP type 2020-08-07 10:12:56 -05:00
Daniel Pouzzner f6acbd5f97 test_wc_curve25519_make_pub(): fix order of args to wc_curve25519_make_pub(). 2020-08-06 18:37:00 -05:00
toddouska 82d927d40f
Merge pull request #3199 from dgarske/openssl_sha
Fix for building openssl compat without SHA-1
2020-08-06 15:59:26 -07:00
Daniel Pouzzner 0f59e632e1 tests/api.c: add test_wc_curve25519_make_pub(); fix some old stray tabs; remove weird extra string-terminating null in test_wolfSSL_sk_CIPHER_description(). 2020-08-06 17:52:48 -05:00
toddouska 4e9d49556e
Merge pull request #3194 from SparkiDev/unit_fix_1
Fix unit.test to not fail randomly
2020-08-06 10:51:12 -07:00
Ethan Looney 77bb300409 Removed unnecessary pointers, matched Xfree arugments and checked the return values of generated keys 2020-08-06 09:21:41 -07:00
Ethan Looney afcb40724e Added proper ifdef's to EccPrivateKeyToDer 2020-08-06 08:06:06 -07:00
Juliusz Sosinowicz 139a192185 Implement wolfSSL_d2i_X509_NAME 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz ca3a608408 Implement functions
- `wolfSSL_d2i_ECPrivateKey`
- `wolfSSL_EC_POINT_add`
- `wolfSSL_EC_POINT_invert`
2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz 2529ce21b0 Implement wolfSSL_EC_GROUP_dup 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz ea8dd31de0 Implement wolfSSL_i2d_PUBKEY and refactor wolfSSL_i2d_PrivateKey 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz 1f0d6d5f31 New functions implemented
- `EC_POINT_is_on_curve`
- `i2d_EC_PUBKEY`
- `i2d_ECPrivateKey`
- `wc_ecc_point_is_on_curve`
2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz e131d6be5b group->curve_nid is now set to the real NID of the curve 2020-08-06 15:52:11 +02:00
Juliusz Sosinowicz c28b7b59c3 Fix jenkins leaks 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz ad2e710563 Fix missing free 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz a6651a21f8 Fix segfault 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz 229c5e9563 wolfSSL_X509V3_EXT_i2d cont. 2020-08-06 13:47:26 +02:00
Juliusz Sosinowicz fe1f815761 wolfSSL_X509V3_EXT_i2d: NID_ext_key_usage 2020-08-06 13:45:36 +02:00
Juliusz Sosinowicz 3621af9996 Implement new OpenSSL API
- i2d_PKCS8PrivateKey_bio
- X509V3_EXT_i2d
- SSL_renegotiate_pending
2020-08-06 13:45:36 +02:00
David Garske 4a167c0f2c
Merge pull request #3119 from tmael/do178-fix
DO-178 fix
2020-08-05 16:30:00 -07:00
Sean Parkinson 8afd629a30 Fix unit.test to not fail randomly
Get the serial number from the certificate to calculate the encoding size.
Fix making of the certificate to copy serial number out if not already set.
2020-08-06 08:52:21 +10:00
Ethan Looney 9671901de6 Added a free call to SetSubjectBuffer 2020-08-05 15:52:09 -07:00
Sean Parkinson 83caf39caa SP ECC Cache Resitance
SP ECC improved cache attack resistant implementation.
On by defualt and turn off with WC_NO_CACHE_RESISTANT.
2020-08-06 08:21:08 +10:00
David Garske c421445ba9 Added no SHA-1 hash support for OPENSSL compatibility. Fix for `./configure --enable-opensslextra --disable-sha`. This allows using SHA2-256 for the hashing including the derived `issuerHash` and `subjectHash`. Adds issuer hash openssl compatibility function `X509_issuer_name_hash`. 2020-08-05 14:43:24 -07:00
Ethan Looney 49e5d8efea Added additional ifdef's to Ed25519 functions and cast derSz to word32 2020-08-05 12:31:50 -07:00
Ethan Looney 633e950942 Added asn.c unit tests 2020-08-05 10:57:32 -07:00
Ethan Looney 42856287ee Added check for wolfmath.c for digits == 0 and test for api.c 2020-08-04 13:25:10 -07:00
Chris Conlon 5641e2ae50
Merge pull request #3173 from ethanlooney/18th_branch
Added unit tests for wolfmath.c
2020-08-04 09:10:21 -06:00
Ethan Looney 7f381275b1 Removed comment and changed len equal to variables instead of numbers 2020-08-03 13:31:11 -07:00
David Garske 776b1a2d17 Fix for ED25519 with user_settings.h. Fixes for build warnings. Fix spelling error. Added template for wolfBoot key/sign tools. 2020-07-31 15:17:53 -07:00
Ethan Looney b627610cde Added bad test cases for get_digit and corrected comment formatting 2020-07-31 09:44:10 -07:00
Ethan Looney c52930bb8a Added freerng to 'test_mp_rand' 2020-07-30 09:37:05 -07:00
Tesfa Mael d03971e233 Add comment to clarify errno in test 2020-07-30 09:18:45 -07:00
Tesfa Mael cebb283822 DO-178 changes 2020-07-30 09:18:45 -07:00
Ethan Looney 3381eb2094 Added tests for Sha512.c 2020-07-30 09:18:45 -07:00
Chris Conlon 1168bdd05b
Merge pull request #3165 from ethanlooney/17th_branch
Added unit tests for wc_port.c
2020-07-30 09:08:28 -06:00
Ethan Looney b4cd0886bb Changed test returns for 'get_digit' to remove implicit conversion errors 2020-07-29 14:23:03 -07:00
Ethan Looney 7c59c74e07 Added unit tests for wolfmath.c 2020-07-29 10:34:15 -07:00
Ethan Looney b524926837 Deleted unneeded xfopen and xfclose 2020-07-29 09:31:37 -07:00
toddouska e618257f21
Merge pull request #3167 from dgarske/test_fixups
Fixes for `mutex_test` and API unit test `derSz`
2020-07-28 16:45:58 -07:00
Chris Conlon 70aa11f0a9
Merge pull request #3153 from ethanlooney/15th_branch
Added unit tests for Logging.c
2020-07-28 16:35:31 -06:00
Ethan Looney 5af4872bab Changed lock type to 0 2020-07-28 09:16:43 -07:00
David Garske 8440973d99 Fix for `derSz` calculation on non-const value `keySz`. ZD 10654 2020-07-28 08:18:42 -07:00
Ethan Looney e7429c8504 Added unit tests for wc_port.c 2020-07-27 09:32:25 -07:00
Chris Conlon b0ed250f09
Merge pull request #3162 from ethanlooney/18th_branch
Changed ifndef(NO_SHA224) to ifdef(WOLFSSL_SHA224)
2020-07-27 09:21:28 -06:00
Ethan Looney b734b13120 Changed ifndef(NO_SHA224) to ifdef(WOLFSSL_SHA224) due to 'NO_SHA224' not existing 2020-07-24 14:24:50 -07:00
Ethan Looney 6088a7bd79 Added if defined debug check to only print to file if debug is enabled 2020-07-24 10:03:49 -07:00
Ethan Looney 563806c497 Changed the log dump txt file's directory to include /tests and added it to make clean 2020-07-23 10:12:40 -07:00
Ethan Looney f7e4c1c8ad Added SetLoggingCb check 2020-07-22 15:44:13 -07:00
Ethan Looney 5e515c12fb Removed unneeded comment 2020-07-22 08:28:43 -07:00
John Safranek c8e9d058f0
DTLS Test Speedup
Change the example client to use select instead of sleep.
If building for the standalone client, it will wait 1 second.
If built for no main driver, it'll wait 10ms rather than 1 second.
2020-07-21 18:40:18 -07:00
Ethan Looney 953e7cf181 Changed sz type from int to long 2020-07-21 15:28:17 -07:00
Ethan Looney b500a54fc5 Added new file to read in and dump error message and added cleanup within cleanup script 2020-07-21 12:30:43 -07:00
Ethan Looney e8034619ba Add more if defined to ERR_print_errors_fp 2020-07-21 12:30:43 -07:00
Chris Conlon ddb2923c19
Merge pull request #3133 from ethanlooney/13th_branch
Added unit tests for Hash.c - Fixed hash formatting errors
2020-07-20 10:03:28 -06:00
Chris Conlon 86745dd7fc
Merge pull request #3134 from ethanlooney/14th_branch
Added unit tests for Random.c
2020-07-20 10:02:22 -06:00
Ethan Looney ef71099225 Removed duplicate semicolon and deleted unneeded initrng 2020-07-17 10:34:38 -07:00
Ethan Looney 93c6e99aef Added a ret check 2020-07-17 08:45:39 -07:00
Ethan Looney 96e59118fc Changed the if defined order and to include fips and selftest 2020-07-16 15:50:03 -07:00
Ethan Looney 2275b89654 Removed unnecessary comments and added HashInit's and checked that they returned errors when they should 2020-07-16 12:38:55 -07:00
toddouska 9137794cb4
Merge pull request #3105 from embhorn/zd10457_a
Adding wolfSSL_X509_check_ip_asc
2020-07-16 10:53:27 -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
Ethan Looney d54a51cd20 Added if not defined wc_no_rng 2020-07-15 13:56:12 -07:00
Ethan Looney 7a642e2b78 Added unit tests for Random.c 2020-07-15 12:55:19 -07:00
Ethan Looney 6be76e84ec Fixed formatting for Shake256Hash 2020-07-15 12:52:17 -07:00
Ethan Looney 9a07df9631 Changed hash size to 144 for Shake256Hash 2020-07-15 12:52:17 -07:00
Ethan Looney 379212acec Initialized variable data 2020-07-15 12:52:17 -07:00
Ethan Looney aaa6e892da Added unit tests for hash.c 2020-07-15 12:52:17 -07:00
Eric Blankenhorn 525a3cb9c3 Move API out of OPENSSL_EXTRA 2020-07-15 10:48:11 -05:00
Eric Blankenhorn d1a82589f9 Adding wolfSSL_X509_check_ip_asc 2020-07-15 10:48:11 -05:00
Chris Conlon 4938baa892
Merge pull request #3121 from ethanlooney/12th_branch
Added unit tests for Sha3.c
2020-07-13 17:29:45 -06:00
Ethan Looney c5b8181005 Added a free call for shake256_copy 2020-07-13 09:58:00 -07:00
Chris Conlon ed9648770d
Merge pull request #3120 from ethanlooney/11th_branch
Added unit tests for Sha512.c
2020-07-10 17:12:23 -06:00
Jacob Barthelmeh 2aaeb2a2df fix X509 multiple OU's and refactor 2020-07-10 17:12:20 -06:00
Ethan Looney 84aa7d746a Added unit tests for Sha3 2020-07-10 15:43:08 -07:00
Ethan Looney 295aa4ac55 Added tests for Sha512.c 2020-07-10 10:15:32 -07:00
Tesfa Mael 890500c1b1 Fix Coverity 2020-07-08 08:20:43 -07:00
TakayukiMatsuo 1e94f0478c Added resetting size info output-buffer before calling export APIs
Added resetting size into output-buffer before calling export APIs
2020-07-08 08:20:43 -07:00
toddouska c8dcd59565
Merge pull request #3082 from JacobBarthelmeh/Testing
restrict the cert version allowed
2020-07-07 15:37:01 -07:00
Ethan Looney 296b562113 Fixed formatting and forgotten curly bracket 2020-07-06 12:33:06 -07:00
Ethan Looney 1b7a96627c Changed formatting 2020-07-06 12:05:55 -07:00
Ethan Looney dfde73620c Added if defined cases for tests using hashes 2020-07-06 08:07:03 -07:00
Ethan Looney 5f3a287a6a Added tests to sha256.c for sha224 and sha256. 2020-07-02 14:30:30 -07:00
Ethan Looney 3242fa3669 Fixed formatting, redundant if's and added a comment explaining why a value was chosen. 2020-07-01 16:01:50 -07:00
Juliusz Sosinowicz fd79ebfe8d TLS 1.3 requires chacha and poly1305 for myTicketEncCb 2020-07-01 20:24:50 +02:00
Ethan Looney f526a11126 Added additional tests for curve25519 and fixed a print format error from previous tests 2020-07-01 10:19:40 -07:00
Ethan Looney a59560a1d5 Added tests to curve25519.c and fixed a print error from previous curve25519 tests 2020-07-01 09:32:03 -07:00
Ethan Looney 4ad904909c Added a return check 2020-06-30 12:40:20 -07:00
Ethan Looney 78efb48acf Added two more tests to hit xmemset lines 2020-06-30 12:40:20 -07:00
Ethan Looney b7e682e677 Added more tests to api.c for curve448 2020-06-30 12:40:20 -07:00
Chris Conlon 94654c7a46
Merge pull request #3062 from TakayukiMatsuo/branch-2
Added testcases for wc_curve25519_export_key_xx
2020-06-30 14:27:24 -05:00
Juliusz Sosinowicz e63a80f1af Use `NO_SESSION_CACHE` as well in preproc checks 2020-06-30 21:21:43 +02:00
Juliusz Sosinowicz b57cf802eb Expose session serialization outside of `OPENSSL_EXTRA`
Use `./configure CFLAGS='-DHAVE_EXT_CACHE'` to enable session serialization without `OPENSSL_EXTRA`.
2020-06-30 20:17:21 +02:00
Chris Conlon b6aaedd3b4
Merge pull request #3080 from ethanlooney/second_branch
Added additional tests to curve448.c through api.c
2020-06-29 11:21:15 -05:00
Jacob Barthelmeh 14d0b4e7d6 adjust test case 2020-06-26 10:25:50 -06:00
Ethan Looney 1c1ddaa6c2 Added checks to initial returns and free rng 2020-06-25 16:40:38 -07:00
Sean Parkinson f6d26b4e81
Merge pull request #3072 from kaleb-himes/SANITY_CHECKS
ed25519 and ed448 check sigLen against expected
2020-06-26 08:31:55 +10:00
Jacob Barthelmeh 0c7b851bd3 restrict the cert version allowed 2020-06-25 15:45:18 -06:00
David Garske e2afbae6aa
Merge pull request #3054 from JacobBarthelmeh/CRL
fix for x509 store add crl
2020-06-25 09:52:12 -07:00
kaleb-himes 17466727b2 Implement peer review feedback 2020-06-25 09:43:22 -06:00
Ethan Looney fe7d9ea7c1 changed RNG to WC_RNG 2020-06-24 15:40:58 -07:00
Ethan Looney 79981e3cf7 Added additonal tests to curve448.c 2020-06-24 15:40:38 -07:00
Ethan Looney 86b7f18502 Added additional tests to curve448.c through api.c 2020-06-24 15:40:22 -07:00
toddouska 9cd6f92d19
Merge pull request #3058 from JacobBarthelmeh/Certs
Fix and test case for malformed name constraint
2020-06-24 10:15:08 -07:00
kaleb-himes 722961f55c ed25519 and ed448 check sigLen against expected 2020-06-23 17:32:00 -06:00
Sean Parkinson 582240a84d
Merge pull request #3051 from embhorn/zd10451
Sanity check wc_ecc_import_raw x, y, and key
2020-06-24 08:52:10 +10:00