880 Commits

Author SHA1 Message Date
David Garske
d1e13a973c Fix for building WOLFSSL_CERT_EXT without WOLFSSL_CERT_GEN due to missing CTC_MAX_EKU_OID_SZ. Change to allow --enable-certext without certgen. 2018-08-14 15:00:56 -06:00
David Garske
c073aee87c Added new ECC export API's to support export as hex string. New API's are wc_ecc_export_ex and wc_ecc_export_int. For hex string use ECC_TYPE_HEX_STR as encType arg. Refactor to reduce duplicate code. Build fixes for NO_ECC_KEY_EXPORT. 2018-08-14 12:05:22 -06:00
toddouska
d4f908c372
Merge pull request #1728 from JacobBarthelmeh/HardwareAcc
Add build for AF_ALG
2018-08-13 16:27:51 -07:00
Eric Blankenhorn
bb574d28b2 Support for more cert subject OIDs and raw subject access (#1734)
* Add businessCategory OID
* Raw subject support methods
* Support for jurisdiction OIDs
* Wrap in WOLFSSL_CERT_EXT
* Adding tests
2018-08-12 12:53:29 -07:00
David Garske
a43d4d16ba
Merge pull request #1719 from MJSPollard/OpenSSLAllFix
Added boost define and openssl bug fix with WOLFSSL_KEY_GEN
2018-08-02 15:20:27 -07:00
JacobBarthelmeh
cb756397b3 inital AES-CBC with af_alg
progress on AES-GCM with AF_ALG and add SHA256

add aes-gcm test cases and finish logic of aes-gcm with AF_ALG

formating of tabs and white space

add files to dist

adding ecb and ctr mode with af_alg

make length of buffers for ctr be AES_BLOCK_SIZE

formating and add support for sha256 copy/gethash

sanity checks on arguments

cast return values and valgrind tests

make it easier to use sha256 with af_alg

remove hard tabs

add endif for after rebase
2018-08-01 08:54:20 -06:00
David Garske
656c0453a2 Fix for unit test abort(). 2018-07-30 13:53:54 -07: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
6ed6876b1f Enhanced the --enable-memtrack option to keep list of pointers allocated and reports leaked memory at end. Cleanup of the wolfCrypt_Init and wolfCrypt_Cleanup calls in unit.test and SrpTest memory tracking feature. 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
toddouska
62cb69ded6
Merge pull request #1724 from dgarske/pemtoder
Added API's to expose alloc/free of DerBuffer and new unit tests
2018-07-30 13:50:19 -07:00
toddouska
335f467b8c
Merge pull request #1714 from dgarske/pic32hashleak
Fixes for PIC32MZ hash memory leak
2018-07-30 13:48:59 -07:00
David Garske
309d7a9d0d Added API's to expose alloc/free of DerBuffer using wc_AllocDer and wc_FreeDer. Added unit tests for new API's and missing ones for wc_PemToDer and wc_CertPemToDer. ZD 4185. 2018-07-30 11:19:59 -07:00
MJSPollard
543cac65d8 Added boost define and openssl bug fix with WOLFSSL_KEY_GEN 2018-07-27 12:42:09 -06:00
David Garske
efbabbfb29 Further improvements to hashing code to make sure wc_*Free is always called including wc_HashFree. Added new defines to disable PIC32MZ hardware features using NO_PIC32MZ_HASH, NO_PIC32MZ_RNG and NO_PIC32MZ_CRYPT. 2018-07-26 14:41:30 -07:00
toddouska
90367df13c
Merge pull request #1710 from SparkiDev/ed25519_only
Changes to build with X25519 and Ed25519 only
2018-07-25 14:24:03 -07:00
toddouska
84c1b633fb
Merge pull request #1713 from JacobBarthelmeh/UnitTests
fix buffer types for ARC4 test
2018-07-25 14:17:10 -07:00
David Garske
92cb8f06ea Fixes to make sure hash free is always called (resolves memory leaks with PIC32MZ hashing hardware). Only print Alloc/Free messages with track memory when WOLFSSL_DEBUG_MEMORY_PRINT is defined. Added test for ForceZero with 0 length. 2018-07-25 11:22:03 -07:00
Jacob Barthelmeh
003b7b28f4 fix buffer types for ARC4 test 2018-07-24 17:37:39 -06:00
toddouska
e618f34c2f
Merge pull request #1707 from kaleb-himes/ARM_GCC_EX_FIXES
Fixes for building without DRBG and ForceZero test
2018-07-23 16:14:43 -07:00
toddouska
ab3ffaa26a
Merge pull request #1706 from SparkiDev/sha384_not_sha512
Allow SHA384 to be compiled in without SHA512
2018-07-23 09:47:49 -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
kaleb-himes
887e3deee8 Move ForceZero test to api.c and turn on tests when inline disabled 2018-07-20 13:30:06 -06:00
Sean Parkinson
9433fcb820 Allow SHA384 to be compiled in without SHA512 2018-07-20 09:42:01 +10:00
MJSPollard
db8939c578 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into wolfASIO 2018-07-18 11:10:35 -06:00
toddouska
436e774729
Merge pull request #1685 from SparkiDev/dh_max
Add support for maximum DH key size
2018-07-18 09:33:43 -07:00
toddouska
1337f7ddec
Merge pull request #1674 from dgarske/derchainsz
Fix for max cert chain size calculation
2018-07-13 13:53:35 -07:00
David Garske
0a19dc0940 Don't run new cert chain test if RSA is disabled (test chain contains RSA certs). 2018-07-13 11:41:06 -07:00
Eric Blankenhorn
9bc0e0c4fc Static analysis fixes (#1658)
* Static analysis fixes
* Fixes for zd4071, zd4074, zd4093-zd4094, zd4096, zd4097-zd4104.
* Add test cases.
2018-07-13 09:02:09 -07:00
Sean Parkinson
ffc6cf4eb8 Add support for maximum DH key size 2018-07-13 17:36:42 +10:00
David Garske
0ce6cbd4c4 Added API unit test for wolfSSL_CTX_use_certificate_chain_file_format. 2018-07-12 13:22:21 -07:00
MJSPollard
d8dff3e4de Merge branch 'master' of https://github.com/wolfSSL/wolfssl into wolfASIO 2018-07-12 11:57:34 -06:00
toddouska
23687f44bc
Merge pull request #1643 from ejohnstown/altnames
Subject Alt Name Matching
2018-07-11 13:20:58 -07:00
John Safranek
239880a9de Subject Alt Name Matching
1. Removed an external test tag from a failure test case. Ends up leaving a thread still running on exit.
2018-07-10 17:07:48 -07:00
Jacob Barthelmeh
58478c50af check that fp max bits is large enough before test 2018-07-10 15:09:47 -06:00
MJSPollard
3fc7424e03 implemented requested changes 2018-07-10 11:52:41 -06:00
MJSPollard
ac0b31dee8 refactored and added defines for wolfSSL/Asio Compat 2018-07-03 11:07:15 -06:00
John Safranek
adb3cc5a5a Subject Alt Name Matching
1. Added certificates for localhost where the CN and SAN match and differ.
2. Change subject name matching so the CN is checked if the SAN list doesn't exit, and only check the SAN list if present.
3. Added a test case for the CN/SAN mismatch.
4. Old matching behavior restored with build option WOLFSSL_ALLOW_NO_CN_IN_SAN.
5. Add test case for a correct certificate.

Note: The test for the garbage certificate should fail. If you enable the old behavior, that test case will start succeeding, causing the test to fail.
2018-07-02 13:39:11 -07:00
David Garske
2bd4fb110c Fix additional cases for use of unititlized PKCS isDynmaic in unit test. 2018-07-02 10:24:41 -07:00
MJSPollard
e319987579 Added wolfSSl compatability for Asio C++ library 2018-07-02 10:48:02 -06:00
David Garske
fb3d3dce0e Fix for use of unititlized PKCS7.isDynamic case in unit test. Added return code checks for wc_PKCS7_Init. 2018-07-02 09:38:14 -07:00
David Garske
07401d909c Added support for dynamic allocation of PKCS7 structure using wc_PKCS7_New and wc_PKCS7_Free. Updated the test examples to use the dynamic method. Add API unit test for wc_PKCS7_New. 2018-06-29 15:04:28 -07:00
toddouska
5d767aa004
Merge pull request #1641 from ejohnstown/rename-inline
Rename INLINE
2018-06-27 09:34:41 -07:00
John Safranek
586874b997 Rename INLINE
1. Renamed the macro INLINE as WC_INLINE.
2. For FIPS and the "selftest" build, define INLINE as WC_INLINE. Allows the FIPS code to work unchanged.
2018-06-26 15:17:46 -07:00
toddouska
d9b5948947
Merge pull request #1605 from dgarske/asyncfsanitize
Fixes for async to resolve runtime fsanitize issues
2018-06-26 14:27:07 -07:00
John Safranek
e6c7952f50 Merge master into fipsv2. Resolved a conflict in api.c. 2018-06-22 09:52:26 -07:00
David Garske
522f365279 Fix one more issue with PKCS7 and async, which is not supported. 2018-06-22 09:30:25 -07:00
toddouska
c1362cca60
Merge pull request #1629 from JacobBarthelmeh/Certs
disable CRL with additional cn/alt test certs
2018-06-19 14:42:21 -07:00
Jacob Barthelmeh
d3cd0b6b2e disable CRL with additional cn/alt test certs 2018-06-18 16:10:45 -06:00
Jacob Barthelmeh
a1295b3148 memory management with test cases 2018-06-15 15:43:42 -06:00