Compare commits

...

7067 Commits

Author SHA1 Message Date
3cd5dabd0b Fixes compilation, I have no idea if it still does what it should 2022-06-14 18:23:54 +02:00
3f13b49fa3 Merge pull request #2695 from JacobBarthelmeh/Release
prepare for release v4.3.0
2019-12-20 11:10:34 -08:00
e1433867ce fix for expected nightly config test report 2019-12-20 09:46:12 -07:00
5675a2b3c5 prepare for release v4.3.0 2019-12-20 08:43:34 -07:00
45d55c8f38 Merge pull request #2676 from SparkiDev/sp_cortexm_perf
Improve Cortex-M RSA/DH assembly code performance
2019-12-19 15:03:59 -08:00
51f956490f Merge pull request #2661 from SparkiDev/parse_cert_rel_fixes
Cleanup ParseCertRelative code
2019-12-19 11:03:56 -08:00
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
2aa8fa2de6 Merge pull request #2688 from kaleb-himes/GH2552
use const to declare array rather than variable sz - VS doesn't like …
2019-12-19 08:52:30 -08:00
e10ace21df Merge pull request #2690 from SparkiDev/sp_int_fixes_1
Fix SP to build for different configurations
2019-12-19 08:52:52 -07:00
36f697c93d Fix SP to build for different configurations
Was failing:
  --enable-sp --enable-sp-math
  --enable-sp --enable-sp-math --enable-smallstack
2019-12-19 15:15:19 +10:00
95c0c1f2a5 use const to declare array rather than variable sz - VS doesn't like this 2019-12-18 16:08:26 -08:00
64a1045dc3 Cleanup ParseCertRelative code
Fix for case:
- can't find a signer for a certificate with the AKID
- find it by name
Has to error as the signer's SKID is always set for signer and would
have matched the AKID.
Simplify the path length code - don't look up CA twice.
Don't require the tsip_encRsaKeyIdx field in DecodedCert when
!WOLFSSL_RENESAS_TSIP - use local variable.
2019-12-19 08:53:24 +10:00
6922d7031c Merge pull request #2685 from embhorn/coverity_fixes
Coverity fixes
2019-12-18 14:06:48 -08:00
531fedfbb4 Merge pull request #2687 from ejohnstown/dtls-cap
DTLS Handshake Message Cap
2019-12-18 13:50:52 -08:00
031e78e103 Merge pull request #2606 from kaleb-himes/DOCS_UPDATE_19_NOV_2019
Add dox documentation for wc_ecc_make_key_ex
2019-12-18 13:49:57 -08:00
0057eb16f8 Merge pull request #2686 from ejohnstown/crl-skid
Check name hash after matching AKID for CRL
2019-12-18 13:48:59 -08:00
573d045437 Merge pull request #2682 from SparkiDev/akid_name_check
Check name hash after matching AKID
2019-12-18 13:08:19 -08:00
c054293926 Merge pull request #2684 from JacobBarthelmeh/build-tests
fix for g++ build warning
2019-12-18 12:09:29 -08:00
52893877d7 Fixes from review 2019-12-18 13:25:25 -06:00
6c6d72e4d6 Find CRL Signer By AuthKeyId
When looking up the signer of the CRL by SKID/AKID, also verify that the
CRL issuer name matches the CA's subject name, per RFC 5280 section 4.1.2.6.
2019-12-18 10:17:51 -08:00
2607cf3429 Fix up based on peer feedback 2019-12-18 10:55:20 -07:00
5a04ee0d8b Merge pull request #2640 from dgarske/alt_chain
Fixes for Alternate chain processing
2019-12-18 09:38:45 -08:00
b89121236f Merge pull request #2635 from dgarske/async_date
Fix for async date check issue
2019-12-18 09:34:08 -08:00
74a8fbcff4 Merge pull request #2666 from SparkiDev/b64_dec_fix
Bade64_Decode - check out length (malformed input)
2019-12-18 09:30:41 -08:00
c2e5991b50 Merge pull request #2681 from ejohnstown/crl-skid
Find CRL Signer By AuthKeyId
2019-12-18 09:29:17 -08:00
b5f645ea00 fix for g++ build warning 2019-12-18 10:01:52 -07:00
b126802c36 Clarify logic for skipping call to AddCA. 2019-12-18 06:04:26 -08:00
c1218a541b Check name hash after matching AKID
RFC 5280, Section 4.1.2.6:
If the subject is a CA (e.g., the basic constraints extension, as
discussed in Section 4.2.1.9, is present and the value of cA is TRUE),
then the subject field MUST be populated with a non-empty distinguished
name matching the contents of the issuer field (Section 4.1.2.4) in all
certificates issued by the subject CA.

The subject name must match - even when the AKID matches.
2019-12-18 17:57:48 +10:00
6ccd146b49 Bade64_Decode - check out length (malformed input) 2019-12-18 17:06:58 +10:00
ef6938d2bc DTLS Handshake Message CAP
Cap the incoming DTLS handshake messages size the same way we do for
TLS. If handshake messages claim to be larger than the largest allowed
certificate message, we error out.
2019-12-17 16:55:58 -08:00
7e74d02da5 Merge pull request #2677 from SparkiDev/p12_pbkdf_tmp_fix
PKCS#12 PBKDF - maximum tmp buffer size
2019-12-17 16:48:08 -08:00
ff026efe49 Merge pull request #2670 from SparkiDev/dec_pol_oid_fix
DecodePolicyOID - check out index
2019-12-17 16:47:36 -08:00
892e951c8a Merge pull request #2669 from SparkiDev/name_joi_fix
Decode X.509 name - check input length for jurisdiction
2019-12-17 16:46:30 -08:00
435d4bf427 Merge pull request #2658 from SparkiDev/asn_date_check
Check ASN date characters are valid
2019-12-17 16:39:35 -08:00
f81ce71c25 Merge pull request #2660 from JacobBarthelmeh/Compatibility-Layer
add --disable-errorqueue option
2019-12-17 16:37:02 -08:00
06563ed3fa Merge pull request #2642 from SparkiDev/sp_exptmod
sp_int: support for more values in sp_exptmod
2019-12-17 16:36:12 -08:00
037c319bab Find CRL Signer By AuthKeyId
1. Add parsing of CRL extensions, specifically the Auth Key ID extension.
2. To verify CRL, search for CA signer by AuthKeyId first, then by name.  If NO_SKID is set, just use name.
3. Update the ctaocrypt settings.h for the NO_SKID option with CRL so FIPS builds work.
2019-12-17 15:33:39 -08:00
feeb18600f Merge pull request #2636 from SparkiDev/mp_exptmod_fixes
Handle more values in fp_exptmod
2019-12-17 15:22:24 -08:00
138377f30e Merge pull request #2641 from SparkiDev/sp_c32_lshift
Fix lshift in SP 32-bit C code - FFDHE
2019-12-17 15:17:17 -08:00
5ee9f9c7a2 Merge pull request #2637 from SparkiDev/ecc_cache_resist
Improve wc_ecc_mulmod_ex cache attack resistance
2019-12-17 15:16:16 -08:00
028d9e5443 Merge pull request #2634 from SparkiDev/pkcs7_libz_fix
Fix missing variable declaration
2019-12-17 15:13:13 -08:00
a176789f13 Fix for async issue with "badDate" and "criticalExt" check getting skipped on call to ConfirmSignature with WC_PENDING_E response. Added log message when date failure is skipped. 2019-12-17 15:03:00 -08:00
06e5e81b1b Merge pull request #2663 from embhorn/zd5050
Clarify wolfSSL_shutdown error on subsequent calls
2019-12-17 14:59:35 -08:00
774a758f59 Fixes in test and example code 2019-12-17 15:56:40 -06:00
ab14a26be0 Merge pull request #2650 from dgarske/boot_tpm
Fix API visibility for ED25519 check key
2019-12-17 13:45:39 -08:00
cfd91fb0b8 Add check for length == 0 in wc_Arc4SetKey 2019-12-17 13:28:50 -07:00
e8594daab6 Merge pull request #2678 from tmael/night_valgrind
Fix memory leak detected with Valgrind
2019-12-17 09:11:30 -08:00
88188b79e2 Fix mem leak 2019-12-16 18:03:11 -08:00
8d7d2c74ee PKCS#12 PBKDF - maximum tmp buffer size
Use WC_MAX_BLOCK_SIZE - only an issue if PBKDF is using SHA-3
algorithms.
2019-12-17 09:56:08 +10:00
a71eb11b38 Improve Cortex-M RSA/DH assembly code performance
Performance of modular exponentiation improved by about 30%.
2019-12-17 09:03:34 +10:00
8d8ab655fa Merge pull request #2671 from ejohnstown/maint-conf
Maintenance: Configure
2019-12-16 13:38:02 -08:00
c0716b9e3f Merge pull request #2673 from Naruto/feature/fix_readme_miss
fix spell miss of zephyr README.md
2019-12-16 12:31:55 -07:00
af5c98a6a8 Fixes in wolfCrypt test 2019-12-16 10:22:42 -06:00
7fbadeaa17 fix spell miss of zephyr README.md 2019-12-16 21:36:43 +09:00
0bb8ae8564 Fixes for new defects in wolfCryot and wolfSSL (excluding test code) 2019-12-13 17:17:13 -06:00
f2115b2c2b Merge pull request #2652 from ejohnstown/maintenance-error
Maintenance: Error Strings
2019-12-13 15:03:32 -08:00
0348123261 Maintenance: Configure
1. Remove some redundant AM_CONDITIONAL macros checking for OCSP and CRL.
2. Moved the AM_CONDITIONAL macro setting BUILD_PKCS12 to the other AM_CONDITIONALS.
2019-12-13 15:02:03 -08:00
1a594d92ba Merge pull request #2668 from ejohnstown/maintenance-scanbuild
Fixed a couple initialization issues scan-build indicated
2019-12-13 14:13:48 -07:00
6a2975c742 DecodePolicyOID - check out index 2019-12-13 12:13:38 +10:00
b3cbab4bf3 Decode X.509 name - check input length for jurisdiction 2019-12-13 11:55:15 +10:00
e7af2d2ba9 Fixed a couple initialization issues scan-build indicated. 2019-12-12 16:50:37 -08:00
a3cc2aa6ff Merge pull request #2665 from kaleb-himes/ZD-9590-CCM-Benchmarking
Add CCM Decryption to benchmarking
2019-12-12 16:48:12 -08:00
e063fb1631 sp_int.c: Strip leading zeros in sp_read_radix 2019-12-13 09:08:55 +10:00
0a38d7c178 Add CCM Decryption to benchmarking 2019-12-12 13:53:30 -07:00
51d5abd63f Clarify wolfSSL_shutdown error on subsequent calls 2019-12-12 13:16:52 -06:00
adc14f7552 sp_int: Check size of numbers for overflow 2019-12-12 18:36:23 +10:00
2e5258fe15 add --disable-errorqueue option 2019-12-11 11:19:58 -07:00
dffb59ea52 sp_int: support for more values in sp_exptmod and fix
SP C - fix mont reduce with fast mul_add
2019-12-11 11:10:18 +10:00
093a31ed49 Merge pull request #2655 from kaleb-himes/ZD-9592
Remove forcing NO_SKID on unsuspecting CRL users
2019-12-10 16:33:16 -08:00
05dafd0adb Check ASN date characters are valid 2019-12-11 09:22:26 +10:00
74e54393ab Remove a bitfield indicator from a structure member that didn't require it. 2019-12-10 13:17:30 -08:00
2b66a9f1ec Address reviewed items 2019-12-09 14:44:59 -07:00
e8c7d6f818 Account for ASN disabled 2019-12-07 05:06:41 -07:00
bbdf0d101f Improve Decoded CRL initialization 2019-12-07 04:23:02 -07:00
072fe8fd6d More complete fix for removing NO_SKID condition as default with CRL enabled 2019-12-07 03:39:57 -07:00
8450c4ae39 Merge pull request #2643 from ejohnstown/maintenance-prime
Maintentance: Prime
2019-12-06 18:50:51 -08:00
05e672428d Merge pull request #2645 from cconlon/cmsrsacb
CMS SignedData RSA sign callback for raw digest
2019-12-06 17:13:32 -07:00
6081bdaad6 free PKCS7 before creating new in API test 2019-12-06 12:00:33 -07:00
19a4371d48 Maintenance: Error Strings
1. One of the error string was >80 bytes long. Shortened it.
2. The function that copies an error string to an output array needs to
ensure the string is still null terminated.
3. Added a check to the wolfCrypt test to see that error strings aren't
>= 80 bytes long.
2019-12-06 09:53:39 -08:00
b4f67dabcf Merge pull request #2647 from kojo1/SN-size
EXTERNAL_SERIAL_SIZE to build option
2019-12-06 09:13:07 -07:00
b28f6aeb34 Work to support wolfBoot with wolfTPM. Fix missing visibility marker for wc_ed25519_check_key. 2019-12-06 06:53:23 -08:00
87ec950221 Rollback the define in internal.h 2019-12-06 10:31:28 +09:00
9fd5628148 Merge pull request #2631 from SparkiDev/mp_invmod_fix
mp_invmod handles more inputs
2019-12-05 16:21:33 -08:00
7e391f0fd5 Merge pull request #2629 from SparkiDev/dsa_blinding
Blinding for DSA sign
2019-12-05 16:20:21 -08:00
4b31a180c8 Merge pull request #2626 from SparkiDev/sp_invmod_fixes
Fix sp_invmod to handle more input values
2019-12-05 16:18:55 -08:00
8cc4c62c14 Merge pull request #2625 from SparkiDev/set_ser_num_2
Support 20-byte serial numbers and disallow 0.
2019-12-05 16:17:54 -08:00
bd8a612d6c Merge pull request #2624 from ejohnstown/maintenance-ASN1
Maintenance: ASN.1
2019-12-05 16:16:42 -08:00
7ec448ac0c Merge pull request #2617 from embhorn/zd9553
Fix for vasprintf with AIX
2019-12-05 16:15:24 -08:00
7631fdafa1 Merge pull request #2612 from SparkiDev/sp_div_small_a
sp_div improved to handle when a has less digits than d
2019-12-05 16:14:05 -08:00
6d40c20f2c Merge pull request #2609 from JacobBarthelmeh/Compatibility-Layer
Fix for EVP CipherUpdate decrypt and add test case
2019-12-05 16:12:26 -08:00
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
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
d74a1888bb move it to build option 2019-12-06 06:28:25 +09:00
2c0fda4168 Maintentance: Prime
1. Revisited the option enables around the wolfCrypt prime test. Added a
check for key generation to the check for public MP.
2019-12-05 12:23:42 -08:00
be97444d24 add api test for wc_PKCS7_SetRsaSignRawDigestCb() 2019-12-05 10:33:49 -07:00
2063fa502f add CMS RSA sign callback for raw digest 2019-12-05 10:33:49 -07:00
0552fbc5de Fix lshift in SP 32-bit C code - FFDHE 2019-12-05 09:08:30 +10:00
9b437384de Allow AddCA for root CA's over the wire that do not have the extended key usage cert_sign set. 2019-12-04 14:14:37 -08:00
b01c558adb Fix to not send alert until after the verify cert callback and alternate chain logic has been evaluated. 2019-12-04 12:41:23 -08:00
acd4bc3305 Added logging for SendAlert call. 2019-12-04 11:02:22 -08:00
44fc3e14b1 Maintenance: ASN.1
1. Fix some preprocessor flag checking for function EncodePolicyOID. It
also needs to be available for OpenSSL Compatibility.
2. Fix for a name string for a test that can get left in or out
incorrectly.
2019-12-04 10:26:37 -08:00
3646051434 Fix for alternate chain logic where presented peer's CA could be marked as trusted.
When building with `WOLFSSL_ALT_CERT_CHAINS` a peer's presented CA could be incorrectly added to the certificate manager, marking it as trusted.

Began in PR #1934
ZD 9626
2019-12-04 06:56:36 -08:00
2a0c037f98 Improve wc_ecc_mulmod_ex cache attack resistance 2019-12-04 11:08:28 +10:00
c5f9a601e8 Handle more values in mp_exptmod
Handle prime (modulus) of 0 and 1.
Handle exponent of 0.
Fix for base of 0 in fp_exptmod and hadnle base of 0 in mp_exptmod.
fp_exptmod - Don't modify X's sign during operation when passed in as negative.
2019-12-04 09:32:08 +10:00
fd4fb28a2e Fix missing variable declaration
--enable-scep --with-libz
PKCS#7 decompress code
2019-12-03 11:07:29 +10:00
b9a82204e2 Blinding for DSA sign 2019-12-03 09:36:33 +10:00
7e45ae2ec6 Merge pull request #2621 from JacobBarthelmeh/SanityChecks
sanity check on "a" input to invmod
2019-12-02 10:57:01 -08:00
2efa91632e revert adding import check in configure.ac 2019-12-02 08:56:00 -07:00
bfaa970d84 Merge pull request #2628 from tmael/nightly_valgrind
Fix Valgrind Known Configs Test
2019-11-29 08:59:58 -08:00
204045223f Fix sp_invmod to handle more input values 2019-11-29 11:54:36 +10:00
bd7a572a8f mp_invmod handles more inputs
Value to invert: a
Modulus: b
integer.c - normal math
  - a is one, or a mod b is one
tfm.c - fast math
  - b is -ve (error), or b is zero
  - a is zero or a mod b is zero
2019-11-29 09:08:44 +10:00
f0c070b2cf Merge pull request #2630 from SparkiDev/poly1305_avx2_fix
Poly1305 AVX2 asm fix
2019-11-28 09:28:22 -08:00
06ca07c79f Poly1305 AVX2 asm fix
Missed carry when converting from 26 in 64 bits to 64 in 64 bits.
2019-11-28 16:01:29 +10:00
16ac0d8eb6 Support 20-byte serial numbers and disallow 0. 2019-11-28 10:21:48 +10:00
245a2b7012 sp_int: clamp more results 2019-11-28 10:01:54 +10:00
dadbeff433 sp_int: When setting digit of 0, set used to 0 2019-11-28 10:01:54 +10:00
2ac0ac8776 Fix for sp_div when a > d but same bit length 2019-11-28 10:01:54 +10:00
8315ae892f sp_div improved to handle when a has less digits than d 2019-11-28 10:01:54 +10:00
b396ed0984 Merge pull request #2627 from SparkiDev/rsa_sign_vfy
Change signature generation to verify by default
2019-11-27 14:08:07 -08:00
e1ebb39296 Merge pull request #2618 from ejohnstown/maintenance-prime
Maintenance: Prime
2019-11-27 14:06:23 -08:00
ff85cc7740 Merge pull request #2622 from SparkiDev/ber_to_der_rework
Rework BER to DER to not be recursive
2019-11-27 14:05:36 -08:00
1026c4359d Cast XMALLOC 2019-11-27 14:47:48 -06:00
acdfc514b3 Use memset initialize 2019-11-27 11:09:57 -08:00
cc722468be Maintenance: ASN.1
1. Add an additional check in GetCertHeader() to see that sigIndex is
bounded by maxIdx.
2019-11-27 10:43:51 -08:00
806db8096c Replace use of vasprintf 2019-11-27 11:00:28 -06:00
b06cee333c Add error on EOF 2019-11-27 17:46:15 +01:00
29a8262ea4 Only test X509_NAME_print_ex when defines enabled 2019-11-27 17:46:15 +01:00
0f4a002f4f Formatting 2019-11-27 17:46:15 +01:00
9be1b4cfd8 Remove tabs 2019-11-27 17:46:15 +01:00
944d5e1045 Don't count null char in better way 2019-11-27 17:46:15 +01:00
7c1a1dfd1f Variable declaration at start of scope 2019-11-27 17:46:15 +01:00
308c5f3370 Fix implicit cast 2019-11-27 17:46:15 +01:00
5f39e12b21 Fix leak in SSL_CTX_set0_chain 2019-11-27 17:46:15 +01:00
8dde06bbca Fix compile errors 2019-11-27 17:46:15 +01:00
dd07344499 SSL_SESSION_dup 2019-11-27 17:46:15 +01:00
3c9d191a5b Don't propogate ASN_NO_PEM_HEADER from wolfSSL_load_client_CA_file 2019-11-27 17:46:15 +01:00
1962159d89 more NGINX defines 2019-11-27 17:46:15 +01:00
b71758895e Add support for SSL_CTX_set0_chain 2019-11-27 17:46:15 +01:00
b7913116c0 Remove redeclaration 2019-11-27 17:46:15 +01:00
9fbc167d0c Declare at start of scope 2019-11-27 17:46:15 +01:00
d9ab0c4bcb Check bounds 2019-11-27 17:46:15 +01:00
ea5ac675ed WIP 2019-11-27 17:46:15 +01:00
f0abd4ea82 WIP 2019-11-27 17:45:49 +01:00
9064de1e75 Set proper WOLFSSL_ASN1_TIME in thisupd and nextupd in wolfSSL_OCSP_resp_find_status 2019-11-27 17:45:49 +01:00
31c0abd610 wolfSSL_X509_NAME_print_ex should not put the null terminator in the BIO 2019-11-27 17:45:49 +01:00
de3c11d55c opensslall required 2019-11-27 17:45:49 +01:00
a892f2a95a Changes for nginx 1.15
- ssl.c: add to check to overwrite existing session ID if found
- evp.c: wolfSSL_EVP_DecryptFinal* was checking for wrong value
2019-11-27 17:45:49 +01:00
2e487a2463 Init uninitialised values 2019-11-27 07:46:33 -08:00
23878512c6 Change signature generation to verify by default 2019-11-27 10:47:03 +10:00
776f4af7f6 Rework BER to DER to not be recursive 2019-11-27 10:20:32 +10:00
1b63ab0e73 Merge pull request #2623 from SparkiDev/set_ser_rand
Generating serial number - clear top bit
2019-11-26 16:14:54 -08:00
2de52c7666 Maintenance: Prime
When returning a result from mp_prime_is_prime for normal math, the
result should be MP_YES or MP_NO, not a bare number (1 or 0).
2019-11-26 15:44:30 -08:00
7cb5fe5e2a Merge pull request #2620 from tmael/ALPN_input
Fix alpn buffer overrun
2019-11-26 15:31:56 -08:00
57df5c10c9 Merge pull request #2619 from dgarske/async_mem
Fix for Intel QuickAssist asynchronous build
2019-11-26 15:29:04 -08:00
0d69950d07 Merge pull request #2615 from SparkiDev/mp_exptmod_neg_p
Handle negative modulus with negative exponent in exptmod
2019-11-26 15:20:54 -08:00
95c9dc9fe8 Merge pull request #2614 from ejohnstown/maintenance-OCSP
Maintenance: OCSP
2019-11-26 15:19:27 -08:00
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
5d41ef171c Merge pull request #2610 from ejohnstown/maintenance-DTLS
Maintenance: DTLS
2019-11-26 15:17:22 -08:00
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
55540c6bd3 Replace a compile option check around some filenames for certificate testing. 2019-11-25 16:13:01 -08:00
1ac0b1fc0b Maintenance: ASN.1
1. Undo an earlier change with respect to parsing a long length with
length zero. If BerToDer is disabled, this will be treated as a zero
length. With BerToDer enabled, the conversion will do the right thing.
2019-11-25 16:08:32 -08:00
5e0ca866df Maintenance: ASN.1
1. For certificates, when copying a member of a container, one shouldn't read
beyond the enclosing context.
2019-11-25 16:08:32 -08:00
d389133f33 Maintenance: ASN.1
1. Update the ParseCRL function to always obey the length value of a tag.
2019-11-25 16:08:31 -08:00
9753bf627b Maintenance: ASN.1
1. Remove the function Word32ToString and replace with calls to
XSNPRINTF().
2. Simplify DecodePolicyOID(), which converts an ASN.1 OID to a text
string in the form a.b.ccccc.d... Return an error if it gets too long.
2019-11-25 16:08:26 -08:00
7c3a4a1975 update comment to reflect new sanity check 2019-11-25 10:57:09 -07:00
316b8b0b4d add early return to normal math and WOLFSSL_VALIDATE_ECC_IMPORT to enable-all and enable-fpecc builds 2019-11-25 10:47:08 -07:00
6325269236 Generating serial number - clear top bit
If the top bit is set then the encoding routine will drop a byte of the
serial number.
Better to ensure number is positive, top bit clear, and use as much of
the serial number data as possible.
2019-11-25 15:36:11 +10:00
9a0a48e093 sanity check on "a" input to invmod 2019-11-22 15:47:05 -07:00
8bc3b7df35 Free x509 2019-11-22 14:31:59 -08:00
dc25b79db6 Fix from review 2019-11-22 15:10:13 -06:00
3432a8a1fc Maintenance: Prime
1. Prime test should return NO for 1. (ex function, normal math and fast
math)
2. Call mp_init() on the k value for the primality test case in the
wolfCrypt test.
2019-11-22 13:02:59 -08:00
481da3dcc1 Maintenance: Prime
1. Added a test case for checking "1" as a prime number to the wolfCrypt
test.
2. Allow the wolfCrypt prime test for SP builds.
3. Modify the prime test to use mp_mul rather than mp_mul_d, as the SP
math library doesn't export sp_mul_d.
2019-11-22 11:39:19 -08:00
cf127ec05f Fix buffer overrun 2019-11-22 10:33:17 -08:00
be88bce36d Fix for issues with wolfSSL_OBJ_nid2sn and wc_OBJ_sn2nid and logic finding max item when WOLFSSL_CUSTOM_CURVES and ECC_CACHE_CURVE are defined. Improvements to wolfSSL_EC_get_builtin_curves to avoid using "min" as variable name and eliminate using a local static. 2019-11-22 10:09:10 -08:00
0a924af894 Maintenance: Prime
1. Prime test should return NO for 1. (sp math)
2019-11-22 10:01:21 -08:00
ffb3dfd6ec Fixes for minor test.c build configuration issues. 2019-11-22 07:01:10 -08:00
cdc50d7753 Revert header change in #2504 for asynchronous crypto quickassist_mem.h. 2019-11-22 05:59:57 -08:00
50c4347748 More corner cases in tfm
Handle zero base in fp_exptmod better().
Handle negatives in fp_gcd().
Return FP_OKAY when writing out 0 with mp_toradix().
2019-11-22 09:56:02 +10:00
71943844d6 Maintenance: OCSP
1. Add a couple more bounds checks to wolfIO_HttpProcessResponseBuf().
2019-11-21 14:51:35 -08:00
452ba5b502 Maintenance: Prime
1. Prime test should return NO for 1. (normal math and fast math)
2019-11-21 13:49:26 -08:00
b57294eff7 Fix for vasprintf with AIX 2019-11-21 12:23:15 -06:00
edb07cf68e Merge pull request #2587 from guidovranken/ocsp-resp-decoder-bounds-fix
Properly limit array access in OCSP response decoder
2019-11-21 10:13:49 -08:00
428d51e664 IV is set in the evp ctx level 2019-11-21 09:58:03 -08:00
e883a2f696 Merge pull request #2611 from SparkiDev/sp_int_add_fix
Fix sp_add to handle carries properly
2019-11-21 08:59:09 -08:00
f56a74b6b7 Handle negative modulus with negative exponent in exptmod 2019-11-21 14:55:13 +10:00
6720bc3890 Maintenance: OCSP
1. Add some minimum bounds checking on the HTTP responses as some can
end up being too short.
2019-11-20 17:25:03 -08:00
f95d5eebff Add FreeX509() to clean up when sk stack is empty 2019-11-20 17:02:13 -08:00
6c732725b0 Test evp aes gcm with default IV length 2019-11-20 16:37:15 -08:00
b33ce2207d Merge pull request #2608 from SparkiDev/use_heap
When disabled memory, ensure all heap and types are used
2019-11-20 16:18:07 -08:00
a2d036dcba Merge pull request #2601 from SparkiDev/certs_exts_fix
ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly
2019-11-20 16:17:28 -08:00
a20db0b8ad Fix sp_add to handle carries properly 2019-11-21 09:47:17 +10:00
ce0136e968 Maintenance: Integers
In TFM and Integer, rshb() shouldn't try to shift a value that is 0.
This leads to using a negative offset to a pointer, but isn't used.
2019-11-20 13:55:57 -08:00
6f98d5d348 remove extra parentheses that clang complained about 2019-11-20 14:49:47 -07:00
71690fc73a Maintenance: DTLS
1. Updated the window scrolling. There was a couple off-by-one errors in
the DTLS window handling. They canceled each other out, but there was a
rare case where they would shift too much.
2019-11-20 13:46:23 -08:00
188eb45433 Maintenance: DTLS
Removed redundant sequence increment when sending the Server Hello message.
2019-11-20 13:08:01 -08:00
1eb1755f07 add another evp decrypt test case 2019-11-20 12:29:22 -07:00
9880ad6926 updates to EVP_CipherUpdate for handling storage of last block 2019-11-20 11:57:06 -07:00
19d8ef405c Maintenance: DTLS
When encrypting with AES-GCM, AES-CCM, or PolyChacha, do not increment
the DTLS sequence number. The sequence number should only be incremented
in BuildMessage. This was done because the sequence number used to be
incremented after calculating the HMAC or after the encrypt for AEAD
ciphers. The HMAC has been separated from the sequence increment.
2019-11-20 10:56:56 -08:00
4896a48955 fix EVP_CipherUpdate padding 2019-11-20 11:49:30 -07:00
88fb7efb8c Merge pull request #2602 from SparkiDev/certs_exts_free
ProcessPeerCerts jump to error handling instead of returning
2019-11-20 09:25:48 -08:00
2a7fb69523 Merge pull request #2604 from SparkiDev/disabled_curve_fix
TLS supported curve extension - validate support fix
2019-11-20 09:17:50 -08:00
ccc8a49fcb Merge pull request #2607 from SparkiDev/tls13_serverhello_cs
TLS 1.3 client detects non-TLS 1.3 cipher suite in ServerHello
2019-11-20 09:16:16 -08:00
d5a1adab5d Merge pull request #2605 from SparkiDev/set_ser_num
Added output size to SetSerialNumber
2019-11-20 09:15:36 -08:00
1ba366920c Merge pull request #2581 from SparkiDev/ecc_fixes_add
Add deterministic ECDSA sig gen. Fix corner cases for add point.
2019-11-20 09:12:28 -08:00
f1fbabbb60 Use default 96-bits IV length when unset 2019-11-20 09:09:12 -08:00
d441cee6fb When disabled memory, ensure all heap and types are used 2019-11-20 17:06:42 +10:00
917e5b0405 TLS 1.3 client detects non-TLS 1.3 cipher suite in ServerHello 2019-11-20 12:22:00 +10:00
13c6346158 Check error returns from mp calls 2019-11-20 11:09:50 +10:00
79b35860e0 Added output size to SetSerialNumber
Some internal calls were passing in output size as max number size.
2019-11-20 10:52:48 +10:00
ad3e105303 Add dox documentation for wc_ecc_make_key_ex 2019-11-19 17:06:52 -07:00
c7f7d1b193 TLS supported curve extension - validate support fix
Check curve name is in range before checking for disabled
2019-11-20 09:38:06 +10:00
62eaa27b41 Review comment, avoid double-free 2019-11-19 15:29:48 -08:00
1a3455110e Merge pull request #2599 from dgarske/cleanup_script
Useful script to cleanup test files created
2019-11-19 11:59:50 -08:00
5c4da3e6fa Merge pull request #2598 from dgarske/max_file_sz
Improvements to file size checks
2019-11-19 11:59:21 -08:00
5de27443d0 Merge pull request #2596 from dgarske/mqx_fio_cleanup
Support for MQX 5.0 and cleanup of the MQX includes
2019-11-19 11:49:03 -08:00
7b160a8cf3 Make MAX_WOLFSSL_FILE_SIZE overridable. 2019-11-19 07:46:50 -08:00
9a4614f6e1 Fix for possible uninitialized memSz in bio.c 2019-11-19 05:35:22 -08:00
e7bff37421 Add settings.h build macro note. 2019-11-19 05:33:59 -08:00
1b8f136d29 ProcessPeerCerts jump to error handling instead of returning 2019-11-19 13:17:29 +10:00
f08dfb4afc ProcessPeerCerts allocating memory for exts with OPENSSL_EXTRA properly 2019-11-19 13:03:20 +10:00
e6292eca9c Merge pull request #2597 from ejohnstown/octeon-global
Sync OCTEON Sniffer
2019-11-18 17:06:30 -08:00
c6dac64438 Merge pull request #2594 from ejohnstown/maintenance-BLAKE2
Maintenance BLAKE2
2019-11-18 17:05:01 -08:00
fea1f1d6e5 Maintenance: ASN.1
1. Reject as an error any ASN.1 length value that is multibyte of length 0.
2019-11-18 17:02:19 -08:00
7a5c8f4e07 Merge pull request #2584 from SparkiDev/sp_rsa4096
SP now has support for RSA/DH 4096-bit operations
2019-11-18 15:38:47 -08:00
b646b7258b Merge pull request #2585 from dgarske/webrtc_m79
Support for Google WebRTC (ref m79)
2019-11-18 15:33:49 -08:00
20c82f3c4b Merge pull request #2586 from dgarske/STM32_HW
STM32 Crypto hardware fixes and improvements
2019-11-18 15:22:19 -08:00
90f7a96721 Merge pull request #2593 from ejohnstown/maintenance-DH
Maintenance: DH
2019-11-18 15:18:16 -08:00
12dfe027ed Merge pull request #2595 from dgarske/hmac_devid
Adds PBKDF2 and Hash wrapper heap ctx and crypto callback support
2019-11-18 15:16:19 -08:00
74dd142a51 Review comment 2019-11-18 15:13:59 -08:00
abee442c1e Useful script to cleanup test files created. 2019-11-18 15:08:54 -08:00
6ffd931db1 Merge pull request #2564 from SparkiDev/tlsext_list_fix
Modify linked list traversal - fix for compiler bug
2019-11-18 15:04:26 -08:00
a1e33e7ec9 Maintenance: OCSP
1. Check array index bounds before using them in arrays.
2. When processing an HTTP buffer, check that the new buffer size is
valid before allocating a new one.
2019-11-18 14:15:55 -08:00
48d0b53074 Fix for wolfSSL_cmp_peer_cert_to_file compiler warning with size_t vs long. 2019-11-18 14:01:16 -08:00
ca5549ae91 Improvements for XFTELL return code and MAX_WOLFSSL_FILE_SIZE checking.
Fixes #2527
2019-11-18 13:49:06 -08:00
8347d00bf2 Maintenance BLAKE2
1. Remove the BLAKE2 HMAC from wolfSSL and its testing.
2019-11-18 13:31:15 -08:00
1542482cd5 Cleanup of the MQX file headers for STDIO. Cleanup of fio.h and nio.h includes to use wc_port.h. ZD 9453. 2019-11-18 12:14:34 -08:00
b780982aa4 Adds "devId" crypto device and "heap" context for Hash wrappers and PBKDF
* Adds new hash wrapper init `wc_HashInit_ex`.
* Adds new PBKDF2 API `wc_PBKDF2_ex`.
ZD 9494 (using PBKDF2)
2019-11-18 11:26:56 -08:00
14c986360d Maintenance BLAKE2
1. Remove BLAKE2 support from HMAC.
2. Update doxy header for HMAC with removal of BLAKE2 and addition of SHA-3.
2019-11-18 10:45:30 -08:00
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
12d2d17d18 Minor cleanups to TLS bench tool configuration. 2019-11-18 10:29:50 -08:00
95b83272dd Implementation for SSL_CTX_add1_chain_cert. 2019-11-18 10:19:48 -08:00
c9f7741dfb Merge pull request #2567 from aaronjense/scan-build-fix
Scan-Build Fixes for PKCS7 and PKCS12
2019-11-18 10:21:14 -07:00
ea04dbede1 Merge pull request #2583 from ejohnstown/rng-ebsnet
RNG-EBSNET
2019-11-18 09:15:30 -08:00
7e17904c54 Fix for AES GCM Decrypt auth tag. ZD 9507 2019-11-18 06:46:50 -08:00
b676c69561 Fix for DES mutex return code. Fix TLS bench thread shutdown. README.md updates. 2019-11-18 06:46:20 -08:00
520a032b71 Add show x509 test 2019-11-15 13:23:08 -08:00
6ca12787ae retrieve a stack of X509 certs in a cert manager and a store ctx 2019-11-15 13:23:08 -08:00
7819fedca7 Update for OpenSTM32 project. Adds TLS benchmarking tool, which test client/server for each cipher suite. 2019-11-15 12:10:09 -08:00
0c2c4fd91b Improvements to tls_bench tool in wolfSSL lib for embedded use. 2019-11-15 12:09:19 -08:00
961f9c4ecc Cleanup for invalid use of NO_SHA512 in api.c unit test. 2019-11-15 12:08:50 -08:00
a7e415d077 Fix for AEC CTR mode with STM32 and CubeMX. 2019-11-15 12:08:25 -08:00
27d95d1dfd Add mutex protection on STM32 RNG, AES/DES and Hashing crypto hardware calls for thread safety. Fixes #2580 2019-11-15 12:08:11 -08:00
2a9449182c * Make the wc_Stm32_Aes_Init API always available for STM32. ZD 9503
* Fix for SHA256 hash context to only be included for `STM32_HASH_SHA2`. ZD 9503
2019-11-15 12:07:08 -08:00
4282346eef Merge pull request #2551 from kaleb-himes/ZD5815-EBSNET
Implement porting efforts from ZD5241 and ZD5815
2019-11-15 09:24:10 -07:00
3cd5a97473 Maintenance
1. When getting the DH public key, initialize the P, G, and Pub pointers
to NULL, then set that we own the DH parameters flag. This allows
FreeSSL to correctly clean up the DH key.
2019-11-14 14:42:58 -08:00
604219f2fc Sync OCTEON fix
1. For OCTEON builds, leave out the "-DCVMX_BUILD_FOR_LINUX_HOST" option
from CFLAGS by default so it makes standalone host builds.
2. Add a check of the variable OCTEON_HOST for linux to add back in the
"-DCVMX_BUILD_FOR_LINUX_HOST" to CFLAGS.
2019-11-14 14:21:44 -08:00
2ace532e45 Sync OCTEON fix
1. The sniffer's global device ID wasn't tagged as global.
2. Make sure the sniffer's global device ID is used.
2019-11-14 14:21:44 -08:00
7c78130f70 Sync OCTEON fix
The preprocessor selection for the WOLFSSL_GLOBAL macro for OCTEON wasn't getting selected.
2019-11-14 14:21:44 -08:00
4a2f8482b5 Remove static RSA setting
Customer confirmed their tests are passing without static rsa enabled.
2019-11-14 15:16:32 -07:00
8c6c4e2432 Add unique error codes to verify failures 2019-11-14 16:02:02 -06:00
22042830d6 Merge pull request #2588 from kojo1/BasicConst2
BasicConstraint, compatibility
2019-11-14 13:16:30 -07:00
dccb2e165e if integer it is valid format with CA = False, 2019-11-14 14:51:58 +09:00
cc880e39ae Add deterministic ECDSA sig gen. Fix corner cases for add point.
In verify, two points are added and they may either be the same point
(different z) or result in infinity.
If they are the same point then a double needs to be performed instead.
Detection of infinity added.
Calculation of wc_ecc_sig_size fixed to handle wehn there are more bits
in the order than in the modulus.
2019-11-14 12:49:45 +10:00
a3fca34471 Properly limit array access in OCSP response decoder 2019-11-14 03:19:07 +01:00
411b130369 Add new 4096-bit cert and key to distribution 2019-11-14 09:13:24 +10:00
8f08f001d2 Update the EBSNET GenerateSeed function with a better seed. It was
reseeding itself every few bytes and failing the simple entropy check.
2019-11-13 14:50:58 -08:00
af142b307b Support for WebRTC (ref m79):
* Fixed `set1_curves_list` API's to use `const char*` for names.
* Fixed `ossl_typ.h` to include `ssl.h` compatibility.
* Added `SSL_CTX_up_ref`.
* Added `wolfSSL_set1_curves_list`
* Added `TLS_method` and `DTLS_method`
* Added `SSL_CIPHER_standard_name`.
* Added `X509_STORE_CTX_get0_cert`
* Added `SSL_CTX_set_cert_verify_callback`.
* Enabled "either" side support when `--enable-opensslall` is used.
* Changed `SSL_CIPHER_get_rfc_name` to use `wolfSSL_CIPHER_get_name` instead of stub.
2019-11-13 12:34:33 -08:00
99292158e4 Merge pull request #2573 from JacobBarthelmeh/staticmemory
handle case to avoid memcpy when staticmemory IO pool gives same buffer
2019-11-13 11:29:13 -08:00
76e7e7349b Merge pull request #2575 from tmael/valgrind_dhtest
Fix memory leak in dh_test
2019-11-13 11:28:04 -08:00
46bc8e092a Merge pull request #2582 from ejohnstown/abi-current
ABI
2019-11-13 11:24:45 -08:00
dab7d09570 Fix the possibility that memory is not free'd when GetLength returns 0 2019-11-13 11:55:45 -07:00
0beeb2356b Fix scan-build not recognizing FlatAttrib array being initialized 2019-11-13 11:50:26 -07:00
e3fb746f1d Merge pull request #2503 from dgarske/openvpn
wolfSSL Compatibility support for OpenVPN
2019-11-13 11:04:08 -07:00
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
5221c082f1 SP now has support for RSA/DH 4096-bit operations 2019-11-12 12:04:06 +10:00
d8e40dea3f Fixes from peer review:
* Reduced codesize when building with `OPENSSL_EXTRA_X509_SMALL`.
* Additional argument checks in `wolfSSL_ASN1_BIT_STRING_set_bit`, `wolfSSL_ASN1_STRING_to_UTF8`, `wolfSSL_RSA_meth_new`, `wolfSSL_RSA_meth_set`.
* Fix for compiler warnings in asn.c using strncmp to duplicate string. "specified bound depends on the length of the source argument"
2019-11-11 15:39:23 -08:00
682cf6deac wolfSSL ABI
Hide the RNG and ecc_key allocators from FIPS mode builds.
2019-11-11 15:16:39 -08:00
d17748b1ad Fix for EC_GROUP_order_bits and added unit test. 2019-11-11 14:58:23 -08:00
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
5a21cec030 wolfSSL ABI
Add ABI tags to the functions wolfSSL_Cleanup() to match wolfSSL_Init(),
wolfSSL_X509_free to match wolfSSL_load_certificate_file() which
allocates memory.
2019-11-11 10:16:58 -08:00
68e4014c3f memset DhKeys 2019-11-11 09:43:10 -08:00
8246e02756 Merge pull request #2502 from cariepointer/gcm-tls10-fix
Return error with AES-GCM and negotiated versions < TLSv1.2
2019-11-08 15:06:54 -08:00
c6fa49d4b4 wolfSSL ABI
Add the ABI tag to the prescribed list of functions in the header and source files.
2019-11-08 15:06:18 -08:00
44552fe707 Merge pull request #2536 from dgarske/nxp_mmcau_align
Fix NXP MMCAU when data pointer is not aligned
2019-11-08 15:02:43 -08:00
801ffd4712 Merge pull request #2571 from SparkiDev/asn1_cert_parse_fix
Ensure space for name string. Reset policy count.
2019-11-08 15:02:02 -08:00
a2cdb87067 Add check for if length is <= 0 in wc_Arc4SetKey 2019-11-08 14:54:39 -07:00
99ee4a407d Fix mem leak for valgrind 2019-11-08 12:09:46 -08:00
39eaaddeae Add tests for AEAD cipher suites with TLSv1.1 and TLSv1.0 2019-11-08 10:04:58 -08:00
e329431bc1 Merge pull request #2572 from kaleb-himes/GH2559
Address logical fallacies and syntax issues in example server, addres…
2019-11-08 10:18:12 -07:00
1d02943658 Sanity check in wc_scrypt for invalid params <= 0 2019-11-08 09:40:07 -07:00
c69b6fb6d1 wolfSSL ABI
1. Add a blank #define WOLFSSL_ABI to tag functions as part of the ABI
to remind developers there are rules about those functions specifically.
2. Added allocators and deallocators for WC_RNG objects and ecc_key
objects so they don't have to be used on the stack.
3. Add tests for the new allocators.
2019-11-07 13:03:12 -08:00
f0d3d5d71c 80-character per-line coding standard format fix 2019-11-07 13:33:38 -07:00
95796c80b7 Add prototype for ebsnet_fseek
Customer confirmed prototype was not present in vfile.h, added prototype to wolfSSL header.
2019-11-07 13:31:02 -07:00
5ce88b5086 seperate sanity checks on size and rnd allocation 2019-11-07 13:12:17 -07:00
fd3e4abb46 handle case to avoid memcpy when staticmemory IO pool gives same buffer 2019-11-07 11:36:20 -07:00
ad192786b1 Remove double assignment to pt caught by scan-build test 2019-11-07 11:35:36 -07:00
e24059691c Address logical fallacies and syntax issues in example server, addresses GH issue #2559 2019-11-07 10:30:12 -07:00
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
0fe5d40507 Merge pull request #2568 from aaronjense/iar-build-fix
Fix changed sign warning for IAR build
2019-11-06 15:47:15 -08:00
caaab11f60 Update from review 2019-11-06 15:58:50 -06:00
b2270a068f Merge pull request #2566 from SparkiDev/malloc_unused_fix
Fix unused parameter when XMALLOC doesn't use params
2019-11-06 13:08:48 -08:00
c137c5a3e0 Merge pull request #2565 from SparkiDev/rsa_kg_sp_math
SP Math and RSA Key Gen working again
2019-11-06 13:08:19 -08:00
1becdb9f3b Merge pull request #2563 from SparkiDev/x509_dname_index
Check domain name location index hasn't exceed maximum before setting
2019-11-06 13:07:42 -08:00
c995417d54 Merge pull request #2554 from SparkiDev/sp_misrac
MISRA-C changes to SP plus cppcheck fixes
2019-11-06 13:06:28 -08:00
15d4da1e14 Merge pull request #2562 from JacobBarthelmeh/staticmemory
fix for memory management on edge case with staticmemory
2019-11-06 13:04:33 -08:00
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
969488434a Merge pull request #2544 from JacobBarthelmeh/SanityChecks
add null checks (QSH and CRYPTOCELL)
2019-11-06 12:18:00 -08:00
ea77cd743e Fix changed sign warning for IAR build 2019-11-06 09:59:31 -08:00
cd7001904a Merge pull request #2561 from ejohnstown/x509-loss
X.509 and Secure Renegotiation
2019-11-06 10:53:18 -07:00
d4ca48a513 Fix unused parameter when XMALLOC doesn't use params 2019-11-06 15:46:19 +10:00
65cd8a930e SP Math and RSA Key Gen working again 2019-11-06 15:24:12 +10:00
a6e4926d2f Init variables 2019-11-05 15:14:47 -08:00
d2c4798459 Modify linked list traversal - fix for compiler bug
KeyShare and PreSharedKey traverse linked list using a handle.
Customer reported their compiler couldn't handle the assignment, so,
using a temporary.
2019-11-06 08:57:33 +10:00
77c36b5ea9 Merge pull request #2542 from kojo1/BasicConst
x.509 basic constratint
2019-11-05 15:38:07 -07:00
52f28bd514 Check domain name location index hasn't exceed maximum before setting 2019-11-06 08:31:04 +10:00
890eb415b1 fix for memory management on edge case with staticmemory 2019-11-05 15:13:26 -07:00
165105af95 Merge pull request #2558 from danielinux/pwbased-no-asn
Allow pwdbased module to compile without ASN
2019-11-05 13:26:45 -08:00
e48cf88a70 Merge pull request #2556 from embhorn/arm-test-fix
Fix for ARM platforms
2019-11-05 12:25:56 -08:00
c337ce2703 Merge pull request #2560 from cconlon/cavppss
use wc_RsaPSS_CheckPadding() for selftest build instead of extended
2019-11-05 12:09:25 -08:00
72e1afbe99 X.509 and Secure Renegotiation
1. When retaining the handshake resources for a session using resumption, do not delete the peer's certificate. If keeping peer certificates is enabled, the certificate needs to exist so it may be examined.
2. Free the saved peer certificate when receiving a peer certificate during a renegotiation.
2019-11-05 11:03:34 -08:00
e429558166 use wc_RsaPSS_CheckPadding() for selftest build instead of extended 2019-11-05 10:48:36 -07:00
51ea806d8b Allow pwdbased module to compile without ASN 2019-11-05 10:16:46 +01:00
1361e4dbef remove extra setting of ecc key size with CRYPTOCELL build 2019-11-04 23:25:47 -07:00
e2b7bee9c8 Merge pull request #2533 from cariepointer/apache_bio_want_read
Apache: Return WANT_READ in wolfSSLReceive if BIO retry and read flags are set
2019-11-04 16:52:28 -08:00
32f93be0b6 Replace magic PSS salt length numbers with enums 2019-11-05 09:03:30 +10:00
5141623f48 Merge pull request #2548 from SparkiDev/rsa_check
Add more checks of RSA key
2019-11-04 13:05:35 -08:00
28da0075d1 Merge pull request #2545 from SparkiDev/scrypt_iters
Add scrypt API that takes iterations rather than cost
2019-11-04 13:01:32 -08:00
b723acf0f6 Merge pull request #2534 from SparkiDev/pss_1024_sha512_tls12
Pass the length of the RSA key in bits to PSS padding check in TLS
2019-11-04 11:42:55 -08:00
f4afa4bc87 Merge pull request #2540 from SparkiDev/etm_rehand
Fix Encrypt-Then-MAC when rehandshaking
2019-11-04 11:41:44 -08:00
16899b55b2 Fix for ARM platforms 2019-11-04 11:54:36 -06:00
e2fb359538 Merge pull request #2549 from JacobBarthelmeh/Testing
fix for macro typo's
2019-11-04 08:05:09 -08:00
683658de20 Merge pull request #2553 from miyazakh/fix_esp_buildfail
fix esp build failure
2019-11-04 07:44:01 -08:00
f590f6522d MISRA-C changes to SP plus cppcheck fixes 2019-11-04 16:13:48 +10:00
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
0c8ab5b0e4 fix esp build failure 2019-11-03 12:19:59 +09:00
76404c937e #ifdef guard 2019-11-02 13:01:40 +09:00
2084006b61 Merge pull request #2550 from cconlon/mmcau
fix mmCAU classic XFREE on aligned ptr
2019-11-01 15:59:57 -07:00
ffb80126ff Implement porting efforts from ZD5241 and ZD5815 2019-11-01 16:00:06 -06:00
6ba3aa88ca fix for build after CI tests 2019-11-01 14:47:50 -06:00
98a2322dd9 Merge pull request #2525 from tmael/open_coexist
Raise an error when opensslcoexist option is used with openssl[all][extra]
2019-11-01 11:32:46 -06:00
e07e07f831 Merge pull request #2537 from JacobBarthelmeh/PKCS7
fix for pkcs7 verify streaming
2019-11-01 10:15:44 -06:00
be2cb302ea fix mmCAU classic XFREE on aligned ptr 2019-11-01 09:56:28 -06:00
54f023ac2c Clarify ipasc parameter usage 2019-11-01 10:33:49 -05:00
efca350cba fix for macro typo's 2019-11-01 09:21:21 -06:00
54c7619f81 Add more checks of RSA key
Check d is in valid range, p*q == n, and dP, dQ and u are valid.
2019-11-01 16:25:57 +10:00
7623777857 Add scrypt API that takes iterations rather than cost
iterations = 1 << cost but matches APIs in other products and standard
2019-11-01 10:15:42 +10:00
6839110507 Update from review 2019-10-31 17:45:33 -05:00
9e852b3867 Merge pull request #2539 from dgarske/mutex_ref
Fixes for cases where mutex was not being free'd
2019-10-31 13:10:04 -07:00
b27c1df348 Merge pull request #2538 from SparkiDev/cppcheck_fixes_2
Fixes for errors using cppcheck
2019-10-31 13:08:19 -07:00
ac76b4b692 Merge pull request #2541 from SparkiDev/x25519_gcc_avx2
Fix loading and setting using RIP register with GCC
2019-10-31 13:07:27 -07:00
626e0efd99 Merge pull request #2530 from SparkiDev/pkcs11_tls_client
Use the public key type as private key type with PKCS #11
2019-10-31 13:06:32 -07:00
fca0705a0b Merge pull request #2526 from aaronjense/libwebsockets-build-fix
libwebsockets build fixes
2019-10-31 13:05:46 -07:00
550fbcfff7 add null checks (QSH and CRYPTOCELL) 2019-10-31 10:07:47 -06:00
58d800fbb7 Adding support for IP address verification 2019-10-31 09:15:22 -05:00
9fc33e461c Check names in verify callback. 2019-10-31 09:15:22 -05:00
2ef4d1a16e Keep else to GetBoolean 2019-10-31 17:29:46 +09:00
4f602e02ba accept ASN_INTEGER for compatibility 2019-10-31 12:06:59 +09:00
adff4e719a Fix loading and setting using RIP register with GCC 2019-10-31 12:14:05 +10:00
4be36ef2bd Fix Encrypt-Then-MAC when rehandshaking
New, encrypted handshakes change over to ETM correctly now.
2019-10-31 09:14:42 +10:00
28d466cb10 Fix to ensure 4-byte alignment is default for MMCAU with SHA1, SHA256 and MD5. 2019-10-30 13:34:57 -07:00
760a90ef5d Fixes for cases where mutex is not being free'd. 2019-10-30 10:11:06 -07:00
c354b240f2 Fixes for errors using cppcheck 2019-10-30 14:48:21 +10:00
a0955f8221 fix for pkcs7 verify streaming 2019-10-29 16:47:30 -06:00
7f42b71571 Fix NXP MMCAU when data pointer is not aligned. 2019-10-29 13:45:25 -07:00
6bc16a4acb Merge pull request #2532 from aaronjense/mp-public-defines
Fix for configure used in wolfssl-examples/signature/rsa_vfy_only.…
2019-10-29 08:46:03 -07:00
eb03e5de1e Pass the length of the RSA key in bits to PSS padding check in TLS 2019-10-29 11:56:35 +10:00
e8db4cc2a0 Apache: Return WANT_READ in wolfSSLReceive if BIO retry and read flags are set 2019-10-28 15:08:00 -07:00
140796d2aa Merge pull request #2504 from ejohnstown/sync-octeon
Synchronous OCTEON Sniffer Support
2019-10-28 12:25:57 -07:00
0aeb87f284 Merge pull request #2529 from SparkiDev/etm_max
Fix check for plaintext length when using Encrypt-Then-MAC
2019-10-28 11:59:32 -07:00
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
34c37c58f4 Fixes for configure used in wolfssl-examples/signature/rsa_vfy_only and fix for wrong WOLFSSL_MP_PUBLIC defines.
./configure CFLAGS=-DWOLFSSL_PUBLIC_MP --disable-asn --disable-filesystem --enable-static --enable-shared --enable-cryptonly --enable-sp=smallrsa2048 --enable-sp-math --disable-dh --disable-ecc --disable-sha224 --enable-rsavfy
2019-10-28 09:50:59 -06:00
8a92e1eae6 Fix check for plaintext length when using Encrypt-Then-MAC 2019-10-28 16:28:52 +10:00
ad9522c765 Add WOLFSSL_OLDTLS_AEAD_CIPHERSUITES to allow AEAD cipher suites in TLSv1.0 and TLSv1.1 2019-10-25 09:51:11 -07:00
b80b10b980 Merge pull request #2498 from danielinux/stm32wb55
Support for STM32_PKA accelerator
2019-10-24 15:41:08 -07:00
9f34826173 stm32_pka: fixed remarks from code review 2019-10-24 21:48:35 +02:00
390b936331 stm32_pka: using XMEMCPY 2019-10-24 20:49:43 +02:00
f97452c859 STM32_PKA: using XMEMSET 2019-10-24 20:46:03 +02:00
025754e774 Fixed alignment/padding for hash. ECC tests passing on target. 2019-10-24 20:32:47 +02:00
17f44d4d29 OCTEON Sync
1. Add attributes to the OCTEON functions so they aren't optimized.
2. Disable the same test cases for OCTEON as we do QAT in sync.
2019-10-24 10:00:20 -07:00
3ac4aa5a9b Merge pull request #2524 from cconlon/cau_iar
mmCAU Classic AES key alignment, IAR warnings fixes
2019-10-24 09:23:20 -07:00
3677e4d735 [stm32hal-pka] Fixed after reviews, fix result allocation for sign/mulmod 2019-10-24 16:06:38 +02:00
0b93109b3a throw error when opensslcoexist configured with opensslall or opensslextra 2019-10-23 15:51:19 -07:00
400dcfebba Merge pull request #2516 from danielinux/freescale-ltc-spmath
Fixed Freescale LTC crypto module to compile with SP math
2019-10-23 15:11:43 -07:00
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
954d1ad13e Sniffer Update
1. Add ssl_SetWatchKeyCallback_ex() which was missing.
2. Fix linking issue with OCTEON libraries.
2019-10-23 15:03:50 -07:00
cb7b4af986 Merge pull request #2523 from JacobBarthelmeh/SanityChecks
fix for selftest build
2019-10-23 15:24:16 -06:00
4135850a32 Merge pull request #2522 from dgarske/rel_async_4.2.0
Fixes for building with async (rel v4.2.0 prep)
2019-10-23 14:33:00 -06:00
5b9e005802 fix for selftest build 2019-10-23 12:09:20 -06:00
b8f4b1a712 QAT Header Hiding
For the sync QAT, the QAT headers are included into the library after it
has been built and is being used. The actual headers should only be used
when building wolfSSL and should be hidden from the user.
1. Most of the functions in the sync QAT and OCTEON headers don't need
to be exported. Move all of that into the source files. Only export the
init and deinit functions.
2. Remove inline from the OCTEON support functions.
3. Remove the AES-ECB files for sync OCTEON as unused.
4. Configure defaults to OCTEON2 build, can be overridden with variable.
2019-10-23 09:58:11 -07:00
1ad23334bf Sync Sniffer API Cleanup
1. Switched the IntelQa sync API back to local.
2. Added two functions to setup and cleanup the IntelQA device.
3. Changed the Octeon functions to match the IntelQa functions.
4. Updated sniffer, wolfcryptest, and benchmark.
2019-10-23 09:58:11 -07:00
b0dafbcd1b Sync Octeon Sniffer
Added back some changes from a dropped commit.
1. The Octeon README should be a stub.
2. Changed the license notice in the octeon sync files back to GPLv2.
3. Added a flag to Aes that needed a build guard around it.
4. Replaced the disable for sniffer session stats.
2019-10-23 09:58:11 -07:00
54f0b1a44a Sync QAT Fixes
1. The QAT callback's worker functions need to copy the IV into the AES IV register. QAT doesn't update it automatically.
2. Update the GMAC test to set its device to INVALID_DEVID.
3. Always allocate NUMA buffers before running crypto operation and store the results.
4. The QAT does not like non-multiple of 4 iv lenths, and aad lengths. Or 0. Remove a few test cases for those.
5. QAT wasn't getting a pointer to store the auth tag for GCM. Then store it.
2019-10-23 09:58:11 -07:00
825f311959 add OCTEON and QAT to wolfCrypt test, update SHA-1 to reset ret when it will do the software sha 2019-10-23 09:58:10 -07:00
41e0712eb0 Synchronous Cavium OCTEON Support for Sniffer
1. Fixes for AES-GCM.
2019-10-23 09:58:10 -07:00
67b11b8ece Fixing some play-nice between sync QAT and sync Octeon. 2019-10-23 09:58:10 -07:00
989c964a95 Synchronous Cavium OCTEON Support for Sniffer
1. Add configure option for sync IntelQA that uses the crypto callback API.
2. Make a synchonous copy of the quickassist files.
3. Tie in the crypto device to the sniffer.
4. When making a sniffer build, define static DH enabled.
5. The readme files in the Cavium were being added to the distro optionally, changed to always add the readme files.
6. Added an include of the cavium_octeon header in the wc_ports.c.
7. Updated the Cavium OCTEON callback for AES-GCM.
8. Add the global tag to the list of crypto callback function pointers.
9. Add an accessor to the OCTEON crypto callback module to return the device ID of the OCTEON device.
10. Add a new version of ssl_SetWatchKeyCallback which takes an additional parameter of a device ID. This ID is used to set up the wolfSSL_CTXs in the sniffer session trackers.
11. Update the benchmark to use sync OCTEON and QAT.
2019-10-23 09:58:10 -07:00
7386bd4df1 Fixes for building with ./configure --enable-asynccrypt --enable-all CFLAGS="-DWC_ASYNC_NO_CRYPT" 2019-10-22 13:37:16 -07:00
48c4b2fedc Merge pull request #2521 from JacobBarthelmeh/Release
prepare for release version 4.2.0
2019-10-22 09:12:33 -07:00
8ce3b3a5e6 Use the public key type as private key type with PKCS #11 2019-10-22 10:34:44 +10:00
a3c09f6794 Fix unittest to pass when compiling for NGINX 2019-10-22 08:47:49 +10:00
1cbc2536cc prepare for release version 4.2.0 2019-10-21 16:32:41 -06:00
32f537cb6c wrap time_t requirement in ssl.h by openssl extra build to fix sgx build 2019-10-21 16:29:31 -06:00
497818525a check on keygen for make rsa key function 2019-10-21 14:54:17 -06:00
9b8f1dadd0 Merge pull request #2520 from JacobBarthelmeh/Testing
Testing
2019-10-21 12:20:53 -07:00
eaa8f2a957 libwebsockets build fixes
1. Add --enable-libwebsockets option
2. Add OPENSSL_NO_EC (used in libwebsockets)
3. Add SSL_MODE_RELEASE_BUFFERS and debug message for when wolfSSL_CTX_set_mode doesn't recognize a mode.
2019-10-21 12:03:18 -06:00
132877ea0b Merge pull request #2519 from ejohnstown/dtls-fips-fix
Fix DTLS+OPENSSLALL+FIPS Failure
2019-10-21 10:00:23 -07:00
09a0859865 fix for fortress and no sha build with encrypted keys 2019-10-21 09:37:24 -06:00
e24787c8e4 add ecc header for fp_ecc cache free 2019-10-21 09:21:46 -06:00
ea45da5fa8 change add_all_* to be evp table init and fix valgrind report 2019-10-20 01:13:43 -06:00
26793359a2 Fix DTLS+OPENSSLALL+FIPS Failure
There was a problem with the combination of DTLS, OpenSSL Compatibility,
and FIPSv2 where the DTLS server would fail out because a HMAC key was
too short. FIPS requires a HMAC key be a minimum size. The DTLS server
uses HMAC to generate the first cookie key when initialized. When using
OpenSSL, the feature for creating a DTLS endpoint with its side being
set late is tested. The DTLS cookie wasn't getting set at init because
the server was "neither" at the time. Added a call to set cookie when
initializing a neither endpoint into a server.
2019-10-18 16:30:27 -07:00
42ddd63952 exclude packed __attribute__ on IAR ICC < 9 2019-10-18 16:33:01 -06:00
c18ff36959 fix uninitialized variable warning in IAR-EWARM 7.50.2 2019-10-18 14:08:23 -06:00
c4afbb3685 align AES key if needed when using MMCAU classic 2019-10-18 14:02:43 -06:00
0eefa80d74 initialize max pathlen to preserve ASN no signer error 2019-10-18 11:30:08 -06:00
a0a572cf3e fix sha256 build on armv8 2019-10-18 11:04:45 -06:00
0e73af8b88 Merge pull request #2515 from JacobBarthelmeh/Testing
Initial pass on test cycle
2019-10-17 16:02:17 -07:00
7135e9e500 Merge pull request #2517 from dgarske/x509_date
Fix to restore notBefore/notAfter functions
2019-10-17 16:59:20 -06:00
fb8d2d4b2f Fix to restore notBefore/notAfter functions that were removed in PR #2462. These are not openssl compatibility functions, but are used by JSSE. 2019-10-17 13:02:00 -07:00
78e1336598 Merge pull request #2514 from dgarske/fix_async_next_iv
Various fixes for asynchronous mode
2019-10-16 13:52:47 -07:00
b7d4c9f839 fix build with no server and enable all 2019-10-16 14:19:50 -06:00
f41f67d231 Fixed Freescale LTC crypto module to compile with SP math 2019-10-16 15:44:58 +02:00
b4a3ad6e2d fix test case for enckeys + des3 with md5 disabled 2019-10-15 17:07:05 -06:00
acd0a55d47 add new certs to extra dist 2019-10-15 14:23:01 -06:00
1267987c31 Review comment 2019-10-15 12:24:57 -07:00
1a18e3bba8 Add leading zero padding for odd hex ASCII digits 2019-10-15 11:54:58 -07:00
5c07391f1b Various fixes for asynchronous mode:
* Fix for AES CBC issue with IV (QAT only).
* Fix for test cases with QAT.
* Remove poorly placed debug for AES CFB.
2019-10-15 11:18:55 -07:00
928eb36b5e Merge pull request #2513 from JacobBarthelmeh/UnitTests
update external test certificate
2019-10-15 11:18:01 -07:00
63e74554a8 fix for warning when using c++ compiler 2019-10-15 10:07:02 -07:00
bb6eeefe26 fix for build with --enable-all and gcc-9 on Linux 2019-10-15 09:56:26 -07:00
4bde06fbe3 fix for pkcs11 found running build_test.pl script 2019-10-15 10:25:46 -06:00
b27504b222 update external test certificate 2019-10-15 10:11:38 -06:00
441f3a7f1f Add leading zero for odd number of hex digits 2019-10-14 16:43:45 -07:00
95c036a08a static analysis tests for memory management 2019-10-14 17:17:46 -06:00
d30e4ac74f Merge pull request #2499 from ejohnstown/sniffer-features
Sniffer Features
2019-10-14 15:35:55 -07:00
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
f0dfe5355b Sniffer for IPv6
1. Better length checking on the IPv6 extension headers.
2. Removed the default size update analogous to the IPv4 header check
function. It cannot ever be 0, so the update was unnecessary.
2019-10-14 10:17:37 -07:00
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
9560b905af Merge pull request #2509 from cconlon/selftest_version
Add CAVP selftest version API prototype
2019-10-14 09:23:16 -07:00
2c3e4a2d18 Merge pull request #2508 from ejohnstown/dtls-fix
DTLS Redundant Check
2019-10-13 10:05:44 -07:00
afb1c5f252 Merge pull request #2431 from JacobBarthelmeh/coldfire
M68K (coldfire MCF5441X) wolfcrypt build and examples
2019-10-13 09:16:03 -07:00
f2a3da94b6 refactor some openssl extra functions for cryptonly use 2019-10-11 16:40:08 -06:00
54b6148259 Add comment 2019-10-11 15:19:02 -07:00
ccc500e13f Correct return value from wolfSSL_BIO_BASE64_write() 2019-10-11 14:52:53 -07:00
9357db4d0c check value of ret in test cases 2019-10-11 15:27:15 -06:00
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
d7fe000cfe M68K (coldfire MCF5441X) wolfcrypt build and examples
fix for make dist and cleanup makefile

add aes file to Makefile

macro guards and entropy warning

add AES to build
2019-10-11 14:56:34 -06:00
fd6328aa8e adjust NETBSD selftest tag in fips-check.sh for CAVP version API 2019-10-11 14:29:41 -06:00
2c6c88266b add prototype for wolfCrypt CAVP version in selftest.h 2019-10-11 14:18:04 -06:00
cd934a95a4 Merge pull request #2445 from JacobBarthelmeh/SanityChecks
sanity check on resulting ecc size
2019-10-11 10:53:20 -07:00
9c5fd165d0 addressing non RFC compliance in handling of pathLen constraint 2019-10-10 16:45:29 -06:00
774c0c5c3c Remove a redundant sequence number check for epoch 0. 2019-10-10 14:21:14 -07:00
fabc6596b3 Merge pull request #2369 from JacobBarthelmeh/Testing
fix for inject clear alert from client test case
2019-10-10 13:25:51 -07:00
d781734b55 Merge pull request #2507 from cariepointer/apache_updates
Apache updates
2019-10-10 12:45:01 -07:00
65d1c3b8ce Merge pull request #2506 from tmael/bio_mem_base64
Fix for BIO and base64 encoding/decoding
2019-10-10 13:41:38 -06:00
1d7f0de5b5 Fixes from review, adds some error checking, and adds const variables 2019-10-10 09:13:35 -07:00
4fa2b71848 Minor changes requested from review 2019-10-09 15:38:26 -07:00
af8968ee5e Add REQUIRES_AEAD and move functionallity for checking AEAD ciphers to CipherRequires() 2019-10-09 14:37:39 -07:00
d137cab427 Update in XSTRCAT call 2019-10-09 13:12:34 -07:00
2312d0e125 Dynamically allocate buffer in wolfSSL_X509V3_EXT_print 2019-10-09 12:54:23 -07:00
e22563ed00 BIO chain test 2019-10-09 11:38:07 -07:00
d89f9ddc42 Update X509V3_EXT_print for different extension types 2019-10-09 11:10:27 -07:00
5adcee9f2c Update testsuite to expect ADH-AES256-GCM-SHA384 to fail with TLSv1.0 and TLSv1.1 2019-10-09 08:36:47 -07:00
99209d78a3 STM32 PKA: added include statement 2019-10-09 13:19:57 +02:00
0dfc64678c STM32 PKA: added function prototype 2019-10-09 13:15:56 +02:00
3465a487d3 STM32 PKA fix: remove reverse array operations 2019-10-09 10:22:04 +02:00
89db0da0aa Synchronous Quick Assist Support for Sniffer
1. Fixed a compiler warnings.
2. Fixed a memory issue when using the storage callback with QAT.
2019-10-08 16:49:38 -07:00
b7fe49c8b4 NULL terminate a character sequence 2019-10-08 15:42:39 -07:00
a84fbeae6b Fix for a memory BIO and handle BIO chains 2019-10-08 12:26:54 -07:00
ff15b3cfaa better display of the IPv6 addresses in the sniffer 2019-10-08 11:34:36 -07:00
136bc45857 Update wolfSSL_X509_NAME_print_ex for printing X509_NAME in reverse order 2019-10-07 11:36:00 -07:00
98b8cd35d8 Add ALT_NAMES_OID to switch in wolfSSL_X509_set_ext and update X509V3_EXT_print 2019-10-07 11:29:35 -07:00
b247b4565c Fixes for build warnings with apache httpd 2019-10-07 11:15:55 -07:00
df22115920 Return error with AES-GCM and negotiated versions < TLSv1.2 2019-10-07 08:28:00 -07:00
625bd121f2 Merge pull request #2495 from JacobBarthelmeh/staticmemory
check on if free'ing ctx/method back to heap hint
2019-10-07 08:10:05 -07:00
8ec90339d9 Change the sniffer testsuite to do the IPv6 test when the "-6" option is
on the command line.
2019-10-05 19:26:41 -07:00
f025f08315 Sniffer touches for Windows. 2019-10-04 17:06:35 -07:00
a467c75390 Change the GPL version back to v2 for the quickassist_sync files. 2019-10-04 14:56:42 -07:00
b6b57154e5 Add the new IPv6 sniffer test file to the automake list. 2019-10-04 14:54:17 -07:00
89ff909d73 Sniffer IPv6
1. Sorted out IPv6 configuration for sniff test.
2. Tests the sniffer using an IPv6 file.
2019-10-04 14:54:17 -07:00
ebd435ae46 skip IPv6 extended headers 2019-10-04 14:54:17 -07:00
a5bfb8a18b Change the IP address wrappers to include the version. Makes comparing
easier. Hard-coded some IPv6 localhost tests.
2019-10-04 14:54:17 -07:00
d1d2eb0edd Add IPv6 to the sniffer. 2019-10-04 14:54:17 -07:00
8b21082abe Use wrapper macros for all touches of the sniffer statistics mutex. 2019-10-04 14:54:17 -07:00
1b057df610 When enabling SHOW_SECRETS one of the array counter variables for a
secret had a type mismatch. Changed the index to a word32 to match the
boundary variable's type.
2019-10-04 14:54:17 -07:00
841e469340 Convert the data the snifftest is about to print into printable text.
Anything that isprint() or isspace() is kept, anything else is changed
to a period.
2019-10-04 14:54:17 -07:00
725243b132 Changed how the sniffer calculates the sslFrame size, sslBytes, and the
end of packet pointer. The end of packet pointer is based on sslFrame
and sslBytes. sslBytes is calculated from the total length in the IP
header, rather than the caplen. The caplen may include things like
Ethernet's FCS, which throws packet processing off.
2019-10-04 14:54:17 -07:00
b2fb6d1a81 Move some stats captures to a different location. 2019-10-04 14:54:17 -07:00
3256fef7f9 Sniffer Chain Buffers
1. Fixed an issue when a TLS record is split across two chain buffers.
The second buffer was being treated as a new record.
2. Fixed an issue with STARTTLS_ALLOWED where the input buffer isn't
getting cleared and the skipped data just builds up blocking TLS
records.
2019-10-04 14:54:17 -07:00
53c7f864b2 Add midding function prototype. 2019-10-04 14:54:17 -07:00
b6ca72549c Sniffer Fixes
Added a flag to disable the normally enabled session stats, WOLFSSL_NO_SESSION_STATS.
2019-10-04 14:54:17 -07:00
dea5e73852 Sniffer Chain Input
Add a new method for handling input records where the input is in the form of an iovec list.
2019-10-04 14:54:17 -07:00
62ac388f55 Store Data Callback
Added a callback and support to allow one to handle storing the data
directly without reallocating the data buffer. Also added an example
that uses this callback if the callback is enabled in the build.
2019-10-04 14:54:17 -07:00
98e94a6f0f Added a preprocessor guard around ssl_GetSessionStats(). 2019-10-04 14:54:17 -07:00
a0ad39cf70 Sniffer Stats
Moved the increment of the resume misses statistic.
2019-10-04 14:54:17 -07:00
73273f4fec Sniffer Memory
1. Modify the sniffer code to use XMALLOC and XFREE.
2. Added some new dynamic memory types for the sniffer.
2019-10-04 14:54:17 -07:00
0e1073f622 Sniffer Statistics
Addded two more statistics, cache hits and cache inserts.
2019-10-04 14:54:17 -07:00
4292936efc wolfSSL Global
1. Renamed the global variable tag to WOLFSSL_GLOBAL.
2. Tagged several more global variables with WOLFSSL_GLOBAL.
2019-10-04 14:54:17 -07:00
bbc208ad33 Updated some more globals in the sniffer and session cache with being shared. 2019-10-04 14:54:17 -07:00
a991cc42f4 Add function wolfSSL_get_cipher_name_iana_from_suite() a wrapper around
internal API GetCipherNameIana().
2019-10-04 14:54:17 -07:00
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
743a6ab829 Update the decrypted packet and byte counts. 2019-10-04 14:54:17 -07:00
dd9635d8ff Merge pull request #2469 from embhorn/sk_types
Sk types
2019-10-04 14:44:25 -07:00
30829cec09 Merge pull request #2482 from SparkiDev/cppcheck_fixes_1
Fixes from using cppcheck tool
2019-10-04 14:39:31 -07:00
b213a962e9 Merge pull request #2493 from ejohnstown/sync-qat
Synchronous Quick Assist Support for Sniffer
2019-10-04 11:45:08 -07:00
c26a7ccb68 Fix copy-paste from LTE module 2019-10-04 20:37:38 +02:00
52bf19eefd Added initial support for STM32_PKA ECC accelerator 2019-10-04 20:15:33 +02:00
0d43c1f3d7 Merge pull request #2488 from aaronjense/openssh-fixes
Fix defines that aren't in configure.ac
2019-10-04 10:35:07 -07:00
d48e904c16 Merge pull request #2496 from embhorn/test_ASN1_INTEGER_set
Add conditional check to test_wolfSSL_ASN1_INTEGER_set test case failing for 32-bit platform
2019-10-04 10:33:37 -07:00
48d872187d Synchronous Quick Assist Support for Sniffer
1. Add a HardwareStop for the QAT sync build in wolfCrypt_Cleanup();
2019-10-04 09:01:59 -07:00
a258b84018 Merge pull request #2497 from danielinux/openssl-cleanup
Fix include path issue for openssl compatibility for dh.h.
2019-10-04 08:23:37 -07:00
f47a9c8b20 Add conditional to 64-bit tests 2019-10-04 09:41:48 -05:00
3183ccc0c8 x509.h: include the correct header 2019-10-04 15:04:35 +02:00
5f1dcc3b0c Removed inclusion of openSSL header 2019-10-04 10:22:38 +02:00
82fc96b7f3 adjust onHeap to be a bit field 2019-10-04 08:44:00 +07:00
197b22973b Merge pull request #2490 from dgarske/riscv
Consolidate RISC-V examples and fix `make dist` file error
2019-10-03 15:08:49 -07:00
12bf46296e Consolidate RISC-V examples. Fix make dist file error. 2019-10-03 11:08:50 -07:00
f5a4b82302 Merge pull request #2492 from ejohnstown/titan-cache
Titan Session Cache
2019-10-03 09:52:51 -07:00
177bab84e5 Synchronous Quick Assist Support for Sniffer
1. Add missing deinitializers for the QAT as the sniffer exits.
2019-10-03 09:15:50 -07:00
df2c27af32 check on if free'ing ctx/method back to heap hint 2019-10-03 08:39:18 -07:00
c0a4143942 Titan Session Cache
1. Added a new build option for a TITAN session cache that can hold just over 2 million session entires.
2. Reordered the cache options from largest to smallest.
2019-10-02 14:36:38 -07:00
3b989329cd Merge pull request #2491 from aaronjense/fix-shadow-ret
Fix shadow redeclaration
2019-10-02 12:17:35 -07:00
9a5eb1bb67 Synchronous Quick Assist Support for Sniffer
1. Add configure option for sync IntelQA that uses the crypto callback API.
2. Refactor the IntelQA configure checks so they are usable by both the sync and async options.
3. Make a synchonous copy of the quickassist files.
4. Replace the printfs in the code with a logging macro.
5. Added padding to the AES_KEY structure for WOLF_CRYPTO_CB.
6. Tie in the crypto device to the sniffer.
7. When setting up the symmetric operation, add a build case for the sniffer to use malloc instead of realloc. Sniffer usually uses the middle of another buffer for the input data rather than the beginning of the buffer as it has the TCP/IP data to handle as well.
8. Add the raw key to the DES3 structure.
9. Copy the functions from qa_mem over to qa_sync.
2019-10-02 10:08:46 -07:00
0340b323cd Fix shadow redeclaration 2019-10-02 09:41:06 -06:00
91222bc887 Fix defines that aren't in configure.ac 2019-10-02 09:14:47 -06:00
43e391528d Merge pull request #2489 from ejohnstown/sniffer-etm
Sniffer and Encrypt-Then-Mac
2019-10-02 08:05:25 -07:00
ca817c50aa Merge pull request #2481 from dgarske/nxp_mmcau
Improvements to SHA-1, SHA-256 and MD5 performance
2019-10-01 15:16:50 -06:00
7261ed8b6f Sniffer and Encrypt-Then-Mac
The sniffer doesn't know how to deal with ETM. If the sniffer is enabled, disble ETM.
2019-10-01 13:00:55 -07:00
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
ea68e146c7 Merge pull request #2487 from JacobBarthelmeh/Fuzzer
fix for infinite loop with CSR2
2019-09-30 10:38:26 -07:00
caa5ba7551 Merge pull request #2411 from ejohnstown/wolfrand
wolfRand
2019-09-30 11:11:18 -06:00
056c374f85 Merge pull request #2486 from miyazakh/update_tisp_readme
update tsip porting readme
2019-09-30 10:07:46 -06:00
e7c2892579 fix for infinite loop with CSR2 2019-09-30 21:32:25 +07:00
5486b535d1 update tsip readme 2019-09-29 17:09:08 +09:00
43476e80d4 Merge pull request #2462 from dgarske/webrtc
Support for Google WebRTC
2019-09-27 14:24:11 -07:00
ab4a78fdae Merge pull request #2485 from aaronjense/HAproxy-defines
Fix defines for HAProxy build
2019-09-27 14:37:42 -06:00
4c89a21d12 Updates from peer review. Refactor to combine some BIO elements into ptr. Revert change to BIO_set_fd. 2019-09-27 11:19:42 -07:00
b47039b7ec Fix for possible unused local32 warning. 2019-09-27 09:22:18 -07:00
bfa20c53b0 Fix defines for HAProxy build 2019-09-27 09:18:27 -06:00
937a344682 Merge pull request #2484 from SparkiDev/armv8-x18-redo
Refix stopping use of x18 register
2019-09-26 18:55:59 -07:00
5bcf54b9e2 Refix stopping use of x18 register 2019-09-27 09:41:54 +10:00
1f393c9dde Merge pull request #2483 from JacobBarthelmeh/BuildOptions
early data and enc-then-mac build fixes
2019-09-27 08:00:53 +10:00
78f6bbcdb8 Adjusted the alignement macro to use WC_HASH_DATA_ALIGNMENT for shared settings across hash algos. 2019-09-26 11:53:24 -07:00
6bfe6761d8 Disable the new hashing aligned build option by default. Does not increase performance... the memcpy is faster than the alignment check on modern CPU's. Embedded systems may benefit from this though, so leaving support for it in place. 2019-09-26 11:49:33 -07:00
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
a1b324f7f8 Adding sk_free support for CONF_VALUE 2019-09-26 11:28:59 -05:00
9571f2fce8 Merge pull request #2447 from SparkiDev/sp_const
Change static globals to const where possible
2019-09-26 09:11:23 -07:00
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
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
a5f9d38c0d Remove the BIO method custom... its not compat. Fix bio->ptr to be void*. 2019-09-26 08:42:35 -07:00
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
42d04a36d6 Change static globals to const where possible
Change parameters to functions to be const where possible (and
necessary).
2019-09-26 23:05:02 +10:00
4a6925e2ef Merge pull request #2480 from dgarske/nightly_20190925
Fixes for minor build issues
2019-09-26 17:34:21 +10:00
c6c7f67dfd add check on AEAD only mode with enc-then-mac functions 2019-09-26 12:30:17 +07:00
8139fbd026 early data and enc-then-mac build fixes 2019-09-26 12:12:19 +07:00
f1b68873ef add check on dependencies for tests 2019-09-26 11:43:12 +07:00
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
9d05e9c0b7 Fixes for minor nightly build tests. 2019-09-25 11:07:32 -07:00
bcd8a521f5 Merge pull request #2479 from tmael/aes_gcm
Initialize AES GCM set key
2019-09-20 14:34:25 -07:00
425548565f Fix after rebase 2019-09-20 16:16:10 -05:00
f01e943448 Adding support for STACKOF(CONF_VALUE) 2019-09-20 16:06:13 -05:00
082d0e459d Updates from review 2019-09-20 16:04:14 -05:00
793df114f3 Adding stack object type support to sk_value 2019-09-20 16:02:58 -05:00
74386fd0d0 Initialize GCM AAD in case wc_AesInit() wasn't called 2019-09-20 12:04:33 -07:00
b92509144b Merge pull request #2475 from dgarske/qat_key
Fixes and improvements for async
2019-09-20 10:44:33 -07:00
54cdab8005 Initialize AES GCM set key 2019-09-20 10:17:08 -07:00
8636bac12f Merge pull request #2478 from miyazakh/fix_iar_build
Fix build failure on IAR EWRX
2019-09-20 09:01:56 -06:00
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
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
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
2f818f9508 Fix build failure on IAR EWRX 2019-09-20 09:07:51 +09:00
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
3b6112e317 Fixes for using Keil with single precision math. 2019-09-19 14:34:30 -07:00
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
33a83cdba0 Merge pull request #2436 from miyazakh/Renesas_TSIP_Port
Support renesas tsip
2019-09-19 14:44:33 -06:00
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
fd1d65c4f9 Merge pull request #2470 from SparkiDev/build-fixes
Fixes from overnight build failures
2019-09-19 13:38:25 -07:00
cc452adff1 Merge pull request #2465 from JacobBarthelmeh/Fuzzer
sanity check on length before read
2019-09-19 13:34:42 -07:00
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
ab86e78cbe Merge pull request #2458 from JacobBarthelmeh/Certs
macro guards for re-defines
2019-09-19 12:54:26 -07:00
6aecdf59c1 Fixes for async build and tests. 2019-09-19 12:30:05 -07:00
ae25027135 Fix for TLS v1.3 and PK callbacks. 2019-09-19 12:07:14 -07:00
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
f532143094 adjust CheckASNTag to be GetASNTag 2019-09-19 02:09:51 -06:00
5c5aa45a5e addressed review comments
tsip_usable() reconstruction
2019-09-19 14:35:23 +09:00
a37b604da9 addressed review comments 2019-09-19 11:18:52 +09:00
63d61c490d addressed review comments 2019-09-19 11:18:52 +09:00
a6b2d1621b Free memory for a msg buffer when calling wc_ShaxxxFree() 2019-09-19 11:18:52 +09:00
778a2065ab Replaced key information by dummy data 2019-09-19 11:18:52 +09:00
cb0184fe98 update Readme, added file header etc 2019-09-19 11:18:52 +09:00
a292e69d3f update readme 2019-09-19 11:18:52 +09:00
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
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
bdbe0943cf Add function to print network interface and IP Address 2019-09-18 19:57:19 +01:00
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
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
f0e774d1e1 Merge pull request #2420 from kojo1/KDS-proj
add KDS sample project
2019-09-17 11:53:04 -04:00
bdad0fa53f Merge pull request #2443 from miyazakh/fix_esp_examples
Fixed examples for esp-idf
2019-09-17 11:47:39 -04:00
0e5de0c076 Fix to only AddCA when its CA type and veryNone is not set. 2019-09-17 07:56:02 -07:00
2c2907c2a5 Enc-Then-MAC: when message size is less than digest size return error 2019-09-17 11:23:43 +10:00
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
708556d5c7 adjust sha3 typedef 2019-09-16 10:40:56 -06:00
3b7b81fea7 add local CheckASNTag function 2019-09-15 23:06:11 -06:00
326f02d76d Fix for buffer overrun check logic. 2019-09-15 23:04:13 -06:00
e6c48327c1 sanity check on length before read 2019-09-15 23:04:13 -06:00
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
9d69f17f17 Merge pull request #2468 from tmael/RSA_inline
Fix for RSA inline
2019-09-13 13:46:33 -07:00
9d3d170411 Merge pull request #2456 from dgarske/freedom_unleashed
Support for SiFive HiFive Unleashed board
2019-09-13 11:58:11 -07:00
40fc86dfd2 Merge pull request #2464 from SparkiDev/rshift_neg
Use constant time comparison in MaskMac with scanStart and macStart
2019-09-13 11:56:12 -07:00
a2d3da2831 Merge pull request #2463 from ejohnstown/maintenance-dtls
Maintenance DTLS
2019-09-13 11:53:20 -07:00
6894dde4e9 Merge pull request #2460 from dgarske/debug_buffer
Improvements to `WOLFSSL_BUFFER` function
2019-09-13 11:49:20 -07:00
b70f22e21a 1. Use the session deallocator on the deserialized session in the client.
2. Free the flatten session if the size check fails.
2019-09-12 16:04:34 -07:00
09541082d6 Merge pull request #2416 from kojo1/OCSP-error
Detail error code
2019-09-12 16:51:34 -04:00
4e62d1f509 Fix for RSA inline 2019-09-11 22:57:54 -07:00
c27a4b3865 TLS Maintenance
When serializing the WOLFSSL_SESSION, serialize everything.
2019-09-11 16:44:54 -07:00
852d50adcf DTLS Maintenance
To go with the fix for the functions wolfSSL_(i2d|d2i)_SSL_SESSION,
modify the example client to use a serialized session record for
resumption instead of the direct reference into the session cache. This
change only happens when OPENSSL_EXTRA and HAVE_EXT_CACHE are defined.
2019-09-11 15:29:57 -07:00
2a1a9f36cc Use constant time comparison in MaskMac with scanStart and macStart
Right shift of a negative value is undefined.
Add an 'int' return version of constant time greater than equal.
Change equal and not equal to be constant time in more situations.
2019-09-11 10:57:23 +10:00
ed06f34f55 Updated benchmarks running at 1.5GHz (default is 1 GHz). 2019-09-10 16:09:18 -07:00
22c398494e DTLS Maintenance
The options to switch on and off the code to serialize/deserialize items
in the struct need to match the options for the struct.
(ZD5130, ZD5590)
2019-09-10 16:01:48 -07:00
e93e3b60da DTLS Maintenance
Allow the DTLS server to retransmit a stored flight of messages in an additional acccept state.
(ZD5644)
2019-09-10 11:51:38 -07:00
def36ddfe8 Added instructions for installing Debian on Unleashed board. 2019-09-10 09:16:35 -07:00
66b76a4420 Improvements to WOLFSSL_BUFFER function to eliminate recursive call and use snprintf for string safety. Adds support for build-time change of LINE_LEN. 2019-09-10 08:57:35 -07:00
645f8ddd31 Update RISC 64-bit detection to use __riscv_xlen. 2019-09-10 07:47:28 -07:00
eb2aa3dce1 macro guards for re-defines 2019-09-09 19:24:45 -06:00
99252cc936 Merge pull request #2399 from dgarske/ovs
Compatibility changes for OpenVSwitch
2019-09-09 16:02:27 -07:00
95d3289fa2 Merge pull request #2437 from kaleb-himes/ZD_5546_IAR_CC_CHECK
Fix failing IAR builds, thanks to Joseph C. for the report
2019-09-09 11:42:19 -07:00
88036db223 Visual Studio Solution for Azure Sphere Devices 2019-09-09 10:50:56 -06:00
ab5c12fd17 Added parenthesis around types.h pointer size macro. 2019-09-09 09:01:18 -07:00
c0317ad198 Fix to only expose SSL_want when OPENSSL_EXTRA is defined. 2019-09-09 08:07:30 -07:00
342d03a294 Added SSL_want. 2019-09-09 08:07:30 -07:00
2cf26a1353 Compatibility changes for OpenVSwitch. 2019-09-09 08:07:30 -07:00
c52801754c Fips ready (#2422)
* Changes to update stunnel support

* Required additions for building fips-ready with speedups

* Fix SetASNIntRSA
2019-09-09 02:47:02 -07:00
02419e248f Fix clang 3.8 arm (#2449)
* Fix 'value size does not match register size' error in clang with arm assembly

* More readable casting
2019-09-09 02:46:48 -07:00
87d0c70695 erase compiler complaint, not used var 2019-09-09 08:25:02 +09:00
7433b20d43 renamed wolfSSL_CTX_IsPrivatePkSetForkeyType to wolfSSL_IsPrivatePkSet 2019-09-09 08:25:02 +09:00
348be7fb00 Fix jankis test, known customer config. complaining unused var 2019-09-09 08:25:02 +09:00
82d531562c Fixed build warnings due to esp-idf update
Fixed server application TLS communicatio failure
2019-09-09 08:25:02 +09:00
4c88d94d13 Chacha20 and poly1305 without x18 (#2454)
* Remove use of x18 and organize new optimizations

* Fix invalid operand
2019-09-08 16:03:04 -07:00
afb15f6521 Merge pull request #2455 from JacobBarthelmeh/HardwareAcc
change detection of AESNI support to read bit 25 from ECX
2019-09-09 08:29:00 +10:00
ebe99cf5ef Support for SiFive HiFive Unleashed board. 2019-09-06 16:04:34 -07:00
37328544ad Merge pull request #2453 from SparkiDev/armv8_x18
ARM64 assembly - x18 not able to be used
2019-09-06 15:45:02 -07:00
85b123046b Merge pull request #2377 from SparkiDev/sha2_cs_oldtls
Disallow SHA-2 ciphersuites from TLS 1.0 and 1.1 handshakes
2019-09-06 15:41:15 -07:00
3e12d260b8 ARM64 assembly - x18 not able to be used
Fix Curve25519/Ed25519, SHA-512 and SP code to not use x18.
2019-09-06 15:49:24 +10:00
a975ba9e97 Disallow SHA-2 ciphersuites from TLS 1.0 and 1.1 handshakes 2019-09-06 09:31:14 +10:00
171902f1fb change detection of AESNI support to read bit 25 from ECX 2019-09-05 17:02:44 -06:00
1785089798 Merge pull request #2433 from kaleb-himes/ZD_5602_MINGW_XSNPRINTF
Resolve XSNPRINTF unconditional use in asn.c breaking mingw32 builds
2019-09-05 11:37:21 -07:00
d6685edfa0 Merge pull request #2440 from SparkiDev/tlsfuzzer_fixes
Fixes for fuzz testing
2019-09-05 09:01:10 -07:00
eaeaaf12c1 Merge pull request #2446 from SparkiDev/gplusplus_fix_1
Fixes for g++ compilation
2019-09-04 16:28:42 -07:00
bf7296aefb Merge pull request #2438 from SparkiDev/armv8-poly1305-clang
Fix ARMv8 Poly1305 inline assembly code to compile with clang 3.5
2019-09-04 16:28:02 -07:00
56df8162bd Fixes for g++ compilation 2019-09-04 10:09:36 +10:00
b35fd4f1aa Merge pull request #2441 from JacobBarthelmeh/UnitTests
strncpy gcc warning fixes
2019-09-03 15:44:10 -07:00
0927f93b07 Merge pull request #2442 from JacobBarthelmeh/HardwareAcc
build fix for aesccm + devcrypto=cbc + wpas and afalg
2019-09-03 15:42:41 -07:00
b19e785c2c Merge pull request #2418 from dgarske/sha3_keccak256
Added support for older KECCAK256
2019-09-03 15:42:05 -07:00
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
03967d62f4 sanity check on resulting ecc size 2019-09-03 10:54:11 -06:00
46790080a7 Fix ARMv8 Poly1305 inline assembly code to compile with clang 3.5 2019-09-02 09:52:25 +10:00
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
9fd38dc340 build fix for aesccm + devcrypto=cbc + wpas and afalg 2019-08-30 16:15:48 -06:00
2a750cd18d strncpy gcc warning fixes 2019-08-30 13:34:51 -06:00
ef20276ab5 Merge pull request #2424 from SparkiDev/enc_then_mac
Add support for Encrypt-Then-MAC to TLS 1.2 and below
2019-08-30 11:09:04 -07:00
adc548fc61 Merge pull request #2428 from ejohnstown/ecckey-test-fix
Fix ECC key decode test
2019-08-30 11:07:00 -07:00
347a859ffc Merge pull request #2435 from JacobBarthelmeh/SanityChecks
sanity check on ticket encrypt callback
2019-08-30 10:18:58 -07:00
09f80c7f5f Merge pull request #2439 from miyazakh/fix_espidf_issues
Fix build warnings while compiling wolfssl under esp-idf
2019-08-29 16:24:42 -06:00
db2468154f Merge pull request #2434 from tmael/phase2_compatibility_APIs
Adding phase 2 compatibility APIs
2019-08-29 12:26:27 -07:00
b8d2ccee83 Merge branch 'master' into phase2_compatibility_APIs 2019-08-29 09:16:41 -07:00
9034e3a0fe Merge pull request #2432 from embhorn/api_p2
Adding compatibility API phase 2
2019-08-29 09:05:01 -07:00
5f77627857 Fix SetASNIntRSA 2019-08-29 16:24:09 +02:00
d6bac37def Fix build warnings while compiling wolfssl under esp-idf 2019-08-29 17:44:44 +09:00
24e98dd05e Add support for Encrypt-Then-MAC to TLS 1.2 and below
An extension is used to indicate that ETM is to be used.
Only used when doing block ciphers - HMAC performed on encrypted data.
2019-08-29 09:00:30 +10:00
87e876d8c6 Match padding macro values and restore EVP non-AES-GCM 2019-08-28 15:45:07 -07:00
46b4654564 Fix failing IAR builds, thanks to Joseph C. for the report 2019-08-28 12:44:05 -06:00
a76f719aac Fix review comment 2019-08-28 10:42:57 -07:00
411f15bec3 Merge pull request #2429 from cconlon/cmssig
Add internal PKCS7 content digest check
2019-08-28 09:41:10 -06:00
0c9ba1b361 Adding compatibility API phase 2 2019-08-28 09:29:49 -05:00
625c3074b9 Review comments, sanity check 2019-08-27 17:06:36 -07:00
59dddda3a9 Updated with review comments 2019-08-27 15:37:00 -07:00
dc5d11fef4 Updated with review comments 2019-08-27 15:14:58 -07:00
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
4ec90be4d6 Added --enable-hashflags option. 2019-08-27 13:28:33 -07:00
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
e6252a94ce check attrib->value and attrib->valueSz before use 2019-08-27 14:18:23 -06:00
f9e364f893 Updated wolfSSL_EVP_Cipher() for AES GCM 2019-08-27 11:36:39 -07:00
10431738c7 sanity check on ticket encrypt callback 2019-08-27 11:41:27 -06:00
208e9f3fcf Fix Windows build 2019-08-27 08:49:27 -07:00
e9d1f32441 Fix Windows build 2019-08-27 08:11:31 -07:00
e8f468e2cf correct ifdef directive 2019-08-26 19:17:41 -07:00
00dadafddb Add HAVE_FAST_RSA around RSA_print() 2019-08-26 16:54:10 -07:00
6f9210d6af Peer review feedback changes
Case ```__GNUC__``` already covered, just check for MINGW or CYGWIN cases now.
2019-08-26 16:53:52 -06:00
b2555d38bc Jenkins PRB enable options test 2019-08-26 15:43:58 -07:00
9b3fee223f Typecast to correct type 2019-08-26 14:17:13 -07:00
6311ae425c RSA_generate_key() needs WOLFSSL_KEY_GEN 2019-08-26 13:47:54 -07:00
0f60ee8a85 Merge pull request #2402 from schlatterbeck/master
Fixes for 16-bit systems
2019-08-26 12:41:47 -07:00
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
ea4e7b2669 Resolve XSNPRINTF unconditional use in asn.c breaking mingw32 builds 2019-08-26 13:19:53 -06:00
256ac4a515 Merge pull request #2427 from miyazakh/fix_espbuild_failure
fix uninitialized var for esp idf build failure fix
2019-08-26 10:11:44 -06:00
61d01ab7f3 add unit test for PKCS7 invalid detached content 2019-08-26 09:43:20 -06:00
76b9476b9a Remove debug printf. 2019-08-23 16:24:45 -07:00
99329b0fc4 Improvements to the CRL verify handling. 2019-08-23 16:09:39 -07:00
12687e5a2a internally check PKCS7 content digest against messageDigest attribute 2019-08-23 16:40:12 -06:00
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
1bad2bed3c Merge pull request #2404 from dgarske/strict_cipher
Added strict cipher suite check on client server_hello processing
2019-08-23 12:42:57 -07:00
681de3e41a Merge pull request #2375 from dgarske/stm32_cubemx_halv2
Fixes for STM32F7 and latest CubeMX HAL
2019-08-23 12:28:51 -07:00
6209e8ff24 Merge pull request #2412 from JacobBarthelmeh/PKCS12
adjust wc_i2d_PKCS12 API
2019-08-23 10:30:04 -07:00
63538fedde Required additions for building fips-ready with speedups 2019-08-23 10:22:31 -07:00
54fb08d6df Merge pull request #2426 from JacobBarthelmeh/Fuzzer
sanity check on buffer size before reading short
2019-08-23 10:17:31 -07:00
2ba6c66d44 Fix ECC key load test
When using the configure options '--enable-certgen --enable-certext CPPFLAGS=-DWOLFSSL_VALIDATE_ECC_IMPORT', the ecc_decode_test() will fail the "good" test case. It is using the point (1, 1) in the test, and that fails the key validation. Changed the good key to one of the keys we have in the certs directory. The additional validation checks that the point is on the curve, and is validated in FIPS mode.
2019-08-22 14:18:59 -07:00
8b2a1f13c4 fix uninitialized ver for esp idf build failure fix 2019-08-23 06:08:11 +09:00
0e6bb4717e Merge pull request #2425 from JacobBarthelmeh/SanityChecks
sanity check on buffer size
2019-08-22 12:30:06 -07:00
b83aebafb1 help out static analysis tool 2019-08-22 11:49:10 -06:00
65aeb71d6c sanity check on buffer size before reading short 2019-08-22 11:36:35 -06:00
c6e4aebcdf sanity check on buffer size 2019-08-22 09:23:02 -06:00
cf83561b64 Merge pull request #2417 from SparkiDev/sp_mod_exp_cast_fix
SP Mod exp cast fix
2019-08-22 05:55:27 -07:00
6544b5df88 Merge pull request #2423 from SparkiDev/fe_math_mac
Curve25519/Ed25519 x86_64 assembly working on Mac again
2019-08-22 05:54:49 -07:00
132f60e77f Curve25519/Ed25519 x86_64 assembly working on Mac again 2019-08-22 09:27:39 +10:00
37f1522825 Changes to update stunnel support 2019-08-21 16:18:04 -07:00
05d86ade20 Merge remote-tracking branch 'wolfSSL/master' 2019-08-21 16:17:55 -07:00
e298b3290d Fix to initialize hash flag. 2019-08-21 06:36:37 -07:00
7deab4c54f add KDS sample project 2019-08-21 11:12:09 +09:00
67c3751836 Adds new wolfSSL_CTX_UseSecureRenegotiation API for setting secure renegotiation at the WOLFSSL_CTX level. 2019-08-20 16:43:28 -07:00
a5d222a20e Make public the hash set/get flags functions. 2019-08-20 16:25:48 -07:00
154930d128 Added support for older KECCAK256 used by Ethereum. Uses existing hash flag API's.
To use add build flag `CFLAGS="-DWOLFSSL_HASH_FLAGS"`.

Example:

```c
wc_Sha3_SetFlags(&sha, WC_HASH_SHA3_KECCAK256);
```
2019-08-20 16:14:37 -07:00
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
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
5530336617 SP Mod exp cast fix 2019-08-20 08:50:57 +10:00
fd0390430d Give error code resolution to wolfSSL_CertManagerCheckOCSPResponse 2019-08-20 07:22:54 +09:00
01a3b59e28 fix cast and initialization of variable 2019-08-19 14:54:53 -06:00
3e1c103c78 Added support for loading a PKCS8 ASN.1 formatted private key (not encrypted). 2019-08-16 16:09:00 -07:00
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
7d4023f6a1 Merge pull request #2408 from dgarske/coverity
Minor fixes to resolve Coverity static analysis checks
2019-08-16 14:45:13 -07:00
487e66394e adjust wc_i2d_PKCS12 API 2019-08-16 15:19:33 -06:00
3f992ce39d Additional STM32F7 fixes with HALv2. 2019-08-16 12:31:28 -07:00
eb68ad162b Enable strict cipher suite checking by default. Changed to enable by default and can be disabled using WOLFSSL_NO_STRICT_CIPHER_SUITE. 2019-08-16 10:20:25 -07:00
e8986f389f wolfRand
1. Updated fips-check.sh to make an archive for wolfRand.
2. Updated configure.ac to provide a wolfRand build.
2019-08-16 09:33:41 -07:00
dea4f2fb1a Merge pull request #2410 from SparkiDev/poly1305_x64_fix
Fix Poly1305 on Intel AVX2
2019-08-16 09:08:27 -07:00
8454bd1077 Fix Poly1305 on Intel AVX2
Fix define checks for other x86_64 assembly code files
2019-08-16 17:42:19 +10:00
0d13b385ab Fixes for possible cases where DerBuffer is not free'd in AddCA error cases. 2019-08-15 17:01:30 -07:00
aee766e11b Minor fixes for AES GCM with GMAC and STM32 HALv2. 2019-08-15 16:57:38 -07:00
e7f0ed4b98 wolfRand
1. Excluded wc_encrypt.c from the wolfRand build.
2019-08-15 16:22:16 -07:00
9d53e9b6d5 wolfRand
1. Add fips.h to the install if doing a wolfRand build.
2019-08-15 16:22:16 -07:00
63fe2a219e wolfRand
In configure.ac,
1. Change some whitespace in the FIPS enable section.
2. Reorganize the FIPS section a little bit.
3. When enabling wolfRand, also force cryptonly.
4. Treat wolfRand like FIPSv2 at build time.
In the source include.am,
5. Add checks against BUILD_FIPS_RAND as appropriate.
6. Add the SHA-256 assembly to the wolfRand source list.
2019-08-15 16:22:16 -07:00
a229e1e8e4 wolfRand
1. Rearrange some of the macros in the FIPS section to separate out the
different flavors of FIPS with their own flags to set them apart.
2. Add automake flags for FIPSv1 and wolfRand.
2019-08-15 16:22:16 -07:00
0931b574a7 wolfRand
1. Refactored src/include.am to use the new changes in configure for
multiple FIPS versions.
2. Added conditions for wolfRand.
2019-08-15 16:22:16 -07:00
14316f8e24 wolfRand
Refactor the configure.ac script to make adding additional FIPS options
easier.
2019-08-15 16:22:16 -07:00
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
51c31695bd Merge pull request #2391 from SparkiDev/tfm_dh_2
Specialized mod exponentiation for base 2 in tfm.c and integer.c
2019-08-15 15:59:20 -07:00
b06dbf16c2 Merge pull request #2397 from JacobBarthelmeh/PKCS7
updates to CMS and callback functions
2019-08-15 15:56:41 -07:00
089ca6d6e8 Merge pull request #2403 from JacobBarthelmeh/HardwareAcc
build with devcrypto and aesccm
2019-08-15 15:54:41 -07:00
0a1a81ab42 Merge pull request #2407 from embhorn/api_p1_2
Adding phase 1 API from other projects
2019-08-15 14:13:10 -07:00
1b841363cc Adding tests 2019-08-15 12:27:23 -05:00
ed7ac6fb26 Coverity fixes to make static analysis happy. 2019-08-14 15:42:47 -07:00
b2b24a06f3 Adding API 2019-08-14 15:09:17 -05:00
cb33ada380 Merge pull request #2395 from embhorn/api_p1
Adding compatibility API phase 1
2019-08-13 17:19:22 -07:00
e75417fde1 Added build option to enforce check for cipher suite in server_hello from server. Enabled using WOLFSSL_STRICT_CIPHER_SUITE. Some cipher suites could be allowed if they were supported a build-time even though not sent in the cipher suite list in client_hello.
Example log output for test case where `client_hello` sent a cipher suite list and server choose a cipher suite not in the list:

```
wolfSSL Entering DoServerHello
ServerHello did not use cipher suite from ClientHello
wolfSSL Leaving DoHandShakeMsgType(), return -501
wolfSSL Leaving DoHandShakeMsg(), return -501
```

RFC 5246: 7.4.1.3: Server Hello:  `cipher_suite: The single cipher suite selected by the server from the list in ClientHello.cipher_suites.`
2019-08-13 15:56:19 -07:00
48fa6a458c Adding compatibility API phase 1 2019-08-13 17:09:56 -05:00
fa79ef0940 Merge pull request #2396 from tmael/expanding_OpenSSL_compatibility
Phase 1 of the OpenSSL Compatibility APIs
2019-08-13 14:56:09 -07:00
e8e1d35744 build with devcrypto and aesccm 2019-08-13 14:12:45 -06:00
9301cce9ac Check a null pointer dereference 2019-08-13 11:48:20 -07:00
b1ad0525ea cast to correct static analysis issue 2019-08-13 10:45:24 -07:00
b7bd710bc8 Add small stack option 2019-08-13 10:29:37 -07:00
1acd24deb8 Review comment to reduce stack usage 2019-08-13 10:15:57 -07:00
b9ddbb974a perform domain name check on the peer certificate 2019-08-13 09:55:28 -07:00
20d9d5b0da account for KARI bundle without CERT when callback is set 2019-08-12 17:37:09 -06:00
883d5778a3 handle optional parameters with KARI ECC key 2019-08-12 16:41:35 -06:00
f4d9991e3a remove restriction on key wrap type with callback 2019-08-12 15:34:20 -06:00
63c6c47165 Fixes for 16-bit systems
Systems with sizof(int) == 2 default to expressions with that size.
So we have to do some explicit casts or use unigned long constants in
some cases.
In ssl.h the prototype of a function was not matching the definition.
This resulted in a type incompatibility on a 16-bit system.
2019-08-10 18:27:29 +02:00
6054a851ce move decrypt content callback function to more generic spot 2019-08-09 17:38:30 -06:00
e7c6fc221d Fixes to handle byte swapping on Key and IV for STM32F7 with latest CubeMX. 2019-08-09 15:40:26 -07:00
0a4ac0e380 Merge pull request #2401 from SparkiDev/aesni_null_iv
Set the IV to zero when NULL IV and using AESNI
2019-08-09 12:57:48 -07:00
d4cf6e37e8 DH base 2 impl - better error handling 2019-08-09 12:12:59 -06:00
dd48c825ed Constant compare the HMAC result when using NULL cipher and TLS 1.3 2019-08-09 11:50:07 -06:00
34fe643938 Set the IV to zero when NULL IV and using AESNI 2019-08-09 11:23:14 -06:00
1396ca085b Merge pull request #2400 from dgarske/pkcs7_typo
Fix for dynamic type typo in PKCS7
2019-08-09 10:34:41 -06:00
8e4fa1c786 Fix for dynamic type typo in PKCS7. 2019-08-08 20:14:39 -07:00
4bff2b6bef Fixed valgrind issue 2019-08-06 15:49:36 -07:00
1371fc8327 Review comments 2019-08-06 13:23:18 -07:00
c1938969aa Convert to pointer to pass static memory 2019-08-06 10:47:30 -07:00
000c38ae1f Use wolfSSL_PKCS7_free, not wc_PKCS7_Free 2019-08-06 07:46:57 -07:00
eccc85b9fa Add NO_RSA conditional 2019-08-05 17:51:31 -07:00
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
8e83fb2e67 Fix to resolve AES GCM auth calucation for GMAC where no in/out data is used. 2019-08-05 14:03:02 -07:00
99ddf65a96 add decrypt callback to wc_PKCS7_DecodeEnvelopedData 2019-08-05 10:49:15 -06:00
ab4924b86b Merge pull request #2388 from SparkiDev/sp_ccc_table_size
Fix precomputation tables to not include infinity field.
2019-08-05 08:39:58 -07:00
4f714b9788 Add a timing resistant version
Make mod operations work on the same bit size as closely as possible.
Check fp_mod return in first use.
2019-08-05 10:57:40 +10:00
c34657b20f Merge pull request #2390 from dgarske/altname
Fix for scan-build warning with altName->name possible use of NULL
2019-08-02 15:49:13 -07:00
6f54a2ec6b Merge pull request #2389 from dgarske/crypt_init_count
Fixes for wolfCrypt init/cleanup reference count
2019-08-02 15:48:36 -07:00
9acd952ea1 Merge pull request #2374 from dgarske/ecc_params
ECC improvement to get curve param and example curve macro check fix
2019-08-02 15:44:20 -07:00
31461dbfb5 Merge pull request #2373 from dgarske/mpint
Improvements to atoi, mp_int allocations and STSAFE-A100 error handling
2019-08-02 15:43:20 -07:00
da6fa384d4 Merge pull request #2273 from danielinux/Riot-OS-GNRC
RIOT-OS support with GNRC TCP/IP sockets
2019-08-02 15:42:11 -07:00
f5c1c33dba Fixes for newer STM CubeMX HAL for STM32F7. 2019-08-02 15:12:09 -07:00
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
18002d4545 Merge pull request #2387 from JacobBarthelmeh/Benchmark
fix help print out of benchmark
2019-08-02 08:24:47 -07:00
d1fbdb3ddf Added API unit test for wc_ecc_get_curve_params. 2019-08-02 06:20:14 -07:00
0e1d81e63f Added ability to define your own XATOI 2019-08-02 06:16:41 -07:00
b4673344c0 Adds new wc_ecc_get_curve_params API for getting the ecc_set_type params for a curve index. Fix for example client and server using wrong macro for detecting ECC 256-bit enabled. 2019-08-02 05:50:00 -07:00
2a22179068 Specialized mod exponentiation for base 2 in tfm.c and integer.c 2019-08-02 15:50:08 +10:00
51dfc35aac TLS 1.3 and Integrity-only ciphersuites 2019-08-02 11:00:18 +10:00
3cf30f1e96 Fix to allow proper calling with counts for wolfCrypt_Init and wolfCrypt_Cleanup. Old code was not tracking case such as wolfCrypt_Init -> wolfCrypt_Init -> wolfCrypt_Cleanup and was causing cleanup to be performed, when it shouldn't. 2019-08-01 12:44:03 -07:00
fb8fc4d800 Fix for scan-build warning with altName->name possible use of NULL pointer. 2019-08-01 11:54:28 -07:00
4f0fd2c2f9 Merge pull request #2302 from SparkiDev/ecc_pubkey_check
Add checks of public key for ECC and curve25519
2019-08-01 11:50:02 -07:00
7098fdff29 Merge pull request #2382 from SparkiDev/dsa_ct
Use a fixed number of bits with DSA gen and sign
2019-08-01 11:48:53 -07:00
a8d2b6b3c8 Removed exception for EXIT_TEST in RIOT 2019-08-01 15:50:16 +02:00
34b2d257cd [RIOT-OS/GNRC] Renamed GNRC callback functions 2019-08-01 15:50:16 +02:00
e77161ae9a Riot-OS/GNRC support: reworked after reviewers' comments 2019-08-01 15:50:16 +02:00
1db036eb75 RIOT-OS support with GNRC UDP/IP sockets 2019-08-01 15:50:16 +02:00
1792fe34b9 Fix precomputation tables to not include infinity field.
Fixes to ARM code
- put in it instruction before conditional for old compilers.
- fix small code size version of compare
- handle not being able to shift by the full size - want result to be
zero
Casts as required by compiler to reduce bit size explicitly.
2019-08-01 20:53:41 +10:00
6a52e0a138 fix help print out of benchmark 2019-07-31 11:47:26 -06:00
c400c38588 Merge pull request #2381 from SparkiDev/tls13_sv
Check suite size length is valid as well as space for compression
2019-07-30 16:04:00 -07:00
d4ab1c7e86 Merge pull request #2383 from SparkiDev/sp_dh_2
Special implementation of mod exp when base is 2 in SP
2019-07-30 16:02:38 -07:00
dcab47efd8 Improve wc_curve25519_check_public function doc 2019-07-31 08:44:43 +10:00
81a9779fc4 Merge pull request #2385 from dgarske/minor_items
Minor cleanups for spelling and cast warnings
2019-07-30 15:22:29 -07:00
8b8cc41a1a Merge pull request #2384 from JacobBarthelmeh/PKCS7
add aditional sanity checks on buffer
2019-07-30 15:21:09 -07:00
0a60c2bb2c Merge pull request #2379 from JacobBarthelmeh/sessionExport
reduce size of state only save and add option to remove peer info
2019-07-30 15:09:39 -07:00
21c8ad03d3 Merge pull request #2378 from SparkiDev/tls13_nopskdheke_ks_fix
Fix for TLS 1.3 to always send Key Share
2019-07-30 15:08:38 -07:00
f314613fa1 Merge pull request #2376 from SparkiDev/dsa_sign
Generate k for DSA signature as per FIPS 186-4 B.2.2
2019-07-30 15:06:26 -07:00
91251eb319 Fixes for minor compiler cast warnings. 2019-07-29 08:14:27 -07:00
e3653a7a07 Various spelling corrections. 2019-07-29 08:14:07 -07:00
23af4e92f3 Special implementation of mod exp when base is 2 in SP 2019-07-29 12:58:07 +10:00
ec18ae0fbc add aditional sanity checks on buffer 2019-07-28 19:21:09 -06:00
4778dac49f Add checks of public key for ECC and curve25519 2019-07-29 10:42:44 +10:00
d7b893f250 Use a fixed number of bits with DSA gen and sign 2019-07-29 09:33:11 +10:00
741d7bdb67 Check suite size length is valid as well as space for compression 2019-07-29 08:47:45 +10:00
ca87861915 reduce size of state only save and add option to remove peer info 2019-07-26 14:54:44 -06:00
9e26bc40bb Generate k for DSA signature as per FIPS 186-4 B.2.2 2019-07-26 09:08:23 +10:00
8ce2dd4bf7 Additional STSAFE return code cleanups. 2019-07-25 08:22:31 -07:00
fe598fc6fc Improvements to the STSAFE-A100 error code handling. 2019-07-24 09:01:44 -07:00
2cd64c748a Only require XATOI for build-cases that need it. 2019-07-23 15:36:59 -07:00
b658f2e7c3 Refactor for all fp_int and mp_int allocations to use DYNAMIC_TYPE_BIGINT. This allows customers to setup a static pool for these allocations if desired. 2019-07-23 15:36:59 -07:00
b0444bcfa1 Refactor to add XATOI for standard library function. 2019-07-23 15:36:59 -07:00
50fbdb961f Merge pull request #2366 from JacobBarthelmeh/Release
updating readme and prepare for release
2019-07-23 11:03:29 -07:00
77fda069a8 prepare for release version 4.1.0 2019-07-23 09:27:39 -06:00
2befc9d68f fix for build with WOLFSSL_EXTRA 2019-07-23 09:27:39 -06:00
13957e7762 update server-ecc-self.pem before/after dates 2019-07-23 09:27:39 -06:00
589b056ecb update gitignore and location of test cleanup 2019-07-23 09:27:39 -06:00
8f5a0dc66a Merge pull request #2370 from SparkiDev/arm64_fixes
Fix for AARCH64 on Linaro
2019-07-23 09:26:56 -06:00
f8e2285ab8 Fix for AARCH64 on Linaro
Poly1305 using [wx]29 corrupts data - use [wx]30.
WOLFSSL_ARMASM is an ASM flag as well.
2019-07-23 09:56:18 +10:00
7ca9b23b76 Merge pull request #2361 from dgarske/bench_vs
Fixes for wolfCrypt benchmark and test Visual Studio projects
2019-07-22 11:29:33 -07:00
c443116189 Merge pull request #2364 from dgarske/stm32_cube_small_block
Fix for STM32 AES GCM crypto hardware with less than block size
2019-07-22 11:27:04 -07:00
fc918f9052 Merge pull request #2367 from JacobBarthelmeh/PKCS7
fix for initialize PKCS7 structure with signer
2019-07-22 09:41:17 -07:00
db9a17c8a7 fix for inject clear alert from client test case 2019-07-22 10:34:20 -06:00
aec980b803 fix for initialize PKCS7 structure with signer 2019-07-19 16:23:14 -06:00
aed1e433b2 Updates to benchmark/test Visual Studio projects to properly reference x64. Added missing files to VS projects. Example settings for enabling SP and AESNI in Visual Studio in IDE/WIN/user_settings.h. 2019-07-19 13:08:13 -07:00
ab01cd9be1 Merge pull request #2354 from ejohnstown/fixes
Fixes for FIPS
2019-07-19 09:59:21 -07:00
2abcffd4a7 Revert changes to fe_x25519_asm.S. 2019-07-18 12:15:55 -07:00
0bcae86038 Fixes for wolfCrypt benchmark and test Visual Studio projects. Fixes for benchmark.c compile errors in bench_hmac with Visual Studio. Added README.md files for benchmark and test. 2019-07-18 11:39:59 -07:00
45abd67bd1 Merge pull request #2362 from SparkiDev/chacha20_asm_fix
Fix chacha20 AVX1 assembly to not use register RBX
2019-07-18 08:43:44 -07:00
b73c53471c Merge pull request #2363 from JacobBarthelmeh/Testing
Fixes for builds
2019-07-18 08:38:50 -07:00
6fd623248e Add macro checks around new .c/.S files to allow wildcard include of source files (such as in Eclipse). 2019-07-18 06:49:36 -07:00
7db3f8e2c6 Fixes for STM32 CubeMX AES GCM crypto hardware where less than a block size (16) is used. 2019-07-18 06:09:07 -07:00
b399b08df7 Fix for TLS 1.3 to always send Key Share
Even if resuming or using PSK and not performing DHE key exchange, send
key share extension in case full handshake is required.
2019-07-18 11:01:43 +10:00
d1700d3739 Merge pull request #2358 from ejohnstown/rsa-keygen-speedup
RSA Key Generation Speedup
2019-07-17 18:01:38 -07:00
7fe4521083 Fix chacha20 AVX1 assembly to not use register RBX 2019-07-18 09:42:52 +10:00
0555668f2c Merge pull request #2356 from JacobBarthelmeh/OCSP
revert early free of OCSP buffer after finding it is revoked
2019-07-18 08:38:10 +10:00
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
9c245b7fc5 Fixes
When building with GCC-8 and enable-intelasm set, GCC reported a memcpy
from and two the same pointer being possible. Added a check for the same
pointer and skipped the copy if the same.
2019-07-17 15:35:12 -07:00
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
7e79e3a6bf fix for build with disable filesystem 2019-07-17 16:28:58 -06:00
f63656f18b macro guard on test case with disable AES 2019-07-17 15:22:29 -06:00
dc71f957f3 RSA-Key Gen Speedup
1. When doing the test divides on the first few primes, short circuit
out of the loop if the prospective possible prime divides evenly.
2019-07-17 13:43:15 -07:00
8b6e66f095 Merge pull request #2353 from SparkiDev/ecc_nonce
Improve nonce use in ECC mulmod
2019-07-17 11:23:12 -07:00
9a2f4bb8f8 Merge pull request #2333 from kaleb-himes/WCv4.0.1-stable-master
WCv4.0.1-stable changes
2019-07-17 10:14:40 -07:00
af8395b17b revert early free of OCSP buffer after finding it is revoked 2019-07-17 11:08:28 -06:00
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
483f6a5acd Improve nonce use in ECC mulmod 2019-07-17 09:27:29 +10:00
5f3fd3ae86 Merge pull request #2348 from cconlon/scepchanges
Changes to support SCEP Expansion
2019-07-16 15:26:15 -07:00
fdeb65dec8 WCv4.0.1-stable changes
CHAR_BIT to 8, simplify logic from peer review

Update build script
2019-07-16 15:58:56 -06:00
cb2ed60305 Merge pull request #2351 from ejohnstown/watch-chain-deux
Sniffer Watch Cert Chain Part 2
2019-07-16 15:04:32 -06:00
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
5067d1fc10 Merge pull request #2328 from kaleb-himes/ZD-5373-TIRTOS
Updating for TI hardware offload with latest version of wolfSSL
2019-07-16 11:43:56 -07:00
8b8ff2ac34 Merge pull request #2336 from kaleb-himes/ZD-5388-OCSP-STATUS-UNHONORED
Honor the status from peer and do not do internal OCSP lookup regardless
2019-07-16 11:32:34 -07:00
99d3ea9e56 Merge pull request #2350 from SparkiDev/rsa_pss_fix
Don't pick RSA PSS if not compiled in
2019-07-16 11:28:50 -07:00
4b0bb75909 Sniffer Watch Cert Chain Part 2
1. Check the sizes picked up out of the message against the expected
size of the record when looking at the certificate messages.
2. Renamed the cert and certSz in the watch callback with it being a
certChain.
2019-07-16 09:54:45 -07:00
2e308ea82c Merge pull request #2260 from JacobBarthelmeh/PKCS7
PKSC7 firmware revision + callback / get SID
2019-07-16 10:51:38 -06:00
9f1aa1a27c Merge pull request #2349 from ejohnstown/watch-chain
Sniffer Watch Cert Chain
2019-07-16 10:43:37 -06:00
d51b958334 use ForceZero instead of MEMSET in PKCS7 signed attribute handling 2019-07-16 08:13:47 -07:00
8112c1236d Don't pick RSA PSS if not compiled in 2019-07-16 14:59:01 +10:00
9af9941b90 Fixes for TLS 1.3 and OCSP Stapling
Create the OCSP Response for Stapling and TLS 1.3 when parsing.
When parsing OCSP stapling extension with TLS 1.3, use a new extension
object if it was created.
Set the extension size to 0 before writing extensions when sending a TLS
1.3 Certificate message.
2019-07-16 13:52:36 +10:00
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
4e648dd35f Merge pull request #2347 from JacobBarthelmeh/HardwareAcc
adjust time.h for port due to tm struct change
2019-07-15 15:27:58 -07:00
3cdb4f8bf0 Sniffer Watch Cert Chain
Modifed the sniffer watch callback so it provides a SHA-256 hash of the
peer certificate, as before, and the entire certificate chain sent by
the server in the Certificate handshake message. The chain is taken
directly from the message payload, unprocessed. It'll be a list of pairs
of 24-bit certificate length and a DER encoded certificate, all in
network byte order.
2019-07-15 14:07:22 -07:00
7367da3fb6 sort PKCS7 signed attributes when generating bundle 2019-07-15 13:27:49 -07:00
6e6c93624a free test RSA key after use 2019-07-15 12:32:19 -06:00
cba8a7f155 free buffer when using small stack 2019-07-15 12:32:19 -06:00
4362ce5f6b fix expected size and add sanity checks 2019-07-15 12:32:19 -06:00
a25d04044a save rid for kari callback 2019-07-15 12:32:19 -06:00
60fc9b3a1d add test for manual verify 2019-07-15 12:32:19 -06:00
d33a95352a fix check on ret value and add test case 2019-07-15 12:32:19 -06:00
f79a119c82 add storing sig/digest if no certs in bundle 2019-07-15 12:32:19 -06:00
d7a86de969 add wrap CEK callback, test, and adjustment for fwWrappedFirmwareKey 2019-07-15 12:32:19 -06:00
84653a7fb5 improvements on test code 2019-07-15 12:32:19 -06:00
a7a51d8f33 scan-build warnings / fixes 2019-07-15 12:32:19 -06:00
ab0029f9ac add setter function for ctx and pkcs7 callback, add test cases 2019-07-15 12:32:19 -06:00
2972b1c467 getter for signerinfo SID and decrypt callback 2019-07-15 12:26:11 -06:00
5743a1c80f Merge pull request #2341 from miyazakh/fix_ricoh_buildfailure
fix build failure when enabling MYSQL_COMPATIBLE
2019-07-15 10:10:34 -06:00
9d9495f8b6 allow CSR challenge pass to be encoded as PrintableString 2019-07-12 16:23:48 -07:00
051112a101 adjust time.h for port due to tm struct change 2019-07-12 13:55:04 -06:00
b4765a5c9e Merge pull request #2340 from JacobBarthelmeh/Testing
fsanitize report fixes
2019-07-11 11:18:09 -07:00
88f923a2a1 Merge pull request #2338 from ejohnstown/md5-null-suite
RSA-NULL-MD5 cipher suite
2019-07-11 11:15:48 -07:00
3756a2c8c7 fix build failure when enabling MYSQL_COMPATIBLE 2019-07-11 09:00:03 +09:00
a6cc9af1fc free old peer RSA key in secure renegotiation when getting new one 2019-07-10 17:07:16 -06:00
6c9fac2a71 add wolfSSL_RAND_Cleanup to match wolfSSL_RAND_seed call on init 2019-07-10 16:43:44 -06:00
85ce959031 free peer cert overwritten by secure renegotiation 2019-07-10 16:04:42 -06:00
45b280a53e RSA Null MD5 cipher suite
1. Add the cipher suite TLS_RSA_WITH_NULL_MD5 for use with the sniffer.
2. Added TLS_RSA_WITH_NULL_MD5 to the suite test.
2019-07-10 14:32:14 -05:00
d7b50874f6 Fix leak in dh_test 2019-07-10 13:28:00 -06:00
92bd585f25 Merge pull request #2329 from JacobBarthelmeh/SanityChecks
scan-build fixes
2019-07-10 10:23:39 -07:00
9cd6a992c5 Merge pull request #2295 from kojo1/RSA4096
Static RSA4096
2019-07-10 09:40:41 -06:00
d88458a447 Merge pull request #2322 from SparkiDev/int_is_prime_fix
Fix prime testing to do t iterations of random values in range
2019-07-09 08:03:30 -07:00
9daccb3300 Merge pull request #2320 from SparkiDev/tls_alerts
Send more alerts as per TLS specification
2019-07-09 08:02:32 -07:00
964fd95a43 Merge pull request #2335 from SparkiDev/tls_pss_fix
Fix duplicate definitions in internal.h (new PSS defines)
2019-07-09 08:01:10 -07:00
3e6246af59 Honor the status from peer and do not do internal OCSP lookup regardless
Item 2) Suggestion from Sean implemented: "Limit the message types"

Item 3) Removed a hard tab
2019-07-09 07:09:09 -06:00
e01f9961ac Fix duplicate definitions in internal.h (new PSS defines) 2019-07-09 08:49:04 +10:00
b8c6bc0d7f Changes following peer review, add defines to disable for any HW port 2019-07-08 16:28:35 -06:00
b7986ccb17 Merge pull request #2332 from SparkiDev/poly1305_arm64
Improve perfomance of Poly1305 on ARM64
2019-07-08 15:08:25 -07:00
4d13121de1 Merge pull request #2331 from SparkiDev/sp_c32_fix
Fix for C32 implementation in div
2019-07-08 15:06:16 -07:00
0bb6b388c0 Merge pull request #2312 from kojo1/RAND_bytes_2
RAND_bytes
2019-07-08 15:30:06 -06:00
97a6dc9e7e Merge pull request #2316 from SparkiDev/tls13_ext_fixes
TLS 1.3 extension fixes
2019-07-08 14:13:55 -07:00
1bcec1b9ab Merge pull request #2319 from SparkiDev/tls13_alerts
Improve alert sending in TLS 1.3 code from fuzz testing
2019-07-08 14:11:35 -07:00
efe276414b set internal x509 elements to NULL after free 2019-07-08 15:11:03 -06:00
79165ce8cb Merge pull request #2315 from SparkiDev/tlsx_ext_debug
Print out extension data being parsed when WOLFSSL_DEBUG_TLS defined.
2019-07-08 13:59:11 -07:00
44b8106da6 Merge pull request #2317 from SparkiDev/asn_nofs_fix
Fix for NO_FILESYSTEM builds
2019-07-08 13:32:27 -07:00
bd40a59f3e Merge pull request #2318 from SparkiDev/server_fuzz
Changes to server example for fuzz testing
2019-07-08 13:16:17 -07:00
36920b1469 Merge pull request #2314 from SparkiDev/tls13_fixes
TLS 1.3 ClientHello rework and other fixes
2019-07-08 13:14:37 -07:00
d824b78af0 Merge pull request #2323 from dgarske/various_fixes
Various fixes, improvements to build options for reduced code size and static benchmarks
2019-07-08 13:02:22 -07:00
baf65f4f43 Merge pull request #2327 from JacobBarthelmeh/Compatibility-Layer
add wolfSSL_PEM_write_DHparams implementation
2019-07-08 12:58:10 -07:00
e6ab7d165c Merge pull request #2325 from JacobBarthelmeh/Testing
remove HAVE_CRL macro guard from X509 PEM write function
2019-07-08 12:57:15 -07:00
66db74d827 Merge pull request #2313 from SparkiDev/tls13_reneg
Fix for TLS 1.3 and secure renegotiation
2019-07-08 12:56:02 -07:00
406ff31fc8 Merge pull request #2311 from SparkiDev/tls12_ffdhe_fix
Better support for TLS 1.2 and FFDHE
2019-07-08 12:55:03 -07:00
1070aba5e2 Merge pull request #2308 from SparkiDev/resumption_fix
Don't resume if stored session's ciphersuite isn't in client list
2019-07-08 12:52:59 -07:00
2610d9ce94 Merge pull request #2307 from SparkiDev/pick_hash_sig
Improve hash and signature algorithm selection
2019-07-08 12:51:36 -07:00
74324bb1b5 Merge pull request #2305 from SparkiDev/doalert_fix
Better handling of alerts
2019-07-08 12:50:26 -07:00
60d6d71636 Merge pull request #2304 from SparkiDev/tls_sha224
Support to TLS for RSA SHA-224 signatures
2019-07-08 12:47:56 -07:00
2a4b935e07 Merge pull request #2299 from JacobBarthelmeh/DTLS-MultiCore
DTLS export/import state only
2019-07-08 12:47:13 -07:00
cc453c6c12 Merge pull request #2262 from ejohnstown/sniffer-watch
Sniffer watch
2019-07-08 12:45:35 -07:00
b5a5100068 move location of X509 free 2019-07-05 14:33:35 -06:00
964dac96a7 Merge pull request #2321 from kaleb-himes/ARDUINO-UPDATE
Remove redundent setting WOLFSSL_ARDUINO and add guards
2019-07-05 11:35:30 -07:00
011fa6bafd Added PBKDF2 benchmark. Benchmark improvements to capture results in static buffer (helps benchmarking on systems without printf support). Added benchmark "-print" option to show summary. Added wolfCrypt test version header. 2019-07-05 11:29:14 -07:00
c9f18bfe3b Merge pull request #2326 from SparkiDev/sp_update_1
Changes to other SP implementations based on recent changes
2019-07-05 11:19:01 -07:00
4cf8923838 make wc_DhParamsToDer a static function to avoid DhKey redefenition 2019-07-05 11:58:40 -06:00
8dccecc531 Improve perfomance of Poly1305 on ARM64 2019-07-05 14:41:46 +10:00
61e1491407 Fix for C32 implementation in div
Changes to allow C32 to build on x86_64 when not using fast math.
2019-07-05 10:39:30 +10:00
9b654d25d1 wolfSSL_RAND_seed(NULL, 0); 2019-07-04 18:31:57 +09:00
5dcd421580 scan-build fixes 2019-07-03 17:08:02 -06:00
ab9d89cb31 cast on return and move location of function declaration 2019-07-03 15:20:08 -06:00
02871d5ed4 add test case for wolfSSL_PEM_write_DHparams 2019-07-03 13:32:21 -06:00
0b5ee1b633 Merge pull request #2324 from dgarske/cryptocb_3des
Crypto callback DES3 support
2019-07-03 10:17:23 -07:00
8327984523 fix for leading bit check 2019-07-03 10:35:08 -06:00
f2bb5e8944 implementation of wolfSSL_PEM_write_DHparams 2019-07-02 17:42:33 -06:00
7c393edf49 Changes to other SP implementations based on recent changes 2019-07-03 09:37:31 +10:00
58fe2781f1 Fix for wc_CryptoCb_AesCbcEncrypt with improper find device logic. Fix for HMAC scan-build with ret. Cleanup of HMAC formatting. 2019-07-02 14:08:59 -07:00
a7acacff41 remove HAVE_CRL macro guard from X509 PEM write function 2019-07-02 14:37:33 -06:00
d5f3fa2ff8 Added DES3 Crypto callback support. 2019-07-02 10:15:53 -07:00
01c9fa1830 Added NO_TFM_64BIT option to disable 64-bit for TFM only (also enabled with NO_64BIT. This allows other areas like SHA512/ChaCha20 to still have the 64-bit type, but not use it for TFM. 2019-07-02 09:36:08 -07:00
eba78cd87a Improvements for disabled sections in pwdbased.c, asn.c, rsa.c, pkcs12.c and wc_encrypt.c. Adds --enable-pkcs12, HAVE_PKCS12/NO_PKCS12, HAVE_PKCS8 / NO_PKCS8 and HAVE_PBKDF1 / NO_PBKDF1. 2019-07-02 09:35:46 -07:00
40864da533 Fix prime testing to do t iterations of random values in range 2019-07-02 14:42:03 +10:00
0e33e2d9ee Check PickHashSigAlgo return when doing CerticateRequest
Only check picking the hash and signature algorithm functions return
when a certificate is available to send to peer.
Include the ECC signature and hash algorithms in available list even
when using ECDSA certificates signed with RSA.
List is of capabilities not what is in certificate.
Certificate request sent to peer doesn't have to be an ECDSA certificate
signed with RSA.
Same treatment for RSA.
2019-07-02 11:53:04 +10:00
28aa99c3e3 Always have support for SHA-224 signatures when SHA-224 built-in 2019-07-02 08:27:04 +10:00
21afcf17a8 Sniffer Watch Mode
1. Split the function ssl_SetWatchKey() into ssl_SetWatchKey_file()
which loads the key from a named file and ssl_SetWatchKey_buffer()
which loads the key from a provided buffer. file() uses buffer().
2019-07-01 13:50:28 -07:00
b02e1e8d59 Sniffer Watch Mode
Added some statistics tracking to the watch mode.
2019-07-01 13:50:28 -07:00
8be6c0c08c Sniffer Watch Mode
Add some tests for the Watch mode that will also work with static ECDH.
2019-07-01 13:50:28 -07:00
b61803f165 Sniffer Watch Mode
Added the build option for the Watch mode for the sniffer. Instead of
setting a set of IP addresses and keys, you set a callback function.
When any TLS connection is started, the hook is called and a hash of the
peer certificate is given to the callback function. It has a chance to
load a private key into the sniffer session. Enable this option with the
build flag "WOLFSSL_SNIFFER_WATCH".
2019-07-01 13:50:28 -07:00
fd71618f10 Added warning message if user IO read callback returns negative that is not supported. 2019-07-01 13:41:17 -07:00
b2f919ec13 Fix to include errno.h in tls_bench.c 2019-07-01 13:41:17 -07:00
354ec9cd9d Add useful log message when SP math key size is invalid. 2019-07-01 13:41:17 -07:00
f8e3e63938 Fix for building with USE_STSAFE_VERBOSE to avoid printf use. 2019-07-01 13:41:17 -07:00
3652929573 Merge pull request #2310 from SparkiDev/alpn_sni_parse
ALPN and SNI Extension parsing improvements
2019-07-01 08:57:39 -07:00
4500f2d773 Merge pull request #2309 from SparkiDev/fallback_scsv
Fallback SCSV (Signaling Cipher Suite Value) support on Server only
2019-07-01 08:55:02 -07:00
08bd5000f1 Merge pull request #2306 from SparkiDev/tls_long_msg
Add detection of oversized encrypted data and plaintext
2019-07-01 08:51:20 -07:00
db17fce49a Remove redundent setting WOLFSSL_ARDUINO and add guards 2019-07-01 09:02:21 -06:00
b7e00eea1a Send more alerts as per TLS specification
Requires WOLFSSL_EXTRA_ALERTS or OPENSSL_EXTRA to enable
2019-07-01 17:01:06 +10:00
1fe69992e2 Improve alert sending in TLS 1.3 code from fuzz testing 2019-07-01 14:20:36 +10:00
373bbf6660 Changes to server example for fuzz testing 2019-07-01 13:35:33 +10:00
707156f53b Fix for NO_FILESYSTEM builds 2019-07-01 13:26:28 +10:00
4ff9d951f6 TLS 1.3 ClientHello rework and other fixes
Do version negotiation first. Look for, parse and negotiate with
SupportedVersions extension upfront. Only need to handle TLS 1.3
ClientHello after this.
Any version greater than TLS 1.2 in Legacy Version field is translated
to TLS 1.2.
Fix preMasterSz to when not using PreSharedKey.
Not finsing KeyShare in ClientHello sends a missing_extension alert.
Decoding signature algorithms in new TLS 1.3 range now returns error
when not recognized.
Don't allow RSA PKCS #1.5 signatures to be verified.
Fix accept when downgraded from TLS 1.3 to go to wolfSSL_accept.
Fix server state when sending ChangeCipherSpec for MiddleBox
compatability.
Send a new session ticket even when resuming.
2019-07-01 13:22:21 +10:00
1d05503d20 TLS 1.3 extension fixes
When major version is TLS Draft then this is now ignored.
If version negotitation occurs but none matched then send an alert and
return an error.
Store the rsa_pss_pss_* signature algorithms in the bit mask.
KeyShare Entry parsing returns INVALID_PARAMETER when length is 0 and
results in a different alert being sent.
Check negotiated protocol version is not TLS 1.3 when determing whether
to parse point formats.
2019-07-01 12:20:37 +10:00
4eaabd9be5 Print out extension data being parsed when WOLFSSL_DEBUG_TLS defined. 2019-07-01 11:58:43 +10:00
60af8bdb7c Fix for TLS 1.3 and secure renegotiation 2019-07-01 09:26:05 +10:00
43ce956d9c minor fix 2019-06-29 16:47:39 +09:00
1634d9571c RAND_seed in init, GlobalRNG before tmp. 2019-06-29 09:21:30 +09:00
e96ede65ce Don't resume if stored session's ciphersuite isn't in client list
Turn this check off with NO_RESUME_SUITE_CHECK.
2019-06-28 16:23:41 +10:00
46a2a437d4 Better support for TLS 1.2 and FFDHE
If not FFDHE parameters in list then use existing.
If FFDHE parameters present but none matching then let the ciphersuite
match process fail when DHE must be used.
2019-06-28 16:12:23 +10:00
1592d6f856 ALPN and SNI Extension parsing improvements
SNI will not have more than one type, only one entry in the list per
type and therefore no need to loop.
ALPN error checks improved.
2019-06-28 15:52:51 +10:00
a3e4a2fd6e Fallback SCSV (Signaling Cipher Suite Value) support on Server only 2019-06-28 15:35:56 +10:00
8312ceb14c Improve hash and signature algorithm selection
Return error when no hash-signature algorithm is possible.
2019-06-28 14:31:40 +10:00
5f9a851adb Add detection of oversized encrypted data and plaintext 2019-06-28 12:01:35 +10:00
7d2ac604f5 Better handling of alerts
Better checking of encrypted alerts - check unencrypted data size
correctly before using data.
Send an alert if the alert isn't the right size.
Send an alert if the maximum alert count has been reached - but don't
send it if seeing close_notify alert.
2019-06-28 11:53:33 +10:00
8a0c058782 Support to TLS for RSA SHA-224 signatures 2019-06-28 10:26:48 +10:00
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
8bea016d69 Merge pull request #2277 from julek-wolfssl/arm-poly1305
ARM Poly1305
2019-06-27 09:21:09 +10:00
c7d1424adf word16 for consistency 2019-06-27 06:38:14 +09:00
e7fd45537d update comments for DEGENERATE_SID use 2019-06-26 11:58:53 -06:00
7520137601 Merge pull request #2297 from miyazakh/esp_random
fix ed25519 sign msg test failure in ESP32
2019-06-26 11:54:34 -06:00
da5357cadd Merge pull request #2301 from SparkiDev/dh_pubval_check
Simple checks of DH public value from peer.
2019-06-26 09:20:49 -07:00
0dbba5f056 Merge pull request #2300 from ejohnstown/fips-hash
FIPS Hash
2019-06-26 09:18:48 -07:00
6478f92e04 Merge pull request #2294 from dgarske/read_fixes
Fixes to improve read error handling
2019-06-26 09:17:20 -07:00
cb4f9afd6d free memory in test case 2019-06-25 15:24:39 -06:00
3a378520c0 FIPS Hash
Add the fips-hash.sh script to the Automake distribution.
2019-06-25 11:38:09 -07:00
53c1a6c264 Merge pull request #2283 from dgarske/extern_c
Fixes for cpp extern c
2019-06-25 11:25:39 -07:00
eceb460cff Merge pull request #2287 from ejohnstown/sniffer-stats
Sniffer Statistics
2019-06-25 11:22:24 -07:00
ef64cd300c Fixes to improve read error handling.
* Improved `GetInputData` handling of non -1 return codes.
* Adds support for handling `WOLFSSL_CBIO_ERR_TIMEOUT` return code in non-DTLS case.
2019-06-25 07:11:14 -07:00
dcdd6d6d6f Cleanup around include of wolfmath.h and shared math macros. Fix for SP math case with WOLFSSL_BIGNUM. 2019-06-25 07:06:33 -07:00
a9fff57063 Add extern "C" to headers. Some files are missing this, which can cause issues with some compilers when using the C++ mode. 2019-06-25 07:05:46 -07:00
ee023c6bf4 Simple checks of DH public value from peer.
Add test for wc_DhCheckPubValue
2019-06-25 11:12:33 +10:00
da6ed416be use len for copy-length instead of sz 2019-06-25 08:39:46 +09:00
26384d4936 Sniffer Stats
Upgrade the sniffer stats to unsigned long ints.
2019-06-24 16:16:05 -07:00
b957415609 Merge pull request #2245 from MKinclRA/coverity-issues
Coverity issues
2019-06-24 16:12:52 -07:00
851a547fd5 FIPS Hash
Add a script that updates the verifyCore value automatically. It isn't
included in the dist like fips-check.sh.
2019-06-24 16:01:05 -07:00
15552be934 Merge pull request #2280 from cconlon/selftestccm
CAVP self test build fixes for AES-CCM and PKCS7
2019-06-24 15:55:18 -07:00
036f6a1177 Merge pull request #2281 from ejohnstown/evp-legacy
Legacy EVP_CipherFinal addition
2019-06-24 15:54:43 -07:00
785d984a3c Merge pull request #2282 from SparkiDev/certvfy_tls13
Free RSA key later in TLS v1.3 CertificateVerify
2019-06-24 15:54:04 -07:00
56d7da3130 Merge pull request #2284 from dgarske/api_test
Fixes for track memory and API unit test cleanup
2019-06-24 15:53:32 -07:00
587e962331 Merge pull request #2288 from SparkiDev/ed25519_string_fix
Fix length of buffer to match string length for g++
2019-06-24 15:39:52 -07:00
2ba89cb7a9 Merge pull request #2289 from SparkiDev/sp_prime_fix
When checking primes call only available SP ModExp functions
2019-06-24 15:39:03 -07:00
c7964b62c0 Merge pull request #2290 from kaleb-himes/ZD-5253-X25519
Support CURVE25519 in `get_curve_name` when HAVE_ECC not defined
2019-06-24 15:37:34 -07:00
358757cd2e Merge pull request #2291 from ejohnstown/random-clean
Random Cleanup
2019-06-24 15:36:00 -07:00
0100159079 Merge pull request #2293 from ejohnstown/aesni-fix
AES-NI Fix
2019-06-24 15:34:12 -07:00
78956534f0 Merge pull request #2298 from SparkiDev/static_rsa
Improve handling of static RSA's decrypted pre-master secret
2019-06-24 15:24:18 -07:00
0e3881d418 add test case for state only export on DTLS session 2019-06-24 16:08:12 -06:00
8439beb525 Sniffer Statistics
1. Moved sslKeyFails.
2. Added sslEphemeralMisses, sslEncryptedConns, sslDecodeFails.
3. Removed the Rehandshake stats as the sniffer does not support rehandshaking.
4. Removed two of the per second stats as they seemed redundant.
5. Added a function to atomically read and reset the sniffer statistics.
2019-06-24 09:54:42 -07:00
0eaccb7259 Removed some redundant comments from the sniffer header. 2019-06-24 09:54:42 -07:00
0203a25b60 Sniffer Statistics
Added stats for encrypted and decrypted bytes and packet counts.
2019-06-24 09:54:42 -07:00
9715431921 Sniffer Statistics
1. Wrapped the added code for statistics in a preprocessor guard.
2. Added a check for the current cipher suite and if it is on the list
of allowed suites. Guarded by the statistics option.
3. Added more statistics from the list.
2019-06-24 09:54:42 -07:00
c600f7659a Sniffer Statistics
Added more of the statistics.
2019-06-24 09:54:42 -07:00
2ee7d05dcc Sniffer Statistics
1. Added a structure for all the statistics to be kept.
2. Added a global to track the statistics.
3. Added a copy function to get a copy of the statistics.
4. Added a reset function for the statistics.
5. Handle the alert messages in statistics.
2019-06-24 09:54:42 -07:00
71fe3313d3 Cleanup poly1305 struct 2019-06-24 09:43:55 +02:00
c826c605a3 Fix problems when building with Make 2019-06-24 09:42:07 +02:00
f42c94e3bc Cleanup code and align labels 2019-06-24 09:42:07 +02:00
0fed159abd Poly1305 ARM64 optimization 2019-06-24 09:42:07 +02:00
f1f6ac9308 Improve handling of static RSA's decrypted pre-master secret 2019-06-24 17:09:22 +10:00
1d9d9e2955 fix ed25519 sing msg test failure
better random number handling
2019-06-24 15:27:29 +09:00
6d04d784c4 pkcsBlockLen in RsaUnPad may be > 256 2019-06-24 07:53:23 +09:00
b236a1c32f add export/import window state only 2019-06-21 15:52:48 -06:00
c114bcaead Addressed peer feedback, avoid double check when HAVE_CURVE25519 not set 2019-06-21 09:40:17 -06:00
49a631996c Check other names when FFDHE returns NULL 2019-06-21 09:27:15 -06:00
fba89ae034 Random Cleanup
1. Remove redundant calls to the generate function when instantiating
and reseeding the DRBG.
2. Added note to the apparently redundant extra call to the generate
function when running the self test. This extra call is there to make
sure the internal state is updating correctly as a part of the KAT.
3. Removed duplicate enable argument clause for rng from configure.ac.
2019-06-20 16:02:35 -07:00
f4548945f7 Merge pull request #2292 from ejohnstown/config-tweak
Autoconf Update
2019-06-21 00:53:02 +02:00
e4e6ed3701 AES-NI Fix
Replace some removed constants for AES-NI. They were removed when the
inline assembly that used that was exported to its own file.
For Windows, we're using the C intrinsic AES-NI functions, and those
still needed those constants.
2019-06-20 15:33:30 -07:00
a28e075290 Autoconf Update
Consolidate all the AM_CONDITIONAL statements in one place in the
configure process. This replaces the set of repeat checks of enable
flags to conditionally check the AM_CONDITIONAL.
2019-06-20 13:37:53 -07:00
7225823f90 Merge pull request #2278 from SparkiDev/cert_asn1
Better length checks when parsing ASN.1 certificates
2019-06-20 11:18:02 -07:00
2460effb0b Merge pull request #2285 from SparkiDev/tlsx_len
Better checking of return values in TLSX for error codes.
2019-06-20 10:10:31 -07:00
ce251417f5 curve25519 in get_curve_name when HAVE_ECC not defined. Thanks to C.B. for the report. 2019-06-20 10:57:07 -06:00
b631670cca Fix for SP math build in OpenSSL bn.h 2019-06-20 21:40:58 +10:00
c82c9b481b When checking primes call only available SP ModExp functions 2019-06-20 18:05:25 +10:00
e1b03aa056 Fix length of buffer to match string length for g++ 2019-06-20 17:01:16 +10:00
e7b3b31d9f Change TLSX functions that return error with length to do so separately 2019-06-20 16:37:34 +10:00
7bde02b3e7 Fix for track memory case where the "prev" wasn't getting initialized for the first malloc. Caused issue on last free with fsantize because pointers are not zero'd by default. 2019-06-19 11:23:37 -07:00
19cb31d429 Merge pull request #2286 from miyazakh/fix_make_dist
fix make dist
2019-06-19 09:38:07 -06:00
4581342fb0 fix make dist 2019-06-19 09:32:56 +09:00
71cb117dda Better length checks when parsing ASN.1 certificates 2019-06-19 10:05:21 +10:00
d378d3c009 Better checking of return values in TLSX for error codes. 2019-06-19 10:02:55 +10:00
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
c500fd5a86 Free RSA key later in TLS v1.3 CertificateVerify 2019-06-19 08:47:40 +10:00
c2032c64d2 CAVP self test build fixes for AES-CCM and PKCS7 2019-06-18 08:29:49 -07:00
2cf4a74b47 Merge pull request #2279 from SparkiDev/test_fix
Fix for small stack in test.c
2019-06-17 13:36:03 -07:00
36fb4e2f2d Add a legacy version of the wolfSSL_EVP_CipherFinal() function that
performs the decrypt in the old manner before a particular bug was
fixed. The old method didn't add padding when the data to encrypt was
multiple of the block_size in length. The decrypt happened to ignore the
error returned by checkPad.
2019-06-14 14:43:45 -07:00
18ac566f48 Fix AVX2 ChaCha20 assembly 2019-06-14 10:22:27 +10:00
a4bdfbf953 Fix for small stack in test.c 2019-06-14 08:43:36 +10:00
2435ec2d6b Merge pull request #2275 from SparkiDev/sha512_arm32
Add ARM32 NEON code for SHA-512/384
2019-06-12 16:19:20 -07:00
53cac0499f Merge remote-tracking branch 'wolfSSL/master' 2019-06-12 14:42:02 +02:00
102ecac70c Merge pull request #2237 from julek-wolfssl/proper-arm-chacha-poly1305
ARM Chacha20 assembly code
2019-06-12 22:21:47 +10:00
911c8df185 Fix 256 byte assembly slowdown 2019-06-12 00:52:42 +02:00
1f3d9c04c0 Merge pull request #2274 from miyazakh/fix_printstat_tlsbench
minor fix order for printing stats in tls_bench
2019-06-11 16:23:38 -06:00
01ad44feef Merge pull request #2276 from kaleb-himes/BOTH_FIPS_VERSION_TESTING
Adjustment to test.c for merge of WCv4.0.1 changes
2019-06-11 13:21:42 -07:00
24042c973a Merge pull request #2259 from tmael/port_SiFive_RISCV
Added support for RISC-V SiFive HiFive Freedom platforms
2019-06-10 20:38:43 -07:00
48d4ed38ac Include SIFIVE files for distribution 2019-06-10 14:06:42 -07:00
de5ff0acea Merge pull request #2254 from SparkiDev/curve25519_x64_2
Fix and improvements for X25519 x86_64 ASM code
2019-06-10 13:35:43 -07:00
1f0a46331b Merge pull request #2270 from dgarske/stsafe_tls
STSAFE Improvements to support Crypto Callbacks
2019-06-10 13:34:20 -07:00
540c5cdd2f Updated benchmarks with SPI "dual mode" I/O enabled. 2019-06-10 20:33:28 +02:00
a48981c3c6 Chacha20 ARM optimization 2019-06-10 19:21:46 +02:00
cdf0241ed0 Updated benchmark with SHA512 "slow" version, which performs faster with the RISC-V compiler optimizations. 2019-06-09 19:43:55 +02:00
c5aa13021a Adjustment to test.c for merge of WCv4.0.1 changes 2019-06-07 16:09:35 -06:00
d7ab3a6dec Further user_settings.h cleanup / additions. Additional README.md comments. 2019-06-07 13:58:17 -07:00
02c2782e39 Merge pull request #2272 from JacobBarthelmeh/SanityChecks
remove store of last block w/o padding and adjust padding last block case
2019-06-07 10:29:29 -07:00
b4ca2824cb Merge remote-tracking branch 'wolfSSL/master' 2019-06-07 14:55:21 +02:00
efcf06ef7c use tlsv1_2 client method when tls13 is enabled 2019-06-07 19:13:46 +09:00
6a594218bc Add ARM32 NEON code for SHA-512/384
Fix up ARM32 Curve25519 assembly code to use right directives.
Slight improvement to ARM64 SHA-512 assembly code.
Don't return error code from Transform functions - can't fail.
2019-06-07 15:02:48 +10:00
292aa196fb minor fix to print stats in tls_bench 2019-06-07 12:05:19 +09:00
a2f943984f Merge pull request #2268 from kaleb-himes/GH-2263
debug fix + remove outl value check - outl is only written not read
2019-06-06 11:22:19 -07:00
f114932a03 Merge pull request #2271 from miyazakh/fix_nomutexlock_after_free
avoid mutex lock test after freeing it on NetBSD
2019-06-06 09:27:18 -06:00
90228e1275 Merge pull request #2269 from SparkiDev/sp_cast
Fix casting of memory allocation to correct type
2019-06-06 06:14:59 -07:00
87d24f4488 add additional test case for evp 2019-06-06 16:14:00 +07:00
090899e74e remove store of last block w/o padding and adjust padding last block case 2019-06-06 14:43:07 +07:00
fdd01c8c8c Added support for SHA512, ED25519/CURVE25519 and ChaCha20/Poly1305. Enabled ECC Single Precision (SP) support. Updated README.md wolfCrypt test/benchmarks. Pulled in fix "Fix casting of memory allocation to correct type" from Sean. 2019-06-05 20:21:48 -07:00
64b8af728b skip mutex lock after free 2019-06-06 11:06:29 +09:00
4e3004639d Fix casting of memory allocation to correct type 2019-06-06 09:11:19 +10:00
97780149a5 debug fix + remove outl value check - outl is only written not read 2019-06-05 13:38:13 -06:00
25aeb8238e Addressed review comment about id being undefined 2019-06-04 16:05:57 -07:00
9f9155b6f2 Added STSAFE Crypto Callback support. 2019-06-04 15:57:31 -07:00
074e770c98 * Fix to ensure user_settings.h can be included for bio.c and evp.c when IDE or compiler tries to build it directly. Allows for wildcard .c include along with WOLFSSL_IGNORE_FILE_WARN.
* Fix for building SP cortex M without RSA.
* Fix for type-cast warning with STSAFE-A100.
* Improved the RNG seed test to prevent type-case warning.
2019-06-04 15:57:31 -07:00
fee81ce49e Merge pull request #2257 from dgarske/sha256_regs
Added faster SHA256 build options
2019-06-04 14:05:54 -07:00
77248e4e2a Merge pull request #2255 from SparkiDev/sha512_arm
SHA-512 optimised for ARM64
2019-06-04 14:04:33 -07:00
4f80c7c94e Allow main to build when local debug flag is on 2019-06-04 13:12:27 -07:00
19372c8199 Merge pull request #2266 from kaleb-himes/ZD-5154
Check correct allocation assignment. Thanks to R.A. for the report on…
2019-06-04 10:22:09 -04:00
b4571f1f5a Updates to documentation for SHA256 build options. Changed to enable Ch/Maj math based of specification by default.
The `WOLFSSL_SHA256_ALT_CH_MAJ` alternate Ch/Maj performance is the same.
The `SHA256_MANY_REGISTERS` is about 13% slower on 64-bit. On some platforms is slightly faster.
2019-06-03 14:17:47 -07:00
290663f8b2 Feedback changes implemented 2019-06-03 15:13:02 -06:00
7601276411 Merge pull request #2267 from ejohnstown/aesgcm-selftest
NetBSD Selftest, TLSv1.3, and wolfCrypt v4
2019-06-03 14:31:33 -06:00
4367761367 Merge pull request #2261 from kaleb-himes/ZD-5172
PKCS7 w/ FIPS cert 3389 support
2019-06-03 11:28:27 -06:00
978928be83 NetBSD Selftest, TLSv1.3, and wolfCrypt v4
When building for TLSv1.3 and the NetBSD Selftest, need to use the old
pre-wolfCrypt v4 APIs for AES-GCM and AES-CCM.
2019-06-03 09:40:00 -07:00
80dd6cc143 Check correct allocation assignment. Thanks to R.A. for the report on ZD-5154 2019-06-03 08:34:51 -06:00
9fbe471156 fix check on ret value and add test case 2019-06-03 07:52:50 +07:00
e429185535 Make Transform_SHA512_Len API local scope 2019-06-03 08:35:36 +10:00
7624d90590 Merge pull request #2258 from dgarske/no_stdlib
Improvements for no standard lib and no malloc/free builds
2019-05-31 14:59:33 -07:00
7726bbbff2 Fix extra distribution files for ARM port dir 2019-05-31 10:47:42 +10:00
e01ae09809 X25519 when not AVX2 2019-05-31 10:12:46 +10:00
a5fabda5c6 Added compile-time check for DRBG size. Added support for all build variations DRBG size. 2019-05-30 15:59:12 -07:00
19c348b5c7 Merge pull request #2256 from dgarske/blake2s
Adds Blake2s support
2019-05-30 15:08:59 -07:00
33d27a391a Improve SHA-512 and Curve25519 2019-05-30 16:07:06 +10:00
173163d1a3 SHA-512 optimised for ARM64 2019-05-30 16:04:15 +10:00
af9d82963e Add support for increasing CPU clock speed. New benchmarks with HiFive1 RevB hardware at 320MHz. 2019-05-29 12:11:16 -07:00
fea89c52f4 configure with ECC256 only 2019-05-29 10:51:07 -07:00
5601aa4634 PKCS7 w/ FIPS cert 3389 support 2019-05-29 11:12:34 -06:00
f1ecf33d94 Merge pull request #2253 from danielinux/cygwin-build-fix
Fix visibility tags for cygwin build
2019-05-29 06:29:47 -07:00
765b075e50 Updated with review comments 2019-05-28 17:48:36 -07:00
87fb9f73e9 Added RISC-V SiFive FE310 support
Added freedom-e-sdk based makefile
Updated ecc test code to not allocate more memory than requried
Run wolfcrypt and benchmark tests on the SiFive HiFive1 targets
2019-05-28 17:48:36 -07:00
5ea13a09f6 Adds Blake2s support (--enable-blake2s), which provides 32-bit Blake2 support. 2019-05-28 10:30:19 -07:00
d42bdf9c0b Removed unused variable keyQ from _DhSetKey. 2019-05-27 12:44:10 +02:00
263769765c Merge pull request #2246 from ejohnstown/sniffer-logging
Sniffer Logging
2019-05-24 15:36:11 -07:00
f26a9589ff Added support for printf override using XPRINTF for wolfCrypt test/benchmark. Added ability to override snprintf with XSNPRINTF. If STRING_USER is defined no standard lib <string.h> or <stdio.h> will be included. 2019-05-23 22:03:38 -06:00
a89a2839de Fixes for building with WOLFSSL_NO_MALLOC. Fixes for static memory in bench embedded case. Added support for elimination of XMALLOC/XFREE when building with NO_WOLFSSL_MEMORY and WOLFSSL_NO_MALLOC. If used with WOLFSSL_MALLOC_CHECK will trap failures with malloc_check 2019-05-23 22:00:41 -06:00
ebbfe769e3 Added faster SHA256_MANY_REGISTERS support (thanks Sean). The WOLFSSL_SHA256_BY_SPEC option restore old math, the new case is equivalent math, but easier for compiler to optimize. 2019-05-23 21:53:07 -06:00
6564d03369 Fix and improvements for X25519 x86_64 ASM code 2019-05-24 09:43:08 +10:00
86b558300b Sniffer Logging
1. When collecting the key size to log it, use the constant WOLFSSL_BIT_SIZE for the bytes->bits multiply.
2. When converting the size of the ECC key, break the steps out more explicitly. Also update the comment to be more accurate.
2019-05-23 13:02:52 -07:00
9906a1045b Merge pull request #2251 from SparkiDev/sp_c_div_word
SP - div word in C when __div64 or __div128 not available
2019-05-23 11:51:29 -07:00
ac5a5dfd56 Merge pull request #2247 from SparkiDev/psk_once
Use TLS v1.3 PSK callback in extension allow for one call in client
2019-05-23 11:49:40 -07:00
6fe4c3ff34 Merge pull request #2244 from dgarske/psk_pk
Fix for static RSA cipher suite with PK callback and no loaded private key
2019-05-23 11:43:20 -07:00
cab4a8c9b1 Merge pull request #2240 from dgarske/x509small_showcerts
Added support for `SHOW_CERTS` with `OPENSSL_EXTRA_X509_SMALL`
2019-05-23 11:41:32 -07:00
e7fdb1360a Merge pull request #2239 from JacobBarthelmeh/Fuzzer
add sanity check on length of PSK identity
2019-05-23 11:40:13 -07:00
a742cf9bf8 Merge pull request #2234 from JacobBarthelmeh/Testing
add sanity check on buffer index and regression tests
2019-05-23 11:32:38 -07:00
5b5d03d5ac Merge pull request #2232 from SparkiDev/curve25519_arm_2
Add ARM32 asm code for X25519 and Ed25519
2019-05-23 11:30:29 -07:00
6cbe8219a3 Moved opening brace to the same line. 2019-05-23 16:13:34 +02:00
ad8f9c6134 Changed memsetting mp_ints to boolean flag. 2019-05-23 13:22:09 +02:00
38d1e908d6 Fix visibility tags for cygwin build 2019-05-23 08:41:05 +02:00
b53e94b49a Merge pull request #2252 from kaleb-himes/ZD5137
Arduino refactor, default to fastmath and setup user_settings for user
2019-05-22 19:17:26 -04:00
484f7a6c32 Merge pull request #2236 from tmael/sendAlertToTLSServer
send handshake failure alert to a server
2019-05-23 08:27:09 +10:00
d8a3768464 Update README.md 2019-05-22 10:43:54 -06:00
827fc67e52 Arduino refactor, default to fastmath and setup user_settings for user 2019-05-22 10:38:26 -06:00
ec4dad76e2 send protocol_version fatal alert message 2019-05-21 16:15:27 -07:00
295dd4ff21 send protocol_version fatal alert message 2019-05-21 16:08:25 -07:00
cb9e0a1973 SP - div word in C when __div64 or __div128 not available
Use WOLFSSL_SP_DIV_32 when using 32-bit C code.
Use WOLFSSL_SP_DIV_64 when using 64-bit C code.
2019-05-22 08:39:35 +10:00
c77b99a8a4 Merge pull request #2248 from kaleb-himes/ZD-5141
Fix for potential leak on err: Thanks to Chris H. for the report
2019-05-20 16:11:40 -06:00
04f24881cb Fix for potential leak on err: Thanks to Chris H. for the report 2019-05-17 16:48:58 -06:00
be65e31cdc Fixed possible buffer overflow in wc_DerToPemEx. 2019-05-17 19:23:55 +02:00
c85eae1322 Fixed resource leak in mp_gcd. 2019-05-17 18:38:19 +02:00
797dae9d74 Fixed use of uninitialized value in wc_ecc_sig_to_rs. 2019-05-17 18:04:39 +02:00
1ce8e227d2 Use TLS v1.3 PSK callback in extension allow for one call in client
New compile time option WOLFSSL_PSK_ONE_ID. Indicates one identity
available. No need for client to call callback when generating binder -
already cached.
2019-05-17 08:01:40 +10:00
245db5d5ce Expand Sniffer Logging
1. Moved the CopySessionInfo function to a better location for the additions.
2. Added accessors for a callback and application context data.
3. Added a callback that is called from ProcessClientKeyExchange when everything is known about the start of the current session.
4. Added the private key size and the server name indication to the SSLInfo record.
2019-05-16 14:09:20 -07:00
1781a9fd76 Sniffer Logging
1. Capture the SNI in the SSLInfo.
2. Save the private key length and capture it in the SSLInfo.
2019-05-16 10:57:45 -07:00
27a9080ac3 Removed dead code from _DhSetKey. 2019-05-16 16:58:41 +02:00
cae4d400b9 Removed dead code from wolfSSL_d2i_X509_fp_ex. 2019-05-16 16:54:40 +02:00
6ab24a2ca3 Fixed unintentional integer overflow in SetValidity. 2019-05-16 16:45:10 +02:00
3b544b8584 Fixed use of uninitialized value in wc_BufferKeyEncrypt. 2019-05-16 16:41:31 +02:00
7a9d3db514 Fixed use of uninitialized value in wc_BufferKeyDecrypt. 2019-05-16 16:37:31 +02:00
6c713e4b88 Fixed use of uninitialized values in wc_DhGenerateParams. 2019-05-16 16:31:12 +02:00
fd50248139 Fix for static RSA cipher suite (AES128-GCM-SHA256) with PK callbacks and no private key set. ZD 5092 2019-05-15 19:35:30 -07:00
651087ab5a Merge pull request #2241 from ejohnstown/sniffer
Sniffer Update
2019-05-15 18:52:44 -07:00
7a671eb70b Merge pull request #2243 from JacobBarthelmeh/Windows
custom ECC curves on Windows
2019-05-15 18:51:01 -07:00
aca46f42fb Merge pull request #2242 from ejohnstown/micrium
Micrium Updates
2019-05-15 15:43:37 -06:00
b2a5516c63 custom ECC curves on Windows 2019-05-15 11:31:26 -06:00
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
3b0a7e679a Add an option for __inline w.r.t. using a GHC compiler. 2019-05-14 13:44:33 -07:00
5b658ebff5 Renamed #sslpro as #error. 2019-05-14 13:44:33 -07:00
0cdaf43a14 Rename the macro "STATIC" as "WC_STATIC" to prevent collisions. 2019-05-14 13:44:33 -07:00
a8b469eb7f Sniffer
1. Refactor `ProcessClientKeyExchange()` so it can be expanded to handle ECC keys for ECDH support.
2. Add support to the sniffer for ECDH based cipher suites.
2019-05-14 13:33:52 -07:00
10dde24363 Added support for SHOW_CERTS with OPENSSL_EXTRA_X509_SMALL for embedded debugging of certs. Minor build warning fixes with OPENSSL_EXTRA and STM32_HASH on IAR. 2019-05-14 09:24:59 -07:00
5aa5f350ba add sanity check on length of PSK identity 2019-05-13 17:16:10 -06:00
9d4d877919 Sniffer
1. Added the null-cipher to the list of supported bulk ciphers.
2019-05-13 11:29:14 -07:00
f923409f1f Merge pull request #2235 from kaleb-himes/ZD-5116
Check appropriate flag for private vs public - Thanks to: E.M.
2019-05-13 10:29:48 -07:00
dbeb5d702f Merge pull request #2231 from JacobBarthelmeh/Fuzzer
sanity check on buffer size
2019-05-10 16:46:38 -07:00
27e243085d Merge remote-tracking branch 'wolfSSL/master' 2019-05-10 13:04:18 +02:00
bf9f912b29 send handshake failure alert to a server 2019-05-09 17:01:36 -07:00
79bf578fd3 Check appropriate flag for private vs public - Thanks to: E.M. 2019-05-09 17:05:34 -06:00
e43e03c30a Merge pull request #2226 from tmael/defectEVP
Verify input parameters of EVP_CipherFinal
2019-05-09 14:35:16 -06:00
1605ab86d2 Verify input arguments and handle incorrect length of a final block 2019-05-09 08:32:52 -07:00
34dc41fe75 Merge pull request #2229 from JacobBarthelmeh/Testing
free any existing ke before updating
2019-05-09 11:48:59 +10:00
4e2e207e67 Add ARM32 asm code for X25519 and Ed25519
Improvements to performance of ARM64 code for X25519 and Ed25519
2019-05-09 09:23:58 +10:00
9205ee70f4 add null check on pointer before passing to XFREE 2019-05-08 16:04:20 -06:00
94d9ce1dfa sanity check on buffer size 2019-05-08 09:33:35 -06:00
ff5bf7aea1 Merge pull request #2230 from dgarske/bench_threads
Added benchmarking `-thread <num>` argument support
2019-05-07 11:21:29 -07:00
dcd6e02de9 Merge pull request #2228 from JacobBarthelmeh/Fuzzer
sanity check on buffer size before copy
2019-05-07 11:20:35 -07:00
a36296a959 Merge pull request #2227 from dgarske/eccsigsz
Fix issue with ECC signature size leaking memory with normal math
2019-05-07 11:17:12 -07:00
ade8f780a9 simplify to not expect null terminated strings 2019-05-07 11:11:41 -07:00
891a645eaa Added benchmarking -thread <num> argument support for asynchronous crypto to allow run-time selection of thread count. ZD 4903. 2019-05-07 07:07:56 -07:00
a130ce2eed free any existing ke before updating 2019-05-06 15:51:42 -06:00
b1442633dd sanity check on buffer size before copy 2019-05-06 15:36:58 -06:00
3c1569dff7 Fix for issue with new wc_ecc_get_curve_order_bit_count function not free'ing memory when used with normal math. Started in https://github.com/wolfSSL/wolfssl/pull/2201 2019-05-06 11:41:50 -07:00
683646e452 Merge pull request #2208 from SparkiDev/curve25519_arm
Curve25519 ARM64 assembly
2019-05-03 11:14:35 -07:00
08531a0f31 Merge pull request #2225 from dgarske/unicode
Remove leading unicode UTF-8 BOM characters
2019-05-03 11:12:06 -07:00
3e7a6054a9 Use the macro instead of sizeof() 2019-05-02 14:13:48 -07:00
06eba2c1e2 Removed a redundant check 2019-05-02 13:58:55 -07:00
1a76f0cd26 Remove leading unicode UTF-8[a] BOM characters (EF BB BF). Searched through repo and atmel.c was only one. 2019-05-02 13:21:43 -07:00
78c6ad4d84 Merge pull request #2217 from tmael/maintenanceOcspResponse
Fix for an OCSP Response signed by issuer
2019-05-02 10:14:01 -07:00
0dd3305f06 Merge pull request #2221 from SparkiDev/rfc8032
Support Ed25519ctx and Ed25519ph sign/verify algorithms
2019-05-01 15:45:03 -07:00
5e343b8e7e Merge pull request #2201 from dgarske/siglen
Improvements to the maximum ECC signature calculations
2019-05-01 15:42:12 -07:00
814c5776fd Merge pull request #2051 from dgarske/build_fixups
Fixes for various build issues
2019-05-01 15:41:14 -07:00
b25177ca6c Include new ARMv8 curve25519 C file in distribution 2019-05-01 13:23:06 +10:00
dc98832757 Add more tests for Ed25519ctx and Ed25519ph 2019-05-01 09:24:08 +10:00
dc313ccf6e Merge pull request #2222 from dgarske/win_dir
Fix for read directory functions with Windows
2019-04-30 15:19:34 -07:00
e00ba1c66a Merge pull request #2090 from vaintroub/fix_clang_cl
Disable MP_64BIT when compiling with clang-cl on Windows.
2019-04-30 13:36:39 -06:00
7cdda4d595 Merge pull request #2218 from abrahamsonn/iar
IAR-EWARM warning removal/formatting
2019-04-30 11:55:29 -07:00
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
443fef6a6a Further optimization of the ECC signature size calculation. 2019-04-30 08:50:19 -07:00
9d736898cc Support Ed25519 sign/verify algorithms ctx and ph 2019-04-30 16:57:20 +10:00
8aacd7b802 Fix for read directory functions with Windows (wc_ReadDirFirst and wc_ReadDirNext). Fix to use bit-mask check instead of equality. 2019-04-29 20:47:52 -07:00
b68253c180 Merge branch 'iar' of https://github.com/abrahamsonn/wolfssl into iar 2019-04-26 15:41:27 -06:00
ef29aa94ea Added build option checks to tls.c and tls13.c
Set tls.c and tls13.c to abort if the library is built with TLS 1.3 and not
HAVE_TLS_EXTENSIONS
2019-04-26 15:32:38 -06:00
ea797fd98e Building with just bare TLS 1.3 settings
will produce the error that the wolfSSL struct doesn't have extensions.
2019-04-26 14:08:20 -06:00
bbb72946b7 initialized var. 2019-04-26 11:35:50 -06:00
1830a0a74c Removed trailing whitespaces 2019-04-25 15:50:02 -06:00
45703a8d72 handle OCSP verified certificate which is already loaded as CA 2019-04-25 10:55:12 -07:00
fdabe614f8 Merge pull request #2215 from miyazakh/Renesas_IDE
Clean up user_settings for CS+
2019-04-24 15:55:01 -07:00
dfde631cb2 Free key at the end of the test 2019-04-24 11:49:53 -07:00
12a7c32530 Merge pull request #2170 from tmael/nRF52840CryptoCell
Initial CryptoCell-310 support on nRF52840
2019-04-24 11:09:46 -07:00
547c09e1d7 Merge pull request #2210 from JacobBarthelmeh/Compatibility-Layer-Part2
JSSE additions
2019-04-24 11:04:05 -07:00
a87552b37f Merge pull request #2213 from JacobBarthelmeh/HardwareAcc
add macro guards
2019-04-24 10:59:02 -07:00
edef75c70f Wrapped new unit test API with FIPS macros 2019-04-24 10:02:20 -07:00
6b51f2d5b2 Added unit test for wc_ecc_get_curve_id_from_dp_params 2019-04-23 16:45:52 -07:00
2a6ab9549b add macro guards 2019-04-23 13:51:58 -06:00
3e24212780 add sanity check on buffer size when copying public key 2019-04-23 13:42:49 -06:00
5d2f34aa6d Addressed review comments 2019-04-23 10:04:41 -07:00
34c1d5cba0 Cleanups and fixes for CryptoCell port:
* Protection for .c includes.
* Improved make pub memory issue reporting.
* README.md updates.
* Cleanup of user_settings.h.
2019-04-23 10:04:41 -07:00
6c65550eab Added CryptoCell-310 support
- SHA-256
- AES CBC
- CryptoCell 310 RNG
- RSA sign/verify and RSA key gen
- RSA encrypt/decrypt, decrypt inline
- ECC sign/verify/shared secret
- ECC key import/export and key gen pairs
- Hardware RNG and RTC of nRF52840 for benchmark timing source
- readme doc
2019-04-23 10:04:41 -07:00
90ce5c04dc Clean up user_settings for CS+ 2019-04-23 13:44:05 +09:00
f8c9285b92 Added a WOLFSSL_CIPHER_LIST_MAX_SIZE macro 2019-04-22 16:30:38 -07:00
393ca1b30c Increased test suite ciphers buffer size (ticket #5000))
Enhancement to support ECC domain param HEX string or unsigned bin comparison (ticket #5035)
2019-04-22 10:30:05 -07:00
de299848c1 initialize pubkey size to 0 2019-04-22 10:01:17 -06:00
82796d4b4c remove pubKeyX509 from WOLFSSL_X509 structure 2019-04-19 15:15:02 -06:00
29101a29c9 free key in test case, initialize variables fix, macro guard on iana use 2019-04-19 09:47:15 -06:00
ec2849b885 macro guard on EncodePolicyOID use 2019-04-18 14:56:24 -06:00
efc96e40d1 add test cases 2019-04-18 10:41:51 -06:00
378f5c0d4b Merge pull request #2204 from dgarske/server_fixups
Improvements to TLS write handling in error cases
2019-04-18 09:21:27 -07:00
b291b51988 adjust get pubkey from X509 2019-04-18 09:31:01 -06:00
e1537b2a56 add case CRL_DIST_OID and fix key usage check 2019-04-18 09:31:01 -06:00
e4555b5bf5 add wolfTLSv1_3_method() 2019-04-18 09:31:01 -06:00
abced6c365 place tls 1.3 suites at beginning of list and alter parse on set cipher list 2019-04-18 09:31:01 -06:00
b787465b42 adjust TLS 1.3 capable check 2019-04-18 09:31:01 -06:00
083183e3b1 add get cipher iana list and parse iana list 2019-04-18 09:31:01 -06:00
db1fabbdd4 add WOLFSSL set IO callbacks 2019-04-18 09:31:01 -06:00
6976219b05 add x509 TBS getter function 2019-04-18 09:31:01 -06:00
7da46501cc add certgen and certext to jni, add get timeout function 2019-04-18 09:31:01 -06:00
788443d3cf set initial buffer size 2019-04-18 09:31:01 -06:00
494e469dd2 implement wolfSSL_OBJ_txt2nid for OIDs 2019-04-18 09:31:01 -06:00
72f3329faa add wolfSSL_X509_verify function 2019-04-18 09:31:01 -06:00
bf3d876e6a getter function for X509 public key 2019-04-18 09:31:01 -06:00
0d3541594f Curve25519 ARM64 assembly
Also in a C file but use the assembly code file if possible.
2019-04-18 14:41:57 +10:00
2cf264a9d5 Merge pull request #2207 from ejohnstown/evp-init-fix
EVP Init Fix
2019-04-17 17:16:42 -07:00
3f8e0a67e6 Merge pull request #2206 from miyazakh/Renesas_IDE_CSPlus
Updated Renesas example projects as the latest version of sw use
2019-04-17 17:15:31 -07:00
3bf01072d8 EVP Init Fix
When calling wolfSSL_EVP_DigestInit() with an unsupported string, the
macType should be set to NONE, rather than ignored. In a particular
build combination, functions using that EVP could false the type because
of memory garbage. Just set it in the else case.
2019-04-17 14:04:00 -07:00
1ab5a022c6 updated as the latest version of sw use 2019-04-17 16:30:11 +09:00
5bfc49f63f Changed ECC_MAX_PAD_SZ to be overridable macro for rare case where user might require additional padding. 2019-04-15 14:56:04 -07:00
4ee4cb2068 Improved readability for ECC signature max size calculations. 2019-04-15 11:08:08 -07:00
013e4429da Merge pull request #2202 from SparkiDev/curve25519_asm_file
Curve25519 converted from inline assembly to asm only
2019-04-12 16:31:08 -07:00
3c63f70cde Merge pull request #2203 from dgarske/atmel_typo
Fix for typo in atmel PK callbacks
2019-04-12 15:00:49 -07:00
bd618970c1 Fixed API unit test for wc_ecc_sig_size to allow smaller result. 2019-04-12 12:36:20 -07:00
68390b1ba3 Improvement to wolfSSL_write to not allow for VERIFY_MAC_ERROR or DECRYPT_ERROR errors. This resolves possible end user application implentation issue where a wolfSSL_read failure isn't handled and a wolfSSL_write is done anyways. 2019-04-12 11:29:28 -07:00
364bf50a94 Fixed example server to not try and write on failure. 2019-04-11 11:30:41 -07:00
02500365bf Revert additional atmel.h changes for opaque types in PR #2199. 2019-04-11 06:15:39 -07:00
1d023b344d Fix for typo in atmel PK callbacks from PR #2199. 2019-04-11 06:02:37 -07:00
e5bf2ed1d1 Curve25519 converted from inline assembly to asm only
Fixed large values (top bit set) in tables to be negative as the type is
signed.
Put C++ protection around function prototypes in fe_operations.h.
2019-04-11 16:17:48 +10:00
ae9ef3998c Enable the TFM speedups when used with --enable-ecccustcurves=all and fastmath and x86. 2019-04-10 21:06:17 -07:00
1fffe4a463 Improvements to the maximum ECC signature claculations. The wc_ecc_sig_size function provides actual max based on curve order. The wc_ecc_sig_size_calc has also been adjusted to provide a more accurate maximum size. 2019-04-10 21:05:46 -07:00
b6fcbe8436 Merge pull request #2199 from dgarske/contiki_16bit
Fixes for PK callbacks on 16-bit and ATECC
2019-04-09 14:56:26 -07:00
35654530ba Merge pull request #2198 from SparkiDev/sp_cortex4_iar
Cortex-M code changed to support IAR compiler
2019-04-09 14:41:00 -07:00
173016ef47 Merge pull request #2196 from dgarske/stm32_aes_gcm
Improvement for STM32 GCM performance
2019-04-09 14:31:27 -07:00
13909fc407 Merge pull request #2190 from dgarske/telit
Port for Telit IoT AppZone SDK
2019-04-09 14:26:59 -07:00
a90001581e Fixes for PK callbacks and ATECC. Fixes for PK callbacks on 16-bit system where unsigned int* is used. Fix for ATECC PK callback functions. Fix for atmel_ecc_create_pms to free the used slot. 2019-04-09 08:15:01 -07:00
333b666f6b Fixups updated and IAR defines 2019-04-09 10:59:24 +10:00
9b62141580 Merge pull request #2197 from abrahamsonn/doxygen-update
Updated doxygen script
2019-04-08 15:24:02 -07:00
2c5f268f16 Port for Telit IoT AppZone SDK
* Added new `WOLFSSL_TELIT_M2MB` build option to enable support for RNG, Time, Mutex, FileSystem and Directory.
* Added `XTIME_MS` macro to simplify the tls13.c layer time requirement.
* Cleanup of the wolfCrypt benchmark and test printf remapping.
* Added wolfCrypt optional memory test enabled with `COMPLEX_MEM_TEST`.
* Added wolfCrypt test / benchmark feature for allowing "sleep" between long operations using `TEST_SLEEP()`.
* Fix for extern with `sp_ModExp_2048` when building with `--cpp` option.
2019-04-08 06:43:25 -07:00
4f75d4eea2 Cortex-M code changed to support IAR compiler 2019-04-08 09:03:50 +10:00
c78b0c3a40 Merge pull request #2194 from dgarske/testcerts
Fix for test certs script
2019-04-05 15:13:39 -07:00
bbf8ed408d Fix for LowResTimer function ptoto not matching for 16-bit system. 2019-04-05 14:56:02 -07:00
ce43044426 Improvement for STM32 GCM performance. ZD 4712. 2019-04-05 14:06:23 -07:00
5c8cf9ecd2 Merge pull request #2195 from ejohnstown/vswarn
Fix VS Warning
2019-04-05 13:40:24 -07:00
460556ff45 Updated doxygen script
Changed check_api.sh grep call to be more friendly across machines, prior call
wasn't properly reporting API mismatch on some machines
2019-04-05 13:46:35 -06:00
6a964123a1 Add a pragma to ignore a particular warning when compiling the fast math file for Windows. 2019-04-05 10:08:41 -07:00
f5f1fec840 Merge pull request #2193 from SparkiDev/hash_sha3
SHA-3 support in Hash
2019-04-05 09:04:33 -07:00
2ad80df1c7 Fix for ./certs/gen-testcerts.sh sometimes reporting: "start date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ". 2019-04-05 09:01:44 -07:00
56d7766ba3 Merge pull request #2192 from SparkiDev/small_server
Fixes for small server build without client code
2019-04-05 06:18:57 -07:00
cc5ba81245 SHA-3 support in Hash 2019-04-05 14:52:23 +10:00
ad857c40d1 Fixes for small server build without client code 2019-04-05 09:38:14 +10:00
9c3cb2fbba Merge pull request #2176 from miyazakh/no_signature_algo
Add macro definition to disable signature algorithms extension
2019-04-04 15:35:00 -07:00
db83e6dd31 Merge pull request #2191 from ejohnstown/aesctr-sameio
AES-CTR In Place
2019-04-04 11:14:06 -07:00
f81446bf69 Fixed compiling error while enabling opensslextra 2019-04-04 10:04:09 +09:00
a59488b299 AES-CTR In Place
Added a temp AES block in case in and out are the same pointer.
2019-04-03 15:02:00 -07:00
b224f6fac9 Merge pull request #2181 from JacobBarthelmeh/Compatibility-Layer
update wolfSSL_i2d_RSAPrivateKey function
2019-04-03 09:16:10 -07:00
e13c903ad2 Merge pull request #2189 from dgarske/various_fixes
Various minor fixes
2019-04-02 09:21:31 -07:00
51251bc421 Fix for ssl23.h include for openssl compat with cyassl. 2019-04-01 11:10:29 -07:00
e4059a65b9 Merge pull request #2177 from dgarske/async_rel_v4
wolfSSL Asynchronous release v4 fixes
2019-04-01 11:07:12 -07:00
c7b5f772aa Add missing cert to include.am for make dist, which is required for ./gencertbuf.pl. 2019-04-01 10:09:34 -07:00
e8afb6ea51 Merge pull request #2174 from embhorn/zd4879
Fixes for static analysis issues
2019-04-01 08:48:40 -07:00
26cbfcdee0 Fix for AES GCM decrypt test with Async. 2019-04-01 05:58:44 -07:00
9ce32e3808 Merge pull request #2184 from ejohnstown/ecc-fix
Fix Clang Static-Analysis Finding
2019-04-01 05:46:22 -07:00
9ad48067f6 Merge pull request #2183 from miyazakh/sess_reuse_unitest
Add unit test for session resumption re-using WOLFSSL obj
2019-04-01 05:45:08 -07:00
817eaa6da4 protect compiling while enabling both WOLFSSL_TLS13 and WOLFSSL_NO_SIGALG 2019-03-30 10:41:57 +09:00
6c0989ba4d no_signature_algo 2019-03-30 10:41:40 +09:00
6d1a11eefb Clang static analysis found a potential issue when checking an ECC key
when the curve cache is enabled. There was a chance it could dereference
NULL. Added some error checks to fix it.
2019-03-29 13:35:27 -07:00
6968797848 fixed jenkins test failure 2019-03-30 01:35:35 +09:00
1c22f14d1c added unit test for session resumption re-using WOLFSSL obj 2019-03-29 20:13:41 +09:00
1906179a1b Fix for HAVE_ECC_CDH wolfCrypt test with async using the wrong size for x and y. With async the sizeof(sharedA) == 8 and it should be ECC_SHARED_SIZE. 2019-03-28 18:48:32 -07:00
b0d65d2a3e Remove remnant debug -Map from --with-intelqa build option. 2019-03-28 17:52:08 -07:00
7e9e50c03b Fix for Async TLS v1.3 wolfSSL_write with AES GCM offload. The args->idx was being incremented on the repeated call with BUILD_MSG_HASH state. 2019-03-28 17:52:08 -07:00
5b21da4dc5 Fix for SHA-3 runtime detection for not supported in hardware using NOT_COMPILED_IN. 2019-03-28 17:52:08 -07:00
d7c6683d9b Fix for latest QAT v1.7 detection. The qat library requires usdm_drv. 2019-03-28 17:52:08 -07:00
b599dc2b9d update wolfSSL_i2d_RSAPrivateKey function 2019-03-28 14:15:57 -06:00
9ea2dbea95 Merge pull request #2172 from dgarske/atecc
Fixes for ATECC support
2019-03-28 10:36:54 -07:00
cffe7eccde Fixes for high impact issues 2019-03-28 12:08:19 -05:00
b1c791dbd9 Merge pull request #2180 from miyazakh/wolfsslclean_fix
Initialized sendVerify when calling wolfSSL_clear
2019-03-27 23:32:41 -07:00
8c6316eb9c Merge pull request #2179 from kojo1/X509_STORE_CTX
X509_STORE_CTX_free compatibility
2019-03-27 17:17:26 -06:00
15c7463150 Merge pull request #2166 from SparkiDev/rsa_vfy_only
Fixes for RSA verify only builds
2019-03-27 12:01:14 -07:00
ed5feaf7ae Merge pull request #2173 from dgarske/custcurves
Added `--enable-ecccustcurves=all` option.
2019-03-27 10:19:08 -07:00
05987ec717 Initialized sendVerify when reseting WOLFSSL object 2019-03-27 10:18:43 +09:00
b40e0888ad Fixes for different build configurations 2019-03-26 08:06:19 +10:00
b24e122a0d Fixes for RSA verify only builds 2019-03-26 08:06:19 +10:00
7aa159ca6d Merge pull request #2157 from kojo1/ocsp_staple
Expose CheckResponse as wolfSSL_CertManagerCheckOCSP_Staple
2019-03-25 13:48:29 -07:00
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
6b325929e5 Merge pull request #2175 from kojo1/BN_init
add BN_init
2019-03-25 09:04:36 -06:00
3e42c6edcd remove sk_X509_free for compatibility 2019-03-24 16:57:08 +09:00
6c9e64129d move #include "ocsp.h" after #define WOLF_STACK_OF(x) 2019-03-23 08:03:45 +09:00
d9e6b8a62d Merge pull request #2168 from aaronjense/master
Remove NULL check before pub and priv have a chance to be set
2019-03-22 16:34:34 -06:00
3d747f7c87 add guard on test case for pkcs7 with no aes 2019-03-22 15:56:05 -06:00
744c247e92 change CheckOCSP_staple to OCSPResponse, move to ssl.h 2019-03-22 13:56:32 +09:00
441fb60679 fix cr 2019-03-22 09:40:55 +09:00
50a854c4cf Added --enable-ecccustcurves=all option. 2019-03-21 13:01:04 -07:00
f7a7a97f8c Fix to include the atmel.h with make install when using --with-cryptoauthlib. 2019-03-21 09:13:39 -07:00
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
e07e41d0aa Fix for building ATECC without ATCAPRINTF defined. 2019-03-21 09:13:39 -07:00
21f2beca9f Merge pull request #2165 from ejohnstown/version-update
Version Update v4.0.0
2019-03-21 09:20:36 -06:00
5ab6d58504 Release Fixes
1. Pick up a few new files into the distrubution that were missed.
2019-03-20 15:01:54 -07:00
1c237af5b3 Release Fixes
1. Update the date in README and ChangeLog to today.
2019-03-20 11:08:10 -07:00
fbfd7a4dea Release Fixes
1. Rearrange the deprecation cryptodev option so it doesn't overwrite the cryptocb option, and so it doesn't break its case in the build-test.
2. Fix the content length in the sample HTTP used by the example server.
3. Disable OCSP stapling in the example server if RSA is disabled.
4. Fix a variable in asn.c that was declared in the middle of its scope.
5. Retag the xmalloc, xrealloc, xfree functions used in the memory test as WOLFSSL_API like all the other allocators, instead of extern.
2019-03-20 11:01:24 -07:00
22b2ae7358 Release Fixes
1. Fix for the enable-afalg option from Jacob Barthelmeh.
2. Client fix for enable-sp+enable-sp-math option from David Garske.
3. Added a couple of typecasts to some mallocs.
4. Modified the option guard for the mask member of Options for the webserver build.
5. Added some more padding to the opaque structures used for SHA_CTX and AES_KEY.
6. Added WOLFSSL_API to the stack logging functions.
2019-03-19 13:55:17 -07:00
fb3ca1b53e Release Fixes
1. The RNG internal state could be a memory leak if the seed generate
test fails. If the seed test fails, you have bigger problems.
2019-03-18 14:30:51 -07:00
fed2bc5f72 Remove NULL check before pub and priv have a chance to be set 2019-03-18 13:18:04 -06:00
eebf07b67c Release Fixes
1. Fix two potentially unitialized variables, discovered on a VS build.
2019-03-18 10:14:16 -07:00
384b240ea2 minor fix in test_wolfSSL_BN(), api.c 2019-03-17 13:37:17 +09:00
6a3eccd344 add BN_init, working with tfm, only. 2019-03-17 13:28:04 +09:00
1ac74b0061 Release Fixes
1. Added some typecasting for g++ v8 permissive pointer use errors with void*.
2019-03-15 16:26:11 -07:00
ba8b104d7b Updates for v4.0.0
Update the RPM spec.in file.
2019-03-15 14:03:45 -07:00
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
60d3dec246 Updates for v4.0.0
Add links to the doc README for the wolfSSL and wolfCrypt API references.
2019-03-15 09:43:29 -07:00
d42f3bbdb6 Updates for v4.0.0
Update the DLL version resource.
2019-03-15 09:42:45 -07:00
ce4b54944b Updates for v4.0.0
Updated the README files and ChangeLog.
2019-03-15 09:42:45 -07:00
2817f6ed1a Updates for v4.0.0
Bump the version number in configure.ac and updated the version.h. The
library version wasn't updated between v3.15.7-stable and the snapshot
v3.15.8, so I bumped it for this release.
2019-03-15 09:42:45 -07:00
0ef4b7e933 Merge pull request #2164 from JacobBarthelmeh/PKCS7
adjust location of where PKCS7 content is saved
2019-03-15 09:40:17 -07:00
45b6a3b67d adjust location of where PKCS7 content is saved 2019-03-14 16:48:08 -06:00
6ff2039b1f Merge pull request #2163 from ejohnstown/config-fixes
Configuration Fixes
2019-03-14 15:21:41 -07:00
b1ea7c035f Merge pull request #2118 from kojo1/ocsp_proxy
OCSP, CRL request with "Cache-Control: no-cache" for proxy
2019-03-14 13:26:03 -07:00
172fd6d233 Merge pull request #2148 from cconlon/pkcs7nullparam
add NULL param in CMS KARI OriginatorPublicKey parameters
2019-03-14 13:17:34 -07:00
8a1ad3fcff Merge pull request #2160 from dgarske/fix_async
Fixes for asynchronous crypto and TLS
2019-03-14 11:56:46 -07:00
4b56af67a2 Merge pull request #2144 from embhorn/zd4871
Use snprintf with Win build
2019-03-14 11:42:09 -07:00
ac47e889f7 Merge pull request #2162 from JacobBarthelmeh/PKCS7
handle pkcs7 bundle with signed envelope and no certs list
2019-03-14 10:51:46 -07:00
3e3f746f3b Configure Fixes
When enable-all and disable-rsa is configured, some of the tests needed
for all don't work because they only use RSA keys or certificates.
Disabled those test cases in that build combination.
2019-03-14 10:37:40 -07:00
e08b36ea9c handle pkcs7 bundle with signed envelope and no certs list 2019-03-14 09:51:58 -06:00
6361ec2f10 Fix for AES GCM and CCM ex to NOT increment counter or update IV if failure or async response code. Resolves TLS v1.3 with async simulator. 2019-03-13 23:32:53 -07:00
397c2a4f8a Fix for SetNameFromCert not used when building with --disable-filesystem. 2019-03-13 23:03:00 -07:00
d19c37de2e Fix for example client arg -4 not working. 2019-03-13 22:59:50 -07:00
5a2cd5fc90 Fixes to resolve async crash (using stack pointer after return) due to 16-bit fixes in PR #2133 (commit 700eca4566). Revert to using the "unsigned int" length directly for word32 but cast it. 2019-03-13 22:59:00 -07:00
3feef07c93 Merge pull request #2156 from kaleb-himes/ZD4888-XCODE-UPDATE
Add rules to copy wolfio.h, wolfmath.h and mem_track.h as well as fix…
2019-03-13 18:05:04 -07:00
6b89b1f97a Configure Fixes
One of the external sites contacted for the OCSP stapling test
increased the size of one of their intermediate certificates. The test
failed silently as the certificate was ignored. Increased the
FP_MAX_BITS so that the test can pass with the enable-all option. That
option was setting the FP_MAX_BITS for 3072-bit certificates, and the
site in question is using a 4096-bit certificate.
2019-03-13 17:56:45 -07:00
27ea9d9bce Configure Fixes
1. The combination enable-all and disable-rsa breaks some of the
testing. Added the NO_RSA guards as appropriate.
2. Disabled the OCSP stapling and CRL tests when RSA is disabled as they
use test certificates with RSA keys.
2019-03-13 17:54:33 -07:00
bca69488b2 Xcode Project Update
1. Disable the tls_bench() test in the Xcode iOS benchmark project. It isn't complete.
2019-03-13 15:11:51 -07:00
a42290dd57 Xcode Project Update
1. Removed redundant includes of files.
2. Moved all the files in the viewer into the appropriate directories.
3. Updated the copy rules so the missing include files are copied to the destination for all the three possible targets.
2019-03-13 15:11:38 -07:00
2f4507e4f1 Merge pull request #2159 from JacobBarthelmeh/Testing
sanity check on padlen with pkcs7 decode
2019-03-13 12:58:49 -07:00
508cda43a2 Fix for asynchronous build memory macros, which broke due to PR #2026. 2019-03-13 12:14:43 -07:00
f54a7e50ce Merge pull request #2153 from ejohnstown/no-fips
No-FIPS/FIPS Build
2019-03-13 11:37:07 -07:00
4c42630f2b Merge pull request #2158 from JacobBarthelmeh/PKCS7
PKCS7 BER decode enveloped content
2019-03-13 11:33:52 -07:00
41bc83c5ce Merge pull request #2074 from kaleb-himes/HARMONYv3-ZD4785
Update support for entropy source with HARMONYv3
2019-03-13 09:36:01 -07:00
68c576e0d9 add macro guard around test case 2019-03-13 10:31:32 -06:00
06e5f8c39b sanity check on padlen with pkcs7 decode 2019-03-13 10:00:43 -06:00
effca6c081 add test case for BER encoded PKCS7 content decoding 2019-03-13 08:53:15 -06:00
e810551aab Fix to handle BER with PKCS7 enveloped decode 2019-03-13 08:46:15 -06:00
0d48a4a1a7 Merge pull request #2133 from dgarske/fixes_16bit
Fixes for data types, cast warnings and shift operations when using 16-bit platform
2019-03-12 16:53:27 -07:00
b4ba3d7ca6 Merge pull request #2136 from dgarske/asncapathlen
Fixes issue with CA path length for self signed root CA's
2019-03-12 14:11:15 -07:00
28a1ff5d59 Merge pull request #2146 from dgarske/sigalgo_ecdh
ECDSA option to limit sig/algos to key size with `USE_ECDSA_KEYSZ_HASH_ALGO`
2019-03-12 14:08:10 -07:00
696fe47de2 Merge pull request #2125 from embhorn/zd4297
Decoded cert cache feature
2019-03-12 14:02:47 -07:00
70490a4db6 Merge pull request #1855 from ejohnstown/trust-ca
Trusted CA Key Indication Extension
2019-03-12 13:52:27 -07:00
7ac5f8fde1 Merge pull request #2147 from kaleb-himes/ZD4615-extAuthKeyIdNotSetInCAFix
Edge case fix for AKID not set in CA and two CAs with same issuer line
2019-03-12 11:59:10 -07:00
03e0dd6ca3 Add back this path length check for self-signed CA as special case for the supplicant only. 2019-03-12 11:05:07 -07:00
764b783317 Add rules to copy wolfio.h, wolfmath.h and mem_track.h as well as fix up settings for clang and iPhone XR 2019-03-12 10:36:12 -06:00
666e47faaa Merge pull request #2152 from ejohnstown/readme-fix
Fix Readme
2019-03-12 09:18:39 -07:00
4ea1a7e651 Merge pull request #2154 from miyazakh/fix_DhkeySz
Fixed compile error under ESP-IDF framework
2019-03-12 09:54:10 -06:00
ad32ace0a1 Fixed build-error due to FFDHE_2048 definition 2019-03-12 18:32:13 +09:00
7d1bb05c0c Fix return code for GetMacDigestSize. 2019-03-11 19:37:04 -07:00
700eca4566 Fixes from peer review. Improved compatibility of API's. Clarification on integer.h mp_digit sizes. 2019-03-11 19:34:07 -07:00
f1af32b783 No-FIPS/FIPS Build
Update the fips-check script to create an archive with the current revision of the parts.
2019-03-11 17:13:02 -07:00
57cdbffc2c Merge pull request #2149 from dgarske/cryptocb_ret
Refactor of the crypto callback return code and new API version marker
2019-03-11 16:54:53 -07:00
554af3dcfa Merge pull request #2151 from JacobBarthelmeh/Testing
path include adjustment, rename internal OBJ function, and client pri…
2019-03-11 16:48:19 -07:00
3710a0a6c8 Merge pull request #2135 from SparkiDev/ed25519_check_key
Implement check for Ed25519 private matching public
2019-03-11 16:18:43 -07:00
2b59aefe80 Update from review 2019-03-11 18:14:37 -05:00
8b6bd306f3 Update from review 2019-03-11 18:03:29 -05:00
436a46a9f4 Merge pull request #2131 from dgarske/qat_v3.15.8
Fix for async wolfCrypt test with AES GCM.
2019-03-11 15:50:57 -07:00
ab0beb354b Merge pull request #2129 from SparkiDev/sp_prime
Improve SP code and support prime check using SP in tfm.c
2019-03-11 13:53:57 -07:00
b8035371f4 Merge pull request #2124 from mstaz/ocsp_date_nonce_check_fix
Ocsp date and nonce check fix
2019-03-11 13:29:08 -07:00
c0ee01bbf6 Merge pull request #2123 from dgarske/stm32_gcm
Fixes for STM32 AES GCM
2019-03-11 12:53:27 -07:00
1eb46c697f 1. In the loop in TCA parse, when checking the list of IDs that the
server has keys for, change the polarity of the comparison. If the
current ID is in the list, set the response flag and break out of
the loop.
2019-03-11 12:42:13 -07:00
9bd40353c2 1. Rename the parameters cert and certSz on the function
wolfSSL_UseTrustedCA() to certId and certIdSz.
2. Add better parameter checking to wolfSSL_UseTrustedCA() based on the
ID type.
2019-03-11 12:42:13 -07:00
8a4e8067f6 1. In the trusted CA extension code, add guards for NO_SHA around the cases that use SHA-1.
2. Check the trusted CA id pointer for NULL before copying.
3. Updated the api test for the NO_SHA change.
4. Remove the TCA options member as redundant.
2019-03-11 12:42:13 -07:00
201c85478e Move the -5 option text into the localization array and add a Japanese translation. 2019-03-11 12:42:13 -07:00
a1ed8e7a67 Fix a fall-through bug in the server options parsing around a new
option.
2019-03-11 12:36:58 -07:00
2342ea15eb Remove the CTX versions of the UseTrustedCA functions. A session needs
to be able to set a flag in the extension and that isn't allowed in the
CTX extensions.
2019-03-11 12:36:58 -07:00
cb57a5f3ed Added a test case for TrustedCA to the unit test.conf file. 2019-03-11 12:36:58 -07:00
b7663a940e Trusted CA Key Indication Extension
Added an API for enabling the Trusted CA Key Indication extension from
RFC6066 section 6. If the server doesn't have a match for the client,
the client will abandon the session.
2019-03-11 12:35:12 -07:00
6e1b05316d Merge pull request #2104 from ejohnstown/renegotiation-testing
Secure Renegotiation
2019-03-11 12:10:48 -07:00
b3a1d6bff1 Merge pull request #2099 from miyazakh/Espressif_port_Phase2C
RSA primitive hw acceleration support on esp32
2019-03-11 12:04:26 -07:00
de21642db1 Update sanity check for set 2019-03-11 11:19:51 -06:00
616b75bfba Fix Readme
Fix typo where DTLS was labeled v1.3, not v1.2.
2019-03-11 09:41:37 -07:00
9c9279817b path include adjustment, rename internal OBJ function, and client print outs added 2019-03-11 09:57:04 -06:00
3d9c660688 Refactor of the ECC crypto callback return code handling. 2019-03-11 08:28:45 -07:00
68c04a95e0 Refactor of the crypto callback return code for cases when unavailable to use new error code CRYPTOCB_UNAVAILABLE. Retains support for original NOT_COMPILED_IN error code. Added new CRYPTO_CB_VER define for helping applications handle/detect changes to crypto callback interface (currently no way to determine changes at build-time between release cycles). 2019-03-08 16:50:45 -08:00
1dcd6b92a0 Fix leak in wolfcrypt test app detected w/ WC_RSA_NO_PADDING set (#2145)
Fix leak in wolfCrypt test with `WC_RSA_NO_PADDING`
2019-03-08 14:13:38 -08:00
ea13e0482a wolfIO_HttpBuildRequest_ex 2019-03-09 06:31:52 +09:00
3be4682cda Merge pull request #2134 from dgarske/fixes_nightly
Fixes for minor nightly build errors
2019-03-08 10:15:46 -08:00
d8bec5e034 add NULL param in CMS KARI OriginatorPublicKey parameters 2019-03-08 09:13:22 -08:00
d26a6b59a3 Wrapper for MSC < VS2015 2019-03-08 10:55:34 -06:00
413e3b36cb Edge case fix for AKID not set in CA and two CAs with same issuer line 2019-03-07 11:30:13 -07:00
be83a54f22 Handle older MSC versions 2019-03-07 12:07:00 -06:00
619cf89106 Enhancement for ECDSA with USE_ECDSA_KEYSZ_HASH_ALGO to not send sig/algo hash sizes larger than the ECC key size. 2019-03-07 08:56:35 -08:00
0e962aa6e5 Merge pull request #2130 from jrblixt/feature-WICED6_1-serverChange
examples server HTTP update needed for WICED HTTP parser.
2019-03-06 16:46:36 -08:00
934c1b7952 Use snprintf with Win build 2019-03-06 14:55:51 -06:00
d699b65a25 Merge pull request #2026 from kojo1/mdk-CMSISv2
MDK CMSIS RTOSv2
2019-03-06 09:36:49 -07:00
d61684f210 Merge pull request #2142 from ejohnstown/typecast-add
Add Typecasts
2019-03-06 16:21:20 +10:00
f64c165a8b Merge pull request #2141 from ejohnstown/win-build
windows build update for warnings
2019-03-06 16:15:21 +10:00
b7deab9787 Merge pull request #2140 from JacobBarthelmeh/Testing
adjust comments on key type for function
2019-03-06 08:03:34 +10:00
e897661402 Merge pull request #2139 from ejohnstown/ar-flags
AR flags configure update
2019-03-05 15:49:16 -06:00
e3ddfc42af Add Typecasts
Add some typecasts to the RSA constant time data copy so it doesn't
misbehave with some embedded compilers that do the integer promotion in
a different order than expected.
2019-03-05 13:36:23 -08:00
5e573b518a Fix a couple warnings from a windows build regarding uninitialized variables. 2019-03-05 09:55:18 -08:00
dc3b81f633 adjust comments on key type for function 2019-03-05 10:53:10 -07:00
42eacece82 AR flags configure update
In at least one environment the check for particular AR options was
failing due to a bash script bug. Deleted an extra pair of parenthesis
triggering an arithmetic statement when redundant grouping was desired.
2019-03-05 09:26:30 -08:00
a364874b48 Implement check for Ed25519 private matching public
Add test SSL test that uses the Ed25519 private key only
2019-03-05 08:19:33 +10:00
980970da86 Fixes issue with CA path length basic constraint checking for self signed root CA's. ZD 4863 2019-03-04 11:27:51 -08:00
99b5188ee9 Fix for missing curve specs when using ATECC due to PR (https://github.com/wolfSSL/wolfssl/pull/2115). 2019-03-04 09:48:33 -08:00
da27a4da10 Merge pull request #2119 from jrblixt/feature-WICED-Studio-v6_1-PR02262019
Feature wiced studio v6 1 pr02262019
2019-03-04 17:45:42 +01:00
222f9f4f47 Adjust count. 2019-03-01 20:04:20 -07:00
8569d14cb3 Fixes for minor nightly build errors. Missing wc_ecc_fp_free declaration and "Value stored to 'useSupCurve' is never read". 2019-03-01 16:12:08 -08:00
621e1656b4 Fixes for data types, cast warnings and shift operations when using 16-bit platform. Added new --enable-16bit build option, which defines WC_16BIT_CPU. Fix build error when using WOLFSSL_LEANPSK and NO_WOLFSSL_MEMORY.
Tested using `avr-gcc` version 8.3.0 with: `./configure --host=avr --enable-16bit --disable-filesystem --enable-singlethreaded CFLAGS="-DWOLFSSL_GENSEED_FORTEST -DWOLFSSL_USER_CURRTIME -DWOLFSSL_USER_IO -DWOLFSSL_NO_SOCK -DNO_WRITEV -DUSER_TICKS" --enable-tls13 --enable-compkey --enable-certgen --enable-certext --enable-keygen --enable-session-ticket --enable-maxfragment`. Also with `--enable-fastmath`.
2019-03-01 15:54:08 -08:00
5f332fa29e review changes. 2019-03-01 14:06:27 -07:00
020b27bab2 wolfSSL_SecureResume() should be client only. Return an error if called
form the server.
2019-03-01 11:00:26 -08:00
4f2d4420df Cleanups for hard coded 12 and 16 in AES GCM code. Allow STM32 GCM IV 12 thru 16. 2019-03-01 10:50:08 -08:00
e87433e2b6 Fix for async wolfCrypt test with AES GCM. 2019-03-01 09:56:38 -08:00
5083330b86 Improve SP code and support prime check using SP in tfm.c 2019-03-01 20:24:08 +10:00
Max
de869080be Added description for added ASN options. 2019-03-01 09:49:49 +01:00
809c30a5b9 Merge pull request #2128 from SparkiDev/pkcs11_ecc_server_fix
PKCS #11 id RSA - TLS don't convert length a la ecc
2019-02-28 19:05:33 -08:00
c45dade903 Merge pull request #2127 from SparkiDev/zephyr_fix_1
Fix spelling mistakes in text messages in Zephyr samples
2019-02-28 18:14:00 -08:00
dc144df32a PKCS #11 id RSA - TLS don't convert length a la ecc 2019-03-01 10:23:45 +10:00
cce06e8c50 Addressed to review comments 2019-03-01 08:59:03 +09:00
ee17bd7470 Re-apply spelling error correction 2019-03-01 08:59:03 +09:00
6372634eda Addressed to code review comments 2019-03-01 08:59:03 +09:00
330bbb2f8b RSA primitive hw acceleration support 2019-03-01 08:59:03 +09:00
e8c3e8dd63 Decoded cert cache feature 2019-02-28 16:59:19 -06:00
e78125e8d6 Fix spelling mistakes in text messages in Zephyr samples 2019-03-01 08:43:20 +10:00
b528997d30 Merge pull request #2103 from SparkiDev/pkcs11_hmac
PKCS #11 support for HMAC with MD5, SHA, SHA-2
2019-02-28 09:50:59 -08:00
Max
fd089b4b6b Changed define to configure all date checks in OCSP responses. 2019-02-28 10:49:58 +01:00
1f7f424075 Code review updates.. 2019-02-27 17:27:58 -07:00
edf6318985 PKCS#11 casting fix for clang 2019-02-28 09:31:17 +10:00
a382a979cc Merge pull request #2098 from kaleb-himes/ZD4793
Fix for single threaded case with double free on suites
2019-02-28 08:56:57 +10:00
e2e3b835d6 Merge pull request #2100 from SparkiDev/tls13_vers
Support FFDHE in TLS 1.2 and below. Better TLS 1.3 version support.
2019-02-27 14:55:29 -08:00
8f3f27065c Merge pull request #2114 from dgarske/qat_bench
Fixes and improvements for async / QuickAssist
2019-02-27 14:49:32 -08:00
469898aeeb Merge pull request #2115 from dgarske/ecc_sign_hw
Fix for ECC sign with hardware to ensure the input is truncated
2019-02-27 14:41:57 -08:00
b830447690 Merge pull request #2113 from JacobBarthelmeh/Testing
EVP decrypt with padding fix
2019-02-27 14:35:57 -08:00
9e93bd1000 fix memory leak for multiple status 2019-02-28 07:34:26 +09:00
2e41d25bca fix wolfIO_HttpBuildRequestCrl 2019-02-28 07:23:35 +09:00
4226fb66f9 Merge pull request #2117 from SparkiDev/pkcs11_id_fix_2
PKCS #11 use private key id double free issue fixed
2019-02-27 14:19:43 -08:00
b189fc0ef8 Merge pull request #2120 from dgarske/nightly_fixes
Fixes for various nightly build configuration warnings
2019-02-27 14:15:40 -08:00
5c6876e05e Merge pull request #2121 from JacobBarthelmeh/Compatibility-Layer
rename function wolfSSL_sk_ASN1_OBJCET_pop
2019-02-27 14:12:10 -08:00
95b08553a1 Merge pull request #2122 from tmael/portingDeos
Deos: Corrected a typo in TLS client connect call
2019-02-27 12:50:54 -08:00
164eb30732 Fixes for STM32 AES GCM. Hardware does not correctly compute authTag if input is not a multiple of block size, so fall-back to software for tag only. Hardware also only supports IV of 12 or 16 bytes, so fall-back to software in those cases. ZD 4712 2019-02-27 11:07:03 -08:00
9b500c6d56 Corrected a typo in TLS client connect call and removed .zip project 2019-02-27 10:00:06 -08:00
6ce28d74ff rename function wolfSSL_sk_ASN1_OBJCET_pop 2019-02-26 16:55:03 -07:00
77ffeccb0b Fixes to QAT enables for benchmark for HMAC. Adds new NO_HW_BENCH to support using multi-threaded software only benchmarks. 2019-02-26 14:34:03 -08:00
b33023df2f fix setting outlen with wolfSSL_EVP_CipherUpdate decryption 2019-02-26 15:27:25 -07:00
65c72ddfe1 Reverted an earlier change to the renegotiation resumption. Still need
to check the cert subject hash.
2019-02-26 14:26:09 -08:00
57d8e070f9 1. Remove the clearing of the sessionID from Rehandshake.
2. Put SecureResume in terms of a regular resume, using Get/SetSession
and then calling Rehandshake.
3. Add the startScr after checking secure_renegotiation enabled during a
resume.
2019-02-26 14:10:44 -08:00
1512f4da90 Correct the output for multi-threaded benchmark usign -base10 option. 2019-02-26 13:38:33 -08:00
326ee8c318 Revert change to PKCS12 tailList. 2019-02-26 11:27:08 -08:00
a3af2fc960 Fix for single threaded case with double free on suites. 2019-02-26 11:03:02 -08:00
38303cf27b More spelling fixes. 2019-02-26 10:47:42 -08:00
eecc823208 Fixes for scan-build warnings with ASN, PKCS12 and PKCS7. 2019-02-26 10:47:22 -08:00
e01723a435 Code review changes. 2019-02-26 10:42:02 -07:00
8a47af0edc Added benchmark tests to WICED wolfcrypt test app.
Updated the user_settings.h loc per David.
TLS13; SNI; MAX_FRAG
Configure for wolfCrypt bench.
Update README.
2019-02-26 10:37:58 -07:00
95658be0ce WICED wolfCrypt-TLS_cli_srv-Https_cli 2019-02-26 10:37:48 -07:00
9a129e89c1 Fixes for building with no filesystem and --enable-testcert or WOLFSSL_TEST_CERT. Fixes nightly expected configurations test. 2019-02-26 09:36:31 -08:00
fe620b5250 Compile error when FP_MAX_BITS doesn't support FFHDE parameters 2019-02-26 16:44:59 +10:00
a2f8747652 Fix DecodePrivateKey to return NOT_COMPILED_IN with PKCS#11 2019-02-26 09:22:03 +10:00
cb830a088f Fix for configurations without specific algorithms 2019-02-26 09:22:03 +10:00
700e9896d4 PKCS #11 support for HMAC with MD5, SHA, SHA-2 2019-02-26 09:22:03 +10:00
2bb5dd710c Fix for curve load failure leak. 2019-02-25 15:19:31 -08:00
b45241f6f8 Fix to use QAT for ECC sign and verify when SP is enabled and key was initialized with devId. Fixes issues with wolfCrypt test and QAT not properly calling "again" for the ECC sign, verify and shared secret. 2019-02-25 14:51:15 -08:00
a44751cd39 PKCS #11 use private key id double free issue fixed 2019-02-26 08:27:59 +10:00
efc1ab8c42 Merge pull request #2111 from SparkiDev/ed25519_fixes_1
Various improvements for testing
2019-02-25 13:55:28 -08:00
0360b38de4 Merge pull request #2116 from SparkiDev/pkcs11_id_fix_1
Fixes for PKCS #11 private key id and ECC
2019-02-25 13:09:15 -08:00
3785bafdf4 Merge pull request #2096 from kaleb-himes/ZD4707
Update for newer versions of the TI compiler
2019-02-25 13:05:43 -08:00
603a9b2e59 Merge pull request #2110 from dgarske/spelling
Fixes for various spelling errors
2019-02-25 13:04:12 -08:00
72a50b8d46 Merge pull request #2109 from dgarske/pkcs7_buf
Fix for proper detection of PKCS7 buffer overflow case
2019-02-25 13:02:09 -08:00
Max
aa70ac0be2 Added defines to force OCSP nonce check and omit OCSP date before check. 2019-02-25 14:40:19 +01:00
0e914d81dc Fixes for PKCS #11 private key id and ECC 2019-02-25 11:17:56 +10:00
feea036ec9 Fix generation of certs_test.h
Fix formatting of certs_test.h:
- remove trailing spaces
- change leading tab stops to spaces
2019-02-25 09:00:26 +10:00
712ecabf36 Fix for ECC sign with hardware to ensure the input is truncated to the key order. 2019-02-22 15:30:52 -08:00
9ff976a6e1 Fixes for wolfCrypt test with asynchronous support enabled and --enable-nginx. 2019-02-22 13:47:34 -08:00
b037334732 Merge pull request #2106 from dgarske/ecc_pubkey
Adds `ECC_PUBLICKEY_TYPE` to the support PEM header types
2019-02-22 12:09:10 -08:00
04e3c4414d Merge pull request #2102 from SparkiDev/pkcs11_aes_cbc
Add support to PKCS #11 for AES-CBC and NO_PKCS11 defines
2019-02-22 12:07:23 -08:00
9b125c5797 Merge pull request #2107 from JacobBarthelmeh/Compatibility-Layer
remove null terminators on substrings
2019-02-22 10:26:06 -08:00
8b0bcdaf29 EVP decrypt with padding fix 2019-02-22 10:05:15 -07:00
8bb4e23f8d Various improvements for testing
Fix wc_ecc_fp_free() to be called when using HAVE_STACK_SIZE.
Increase size of replyin client.c so all HTTP reply is displayed.
Fix api.c to support only Ed25519 (not RSA and ECC)
Fix suites.c to detect when CA for client won't work (Ed25519 only)
For Static Memory add debugging and small profile.
Also allow realloc to be called with NULL.
Add more Ed25519 certs and keys.
Fix names of Ed25519 filenames for client and server.
Do NOT turn on ECC_SHAMIR by default with lowresource.
Enable WOLFSSL_STATIC_MEMORY_SMALL if low resource and no RSA.
2019-02-22 17:14:19 +10:00
7b44fbe265 OCSP, CRL request with "Cache-Control: no-cache" for proxy 2019-02-22 09:23:06 +09:00
ee3eb8fb4c Fix for proper detection of buffer overflow case when calling wc_PKCS7_EncodeSignedData. 2019-02-21 13:32:28 -08:00
289f51a77d Fixes for various spelling errors. 2019-02-21 13:29:44 -08:00
5e0a77704b argument check 2019-02-22 06:17:45 +09:00
801ef2c62c add wolfSSL_CertManagerCheckOCSP_Staple 2019-02-22 05:39:38 +09:00
28d8730948 exporse OcspEntry in asn.h 2019-02-22 05:20:54 +09:00
5932cdab15 cast on strlen return value 2019-02-21 13:04:38 -07:00
55ca2c2da7 Added build-time override for benchmark thread count WC_ASYNC_BENCH_THREAD_COUNT. 2019-02-21 10:45:09 -08:00
39626bb349 1. Add a newline to the client's "non-blocking socket and renegotiation" notice.
2. Add suite test cases for more renegotiation setting combinations.
2019-02-21 10:06:55 -08:00
5801e7773b Merge pull request #2108 from miyazakh/server_help_in_jp
fixed examples/server to take additional parameter for "-?"
2019-02-21 05:55:32 -08:00
ee4e27afe2 Fix lengths to support large DH params 2019-02-21 17:13:43 +10:00
b68eab6450 fixed to take additioanl option for -? 2019-02-21 13:44:08 +09:00
18d3e04dbf remove null terminators on substrings 2019-02-20 16:39:18 -07:00
b0957c68fb ForceZero the devKey field of Aes in PKCS#11
Don't memset the key field of AES in PKCS#11.
2019-02-21 08:22:56 +10:00
b4996e35fa Set MAX_PRF_HALF bigger for large FFDHE parameters
Stack size measurement is in a thread - free local fp_cache
2019-02-21 08:09:52 +10:00
7389553bd6 1. For secure renegotiation, remove the check of the peer certificate's
subject ID on renegotiation. Both endpoints are already
cryptographically linked on an encrypted channel.
2. The error code list has gaps where deprecated codes were deleted,
remove the redundant gaps where there aren't missing codes.
2019-02-20 11:45:21 -08:00
9c9221432f Merge pull request #2087 from ejohnstown/aesgcm
Update TLS for AES-GCM/CCM changes
2019-02-20 11:43:06 -08:00
a376e17aee Switch the bound for the XMEMSET of the sessionID when starting a
renegotiation to use sizeof the sessionID rather than the constat used
to set the size of the array.
2019-02-20 11:26:33 -08:00
f78ba4649b Update the help text so the Japanese translations of the new options are printed. 2019-02-20 11:23:00 -08:00
b8dc772ef8 Merge pull request #2105 from dgarske/fix_stm_aesgcm
Fix for STM32 AES GCM
2019-02-20 09:23:11 -08:00
3013cdd925 Merge pull request #2095 from SparkiDev/asm_macosx
Get Mac OS X working with the x86_64 assembly files
2019-02-20 09:19:29 -08:00
025fba8ec6 Merge pull request #2093 from dgarske/tls13_async_dh
Fix for TLSv1.3 with DH key share when using QAT
2019-02-20 09:16:54 -08:00
5d667ed1b8 Merge pull request #2075 from SparkiDev/port_zephyr
Zephyr port of crypto
2019-02-20 09:10:04 -08:00
d81fb727a3 Adds ECC_PUBLICKEY_TYPE to the support PEM header types. Fixes #2097. 2019-02-20 08:40:57 -08:00
1f6314746c Secure Renegotiation
1. Split the wolfSSL_Rehandshake() function into wolfSSL_Rehadshake()
which performs a full handshake on secure renegotiation and
wolfSSL_SecureResume() which performs a session resumption on a
secure renegotiation.
2. Add option to example client to perform a secure resumption instead
of a full secure handshake.
2019-02-19 15:50:55 -08:00
ba14564c49 Fix for STM32 AES GCM, which was incorrectly using software crypto when authInSz != 16. The wc_AesGcmEncrypt_STM32 and wc_AesGcmDecrypt_STM32 functions correctly handle all variations of authInSz. 2019-02-19 15:38:09 -08:00
c2fbef2f7f Refactor to populate preMasterSz on XMALLOC. Fix for DoClientKeyExchange and ecdhe_psk_kea, which assumes preMasterSz is zero. Fix for TLS v1.3 resumption not properly setting preMasterSz. Removed for TLS v1.3 PSK setup test for preMasterSz == 0, which is not required. Spelling fixes for tls13.c. 2019-02-19 13:01:21 -08:00
dc1f0d7822 Fix for DH with QuickAssist to only use hardware for supported key sizes. Fix in random.c for seed devId when building async without crypto callbacks. 2019-02-19 11:57:55 -08:00
161e815c03 remove hard tab 2019-02-20 04:14:17 +09:00
520ae52ece Add support to PKCS #11 for AES-CBC and NO_PKCS11 defines
Added PKCS #11 specific defines to turn off support for algorithms.
2019-02-19 13:50:12 +10:00
e3997558a9 Fixes from review and added REAMEs and setup.sh
Add README.md and setup.sh.
Add READMEs with license information.
2019-02-19 11:47:45 +10:00
5e1eee091a Add threaded samples using buffers and sockets 2019-02-19 11:47:45 +10:00
4302c02e67 Include zephyr directories in the release 2019-02-19 11:47:44 +10:00
2c447b24cd Fixes from review and add IDE files 2019-02-19 11:47:44 +10:00
3366acc9ce Zephyr port of crypto 2019-02-19 11:47:44 +10:00
7aa5cd6f10 Support FFDHE in TLS 1.2 and below. Better TLS 1.3 version support.
Add support for the fixed FFDHE curves to TLS 1.2. Same curves in TLS
1.3 already. On by default - no checking of prime required.
Add option to require client to see FFDHE parameters from server as per
'may' requirements in RFC 7919.

Change TLS 1.3 ClientHello and ServerHello parsing to find the
SupportedVersions extension first and process it. Then it can handle
other extensions knowing which protocol we are using.
2019-02-18 14:51:59 +10:00
b842b8583e add CMSIS RTOSv2 and imporove other default values to user_settings.h template 2019-02-18 06:48:20 +09:00
0ee1e103dd update project files 2019-02-18 06:46:41 +09:00
239f878bd1 fix indentation 2019-02-18 06:45:26 +09:00
f3c2125259 add Mutex type for CMSIS RTOSv2 2019-02-18 06:45:01 +09:00
1c6911634c sprit DECLARE_ARRAY_DYNAMIC into declaration and execution 2019-02-18 06:43:26 +09:00
98e53cb4eb Improved user_settings.h, Abstract.txt 2019-02-18 06:41:53 +09:00
c7f8f9fc90 Declarations have to come before executable statements
WOLFSSL_MDK5_COMPLv5: mdk5 compiler ver 5 regards macro with args as executable statement (This seems to be fixed with v6)
2019-02-18 06:39:06 +09:00
6c3ed46542 examples server HTTP update. 2019-02-15 15:45:30 -07:00
c0d1241786 Modify the TLSv1.3 calls to the AES-GCM and AES-CCM encrypt functions to
use the FIPS compatible APIs with external nonce.
2019-02-15 13:52:23 -08:00
d806134cbf Update for newer versions of the TI compiler 2019-02-15 13:05:37 -07:00
25dd5882f8 Merge pull request #2094 from dgarske/ecdsa_der_len
Adds strict checking of the ECDSA signature DER encoding length
2019-02-15 10:53:57 -08:00
7275ee5f19 Merge pull request #2089 from SparkiDev/tls13_sup_ver
Make SupportedVersions respect SSL_OP_NO_TLSv*
2019-02-15 10:36:32 -08:00
d9a5898e91 Merge pull request #2082 from SparkiDev/parse_kse
Fix length passed to key share entry parsing
2019-02-15 10:31:14 -08:00
c04cade97c Merge pull request #2083 from JacobBarthelmeh/Testing
Expected Configurations Test - NIGHTLY BUILD #505
2019-02-15 10:23:55 -08:00
16f31cf8c6 Get Mac OS X working with the x86_64 assembly files 2019-02-15 15:08:47 +10:00
e47797f700 Make SupportedVersions respect SSL_OP_NO_TLSv* 2019-02-15 08:26:03 +10:00
7328fce60d Disable MP_64BIT when compiling with clang-cl on Windows.
__attribute__ ((mode(TI))) does not really work on clang-cl,
linking would fail with "unresolved external symbol __udivti3",
as reported in https://bugs.llvm.org/show_bug.cgi?id=25305

Fix to use default case with 28bit digits on clang-Windows.
2019-02-14 23:18:51 +01:00
a9f29dbb61 Adds strict checking of the ECDSA signature DER encoding length. With this change the total signature size should be (sequence + r int + s int) as ASN.1 encoded. While I could not find any "must" rules for the signature length I do think this is a good change.
If the old length checking method is desired `NO_STRICT_ECDSA_LEN` can be used. This would allow extra signature byes at the end (unused and not altering verification result). This is kept for possible backwards compatibility.

Per RFC6979: `How a signature is to be encoded is not covered by the DSA and ECDSA standards themselves; a common way is to use a DER-encoded ASN.1 structure (a SEQUENCE of two INTEGERs, for r and s, in that order).`

ANSI X9.62: ASN.1 Encoding of ECDSA:

```
ECDSA-Sig-Value ::= SEQUENCE {
  r INTEGER,
  s INTEGER
}
```

Fixes #2088
2019-02-14 12:05:34 -08:00
e2d7b402e7 Update so TLSv1.3 will work. Needed to make the implicit IVs full sized
when copying. Added a flag to SetKeys() to skip the IV set (used for
TLSv1.3).
2019-02-14 12:04:32 -08:00
3223920fd9 Add a guard for AES-GCM and AES-CCM for the change in Encrypt for the
AES-AEAD type and macros.
2019-02-14 12:04:05 -08:00
cd7f8cc653 Update AES-GCM/CCM use in TLS with a wrapper to select the correct API
depending on using old FIPS, or non-FIPS/FIPSv2.
2019-02-14 12:04:05 -08:00
67e70d6cb6 Update TLS to use the new AES-GCM and AES-CCM APIs that output the IV on
encrypt rather than take the IV as an input.
2019-02-14 12:04:05 -08:00
64cb07557d Merge pull request #2091 from SparkiDev/pkcs11_fixes
Fix PKCS #11 AES-GCM and handling of unsupported algorithms
2019-02-14 09:49:02 -08:00
5856d6b3dc Fix PKCS #11 AES-GCM and handling of unsupported algorithms 2019-02-14 17:06:15 +10:00
275667f0e9 remove ocsp attempt with ipv6 enabled 2019-02-13 19:01:09 -07:00
46bb2591c8 Merge pull request #2070 from dgarske/fix_cryptocb
Fixes and improvements to Crypto Callbacks and STM32 RNG performance
2019-02-13 12:44:19 -08:00
d98ebc4da2 Reverted the Hmac_UpdateFinal change to call final as it causing constant timing issues. Improved the wc_HmacFree to handle the case were final isn't called for Crypto callbacks. 2019-02-13 10:24:53 -08:00
272181bc2e Merge pull request #2086 from dgarske/atecc_makekey
Fix for ATECC make key case when `curve_id == 0`
2019-02-13 09:52:54 -08:00
817b82e453 Merge pull request #2084 from cconlon/cmsFeb19
Changes for CMS signedData default signed attributes
2019-02-13 09:49:55 -08:00
1fab970316 Merge pull request #2085 from miyazakh/esp-idf_fix_script
modified esp-idf setup script to avoid unnecessary file copy
2019-02-13 08:01:13 -07:00
95db819d45 Fixes for warnings when building with --enable-pkcs11. 2019-02-12 16:05:48 -08:00
e0b46734d6 Enhnacement to the tls_bench tool to support new -S command to indicate total size of data to exchange. Previously was just sending one packet back and forth. Imporved the shutdown handling code. 2019-02-12 16:03:10 -08:00
1a8388641d Change new hash SetFlag/GetFlag API's to private. 2019-02-12 16:03:10 -08:00
c9521b56f2 Fix warning about HAL_RNG_GenerateRandomNumber type. 2019-02-12 16:03:10 -08:00
eb8a2f3a03 Minor fixes to CryptoCb wolfCrypt test for AES test and hash support for update/final in same callback. 2019-02-12 16:03:10 -08:00
454687f429 Fix for TLS HMAC constant timing to ensure final is called for dummy operations. Added devCtx to AES for CryptoCb. 2019-02-12 16:03:10 -08:00
dcdb1d7094 Added flag to indicate if hash is copied. 2019-02-12 16:03:10 -08:00
e7b23646a5 Updates to HMAC crypto callback support to capture raw KEY and require hmac struct. 2019-02-12 16:03:10 -08:00
838652c03b Added flags build option to hashing algorithms. This allows indicator to determine if hash will be "copied" as done during a TLS handshake. 2019-02-12 16:03:10 -08:00
40a7bcfc20 Fix for new random seed crypto callback to properly reset error code in NOT_COMPILED_IN case. 2019-02-12 16:03:10 -08:00
88d3abb1e6 Added Crypto callback HMAC support. 2019-02-12 16:03:10 -08:00
18d5b3393c Correct NULL cryptocb case. 2019-02-12 16:03:10 -08:00
891abe130a Added Crypto callback support for ASN CalcHashId. Added arg checking to cryptocb functions. 2019-02-12 16:03:10 -08:00
9fc0610720 Fix to ensure hash devCtx is cleared. 2019-02-12 16:03:10 -08:00
7e3082906e Fix for ensuring devId is passed into symmetric init. 2019-02-12 16:03:10 -08:00
dad88b4c81 Improvements to the STM32L4 random generation code for improved performance and error handling. Added new WOLFSSL_STM32_RNG_NOLIB define to support generic STM32 series RNG without external ST library. 2019-02-12 16:03:10 -08:00
08bcef7c0c adjust wolfSSL_PKCS7_verify API test 2019-02-12 14:48:49 -07:00
f824c8c769 Merge pull request #2077 from ejohnstown/ocsp-ecdsa
OCSP and ECDSA Signers
2019-02-12 09:50:37 -07:00
acb983a154 Fix for ATECC make key case when curve_id == 0 (default). ZD 4383 2019-02-12 08:34:34 -08:00
feae776ee3 Merge pull request #2078 from SparkiDev/ssl_priv_id
Support in SSL for setting a private key id
2019-02-12 07:56:47 -08:00
e5f94e5884 modified script to avoid unnecessary file copy 2019-02-12 10:37:30 +09:00
66ab6d8c22 Check FindObjectFinal call for error 2019-02-12 09:07:14 +10:00
acc0121e0f account for WOLF_C99 with ipv6 test cases 2019-02-11 15:07:12 -07:00
fb6aaf2ae2 rearrange order of default CMS SignedData signed attributes for better interop compatibility 2019-02-11 14:48:37 -07:00
56736a3563 always include default signed attributes for CMS SignedData bundles, add function to remove if needed 2019-02-11 14:41:32 -07:00
4e5ea71118 Merge pull request #2081 from dgarske/dh_max_sz
Fix to detect maximum DH key size
2019-02-11 13:21:08 -08:00
e86aae00ed Change to allow setting of devId for private key 2019-02-11 12:37:44 +10:00
47922a4d87 Support in SSL for setting a private key id
Works with PKCS #11 to use key on device.
2019-02-11 10:38:38 +10:00
88050de1ff Fix length passed to key share entry parsing 2019-02-11 08:29:28 +10:00
dd32df5df1 Merge pull request #2080 from kaleb-himes/ZD4795
fix typo revcd vs recvd and spell out to avoid confusion: received
2019-02-08 17:38:48 -08:00
aa21a0e6df Fix to increase maximum DH key size if using fast math and FP_MAX_BITS supports it. 2019-02-08 17:36:40 -08:00
b6d322cd14 fix typo revcd vs recvd and spell out to avoid confusion: received 2019-02-08 14:27:19 -07:00
6298074f93 OCSP and ECDSA Signers
OCSP uses an identified hash of the issuer's public key to identify the
certificate's signer. (Typically this is SHA-1, but can be any SHA
hash.) The AKID/SKID for the certificates usually are the SHA-1 hash of
the public key, but may be anything. We cannot depend on the AKID for
OCSP purposes. For OCSP lookups, wolfSSL calculates the hash of the
public key based on the copy saved for use with the handshake signing.
For RSA, that was fine. For ECDSA, we use the whole public key including
the curve ID, but for OCSP the curve ID isn't hashed. Stored the hash of
the public key at the point where we are looking at the key when reading
in the certificate, and saving the hash in the signer record.
2019-02-07 17:34:25 -08:00
e52f4494f0 Merge pull request #2069 from dgarske/fix_8192
Fixes for handling 6144 and 8192 bit with TLS v1.3
2019-02-07 15:02:40 -08:00
4f4d16d9e5 Merge pull request #2068 from dgarske/pkcs7_verify_degenerate
Fixes to handle degenerate PKCS 7 with BER encoding
2019-02-07 15:00:21 -08:00
9a67d2a869 Update support for entropy source with HARMONYv3 2019-02-06 13:25:05 -07:00
8666b7de9a add test-ber-exp02-05-2022.p7b file for test 2019-02-06 11:11:27 -07:00
ec28376e7f add PKCS7 BER verify test and fix for streaming 2019-02-06 11:05:15 -07:00
f61d99526b Merge pull request #2072 from JacobBarthelmeh/Testing
fix macro with pic32 mx build
2019-02-04 17:11:13 -08:00
53bf510740 Merge pull request #2073 from JacobBarthelmeh/Jenkins
fix typo with getting cipher suite : Jenkins Nightly Build test 499
2019-02-04 17:10:57 -08:00
be4d6bc204 fix typo with getting cipher suite 2019-02-04 10:53:59 -07:00
390f3f5fca Merge pull request #4 from SparkiDev/pr_2069
Disallow SupportedGroups in ServerHello for TLS 1.3
2019-02-04 09:05:36 +10:00
b7179c2a54 Disallow SupportedGroups in ServerHello for TLS 1.3
But allowed when downgrading to TLS 1.2.
2019-02-04 09:04:11 +10:00
f8ff68ca7a Merge branch 'master' of https://github.com/wolfssl/wolfssl 2019-02-03 16:19:59 +09:00
099d813a8c Fix headers 2019-02-03 15:44:41 +09:00
73fbf845f2 Merge pull request #2066 from SparkiDev/sec_reneg_scsv
Fix empty renegotiation info ciphersuite handling
2019-02-01 10:05:59 -08:00
8fc1780688 Merge pull request #2065 from SparkiDev/ossl_fix1
Changes to make symbols available for OpenSSL compat
2019-02-01 10:04:41 -08:00
14a2343118 Merge pull request #2064 from SparkiDev/tls13_dhkeysz
Set the DH key size for TLS 1.3 when secret calculated
2019-02-01 10:04:15 -08:00
4a5652f318 Merge pull request #2061 from SparkiDev/x86_asm_not_in_c
Pull out x86_64 ASM into separate files
2019-02-01 10:01:34 -08:00
1258467b0a Merge pull request #2054 from SparkiDev/pkcs11_rng
Add support for random and getting entropy (seed) with PKCS#11
2019-02-01 09:59:12 -08:00
4a177a8a30 Merge pull request #1997 from tmael/portingDeos
Initial Deos RTOS port
2019-02-01 09:56:55 -08:00
c080050c80 Fix to detect larger key size requirement based on FP_MAX_BITS. Fix for TLSv1.3 to allow server_hello for TLSX_SUPPORTED_GROUPS. ZD 4754. 2019-02-01 09:53:30 -08:00
c82d11f47d Cleanup of the PKCS7 stream long rc and braces. 2019-01-31 14:37:25 -08:00
3a0afc3506 Fixes to handle degenerate PKCS 7 with BER encoding in PKCS7_VerifySignedData. Fix for PKCS7 API unit test with SHA512 disabled. ZD 4757. 2019-01-31 14:36:46 -08:00
7822cef1ac Pull out x86_64 ASM into separate files 2019-01-29 13:08:24 +10:00
e8b46caf75 Fix empty renegotiation info ciphersuite handling 2019-01-29 12:51:49 +10:00
574238dea0 Set the DH key size for TLS 1.3 when secret calculated 2019-01-29 08:59:49 +10:00
0b2bbc33bd Merge pull request #2059 from miyazakh/openssl_bksize_digest
Added EVP_MD_CTX_block_size and exposed EVP_Digest()
2019-01-28 15:17:26 -07:00
1288036dbe Merge pull request #2047 from kojo1/freeCRL
wolfSSL_CertManagerFreeCRL: exposing FreeCRL
2019-01-25 16:08:31 -08:00
5c6b42e60d cast to a char 2019-01-25 15:30:09 -08:00
66987b4f2a Merge pull request #2058 from SparkiDev/tls13_earlydata_bench
Added EarlyData support to benchmark loop
2019-01-25 14:31:54 -08:00
67f615f42f Merge pull request #2053 from dgarske/warn_secrets
Show warning if secrets debugging options are enabled
2019-01-25 14:26:47 -08:00
0d8ca06928 Merge pull request #2052 from dgarske/atecc_fixes
Fixes for ATECC with PMS outlen and `ATECC_MAX_SLOT`
2019-01-25 14:26:09 -08:00
61e8d1ab92 fix macro with pic32 mx build 2019-01-25 14:13:51 -07:00
e4abcc0a15 fixed api unit test 2019-01-25 09:38:19 +09:00
53adb93ae4 Added EVP_MD_CTX_block_size and publicized EVP_Digest() 2019-01-25 09:05:36 +09:00
743f8b576f Add support for random and getting entropy (seed) with PKCS#11
Getting the seed from a device has been added.
If the HASH_DRBG is available, PKCS#11 will be used for generating the
seed.
Otherwise, all generated random data will come from PKCS#11 device.
2019-01-25 08:01:30 +10:00
0fe7591b0f Added EarlyData support to benchmark loop 2019-01-24 18:10:56 +10:00
4ef6841465 Changes to make symbols available for OpenSSL compat 2019-01-24 08:38:05 +10:00
2fa8e8bb94 realloc improvements 2019-01-22 19:21:51 -08:00
d16c2ca7c6 Merge pull request #1865 from JacobBarthelmeh/Optimizations
--enable-afalg=xilinx
2019-01-22 14:19:54 -08:00
7c4fa33937 Improve the error handling for non ECC_SECP256R1 curve in wc_ecc_make_key_ex. 2019-01-22 14:04:18 -08:00
fd429bb656 Show warning if secrets debugging options (SHOW_SECRETS or WOLFSSL_SSLKEYLOGFILE) are enabled. The #warning can be ignored as error using ./configure CFLAGS="-W#warnings". 2019-01-22 13:29:25 -08:00
c48786c649 Correct the ATECC slot maximum. 2019-01-22 12:14:05 -08:00
7ce255aa4d Fixes for ATECC with PMS outlen and ATECC_MAX_SLOT. 2019-01-21 18:45:42 -08:00
eaf5c3042d Merge pull request #2050 from toddouska/sub
remove outdated submission note
2019-01-21 18:41:38 -08:00
952d0b3b6b Merge pull request #2044 from dgarske/safertos
Fixes to resolve possible build issues with SafeRTOS.
2019-01-21 15:40:48 -08:00
52e8e77390 Merge pull request #2046 from cconlon/addalert
add alert number and string for "unknown_ca" (48)
2019-01-21 15:39:47 -08:00
d00dd9d7c9 Merge pull request #2049 from danielinux/ecc-verify-only
Allow ECC Verify-only operations with NO_ASN and SP_MATH
2019-01-21 15:37:55 -08:00
e87dac66ac Merge pull request #2021 from ejohnstown/dtls-resume
DTLS Update
2019-01-21 15:35:40 -08:00
f7c0a77c9c reomved outdated submission note 2019-01-21 09:14:58 -08:00
5ce6a9009e perform mem copy in realloc 2019-01-20 22:55:51 -08:00
501a3a287b Allow ECC Verify-only operations with NO_ASN and SP_MATH 2019-01-21 07:11:35 +01:00
5539b0eb38 wolfSSL_CertManagerFreeCRL: exporsing FreeCRL 2019-01-20 10:11:19 +09:00
db5c63bb25 fix for benchmarking specific RSA key size with -rsa-sz 2019-01-18 16:47:10 -07:00
8ecee6a7e9 add unknown_ca alert number (48) and string 2019-01-18 15:36:33 -08:00
253915866d make build more modular 2019-01-18 16:25:24 -07:00
4fb6e65857 alignment check and authin size check 2019-01-18 16:25:24 -07:00
b8ebd41fbc key size with AES-CMAC benchmark 2019-01-18 16:25:24 -07:00
f0a3045d62 af_alg sha3 addition
hardware acceleration with RSA

add AES-GCM hardware acceleration

refactor setting RSA IV flag

check and set AF_ALG flags

fix for default AF_ALG use

set buffer alignment with Xilinx RSA

macro guard after rebase

use ALIGN64

clean up test cases
2019-01-18 16:25:24 -07:00
5dbd074f33 adding eclipse project 2019-01-18 14:46:40 -08:00
1f26282bf2 update include.am and add function description 2019-01-18 14:46:39 -08:00
58da860cd6 update readme with config info 2019-01-18 14:46:39 -08:00
e51cc4e99d Removed unneeded \n from WOLFSSL_MSG 2019-01-18 14:46:39 -08:00
534fe6ab39 Updated with PR review comments 2019-01-18 14:46:39 -08:00
739b57c753 Initial Deos RTOS port
- Added support for Deos with no file system
- Implemented a custom malloc since reusing and freeing memory is disallowed in avionics and mission critical applications.
- Added TLS client and server example with a TCP setup mailbox transport
- Timer starts at an offset of CURRENT_UNIX_TIMESTAMP specified by the user
- Uses rand_r() as a pseudo random number generator and uses the current time in seconds as a seed
- Uses strnicmp for XSTRNCASECMP instead of strncasecmp
- a readme doc included
2019-01-18 14:46:39 -08:00
f2732a4ecd Fixes to resolve possible build issues with SafeRTOS.
* Support for building `WOLFSSL_SAFERTOS` without heap.
* Allows `XSTRNCASECMP` macro to be customized.
* USER_TIME supports checks for existing `strct tm` and `time_t`.
2019-01-18 10:02:20 -08:00
c282f5b726 DTLS Nonblocking Updates
Modify the DtlsMsgPoolSend() function to keep track of the last message
retransmit. If a write would block, it allows the retransmit pick up
where it left off.
2019-01-18 09:15:11 -08:00
cc3c2ef683 DTLS Nonblocking Updates
Add command line option to the example server to fake a write block on a
specified DTLS sequence number in epoch 0.
2019-01-18 09:15:11 -08:00
aa4de6e170 DTLS Nonblocking Updates
Do not allow the DTLS message flight be retransmit without being
finished. This can happen if a non-blocking transmit times out the
response and the application tries to retransmit.
2019-01-18 09:15:11 -08:00
8356c3d7e2 DTLS Nonblocking Updates
1. Add a second select for tx.
2. Revised tcp_select to work for either rx or tx.
3. Updated client and server to use new tcp_select_tx() for checking the
tx socket if the nonblocking connect/accept would block on transmit.
2019-01-18 09:15:11 -08:00
63f6c1d280 DTLS Nonblocking Updates
1. Add error code for trying to retransmit a flight when transmitting
the flight hasn't finished.
2. Add function to retransmit the stored flight without updating the
timeout count.
2019-01-18 09:15:11 -08:00
91d81ea691 Add some more debug logging for DTLS retransmission support. 2019-01-18 09:13:28 -08:00
d3e2488552 DTLS Resume Fix
1. In DTLS, when transmitting the Change Cipher Spec message increment the
sequence number.
2. In DTLS, when client receives the CCS message, sanity check that the
server hello has been received in the case of resume.
2019-01-18 09:13:28 -08:00
d07cf53bb1 Merge pull request #2034 from miyazakh/Espressif_port_Phase2B
Initial support atecc608a on 32se
2019-01-18 09:07:51 -08:00
02ef2ede12 Merge pull request #2041 from dgarske/crypto_cb
Refactor and rename of cryptodev to cryptocb
2019-01-18 09:02:44 -08:00
b632c8dcc1 Merge pull request #2043 from SparkiDev/tls13_psk_down
Fix PSK support when no PSK extension
2019-01-18 09:00:56 -08:00
33f876bb20 Merge pull request #2029 from SparkiDev/sni_tls13
Fix SNI on client when downgrading from TLS 1.3
2019-01-18 08:59:47 -08:00
fe97264ff9 Merge pull request #2028 from dgarske/spcortex
Added Cortex-M support for Single Precision (SP) math
2019-01-18 08:59:10 -08:00
d02f7a75b9 Merge pull request #2019 from dgarske/arduino
Improvements to Arduino sketch
2019-01-18 08:54:42 -08:00
aba726fcd3 Merge pull request #2004 from embhorn/prf_move
Moving PRF to wolfcrypt
2019-01-18 08:53:13 -08:00
c6a0d32979 Merge pull request #2042 from ejohnstown/ocsp-script
OCSP Script Update
2019-01-18 08:51:08 -08:00
2bcde06f90 Merge pull request #2001 from kojo1/embed_benchmark
Missing project file
2019-01-18 08:44:09 -08:00
357e0c9d15 Fixes for better backwards compatibility. 2019-01-18 06:54:48 -08:00
e18891aed8 Fix PSK support when no PSK extension 2019-01-18 16:13:07 +10:00
9879425c5f Addressed review comments 2019-01-18 10:53:48 +09:00
4a5c380f32 Addressed review comments 2019-01-18 08:20:20 +09:00
2753d2d548 clean up 2019-01-18 08:20:20 +09:00
e519e1eb2a Support atecc608a on 32se with example programs 2019-01-18 08:20:20 +09:00
8fb7892013 Merge pull request #2040 from ejohnstown/fix-checks
Fix Checks
2019-01-17 12:54:25 -08:00
0459e9842e OCSP Script Update
The check status variable GL_UNREACHABLE is not initialized and there
are times when it is checked and hasn't been set. Initialize it to zero.
2019-01-17 11:36:44 -08:00
ee45cfdbcb Refactor and rename of cryptodev to cryptocb. Refactor API names from wc_CryptoDev to use wc_CryptoCb. Backwards compatibility is retained for anyone using old WOLF_CRYPTO_DEV name. Added comment about fall-through case when CryptoCb return NOT_COMPILED_IN. 2019-01-17 11:01:14 -08:00
8edd7d0b17 Fix Checks
1. In the tls_bench, check the return code on wolfSSL_CTX_SetMinDhKey_Sz() as it is checked in the examples.
2019-01-17 10:32:34 -08:00
f6240e5558 Fix Checks
1. In the client, check the return code on wolfSSL_CTX_SetMinDhKey_Sz() as it is checked in the server. (Resolves issue #2037.)
2. In HashOutput(), check that the hsHashes exists for the session before hashing. (Resolves issue #2038.)
2019-01-17 09:52:00 -08:00
91573735b1 Merge pull request #2036 from ejohnstown/fragsz
TLS Record Fragment Size Check Change
2019-01-17 08:56:45 -08:00
5e03ac13f6 TLS Record Fragment Size Check Change
Fixed a potential bug with respect to processing fragmented handshake
messages. If a handshake message is fragmented across multiple TLS
records and the last fragment's record has the next handshake message in
it, we would throw a buffer error instead of processing the next
message. Changed this so it will finish the handshake message and return
out to process the next message. Also changed the handling of the
handshake message to follow the calling pattern.
2019-01-16 15:53:57 -08:00
02ff19a6c4 Moving PRF to wolfcrypt 2019-01-16 17:23:49 -06:00
bcc2458be6 add t4_demo/t4_demo.mtpj in am 2019-01-17 06:39:49 +09:00
d5b06f93fd Merge pull request #2031 from SparkiDev/sec_reneg_chrome
Changes to secure renegotiation for TLS 1.3 and Chrome
2019-01-16 12:00:08 -08:00
c26cb53c05 Merge pull request #2035 from miyazakh/fix_cmake_build
fixed cmake build on esp-idf
2019-01-16 11:21:11 -08:00
32ed53a991 Merge pull request #2012 from dgarske/cryptocb_sym
Added CryptoDev callback support for AES CBC, SHA1/SHA256 and RNG
2019-01-16 10:41:49 -08:00
5d262e9123 Merge pull request #2027 from dgarske/fix_buildopts
Fixes for various build options and warnings
2019-01-16 10:32:19 -08:00
d7ecdf110e Merge pull request #2013 from dgarske/tls_bench
Enhancements to the TLS benchmark tool
2019-01-16 10:30:55 -08:00
b683a5a6bb Merge pull request #1945 from victork1996/bugfix/openssl-evp-bytes-to-key-compatibility
Fixed OpenSSL compatibility issues in wolfSSL_EVP_BytesToKey
2019-01-16 10:18:08 -08:00
bb74dca6e7 Added certificate and private key to server example. Enable error strings, server side code and remove slow sha option for Arduino. 2019-01-16 10:07:56 -08:00
b37c94a15c Merge pull request #2022 from JacobBarthelmeh/OCSP
memory management with OCSP requests
2019-01-16 08:52:50 -08:00
1226bc3379 fixed cmake build on esp-idf 2019-01-16 18:01:18 +09:00
b2e4c86028 Changes to secure renegotiation for TLS 1.3 and Chrome 2019-01-15 09:47:23 -08:00
53ad7728bf Fix SNI on client when downgrading from TLS 1.3 2019-01-14 15:09:52 -08:00
8352365160 Fixes to resolve Cortex-M issue with ECC. 2019-01-14 14:16:56 -08:00
e4132d32a4 add ocsp test for more code coverage 2019-01-14 13:52:13 -07:00
6ac384793f memory management with OCSP requests 2019-01-14 09:49:50 -07:00
809fed8f05 Fix to resolve unit test error with WOLFSSL_CIPHER_INTERNALNAME or NO_ERROR_STRINGS defined. 2019-01-13 11:06:04 -08:00
864df5f9de Make sure SP ASM is defined for WOLFSSL_SP_ARM_CORTEX_M_ASM. 2019-01-12 09:52:26 -08:00
cfc66dab47 Fix compiler complaints when using Curve25519. 2019-01-11 21:16:13 -08:00
3c2aa60862 Fix to allow RSA public only to build without verify only. 2019-01-11 21:11:40 -08:00
45cd80b4b7 Fix define check of NO_CERT to be NO_CERTS. 2019-01-11 21:10:07 -08:00
bcc177b23d Fixes for build warnings. 2019-01-11 21:07:23 -08:00
406d2ceb6b Merge pull request #2023 from miyazakh/fix_no_hash_raw
fix no_hash_raw for esp32 hw acceleration
2019-01-11 21:04:04 -08:00
56415928ff Added Arduino TLS server sketch. 2019-01-11 17:20:35 -08:00
ebd68e6afd Fix to return the internal cipher suite name instead of NULL if NO_ERROR_STRINGS is defined. Fix for stray "if" in wolfSSL_SESSION_CIPHER_get_name. 2019-01-11 17:20:35 -08:00
0ef4856039 Added connect and shutdown calls to Arduino sketch. Improved the get cipher suite. Improved error handling. 2019-01-11 17:20:35 -08:00
141b263546 Merge pull request #2024 from dgarske/nb_timeout_det
Nonblocking connect timeout check
2019-01-11 17:12:48 -08:00
8df27ffdcf Fix for RTOSv2 2019-01-12 09:11:04 +09:00
cb39768e09 SimpleServer: update projectfile 2019-01-12 08:52:59 +09:00
92fd92c208 SimpleServer/main.c for RTOSv2 and RLnet4 2019-01-12 08:51:29 +09:00
034d1dff21 remove unused project file 2019-01-12 08:05:11 +09:00
64a528f318 remove unused code 2019-01-12 08:03:49 +09:00
4821d06dff fix worning 2019-01-12 07:50:15 +09:00
6a25b42efb fix worning 2019-01-12 07:49:49 +09:00
50598dcbac wc_port.c nad header files for ROTSv2 2019-01-12 07:49:20 +09:00
f67b8fa6a3 Experimental SP Cortex M support for Single Precision math. 2019-01-11 14:38:34 -08:00
6f760d796c update project files: CryptTest, benchmark, SimpleClient 2019-01-12 07:31:25 +09:00
cca27f6724 examples/celient.c, server.c: removing unused headers 2019-01-12 07:29:19 +09:00
13f4086d53 SImpleClient/main.c for CMSIS-RTOSv2 and net4 2019-01-12 07:27:58 +09:00
55fdeacf87 CryptTest, CryptBenchmark/main.c for CMSIS-RTOSv2 2019-01-12 07:26:41 +09:00
a4a6895900 Fix for scan-build "Value stored to 'err' is never read`" 2019-01-11 09:42:41 -08:00
6eea924a5c Fix for non-blocking read timeout. 2019-01-11 08:45:34 -08:00
3f46250994 Fix to timeout after 10 seconds in non-blocking mode if connect does not complete. 2019-01-10 17:12:37 -08:00
ebc9533bc7 Fixes and improvements to the new Crypto callback code for AES and Hashing. 2019-01-09 17:39:05 -08:00
ba0d488807 Added RNG Crypto callback support. 2019-01-09 14:36:40 -08:00
e1fd7b86f7 Merge pull request #2014 from JacobBarthelmeh/Testing
add ocsp stapling test and initialize values
2019-01-09 10:41:56 -08:00
bdc5dd41d1 fix no_hash_raw for esp32 hw acceleration 2019-01-09 16:56:47 +09:00
003360237f Fixes for building with NO_WOLFSSL_SERVER. Minor test.h cleanups. 2019-01-07 10:08:16 -08:00
26ae39a217 check if secure renegotiation struct available 2019-01-04 13:22:34 -07:00
a00eaeb877 add ocsp stapling test and initialize values 2019-01-04 13:16:47 -07:00
df2a0f9a4f Fixes for scan-build warnings. 2019-01-03 12:47:46 -08:00
f3c08ae8b9 Better fixes for ret unused. 2019-01-03 12:42:31 -08:00
ff0a4eb69a Fix for float compare warning. Minor cleanups. 2019-01-03 11:40:04 -08:00
a7251e4158 Fixes for minor Jenkins build warnings. 2019-01-03 11:22:01 -08:00
ef916f2c55 Enhancements to the TLS benchmark tool:
* Added support for running as only Client (`-c`) or Server (`-s`).
* Added support for using sockets (in addition to in memory mode `-m`).
* Fixed support for 16KB test packet (memory version needed TLS header space). Changed to default to 16KB.
* Fixed so transfer is done on each connection and there is not transfer limit (instead "shutdown" message is used).
* Made pthread support optional and based on HAVE_PTHREAD.
* Tested non-blocking support with sockets or shared memory.

To use with localhost sockets and threading use `./examples/benchmark/tls_bench`
To use with threading and in-memory use `./examples/benchmark/tls_bench -m`
To use as separate server client applications with localhost sockets use: `./examples/benchmark/tls_bench -s` and `./examples/benchmark/tls_bench -c` in separate terminals.

```
./examples/benchmark/tls_bench -?
tls_bench 3.15.7 NOTE: All files relative to wolfSSL home dir
-?          Help, print this usage
-c          Run as client only, no threading and uses sockets
-s          Run as server only, no threading and uses sockets
-h          Host (default localhost)
-P          Port (default 11112)
-e          List Every cipher suite available
-i          Show peer info
-l <str>    Cipher suite list (: delimited)
-t <num>    Time <num> (seconds) to run each test (default 1)
-p <num>    The packet size <num> in bytes [1-16kB] (default 16384)
-v          Show verbose output
-d          Enable debug messages
-T <num>    Number of threaded server/client pairs (default 1)
-m          Use local memory, not socket
```
2019-01-03 10:57:39 -08:00
1201ffb13f Added CryptoDev callback support for AES CBC and SHA1/SHA256. 2019-01-02 14:34:26 -08:00
656c7951cd Merge pull request #2010 from dgarske/mdk_fixes
Fixes for MDK5 project
2019-01-02 12:39:35 -08:00
ed80cf4f4d Merge pull request #2009 from JacobBarthelmeh/Testing
fix for some warnings and edge case build
2019-01-02 12:38:51 -08:00
2121607705 Merge pull request #2005 from dgarske/fix_sp_arm32_asm
Fix for SP ASM when building sources directly
2019-01-02 12:36:40 -08:00
71bc571a8a Merge pull request #2000 from kojo1/EVP_CipherInit
EVP_CipherInit: allow NULL iv, key for openSSL compatibility
2019-01-02 12:04:38 -08:00
5677e71cba Merge pull request #1987 from dgarske/32bit
Fixes for `--enable-32bit` option
2019-01-02 11:38:31 -08:00
9c75753bd2 Merge pull request #1984 from miyazakh/Espressif_port_Phase2A
Support AES and SHA hw acceleration on esp32-wroom-32
2019-01-02 11:37:55 -08:00
d5509a4f37 Merge pull request #2007 from dgarske/fips_build
Fixes for a few FIPS build macro checks
2019-01-02 10:10:08 -08:00
332dd75e5f Fix missing semicolon for HAL_CRYP_AESECB_Decrypt call. Fix for NO_MULTIBYTE_PRINT in test.h. These fixes were pulled in from PR #1974. 2018-12-31 13:53:12 -08:00
47f5282416 fixes for gcc 8 string warnings 2018-12-28 17:16:45 -07:00
a1459f6fec fix build when QSH is enabled and TLS 1.3 is enabled 2018-12-28 17:16:34 -07:00
fb0eb55f28 Improved FIPS version check logic for error-crypt.h. 2018-12-28 09:36:13 -08:00
b5ff99a017 Fixes for a few minor build errors where HAVE_FIPS and HAVE_FIPS_VERSION are not checked. 2018-12-28 09:22:36 -08:00
9df0fc9509 Added protection to ensure WOLFSSL_SP_ASM gets defined when required. Updated the SP macro comments in GCC-ARM user_settings.h. ZD 4556. 2018-12-28 08:48:28 -08:00
30612ad3ed addressed review comments 2018-12-28 11:48:39 +09:00
965c68abdf Chaged to match filename and standard in file header 2018-12-28 08:39:19 +09:00
913fe6ea2b addressed review comments 2018-12-28 08:39:19 +09:00
e8bf2bbb02 removed multiple user_settings.h 2018-12-28 08:39:19 +09:00
9d2294b967 Support AES and SHA hw acceleration on esp32-wroom-32
Removed unnecessary codes
Added README
Some clean up for maintenancebility
Removed unused methods

Removed unused methods
2018-12-28 08:39:19 +09:00
c54e8e31bd Merge pull request #2003 from dgarske/async_rel_3.15.7
Async release v3.15.7 prep
2018-12-27 13:55:12 -08:00
cc8c6078b6 Fix to adjust WC_ASYNC_DEV_SIZE. Fix for tests/test-trustpeer.conf typo in include.am. 2018-12-27 11:08:49 -08:00
2351047409 Fixes for various scan-build reports. 2018-12-27 11:08:30 -08:00
1eccaae25f Fix for DTLS async shrinking input buffer too soon and causing -308 (INCOMPLETE_DATA). 2018-12-27 11:07:32 -08:00
5cb5b510ab Added blocking support for PKCS 7 with async. Fix for RSA async key gen in wolfCryp test. 2018-12-27 11:07:07 -08:00
66442c4bd5 add initialization value for af_alg 2018-12-26 16:57:24 -07:00
697c99a9ec Merge pull request #1934 from dgarske/fix_alt_chain
Fixes and cleanups for processing peer certificates
2018-12-26 15:09:42 -08:00
9c88218b62 Merge pull request #1998 from dgarske/async_fix_smallstack
Fix double free with async and small stack
2018-12-26 14:35:57 -08:00
a7350b7d2e Merge pull request #1994 from JacobBarthelmeh/Release
prepare for release 3.15.7
2018-12-26 10:49:35 -08:00
f97696a546 AesSetKey_ to AesSetKey_ex 2018-12-26 13:52:41 +09:00
6ff8febf0f README: set properties of CC-RX 2018-12-25 15:37:30 +09:00
1d5c50cc63 Missing project file 2018-12-25 07:14:56 +09:00
0c828d14a0 Name conficted. filter out with NO_AES 2018-12-24 17:27:41 +09:00
a73bca090b fix for nginx port 2018-12-23 22:19:03 -07:00
b6d61f2987 prepare for release 3.15.7 2018-12-23 22:18:48 -07:00
ae09fbe8a2 EVP_CipherInit: allow NULL iv for openSSL compatibility 2018-12-24 12:00:21 +09:00
86177d1830 Removes the forced 32-bit instruction (via -m32) from --enable-32bit option and replaces with comment. Some compilers do not support the -m32 option, plus to work properly it must be used with configure directly like ./configure CFLAGS="-m32" LDFLAGS="-m32". Removes the NO_64BIT option to allow building corect on x86_64 and aarch64 (math libs detect platform properly). Fixes #1985. 2018-12-23 15:59:57 -08:00
3eff20904a Merge pull request #1991 from dgarske/rsa_nb_time
Adds RSA non-blocking time support
2018-12-21 15:58:54 -08:00
75321d72f6 Merge pull request #1996 from JacobBarthelmeh/Testing
free internal OCSP buffers
2018-12-21 15:57:58 -08:00
61757c83eb Fix double free with ./configure --enable-asynccrypt --enable-smallstack. 2018-12-21 15:45:33 -08:00
a358174b4b Fix for DH prime test (extra leading spaces). Fix for new chain tests with CRL enabled. The current way of testing chain only loads root CA as trusted. The intermediate CA CRL isn't trusted or loaded and causes error. 2018-12-21 12:36:47 -08:00
6191cb1927 free internal OCSP buffers 2018-12-21 12:30:49 -07:00
59a3b4a110 New tests for cert chains, alternate cert chains, trusted peer certs and DH prime cleanup:
* Added ECC and RSA intermediate CA's and server/client chain certificates for testing.
* Enhanced suites test to support expected fail arg `-H exitWithRet` in any test .conf file.
* Added new `test-altchains.conf` for testing with `WOLFSSL_ALT_CERT_CHAINS` defined.
* Added new `test-chains` for testing chains.
* Added new `test-dhprime.conf` for DH prime check tests.
* Added new `test-trustedpeer.conf` for testing `WOLFSSL_TRUST_PEER_CERT`.
* Refactor to add `-2` to disable DH prime check by default (except for new test-dhprime.conf).
* Added ability to run a specific test.conf file using syntax like `./tests/unit.test tests/test-altchains.conf`.
2018-12-21 09:54:55 -08:00
00dd222aa5 Fix for example client with -X external tests to not disable for PSK build unless usePsk is set. Resolves issue with external tests being skipped if building with PSK enabled. 2018-12-21 08:21:59 -08:00
9733076fe0 Fixes and cleanups for processing peer certificates:
* Fix with `WOLFSSL_ALT_CERT_CHAINS` to resolve issue with using a trusted intermediate to validate a partial chain. With the alt cert chain enabled a CA may fail with only `ASN_NO_SIGNER_E` and the connection is allowed if the peer's certificate validates to a trusted CA. Eliminates overly complex 1 deep error alternate chain detection logic. Resolves ZD 4525.
* Refactor and cleanup of ProcessPeerPerts to combine duplicate code and improve code commenting.
* Fix for CA path len check in `ParseCertRelative` to always check for self-signed case (was previously only in NO_SKID case).
* Improvement to include self-signed flag in the DecodedCert struct.
2018-12-21 08:20:04 -08:00
3e31115654 Merge pull request #1993 from JacobBarthelmeh/Testing
Release Testing
2018-12-20 16:19:17 -08:00
d3274e28e8 fix for hash types with fips windows opensslextra build 2018-12-20 14:22:35 -07:00
7d11c3f67c fix for reported nightly Jenkins build tests 2018-12-20 13:35:54 -07:00
a4a4cd6a3c Merge pull request #1992 from SparkiDev/tls13_group_hrr
Fix HelloRetryRequest to be sent immediately and not grouped
2018-12-20 11:14:30 -08:00
5d2d370bd5 fix for scan-build warning 2018-12-20 11:40:20 -07:00
164a762088 fix afalg/cryptodev + opensslextra build 2018-12-20 10:52:17 -07:00
eba11e097a Fix HelloRetryRequest to be sent immediately and not grouped 2018-12-20 16:41:38 +10:00
48c267dda8 fix warning with secure-renegotiation build and error with ntru build 2018-12-19 15:47:43 -07:00
165a80d02d fix for build with cryptonly + rsapub 2018-12-19 15:30:22 -07:00
92d59c7df4 fix for cryptonly + rsavfy build 2018-12-19 14:36:32 -07:00
413506f2b5 Adds new wc_RsaSetNonblockTime API and WC_RSA_NONBLOCK_TIME build option. This new function configures the maximum amount of blocking time in microseconds. It uses a pre-computed table along with the CPU speed in megahertz to determine if the next operation can be completed within the maximum blocking time provided. 2018-12-19 13:15:41 -08:00
fc926d3c61 fixes from infer testing 2018-12-19 11:56:29 -07:00
986b5d3951 Merge pull request #1988 from JacobBarthelmeh/ARMv8
add -mstrict-align flag with armasm
2018-12-18 15:51:32 -08:00
4068975190 Merge pull request #1983 from dgarske/x509small_verifycb
Include current cert as X509 in verify callback for small build
2018-12-18 15:40:00 -08:00
58a2f518e8 Merge pull request #1981 from dgarske/qat_features
Added RSA Key Gen and SHA-3 support for Intel QuickAssist
2018-12-18 15:39:38 -08:00
0a6732ee67 Merge pull request #1979 from SparkiDev/tls_sh_tlsx_parse
Fix TLS 1.2 and below ServerHello TLSX_Parse to pass in message type
2018-12-18 15:39:12 -08:00
4a170c0399 Merge pull request #1971 from SparkiDev/tls13_old_hello
Don't expect old ClientHello when version is TLS 1.3
2018-12-18 15:38:44 -08:00
f1c62f191d Merge pull request #1941 from ejohnstown/rekey
Server Side Secure Renegotiation
2018-12-18 15:38:16 -08:00
c41d02e72f fix for Aarch32 aesgcm sanity checks 2018-12-18 10:35:53 -07:00
412966ed80 add -mstrict-align flag with armasm 2018-12-17 17:36:48 -07:00
443dbf251b Fix to supply the X509 current_cert in the verify callback with OPENSSL_EXTRA_X509_SMALL defined or ./configure --enable-opensslextra=x509small. 2018-12-17 13:02:14 -08:00
c478a2791a Fix to disable the raw Hmac_UpdateFinal_CT HMAC calculation for async crypt. Resolves issue using -v 2 -l ECDHE-RSA-AES128-SHA with QAT. 2018-12-17 12:54:33 -08:00
cbbe63ec62 Added QAT SHA3 support. Fix for SHA512/SHA384 with QAT and Intel ASM enabled. 2018-12-17 12:54:33 -08:00
c23489e6ed Added support for QAT RSA Key Generation. 2018-12-17 12:54:33 -08:00
b60918b8cd Merge pull request #1982 from kaleb-himes/DGE_REPORT_MAINTENANCE
Address maintenance item: external test w/ static mem
2018-12-17 13:52:33 -07:00
15b6c39929 Updates based on Jacobs Feedback 2018-12-17 09:42:15 -07:00
502e3c2b6d Address maintenance item: external test w/ static mem 2018-12-14 09:30:03 -07:00
249306f08c Merge pull request #1978 from ejohnstown/dot-release
touch version for interstitial release
2018-12-13 10:27:41 -08:00
c628562ee7 Fix the Old ClientHello detection with TLS 1.3 with new state
Put the clientState into CLIENT_HELLO_RETRY (new state) when waiting for
second ClientHello.
Chrome sends change_cipher_spec message, for reasons of compatability,
which meets the requirements of the Old ClientHello detection when state
of client is NULL.
2018-12-13 17:06:00 +10:00
f90e5601ad Fix TLS 1.2 and below ServerHello TLSX_Parse to pass in message type 2018-12-13 16:12:53 +10:00
3e326aba15 Merge pull request #1973 from SparkiDev/tls13_max_ticket_nonce_sz
Increase maximum ticket nonce size to 8
2018-12-12 15:00:57 -08:00
70cb4dcdb1 Merge pull request #1972 from SparkiDev/tls13_alpn
ALPN is returned in ServerHello even in TLS 1.3
2018-12-12 14:59:59 -08:00
fb68b3a450 Merge pull request #1970 from cconlon/yoctoinstall
Add Yocto Project / OpenEmbedded build instructions to INSTALL file
2018-12-12 14:53:44 -08:00
122114b840 Merge pull request #1969 from dgarske/atecc508a_fixes
Fixes for ATECC508A/ATECC608A and latest CryptoAuthLib
2018-12-12 14:53:12 -08:00
2ef8be2718 Merge pull request #1968 from dgarske/fixes_stm32cube_aes
Fixes for STM32 AES GCM crypto hardware acceleration
2018-12-12 14:52:35 -08:00
bdf447cec9 Merge pull request #1966 from cconlon/wctestbench
add define to use test/benchmark.h without path prefix
2018-12-12 14:50:32 -08:00
3f7ced3ed5 Merge pull request #1960 from SparkiDev/sp_rsavfy
Allow a very small build based on SHA-256 and RSA verify
2018-12-12 14:49:42 -08:00
f715d9179c Add check for buffer size versus pad size in DoCertificateStatus() 2018-12-12 12:48:30 -08:00
8772b5dc51 Merge pull request #1976 from embhorn/test_fix
Fix failing nightly tests
2018-12-12 12:07:01 -08:00
eef48cd8a2 touch version for interstitial release 2018-12-12 11:49:32 -08:00
cbc8f4ce38 Fix failing nightly tests 2018-12-12 09:48:34 -06:00
d8adca91b3 Increase maximum ticket nonce size to 8
There is a TLS 1.3 server implementation that uses 8 bytes.
2018-12-12 09:56:05 +10:00
c7b0aac47a Merge pull request #1964 from embhorn/codecov
Code coverage tests and fixes
2018-12-11 15:08:56 -08:00
195b995bc4 Fixes from review 2018-12-11 12:19:45 -06:00
dc104985c3 Fixes from review 2018-12-11 11:41:39 -06:00
59bfead3c8 Fixes from review 2018-12-11 11:30:13 -06:00
1c0fa6fb58 Code coverage tests and fixes - default config 2018-12-11 08:56:21 -06:00
c844b1c253 ALPN is returned in ServerHello when downgrading from TLS 1.3
TLS 1.3 Specification has extension returned in EncryptedExtensions.
2018-12-11 19:01:49 +10:00
a484749f4c Merge pull request #1965 from ejohnstown/vx-mg-updates
VxWorks/Mongoose Updates
2018-12-10 15:56:33 -08:00
06d6b06928 add Yocto Project / OpenEmbedded build instructions to INSTALL file 2018-12-10 16:48:14 -07:00
a936c609f3 Fixes for ATECC508A/608A CryptoAuthLib demo. 2018-12-10 11:40:37 -08:00
7e0e512a5c Minor build fixes for CryptoAuthLib with ATECC508A or ATECC608A. 2018-12-10 11:40:37 -08:00
6552455968 Minor improvements to the STM32 CubeMX AES-GCM logic. 2018-12-10 11:40:06 -08:00
c7ffdc8b0b VxWorks Update
1. Replace the WOLFSSL_PTHREADS option for VxWorks builds, but comment it out.
2. Added a comment about using the pthreads wrappers for mutexes in VxWorks.
2018-12-10 11:28:32 -08:00
dc82beea4e Mongoose Update
1. Add a couple more OpenSSL compatibility layer functions to the the HAVE_WEBSERVER option.
2018-12-10 11:28:32 -08:00
bc4150af2c Mongoose Update
1. HAVE_WEBSERVER option turns on a couple more functions that MG is
using for client side authentication.
2. If using webserver, those functions return and error.
2018-12-10 11:28:32 -08:00
70d345eda0 VxWorks Update
1. Remove pthreads enable from VxWorks build.
2. Add mutex wrappers for native VxWorks mutex semaphores.
2018-12-10 11:28:32 -08:00
2208514c98 Merge pull request #1962 from dgarske/fix_fe25519_noavx2
Fix for Intel Speedups with no AVX2 (part 2)
2018-12-10 17:17:42 +10:00
fb41510f12 Fixup for compiling verify only inline for PPC using GCC 2018-12-10 11:52:10 +10:00
c122f6082f Allow a very small build based on SHA-256 and RSA verify 2018-12-10 08:48:01 +10:00
e4f60dc894 Merge pull request #1967 from kojo1/ShadowGlobal
Shadowed global: min in misc.c
2018-12-08 09:20:56 -08:00
0a725f4d56 Fixes for AES with STM32 crypto hardware:
* Fixes to ensure the "const" input buffer is not modified for AES GCM calls with STM32 hardware crypto.
* Improvements to allow AES GCM hardware acceleration for inputs that are not a multiple of AES block size.
* Switched the wolfCrypt test for STM32_CRYPTO to use the standard AES GCM tests with 12-byte IV and less than 16-byte auth data.
* Fixes for building with the standard peripheral library.
* Fixes for building with `NO_AES_DECRYPT`.
`./configure --enable-debug --disable-shared --enable-cryptonly CFLAGS="-DNO_AES_DECRYPT"`
2018-12-07 17:23:38 -08:00
8f3b05dd33 Shadowed global: min in misc.c 2018-12-08 09:40:31 +09:00
43bc0233cb Merge pull request #1963 from SparkiDev/ct_signed
GCC ARM compiler requires explicit signed declaration
2018-12-07 16:32:09 -08:00
d662291b3d add define to use test/benchmark.h without path prefix 2018-12-07 10:27:51 -07:00
fe8080ce4a GCC ARM compiler requires explicit signed declaration 2018-12-07 15:01:18 +10:00
0259178033 Merge pull request #1961 from kaleb-himes/ZD4553-MAINTENANCE
Test adjustments for testing with nginx in FIPS mode
2018-12-07 09:29:47 +10:00
14c43959f0 Fixes for Curve25519 FE math build error with Intel Speedups enabled and no AVX2. These changes should have been part of PR #1958 and were missed. 2018-12-06 12:40:06 -08:00
7048efb5fa Test adjustments for testing with nginx in FIPS mode 2018-12-06 13:02:58 -07:00
6dfc723961 Merge pull request #1959 from SparkiDev/tls13_ems_down
Send EMS extension in ClientHello when downgradable from TLSv1.3
2018-12-06 07:42:55 -08:00
d6ebd2d832 Merge pull request #1950 from SparkiDev/rsa_unpad
Make RsaUnPad constant time when Block Type 2 message
2018-12-06 06:08:15 -08:00
f468e7f0b6 Merge pull request #1958 from dgarske/fix_fe25519_noavx2
Fix for Intel Speedups with no AVX2
2018-12-06 10:44:12 +10:00
1d5b99eecc Send EMS extension in ClientHello when downgradable from TLSv1.3 2018-12-06 09:41:22 +10:00
8aa54e5453 Merge pull request #1956 from cconlon/selftestfix
CAVP selftest fix for wc_RsaPSS_CheckPadding_ex() in test.c
2018-12-06 09:12:59 +10:00
ab03f9291b Make RsaUnPad constant time when Block Type 2 message 2018-12-06 08:36:49 +10:00
b145aab6b2 Server Side Renegotiation
1. Fix testing issue with a client using the SCSV cipher suite to indicate desire for renegotiation.
2. Add indication to both the server and client examples that the renegotiation was successful.
2018-12-05 13:08:24 -08:00
ec76ab7e42 Server Side Renegotiation
1. Add an extra guard check around a call to SendHelloRequest() in the case where server renegotiation is disabled.
2. Replaced an accidental deletion of an include of the misc.h header for no inline builds.
2018-12-05 13:08:24 -08:00
69436b6d41 Server Side Secure Renegotiation
1. Fix spelling typo in a comment.
2. Correct the server's check of its secure renegotiation extension.
2018-12-05 13:08:24 -08:00
0abf7c4997 Server Side Secure Renegotiation
1. Add the server side renegotiation flag to the secure renegotiation option.
2. Changed the AddEmptyNegotiationInfo so it doesn't create an extension, just adds a reply if SCR is enabled.
3. Fix the server's reaction to the client sending the SCR extension.
2018-12-05 13:08:24 -08:00
175c91ab4e Server Side Secure Renegotiation
1. Fix an incorrect function entry log string.
2. Restart the server's accept state assuming the client hello was
received when the client initiates renegotiation.
2018-12-05 13:08:24 -08:00
d168d60ade Server Side Secure Renegotiation
1. Add enables to the example server for turning on secure renegotiation.
2. Add encryption assists to the handhshake message handler functions.
3. Add a hello request message function. Includes handshake timing pre/postambles.
2018-12-05 13:08:24 -08:00
8355dd29cb Fix for Curve25519 FE math build error with Intel Speedups enabled and no AVX2. Fixes to allow forcing NO_AVX2_SUPPORT. Reproducible with ./configure --enable-curve25519 --enable-ed25519 --enable-intelasm CFLAGS="-DNO_AVX2_SUPPORT". 2018-12-05 13:04:30 -08:00
74eadf556e Merge pull request #1946 from ejohnstown/dh-speedup
DHE Speed Up
2018-12-05 12:22:21 -08:00
dfcfbc885d Merge pull request #1955 from JacobBarthelmeh/Testing
add mynewt_port.c to make dist
2018-12-05 10:39:02 -08:00
ac0f71f4c4 Merge pull request #1954 from JacobBarthelmeh/DH
remove restriction on max key size with wolfSSL_DH_generate_key
2018-12-05 10:38:31 -08:00
cc93c43a52 Merge pull request #1953 from dgarske/qat2
Fixes for building with the latest QuickAssist v1.7 driver
2018-12-05 10:37:45 -08:00
68e1091627 Merge pull request #1952 from cconlon/cmstestfix
Fix for PKCS7 unit test with AES disabled
2018-12-05 10:36:52 -08:00
ecdb27289c Merge pull request #1951 from ejohnstown/ios-bench-touchup
Touch Up iOS Project
2018-12-05 08:08:39 -08:00
f4831b9fbb add mynewt_port.c to make dist 2018-12-04 16:45:30 -07:00
188a15428d Touch Up iOS Project
1. Remove the file async.c from the iOS Benchmark project.
2. Update the organization name in the Benchmark project to "wolfSSL Inc".
3. In the workspace project, change the path to the wolfSSL test to be a local relative path rather than an absolute path.
4. In the workspace project, remove the benchmark project and re-add it. It becomes a local relative reference with the correct name.
2018-12-04 15:29:41 -08:00
d90e66da80 remove restriction on max key size with wolfSSL_DH_generate_key 2018-12-04 16:20:31 -07:00
60a424d4e9 CAVP selftest fix for wc_RsaPSS_CheckPadding_ex() in test.c 2018-12-04 15:19:08 -08:00
ec1bd3951e Fixes for building with the latest QuickAssist v1.7 driver:
* Updated `--with-intelqa=` to support detection of QAT driver version and use different .so libs.
* Added include and lib reference for new libusdm.
* Added `QAT_ENABLE_RNG` option.
* Fix for dynamic type spelling error (`DYNAMIC_TYPE_SYMETRIC_KEY` -> `DYNAMIC_TYPE_SYMMETRIC_KEY`).
* Fix benchmark output to use "took" not "tooks".
2018-12-04 12:54:11 -08:00
a47e08c49e DHE Speed Up
1. Add missing "-2" flags to the last line of most of the test conf files.
2018-12-04 12:04:12 -08:00
6254062438 Merge pull request #1948 from dgarske/fix_fips
Fix missing fips.h error
2018-12-04 11:32:37 -08:00
fa0b4cd2d5 DHE Speed Up
1. Modify all the test configuration files to disable the DHE prime test.
2. Add a test configuration that tests three cipher suites with the DHE prime test enabled.
2018-12-03 15:15:30 -08:00
a55f11cdd8 DHE Speed Up
1. Also apply the setting to the client side.
2. Updated the server and client command line options to use "-2" for disabling the DHE check.
2018-12-03 13:56:14 -08:00
4995051081 Merge pull request #1947 from miyazakh/fix_uninitialize_vars
Fixed uninitialized vars
2018-12-03 11:16:42 -08:00
9bda19fd25 fix for PKCS7 KEKRI array bounds check warning on gcc 8.2.0 2018-12-03 11:15:33 -08:00
28dc1cbb67 fix unit test for PKCS#7 with AES disabled 2018-12-03 12:00:04 -07:00
f74fb84337 Touch Up iOS Project
1. Fix iOS Benchmark reference to the async.c file.
2. Fix iOS Benchmark reference to the sp.c file. Changed to spr_c64.c.
3. Removed misc.c from iOS Benchmark as it is using inlined misc.h.
4. Added define of HAVE___UINT128_T to the user_settings.h so the
benchmark would build.
5. Wrapped the benchmark usage strings in NO_MAIN_DRIVER.
2018-12-03 10:38:56 -08:00
ea769bcf38 Fixed uninitialized vars 2018-12-01 10:13:00 +09:00
bdfa0e1745 Reapplying fix from PR #1423. Fixes issue #1415 (again). 2018-11-30 14:32:55 -08:00
564a1ee499 Make the skip DH test flag build-conditional. 2018-11-30 09:19:11 -08:00
34d8437a2e Merge pull request #1944 from ejohnstown/ios-touchup
Touch Up iOS Project for FIPS
2018-11-30 08:57:54 -08:00
ff1a1dc5d5 DHE Speed Up
When loading DH domain parameters into a CTX, test the prime
immediately. When loading them into a session, test the prime right
before using it during the handshake. Sessions that get their prime from
their context do not need to test their prime. Added a function to
disable testing the prime in a session. The goal is to speed up testing
as every single test case loads DH parameters whether they are used or
not.
2018-11-29 17:04:04 -08:00
a8e21d1c09 Changed tabs to spaces to be consistent with the project's convention 2018-11-29 23:29:18 +02:00
938e9ad7be Fixed some OpenSSL compatibility issues in wolfSSL_EVP_BytesToKey
Fixed wrong error checks, changed return value to the size of the derived key, added support for the case where data == NULL and removed the assignment of constant value to info->ivSz (the correct value is assigned to it inside 'wc_EncryptedInfoGet')
2018-11-29 23:19:23 +02:00
2c48553a29 Merge pull request #1936 from kojo1/multi-byte
NO_MULTIBYTE option
2018-11-29 13:16:10 -08:00
bea93e9159 Merge pull request #1943 from abrahamsonn/doxygen-update
Doxygen update
2018-11-29 13:06:21 -08:00
af0bb278a1 Touch Up iOS Project
1. Updated a config item regarding the order of searching headers to the current recommendation from Apple.
2. Added the define flag CYASSL_USER_SETTINGS to the FIPS project so the user settings are loaded into the FIPS files.
2018-11-29 12:46:39 -08:00
48252524dc Merge branch 'master' of https://github.com/wolfssl/wolfssl into doxygen-update 2018-11-29 10:16:33 -07:00
1b5ac2ea8d Updated an API's documented return codes
Added ASN_BEFORE_DATE_E and ASN_AFTER_DATE_E to
wolfSSL_CTX_load_verify_locations
2018-11-29 10:03:38 -07:00
bbea4aba59 IAR EWARM 2018-11-29 07:21:56 +09:00
a203cd4901 NO_MULTIBYTE to NO_MULTIBYTE_PRINT 2018-11-29 07:04:01 +09:00
95c6c0df28 Updated doxygen with some more API
Added new DH API function signatures/some descriptions
2018-11-28 15:03:01 -07:00
0e94ae529c Rollback stacing 2018-11-29 06:52:43 +09:00
a3d1ea20ff updated page list to include PKCS#11 page 2018-11-28 14:49:42 -07:00
8c0a55d43b Merge pull request #1939 from cconlon/selftestfix
exclude wolfSSL_EC_POINT_point2hex() in CAVP selftest build
2018-11-28 13:13:25 -08:00
424196cb03 Doxygen format updates
Updated the doxygen page list to include PKCS#11, and create the PKCS#11 page
2018-11-28 13:45:19 -07:00
c4919d191b Added doxygen comment page
The new doxygen comment page (pkcs11.h) lets Doxygen know when running that
there are new API and that they will need a page created.
2018-11-28 13:36:00 -07:00
74b8c2795b Merge branch 'master' of https://github.com/wolfssl/wolfssl into doxygen-update 2018-11-28 11:35:17 -07:00
70305758d4 Merge pull request #1942 from SparkiDev/asn_trad_fix
Return ToTraditional API to original signature
2018-11-28 08:08:26 -08:00
33db5babc9 Merge pull request #1940 from SparkiDev/pkcs11_cast
Fix for clang - cast down
2018-11-28 08:06:28 -08:00
2827ef6a57 Merge pull request #1938 from SparkiDev/tls13_ext
Check for TLS 1.3 version in the method for extenstions.
2018-11-28 08:05:42 -08:00
814e45a12b Merge pull request #1925 from kaleb-himes/ZD4486-XCODE
i386 arch lacks registers to support some tfm assembly without correct CFLAGS
2018-11-28 08:04:09 -08:00
310ffd0045 Check for TLS 1.3 version in the method for extenstions.
During parsing of ClientHello, ServerHello and HelloRetryRequest, the
SSL object version may not be set to the negotiated version.
2018-11-28 14:59:43 +10:00
918c769284 Return ToTraditional API to original signature 2018-11-28 12:27:57 +10:00
1a518c6c46 Fix for clang - cast down 2018-11-28 08:49:33 +10:00
6ed462f564 Provide example of appropriate CFLAGS for exposing registers on i386 required for inline assembly in tfm.c 2018-11-27 15:22:42 -07:00
11810160b4 Merge pull request #1937 from tmael/portingMicriumIII
Micrium uC/OS-III port (updated readme & user_settings)
2018-11-27 11:08:53 -08:00
a5e3b18252 exclude wolfSSL_EC_POINT_point2hex() in CAVP selftest build 2018-11-27 09:12:55 -08:00
216b2bf3fe rerun benchmark tests 2018-11-26 18:17:10 -08:00
3cee583f8d NO_MULTIBYTE option in RTE/wolfssl/user_settings.h 2018-11-27 07:26:19 +09:00
55bbffe3c6 Merge pull request #1932 from dgarske/maxfrag_reconf
Post-handshake max fragment size adjustment
2018-11-26 13:27:26 -08:00
3afa9a3886 Merge pull request #1929 from ejohnstown/sniffer
Sniffer Updates
2018-11-26 13:24:31 -08:00
4afa0f72fe Merge pull request #1926 from cconlon/cms2
CMS expansion, SignedData detached signature support
2018-11-26 13:22:26 -08:00
c529e011a7 NO_MULTIBYTE for multibyte non-supported IDEs 2018-11-26 08:11:31 +09:00
d51d8d86b5 update readme 2018-11-21 12:08:54 -08:00
96b4ddad82 Sniffer Update
1. Collect the SSL Info capture into its own function.
2. Add a Trace function for the SSL Info.
3. When copying the IANA name for the cipher suite, use a strncpy
instead of a memcpy and cap the copy at the length of the destination.
Force a null terminator at the end of the destination, just in case.
4. Modify the snifftest to collect the SSL Info.
2018-11-21 11:29:28 -08:00
7a24d4e46f Adds new WOLFSSL_ALLOW_MAX_FRAGMENT_ADJUST macro around non-standard feature. This allows for adjustment of the maximum fragment size post handshake. 2018-11-21 10:30:24 -08:00
4bf61a81e4 Merge pull request #1930 from tmael/portingMicriumIII
Micrium uC/OS-III port
2018-11-21 10:29:17 -08:00
f87c327fae Merge pull request #1933 from SparkiDev/tls13_ems
No Extended Master Secret in ServerHello if protocol TLSv1.3
2018-11-21 10:25:59 -08:00
f11809aa62 Merge pull request #1923 from JacobBarthelmeh/Testing
cast to resolve warning, check size of time_t, and check for null tes…
2018-11-21 10:17:23 -08:00
73dbd15b2b Merge pull request #1896 from SparkiDev/openssl_extra2
More OpenSSL API support
2018-11-21 10:16:37 -08:00
09141d479e store CMS detached variable when using streaming API 2018-11-21 10:12:36 -08:00
1244212d41 Merge pull request #1921 from miyazakh/Espressif_port_Phase1
Porting wolfssl into ESP-IDF development framework
2018-11-21 08:16:56 -08:00
101966329e add readme doc 2018-11-20 22:56:04 -08:00
da71d7243e adding new files for make dist 2018-11-20 18:40:25 -08:00
5156641f2b No Extended Master Secret in ServerHello if protocol TLSv1.3 2018-11-20 08:38:14 +10:00
95bd340de5 Add support for more OpenSSL APIs
Add support for PEM_read and PEM_write
Add OpenSSL PKCS#7 signed data support
Add OpenSSL PKCS#8 Private key APIs
Add X509_REQ OpenSSL APIs
2018-11-20 07:54:24 +10:00
e81436ffe9 Add support for altering the max-fragment size post-handshake using existing API wolfSSL_UseMaxFragment. 2018-11-19 13:26:48 -08:00
b05782a5c9 use static const 2018-11-19 09:13:09 -08:00
3a033cae8c Add standard GPLv2 header 2018-11-19 08:59:48 -08:00
7ac8acff09 fix IAR EWARM Error[Pe028]: expression must have a constant value 2018-11-19 00:19:58 -08:00
2ad6ce351b add micrium current_time and use correct serial function 2018-11-18 23:44:20 -08:00
061757c909 remove WOLFSSL_TYPES, add defines in user settings 2018-11-18 23:44:20 -08:00
11ccce809d fix formatting, converted tabs to spaces 2018-11-18 23:44:20 -08:00
ac8c4adc06 port to uC/OS-III
remove uC/OS-III eclipse project files

Adding wolfSSL client example for uC/TCP-IP with WinPcap running on Win7

Cleaned up user_settings and client example code

wolfSSL server example for uCOS-III/TCP-IP

Fixed typo and formating

Removed comments from user settings

serial (UART) interface isn't available on all targets

Updated to use PEM certs

add XSNPRINTF snprintf

define tx msg and size for clarity
2018-11-18 23:44:20 -08:00
bc09f4bd30 Porting wolfssl into ESP-IDF development framework 2018-11-17 09:36:09 +09:00
3599798aac Move a variable declaration to the start of a block instead of in the
middle.
2018-11-16 15:54:19 -08:00
6ee60bbb49 Sniffer Update
1. Adds a new function ssl_DecodePacketWithSessionInfo() that returns a
copy of the TLS session info (version and suite ID) for the packet that
is decoded.
2. Adds a new function DecodePacketInternal() that does the same work as
the old DecodePacket() with the additional Session Info behavior.
3. Both DecodePacket public functions call the internal version.
2018-11-16 15:00:06 -08:00
d2989d9f43 Sniffer Fix
Drop a handshake message if it is split across TLS records. The likely
messages dropped are certificate and certificate request, which are
ignored by the sniffer.
2018-11-16 15:00:06 -08:00
e756c5ffc9 use devId variable in test.c for PKCS7 examples 2018-11-16 15:54:32 -07:00
4295db218a add CMS SignedData support for detached signatures 2018-11-16 15:54:32 -07:00
7f76af0b36 Merge pull request #1927 from JacobBarthelmeh/AES
additional macro guards for disabling aescbc with opensslextra
2018-11-16 15:53:04 -07:00
ee30b2b476 better name for time_t size macro guard 2018-11-16 15:51:38 -07:00
ae1b1d777a compile out aescbc function declarations when off 2018-11-15 14:08:40 -07:00
c307fd7af4 additional macro guards for disabling aescbc with opensslextra 2018-11-15 13:40:04 -07:00
8399a7a517 i386 arch lacks registers to support some tfm assembly, detect and disable 2018-11-15 09:52:20 -07:00
c592a1d6cb Merge pull request #1924 from dgarske/fix_fipscheck
Fix to resolve issue with fips_check.sh
2018-11-14 09:05:20 -07:00
ed79aa1dc5 Fix to resolve issue with fips_check.sh after --depth=1 change in PR #1920. Fixes Jenkins report error: pathspec 'v3.6.0' did not match any file(s) known to git. 2018-11-13 06:30:05 -08:00
0f4a06594e cast to resolve warning, check size of time_t, and check for null test case 2018-11-12 16:02:33 -07:00
8689cc6a04 Merge pull request #1922 from SparkiDev/tls_pad_fix
Fix for checking of TLS padding when padding byte value > msg len
2018-11-12 13:20:35 -08:00
2503a4c0de Merge pull request #1920 from dgarske/check_speedup
Various script improvements for git clone calls
2018-11-12 13:17:14 -08:00
0452594cf7 Merge pull request #1905 from SparkiDev/sp_thumb
Single Precision: ARM Thumb assembly implementation
2018-11-12 13:16:11 -08:00
254b0f665b Merge pull request #1918 from dgarske/async_rel_v3.15.5
wolfSSL Async Release v3.15.5 Fixes
2018-11-12 11:22:55 -08:00
61c7be669b Fix for checking of TLS padding when padding byte value > msg len 2018-11-12 17:37:34 +10:00
533f4a5c77 Speedups for the git clone calls in check scripts to use --depth 1.
```
BEFORE CHANGE:

time ./fips-check.sh windows keep
Receiving objects: 100% (18408/18408), 12.61 MiB | 625.00 KiB/s, done.
Receiving objects: 100% (7045/7045), 110.48 MiB | 488.00 KiB/s, done.

real	5m4.604s
user	1m38.039s
sys	0m25.984s

AFTER CHANGE:
time ./fips-check.sh windows keep
Receiving objects: 100% (642/642), 1.02 MiB | 1.26 MiB/s, done.
Receiving objects: 100% (767/767), 24.15 MiB | 487.00 KiB/s, done.

real	1m43.194s
user	1m34.100s
sys	0m24.046s
```
2018-11-09 09:36:41 -08:00
ba8d1962c7 Fix for test case wc_AesInit with bad argument. Adds bad arg check for API in FIPS mode. 2018-11-09 09:26:01 -08:00
9f6167872f Fixes for additional use of unititlized variable with async for AES and DH. 2018-11-08 15:56:51 -08:00
b3d5999be9 Fix for unused variables with --disable-rsa --enable-tls13 case in InitSuites. 2018-11-08 15:54:06 -08:00
d5dddd2b29 Fix for unused useSupCurve in example client with --disable-ecc. 2018-11-08 15:43:18 -08:00
e9a10e3614 Scan-build fix for possible case where r and s aren't initalized for wc_ecc_verify_hash. 2018-11-08 15:40:06 -08:00
fcb40570e2 Fixes for warnings with possible use of uninitialized variable in async with DES3 and AES. 2018-11-08 15:39:52 -08:00
da76fb6861 Fixes for warning about possible uninitialized use of asyncDev for wc_Gmac and wc_GmacVerify. 2018-11-08 13:43:13 -08:00
39506e61d1 Merge pull request #1916 from JacobBarthelmeh/Release
Prepare for release v3.15.5
2018-11-08 12:59:05 -08:00
4a88626500 Merge pull request #1917 from SparkiDev/sp_def
Fix define to use letter S instead of 5
2018-11-08 10:39:52 -08:00
078db9e445 fix for nightly cavp test 2018-11-08 09:25:10 -07:00
cd37e3967c prepare for release 3.15.5 2018-11-07 16:08:29 -07:00
94c75aa3ed Fix define to use letter S instead of 5 2018-11-08 08:25:29 +10:00
2468a19c82 static analysis fix on non default build and g++ warning 2018-11-07 14:50:07 -07:00
6e4ab91ccf Merge pull request #1915 from JacobBarthelmeh/Testing
fix side init for set connect/accept functions
2018-11-07 09:24:44 -08:00
196791390b Merge pull request #1911 from kaleb-himes/CRYPT_LOGIC_UPDATES-R2
Fix pre-processor checks in wolfCrypt test for unique configuration
2018-11-07 10:22:03 -07:00
5a53048e8f Merge pull request #1914 from kaleb-himes/FIX_x_OPT_SERVER
Fix -x option in server to continue in event of error (R)
2018-11-07 10:11:27 -07:00
f7f6506a54 Merge pull request #1898 from cconlon/cmsupdates
wolfCrypt PKCS#7/CMS Expansion
2018-11-07 08:36:02 -08:00
24e2a2b228 Merge pull request #1912 from dgarske/fix_BN_bn2hex
Fixes for compatibility function `BN_bn2hex`
2018-11-07 08:35:15 -08:00
100bf76748 sanity check on length befor checking ASN.1 tag 2018-11-06 18:35:13 -08:00
27db083733 make degenerate test structure dynamic to set the uninitialized dynamic flag 2018-11-06 18:35:13 -08:00
820ee0439a handle degenerate case after rebase 2018-11-06 18:35:13 -08:00
9fa4f754ab fix PKCS7/CMS conditional build errors 2018-11-06 18:35:13 -08:00
a2b2ce124e add a check to help out static analysis tool 2018-11-06 18:35:13 -08:00
afbf09b970 fix for building with clang 2018-11-06 18:35:13 -08:00
773a81ef6a CMS fixes for building with NO_ASN_TIME 2018-11-06 18:35:13 -08:00
448f91b56d fixes after more fuzz testing 2018-11-06 18:35:13 -08:00
cc32466603 build fix for test.c when disabling CMS EncryptedData content type 2018-11-06 18:35:13 -08:00
9bef9bad8e PKCS7/CMS build fixes when disabling individual AES sizes 2018-11-06 18:35:13 -08:00
4d9375b862 PKCS7/CMS build fixes when disabling AES 2018-11-06 18:35:13 -08:00
004b0d3793 PKCS7/CMS build fixes when disabling RSA, ECC, or AES-GCM/CCM 2018-11-06 18:35:12 -08:00
867bcb4545 small stack memory management 2018-11-06 18:35:12 -08:00
77a1dafed0 fix for fall through with gcc-7 2018-11-06 18:35:12 -08:00
62a2847d75 make internal stream buffer dynamic
formating and build without stream api
2018-11-06 18:35:12 -08:00
048a7f4c57 fix for memory leak after resetting stream state 2018-11-06 18:35:12 -08:00
5a59fdd6fd scan-build warnings 2018-11-06 18:35:12 -08:00
b3506c836c remove content type restriction and fix build with compkey 2018-11-06 18:35:12 -08:00
98efc1e9de testing with verify signed stream function 2018-11-06 18:35:12 -08:00
752259e343 first addition of decode enveloped stream 2018-11-06 18:35:12 -08:00
5525f59852 first addition of verify sign stream data 2018-11-06 18:35:12 -08:00
47303ed445 fix decryption of EnvelopedData PWRI KEK size 2018-11-06 18:35:12 -08:00
b4d02d6d99 fix setting and checking CMS EnvelopedData version 2018-11-06 18:35:12 -08:00
b0e4cb3572 valgrind testing 2018-11-06 18:35:12 -08:00
5d8f59d83b initial AuthEnvelopedData stream and add debug messages 2018-11-06 18:35:12 -08:00
d69a3c1092 add single-shot API for generating CMS Signed Encrypted Compressed FirmwarePkgData 2018-11-06 18:35:12 -08:00
c9f75fe7b4 add test cases for CMS Signed-Encrypted and Signed-Compressed FirmwarePkgData to test.c 2018-11-06 18:35:12 -08:00
175e32b468 add single-shot API for generating CMS Signed Compressed FirmwarePkgData 2018-11-06 18:35:12 -08:00
ed7cd54a91 add single-shot API for generating CMS Signed Encrypted FirmwarePkgData 2018-11-06 18:35:12 -08:00
cc05c46318 add single-shot API for generating CMS Signed FirmwarePkgData 2018-11-06 18:35:12 -08:00
2cc89936e3 add semicolon after FALL_THROUGH 2018-11-06 18:35:12 -08:00
02df920269 use fall through and update api tests to use wc_PKCS7_New 2018-11-06 18:35:12 -08:00
83a150c4df stream of PKCS7 decode encrypted 2018-11-06 18:35:12 -08:00
40ef246b1f add CMS AuthEnvelopedData support for unauthAttrs 2018-11-06 18:35:12 -08:00
4315384051 update test.c error returns for PKCS7 2018-11-06 18:35:12 -08:00
06a6f8400b add CMS AuthEnvelopedData support for authAttrs 2018-11-06 18:35:12 -08:00
bc94cdc11b add CMS AuthEnvelopedData content type support 2018-11-06 18:35:12 -08:00
a4da14f4b0 allow CMS CompressedData to be disabled with NO_PKCS7_COMPRESSED_DATA 2018-11-06 18:35:12 -08:00
75349bbba5 add support for SubjectKeyIdentifier to KTRI CMS RecipientInfo types 2018-11-06 18:35:12 -08:00
794137c20c add CMS EnvelopedData OtherRecipientInfo support 2018-11-06 18:35:12 -08:00
85e0c203ea ignore pkcs7 test files 2018-11-06 18:35:12 -08:00
0b3930e24f save and set PKCS7 isDynamic flag in wc_PKCS7_Init 2018-11-06 18:35:12 -08:00
13b30a6a21 add CMS EnvelopedData PasswordRecipientInfo support 2018-11-06 18:35:12 -08:00
dbb5bb7570 add CMS EnvelopedData KEKRecipientInfo support 2018-11-06 18:35:12 -08:00
ec07fe492e misc CMS fixes from review and valgrind 2018-11-06 18:35:11 -08:00
1f8c4c2613 merge CMS changes with master 2018-11-06 18:35:11 -08:00
7841434744 add support for multiple certificates in CMS SignedData certificates field 2018-11-06 18:35:11 -08:00
897c6b455f move CMS signed attribute OIDs into BuildSignedAttributes() 2018-11-06 18:35:11 -08:00
a25a637270 add CMS signingTime attribute support for SignedData 2018-11-06 18:35:11 -08:00
56f1b68442 use SetContentType() to set SignedData content type 2018-11-06 18:35:11 -08:00
ce1381dc9a add contentType check to CMS compressed tests 2018-11-06 18:35:11 -08:00
6a06a3b63b add CMS CompressedData test using FirmwarePkgData 2018-11-06 18:35:11 -08:00
c51cf4472e add support for CMS CompressedData content type 2018-11-06 18:35:11 -08:00
32b70dd56c add support for FirmwarePkgData in CMS SignedData EncapsulatedContentInfo 2018-11-06 18:35:11 -08:00
2a60fbd766 add support for SubjectKeyIdentifier in CMS SignedData SignerInfo 2018-11-06 18:35:11 -08:00
70ca95b357 add support for custom contentType with CMS SignedData type 2018-11-06 18:35:11 -08:00
bdf07e64cf Merge pull request #1901 from dgarske/rsa_nonblock
Added RSA non-blocking support
2018-11-06 16:39:43 -08:00
5d8f4351ff Merge pull request #1903 from dgarske/dhkeycheck
Speed improvements for DH public key prime checking
2018-11-06 16:35:27 -08:00
7a2a66743b fix side init for set connect/accept functions 2018-11-06 16:48:06 -07:00
bc2bb78010 Fix -x option in server to continue in event of error (R) 2018-11-06 14:09:46 -07:00
144ff68cfb Merge pull request #1882 from SparkiDev/pkcs11_lib
Improvements for PKCS#11 library
2018-11-06 08:53:57 -08:00
2c7ff56a3e Merge pull request #1907 from JacobBarthelmeh/Testing
infer and g++ build fixes
2018-11-06 08:48:28 -08:00
95092696bf Fix to make sure mp_toradix and mp_radix_size are included for OPENSSL_EXTRA. 2018-11-06 08:38:47 -08:00
efb1efcc0d Fixes and additional tests for compatibility function BN_bn2hex. In the DEBUG_WOLFSSL case it was returning a (char*)"", which was trying to be free'd. We cannot return const char* here, since its assumed to be an allocated pointer. Fix the dynamic type for XMALLOC/XFREE to match, since OPENSSL_free is used to free returned value. Fix to add room for null term. Added missing API unit test for BN_print_fp. Exposed these functions for OPENSSL_EXTRA. 2018-11-06 05:55:25 -08:00
1a4533f166 Merge pull request #1910 from embhorn/zd4324
Handle incomplete shutdown
2018-11-06 05:19:58 -08:00
ee00852509 Merge pull request #1909 from ejohnstown/filedist
Added the resource.h and wolfssl.rc to the list of EXTRA_DIST files.
2018-11-05 14:40:04 -07:00
d61ae3a02a Handle incomplete shutdown 2018-11-05 10:30:48 -06:00
92d6dc36af Fix pre-processor checks in wolfCrypt test for unique configuration 2018-11-02 15:22:11 -06:00
c1ca1f1b78 Remove DH prime check on selftest/fips builds. 2018-11-02 12:55:07 -07:00
6372c3d6e1 * Added RSA non-blocking support enabled with WC_RSA_NONBLOCK. Adds new wc_RsaSetNonBlock function for enabling / non-block context. Added wolfCrypt test function rsa_nb_test to validate. Result is: RSA non-block sign: 8200 times and RSA non-block verify: 264 times
* Signature wrapper improvements to eliminate mallocs/frees unless small stack is used. If small stack is used only one allocation is done based on actual max (was previously was allocating too much and in the encoding case was reallocating a second buffer).
2018-11-02 12:41:23 -07:00
98291f8465 Update comment in dh.c. 2018-11-02 11:38:52 -07:00
1261247e2a Added the resource.h and wolfssl.rc to the list of EXTRA_DIST files. 2018-11-02 11:30:29 -07:00
cfafbd9659 Added the prime check to the functions wolfSSL_SetTmpDh() and wolfSSL_CTX_SetTmpDh(). 2018-11-02 11:01:39 -07:00
1ffc1108a6 Merge pull request #1906 from cconlon/selftest-fixes
fixes for CAVP selftest build errors
2018-11-01 11:31:39 -06:00
a953a3141e infer and g++ build fixes 2018-11-01 09:59:35 -06:00
81650d6cef Fix for subtract
Added cortex-m support using umull for faster implementation.
2018-11-01 15:21:51 +10:00
2b3b19d1c8 Merge pull request #1904 from JacobBarthelmeh/PKCS7
add test for degenerate case and allow degenerate case by default
2018-11-01 08:36:15 +10:00
6dd4fba888 fix for clang warning 2018-10-30 17:41:03 -06:00
cc3ccbaf0c add test for degenerate case and allow degenerate case by default 2018-10-30 17:04:33 -06:00
f6093e1e0d Fixes to remove DH prime checks for server side DH parameters. 2018-10-30 15:51:47 -07:00
def7a91e70 fix CAVP selftest build errors 2018-10-30 16:35:45 -06:00
f4b0261ca7 Fix to not do prime test on DH key the server loaded. Now it will only do the prime test on the peer's provided public DH key using 8 miller rabbins. Refactored the fast math miller rabin function to reuse mp_int's, which improved peformance for mp_prime_is_prime_ex from 100ms to 80ms. Normal math mp_prime_is_prime_ex is ~40ms (as-is). Added test for wc_DhSetCheckKey. 2018-10-30 11:20:07 -07:00
2c0edae96f Merge pull request #1889 from kojo1/t4_demo
Renesas RX demo
2018-10-30 10:14:02 -06:00
ab458db504 Review comment changes
Add heap as a device initialization parameter.
Allocate slot info pointer wiht device heap pointer.
ForceZero user pin on token finalization.
Add comments to structure definitions.
2018-10-30 15:56:31 +10:00
b64c527138 added files under t4_demo to include.am 2018-10-30 13:18:58 +09:00
ba90674357 Merge pull request #1897 from WolfWalter/fix_sigrs_length
ATECC508 reference PK callback fix for signature length
2018-10-29 08:54:46 -07:00
ae07ba93ad Merge pull request #1894 from dgarske/pk_keysize
Fixes for key size detection when using PK callbacks
2018-10-26 09:46:10 -07:00
d18c9cad61 Merge pull request #1895 from dgarske/test_384bit
Added ECC P-384 bit test certs and keys
2018-10-26 09:44:41 -07:00
a6adfd434d Merge pull request #1893 from dgarske/ecdsa_hashalgo
New build option to match ECDSA hash algo digest size with ephemeral key size
2018-10-26 09:43:07 -07:00
a47eeec145 fixed sigRs length
atmel_ecc_sign and atmel_ecc_verify expect sigRS length to be 64 Byte (32 Byte each).
2018-10-26 16:43:03 +02:00
153c7cc684 Fix for unused variable in new fast-rsa function wc_RsaPublicKeyDecode_ex. 2018-10-25 11:12:33 -07:00
3be7eacea9 Added client/server certs and keys for P-384-bit signed by P-384 CA. Fix for broken certs/ecc/genecc.sh script. Added simple P-384 cipher suite test. 2018-10-25 09:21:27 -07:00
d21603334b Added build option USE_ECDSA_KEYSZ_HASH_ALGO to alter the hash algorithm selection for ecc_dsa_sa_algo. With this build option we try and choose a hash algorithm digest size that matches the ephemeral key size, if not found then will match on next highest. We've seen cases with some Windows based TLS client's where they do not properly support hashing a smaller ephemeral key with a larger hash digest size (such as P-256 key and SHA512 hash). 2018-10-25 09:19:35 -07:00
81651c351b Added optional logging for example PK callbacks in test.h enabled with DEBUG_PK_CB. 2018-10-25 09:15:34 -07:00
86758f9640 Fixes for key size detection when using PK callbacks (HSM) and no private key has been loaded (affects HAVE_PK_CALLBACKS on server side only when no dummy private key is loaded). Fix for possible leak during ECC min key size failure with small stack. Added new API wc_RsaPublicKeyDecode_ex for parsing an RSA public key for the modulus and exponent. Changed wolfSSL_CTX_SetTmpEC_DHE_Sz to support a size == 0 for using the long-term private key's size. Changed ECDHE_SIZE so it can be overridden and build-time. Added tests for wolfSSL_CTX_SetTmpEC_DHE_Sz and wolfSSL_SetTmpEC_DHE_Sz. 2018-10-25 09:15:23 -07:00
23445546c5 Merge pull request #1892 from dgarske/ecdhe_keysize
Fix for ephemeral key size selection
2018-10-25 07:27:20 -07:00
c4d6f886b7 Revert change from PR #1845 commit 24f9f12844. This ensure the ephemeral key is P-256 or the overridden value determined by wolfSSL_CTX_SetTmpEC_DHE_Sz and wolfSSL_SetTmpEC_DHE_Sz. This restores previous behavior from last release. 2018-10-24 09:48:03 -07:00
0eb115e7a1 Merge pull request #1884 from kaleb-himes/ECC_DISABLED_TEST_FIX
Fixes to resolve skipped tests with ECC disabled
2018-10-24 09:30:47 -07:00
7586e1df42 Only do early data in initial handshake when using PSK 2018-10-24 09:47:30 +10:00
c173d72423 Merge pull request #1891 from SparkiDev/nginx-1.15.5
Add defines for latest nginx
2018-10-23 08:07:52 -07:00
ef8b564d2e Add defines for latest nginx 2018-10-23 22:08:44 +10:00
22aa01a547 Merge pull request #1881 from SparkiDev/pkcs7_no_si
Return error when attempting to verify signed data without signers
2018-10-22 15:00:55 -07:00
878b5925fc Merge pull request #1877 from dgarske/pkcs8_ec
Added support for ECC private key with PKCS8 encoding
2018-10-22 14:59:10 -07:00
42fecee77b Merge pull request #1859 from SparkiDev/pkcs7-cons
Support constructed OCTET_STRING in PKCS#7 signed data
2018-10-22 14:52:50 -07:00
353f9018f5 Merge pull request #1890 from miyazakh/jamsg
Added Japanese message into the examples client and server
2018-10-22 13:44:11 -06:00
0b720c4412 Fixes for TLSv1.3 early data. 2018-10-22 11:35:40 -07:00
96abf43238 Merge pull request #1888 from MJSPollard/nidFIX
Fixed compilation issues with Asio, Websocket++, and HAProxy
2018-10-22 10:19:05 -06:00
6953677a8f Keep the max line length to 80 2018-10-20 17:15:17 +09:00
a27b4c2efb Added Japanese message into the examples client and server 2018-10-20 13:40:01 +09:00
7ce236f3af Fix for new test_wolfSSL_PKCS8 changes to init/free the ecc_key. 2018-10-19 16:04:02 -07:00
dabeccca27 README_en 2018-10-20 07:59:22 +09:00
f2ef67446d T4 demo 2018-10-20 07:21:52 +09:00
c268829b68 Fix bug with SendClientKeyExchange and ifdef logic for ecdhe_psk_kea, which was preventing ECDHE-PSK from working if HAVE_CURVE25519 was defined. Disabled broken downgrade test in test-tls13-down.conf (@SpariDev will need to investigate). Various spelling fixes. 2018-10-19 13:21:56 -07:00
fac6ce794d Fix HAProxy redefinition warning 2018-10-19 12:14:57 -06:00
355184bc9b added fix for failing asio and haproxy tests 2018-10-18 17:32:42 -06:00
4a4ae446aa Fix for unit.test fails with -H verifyFail. 2018-10-18 11:58:00 -07:00
84fb23cfab Merge pull request #1880 from kojo1/NID
NID definitions are in asn.h
2018-10-18 09:48:20 -07:00
7551e49fed Improvements for PKCS#11 library 2018-10-18 17:31:17 +10:00
67bb558025 Return error when attempting to verify signed data without signers 2018-10-18 13:44:13 +10:00
8a872891c5 NID_domainComponent is moved to asn.h 2018-10-18 09:28:15 +09:00
cdd8f6b950 Macro guard on cipher suite added - Thanks Jacob\! 2018-10-17 16:44:47 -06:00
dc519e6a45 When no cert specified using default, do not return failure in suite tests 2018-10-17 15:20:39 -06:00
095337b1cf Merge pull request #1878 from kaleb-himes/TEST_COVERAGE_3
Test coverage 3
2018-10-17 13:47:10 -07:00
dcb105deff Merge pull request #1876 from dgarske/max_frag_256
Added new 256-byte max fragment option `WOLFSSL_MFL_2_8`
2018-10-17 13:21:57 -07:00
8b529d3d57 Add test for ECC private key with PKCS 8 encoding (no crypt) and -----BEGIN EC PRIVATE KEY----- header. 2018-10-17 10:01:29 -07:00
5ca822b1e9 Peer review changes requested 2018-10-17 10:46:45 -06:00
7391f4db90 Merge pull request #1815 from dgarske/atecc508_fixes
Fixes for ATECC508A
2018-10-17 08:35:09 -07:00
969098518f Merge pull request #1873 from dgarske/fix_async_multi_rec
Fixes and improvements for wolfSSL asynchronous mode
2018-10-17 08:23:27 -07:00
2aa6f91144 Reset IV after update via call to encrypt 2018-10-16 18:31:16 -06:00
0d7d8f54e0 Added support for ECC private key with PKCS8 parsing. Fix is to attempt pkcs8 parse for -----BEGIN EC PRIVATE KEY----- and if parse fails to treat as normal private key. ZD 4379. 2018-10-16 16:56:42 -07:00
d7d102d90a Added cipher suite unit tests for max fragment options 1-6 for TLS v1.2 and DTLS v1.2. Fix for client usage comment for max fragment. 2018-10-16 16:47:24 -07:00
ab61cefa58 Fix max frag error case tests to use min/max. 2018-10-16 08:58:46 -07:00
4adaeb8585 Added new 256-byte max fragment option WOLFSSL_MFL_2_8. 2018-10-15 17:06:21 -07:00
e53694b351 Fix for shared secret callback for client side, where it was not using the provided peer's public key. Fix for ATECC508A to put it into idle mode after operations to prevent watchdog fault mode (can be disabled by defining WOLFSSL_ATECC508A_NOIDLE). Fixes for callbacks to support using software for non P-256 curves (can be disabled by defining WOLFSSL_ATECC508A_NOSOFTECC). 2018-10-15 16:01:04 -07:00
bd57f5b385 Fix to resolve possible buffer overflow with atmel_get_rev_info when using byte. 2018-10-15 14:17:43 -07:00
177bf49fa6 Updates to the atmel.c code to allow easier customization of the hardware interface. 2018-10-15 14:17:43 -07:00
bb737ec99d Fixes for building against latest CryptoAuthLib. Refactor to eliminate the atcatls function calls, since these have been removed from latest CryptoAuthLib. Cleanup of the slot assignment handling. 2018-10-15 14:17:43 -07:00
d67cb9e875 Added new build option for Microchip CryptoAuthLib (--enable-cryptoauthlib). Build fixes with WOLFSSL_ATECC508A enabled. 2018-10-15 14:17:43 -07:00
ba9f21bad6 Improvements to the ATECC508A README.md. 2018-10-15 14:17:42 -07:00
c51c607e96 Fix to use inLen for raw public key copy. No need to throw an error for other curve types as this function may be used for software only import/export. In the TLS case with only SECP256R1 there are other places where an error will be thrown. 2018-10-15 14:17:42 -07:00
53c2264327 Fix for checking the inLen when setting raw public key len for hardware. Finished the ATECC508A ECC functions to support native TLS with the WOLFSSL_ATECC508A option and SECP256R1. Added slot type for alloc/free. Added helper functions for setting the PK callbacks and custom content. Updated the README.md with build options. Added support for overriding the ATECC_MAX_SLOT. Added overridable define for encryption slot number ATECC_SLOT_I2C_ENC. Added new build option WOLFSSL_ATECC_PKCB for using just the reference PK callbacks. 2018-10-15 14:17:42 -07:00
7074625048 Added slot callbacks. Improvements for the Atmel time support. Fix to make sure read encryption key is cleared from stack buffer. 2018-10-15 14:17:42 -07:00
e78ddfce75 Fix for wc_ecc_import_x963_ex to handle ATECC508A raw public key. Cleanup of the ATECC508A encryption key support. Added new macro ATCA_TLS_GET_ENC_KEY to allow setting your own function at build-time for getting the encryption key. 2018-10-15 14:17:42 -07:00
be318abbc2 Fixes for building with WOLFSSL_ATECC508A with latest atca. 2018-10-15 14:17:42 -07:00
7c3313481a Fix for memory cleanup cases in MakeTlsMasterSecret. 2018-10-15 13:22:55 -07:00
f7eb8bf080 Merge pull request #1874 from JacobBarthelmeh/HardwareAcc
fix for afalg header install and macro set
2018-10-15 11:51:10 -07:00
23ef832dd3 fix for afalg header install and macro set 2018-10-12 15:45:46 -06:00
a0608151cf Fix for the WOLFSSL_NONBLOCK_OCSP case to reset the error code as well. 2018-10-12 11:20:13 -07:00
5904a97378 Added comments in aes.c for locating software implementation of algorithm using Software AES. 2018-10-12 10:48:26 -07:00
23a0f3cfa1 Added new WOLFSSL_SSLKEYLOGFILE define to output master secret used by Wireshark logging to file. Defaults to sslkeylog.log, but can be overridden using WOLFSSL_SSLKEYLOGFILE_OUTPUT. 2018-10-12 10:47:30 -07:00
52210c9d16 Improved error trapping in BuildTlsHandshakeHash, without altering timing. 2018-10-12 10:45:47 -07:00
fc77ed068c Fix for verify callback to not report override when there is no error. Cleanup of the myVerify example callback return code handling. 2018-10-12 10:45:20 -07:00
6fbeae8f11 Fixes for building with WC_ASYNC_NO_SHA256. Improvements with WC_ASYNC_NO_HASH or WC_ASYNC_ENABLE_ECC to avoid unnecessary memory allocations. 2018-10-12 10:44:26 -07:00
fec726f10a Fix for async issue with receiving multiple TLS records (server_key_exchange and server_hello_done) in same packet, which may miss call to DoHandShakeMsgType -> HashInput because ssl->error is still marked pending WC_PENDING_E. 2018-10-12 10:39:40 -07:00
45eb3ae72d Merge pull request #1871 from miyazakh/work
Added Japanese messages that can be enabled by option switch
2018-10-12 10:54:59 -06:00
0b78b75530 Merge pull request #1860 from dgarske/tls_either_side
Methods cleanup and new DTLS "either" side methods
2018-10-12 07:35:17 -07:00
1a34b9da03 Added NO_RSA condition for build failure 2018-10-12 11:02:01 +09:00
19905b7798 Merge pull request #1872 from ejohnstown/ext-skip
Skip Server Supported Curve Extension
2018-10-11 17:47:08 -07:00
1fd791da21 Fix to check response code on InitSSL_Side calls. 2018-10-11 15:50:22 -07:00
b404d4805f Skip Server Supported Curve Extension
Added a build option, WOLFSSL_ALLOW_SERVER_SC_EXT, that skips the
client's parsing of the supported curve extension if sent by the
server for sessions using < TLSv1.3. The server doesn't need to send it
and the RFCs don't specify what should happen if it does in TLSv1.2, but
it is sent in response from one particular Java based TLS server.
2018-10-11 15:21:32 -07:00
63878f32ab Fixed tests failures on jenkins 2018-10-11 21:43:39 +09:00
b736012214 Fixed disable Option Test on jenkins 2018-10-11 19:40:35 +09:00
e774bfcf60 Tweaked message in Usage 2018-10-11 18:06:02 +09:00
b4b180c1b9 Added Japanese messages that are enabled by option switch 2018-10-11 15:42:50 +09:00
9a0ecd4eb6 Merge pull request #1870 from tmael/AddressingCodeCoverage
Addressing code coverage
2018-10-10 14:46:32 -07:00
f9ff151ee7 wolfSSL_AES_cbc_encrypt unit test refactor, TODO: Decrypt 2018-10-10 16:16:57 -04:00
23797ab4cb wolfSSL_AES_cbc_encrypt unit tests, TODO: Decrypt 2018-10-10 15:59:10 -04:00
5d047cc4d9 Added test_wc_curve25519_size to increase code coverage 2018-10-10 12:46:25 -07:00
8f1ad656c2 Improving code coverage 2018-10-09 16:13:26 -07:00
0293686990 Added example client/server support for loading certificate and private key into WOLFSSL object using -H loadSSL. Added load_ssl_buffer function to load buffers into WOLFSSL objects. Changed wolfSSL_get_SSL_CTX API to always be exposed. Added TEST_LOAD_BUFFER build option to use the load_buffer and load_ssl_buffer calls for example client/server. 2018-10-09 12:54:41 -07:00
7a3a314ece Merge pull request #1868 from kaleb-himes/TEST_COVERAGE_2
Test coverage 2
2018-10-09 11:16:31 -07:00
355048230f Merge pull request #1866 from dgarske/openssl_leak_fix
Fix leaks in compatibility functions `wolfSSL_X509_print` and `wolfSSL_i2d_RSAPublicKey`
2018-10-08 09:38:26 -07:00
7a02832547 Merge pull request #1849 from dgarske/asn_piv
Added ASN certificate PIV and GZIP support
2018-10-08 09:32:19 -07:00
c6e3e34ff7 Remove unused macro 2018-10-08 09:35:37 -06:00
1ed50a40e7 Fix for wolfSSL_i2d_RSAPublicKey leak. 2018-10-05 14:09:12 -07:00
66420db07c Initializing coverage for CRL APIs 2018-10-05 15:05:03 -06:00
93c85caec4 Merge pull request #1867 from miyazakh/work
fixed typo
2018-10-05 16:26:00 +09:00
67cab29d81 fixed typo 2018-10-04 21:02:22 -07:00
cec61ac3c9 Fix for leak in wolfSSL_X509_print, where the RsaKey is not free'd. Cleanup of formatting. 2018-10-04 16:51:51 -07:00
1d7c4f96fa Fix windows build warning with side data type mismatch. 2018-10-04 16:10:50 -07:00
319096e7e7 Fix indent for error case. 2018-10-04 16:07:35 -07:00
bbdb17975c Adds build option WOLFSSL_EITHER_SIDE for deferring the "side" of the TLS session until first connect or accept. Added the DTLS generic v1.0 and v1.2 methods for "either" side. Added "either" methods unit tests. Added "either" -v e support to example client/server. Fix to expose wolfSSL_use_certificate_file and wolfSSL_use_PrivateKey_file without OPENSSL_EXTRA. Cleanup of the methods for (void)heap and log messages. Spelling fixes. 2018-10-04 15:47:50 -07:00
846ae06ae9 Merge pull request #1863 from tmael/mingw32Fix
Fixed MINGW32 build errors
2018-10-04 09:15:01 -07:00
0ec9b28402 Added GZIP compression tests. Added new wc_Compress_ex API to support GZIP compression option. 2018-10-03 16:29:45 -07:00
08654ce71d Start hitting up the stubs, more to come 2018-10-03 17:01:12 -06:00
f83ea9a9d5 Fixed MINGW32 build errors 2018-10-03 13:58:51 -07:00
d473fd38ab Merge pull request #1861 from dgarske/coding_cleanup
Cleanup of the base64/base16 start hex values
2018-10-03 09:36:49 -07:00
c619bfebda Add test for NIST PIV case. 2018-10-02 17:08:27 -07:00
f0350c1efb Refactor of the wc_ParseCertPIV to support detection of Identiv format header. Added flag to indicate Identiv type. Added wolfCrypt test for wc_ParseCertPIV function with Identiv PIV template. 2018-10-02 17:01:56 -07:00
0c72dee315 Fixes for building with ./configure --enable-asn=nocrypt. Added wolfCrypt test template for certpiv_test, pending test PIV certs to use. 2018-10-02 15:18:57 -07:00
680a863054 Added support for building with certificate parsing only. ./configure --enable-asn=nocrypt. Added new API for parsing PIV format certificates wc_ParseCertPIV with WOLFSSL_CERT_PIV build option. Added wc_DeCompress_ex with ability to decompress GZIP. Moved the ZLIB error codes into wolfCrypt. 2018-10-02 15:18:56 -07:00
0829af7a05 Support constructed OCTET_STRING in PKCS#7 signed data 2018-10-03 07:51:37 +10:00
cfba86d3ab Further cleanup of the Base64 and Base16 encoding start/min value. 2018-10-02 14:38:08 -07:00
be2f68d183 Cleanup of the base64 decode start hex 0x2b. 2018-10-02 08:33:45 -07:00
4ca7460735 Merge pull request #1856 from ejohnstown/version-indication
Windows DLL Version Resource
2018-10-01 12:51:38 -07:00
142111da3b Merge pull request #1857 from kaleb-himes/MORE_TEST_COVERAGE
Add more coverage cases to unit tests
2018-10-01 12:19:12 -07:00
8f36a78a71 Exclude the version resource from the static library builds. It triggers a linker warning for Win32 builds and it isn't used in the static builds. 2018-10-01 10:37:45 -07:00
1f643800a6 Add more coverage cases to unit tests 2018-09-28 15:32:16 -06:00
05ca60a266 Add a version resource to the wolfSSL library for Visual Studio builds. 2018-09-28 11:46:22 -07:00
13bf2fc342 Merge pull request #1854 from dgarske/fix_ecdsa_sig_leak
Fix for leak with openssl compatibility API and normal math
2018-09-28 09:26:26 -06:00
f19f803098 Fix for possible leak with openssl comatibility API wolfSSL_d2i_ECDSA_SIG when fast math is disabled. 2018-09-27 11:39:30 -07:00
6d18f58f81 Merge pull request #1848 from JacobBarthelmeh/Benchmark
changes to benchmark app
2018-09-26 15:10:20 -07:00
d30c45a79c Merge pull request #1637 from ghoso/openssl_compat201805
OpenSSL Compatibility APIs 2018/06
2018-09-26 14:54:14 -06:00
5cd428eaa8 Merge pull request #1853 from dgarske/mp_add_d
Fixes for missing `mp_add_d`
2018-09-26 13:50:14 -06:00
fc81467715 Merge pull request #1851 from dgarske/lighttpd_fix
Lighttpd fixes
2018-09-26 13:24:16 -06:00
d0abc10fe9 update RSA keygen benchmark and test with asynccrypt 2018-09-26 13:10:05 -06:00
8ccd715f31 Merge branch 'master' into openssl_compat201805 2018-09-26 11:06:26 -06:00
441c0492f6 Fixes for missing mp_add_d. Fix for IDE/GCC-ARM user_settings.h to remove redudant USE_FAST_MATH option. 2018-09-26 08:34:08 -07:00
6e629a51f8 Added test case for scenario where error is pushed, cleared then try to get current. Without fix to clear wc_current_node in wc_ClearErrorNodes this causes access to invalid/free'd memory. 2018-09-26 08:16:58 -07:00
3c828c0547 Merge pull request #1850 from ejohnstown/const
DecodedCert der to const
2018-09-26 07:52:19 -07:00
1bf7cad633 Fix for case where wc_ClearErrorNodes is called, but then wc_PullErrorNode is called and wc_current_node is populated with invalid ->next pointer. 2018-09-25 16:13:13 -07:00
d7249068db Fix for Lighttpd 1.4.49, which requires HAVE_EX_DATA. 2018-09-25 15:14:57 -07:00
18a27cfe75 Changed the DecodedCert's der pointer to be a pointer to const. The
DecodedCert doesn't own the der value, so it should be const. Had to
make many other changes downstream of this.
2018-09-25 12:55:52 -07:00
52b5fe569b restore PR#1819 to pass Jenkins tests. 2018-09-25 18:04:27 +09:00
ff5506faf2 define wolfSSL_OPENSSL_add_all_alogrithms_noconf alias for wolfSSL_OpenSSL_add_all_algorithms_noconf and some fixes 2018-09-25 15:39:56 +09:00
71863c462e (void) for unused in NO_RSA case 2018-09-25 15:39:56 +09:00
dc06bb075d moving and consoridating NID defines to enum in asn.h 2018-09-25 15:39:56 +09:00
01654dac1a minor fix 2018-09-25 15:39:56 +09:00
cfa99c567b merge PR #1820 Porting aid 2018-09-25 15:39:56 +09:00
ca9f62713d fix test_wolfSSL_CTX_load_verify_locations() build error 2018-09-25 15:39:56 +09:00
cf5377ec5b Revert "fix api.c error code to fit into"
This reverts commit 9eddc2ed3598dbede3c6a3aa1e0b50e111369d63.
2018-09-25 15:39:56 +09:00
921992e689 fix api.c error code to fit into 2018-09-25 15:39:55 +09:00
d9c0e1ddde increase memory bucket size 2018-09-25 15:39:55 +09:00
c28e981b9b avoid shadow 2018-09-25 15:39:55 +09:00
c7cfa74577 Fix some flaws caused by rebase 2018-09-25 15:39:55 +09:00
a189d00fc9 Refactor cs+ project 2018-09-25 15:39:55 +09:00
3c93d4e638 KEEP_STORE_CERTS release elimination, limited to FreeX509 in X509_STORE_CTX 2018-09-25 15:39:55 +09:00
226bc54b57 ctx->ourCert keeps duplicated x509 2018-09-25 15:39:55 +09:00
8a046b0bac WOLFSSL_KEEP_STORE_CERTS for wolfSSL_X509_free 2018-09-25 15:39:55 +09:00
59beba6338 WOLFSSL_CIPHER_INTERNALNAME option 2018-09-25 15:39:55 +09:00
c3abb6c0cd HAVE_HTTP_CLIENT is disabled if WOLFSSL_USER_IO is defined in wolfsssl/wolfio.h 2018-09-25 15:39:55 +09:00
93e1221894 WOLFSSL_KEEP_STORE_CERTS for X509_STOREmake 2018-09-25 15:39:55 +09:00
9ea88b5181 wc_PKCS12_free, EVP_PKEY_free for PKCS12 in test_wolfSSL_OBJ 2018-09-25 15:39:55 +09:00
89dcbd6693 set dynamic flag when wolfSSL_ASN1_OBJECT_new() 2018-09-25 15:39:55 +09:00
511b59cf73 set dynamic flag in ASN1_OBJECT_new 2018-09-25 15:39:55 +09:00
9ae3ccb3ba OBJ_sn2nid with OPENSSL_EXTRA_X509_SMALL 2018-09-25 15:39:55 +09:00
094141b4ea initiallizing asn1Name 2018-09-25 15:39:55 +09:00
7d2a03f8c9 OBJ_obj2nid memory leak 2018-09-25 15:39:55 +09:00
2669b80943 Fix crashed issue if you call X509_free() after X509_STOER_CTX_free() 2018-09-25 15:39:55 +09:00
5de7a34fd4 Add memory free to prevent from leaking 2018-09-25 15:39:55 +09:00
1c627430c7 increase wolfcrypt test program memory size along to WOLFSSL structure modificaiton.
rebase with master branch
2018-09-25 15:39:55 +09:00
1d1f4df8cb Fix XBADFILE typo 2018-09-25 15:39:55 +09:00
7af43b6cf0 test_wolfSSL_OBJ with NO_DES3, NO_RSA 2018-09-25 15:39:55 +09:00
7767d802b7 arg_obj check has done before 2018-09-25 15:39:55 +09:00
c673884cbb #ifdef HAVE_ECC to OBJ_nid2obj, and its test in api.c 2018-09-25 15:39:55 +09:00
4d03b55fef XBADFILE in bio.c 2018-09-25 15:39:55 +09:00
fd634141bd wolfSSL_get_rbio,wolfSSL_get_wbio.
fix to check XBADFILE in wolfSSL_BIO_write_file.
2018-09-25 15:39:55 +09:00
fd01659baa Obj_obj2nid 2018-09-25 15:39:55 +09:00
19c1a3a3f9 Fix i2d_RSAPublicKey() memory leak issue. 2018-09-25 15:39:55 +09:00
3f993c280c Change buffer variable name for preventing from conflict with debug option. 2018-09-25 15:39:54 +09:00
3f82fb62a0 SSL_get_peer_cert_chain() count value check in api.c 2018-09-25 15:39:54 +09:00
259d3b5720 WOLFSSL_USER_FILESYSTEM option 2018-09-25 15:39:54 +09:00
1e87eae3b7 i2d_RSAPublicKey(rsa, NULL) 2018-09-25 15:39:54 +09:00
52cee17668 use XSEEK_END 2018-09-25 15:39:54 +09:00
e6612b34f7 use XFILE, BADFILE, XFxxxx 2018-09-25 15:39:54 +09:00
787fa5d49a get name in X509_NAME_get_entry 2018-09-25 15:39:54 +09:00
3bf776baf4 wolfSSL_ASN1_TIME_get_data() changed 2018-09-25 15:39:54 +09:00
29d3303995 Add tests for d2i_PKCS12_fp,i2d_RSAPublicKey,RSA_verify and X509_print 2018-09-25 15:39:54 +09:00
b588e6ab29 ERR_peek_last_error() and SSL_get_SSL_CTX reference error on opensslextra.
Implemented wolfSSL_X509_get_version().
2018-09-25 15:39:54 +09:00
e79cdefcde X509_NAME_ENTRY_get_object 2018-09-25 15:39:54 +09:00
2922a93bf7 PEM_read_X509_CRL 2018-09-25 15:39:54 +09:00
050fa2f8f8 wolfSSL_X509_CA_num() 2018-09-25 15:39:54 +09:00
aaa26f3f41 wolfSSL_ASN1_TIME_get_data() 2018-09-25 15:39:54 +09:00
a002a6715f wolfSSL_ASN1_TIME_get_length() 2018-09-25 15:39:54 +09:00
98ae3bb7fd Add define for OpenSSL API. 2018-09-25 15:39:54 +09:00
741301bb2c Single Precision: ARM Thumb assembly implementation
Remove AVX2 code from platform specific code that doesn't support it.
Fix sp_lshd to memmove correct amount.
2018-09-25 09:10:45 +10:00
c4e1cdf335 Merge pull request #1845 from dgarske/tls_curve_order
TLS supported curve selection fixes
2018-09-25 08:26:14 +10:00
27aaedf37c add -rsa-sz which benches any RSA key size 2018-09-24 16:21:13 -06:00
4855246fc6 Merge pull request #1847 from kaleb-himes/ASN_T_LONG
Address a potential out of bounds write
2018-09-24 10:51:49 -06:00
3be25441fa Merge pull request #1843 from dgarske/async_fixes
Fixes for wolfCrypt async use with TLS
2018-09-24 09:51:19 -06:00
0efc637d2d Merge pull request #1834 from SparkiDev/pkcs11
Support for PKCS#11
2018-09-24 09:41:45 -06:00
038b5e8a66 Fix comment spelling error. 2018-09-24 07:23:54 -07:00
d273d1dc81 Fixes from review 2018-09-24 08:44:31 +10:00
3a72cf7996 Fixes from review 2018-09-24 08:41:25 +10:00
f7f158cbd9 Fix encode and decoding of EC signature 2018-09-24 08:41:25 +10:00
77a81057be Casting fixes 2018-09-24 08:41:25 +10:00
5744e4227d Rewrote the public pkcs11 headers
Fixed file name in comment.
2018-09-24 08:41:25 +10:00
8a5a03ea35 Support for PKCS#11
Support for RSA, ECDSA and AES-GCM operations.
2018-09-24 08:41:25 +10:00
dfec7f2263 Fix for TLS v1.3 async case with cipher suite TLS_AES_128_GCM_SHA256 and RSA key type. Fix for issue with long cipher suite name test for TLS 1.3. 2018-09-21 16:30:05 -07:00
29d60ec7e9 Changed to MAX over LONG based on peer review 2018-09-21 17:09:37 -06:00
fc77590c4e Address a potential out of bounds write 2018-09-21 17:02:56 -06:00
b2575b0b60 Fix to only skip early key free if async pending. 2018-09-21 15:13:15 -07:00
e07e8a6a6e Merge pull request #1846 from cconlon/validity
fix daysValid seconds calculation
2018-09-21 12:02:11 -07:00
0591b18339 fix daysValid seconds calculation 2018-09-21 11:04:39 -06:00
a643aeac41 * Fixes for async with TLS where keys are being free'd too soon.
* Fix for possible NULL RNG case in mp_rand.
* Fix for memory macros to handle expression for `HEAP`.
* Fix for possible unknown uint32_t type with mem track.
* Fix for double Alloc/Free print when using track and debug memory at same time.
* Fix for building with `./configure CFLAGS="-DECC_USER_CURVES -DNO_ECC256 -DHAVE_ECC160"`
* Performance improvements for cases with `WC_ASYNC_NO_HASH` and `WC_ASYNC_ENABLE_SHA256`.
2018-09-21 09:33:40 -07:00
24f9f12844 Fix for the curve logic to pick the hightest strength, not just the default 256-bit. Added test for setting user curve. ./examples -H useSupCurve. 2018-09-21 09:27:48 -07:00
39019c2418 Re-order the default supported curve groups by strength. Some TLS servers pick the top choice instead of the strongest. 2018-09-21 08:54:32 -07:00
a5fffdbbb7 Merge pull request #1844 from kaleb-himes/CERT_UPDATE_FIX
Cert update fix
2018-09-20 18:06:16 -07:00
dfb9db2b8d Merge pull request #1832 from JacobBarthelmeh/HardwareAcc
Linux /dev/crypto SHA256 and AES
2018-09-20 18:05:35 -07:00
dc942bf9cb Remove unnecessary duplicate revocation 2018-09-20 16:54:35 -06:00
ea06a3e8cb Resolve some persistent error report when conf not passed to req 2018-09-20 16:50:02 -06:00
fe2f9d4aa4 minor adjustments and add README 2018-09-20 15:59:29 -06:00
427c62e04a Merge pull request #1841 from kaleb-himes/CERT_UPDATE_REFACTOR
Cert update refactor
2018-09-20 14:24:06 -07:00
54e04dd312 posix compliance enhancements for portability 2018-09-20 10:30:11 -06:00
4177c2f316 Merge pull request #1839 from ejohnstown/rng
RNG Update
2018-09-20 08:49:39 -07:00
c225b45364 Merge pull request #1842 from kaleb-himes/NO_SHA_CRL_ON_BUILD_FAILURE
Update certs to address nightly failure with disable sha enable crl
2018-09-20 06:09:29 -07:00
17ebb0ea49 Update certs to address nightly failure with disable sha enable crl 2018-09-19 15:22:08 -06:00
afcdfd70fe Merge pull request #1840 from embhorn/fix_renewcerts
Revert addition of OIDs to cnf
2018-09-19 15:11:20 -06:00
f3fd67c54b White space updates and revert cnf changes in lieu of PR #1734 2018-09-19 14:54:19 -06:00
4f6ee556dc Refactor the cert renewal scripts with error handling
Portability updates
2018-09-19 14:47:21 -06:00
96a7e366bc testing with valgrind and static analysis tools 2018-09-19 14:29:33 -06:00
2e88151cfd crypto only sha256 cryptodev
formating and refactoring

update configure for devcrypto

add AES algorithms to cyrptodev port

increase structure size for compatibility AES with cryptodev

add wc_devcrypto.h to install path
2018-09-19 10:41:29 -06:00
951bd5a01a FIPSv2: RNG Update
1. Put the SeedTest function in the HASH_DRBG scope.
2018-09-19 07:22:04 -07:00
b1b7093a1d Revert addition of OIDs to cnf 2018-09-19 08:01:40 -05:00
8972867ada FIPSv2: RNG Update
1. Updated the IDE/WIN10 user settings to enable RDSEED by default.
2. Updated the Windows GenerateSeed() function to take into account the
RDSEED enabled setting.
3. Exclude the TestSeed() function check for the "selftest" build as
well as old FIPS.
2018-09-18 16:08:35 -07:00
582cf3182e FIPSv2: RNG Update
1. Update the SEED_BLOCK_SZ to 4 for non-FIPS builds.
2. Change fips-check.sh to skip copying over the random.{c,h} files for
now. Need the tagged versions of the other files and the new random for
now.
2018-09-18 14:36:43 -07:00
4aa85f956f FIPSv2: RNG Update
1. The wolfcrypt test shouldn't check TestSeed() for old FIPS builds.
2018-09-18 14:36:42 -07:00
b9a850575f FIPSv2: RNG Update
1. For non-FIPS builds, lower the entropy request size to the old value.
2. Added a consistency check to the result of the entropy source. The test
involves requesting an additional 64-bits, then doing a running
comparison of each block of 64-bits. The first block of bits is ignored.
3. Refactored the RNG seeding a bit. Renamed all variables with
"entropy" in the name as "seed". Renamed the constants for entropy sizes
as seed sizes. Changed the security strength to its actual value and
introduced an entropy scaling factor for the number of bits of entropy
per bit and a size for the NDRBG block size.
4. Changed it so the user can change the parameters for the RNG at the
build configuration. If using FIPSv2, triggers an error if the paramters
are changed.
2018-09-18 14:36:42 -07:00
085daa78cd Merge pull request #1833 from dgarske/norng_fixes
Fixes for building without RNG enabled
2018-09-18 14:52:21 -06:00
4981480215 Fix to make sure wc_RNG_GenerateBlock return code is checked in test.h GetRandomPort. 2018-09-18 12:55:52 -07:00
9e305a01b4 More fixes for building with ./configure --disable-rng. 2018-09-18 11:17:39 -07:00
d05423af7e Merge pull request #1835 from danielinux/fix-fall-through-define-typo
Fixed typo in the definition of macro FALL_THROUGH
2018-09-18 07:01:15 -07:00
b832b7bad3 Fixes for building with ./configure --enable-opensslextra --disable-hashdrbg --disable-rng --enable-cryptonly --disable-dh --disable-rsa --disable-ecc. 2018-09-17 09:38:45 -07:00
14815431e7 Merge pull request #1836 from kaleb-himes/MP_SET_IMPL_DEC_FIX
mp_set pre-processor logic in fastmath breaking existing builds, norm…
2018-09-14 16:44:29 -07:00
2e4c07ed93 Fixes and improvements for handling the --disable-rng case. Valid make check tests requires wolfCrypt only and no asymmetric crypto (./configure --disable-rng --enable-cryptonly --disable-dh --disable-rsa --disable-ecc). 2018-09-14 14:09:27 -07:00
301e91e4d3 mp_set pre-processor logic in fastmath breaking existing builds, normal math not effected 2018-09-14 14:29:19 -06:00
04c444af35 add wolfSSL version print out to benchmark app 2018-09-14 14:17:49 -06:00
32d3cb6cfb Fixes for case with Intel rand source and no DRBG (./configure --enable-intelasm --enable-intelrand --disable-hashdrbg). Fixes to wolfSSL_RAND_egd to better handle no DRBG case. 2018-09-14 09:48:57 -07:00
a7ab98be69 Removed typo in the definition of macro FALL_THROUGH 2018-09-14 11:02:23 +02:00
fb699acec4 Merge pull request #1831 from MJSPollard/benchmarkCSV
added option to print wolfcrypt benchmark tests in CSV format
2018-09-13 16:16:09 -06:00
a4d502e22a Additional fixes for no RNG cases. Specifically ./configure --disable-hashdrbg --disable-rng --enable-cryptonly 2018-09-13 14:07:08 -07:00
77cd361bca Fixes for building with WC_NO_RNG. 2018-09-13 13:23:55 -07:00
e071f1ca7e Merge pull request #1825 from SparkiDev/compat_apis_1
Add more compatability APIs.
2018-09-13 13:13:12 -07:00
8a6a9e7620 Merge pull request #1820 from kojo1/portingAid
Porting aid
2018-09-13 11:06:55 -06:00
d4d6346ee5 fixed unused variable error 2018-09-13 08:47:01 -06:00
7457ab3e14 added define to work with certain enabled options 2018-09-12 23:37:31 -06:00
037151eae0 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into benchmarkCSV 2018-09-12 23:32:45 -06:00
1c25fc801e Changed up some words 2018-09-12 16:58:32 -06:00
4f95ba0f69 Where did a bunch of those links even come from? 2018-09-12 16:51:45 -06:00
0275366fb6 Fixes from code review
Document how length of ECDSA signature calculated.
Check parameter not NULL before use.
Formatting fix.
Also, disable RSA test of EVP_DigestSign/Verify* when HAVE_USER_RSA.
2018-09-13 08:47:09 +10:00
e809fc2d5d Updated some of the links on the Doxygen page 2018-09-12 16:45:18 -06:00
324235f698 Merge pull request #1823 from dgarske/cert_ext_only
Fix for build with cert extensions and openssl extra only
2018-09-12 13:03:37 -07:00
581f72adf8 Merge pull request #1822 from dgarske/fixes_async
Fix for dh_test to make sure the provided agree size is populated
2018-09-12 13:03:04 -07:00
5b985c7dbd Merge pull request #1821 from dgarske/nxp-ltc
Fixes for NXP LTC support with K82
2018-09-12 13:02:21 -07:00
b330c6e035 Merge pull request #1801 from kaleb-himes/OCSP-GLOBALSIGN-FIXr2
Address issues when testing with WOLFSSL_OCSP_TEST set
2018-09-12 11:36:41 -07:00
bd1d36f0aa Merge pull request #1818 from aaronjense/IAR-EWARM-build-update
fixed compile time errors and warnings for IAR-EWARM projects
2018-09-12 11:15:59 -07:00
8aae8ceb2a Changed mobile viewport scale 2018-09-12 10:16:45 -06:00
df20daa1ae Support RSA and ECC in wolfSSL_DigestSign/Verify* 2018-09-12 16:31:39 +10:00
7ddc756d15 eliminate double semi-colon 2018-09-12 10:13:30 +09:00
66dc735454 Merge pull request #1830 from dgarske/renesas
Fixes for Renesas example projects
2018-09-11 15:40:00 -06:00
4bbbb82a01 Merge pull request #1829 from embhorn/zd3928
Make DecodedCert elements available with WOLFSSL_CERT_EXT
2018-09-11 14:38:31 -07:00
d280359548 added option to print wolfcrypt benchmark tests in CSV format 2018-09-11 14:49:54 -06:00
6876b7d98e Removed comment from HTML header 2018-09-11 13:35:49 -06:00
93e3db3ae2 Merge branch 'master' of https://github.com/wolfssl/wolfssl into doxygen-update 2018-09-11 13:33:47 -06:00
0ad77628f1 Merge pull request #1827 from kaleb-himes/CPP_POLY1305
Fix for HAVE_POLY1305 without one time auth
2018-09-11 10:00:39 -07:00
ca83f97508 Merge pull request #1828 from cconlon/nucleusfix
Pass arguments through to Nucleus memory functions in 1.2 build
2018-09-11 09:41:01 -07:00
a63da76e07 Fixes for Renesas example projects. 2018-09-11 09:38:24 -07:00
d658701350 Added NO_WOLF_C99 define, replaced sp.c with relevant sp_*.c, removed evp.c and bio.c from compiling seperately from ssl.c 2018-09-11 11:16:04 -05:00
01dc018cda Make DecodedCert elements available with WOLFSSL_CERT_EXT 2018-09-11 10:41:12 -05:00
8060deb40a pass arguments through to Nucleus memory functions in 1.2 build 2018-09-11 09:26:12 -06:00
330a7048c7 Add more compatability APIs.
d2i_ECDSA_SIG, i2d_ECDSA_SIG, EVP_DigestVerifyInit,
EVP_DigestVerifyUpdate, EVP_DigestVerifyFinal, EVP_PKEY_id,
PEM_read_bio_PUBKEY
2018-09-11 09:28:03 +10:00
f90b7d6c37 Merge pull request #1826 from embhorn/serialnumOID_new
`wolfSSL_CTX_load_verify_chain_buffer_format` and device serial number OID
2018-09-10 11:33:37 -07:00
238f45d89d Fix for build with ./configure --enable-certext --enable-opensslextra. 2018-09-10 08:22:17 -07:00
f48e2067ae Added new API wolfSSL_CTX_load_verify_chain_buffer_format for loading CA cert chain as DER buffer list including API unit test. Support for device serial number OID. 2018-09-10 08:15:17 -07:00
2c5b0d82da Fix for dh_test to make sure the provided agree size is populated. This resolves issue with async and QuickAssist DH. 2018-09-10 07:13:52 -07:00
a2be7590d1 Fixes for NXP LTC support with K82. Fix for SHA384/512. Fix for AES CBC not storing previous IV. Fix for wc_AesSetKey arg check. Fix for AES GCM IV != 12 test. Changed LTC default in settings.h to not enable SHA512 and Ed/Curve25519. Tested using Rowley Crossworks v4.2.0 on a FRDM-K82F. There is an initial stack pointer issue with the arm-startup code here for Rowley still outstanding, but these fixes are valid as-is. 2018-09-10 07:13:32 -07:00
8fdb6b79d0 Merge pull request #1824 from SparkiDev/tls_cam_no_aes
Camellia is a block cipher in TLS - can't turn on AEAD only define
2018-09-09 17:28:34 -07:00
f8ac5b5f71 Merge pull request #1819 from dgarske/fix_load_loc
Fix for load location test to handle multiple failure codes
2018-09-10 08:36:19 +10:00
2d413c5bb8 Camellia is a block cipher in TLS - can't turn on AEAD only define 2018-09-10 08:18:03 +10:00
0d44252608 error pass though build flag WOLFSSL_PASSTHRU_ERR 2018-09-08 10:19:31 +09:00
902008f5ea refer unit_PassThrough flag at least once 2018-09-08 09:17:52 +09:00
412eecd51a Add wc_SetIssuerRaw and EncodeCert with raw fields (#1798)
* Make cert with raw issuer
* Add wc_SetIssuerRaw
* Use issuer raw in EncodeCert
2018-09-07 16:22:23 -07:00
7d1ab5e9d2 Merge pull request #1817 from danielinux/fix-old-style-definitions
Remove old-style function definitions
2018-09-07 15:52:45 -07:00
575382e5a9 Fix for load location test to handle multiple failure codes (failure may return ProcessFile error code or WOLFSSL_FAILURE). Moved expired certs and setup load location test for expired certs. 2018-09-07 15:30:30 -07:00
e677c32714 test file access functions 2018-09-08 07:27:33 +09:00
294a22e938 flag to pass throug errors for correcting as many error information as possible. 2018-09-08 06:02:20 +09:00
c98f8842a3 Merge pull request #1816 from ejohnstown/ocsp-no-server
OCSP Stapling/No Server Build
2018-09-07 11:48:13 -07:00
27555d6eb7 Fix old-style function definitions 2018-09-07 09:13:20 +02:00
a7fb48e157 Merge pull request #1783 from dgarske/load_loc
Enhanced load verify locations to support flags
2018-09-06 17:00:09 -07:00
15be0aceed OCSP Stapling/No Server Build
In the case of OCSP Stapling being enabled and NO_WOLFSSL_SERVER being
set, there was a spot where the ocsp_stapling list was still being
touched even though it is left out of the build. Just needed to add the
right #ifdefs.
2018-09-06 16:56:09 -07:00
ed14b68c38 Merge pull request #1813 from ejohnstown/bitfield
Bitfield Fixes
2018-09-06 16:01:59 -07:00
0a7b06857d Merge branch 'master' of https://github.com/wolfssl/wolfssl into doxygen-update 2018-09-06 14:56:24 -06:00
6981d48a4d Made some general Doxygen fixes 2018-09-06 14:54:13 -06:00
5360faac9d Bitfield Fixes
A couple flags were being implemented as bitfields from an int type.
GCC-8 is being more strict of type and value checking and is treating
single bit ints as both 1 and -1 and complaining about value changes.
Change the two int bitfields to use word16 bitfields as is the
pattern elsewhere.
2018-09-06 13:46:00 -07:00
d9a6484b75 Fix to improve return code logic in wolfSSL_CTX_load_verify_locations_ex. 2018-09-06 13:01:44 -07:00
ae3d8d3779 * Fixed wolfSSL_CTX_load_verify_locations to continue loading if there is an error (ZD 4265).
* Added new `wolfSSL_CTX_load_verify_locations_ex` that supports flags `WOLFSSL_LOAD_FLAG_IGNORE_ERR`, `WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY` and `WOLFSSL_LOAD_FLAG_PEM_CA_ONLY`.
* Fix for `PemToDer` to handle PEM which may include a null terminator in length at end of file length causing wrong error code to be returned. Added test case for this. (ZD 4278)
* Added macro to override default flags for `wolfSSL_CTX_load_verify_locations` using `WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS`.
* Added tests for loading CA PEM's from directory using `wolfSSL_CTX_load_verify_locations` and `wolfSSL_CTX_load_verify_locations_ex` with flags.
* Added tests for `wolfSSL_CertManagerLoadCABuffer`.
* Updated the expired test certs and added them to `./certs/test/gen-testcerts.sh` script.
2018-09-06 12:51:22 -07:00
8719b888eb Added some files to the .gitignore
Specifically, added
    doc/doxygen_warnings
    doc/html
    doc/pdf
2018-09-06 13:02:30 -06:00
d998d10f02 Merge pull request #1805 from dgarske/fix_csr
Fix for CSR generation email value
2018-09-05 19:44:41 -07:00
a7821e0d6d Merge pull request #1810 from quinnmiller1997/fp_mul_comba_7-typo
Fixed typo in fp_mul_comba_7
2018-09-05 19:43:47 -07:00
30d968d6b0 Merge pull request #1811 from SparkiDev/tls_sig_ret
Fix CheckCertSignature return to be remembered past ParseCertRelative
2018-09-05 19:43:23 -07:00
a3cc2119d7 Fix CheckCertSignature return to be remembered past ParseCertRelative 2018-09-06 10:42:49 +10:00
b8605fa544 Fixed typo in fp_mul_comba_7 2018-09-05 14:51:50 -06:00
0626338be2 Fix for HAVE_POLY1305 without one time auth 2018-09-05 14:41:57 -06:00
5ee09f77a1 Merge pull request #1796 from ghoso/e2studio
add project files for Renesas e2studio
2018-09-05 11:41:01 -06:00
d432d346aa Merge pull request #1809 from cconlon/stm32rngfix
enable RNG clock when WOLFSSL_STM32F427_RNG is defined
2018-09-04 17:21:01 -07:00
28ad8e591d Adding comment for empty case in GetNameType 2018-09-04 18:08:40 -05:00
bac8b78a8c Merge pull request #1803 from SparkiDev/tfm_stack
Small stack for fast math code
2018-09-04 15:57:59 -07:00
d149795648 Merge pull request #1759 from dgarske/verifycbfail
Fix to resolve issue with verify callback not causing an error
2018-09-04 15:52:58 -07:00
8e67ef33b2 Merge pull request #1799 from SparkiDev/cert_vfy_small
Smaller dynamic memory usage in TLS
2018-09-04 15:40:11 -07:00
8584da60a8 Merge pull request #1802 from SparkiDev/tls13_0rtt_ch
Group Early Data message with ClientHello for faster delivery
2018-09-04 15:39:14 -07:00
e1c4d3f5e6 Merge pull request #1808 from ejohnstown/vali-date
Validate Date
2018-09-04 15:33:41 -07:00
d3ea903c55 enable RNG clock when WOLFSSL_STM32F427_RNG is defined 2018-09-04 16:13:09 -06:00
e730cda550 Validate Date
The ValidateDate() function is wrapped by a macro so it may be replaced
in environments without ASN_TIME built in. In two cases, OCSP and CRL,
ValidateDate() is called directly instead of by the macro. This change
fixes that.
2018-09-04 13:39:26 -07:00
17a70aee1b Added test and minor fixes for CheckCertSignature 2018-09-03 10:50:47 +10:00
4b208f4fe5 Make grouping EarlyData and ClientHello a configuration option 2018-09-03 08:48:28 +10:00
4d0478a287 Fix fp_div_2d to return remainder correctly
If a == c are then a and c don't equal d:
calculate d before c
If a != c then a doesn't change in calculating c:
calculate d after c
2018-09-03 08:32:55 +10:00
d2b9b230a0 Added additional verify callback override test cases. 2018-08-31 16:26:51 -07:00
6171e29fe8 Fix for CSR generation after PR (https://github.com/wolfSSL/wolfssl/pull/1734). This resolves issue with email name in CSR. (Thanks to Forum post https://www.wolfssl.com/forums/post4137.html).
Failed examples:

```
145:d=5  hl=2 l=  16 prim: EOC
      0000 - 69 6e 66 6f 40 77 6f 6c-66 73 73 6c 2e 63 6f 6d   info@wolfssl.com
```

```
SET {
138  23:         SEQUENCE {
140   3:           OBJECT IDENTIFIER objectClass (2 5 4 0)
       :             Error: Spurious EOC in definite-length item.
```

Success Examples:

```
140:d=5  hl=2 l=   9 prim: OBJECT            :emailAddress
  151:d=5  hl=2 l=  16 prim: IA5STRING         :info@wolfssl.com
```

```
SET {
138  29:         SEQUENCE {
140   9:           OBJECT IDENTIFIER emailAddress (1 2 840 113549 1 9 1)
151  16:           IA5String 'info@wolfssl.com'
```
2018-08-31 11:20:04 -07:00
41ab3d91fd Small stack for fast math code
Any large stack usages have been changed to dynamic memory allocations
when WOLFSSL_SMALL_STACK is defined.
Modified functions to return error codes.
2018-08-31 17:55:49 +10:00
697c61af35 correct typo in IDE/include.am 2018-08-31 14:57:16 +09:00
00ff519b23 remove wrong configuration in IDE/include.am 2018-08-31 14:52:12 +09:00
d089a4651a Group Early Data message with ClientHello for faster delivery 2018-08-31 09:28:38 +10:00
d86fc2dbbe Smaller dynamic memory usage in TLS
Code doesn't require a DecodedCert which saves on dynamic memory usage.
WOLFSSL_SMALL_CERT_VERIFY: Don't have a DecodedCert allocated and verify
certificate signature in ProcessPeerCerts as this is maximum dynamic
memory usage.
WOLFSSL_SMALL_CERT_VERIFY is enabled with 'lowresource' configuration
option.
Fix sp_clear to work with NULL parameter.
Define a new function HashId that maps to the hashing function
available.
Set MAX_CERT_VERIFY_SZ to be the maximum based on what algorithms are
compiled in.
Fix usage of MAX_CERT_VERIFY_SZ in functions sending certificate verify
messages.
2018-08-31 08:29:28 +10:00
ffc0f0fb26 Fix for building with SESSION_CERTS using pointer after free. Documented store->discardSessionCerts. 2018-08-30 13:57:21 -07:00
3729b12fae Address issues when testing with WOLFSSL_OCSP_TEST set 2018-08-30 14:44:49 -06:00
b369e524d4 Fix for the ECDSA verify callback override test case. Switched to AES128-GCM cipher suite (better cipher suite overall). 2018-08-30 11:48:08 -07:00
3d0d10345a Added test cases for ensuring forced error fails on client and server. Added test cases to ensure bad certificate can be overriden. 2018-08-30 11:17:21 -07:00
944342b386 Fixes for verify callback failure override handling. Fixes the return codes in the failure cases. 2018-08-30 11:17:21 -07:00
53c0003cad Fix to resolve issue with verify callback not causing an error (if one not already present) when returning 0. Test case to follow shortly. 2018-08-30 11:17:21 -07:00
2551512718 add CS+ and e2studio settings in IDE/include.am 2018-08-30 13:50:50 +09:00
31e37ea5df Merge pull request #1797 from SparkiDev/stack_size
Small stack usage fixes
2018-08-29 16:19:46 -07:00
fc64788092 Merge pull request #1795 from SparkiDev/tls13_no_tls12
Fixes to work when compiled with TLS 1.3 only
2018-08-29 16:16:46 -07:00
d084a4bcb8 Merge pull request #1794 from SparkiDev/sp_armasm_modexp
Fix for SP ASM arm and no DH
2018-08-29 16:13:34 -07:00
03fbad22a6 Merge pull request #1792 from SparkiDev/gcc_8_fixes
GCC 8 new warnings in -Wall fix
2018-08-29 16:12:19 -07:00
818b0a3c9c Merge pull request #1791 from SparkiDev/keyshare_ecc_free
Fix memory leak in KeyShare using ECC and not fast math
2018-08-29 16:11:32 -07:00
ab487e25a0 Merge pull request #1790 from JacobBarthelmeh/SanityChecks
change grep message for RSA key size with tests
2018-08-29 16:11:14 -07:00
4fd805ff1e Merge pull request #1789 from JacobBarthelmeh/Fuzzer
sanity check on buffer before clearing it
2018-08-29 16:10:56 -07:00
e4ccb2fe83 Merge pull request #1784 from dgarske/stsafe_server
Added ST-Safe PK callback example for Key Generation (TLS server only)
2018-08-29 16:07:14 -07:00
4d79eb121e add include.am file and comment for related code of Renesas cs+ and e2studio 2018-08-29 11:06:13 +09:00
4dbe86f1fd Small stack usage fixes
Stack pointer logging added.
2018-08-29 10:16:51 +10:00
4d6f43277e add project files for Renesas e2studio 2018-08-28 17:56:55 +09:00
487c60df78 Fixes to work when compiled with TLS 1.3 only
TLS 1.3 Early Data can be used with PSK and not session tickets.
If only TLS 1.3 and no session tickets then no resumption.
External sites don't support TLS 1.3 yet.
2018-08-28 15:37:15 +10:00
57620caac8 Fix for SP ASM arm and no DH
Fix mod exp in ARM asm to work for different size exponents.
In ASM code, mont_norm is not used in RSA so protect from no DH.
2018-08-28 11:24:38 +10:00
551201c00c GCC 8 new warnings in -Wall fix 2018-08-27 12:51:01 +10:00
24694ef7b0 Fix memory leak in KeyShare using ECC and not fast math 2018-08-27 10:50:57 +10:00
46c04cafd3 change grep message for RSA key size with tests 2018-08-24 16:47:37 -06:00
d122b9f8b5 sanity check on buffer before clearing it 2018-08-24 16:29:43 -06:00
205088d1bc Merge pull request #1787 from ejohnstown/patches
Patches for various build errors
2018-08-24 14:46:28 -07:00
459455328f Merge pull request #1788 from ejohnstown/oid
OID handling in DecodeExtKeyUsage
2018-08-24 14:46:19 -07:00
1d9b482711 Merge pull request #1747 from kaleb-himes/XCODE-UPDATES
Xcode updates
2018-08-24 14:01:39 -07:00
86ce22c32e Merge pull request #1785 from embhorn/zd4225
Fix for old certs not discarded when server does not resume session
2018-08-24 13:22:06 -07:00
1005ca0703 Merge pull request #1786 from kaleb-himes/USER-HEAP-WITH-CM
Unloading from CM, and using custom heap, ensure XFREE has acces…
2018-08-24 11:56:48 -07:00
bd5e507617 OID
1. When checking an OID sum against an OID string based on context, skip the unknown OIDs instead of treating them as parse errors.
2. When getting an OID, pass the lower error upstream instead of just PARSE error.
2018-08-24 11:51:25 -07:00
4eb0d32fa8 Patches
1. Define Timeval in callbacks.h if the file sys/time.h is missing.
2. When picking the correct strtok() function, take into account MINGW64.
3. In the example server, changed the call to SSL_accept_ex() as it doesn't exist. Using wolfSSL_accept_ex(). Only a problem when setting WOLFSSL_CALLBACKS.
4. PickHashSigAlgo() is missing a ; when WOLFSSL_CALLBACKS is set.
2018-08-24 11:46:02 -07:00
347fdccf1c Added missing README.md. 2018-08-24 11:11:30 -07:00
c96aeb4550 Added documentation and benchmarks for STM32 and STSAFE-A100 support. 2018-08-24 11:03:14 -07:00
7f324d2c3b Merge pull request #1781 from JacobBarthelmeh/Compatibility-Layer
fix for IV of DES_ncbc function
2018-08-24 10:16:21 -07:00
b7b99a2e92 Unloading from CM, and using custom heap, ensure XFREE has access to custom heap 2018-08-24 10:07:10 -06:00
274b41dea5 Merge pull request #1782 from JacobBarthelmeh/SanityChecks
refactor CloseSocket for WOLFSSL_BIO free with USER IO
2018-08-24 09:08:05 -06:00
498d8e6c15 Fix for old certs not discarded when server does not resume session 2018-08-24 07:53:35 -05:00
88e6bd2915 Added ST-Safe server side PK callback example for key gen. Added helper API's for setting up the PK callbacks and custom context. 2018-08-23 15:57:14 -07:00
40551720ab refactor CloseSocket and add guard 2018-08-23 16:30:53 -06:00
689da22799 Refactor and updates for XCODE projects following peer review 2018-08-23 15:41:35 -06:00
c7dde6c682 Merge pull request #1656 from danielinux/contiki-port
Contiki port
2018-08-23 12:31:56 -07:00
cc39f3211a Merge pull request #1780 from dgarske/pkcs7_ex
Added new PKCS7 ex API's to support signing and validation of large data
2018-08-23 08:41:25 -07:00
5d8a2a7702 Merge pull request #1778 from SparkiDev/sp_mem
Make ALT_ECC_SIZE with SP work
2018-08-23 08:25:44 -07:00
554d40a62e Merge pull request #1777 from dgarske/async_fixes
Build fixes for async
2018-08-23 08:23:20 -07:00
0d171e591b Merge pull request #1776 from SparkiDev/inline_cmpl_fix
Fix for clang builds with configs not using inline funcs
2018-08-23 08:22:39 -07:00
54a379d8e0 Merge pull request #1775 from SparkiDev/tls_no_cert_vfy
Fix for no certificates and calling DoVerifyCallback.
2018-08-23 08:22:07 -07:00
8477d5ba1b Merge pull request #1773 from ejohnstown/critical-option
Certificate Extension Critical Check Optionality
2018-08-23 08:21:19 -07:00
5ce1757e05 Merge pull request #1779 from dgarske/pic32mz_crypt_align
Fix for PIC32MZ crypto hardware alignment
2018-08-23 09:05:50 -06:00
f23eb37ade fix for IV of DES_ncbc function 2018-08-23 09:03:09 -06:00
57d72028f6 Fix for missing return code on wc_Pic32HashFree. 2018-08-22 16:38:55 -07:00
d0d28c82cd Added new PKCS7 ex API's for supporting signing and validation of large data blobs. New API's are wc_PKCS7_EncodeSignedData_ex and wc_PKCS7_VerifySignedData_ex. Includes header docx and unit tests for new API's. Cleanup for the PKCS7 small stack and const oid's. 2018-08-22 15:46:37 -07:00
53af520911 Fix to resolve issue with PIC32MZ crypto hardware (AES/DES3 only) where an unaligned input/output buffer was not handled correctly. This results in a BUFFER_E. This was seen with DTLS v1.0 and TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA cipher suite. Fix is to allocate a dynamic buffer from heap if the input/output are not aligned. Tested and verified with a PIC32MZ2048EFM144 and the wolfssl_udp_client example for Harmony using DTLS v1.0 and the setudppacketoptions 192.168.0.107 11111 hello -> sendudppacket commands. Cleanups in older ctoacrypt/settings.h for PIC32MZ. 2018-08-22 13:39:03 -07:00
d7d2fb34af fixed ifdef WOLFSSL_CONTIKI 2018-08-22 17:37:47 +02:00
bdb5d3c191 Improved support for contiki/uIP. 2018-08-22 09:15:10 +02:00
7bd16a2582 Fixed after second review 2018-08-22 09:15:10 +02:00
b74869a61a Moved contiki + uIP support in the library 2018-08-22 09:15:10 +02:00
b7385476f0 Removed empty ifdef section 2018-08-22 09:15:09 +02:00
79a7518fdd Using inline functions for XMALLOC/XFREE/XREALLOC in contiki
This is necessary to avoid the "unused variable" warnings
2018-08-22 09:15:09 +02:00
3d27a8dc53 Contiki port 2018-08-22 09:15:09 +02:00
783c4a0c5e Make ALT_ECC_SIZE with SP work
Change to more relevant dynamic types in SP also.
2018-08-22 16:02:51 +10:00
9ae4ef2d5c Build fixes for --enable-async --enable-all --with-intelqa. Resolves conflict for stat variable name. Fix for DH with async. Fix for async devSize. 2018-08-21 19:51:13 -07:00
08c2d94011 return value check of XFSEEK 2018-08-22 10:46:46 +09:00
31bd844d6f Fix for clang builds with configs not using inline funcs 2018-08-22 11:16:57 +10:00
fff5cff273 Fix for no certificates and calling DoVerifyCallback. 2018-08-22 10:57:19 +10:00
776fd51720 Merge pull request #1768 from SparkiDev/tls13_final
Use final TLS 1.3 version value by default.
2018-08-21 12:29:51 -07:00
e635e49635 Merge pull request #1772 from SparkiDev/tls13_point_ext
Send EC poiint format extension if downgradable from TLS 1.3
2018-08-21 12:27:10 -07:00
a505f2b063 Merge pull request #1662 from SparkiDev/mem_track
Add memory usage tracking and logging
2018-08-21 12:25:49 -07:00
a0f1c9dbe4 Make the check of the certificate extension critical flag optional based on compile option. 2018-08-21 10:57:04 -07:00
1ab17ac827 More changes to minimize dynamic memory usage.
Change define to WOLFSSL_MEMORY_LOG.
Fix for ED25519 server certificate - single cert to allow comparison
with ECC dynamic memory usage.
Free memory earlier to reduce maximum memory usage in a connection.
Make MAX_ENCODED_SIG_SZ only as big as necessary.
Change memory allocation type in sha256 from RNG to DIGEST.
If we know the key type use it in decoding private key
2018-08-21 14:41:01 +10:00
d29118ba58 Merge pull request #1771 from dgarske/tls13only
Fixes for building with TLS v1.3 only enabled.
2018-08-21 14:25:54 +10:00
103a0d351b Send EC poiint format extension if downgradable from TLS 1.3 2018-08-21 10:11:12 +10:00
389f56b5c7 Fix for building with TLS 1.3 only when AES CBC is enabled. Algorithm is allowed to be enabled, but the AES CBC cipher suites should not be. Fixed AEAD enable to check AES CBC based on HAVE_AES_CBC define. 2018-08-20 16:29:48 -07:00
506c858ed6 Add memory usage tracking and logging
Add WOLFSSL_MEMORY_TRACKING to report allocations and frees with the
type.
Fix places where memory can be freed earlier.
2018-08-21 08:54:57 +10:00
b12386fbb1 Fixes for building with TLS v1.3 only (./configure --disable-tlsv12 --enable-tls13 --disable-aescbc --enable-ed25519 --enable-curve25519) 2018-08-20 15:49:03 -07:00
20950ffde8 Remove TODOs around TLS 1.3 draft version. 2018-08-21 08:41:50 +10:00
3d16ed9c02 Merge pull request #1770 from ejohnstown/prime-fix
Prime Test Bug Fix
2018-08-20 13:24:05 -07:00
e4757f1283 Prime Test Bug Fix
Using the wrong size for the MR test check value. Converting from size
of FP_MAX_BITS to the DH prime size, dividing too much. Switched it to
its own constant.
2018-08-20 11:43:06 -07:00
f3c4d5442e Merge pull request #1757 from dgarske/pkcs8_pad
Fix to resolve padding issue with PKCS 8 encryption.
2018-08-20 09:32:34 -07:00
0e1b8b7bd8 Merge pull request #1760 from dgarske/atmel_asf
Fixes for building with Atmel ASF (`WOLFSSL_ATMEL`)
2018-08-20 09:20:01 -07:00
0f539616be Merge pull request #1766 from JacobBarthelmeh/UnitTests
cleanup with test cases and access to FP_MAX_BITS
2018-08-20 09:19:14 -07:00
683182f494 Merge pull request #1765 from SparkiDev/sp_fixes_1
Fixes for SP
2018-08-20 09:18:31 -07:00
555714afa3 Merge pull request #1764 from SparkiDev/tls13_psk_cb
Separate PSK callback for TLS 1.3
2018-08-20 09:17:01 -07:00
c8814a7ee1 Merge pull request #1769 from SparkiDev/tls13_dh
TLS 1.3: Always left-pad DH secret to length of prime
2018-08-20 09:13:50 -07:00
3e08c27512 Merge pull request #1715 from SparkiDev/disable_aescbc
Config option to disable AES-CBC
2018-08-20 09:08:19 -07:00
d104ae39e3 TLS 1.3: Always left-pad DH secret to length of prime 2018-08-20 14:20:50 +10:00
3cdeccc36e Use final TLS 1.3 version value by default. 2018-08-20 14:17:38 +10:00
a7b5ed1c27 Merge pull request #1767 from aaronjense/dsa-unreachable-statement
silence warning for unreachable statement from some compilers.
2018-08-18 17:50:45 -07:00
79590f3310 silence warning for unreachable statement from some compilers. 2018-08-17 15:13:06 -06:00
ed9aaa93f4 include tfm in example client for veiwing FP_MAX_BITS 2018-08-17 11:06:40 -06:00
cc10c971cd make sure that even if wolfSSL_Init has been called multiple times that wolfSSL_Cleanup gets called in tests 2018-08-17 11:04:21 -06:00
ff635d5b2b Merge pull request #1763 from aaronjense/ecc-check-key-type
Fix error with wolfCrypt-JNI having ECC_PRIVATEKEY_ONLY and d != NULL
2018-08-16 18:16:43 -07:00
f1222c3f9f Separate PSK callback for TLS 1.3
It is highly recommended that the PSK be different for each protocol.
Example callback already returns a different key for TLS 1.3.
New callback includes the ciphersuite, as a string, to use with the key.
2018-08-17 10:18:28 +10:00
2ac2c24f22 Fixes for SP
More places to mask shifted n.
Fix conditional check on NO_3072 in sp_int.h
Disable prime checking when using SP maths.
Add support for mp_tohex to SP maths.
Fix wolfmath.c to support including SP maths.
2018-08-17 10:13:29 +10:00
93546694ca modify for readability 2018-08-16 17:04:32 -06:00
aeb9ab8aea Combine if statements 2018-08-16 16:25:53 -06:00
eb08c6f6fc Fix error with wolfCrypt-JNI having ECC_PRIVATEKEY_ONLY and d != NULL 2018-08-16 15:29:46 -06:00
f487b0d96a Config option to disable AES-CBC
AEAD only detection and removeal of code.
Also in single threaded builds, reference the ctx suites in ssl object
if it exists.
2018-08-16 08:25:13 +10:00
9db7ba2f0d Fix for cast mismatch and spelling of state. 2018-08-15 12:00:44 -07:00
c6e075f077 Fixes for building with Atmel ASF and no ECC508A. 2018-08-15 12:00:44 -07:00
739bbd1355 Merge pull request #1750 from JacobBarthelmeh/SanityChecks
update condition for include of sys/time.h
2018-08-15 11:28:05 -06:00
baab6755b2 Merge pull request #1756 from dgarske/norng
Fixes for building with `WC_NO_RNG`
2018-08-15 10:18:44 -07:00
be0523b7cd Merge pull request #1749 from JacobBarthelmeh/UnitTests
check max key size with ocsp stapling test
2018-08-15 10:18:12 -07:00
373258a0c2 account for NO_RSA and SP math when printing max RSA key size 2018-08-15 09:52:43 -06:00
c3ab52ed44 key size check on ocsp-stapling2 test 2018-08-15 09:52:43 -06:00
f74406d2c9 check max key size with ocsp stapling test 2018-08-15 09:52:43 -06:00
3d16f891d4 Fix to check for buffer overrrun with the additional padding in PKCS12 EncryptContent function. 2018-08-14 19:20:24 -06:00
cdff2869c2 Fixes for building with WC_NO_RNG (applies to wolfCrypt only builds). Tested with ./configure --enable-cryptonly CFLAGS="-DWC_NO_RNG" && make. 2018-08-14 18:53:25 -06:00
2420af3cf2 Merge pull request #1758 from dgarske/certext
Fix for building certext without certgen
2018-08-14 17:00:51 -05:00
9ad059542a Merge pull request #1745 from dgarske/ecc_export_hex
Added new ECC export API's to support export as hex string
2018-08-14 14:19:23 -07:00
e2de988f98 Merge pull request #1739 from dgarske/asio
Fixes to openssl compatibility for Boost.Asio with SSF
2018-08-14 14:18:08 -07:00
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
1c297b3ac4 Cleanup of some macro logic for enabling the mp_toradix. 2018-08-14 12:58:00 -06:00
f23915baa1 Fix for BIO ssl case, which is not supported (for the Boost.Asio project this isn't required either). 2018-08-14 12:44:31 -06:00
6ca56ee98c Fix to handle carriage return case in PEM end of line character handling (for Windows). Cleanup to consolidate duplicate end of line character handling code. 2018-08-14 12:22:18 -06:00
ff7d2fefdc Fix for DH max size calc not including DH_Pub. 2018-08-14 12:22:18 -06:00
7b83db0f65 Fix for PemToDer which was not properly handling extra new lines at end of file. 2018-08-14 12:22:18 -06:00
eca64717be Fix for BIO_wpending to work correctly. 2018-08-14 12:22:18 -06:00
17e102d914 Fixes for asio build options (so includes OPENSSL_EXTRA). Fix for bad named variable shutdown. Fix for the side size in Options struct to support WOLFSSL_SIDE_NEITHER (3). Fix to set the side on wolfSS_connect() or wolfSS_accept(). 2018-08-14 12:22:18 -06:00
be33e69b22 Refactor to rename wc_ecc_export_int to wc_export_int for generic API for exporting an mp_int as hex string or unsigned bin. 2018-08-14 12:17:20 -06:00
368227be2c Fix to make sure fp_div_d is available. 2018-08-14 12:05:22 -06:00
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
04c2b51b4d Fix for padding size calculation and cast warning. 2018-08-14 11:49:21 -06:00
278fd9c054 update condition for include of sys/time.h 2018-08-14 10:51:05 -06:00
d823d6f7b6 Fix to resolve padding issue with PKCS 8 encryption. 2018-08-14 10:51:04 -06:00
64f553d944 Merge pull request #1755 from ejohnstown/scan-build-fix
Scan-Build Fix
2018-08-14 10:11:02 -06:00
aee4aea64d Merge pull request #1748 from JacobBarthelmeh/Testing
call hamc init with blake2 software test
2018-08-14 10:07:01 -06:00
d4f908c372 Merge pull request #1728 from JacobBarthelmeh/HardwareAcc
Add build for AF_ALG
2018-08-13 16:27:51 -07:00
a3627106ea Merge pull request #1753 from dgarske/gcc_arm_fips
Enhancements to the GCC-ARM example
2018-08-13 16:20:13 -07:00
91d2b17139 Scan-Build Fix
1. Initialize the sz variable in wc_BerToDer().
2018-08-13 14:37:04 -07:00
f44d42b1c8 Enhancements to the GCC-ARM example to support FIPS and additional build options. Added examples for memory overrides and standard library overrides. Fixes for building without test, benchmark or TLS. Changed the ARM startup code to only work for the Cortex M0 example using the define USE_WOLF_ARM_STARTUP. 2018-08-13 12:22:14 -06:00
5caaa94868 Merge pull request #1754 from dgarske/fix_fipsv2
Fix for FIPS PRB error with CAVP test
2018-08-13 11:18:33 -07:00
b71c2ddf38 call hamc init with blake2 software test 2018-08-13 08:58:01 -06:00
93a7b76da5 Fix missing RSA_MIN_SIZE and RSA_MAX_SIZE and case where HAVE_FIPS_VERSION is not defined. 2018-08-13 08:18:51 -06:00
80e46253d9 Fix for FIPS v1 CAVP case so the wc_RsaExportKey and wc_CheckProbablePrime functions are available. Cleanup to remove unused ERROR_OUT. 2018-08-13 06:25:55 -06:00
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
6d10efe79c Merge pull request #1752 from kaleb-himes/ocsp-stapling-pzero-take2
Use port 0 (dynamic) solution on servers and clients in addition to ocsp responders. Fix for OCSP tests when running concurrently.
2018-08-10 15:15:43 -07:00
280de47d06 Use pzero solutions on servers and clients in addition to ocsp responders 2018-08-10 14:17:17 -06:00
c288a214b1 give servers time to shut-down after client connection 2018-08-10 11:57:35 -06:00
ba3bc59771 further test control over ocsp-stapling tests 2018-08-10 11:44:16 -06:00
735e4a0986 ocsp stapling tests to wait until unit tests are complete 2018-08-10 11:18:04 -06:00
6113f68c21 make renewcerts-for-test use portable function declaration 2018-08-10 10:40:16 -06:00
35dbf9a6fe address file restoration issue present when git not available 2018-08-10 10:24:42 -06:00
a9a9dd257e Merge pull request #1743 from kaleb-himes/ocsp-logic-update
update ocsp test case for portability and informative updates on use …
2018-08-08 10:45:26 -06:00
c7f1d810c3 update ocsp test case for portability and informative updates on use of environment variable 2018-08-07 10:42:18 -06:00
cc1680dc98 Merge pull request #1741 from dgarske/verify_cb
Refactor of the verify callback
2018-08-06 13:12:54 -07:00
56974c099e Improved the logic for WOLFSSL_ALWAYS_VERIFY_CB to be more explicit and updated comments. 2018-08-06 11:40:35 -07:00
c4ea50b956 Fix for issue with using CopyDecodedToX509 again for existing X509 and freeing the altNames in original. Fix was to use the ssl->peerCert directly for the index 0 cert. Improvement to make sure ex_data is always populated. Added NULL arg check on wolfSSL_get_peer_certificate. 2018-08-06 11:40:35 -07:00
7d39a897dc Refactor of the verify callback to eliminate duplicate code and provide consistency with various build options. Documented build options and added code comments in new DoVerifyCallback function. Added documentation in test.h myVerify function for arguments and return code. Fix from commit da1ac36 which added current_cert to WOLFSSL_X509_STORE_CTX, but is only required for ASIO compatibility and is not used. 2018-08-06 11:40:35 -07:00
30d6c0c1fc Merge pull request #1737 from ejohnstown/ocsp-free
OCSP Free
2018-08-06 09:08:01 -07:00
30e787b10c create buffer with structure copy and set fd after close 2018-08-03 16:46:15 -06:00
7726786998 fix comment and remove duplicate free 2018-08-03 15:04:37 -06:00
738a121d61 Merge pull request #1740 from ejohnstown/null-check
NULL Check
2018-08-03 13:53:53 -07:00
b88d60ecbb Merge pull request #1665 from ejohnstown/mr
Prime Number Testing
2018-08-03 12:50:27 -07:00
f6a8a2f5bd NULL Check
When using the async option, the RSA key is checked on the first call to
DoTls13CertificateVerify() when the async state machine is set up. On
the subsequent call, the pointer to the key isn't checked again. Added a
check. (This was from a static analysis report.)
2018-08-03 11:09:43 -07:00
368b5b1072 Merge pull request #1729 from kaleb-himes/init-array
Initialize array to zero(s)
2018-08-02 16:33:37 -07:00
f45dbed8f9 OCSP
1. Modify the other OCSP Stapling scripts to better manage the OCSP responder.
2. Modify the client's W option to take:
 - 1 for Stapling v1
 - 2 for Stapling v2
 - 3 for Stapling v2 MULTI
3. Modify the client to disallow stapling v2 with TLSv1.3.
2018-08-02 16:25:38 -07:00
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
a915c3a381 Merge pull request #1738 from ejohnstown/DH
DH SP Fix
2018-08-02 15:04:33 -07:00
660c3300e1 Merge pull request #1730 from dgarske/dertoc
Added handy script for converting DER file to C array
2018-08-02 15:54:15 -06:00
5ae45436f4 OSCP
1. Added a missed attr files for the OSCP status files. Bare minimum attr.
2. Added the attr files to the automake include.
3. Fix out of bounds read with the OCSP URL.
2018-08-02 14:50:59 -07:00
782ea74fbf Merge pull request #1732 from kojo1/Ticket-4169-2
Ticket 4169: eliminate ssl->CBIORecv/Send overwritten in SSL_set_bio
2018-08-02 14:58:25 -06:00
99b556c07d Merge pull request #1735 from embhorn/zd4179
Fix for resource leak
2018-08-02 14:27:04 -06:00
c71f730d67 OSCP
1. Made killing the OCSP server process more reliable.
2. Added attr files for the OSCP status files. Bare minimum attr.
3. Added a NL to the error string from the client regarding external tests.
2018-08-02 11:32:36 -07:00
ddec878152 Disable external tests for OCSP scripts 2018-08-02 10:03:47 -06:00
b248af6f84 Update from review 2018-08-02 10:59:07 -05:00
a178764a8b Portability and self-cleanup changes to ocsp test scripts 2018-08-02 09:47:13 -06:00
93c2f3b170 Initialize array to zero(s) 2018-08-02 09:21:09 -06:00
fd75f35801 fix cbioFlag check 2018-08-02 10:18:09 +09:00
6527c2a724 DH SP Fix
When doing the sp_2048_mod_exp_*() is processed, one of the index
variables is masked with 0x1f when it was updated. Added the masking to
the initial set of the index.
2018-08-01 16:32:22 -07:00
c87d6b27e2 OCSP Free
Free the OCSP request when creating the response only if there is an error making the request.
2018-08-01 15:34:43 -07:00
0ccdefb8d0 Merge pull request #1733 from ejohnstown/des-iv
Fix DES IV value
2018-08-01 14:57:26 -07:00
7647d52d77 Prime Number Testing
1. Remove a copy-paste error when clearing up the RNG used to test a prime.
2. Tag a some const test values as static in the wolfCrypt test.
2018-08-01 14:49:06 -07:00
244d931e75 Merge pull request #1721 from kaleb-himes/cleanup-debug
Cleanup debug errors
2018-08-01 15:01:25 -06:00
ba2f0fd8fc Fix for zd4179, 4181, 4182 2018-08-01 15:56:15 -05:00
5ca2ff187b DES IV
Change the DES_IV_SIZE back to 8 bytes, rather than 16.

DES/DES3 was passing the wolfCrypt test becuase the main DES code uses
the DES_BLOCK_SIZE when handling the IV. The TLS/SSL code uses the
DES_IV_SIZE when generating the session keys.
2018-08-01 13:08:52 -07:00
98f6ae16ca copy cbioFlag from ctx to ssl 2018-08-02 04:48:39 +09:00
8bc5bc227d Merge pull request #1634 from ejohnstown/gcc-8-fixes
GCC-8 String Fixes
2018-08-01 12:13:10 -07:00
da096497e0 Merge pull request #1727 from dgarske/memdocs
Documented memory build options
2018-08-01 12:12:34 -07:00
ce5e787afc formating and sanity check on pointer with test case 2018-08-01 11:57:36 -06:00
dba8131b19 Merge pull request #1731 from ejohnstown/redundant-cert
redundant certificate fix
2018-08-01 10:42:30 -07:00
a72cbcf8eb Merge pull request #1726 from ejohnstown/memcb-test
memory callback test fix
2018-08-01 10:05:14 -07:00
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
96c1a567f0 #4169: CBIO set flag to escape from overwritten in SSL_set_bio 2018-08-01 19:16:42 +09:00
61ac7315e2 a certificate was named in an automake include that isn't actually in the tree, a similar named certificate is actually used 2018-07-31 17:25:35 -07:00
72aef0ab11 Added handy script for converting DER file to C array. Example: ./scripts/dertoc.pl ./certs/server-cert.der server_cert_der_2048 server-cert.c. 2018-07-31 15:57:02 -07:00
f5b3de6b54 GCC-8 string fixes
1. Found one more case where a string is copied, potentially without the null. In wc_ports w.r.t. directory and file names.
2018-07-31 14:02:44 -07:00
7053830628 GCC-8 string fixes
Fix for the Windows directory search code.
2018-07-31 14:02:44 -07:00
af89458af0 GCC-8 string fixes
1. strncpy needs to include the source string's NULL.
2. Deleted a few redundant string modifications.
2018-07-31 14:02:44 -07:00
ed208efc4d GCC-8 string fixes
1. Modify wolfSSL_get_ciphers() to limit the XSTRNCPY based on the dst buf length, not the src string.
2018-07-31 14:02:44 -07:00
2e1a1681ec GCC-8 string fixes
1. strncat() does not like to copy single byte strings with "n = 1", as it won't null-terminate.
2. strncpy()'s len parameter is the size of the dst not the src.
3. Replaced the echoserver HTTP response composition of const strings with a copy of a single string.
2018-07-31 14:02:44 -07:00
50372b7033 Memory Callback
1. Allow SetAllocators to use NULL as a callback. Memory wrappers will use default with NULL.
2. Remove the ResetAllocators function. Use SetAllocators with NULL.
3. Modify memory tracker to save the old allocators on init and restore them on cleanup.
2018-07-31 09:30:03 -07:00
0e1588f4ad Documented memory build options. Added logging for normal wolf malloc/free opterations when using WOLFSSL_DEBUG_MEMORY and WOLFSSL_DEBUG_MEMORY_PRINT (previously only worked with WOLFSSL_STATIC_MEMORY and WOLFSSL_TRACK_MEMORY). Changed WOLFSSL_MALLOC_CHECK option to use WOLFSSL_MSG. 2018-07-31 09:03:40 -07:00
fe08b98117 Adjust guards following peer review 2018-07-31 09:50:44 -06:00
2b3f94944d Merge pull request #1723 from kaleb-himes/overhead-avoidance
avoid overhead call to alloc and free when sigSz invalid
2018-07-31 08:14:49 -07:00
f18351fef5 Merge pull request #1718 from dgarske/memtest
New memory testing feature and fixes for null checks
2018-07-31 07:56:29 -07:00
f5bd376450 Merge pull request #1720 from dgarske/stsafe_wolf
Added STM32L4/ST-Safe support. Fixes for AES CBC Decrypt w/CubeMX
2018-07-31 07:41:49 -07:00
0f86494161 * Added support for STM32L4 AES hardware crypto.
* Added reference PK callbacks functions for ECC sign, verify and shared secret used by TLS in `wolfcrypt/src/port/st/stsafe.c`.
* Fix for wolfcrypt_test to not require args to be provided.
* Fix for wolfCrypt `ecc_test_buffers` to poperly init ecc_key (resolves devId issue).
* Fix for STM32 AES CBC Decrypt with CubeMX, which was not capturing the first input block for next IV.
* Refactor to combine STM32 hardware init code.
2018-07-30 13:58:19 -07:00
656c0453a2 Fix for unit test abort(). 2018-07-30 13:53:54 -07:00
6a91fbcfdd Fixes for warnings from Jenkins reports. 2018-07-30 13:53:54 -07:00
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
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
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
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
335f467b8c Merge pull request #1714 from dgarske/pic32hashleak
Fixes for PIC32MZ hash memory leak
2018-07-30 13:48:59 -07:00
50115e55b3 Merge pull request #1725 from kaleb-himes/USER_CONF_SIZES
Allow users to adjust upper bounds
2018-07-30 13:44:58 -07:00
ec238c0553 Allow users to adjust upper bounds 2018-07-30 13:44:40 -06:00
c71d8eb6ba Merge pull request #1653 from Naruto/feature/mynewt
port apache mynewt
2018-07-30 13:33:25 -06:00
1079b0e3b3 Merge pull request #1716 from cariepointer/osp/haproxy
Define functions required by HAProxy and enable SSLV3 dependency
2018-07-30 13:26:38 -06:00
0ef63048a0 Fix for new report in wc_BerToDer with uninitialized derSz. 2018-07-30 11:51:26 -07:00
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
d19b78d81a Fix typo in comment 2018-07-30 12:17:55 -06:00
166330030c Handle case where external unassigned 2018-07-29 06:46:07 -06:00
861fec1dc6 porting mynewt 2018-07-28 18:03:20 +09:00
0ee4b88e74 avoid overhead call to alloc and free when sigSz invalid 2018-07-27 16:25:10 -06:00
4b8507813e Prime Number Testing
1. Also disable the new prime test from TLS while using SELFTEST.
2018-07-27 13:34:38 -07:00
afb2180e80 Cleanup debug errors 2018-07-27 14:00:19 -06:00
04e16b8df8 Merge pull request #1717 from JacobBarthelmeh/Testing
sanity check on pkcs8 variable
2018-07-27 13:33:55 -06:00
543cac65d8 Added boost define and openssl bug fix with WOLFSSL_KEY_GEN 2018-07-27 12:42:09 -06:00
74c4d31c07 sanity check on pkcs8 variable 2018-07-27 11:16:41 -06:00
31f1692cbf Prime Number Testing
1. Disable the new prime test from TLS while using FIPS or setting the flag WOLFSSL_OLD_PRIME_CHECK.
2018-07-26 16:01:08 -07:00
4b2a591a93 Prime Number Testing
1. Added calls to wc_DhSetCheckKey() on the client side of TLS.
2. Added an API test to the wolfCrypt test.
3. Fixed a bug in the prime test found with the API test. Misuse of tertiary operator.
2018-07-26 14:43:04 -07:00
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
a1f69f0d64 Define functions required by HAProxy and enable SSLV3 dependency 2018-07-26 12:53:21 -07:00
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
84c1b633fb Merge pull request #1713 from JacobBarthelmeh/UnitTests
fix buffer types for ARC4 test
2018-07-25 14:17:10 -07:00
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
beceab2734 Fix for leak with WOLFSSL_PIC32MZ_HASH and TLS. The PIC32 update cache buffer was not always being free'd. 2018-07-25 11:22:03 -07:00
74fbd06817 Merge pull request #1686 from cconlon/nucleus-update
Nucleus port and PB changes
2018-07-25 09:17:40 -06:00
003b7b28f4 fix buffer types for ARC4 test 2018-07-24 17:37:39 -06:00
fe2aee11d8 Merge pull request #1712 from JacobBarthelmeh/Testing
check if internal of WOLFSSL_RSA struct is already set
2018-07-24 11:55:15 -07:00
17c7ecb2bc Merge pull request #1711 from dgarske/memtrack
Fix for memory tracking cleanup
2018-07-24 11:53:08 -07:00
169cca355f Merge pull request #1705 from cconlon/truestudio-project
Add wolfSSL library project for Atollic TrueSTUDIO
2018-07-24 11:52:11 -07:00
018573bcf3 Merge pull request #1695 from JacobBarthelmeh/Optimizations
add some macro guards for CipherRequires function
2018-07-24 11:51:03 -07:00
0175447eb3 tie TRUESTUDIO files into include.am 2018-07-24 09:36:49 -06:00
f69c6e382c check if internal of WOLFSSL_RSA struct is already set 2018-07-23 17:17:27 -06:00
92bc891713 Merge pull request #1709 from SparkiDev/rsa_low_mem_fix
Fix for RSA_LOW_MEM and other configurations
2018-07-23 16:15:28 -07:00
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
ef076a68d3 Added new API wolfSSL_ResetAllocators to allow reset of memory callbacks to defaults. Added new CleanupMemoryTracker which restores memory callback functions. This resolves issue with trying to free memory allocated prior to InitMemoryTracker. 2018-07-23 16:03:08 -07:00
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
69aa74d220 Merge pull request #1708 from ejohnstown/config-fix
Configure Fix
2018-07-23 10:43:12 -06:00
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
06b888a997 Fix for RSA_LOW_MEM and other configurations
Also cast return of XMALLOCs.
2018-07-23 08:47:11 +10:00
3957bb4ebe Configure Fix
1. The check for options that start with an underscore to wrap them with another check was broken. Replaced with a use of grep. The old original version breaks on some shells.
2018-07-20 15:14:03 -07:00
c432bb5e82 Revert back to no tests for test.h consideration 2018-07-20 14:41:46 -06:00
887e3deee8 Move ForceZero test to api.c and turn on tests when inline disabled 2018-07-20 13:30:06 -06:00
027f18919a Resolving some unwanted dependencies 2018-07-20 11:54:36 -06:00
7f19f914c0 create WOLFSSL_NUCLEUS_1_2 for older 1.2 version 2018-07-20 10:51:15 -06:00
d54c7a7df8 Merge pull request #1704 from quinnmiller1997/crossworks
Added support for Jenkins testing in Rowley Crossworks
2018-07-20 08:15:16 -07:00
9433fcb820 Allow SHA384 to be compiled in without SHA512 2018-07-20 09:42:01 +10:00
c5a44c083a Merge pull request #1703 from cconlon/truestudio
Fix Atollic TrueSTUDIO warning, add WOLFSSL_STM32F427_RNG
2018-07-19 15:59:11 -07:00
b6ac3379f0 add wolfSSL library project for Atollic TrueSTUDIO 2018-07-19 16:06:42 -06:00
6d0c49a425 Added support for Jenkins testing in Rowley Crossworks 2018-07-19 15:34:28 -06:00
59f241e510 Merge pull request #1702 from ejohnstown/fips-ecc
FIPS build and ECC fixes
2018-07-19 13:56:03 -07:00
a58d1cf030 Merge pull request #1655 from MJSPollard/wolfASIO
Added wolfSSL compatability for Asio C++ library
2018-07-19 13:44:07 -06:00
19dd08e191 requested style changes 2018-07-19 11:05:56 -06:00
c9434c5ad8 FIPS build and ECC fixes
1. The fips-check script was missing the ecc file when building the FIPSv2 test directory. The correct file was sent in for testing.
2. When building with ECC import validation enabled, one usage of the ALLOC_CURVE_SPECS macro had an extra parameter. (copy-and-paste error)
2018-07-19 10:02:14 -07:00
213f79f06f only require Nucleus XTIME when NO_ASN_TIME is not defined 2018-07-19 10:47:37 -06:00
42985d8250 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into wolfASIO 2018-07-19 10:26:54 -06:00
5c940351b7 add include for task.h for FREERTOS in benchmark.c 2018-07-18 16:52:16 -06:00
5b9fbb5d42 add WOLFSSL_STM32F427_RNG support 2018-07-18 16:44:30 -06:00
27b7791f5e fix TrueSTUDIO warning in PKCS12_create_key_bag() 2018-07-18 16:15:33 -06:00
da1ac3643f added current_issuer member in X509_STORE_CTX struct for SSF use 2018-07-18 16:01:16 -06:00
70dfb9af72 Merge pull request #1700 from embhorn/zd4110
Move #if blocking wc_PubKeyPemToDer
2018-07-18 12:33:01 -07:00
0dbd35ae01 websocketpp compat. addition, add new define for asio 2018-07-18 12:09:12 -06:00
db8939c578 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into wolfASIO 2018-07-18 11:10:35 -06:00
227e7cc8c7 Merge pull request #1690 from SparkiDev/tls_sha384_copy
Remove special case SHA-384 copy code
2018-07-18 09:37:50 -07:00
aa2d6f8060 Merge pull request #1699 from dgarske/ecc508a_pkcb
Added reference PK callbacks for ATECC508A to support TLS
2018-07-18 09:35:58 -07:00
436e774729 Merge pull request #1685 from SparkiDev/dh_max
Add support for maximum DH key size
2018-07-18 09:33:43 -07:00
52aac6e641 Merge pull request #1697 from embhorn/zd4060
Dead code in wolfSSL_BIO_gets()
2018-07-18 09:22:35 -07:00
0c59aa8e31 Move #if blocking wc_PubKeyPemToDer 2018-07-18 11:15:06 -05:00
17d5b6a42b Merge pull request #1694 from SparkiDev/stack_ecc
Small stack support in ECC
2018-07-18 08:57:35 -07:00
ebdfe9715e Merge pull request #1698 from SparkiDev/ed25519_def
Fix define protection to be ED25519 not ECC
2018-07-17 20:05:47 -07:00
74c391d138 Added reference PK callbacks (HAVE_PK_CALLBACKS) for ATECC508A device for wolfSSL TLS. 2018-07-17 19:02:56 -07:00
0236a293e4 Fix define protection to be ED25519 not ECC 2018-07-18 10:12:57 +10:00
ce092a96a2 Change default maximum to 4096 bits. 2018-07-18 08:40:43 +10:00
a862ef860b Merge pull request #1696 from quinnmiller1997/crossworks
Updated Rowley-Crossworks settings for CMSIS 4, added support for Jenkins testing
2018-07-17 13:32:34 -07:00
1840ae7013 Merge pull request #1693 from SparkiDev/stack_rsa
Small stack fixes and ignore RSA fields in RSA_LOW_MEM
2018-07-17 12:24:00 -07:00
6a6f5d01b4 Fix for zd4060 2018-07-17 14:20:14 -05:00
f693c9cc8b Merge pull request #1692 from SparkiDev/stack_hashalgs
Stack hashalgs
2018-07-17 12:20:02 -07:00
96567112cd Merge pull request #1691 from SparkiDev/stack_dh_tls
Small stack fixes
2018-07-17 12:15:26 -07:00
8fed6dfb27 Merge pull request #1687 from cariepointer/openssh-des3
Update configure to enable des3 when building OpenSSH
2018-07-17 12:03:18 -06:00
1766b69de2 Added suppport for Jenkins testing on FRDM-K64F and updated README 2018-07-17 11:30:33 -06:00
d6c9d30aee Merge pull request #1689 from ejohnstown/atomic-dtls
DTLS and Atomic Encrypt Callback
2018-07-17 09:37:50 -07:00
eebbe0239a Merge pull request #1683 from kaleb-himes/SGX_STATIC_LIB_FIX
Update SGX Static lib solution, solve through settings.h
2018-07-17 10:22:14 -06:00
7e5bf9b8a9 add some macro guards for CipherRequires function 2018-07-17 09:04:06 -06:00
e6c22fbd85 Small stack support in ECC
Small stack builds now dynamically allocate large stack variables.
Cache option added to avoid repeated allocation of temporaries in add
points, double point and map.
Cached memory allocated in mulmod and mul2add.
2018-07-17 16:39:53 +10:00
c01c79349e Small stack fixes and ignore RSA fields in RSA_LOW_MEM
Fix asn.c and rsa.c small stack to not have large stack variables.
In RSA code don't load or store dP, dQ or u when using RSA_LOW_MEM as
they are not used.
Fix SP to recognize RSA_LOW_MEM means to use d, private exponent.
Fix wc_CheckRsaKey to work with SP.
Fix sp_int to support mp_set_int for wc_CheckRsaKey().
2018-07-17 11:05:38 +10:00
befe15ddb9 Add configure option to cache when using small stack 2018-07-17 09:36:49 +10:00
6ef800e5f7 Cache Sha256 for small stack when asked in random
Small stack builds see SHA-256 allocating W a lot.
Cache the SHA-256 object in DRBG when WOLFSSL_SMALL_STACK_CACHE is
defined.
Call free function on SHA-256 object now that it is required.
2018-07-17 09:33:24 +10:00
88a2531652 Cache the data allocated in SHA-2 Transform functions
SHA-2 algorithms allocate W each call to transform when using
WOLFSSL_SMALL_STACK.
Put a pointer into the SHA-2 object to cache W.
Change code to call the SHA-2 Free functions now that they are required.
Only cache when WOLFSSL_SMALL_STACK_CACHE is defined.
2018-07-17 09:17:39 +10:00
514a949557 Small stack fixes
Changes to DH and SSL/TLS code to dynamically allocate large stack
variables when compiled with WOLFSSL_SMALL_STACK.
2018-07-17 09:04:00 +10:00
87f378efb5 Remove special case SHA-384 copy code
SHA-384 implementation has a GetHash API and TLS code uses it.
2018-07-17 08:16:46 +10:00
49fefe176e DTLS and Atomic Encrypt Callback
When using the encrypt callback, the DTLS sequence number isn't incremented. Moved the increment to later in the BuildMessage() function.
2018-07-16 13:33:03 -07:00
ea769b831c Fix tab indentation 2018-07-16 13:09:45 -07:00
dbe0ac6fec Update configure to enable des3 when building OpenSSH 2018-07-16 09:49:23 -07:00
00fd7ff8de Prime Number Testing
1. Added some new ifdef clauses to tfc and integer so that
the prime checking is available when using RSA, DSA, or DH.
A couple functions used were dependent on ECC being enabled.
2018-07-13 17:42:35 -07:00
f0422bec41 Merge pull request #1681 from dgarske/pk_keygen
Added ECC and Curve25519 Key Generation PK callback support
2018-07-13 14:03:13 -07:00
f59fb0df8e add custom print to test.c for PB 2018-07-13 14:58:48 -06:00
eeb50099d9 initial Nucleus port with PB changes 2018-07-13 14:58:37 -06:00
1337f7ddec Merge pull request #1674 from dgarske/derchainsz
Fix for max cert chain size calculation
2018-07-13 13:53:35 -07:00
ddd6563442 Dependencies for SGX project updated 2018-07-13 13:18:15 -06:00
6c1778d373 Merge pull request #1669 from cconlon/mqxfixes
fixes for MQX classic 4.0 with IAR-EWARM
2018-07-13 11:59:28 -07:00
223c71b96c Merge pull request #1673 from ejohnstown/configure-update
Yet Another Configure Update
2018-07-13 11:55:08 -07:00
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
2f00c0b465 Added test case for new server ECDHE PK callback. 2018-07-13 10:45:36 -07:00
71d8946ee6 Merge pull request #1678 from cariepointer/osp/openssh
Move function prototypes from wolfss/ssl.h and openssl/ssl.h to appropriate header files for OpenSSH compatibility
2018-07-13 10:05:18 -06:00
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
f22f33606a Merge pull request #1684 from ejohnstown/distcheckfix
add missing certificates to the automake include
2018-07-13 09:41:10 -06:00
ffc6cf4eb8 Add support for maximum DH key size 2018-07-13 17:36:42 +10:00
771e349925 Prime Number Testing
1. Moved a few functions around in tfm.c and integer.c.
2. Added some new ifdef clauses to tfc and integer so that the prime checking is available when using RSA, DSA, or DH.
3. Added an internal version of function wc_DhSetKey and wc_DsaImportParamsRaw that always checks to see if the prime value is prime. Modified the original function to be a wrapper.
2018-07-12 17:22:44 -07:00
0240cc7795 add missing certificates to the automake include 2018-07-12 17:06:02 -07:00
997a377310 Prime Number Testing
1. In wc_DhGenerateParams(), changed the call to mp_prime_is_prime() to
mp_prime_is_prime_ex().
2. In wc_MakeDsaParameters(), changed the call to mp_prime_is_prime() to
mp_prime_is_prime_ex().
3. Added wc_CheckProbablePrime_ex in RSA that also takes an RNG to call
mp_prime_is_prime_ex(). If RNG is NULL, call mp_prime_is_prime().
4. Rewrite wc_CheckProbablePrime() in terms of
wc_CheckProbablePrime_ex().
2018-07-12 15:00:13 -07:00
7d5da4d122 Fix typo in function name 2018-07-12 14:40:46 -07:00
0ce6cbd4c4 Added API unit test for wolfSSL_CTX_use_certificate_chain_file_format. 2018-07-12 13:22:21 -07:00
1b965491d9 Solve through settings.h instead 2018-07-12 14:09:57 -06:00
f7c5b27bfc Merge pull request #1675 from toddouska/zero-error
make SOCKET_PEER_CLOSED_E consistent between read and 2 write cases
2018-07-12 12:53:48 -07:00
cadd556b3a cast result of bitwise not back to original type to prevent compiler warnings 2018-07-12 13:46:55 -06:00
eeece1df1e Fix for duplicate declaration of EccMakeKey. 2018-07-12 12:13:10 -07:00
81d13e15d5 Added ECC and Curve25519 Key generation callback support for HAVE_PK_CALLBACKS. The TLS server side ECDHE could not correctly handle PK callback based shared secret calculation using a hardware based generated key. Refactor internal functions to use the callback ctx getter API. 2018-07-12 11:52:54 -07:00
d486df50aa fix an error where mp_copy was used instead of mp_sub_d 2018-07-12 11:03:41 -07:00
93d7891701 Added different tls version support for asio 2018-07-12 11:59:58 -06:00
d8dff3e4de Merge branch 'master' of https://github.com/wolfSSL/wolfssl into wolfASIO 2018-07-12 11:57:34 -06:00
40d0e7f711 Merge pull request #1677 from ejohnstown/gcc-arm-update
GCC-ARM README Update
2018-07-12 10:27:07 -07:00
c1af8d2190 Move function prototypes from wolfss/ssl.h and openssl/ssl.h to appropriate header files for OpenSSH compatibility 2018-07-12 08:13:51 -07:00
5908230d20 Prime Number Testing
1. Fixed variable name typo in DH for the FFDHE 8192-bit q value.
2. Updated some error strings in wolfSSL_BN_is_prime_ex().
3. Changed the calls to mp_prime_is_prime_ex() in fp_randprime() and
mp_randprime() so they go back to the 8 rounds of MR, which is more than
adequate in this situation.
2018-07-11 16:24:41 -07:00
2f638a0ae1 GCC-ARM README Update
Added directions for building wolfSSL using the gcc-arm-none-eabi tools.
2018-07-11 16:05:02 -07:00
23687f44bc Merge pull request #1643 from ejohnstown/altnames
Subject Alt Name Matching
2018-07-11 13:20:58 -07:00
d639939a07 make SOCKET_PEER_CLOSED_E consistent between read and 2 write cases 2018-07-11 13:00:29 -07:00
05cfeae3ce Fix for handling max cert chain size. It was not accounting for the 3 byte header in max size calculation. 2018-07-11 12:32:49 -07:00
eb32935081 Configure Update
1. Fix typo.
2. Change the parsing of the -D options to be more POSIX friendly.
Removed the "==" and replaced the multi escaped [] with a test command.
2018-07-11 12:01:05 -07:00
0f2b5ca181 fixes for MQX classic 4.0 with IAR-EWARM 2018-07-11 10:54:24 -06:00
df6c496c4e Merge pull request #1671 from SparkiDev/x25519_asm_fix
Fix for Curve25519 ASM
2018-07-11 09:50:57 -07:00
c1a9945656 Merge pull request #1670 from JacobBarthelmeh/UnitTests
check that fp max bits is large enough before test
2018-07-11 09:49:22 -07:00
9281f30deb Fix for Curve25519 ASM
On rare occasions, multiplication and/or squaring result had top bit set
after overflow add - must to be reduced in that case.
2018-07-11 11:53:53 +10:00
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
e2dec618d8 Merge pull request #1667 from ejohnstown/certgentime
Cert Gen Time
2018-07-10 14:40:37 -07:00
0e06f6413d Prime Number Testing
1. Update the function wolfSSL_BN_is_prime_ex to use mp_prime_is_prime_ex.
2. Modified fast and normal mp_prime_is_prime_ex() to use random numbers
that are in the range 2 < a < n-2.
2018-07-10 14:30:53 -07:00
9ca5c65f33 Merge pull request #1645 from abrahamsonn/doxygen-appearance-fix
Doxygen appearance fix
2018-07-10 15:27:07 -06:00
58478c50af check that fp max bits is large enough before test 2018-07-10 15:09:47 -06:00
4cbae0bca3 changes to make jenkins tests work 2018-07-10 13:34:16 -06:00
3fc7424e03 implemented requested changes 2018-07-10 11:52:41 -06:00
d361a1aebd Merge branch 'master' of https://github.com/wolfSSL/wolfssl into wolfASIO 2018-07-10 11:04:53 -06:00
f1c3098bdc Prime Number Testing
Made modifications to the primality testing so that the Miller-Rabin tests check against up to 40 random numbers rather than a fixed list of small primes.
2018-07-09 16:33:26 -07:00
87499aa7bd Merge pull request #1668 from ejohnstown/ignore-file
Ignore File
2018-07-09 11:18:44 -07:00
376a4d3ca8 Merge pull request #1666 from dgarske/fix_always_verify
Fix for building with `WOLFSSL_ALWAYS_VERIFY_CB`
2018-07-09 11:13:28 -07:00
90cf4ad7ad Merge pull request #1648 from embhorn/pkcb
Add PK_CALLBACK support for RSA/ECC verify to ConfirmSignature
2018-07-09 11:05:48 -07:00
9c2a5d2906 Further simplification of the PK verify wrapping to avoid malloc/free. Thanks Todd! 2018-07-06 16:21:43 -07:00
ed17963f21 Add fipsv2.c to the gitignore file. 2018-07-06 16:08:16 -07:00
2e2a502683 Merge pull request #1659 from ejohnstown/configure-update
Configure Update
2018-07-06 16:08:11 -07:00
85d58cbf8c Fix for building with WOLFSSL_ALWAYS_VERIFY_CB. 2018-07-06 15:31:52 -07:00
5cc8771b43 Cert Gen Time
When generating the times for a generated certificate, calculate the
time differences based on the seconds from epoch rather then converting
back and forth between tm structures. One particular RTOS calculates the
date change when generating a certificate on the first of the month. It
leaves the certificate valid on the zeroth of the month.
2018-07-06 15:31:34 -07:00
595beb3fec Fixup for the removal of const. 2018-07-06 09:35:00 -07:00
32f1b0a9c2 Added separate context for each SignatureCtx verify callback. Added missing ssl info to callback context. 2018-07-06 09:28:46 -07:00
9bf8122af7 Merge pull request #1660 from JacobBarthelmeh/ARMv8
adjust macro guards for additional functions
2018-07-06 09:02:35 -07:00
8ba4dda8a8 Merge pull request #1663 from dgarske/lib_isolate
Cleanup old `WOLFSSL` and `WOLFSSL_CTX` references in wolfCrypt
2018-07-05 16:09:56 -07:00
80f98f7ab7 Merge pull request #1664 from JacobBarthelmeh/Testing
keep length value after call to wc_BerToDer
2018-07-05 18:05:28 -05:00
3cbcc872c1 Improved PK callback support for ConfirmSignature so certificate verification uses the callbacks. Retained wolfSSL/wolfCrypt isolation (I.E. no wolfSSL references from wolfCrypt). 2018-07-05 14:04:06 -07:00
e44cb91a3b keep length value after call to wc_BerToDer 2018-07-05 14:35:35 -06:00
0e8e3b7441 Cleanup old WOLFSSL and WOLFSSL_CTX references in wolfCrypt that are no longer required. 2018-07-05 09:58:47 -07:00
c8e118cd12 adjust macro guards for additional functions 2018-07-03 16:52:29 -06:00
af65a9520a Configure Update
Change the increment of the number of jobservers to be more posixish.
More compatible with HPUX's ksh.
2018-07-03 14:42:51 -07:00
ae54bae2fa Merge pull request #1654 from SparkiDev/tls13_stapling
TLS 1.3 OCSP Stapling
2018-07-03 12:56:28 -07:00
ad0f775911 Merge branch 'master' into wolfASIO 2018-07-03 11:14:16 -06:00
ac0b31dee8 refactored and added defines for wolfSSL/Asio Compat 2018-07-03 11:07:15 -06:00
f809a6a17b Merge pull request #1651 from dgarske/pkcs7_dynamic
Added PKCS7 dynamic allocation support
2018-07-02 16:26:03 -07:00
fbd5a4f67f Merge pull request #1650 from dgarske/fix_armv8_aes
Fix ARMv8 AES code build error
2018-07-02 16:23:32 -07:00
77f11a6be9 Merge pull request #1649 from embhorn/zd4043
Fix for memory leak in wolfSSL_BN_hex2bn
2018-07-02 16:22:57 -07:00
9f35d211e0 Merge pull request #1644 from JacobBarthelmeh/Compatibility-Layer
add ca when getting chain from x509 store
2018-07-02 16:22:11 -07:00
e17a16a45a Merge pull request #1600 from dgarske/lighttpd
Changes to support Lighttpd 1.4.49
2018-07-02 16:18:41 -07:00
df9ed87c5f Merge pull request #1652 from ejohnstown/dhtestleak
Fixed a memory leak in the wolfCrypt test for DH key generation.
2018-07-02 17:05:22 -06:00
52d9803d72 Merge pull request #1657 from JacobBarthelmeh/Testing
casts for tls 1.3 windows warnings
2018-07-03 08:25:01 +10:00
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
cf191a4d96 Fixed a memory leak in the wolfCrypt test for DH key generation. 2018-07-02 13:31:13 -07:00
201217bd97 casts for tls 1.3 windows warnings 2018-07-02 13:55:38 -06:00
2bd4fb110c Fix additional cases for use of unititlized PKCS isDynmaic in unit test. 2018-07-02 10:24:41 -07:00
e319987579 Added wolfSSl compatability for Asio C++ library 2018-07-02 10:48:02 -06:00
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
a9ff79e321 check return value 2018-07-02 10:10:30 -06:00
0bf3a89992 TLS 1.3 OCSP Stapling
Introduce support for OCSP stapling in TLS 1.3.
Note: OCSP Stapling v2 is not used in TLS 1.3.
Added tests.
Allow extensions to be sent with first certificate.
Fix writing out of certificate chains in TLS 1.3.
Tidy up the OCSP stapling code to remove duplication as much as
possible.
2018-07-02 16:59:23 +10:00
3adbb07abe Comment correction. 2018-06-29 15:07:56 -07:00
733cb74ea8 Updated all PKCS7 XMALLOC/XFREE to use heap pointer (even small stack). 2018-06-29 15:05:37 -07:00
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
33b72a3dfe Merge pull request #1647 from ejohnstown/akid-not-crit
Add error case for critical Auth Key ID extension
2018-06-29 10:41:04 -07:00
44c4e33290 Fix ARMv8 AES code to use the shared aes.h CTR_SZ and GCM_NONCE_MID_SZ. 2018-06-29 10:22:25 -07:00
ebb3eb87d1 Update from review 2018-06-29 11:02:10 -05:00
42ece70ff2 Merge pull request #1635 from ejohnstown/rpm-fixes
RPM Fixes
2018-06-29 09:44:11 -06:00
c6890d518e Fix resource leak in wolfSSL_BN_hex2bn 2018-06-29 09:44:01 -05:00
54f2c3fe18 Merge pull request #1646 from dgarske/stm32l4_iar
Added support for the STM32L4 and fixed mixed enum warnings
2018-06-28 15:34:33 -07:00
b4da4340a1 Merge pull request #1640 from SparkiDev/tls13_nb
Fix non-blocking and buffered I/O
2018-06-28 15:32:42 -07:00
ea32f2dbef Merge pull request #1638 from SparkiDev/nginx-ocsp
Fix support for OCSP and Nginx
2018-06-28 15:31:18 -07:00
e204b19923 add statusCb variable to OPENSSL_EXTRA build 2018-06-28 14:36:15 -06:00
6fa92fdd71 Add error case for critical Auth Key ID extension 2018-06-28 13:03:16 -07:00
cd2971fb93 Abstracted code for setting options mask to improve wolfSSL_CTX_set_options, so it doesn't require allocating a WOLFSSL object. 2018-06-27 21:30:25 -07:00
6dbca2b718 Fix to resolve the increased stack by allocating the temp ssl from the heap. 2018-06-27 19:44:34 -07:00
66c2c65444 Changes to support Lighttpd 1.4.49:
* Fix for `wolfSSL_CTX_set_options` to work correctly when no certificate has been set for WOLFSSL_CTX, otherwise this operation fails with `Server missing certificate`.
* Fix for bad argument name `time`.
* Fix for `warning: type of bit-field`: Allowed types for bit-fields are int and unsigned int only.
* Exposed `ERR_remove_thread_state` and `SSL_CTX_set_tmp_ecdh` for lighttpd
* Renamed `WOLFSSL_ERR_remove_thread_state` to `wolfSSL_ERR_remove_thread_state` and setup old name macro.
* Add missing newline on asn1.h.
* Whitespace cleanup in ssl.c.
2018-06-27 19:44:34 -07:00
7ae9e4359d Added support for the STM32L4 with AES/SHA hardware acceleration. Fixed a few minor compiler warnings with mis-matched enum types. 2018-06-27 19:40:03 -07:00
abaa5daf43 Fix non-blocking and buffered I/O
Fix states in TLS 1.3 connect and accept to be monotonically increasing
by 1.
Always have a new state after a buffer is constructed to be sent.
Add non-blocking support into TLS benchmark and support TLS 1.3.
2018-06-28 08:49:32 +10:00
7fbe1d3049 Fix support for OCSP and Nginx
Store DER copy of CA certificate with signer when
WOLFSSL_SIGNER_DER_CERT is defined.
Keep the bad issuer error for later when compiling for OpenSSL
compatability.
Authority Info string needs to be passed back with a nul terminator.
2018-06-28 08:48:06 +10:00
f32bd77a1d Updating appearance
In the past, Doxygen just listed API for wolfSSL and wolfCrypt in one long list.
Now there are two separate pages for the wolfSSL and wolfCrypt API references.
2018-06-27 16:29:37 -06:00
765d97ae01 1. Trailing whitespace removal 2018-06-27 16:22:12 -06:00
af75145602 adjust macro guards 2018-06-27 16:13:46 -06:00
ac3eb470f9 Merge pull request #1642 from ejohnstown/conner-doc-update
Doxy Update
2018-06-27 14:37:52 -06:00
c2c209fb89 add ca when getting chain from x509 store 2018-06-27 14:09:32 -06:00
47497f5aaa Removed stray merge failure marker debris. 2018-06-27 10:40:03 -07:00
554275ba71 documentation fix, changes made to x509_print for wolfCLU 2018-06-27 10:29:18 -07:00
13b7dad0fa documentation clean up, added check for asn generalized time 2018-06-27 10:22:47 -07:00
5d767aa004 Merge pull request #1641 from ejohnstown/rename-inline
Rename INLINE
2018-06-27 09:34:41 -07:00
0c74e778dc Merge pull request #1633 from dgarske/bench_3072
Benchmark support for 3072-bit RSA and DH
2018-06-27 07:17:53 -07:00
3572b26bd9 Merge pull request #1636 from JacobBarthelmeh/Testing
add options for OCSP test and combine certs
2018-06-26 22:46:11 -07:00
1b2876679b Merge pull request #1631 from ejohnstown/wolfio-select
wolfIO Select Update
2018-06-26 19:27:20 -07:00
f031a6fc67 check on variable for printout 2018-06-26 17:03:04 -06:00
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
d8086ded6a Merge pull request #1639 from ejohnstown/selftest-fixes
netbsd-selftest fix
2018-06-26 15:38:03 -06:00
d9b5948947 Merge pull request #1605 from dgarske/asyncfsanitize
Fixes for async to resolve runtime fsanitize issues
2018-06-26 14:27:07 -07:00
4151af4b4a A few new functions in AES-GCM and DH don't exist in the netbsd-selftest build of wolfSSL. Option them out of the wolfCrypt self-test. 2018-06-25 17:49:11 -07:00
a7d761c336 Merge pull request #1424 from ejohnstown/fipsv2
FIPSv2
2018-06-25 09:58:48 -07:00
8c9e0cd427 add options for OCSP test and combine certs 2018-06-22 15:58:27 -06:00
d13dfa309e RPM Fixes
1. Fixed a few parsing checks in the dates in the RPM changelog.
2. Moved some file names between sections in the include.am and spec.in files.
3. Added the match-start-of-line to the regex for finding the -D items for the options file.
2018-06-22 11:55:09 -07:00
9d7bcf8ec7 wolfIO Select Update
1. In wolfIO_Select(), separate out the fd lists into separate read and write lists.
2. Check the read and write fds lists to see if the connect() succeeded or failed.
3. Windows doesn't use the nfds parameter to Select. Initialize it to zero and reset it to the right value when building for not-Windows.
4. Remove the warning disable for Windows.

GCC 8.1 checks that "restrict" pointer parameters don't point to the same thing and will error if they do.
2018-06-22 10:49:57 -07:00
e6c7952f50 Merge master into fipsv2. Resolved a conflict in api.c. 2018-06-22 09:52:26 -07:00
ed1c56a4fc Benchmark support for 3072-bit RSA and DH when USE_CERT_BUFFERS_3072 is defined. 2018-06-22 09:30:33 -07:00
522f365279 Fix one more issue with PKCS7 and async, which is not supported. 2018-06-22 09:30:25 -07:00
1cb5bbf8ea Fixes for some async issues. Fixes an async issue with BuildMessage. Fixes for PKCS7 tests to not use async since it is not supported. 2018-06-22 09:30:25 -07:00
71606dde45 Fixes for a few wolfCrypt test memory leaks. Fix for HMAC with empty input not supported on QuickAssist. 2018-06-22 09:30:25 -07:00
ec132cd3f4 Fix fsanitize issue for mp_rand. 2018-06-22 09:30:25 -07:00
623f1b58ac Fix for min IV size check. Cleanup of the max IV to use new enum MAX_IV_SZ. 2018-06-22 09:30:25 -07:00
64ba151c35 Experimental fixes for async to resolve runtime fsanitize issues with invalid memory access due to attempting realloc on non NUMA type. Tested with ./configure --with-intelqa=../QAT1.6 --enable-asynccrypt CC="clang -fsanitize=address" --enable-debug --disable-shared --enable-trackmemory CFLAGS="-DWOLFSSL_DEBUG_MEMORY -DWOLFSSL_DEBUG_MEMORY_PRINT" && make and sudo ./tests/unit.test. 2018-06-22 09:30:25 -07:00
1179969dcf Merge pull request #1630 from embhorn/zd3963
Add support for C99 tools without strings.h and add option to disable C99
2018-06-21 18:00:23 -07:00
8e78623123 Merge pull request #1632 from JacobBarthelmeh/Release
prepare for release v3.15.3
2018-06-21 15:37:32 -07:00
8fd18e06f7 prepare for release v3.15.3 2018-06-21 12:22:27 -06:00
518c987c61 update CA for ocsp test 2018-06-21 12:13:33 -06:00
9d86d323ef Merge pull request #1628 from JacobBarthelmeh/Fuzzer
sanity check on hashing size
2018-06-20 17:46:38 -07:00
bf63003237 sanity check before reading word16 from buffer 2018-06-20 16:48:40 -06:00
2f43d5eece update size to be used with fuzzing 2018-06-20 15:29:05 -06:00
0dc9a19835 Remove check to include strings.h 2018-06-20 10:40:03 -05:00
777c89a257 sanity check on pointer 2018-06-20 09:37:36 -06:00
61655ef56d comment on sz value and sanity check before fuzzing 2018-06-20 09:21:56 -06:00
83324f39d7 update IO callback function names with CSharp wrapper 2018-06-20 09:10:19 -06:00
07810eb21e Merge branch 'master' into zd3963 2018-06-20 10:05:20 -05:00
6d3237a0b4 Add support for C99 tools withoutstrings.h and add option to disable C99 checking. 2018-06-20 09:49:33 -05:00
c1362cca60 Merge pull request #1629 from JacobBarthelmeh/Certs
disable CRL with additional cn/alt test certs
2018-06-19 14:42:21 -07:00
d481a3fb92 Merge pull request #1625 from JacobBarthelmeh/Testing
memory management with test cases
2018-06-19 14:41:18 -07:00
d8e278b6b3 revert free on sig and add comment 2018-06-18 18:15:26 -06:00
e348522353 Merge pull request #1627 from ejohnstown/pkcs7-verify
Fix PKCS7 Sign Verify
2018-06-18 15:32:18 -07:00
4e6a88caf9 Merge pull request #1626 from JacobBarthelmeh/UnitTests
fix for implicit declaration error
2018-06-18 15:30:06 -07:00
d3cd0b6b2e disable CRL with additional cn/alt test certs 2018-06-18 16:10:45 -06:00
38f916a798 sanity check on hashing size 2018-06-18 15:50:44 -06:00
2fd000532a A length value was set to zero in a situation where the existing value was needed. 2018-06-18 11:48:45 -07:00
c98aca32c4 static analysis report fixes 2018-06-15 17:00:45 -06:00
bade35bd76 update return value 2018-06-15 16:25:09 -06:00
0f9063d2a9 fix for implicit declaration error 2018-06-15 16:14:22 -06:00
a1295b3148 memory management with test cases 2018-06-15 15:43:42 -06:00
c78a552eb3 Merge pull request #1598 from JacobBarthelmeh/Nucleus
wolfCrypt only Nucleus
2018-06-15 14:23:54 -07:00
0d0aa74444 Merge pull request #1623 from dgarske/fix_atecc508a
Fixes for build with `WOLFSSL_ATECC508A` defined
2018-06-15 11:06:33 -07:00
55945acd55 Merge pull request #1622 from cconlon/cavp-selftest-fix
fix CAVP self test build with newer raw hash functions
2018-06-15 11:02:15 -07:00
b90fa909ef add warning for source of entropy 2018-06-15 11:40:05 -06:00
495e3552d2 Merge pull request #1624 from JacobBarthelmeh/Testing
move location of wolfSSL_d2i_RSA_PublicKey to fix x509 small build
2018-06-15 10:39:08 -07:00
c03c10e1d4 move location of wolfSSL_d2i_RSA_PublicKey to fix x509 small build 2018-06-14 14:38:15 -06:00
139a08a98e Merge pull request #1621 from SparkiDev/tls13_no_cs
Allow NO_WOLFSSL_CLIENT/SERVER to compile and pass tests
2018-06-14 09:08:13 -07:00
5b2bb44bc8 Fixes for build with WOLFSSL_ATECC508A defined. 2018-06-13 20:10:01 -07:00
aa01fd8adf Merge pull request #1619 from JacobBarthelmeh/HardwareAcc
RAW hash function APIs not supported with ARMv8 build
2018-06-13 16:07:53 -07:00
15348d4936 Merge pull request #1612 from dgarske/fixmatchdomainname
Fixes for `MatchDomainName` to properly detect failures
2018-06-13 13:13:52 -07:00
534114d979 For the FIPSv2 build, remove the define for FP_MAX_BITS from the CFLAGS. Default value was appropriate. 2018-06-13 09:35:42 -07:00
61056829c5 Added success test cases for domain name match (SNI) in common name and alternate name. 2018-06-13 09:26:54 -07:00
1db5d6ebd6 fix CAVP self test build with newer raw hash functions 2018-06-13 09:55:16 -06:00
a03c15e598 Allow NO_WOLFSSL_CLIENT/SERVER to compile and pass tests 2018-06-13 11:42:16 +10:00
e60262cbf1 Merge pull request #1604 from TimParrish/addAMDFunk
Update cpuid.c to optimize intelasm for performance on AMD processors
2018-06-12 16:19:33 -07:00
8fa1592542 Fix to use SHA256 for the self-signed test certificates. 2018-06-12 16:12:29 -07:00
9dc560dd01 RAW hash function APIs not supported with ARMv8 build 2018-06-12 16:45:38 -06:00
1f16b36402 Fixes for MatchDomainName to properly detect failures:
* Fix `MatchDomainName` to also check for remaining len on success check.
* Enhanced `DNS_entry` to include actual ASN.1 length and use it thoughout (was using XSTRLEN).

Added additional tests for matching on domain name:
* Check for bad common name with embedded null (CN=localhost\0h, Alt=None) - Note: Trouble creating cert with this criteria
* Check for bad alternate name with embedded null (CN=www.nomatch.com, Alt=localhost\0h)
* Check for bad common name (CN=www.nomatch.com, Alt=None)
* Check for bad alternate name (CN=www.nomatch.com, Alt=www.nomatch.com)
* Check for good wildcard common name (CN=*localhost, Alt=None)
* Check for good wildcard alternate name (CN=www.nomatch.com, Alt=*localhost)
2018-06-12 14:15:34 -07:00
9448b96afd updated change log 2018-06-12 14:15:57 -06:00
26835bef79 Updated README.md 2018-06-12 13:54:50 -06:00
1dd7f83752 Merge branch 'addAMDFunk' of https://github.com/TimParrish/wolfssl into addAMDFunk 2018-06-12 13:50:07 -06:00
af7b676405 Merge pull request #1602 from dgarske/compat_withnotls
Fixes for building with openssl compatibility enabled and no SSL/TLS
2018-06-12 12:25:32 -07:00
Tim
d043b2c559 Merge branch 'addAMDFunk' of github.com:TimParrish/wolfssl into addAMDFunk 2018-06-12 13:17:53 -06:00
Tim
d518e0b7f6 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into addAMDFunk 2018-06-12 13:16:01 -06:00
5e516cc2e0 Merge branch 'master' into fipsv2 2018-06-12 10:10:50 -07:00
53b0d2cba3 updated readme to show that AMD processors are supported 2018-06-12 10:59:42 -06:00
dac5f84f61 Fix build error with missing bio. Fix for pkey not being reset to NULL for d2i_PrivateKey failure case test. 2018-06-12 09:38:18 -07:00
292e9535ae Fix for wolfSSL_ERR_clear_error to call wc_ClearErrorNodes when its available (mismatched macros), which was incorrectly causing test_wolfSSL_ERR_put_error to fail. Added test_wolfSSL_PEM_PrivateKey test for ECC based key. Refactored the RNG test to only run the reseed test if TEST_RESEED_INTERVAL is defined. This is the test that was causing the tests/api.c to take so long to complete. Will add this macro to the enable options test. 2018-06-12 09:38:18 -07:00
9cbd2b00d4 Added test for PEM_read_bio_PrivateKey using BIO loaded using BIO_new_mem_buf. 2018-06-12 09:38:18 -07:00
e1890a4b0e Added some bad argument checks on compatibility functions BIO_new_mem_buf and PEM_read_bio_PrivateKey. 2018-06-12 09:38:18 -07:00
ad0a10441d Fixes for building with openssl compatibility enabled and no TLS client/server.
Resolves issues building with:
`./configure --enable-opensslextra --disable-rsa --disable-supportedcurves CFLAGS="-DNO_WOLFSSL_CLIENT -DNO_WOLFSSL_SERVER" --disable-examples`
`./configure --enable-opensslextra --disable-ecc --disable-supportedcurves CFLAGS="-DNO_WOLFSSL_CLIENT -DNO_WOLFSSL_SERVER" --disable-examples`

Ticket 3872
2018-06-12 09:38:18 -07:00
39f3df0778 Merge pull request #1610 from SparkiDev/ed25519_priv
Fix private-only keys and make them script generated
2018-06-12 08:34:38 -07:00
8ecb9aacd3 Merge pull request #1592 from SparkiDev/psk_test_fix
Fix test to work with configurations not including AES-GCM
2018-06-12 08:33:44 -07:00
82550b2f8c Merge pull request #1617 from dgarske/fix_arduino
Fixes for Arduino
2018-06-12 08:31:51 -07:00
cb8351c027 Merge pull request #1607 from SparkiDev/tls13_interop_ver
Return TLS 1.3 draft version in ServerHello
2018-06-12 08:30:48 -07:00
766323e90f Merge pull request #1613 from SparkiDev/tls13_post_auth
Fix post authentication for TLS 1.3
2018-06-12 08:29:38 -07:00
83ffb64cda Merge pull request #1599 from dgarske/pkcs7free
Fixes for PKCS7 error case that might leak memory
2018-06-12 08:28:19 -07:00
3b74dbf86a Merge pull request #1609 from SparkiDev/tls13_time
Don't include sys/time.h explicitly in tls13.c
2018-06-12 08:27:43 -07:00
2c8f89ae33 Merge pull request #1611 from kaleb-himes/AN_UP2
Allow for wc_SetAltNamesBuffer call with larger than 16384 bytes
2018-06-12 08:26:58 -07:00
49b82456eb Merge pull request #1618 from cconlon/opensslcompat
Align return values for EVP_DigestUpdate/Final for OpenSSL Compatibility
2018-06-12 08:25:18 -07:00
29410ada1e Merge pull request #1595 from SparkiDev/tls13_cipher_down
Fix for downgrading from TLS 1.3 due to old cipher suite
2018-06-12 08:24:26 -07:00
f2a20c4232 Merge pull request #1573 from SparkiDev/tls_pad_vfy
Constant time padding and HMAC verification in TLS
2018-06-12 08:22:32 -07:00
22ddd41b61 Merge pull request #1581 from ejohnstown/update-configure
Update configure.ac
2018-06-12 08:17:35 -07:00
b7caab938e Fix post authentication for TLS 1.3 2018-06-12 09:49:23 +10:00
7827712fcc FIPS Revalidation (acceptance fixes)
1. The Windows 10 wolfcrypt test project was missing the flag for USE_CERT_BUFFERS_256.
2. Add note to fips-check about using linuxv2 with Win10.
2018-06-11 15:27:52 -07:00
35c8ba3188 Merge pull request #1601 from SparkiDev/ecdsa_sign
Change ECDSA signing to use blinding.
2018-06-11 14:13:24 -07:00
637eaa08ba Merge pull request #1614 from SparkiDev/tls13_log_file
Remove log file and change location to local
2018-06-11 13:51:51 -07:00
a472325f89 return WOLFSSL_FAILURE on error from EVP_DigestUpdate() and EVP_DigestFinal() 2018-06-11 14:27:08 -06:00
7e5c41ca35 Fixes for some async issues in FIPSv2. 2018-06-11 12:41:15 -07:00
10070bb5fd FIPS Revalidation (acceptance fixes)
1. Backed out some changes to AES-GCM with respect PIC32 only code. (This change will not be in the FIPS boundary.)
2018-06-11 10:21:19 -07:00
74d4a02542 Remove log file and change location to local 2018-06-11 15:00:17 +10:00
cf9c352d91 Fixes for Arduino. Don't use C99 for Arduino. Enhanced the script to create as new folder in IDE/ARDUINO/wolfSSL. Updated README.md. 2018-06-08 14:27:54 -07:00
ce2f393bc7 Autoconf Update
1. Remove many redundant macros.
2. Reorder several macros to more appropriate locations.
3. Several macros take lists of items to process, not just individual items. Combined duplicated macros' parameters into lists.
4. Some macros had unnecessary parameters.
5. Added some AX_REQUIRE_DEFINED() checks for the macros used.
6. Add cyassl/options.h to the AC_CONFIG_FILES list. It will be recreated from the template when running config.status the same as wolfssl/options.h
7. Remove the dist-dir rule from Makefile.am. This is prefering the process rather than automating that one step. Make dist will not run config.status.

* AC_PROG_CC must be before any macros that will try to compile for tests.
* AC_CHECK_SIZEOF takes a single type, no size values.
* Only one of the AC_CANONICAL_X macros are expanded. Removed AC_CANONICAL_BUILD since it is never actually used.
* Removed the AC_PROG_CXX and anything C++ related.
* Removed LT_LANG([C]) as it is the default and the C doesn't do anything.
2018-06-08 10:47:14 -07:00
df6fe0b07c FIPS Revalidation (acceptance fixes)
1. Update the fips-check script to pull the FIPSv2 code from the main repositories.
2. Script cleanup.
3. Disable the api.test check of wc_ecc_mulmod() when WOLFSSL_VALIDATE_ECC_IMPORT is enabled.
2018-06-08 10:36:28 -07:00
e99fc3026d Fixed issue with MatchDomainName. Fixes issue #1606. This is a valid and confirmed bug report in v3.15.0. Applies to ./configure --enable-sni case with wolfSSL_CTX_UseSNI where common name has wildcards. Pushing fix for visibility now and will add test case. 2018-06-08 10:09:53 -07:00
1123beb2d2 Allow for wc_SetAltNamesBuffer call with larger than 16384 buffers at user discretion 2018-06-08 10:16:40 -06:00
bea0e6142a Merge pull request #1608 from dgarske/maxcerfix
Resolves issue with reassembling large certificates
2018-06-08 08:25:14 -07:00
5547a7b4bd Fix private-only keys and make them script generated 2018-06-08 17:38:11 +10:00
587f4ae79e Don't include sys/time.h explicitly in tls13.c 2018-06-08 09:00:12 +10:00
00ddeb07d8 Resolves issue with reassembling large certificates. The ProcessPeerCerts function was using the wrong max size check for certs. Built and test with ./configure CFLAGS="-DMAX_CERTIFICATE_SZ=20000". 2018-06-07 15:56:37 -07:00
391d1953fa FIPS Revalidation (acceptance fixes)
1. Add a couple of missing options to user_settings.h for Win10 and configure.ac.
2. Clear the execute flag from the ecc.h.
2018-06-07 10:57:46 -07:00
c6e2585fbc added check for AMD processor to asm.c 2018-06-07 10:35:54 -06:00
020b69aba0 Return TLS 1.3 draft version in ServerHello 2018-06-07 22:01:42 +10:00
234228e5af FIPS Revalidation (acceptance fixes)
1. Fixed some whitespace in api.c.
2018-06-06 17:50:55 -07:00
e673cdf2d2 Merge pull request #1594 from kojo1/openSSL-Compat-CRL-STORE
FILE* to XFILE
2018-06-06 16:34:59 -07:00
596cedc226 Merge pull request #1603 from ejohnstown/add-changelog
Add ChangeLog
2018-06-06 16:32:18 -07:00
Tim
59067825fc Update cpuid.c to optimize intelasm for performance 2018-06-06 16:44:46 -06:00
a6dd93aa2e Removed replaced the last two references to "CYASSL" macros with "WOLFSSL" in the example server. 2018-06-06 13:14:06 -07:00
7e9a32fffd FIPS Revalidation
Merge branch 'master' into fipsv2. Using a merge instead of a rebase to retain commit IDs and tags.
2018-06-06 12:43:15 -07:00
e9d9e7c37c replaced NEWS.md in Makefile.am with ChangeLog.md 2018-06-06 10:56:24 -07:00
9b9568d500 Change ECDSA signing to use blinding. 2018-06-06 11:52:04 +10:00
1c17f55ee4 updated the readme/changelog with the correct release date 2018-06-05 16:10:08 -07:00
0c966d7700 Update ChangeLog and NEWS
While the GNU coding standard states that the NEWS file should be a list of the high level changes and the ChangeLog should be every change in detail, our public source repository contains the detailed log of all changes and the name "ChangeLog" makes more sense to me than "NEWS".  Instead of keeping two copies of the README, one in plain text and one in MarkDown, only keeping the MarkDown copy. It displays better in the source repository, it is still plain text, and we aren't keeping two separate copies of the files.
2018-06-05 16:07:53 -07:00
ab319ae599 Fixed a couple of places in PKCS7 error cases where key free (wc_FreeRsaKey or wc_ecc_free) might not be called. 2018-06-05 14:32:17 -07:00
b63d3173a1 update change log (#1597) 2018-06-05 12:42:43 -07:00
4ac34b74bd Fix test to work with configurations not including AES-GCM 2018-06-05 10:30:15 +10:00
ab5eeb9f79 Merge pull request #1596 from dgarske/leakfixes
Fix for possible leak with normal math and ECC verify fail for R and S
2018-06-04 13:30:09 -07:00
5eca844e01 Fix for possible leak with normal math and verify fail for R and S in ECC verify. 2018-06-04 11:05:14 -07:00
fcd2234841 Fix for downgrading from TLS 1.3 due to old cipher suite
TLS 1.3 specification doesn't allow downgrading based on cipher suite.
2018-06-04 12:42:41 +10:00
caf88c81c2 Merge pull request #1593 from ejohnstown/fix-cert-includes
Fix Cert Includes
2018-06-01 11:32:18 -07:00
f1588e0ad9 Fix Cert Includes
1. Added files that were missing from the certs directory include.am files.
2. Fixed the duplicate items in the certs directory's include.am files.
3. Reorganized the certs directory include.am files to be a tree.
2018-05-31 17:38:47 -07:00
3ff8c45aa8 FILE to XFILE 2018-06-01 09:30:20 +09:00
1cc6042f01 exlude unneeded files with Nucleus build 2018-05-31 15:27:37 -06:00
0c2199084e single threaded wolfcrypt only Nucleus port 2018-05-31 15:04:44 -06:00
70b3ba1c04 Merge pull request #1591 from ejohnstown/release-3.15.0
Release v3.15.0 Preparation
2018-05-31 12:07:43 -07:00
c43a84547a Merge pull request #1572 from dgarske/cryptodev
Added crypto device framework
2018-05-31 10:28:58 -07:00
dfca1beff0 Touch the version number on the library filename in the rpm spec. 2018-05-31 10:20:18 -07:00
8a61b7303a Remove execute bit from a few files. 2018-05-31 10:14:47 -07:00
a4e6cfd3ac Added new file NEWS.md to Makefile for dist builds. 2018-05-31 10:12:34 -07:00
6a2c30e593 Release v3.15.0
1. Update configure.ac for new version.
2. Update the version header.
3. Update the README files with the new changelog.
4. Moved all previous change logs from README files to NEWS files.
2018-05-30 20:00:09 -07:00
bca29395a3 Merge pull request #1590 from JacobBarthelmeh/Compatibility-Layer
add NO_OLD_SHA_NAMES macro and add back SHA512, SHA384
2018-05-30 19:56:17 -07:00
5849e9f1a1 update macro name in test case 2018-05-30 17:42:07 -06:00
e358fc03c7 Merge pull request #1589 from quinnmiller1997/pkcs7_fix
Fixed a filename in the pkcs7.h comments
2018-05-30 16:19:50 -07:00
587484a1ef add NO_OLD_SHA_NAMES macro and add back SHA512, SHA384 2018-05-30 16:10:34 -06:00
4ecff14bd2 Fixed a filename in the pkcs7.h comments 2018-05-30 14:53:03 -06:00
33d416a060 Fix two more scan-build issues with set but not used. 2018-05-30 13:23:08 -07:00
6d84755106 Merge pull request #1587 from cconlon/cavp-selftest-fix
Fix CAVP selftest build
2018-05-30 12:57:35 -07:00
d7b560f2ab Fix for scan-build warning about value being stored and not used. Changed the wc_RsaFunction API to public. Added ability to expose wc_RsaDirect with new define WC_RSA_DIRECT. 2018-05-30 12:44:55 -07:00
999663fae1 Merge pull request #1498 from JacobBarthelmeh/Certs
update before/after dates with certificates
2018-05-30 10:09:49 -07:00
5d99079603 fix HAVE_SELFTEST build for CAVP selftest 2018-05-30 11:08:18 -06:00
fc482235b0 Improved the CryptoDev test to include example callback with context. 2018-05-30 09:11:44 -07:00
a2fdc6262d Merge pull request #1586 from ejohnstown/suite-info
Rerefactor Cipher Suite List
2018-05-30 07:54:13 -07:00
5e4c6e35cc Merge pull request #1542 from ghoso/openssl_compat201805
OpenSSL Compatibility APIs
2018-05-30 08:50:29 -06:00
b84f111d51 rebase with master branch and fix some code. 2018-05-30 17:15:07 +09:00
8cd357aa3a d2i_PKCS12_fp 2018-05-30 12:10:41 +09:00
c715bb5ade X509_check_ca 2018-05-30 12:08:27 +09:00
3f6b7c8833 Merge with openSSL-Compat-CRL-STORE on kojo1/wolfssl 2018-05-30 12:08:27 +09:00
0fb446ad36 i2c_ASN1_INTEGER 2018-05-30 12:03:58 +09:00
d7e4bbf1cf ASN1_STRING_print_ex 2018-05-30 11:56:43 +09:00
5c11e1440f ASN1_TIME_to_generalizedtime 2018-05-30 11:56:43 +09:00
b1ef0c808e Add all stubs. 2018-05-30 11:56:42 +09:00
36ced360cb Add Renesas CS+ project files. 2018-05-30 11:53:18 +09:00
5ff460bb7f OPENSSL_add_all_algorightms_noconf 2018-05-30 11:53:18 +09:00
005284a127 ASN1_GENERALIZEDTIME_free 2018-05-30 11:53:17 +09:00
24ff55b085 RAND_poll 2018-05-30 11:53:17 +09:00
fb7d74c197 FinalRaw parameter hash may not be aligned. 2018-05-30 09:10:46 +10:00
e684156a1e Constant time padding and HMAC verification in TLS 2018-05-30 09:10:46 +10:00
1a7d208a60 add crl2.pem to renew certs script 2018-05-29 16:57:30 -06:00
b2225a0bc0 Rerefactor Cipher Suite List
1. Do not add iana_name to the struct if disabling error strings.
2. Change the IANA_NAME macro to SUITE_INFO, and build the suite info records as appropriate for the error string enablement.
2018-05-29 14:34:57 -07:00
cc58d3160f Merge pull request #1579 from C-Treff/Tenasys_Review
time 64bit, test update
2018-05-29 14:06:44 -07:00
0a35c37211 Merge pull request #1584 from SparkiDev/tls_many_nst
Allow multiple NewSessionTicket messages
2018-05-29 13:43:59 -07:00
52179eba16 Merge pull request #1583 from dgarske/nomatch
Added test for common name failure with check domain name
2018-05-29 13:30:42 -07:00
2cf853d1f1 Merge pull request #1582 from SparkiDev/tls13_only
Allow TLS 1.2 to be compiled out.
2018-05-29 13:26:54 -07:00
92dd231c27 Merge pull request #1585 from SparkiDev/new_compiler
New compilers
2018-05-29 12:25:56 -07:00
16738f1449 Merge pull request #1569 from kojo1/openSSL-Compat-CRL-STORE
openSSL compatibility APIs: X509_CRL, STORE
2018-05-29 09:47:22 -06:00
f871bafe3a Fix uninitialized 2018-05-29 11:06:26 +10:00
68666101b7 Fix for g++ 7.3 - macro strings in asm 2018-05-29 09:25:38 +10:00
1d8fb7be82 Allow multiple NewSessionTicket messages
Interopability testing with OpenSSL
2018-05-28 09:18:26 +10:00
c60b60c50c #if condition to refer wc_PKCS12_new, wc_d2i_PKCS12 2018-05-26 16:02:51 +09:00
ba03f6e08b wolfSSL_d2i_PKCS12_fp 2018-05-26 13:04:06 +09:00
3939eadf9c get derLen by RsaPublicKeyDerSize 2018-05-26 10:55:17 +09:00
af471a360d Merge pull request #1574 from cariepointer/test/wolfcrypt
Add unit test for wc_SignatureGetSize
2018-05-25 11:29:58 -06:00
12dc346058 Change return value to 0 for null key when HAVE_USER_RSA is defined 2018-05-25 09:25:25 -06:00
ba8e441e53 Allow TLS 1.2 to be compiled out. 2018-05-25 11:00:00 +10:00
65014248f9 Fix typos, update ret for if HAVE_USER_RSA defined 2018-05-24 16:32:27 -06:00
a5c2e8b912 Added test for common name with invalid domain fails as expected when set with wolfSSL_check_domain_name. 2018-05-24 14:39:35 -07:00
453daee965 Merge pull request #1523 from SparkiDev/ed25519_key
Allow Ed25519 private-only keys to work in TLS
2018-05-24 09:56:17 -07:00
87f9d0f141 Merge pull request #1566 from ejohnstown/tcp-timeout
Fix TCP with Timeout
2018-05-24 09:07:50 -07:00
5d693b263d removed more tabs 2018-05-24 09:56:54 +02:00
06e9354629 removed tabs 2018-05-24 09:48:18 +02:00
1d281ce515 replace memset by XMEMSET
replaced memset with XMEMSET as requested by @dgarske

INtime project files cleanup
2018-05-24 09:35:46 +02:00
005a0d4dff Define devId if RSA is enabled 2018-05-23 20:17:11 -06:00
d38a0039ed Merge pull request #1549 from JacobBarthelmeh/Cert-Report1
fix for relative URI detection
2018-05-23 17:05:35 -07:00
e4e0dfe9d3 Merge pull request #1564 from JacobBarthelmeh/PKCS12
Pkcs12
2018-05-23 16:59:13 -07:00
6f221ff75c Fix possible leak in PKCS for failure case with small stack enabled. 2018-05-23 16:21:49 -07:00
0315b378f5 Fix TCP with Timeout
Updated example client and server to use the new wolfSSL_dtls_set_using_nonblock() function.
2018-05-23 16:07:45 -07:00
6a00bfc9f7 Merge pull request #1580 from JacobBarthelmeh/Testing
check on cipher suites for AEAD
2018-05-23 17:02:01 -06:00
450741f8ef Change checks for message chaching to happen once
Add compile option to remove Ed25119 client auth in TLS 1.2.
Cipher suite choice does not affect client auth.
2018-05-24 08:43:28 +10:00
982119b495 Only cache messages when required. 2018-05-24 08:43:28 +10:00
9358edf5dd Fixes from code review
Include new private key files in release.
Set messages field to NULL after free.
2018-05-24 08:43:28 +10:00
58f523beba Allow Ed25519 private-only keys to work in TLS
Change Ed25519 in TLS 1.2 to keep a copy of all the messages for
certificate verification - interop with OpenSSL.
2018-05-24 08:43:28 +10:00
4eeb9c8c56 Merge branch 'master' into test/wolfcrypt 2018-05-23 16:35:10 -06:00
72d168028e Fixes to better handle PKCS7 error cases. 2018-05-23 15:29:33 -07:00
9a75e5cf68 Fixes in PKCS7 for handling hardware based devId and no private key. Fix to handle scenario where kari->decoded is allocated, but not initalized (was causing use of unitliaized in FreeDecodedCert). Fix to handle hardware base RSA key size. 2018-05-23 14:48:10 -07:00
555efe0345 Merge pull request #1577 from TimParrish/firstUnitTest
First unit test
2018-05-23 15:24:56 -06:00
a18f220a5a Remove trailing whitespaces 2018-05-23 14:39:36 -06:00
8bd41629ae Split wc_SignatureGetSize test into wc_SignatureGetSize_ecc and wc_SignatureGetSize_rsa tests 2018-05-23 14:26:35 -06:00
9021091896 update comments 2018-05-23 14:04:41 -06:00
690f98fb0f Merge pull request #1578 from SparkiDev/test_cov
Improve coverage
2018-05-23 12:51:37 -06:00
b1ed852f36 Fix TCP with Timeout
wolfSSL remains agnostic to network socket behavior be it blocking or non-blocking. The non-blocking flag was meant for the default EmbedRecvFrom() callback for use with UDP to assist the timing of the handshake.

1. Deprecate wolfSSL_set_using_nonblock() and wolfSSL_get_using_nonblock() for use with TLS sockets. They become don't-cares when used with TLS sessions.
2. Added functions wolfSSL_dtls_set_using_nonblock() and wolfSSL_dtls_get_using_nonblock().
3. Removed a test case from EmbedReceive() that only applied to UDP.
4. Removed the checks for non-blocking sockets from EmbedReceive().
5. Socket timeouts only apply to DTLS sessions.
2018-05-23 11:29:16 -07:00
89fbb1b40d only compile SEQ increment function in case of DTLS or HAVE_AEAD 2018-05-23 12:07:35 -06:00
Tim
4fd85853c5 I think I now understand the trailing white space... 2018-05-23 11:57:12 -06:00
29d9759aa0 check on cipher suites for AEAD 2018-05-23 11:53:33 -06:00
cd9f86d921 time 64bit, test update
64bit settings for time is mandatory for INtime. Changed the project file.

Test for ecc_test_buffers was unreliable, as the structs were not initialized befor usage.
2018-05-23 10:33:56 +02:00
3bb4949e02 Improve coverage
Renumber errors in test.c to be unique.
Fix stack usage to work in --enable-distro --enable-stacksize builds.
2018-05-23 16:24:23 +10:00
Tim
124f45d449 re-upload 2018-05-22 17:45:04 -06:00
Tim
83e67a4197 additional changes made 2018-05-22 17:25:22 -06:00
438f8da11f Merge pull request #1559 from ejohnstown/update-ar
Hush ar warning
2018-05-22 17:22:48 -06:00
Tim
58ac951471 Changes made- Thank you 2018-05-22 16:00:40 -06:00
abf93c9c2c Merge pull request #1575 from quinnmiller1997/Unit_Test
Added unit test for Blake2
2018-05-22 14:22:05 -06:00
Tim
b308fa9a39 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into firstUnitTest 2018-05-22 13:26:45 -06:00
6321008ef4 Modify wc_SignatureGetSize test for ECC and RSA specific API 2018-05-22 13:24:36 -06:00
Tim
d6809c029d First unit test 2018-05-22 13:21:37 -06:00
f2ce8dcbca Added unit test for Blake2 2018-05-22 10:47:44 -06:00
df24bc6096 Update unit test 2018-05-22 09:22:01 -06:00
6cc84d2301 Add initial test_wc_SignatureGetSize() method 2018-05-21 17:11:21 -06:00
be9ae9a3c4 Merge pull request #1570 from MJSPollard/MikePollardBranch
added Poly1305SetKey Unit Test
2018-05-21 16:35:15 -06:00
85511067e4 Added crypto device framework to handle PK RSA/ECC operations using callbacks. Adds new build option ./configure --enable-cryptodev or #define WOLF_CRYPTO_DEV. Added devId support to PKCS7. 2018-05-21 14:31:08 -07:00
1b9cff1c5d Hush ar warning
At some point, ar on Ubuntu started throwing the following warning:

    ar: `u' modifier ignored since `D' is the default (see `U')

Add the "U" option to the ar flags if the version of ar supports it.
(The version used by macOS does not support the flag, for example.) The
AR_FLAGS set in configure will later be used by libtool.
2018-05-21 13:49:20 -07:00
2021bcb188 Merge pull request #1560 from dgarske/ciphernamecleanup
Refactor of the cipher suite names to use single array
2018-05-21 14:24:53 -06:00
e7de654b61 Merge pull request #1558 from dgarske/fsanitize
Fixes for fsanitize reports
2018-05-21 14:18:07 -06:00
2d88e2efe7 Merge pull request #1567 from SparkiDev/intel_64_align
ForceZero - align 64-bit access on Intel 64-bit
2018-05-21 14:16:36 -06:00
fb247a5d8d added null check for key 2018-05-21 13:59:15 -06:00
6e13bfcfce Merge pull request #1571 from aaronjense/unit-test-curve25519
Added unit-test for wc_curve25519_init and wc_curve25519_free
2018-05-21 13:42:11 -06:00
2b49f69f1b updated unit test 2018-05-21 12:44:59 -06:00
f214dbc3dd Removed unneeded call on test_wc_curve25519_init 2018-05-21 11:50:52 -06:00
8197d9ec36 Added unit-test for wc_curve25519_init and wc_curve25519_free in tests/api.c 2018-05-21 10:59:02 -06:00
f447fe22b0 added Poly1305SetKey Unit Test 2018-05-21 10:55:56 -06:00
3a27d85c4e Use sizeof instead of constant value 2018-05-21 21:26:25 +10:00
22078d6811 wc_Sha512 type 2018-05-20 15:50:16 +09:00
da8452ab29 Removed redundant #defines 2018-05-20 14:29:40 +09:00
d347f5ca77 #define SHA384/512 WC_SHA384/512 -> wolfSSL_SHA384/512 2018-05-20 13:55:47 +09:00
d10f0911a4 sHA384, SHA512 conflict with openSSL 2018-05-20 13:55:47 +09:00
874022d938 fix #if conditions and others 2018-05-20 13:55:47 +09:00
153bcb5297 d2i_X509_fp 2018-05-20 13:55:47 +09:00
460becf739 SHA256, SHA384, SHA512 2018-05-20 13:55:47 +09:00
c275dfc5ab X509_STORE_add_crl 2018-05-20 13:55:46 +09:00
4efe8740ad Eliminate d2i_RSAPublicKey test when HAVE_FAST_RSA is enabled 2018-05-20 13:55:46 +09:00
98ef7f43e1 use wolfSSL_X509_CRL_free instead of XFREE 2018-05-20 13:55:46 +09:00
c26bcdd199 Enable RSA_LoadDer with HAVE_FAST_RSA 2018-05-20 13:55:45 +09:00
03d68812a9 Fix #if condition for test 2018-05-20 13:55:45 +09:00
ad71f44f3c suppress i2d_RSAPublicKey with HAVE_FAST_RSA 2018-05-20 13:55:45 +09:00
6cef2e5d31 memory leak in d2i_X509_CRL 2018-05-20 13:55:45 +09:00
76686c9e20 fix error return, i2d_RSAPublicKey 2018-05-20 13:55:44 +09:00
6580a1fefa enable SetBitString, SetASNInt, SetASNIntMP with OPENSSL_EXTRA 2018-05-20 13:55:44 +09:00
5d4c0c582e skip d2i_X509_CRL_fp test. Done locally. 2018-05-20 13:55:44 +09:00
2e4884b6f9 PEM_read_X509_CRL only with HAVE_CRL 2018-05-20 13:55:44 +09:00
f56fd5db00 eliminate dupricated func prototypes 2018-05-20 13:55:44 +09:00
138f9f8f66 add wc_RsaKeyToPublicDer in asn.c when OPENSSL_EXTRA, fix wolfSSL_i2d_RSAPublicKey 2018-05-20 13:55:43 +09:00
03846b2d2d d2i_RSAPublicKey, d2i_X509_CRL, d2i_X509_CRL_fp, X509_CRL_free, PEM_read_X509_CRL 2018-05-20 13:55:43 +09:00
6e697c21d9 Fix the include.am to include aes_asm.S with the correct filename. 2018-05-18 15:02:43 -07:00
cf70b1a013 Revert ForceZero changes in favor of PR #1567. 2018-05-18 05:29:09 -07:00
dd0489db8c 1. Added the pair-wise consistency test to the RSA Key Gen.
2. Modified an RSA key size test case so it didn't try to make a key that was too big.
2018-05-17 17:41:34 -07:00
d63da10c96 ForceZero - align 64-bit access on Intel 64-bit
Test added to ensure ForceZero works.
2018-05-18 10:38:21 +10:00
f67046f485 better bounds checking 2018-05-17 16:55:59 -06:00
d8c33c5551 Fix TCP with Timeout
1. Take out DTLS support from EmbedReceive(). DTLS uses EmbedReceiveFrom().
2. Modify EmbedReceive() to return TIMEOUT if the session is set to blocking mode.
2018-05-17 15:53:38 -07:00
096456f466 Merge pull request #1565 from embhorn/zd3883
wolfSSL_HMAC_Final parameter len should be optional
2018-05-17 13:19:19 -07:00
b973d6e8b1 Fix to handle NO_ERROR_STRINGS case in unit test. The IANA names are disabled when NO_ERROR_STRINGS is defined. 2018-05-17 10:24:02 -07:00
b6a92a97ce convert to byte to fix warning 2018-05-17 08:55:07 -06:00
5cbb9e8341 wolfSSL_HMAC_Final parameter len should be optional 2018-05-17 08:53:21 -05:00
e1745428ac add set short int helper function 2018-05-16 20:16:40 -06:00
8163225180 Refactor of the cipher suite names to use single array, which contains internal name, IANA name and cipher suite bytes. 2018-05-16 15:29:27 -07:00
dad574edb8 Fix to use proper type (size_t) for alignment check. 2018-05-16 14:34:16 -07:00
52b66edf72 Fixes for a few more fsanitize issues. Added alignment for ForceZero. Added word32 aligned acceleration for ForceZeero. Added 'NO_ALIGNED_FORCEZERO' define to allow disabling aligned ForceZero acceleration. We cast the 24 left-shifts to word32 because compiler assumes signed int type, and a runtime value with MSB set results into runtime fsanitize error. 2018-05-16 13:27:13 -07:00
4dacd31ea4 Force to zero the buffer used to generate the DH private key. 2018-05-16 15:47:13 -04:00
6a31f103aa Test Fixes
1. When building on VS, it didn't like using a variable for an array size. Fixed it so it was a constant.
2. In dh.c, there were a few #if that should have been #ifdef.
3. Tweaked a return value in the wolfCrypt test so it was read after being set.
2018-05-16 15:47:13 -04:00
12edf80e2b FIPS Revalidation
1. ForceZero the odd block when using RDSEED to seed the DRBG.
2. When using FIPSv2 and Intel_ASM speedups, force RDSEED failure flag.
3. Annotate the ecc key pair checking code with NIST process references.
4. Add function to pair-wise check the DH key.
5. Add optional "Q" values for the FFDHE canned parameters from RFC 7919.
6. Enabled the ECC key checks by default for FIPS.
7. Added DH private key check function.
8. Enabled the DH key checks by default for FIPS.
2018-05-16 15:47:13 -04:00
ceed6e08fd FIPS Revalidation
1. Add second RNG initialization API to let caller pass in a nonce.
2018-05-16 15:47:13 -04:00
20d8a4a376 FIPS Revalidation
1. Added missing pair-wise consistency test for RSA keys.
Note: This function is not available to old FIPS and user RSA.
2018-05-16 15:47:13 -04:00
1ff4ea1ec9 Test Fixes
1. Changed the ecc_sets table for Windows builds to use arrays instead of pointers to strings.
2. Updated the initializer to play nice with the Windows and not-Windows versions of the ecc_sets table.

This is a change for FIPS mode on Windows. The ecc_sets table has pointers to constants. When the FIPS POST runs, the pointers stored in the table are relocated pointers so the verify fails.
2018-05-16 15:47:13 -04:00
6b6ed2c42f FIPS Revalidation
1. Created a new IDE project directory for WIN10.
2. Reverted the Windows IDE project files.
2018-05-16 15:47:13 -04:00
a8dbdd6c28 Test Fixes
1. Windows IDE project, clean up the preprocessor flags.
2. Add command line define to the MASM steps to set HAVE_FIPS and HAVE_FIPS_VERSION=2.
3. Disable the whole program optimization for the non-DLL builds for the file fips.c.
4. Tweaked the aes_asm.asm's code segment line to be dependant on the FIPS setting. Only place it specially for FIPSv2.
5. Reverted the Windows IDE project and copied the new setting to a WIN10 directory.
2018-05-16 15:47:13 -04:00
4d0a061acb FIPS Revalidation
1. Updated the segment tags in the aes_asm.asm file so that it is linked in order between aes.obj and des3.obj.
2018-05-16 15:47:13 -04:00
3be824ad68 Test Fixes
1. Changed the _InitHmac() function in ssl.c to have a different name.
2. Added switch in ssl.c to use _InitHmac or _HMAC_Init depending on FIPS option.
2018-05-16 15:47:13 -04:00
f7fa648f77 Test Fixes
1. Found a problem in AES-GCM encrypt where it could step on the ciphertext with the correct sized IV.
2018-05-16 15:47:13 -04:00
1538ceef47 FIPS Revalidation
1. Update the Windows project settings.
2018-05-16 15:47:13 -04:00
dde1f87de9 Test Fixes
1. The intrinsic versions of AES_GCM_encrypt and AES_GCM_decrypt needed updates for variable length tags.
2018-05-16 15:47:13 -04:00
6d4777f3ca Test Fixes
1. MSC doesn't allow for inline assembly. Restore the intrinsic version of AES_GCM_encrypt and AES_GCM_decrypt for MSC AES-NI builds. This is lacking AVX.
2018-05-16 15:47:13 -04:00
418cca5efd Test Fixes
1. Something changed in the wolfSSL layer with respect to setting some constants for old FIPS mode, didn't take into account new FIPS mode.
2018-05-16 15:47:13 -04:00
b120a27c3e FIPS Revalidation
1. Update the GenerateSeed() function for RDSEED on Windows to use the intrinsic function instead of inline assembly.
2018-05-16 15:47:13 -04:00
4f1dd3b9a7 Test Fixes
1. Update gitignore with some more VS outputs.
2. Update the Windows IDE user settings with FIPSv2 settings.
3. Remove redundant _InitHmac() function from ssl.c.
4. In wc_DhGenerateParams(), initialize the groupSz and bufSz to 0.
5. In wc_DhExportParamsRaw(), initialize pLen, qLen, and gLen to 0.
6. In wc_MakeRsaKey(), initialize isPrime to 0.
7. In ecc_test_make_pub(), initialize exportBuf and tmp to NULL and initialize the ECC key before any chance of trying to free it.
8. In fips_test.h header, update types.h include to use the wolfCrypt types rather than ctaocrypt types.
9. In fips_test.h header, change the visibility tags on all the function prototypes to use the WOLFSSL tags rather than CYASSL.
10. Change the wolfCrypt visibility tags to use CyaSSL's tags for old FIPS and the regular tags for new FIPS and non-FIPS builds.
2018-05-16 15:47:13 -04:00
eea4d6da50 Test Fixes
1. Modify RSA-PSS to be able to sign and verify SHA-384 and SHA-512 hashes with 1024-bit RSA keys.
2018-05-16 15:47:12 -04:00
dc31dbaeaf FIPS Revalidation/Test Fixes
1. Added APIs to perform RSA-PSS verify and padding operation in the same call.
2. Change to RsaPSS sign and verify to pick the proper salt length if the key is 1024-bits and the hash is SHA-512.
2018-05-16 15:47:12 -04:00
27470aa704 FIPS Revalidation/Test Fixes
1. For FIPSv2 builds, changed the FP_MAX_BITS to 6144.
2. Fixed bug in HMAC-SHA-3 where the digest size was being used instead of the block size for processing the key.
2018-05-16 15:47:12 -04:00
8fb3a0c078 FIPS Revalidation
1. Add a copy of the DSA parameter generation function to DH for use without DSA.
2018-05-16 15:47:12 -04:00
6796ab5f8c FIPS Revalidation
1. Bug fixes to AES-GCM. Separated out the internal and external IV set functions.
2018-05-16 15:47:12 -04:00
c2f964039e FIPS Revalidation
1. Updated the configure.ac to add in the RSA direct function to FIPS builds
2018-05-16 15:47:12 -04:00
6d7599cf47 FIPS Revalidation
1. Add new APIs for AES-GCM so it can manage the IV per SP 800-38D.
2. Add new APIs for AES-CCM so it can manage the IV, similar to the behavior in AES-GCM.
3. Add new APIs for GMAC that use the new AES-GCM APIs.
2018-05-16 15:47:12 -04:00
4ba026c0bf Test Fixes
1. Added error code for ECDHE FIPS KAT failure.
2018-05-16 15:47:12 -04:00
19da916102 Test Fixes
1. Removed redundant forward declaration of RsaKey from hmac.h.
2. Updated gitignore with the first and last files.
3. Updated autogen with touching the first and last files.
2018-05-16 15:47:12 -04:00
3685b7b176 Test Fixes
1. AesGcmEncrypt_ex requires the RNG, remove function if RNG disabled.
2. Fix a couple function name changes in the example server.
3. Removed the old FIPS wrapping added to dh.h, was redundant.
4. Move include of random.h in the aes.h file.
5. Fix where ecc.c was being left out of old FIPS builds.
6. Exclude the AES-GCM internal IV test case when building without the RNG.
7. Fix api test where AES-GCM Encrypt was called with a too-long IV in old FIPS mode. Non-FIPS and new FIPS are allowed longer IVs.
2018-05-16 15:47:12 -04:00
13ff245166 FIPS Revalidation
1. AES-GCM encrypt IV length allowed to be 8-bits.
2018-05-16 15:47:12 -04:00
90a5bde0f2 FIPS Revalidation
1. Update the const data and code segment tags for the Windown builds.
2018-05-16 15:47:12 -04:00
4b3933aa1b FIPS Revalidation
1. Enabled ECC Cofactor DH for the FIPSv2 build.
2. Updated the wolfCrypt HMAC-SHA-3 test to leave out the set of test cases that use the four-byte key in FIPS mode.
2018-05-16 15:47:12 -04:00
33040a25d8 FIPS Revalidation
1. Change to configure.ac to automatically enable HKDF in FIPSv2 builds.
2018-05-16 15:47:12 -04:00
d0d2527950 FIPS Revalidation
1. Change to configure.ac to automatically enable AES-CTR in FIPSv2 builds.
2. Move the aes-ni asm file into the boundary if enabled.
3. Enable AES-ECB by default.
2018-05-16 15:47:12 -04:00
4bcd7b7986 AES-GCM
1. Updated the wolfCrypt GMAC test to leave out the test case with the 15-byte tag when building for FIPS.
2. Replace tabs with spaces.
2018-05-16 15:47:12 -04:00
eb1a76bf2a FIPS Revalidation
1. Updated CMAC to allow tag length from 4 to 16 bytes, inclusive.
2018-05-16 15:47:12 -04:00
aa968eac98 FIPS Revalidation
1. Enable SHA-224 by default if building for FIPSv2.
2018-05-16 15:47:12 -04:00
fe8d46da95 FIPS Revalidation
1. Added new AES-GCM Encrypt API for FIPS where the IV is generated internally.
2. Fix the AES-NI guard flags so it can be used when FIPS enabled.
2018-05-16 15:47:12 -04:00
be61204fd7 FIPS Revalidation
1. Added CMAC to the boundary.
2. Added DHE to the boundary.
2018-05-16 15:47:12 -04:00
f6fe3744a7 FIPS Update
1. Moved the rest of the FIPS algorithms to FIPSv2.
2. Updated the fips-check and autogen scripts.
3. Updated the automake include for the crypto files.
4. Updated the example server to use the wolfSSL API and wolfSSL-based OpenSSL compatibility layer.
5. Added error code for the SHA-3 KAT.
6. Updated an test case in the API test for AES-GCM encrypt that is now considered a success case, but the FIPS mode was still treating as a failure.
2018-05-16 15:47:12 -04:00
df4d748f59 FIPS Update
1. Move SHA-224 and SHA-256 into FIPSv2.
2. Move HMAC into FIPSv2.
3. Move Hash_DRBG into FIPSv2.
2018-05-16 15:47:12 -04:00
6352208e04 FIPS Update
1. Add SHA-3 to the src/include.am so that it is always included in FIPSv2.
2. Tweak the SHA-3 header to follow the new FIPS pattern.
2018-05-16 15:47:12 -04:00
0c5d704c7f AES-CCM FIPS
1. Add new error code for the AES-CCM FIPS KAT failure.
2. When enabling FIPSv2, force enable AES-CCM.
2018-05-16 15:47:12 -04:00
d373844a18 fix sequence with pkcs12 shrouded keybag creation 2018-05-16 10:16:15 -06:00
8ff328cb39 Merge pull request #1551 from dgarske/asynccheck
Added new `async-check.sh` script
2018-05-16 08:02:11 -07:00
b5e0499022 Merge pull request #1550 from dgarske/rsaverify
Check returned size matches signature size for RSA verify in openssl compatibility
2018-05-16 08:00:31 -07:00
bbc178a704 Merge pull request #1548 from JacobBarthelmeh/Testing
fix ecc public key print with X509 print function
2018-05-16 07:59:19 -07:00
8619062ae7 Merge pull request #1522 from dgarske/mbedtls_compat
Port for using AWS FreeRTOS
2018-05-16 07:57:55 -07:00
1be8a6e4ef Merge pull request #1502 from ejohnstown/update-m4
Update M4 Autoconf Files
2018-05-16 07:57:13 -07:00
566bb4cefe version for PBE SHA1 DES oid 2018-05-16 08:38:50 -06:00
1ca62ee0a1 add error return for unsuported version 2018-05-15 22:51:11 -06:00
f021375c4b Fixes for fsanitize reports. 2018-05-15 17:23:35 -07:00
a6ad6b94d1 account for IGNORE_NAME_CONSTRAINTS when testing the parsing of a relative URI 2018-05-14 16:03:51 -06:00
63a0e872c5 add test for fail case when parsing relative URI path 2018-05-14 14:27:02 -06:00
9c33244158 Update ax_pthread.m4
The AX_PTHREAD macro has a check for side-effects of the pthread flag beyond the functions being available. It also checks for a particular macro being set when compiling the test file. When running the build through the scan-build static analysis, for some reason, the check value isn't set. The build fails. I commented the check out for now.
2018-05-11 17:39:51 -07:00
2a4d386a50 Update ax_pthread.m4
1. Updated to the most recent copy of ax_pthread.m4.
2. Removed the darwin-clang check m4.
3. Added a check to see if AX_PTHREAD added the flag `-Qunused-arguments` for clang and if so prepend `-Xcompiler` so libtool will use it. Otherwise when building on Sierra's clang you get "soft" warnings on the build of the dylib.
2018-05-11 10:21:47 -07:00
83257d662a Also check returned size matches for RSA verfiy in openssl compatability layer. 2018-05-11 17:09:07 +02:00
af9507391a Fixes and improvements for FreeRTOS AWS. Fixes for building openssl compatibility with FreeRTOS. Fixes for TLS 1.3 possibly uninitialized vars. 2018-05-11 16:40:32 +02:00
cb2f1d6d7d Added new async-check.sh script for setting up the async simulator for internal testing. 2018-05-11 16:38:24 +02:00
7a4da340d4 Merge pull request #1547 from JacobBarthelmeh/Docs
add aes init function to docs
2018-05-09 16:40:36 -07:00
110c41613f cast on return of malloc 2018-05-09 14:50:26 -06:00
d1192021a5 alter search behavior for testing if URI is a absolute path 2018-05-09 14:43:52 -06:00
c910d84507 Merge pull request #1527 from kojo1/RenesasCSPlus
Renesas CS+ projects
2018-05-09 10:07:16 -06:00
66e59e4a6a Rollback #if condition 2018-05-09 10:58:10 +09:00
bb979980ca add test case for parsing URI from certificate 2018-05-08 16:24:41 -06:00
4ee957afa3 fix for relative URI detection 2018-05-08 10:19:51 -06:00
4f0893bda5 fix ecc public key print with X509 print function 2018-05-07 14:16:27 -06:00
fd691a5795 add aes init function to docs 2018-05-07 10:24:44 -06:00
08165d5a16 Merge pull request #1540 from SparkiDev/tls13_ticket_fix
NewSessionTicket parsing error fix
2018-05-04 10:54:23 -07:00
0fec651338 Merge pull request #1539 from cconlon/toradix
expose mp_toradix() when WOLFSSL_PUBLIC_MP is defined
2018-05-04 10:49:21 -07:00
6e5258b56e Merge pull request #1538 from dgarske/fixmatchdomainnull
Fix for handling match on domain name that may have a null terminator inside
2018-05-04 10:25:28 -07:00
ecd2e75564 #ifndef FREESCALE_LTC_ECC with fe_init 2018-05-04 07:34:47 +09:00
69ce10f292 NewSessionTicket parsing error fix 2018-05-04 08:18:54 +10:00
3fd47bdff3 Fix for example client/server with -H exitWithRet option to make sure all cleanup is performed. Resolves valgrind report due to TicketCleanup() not being called. 2018-05-03 13:39:37 -07:00
bb7bcfd877 expose mp_toradix() when WOLFSSL_PUBLIC_MP is defined 2018-05-03 13:41:23 -06:00
a2fa61cd3d Merge pull request #1534 from SparkiDev/tls13_static_rsa
Fix TLS 1.3, change Client Hello version to work with static RSA (TLS 1.0 - TLS 1.2)
2018-05-03 12:38:55 -07:00
1c09c06349 Merge pull request #1533 from SparkiDev/tls13_draft26
Allow building TLS 1.3 at draft 26
2018-05-03 12:37:39 -07:00
74618d0e3c Merge pull request #1532 from SparkiDev/test_fix
Fixes for tests
2018-05-03 11:44:01 -07:00
73d85774df Merge pull request #1525 from dgarske/sockclose
Cleanup of the socket close code
2018-05-03 11:42:30 -07:00
325402cf5a Minor fix for the expected failure case use of ssl after free. Renamed skipExit to exitWithRet. 2018-05-03 10:02:59 -07:00
89a4c98670 * Added support for expected fail test cases with example client/server and suites unit test.
* Added test for certificate with bad alt name containing a null character mid byte stream.
* Fix for issue with suites unit test where last arg in file doesn't conain data for a param, causing it to skip test.
* Fix for last test in tests/test.conf not being run for `TLSv1.2 RSA 3072-bit DH 3072-bit`.
* Moved the `tls-cert-fail.test` tests into the new expected failure suite test (`./tests/test-fails.conf`). Now it explicilty checks RSA and ECC for the no signer and no sig tests.
2018-05-03 09:40:51 -07:00
d43aa37041 Fix for handling match on domain name that may have a null terminator inside. The check should match on len from ASN.1 reguardless of a null character. 2018-05-03 09:33:05 -07:00
996ee78d50 Fix Client Hello version to work with static RSA 2018-05-02 10:20:55 +10:00
d60b16c5b8 Merge pull request #1531 from kaleb-himes/FIPS-CHECK-SCRIPT
revert to default but exclude for sgx/netos
2018-05-01 15:14:00 -06:00
27c3a70e13 Allow building TLS 1.3 at draft 26 2018-05-01 15:19:18 +10:00
5845482fc0 Fixes for tests
Fix the benchmark client to set all groups supported.
Fix TLS 1.3 test script to work on PPC - check counter in separate test.
2018-05-01 14:27:38 +10:00
c5a39b9048 rever to default but exclude for sgx/netos projects 2018-04-30 15:17:58 -06:00
65eb79e5cd Merge pull request #1519 from dgarske/buildfixes
Build fixes for a few configurations
2018-04-30 11:49:16 -07:00
d53716496a Merge pull request #1521 from dgarske/tlsx_returncodes
Refactor of the TLSX code to support returning error codes
2018-04-30 11:46:41 -07:00
3ad708fb20 Merge pull request #1514 from dgarske/certdates
Enhancements and cleanup to ASN date/time
2018-04-30 11:14:38 -07:00
8311628f93 Merge pull request #1508 from kaleb-himes/FIPS-CHECK-SCRIPT
Fips check script
2018-04-30 10:50:03 -07:00
4c5982949e minor fix 2018-04-28 13:25:41 +09:00
7de23d65ce Merge pull request #1517 from dgarske/sighash
Added new signature wrapper functions to allow use of hash directly
2018-04-27 16:07:56 -07:00
6e96318785 Readme.txt 2018-04-28 06:36:56 +09:00
8ef777315a Merge pull request #1516 from dgarske/gccarm
GCC-ARM IDE example improvements
2018-04-27 14:13:45 -07:00
e69af98a7e fix warnings 2018-04-28 06:06:45 +09:00
3e9028387f test project 2018-04-28 05:46:42 +09:00
c5df9d56ad wolfssl_lib project 2018-04-28 05:39:42 +09:00
ac791610dd USE_WOLF_TIMEVAL_T 2018-04-28 05:28:49 +09:00
22a2b45108 duplicated fe_init for non-configure based IDE 2018-04-28 05:07:00 +09:00
a91ac55e24 define valiable before exec statements 2018-04-28 05:05:45 +09:00
2cc2f224f8 XTIME in LowResTimer 2018-04-28 05:03:51 +09:00
e9dd44a667 Merge pull request #1524 from abrahamsonn/master
Doxygen landing page update
2018-04-27 11:44:00 -07:00
3200040d1a Cleanup of the socket close code used for examples, CRL/OCSP and BIO. Now only a single macro is responsible for closing a socket CloseSocket and all duplicate code is eliminated. 2018-04-27 10:29:19 -07:00
9424a96289 Doxygen landing page update 2018-04-27 10:56:13 -06:00
e45f0efc3f Documentation Fixes (#1520)
* Fixed documentation errors found by check_api script
* Formatting changes so that comments/API pairs are more obvious
2018-04-27 09:50:34 -07:00
5c97374156 Fix for RSA RSS check to make sure RSA is enabled. Added TLS 1.3 DH check for key sizes. 2018-04-26 14:04:54 -07:00
ef7b40dcab Refactor of the TLSX code to support returning error codes.
* The `SANITY_MSG_E` responses in `TLSX_SupportedVersions_GetSize`, `TLSX_SupportedVersions_Write`, `TLSX_Cookie_GetSize` and `TLSX_Cookie_Write` would incorrectly be handled.
* Added build-time checks in `tls13.c` for dependencies on `HAVE_HKDF` and `WC_RSA_PSS`.
2018-04-26 11:30:57 -07:00
fe4cbb2a03 Fix for Jenkins report Expected Configurations Test - NIGHTLY BUILD #267, building ./configure --disable-asn --disable-ecc --disable-rsa --enable-psk --enable-sni. Reported unused variables, parameters and function. 2018-04-26 05:47:48 -07:00
04626c6a1f Fixes build issue using wrong DES define for WC_MAX_SYM_KEY_SIZE macro. Reproduced using ./configure --enable-leanpsk --enable-des3. Fixes issue #1518. 2018-04-26 05:35:04 -07:00
fc02003f76 Added new signature wrapper functions to allow direct use of hash wc_SignatureVerifyHash and wc_SignatureGenerateHash. These new function abstract existing signature wrapper code, so minimal code size increase. Added test cases for new functions for RSA (with and without DER encoding) and ECC. 2018-04-25 13:10:53 -07:00
c1d4f659ad Merge pull request #1511 from ejohnstown/dist-tweak
Make Dist Automation Tweak
2018-04-25 10:56:40 -07:00
107290b552 Merge pull request #1515 from dgarske/buildfixes
Fixes for various build configurations
2018-04-25 10:23:27 -07:00
5c61810d4d Merge pull request #1497 from SparkiDev/tls13_draft28
Tls13 draft28
2018-04-25 10:17:37 -07:00
a9f32c30da Fix for SGX build after C99 changes strings.h: No such file or directory. 2018-04-25 07:56:54 -07:00
3c684886ad Fixes to resolve building --enable-tls13 --disable-ecc --enable-curve25519 --enable-ed25519. 2018-04-25 07:54:53 -07:00
089e1b6b9b Fix for expected Configurations Test - NIGHTLY BUILD #265 and ifdef cleanup. 2018-04-25 07:54:53 -07:00
2e6c195b43 GCC-ARM IDE improvements:
* Added documentation for `ECC_USER_CURVES`.
* Added option for RSA PSS padding support.
2018-04-24 15:26:53 -07:00
65c9277213 More fixes from Jenkins testing. 2018-04-24 14:01:33 -07:00
ff1559275d Merge pull request #1512 from dgarske/c99
Fixes to resolve issues with c99 compliance
2018-04-24 13:36:41 -07:00
1ddccf63dc Merge pull request #1496 from JacobBarthelmeh/Compatibility-Layer
Compatibility layer
2018-04-24 13:33:33 -07:00
e63afa08bd Fix a couple of minor Jenkins issues. 2018-04-24 13:25:28 -07:00
56025f38b9 Enhancements and cleanup to ASN date/time:
* Refactor the ASN get date logic to combine shared code.
* Added new API `wc_GetDateInfo` to get raw date, format and length.
* Added new API `wc_GetCertDates` to extract certificate before/after dates as `struct tm` type.
* Added new API `wc_GetDateAsCalendarTime` which parses the raw date string and convers to `struct tm`.
* Added tests for new API's.
* Added missing tests for `wc_SetAltNames`, `wc_SetAltNamesBuffer` and `wc_SetDatesBuffer`.
* Fixed build for older `NO_TIME_H` macro.
2018-04-24 13:04:36 -07:00
b48a9ded15 Fix to allow user to force build using WOLF_C99 option. 2018-04-23 13:52:58 -07:00
289a282183 Fixes to resolve issues with c99 compliance (building with ./configure CFLAGS="-std=c99").
* Fix for ReadDir checking for file flag to use `S_ISREG(ctx->s.st_mode)` syntax.
* Added macro for strsep `XSTRSEP`. Added wolf implementation as `wc_strsep` enabled as C99 or `USE_WOLF_STRSEP`.
* Fix to use `gethostbyname` for c99 instead of `getaddrinfo`.
* For c99 use wolf strtok `wc_strtok`.
* Exposed API's for `wc_strtok` and `wc_strsep` when available.
* Include `sys/time.h` when available from autocon `HAVE_SYS_TIME_H` or c99.
* include `<strings.h>` when `HAVE_STRINGS_H` or c99.
2018-04-23 13:47:22 -07:00
568d24c63c Coverity fixes (#1509)
* Coverity fixes 3
2018-04-23 09:20:28 -07:00
9831a8ac94 Added a dist-hook target to the Makefile to copy the default options.h.in over options.h. 2018-04-20 11:07:57 -07:00
7d425a5ce6 Added support for an anonymous cipher suite (#1267)
* Added support for cipher suite TLS_DH_anon_WITH_AES256_GCM_SHA384
* Added test cases for verification of anonymous cipher suite
2018-04-20 10:35:37 -07:00
853756a73c Added a TLS alert message 115 (#1391)
Added a new TLS alert message `unknown_psk_identity` (115) from RFC 4279,  section 2.
2018-04-20 10:23:57 -07:00
94157634e1 TLS 1.3 fixes/improvements
Support Draft 28: able to compile code to return BAD_BINDER if no PSKs
match and certificates not to be used.
Change key share implementation to use server preference - server now
checks each client key share's group is in supported_groups extension.
Client and server examples modified to support server preference.
Application can set client's and server's supported groups by rank.
Server's supported groups is sent back in encrypted_extensions if
preferred group is not in client's list - able to be turned off at
compile time.
Application can query server's preferred group from client.
Able to compile using 0x0304 as version instead of draft version.
Fix state machine in TLS 1.3 to support unexpected hello_retry_request.
Also fixes non-blocking.
Fix resumption to use the named group from session.
Fix named group in session structure to be a 2-byte field.
Better detection of errors in message flow.
Fix DoTls13ClientHello when downgrading - don't do TLS 1.3 things.
Not downgrading on client fixed.
Downgrade protocol version from TLS 1.3 when not TLS 1.3 ciphersuite.
Get downgrading from TLS 1.3 and resumption working.
Change earlyData value to an enum.
Support no extensions data (as opposed to zero length extension data) in
TLS 1.3 ClientHello.
Check PSK cipher suite is available to both client and server before
using.
Check first PSK identity chosen when server says it is using early data
at client.
Check PSK extension is last in client_hello on server.
Check the PSK cipher suite to use is supported on client.
Check the returned cipher suite for pre-shared keys is the same as
client expects.
Send alert decrypt_error when verification fails in certificate_verify
or finished message doesn't match calculated value.
Fail when certificate messages recieved in handshake when using PSK.
Validate on the server that EndOfEarlyData message has been recieved
before finished message when server sent EarlyData extension.
2018-04-20 09:44:02 +10:00
3476a9b55a versions for Baxter updated, new tag in fips v3.12.6 2018-04-19 15:24:22 -06:00
9e4bb3fee1 Merge pull request #1504 from SparkiDev/nginx-pemenc
Key derivation for encrypted PEM uses salt length of 8 in OpenSSL
2018-04-19 11:23:39 -07:00
f7cb5c5c15 Merge pull request #1507 from kaleb-himes/README-update
Bring special notes inline with commit 8edbca1b21b6fcd6d09910c66bbf35…
2018-04-19 11:17:25 -07:00
b7c61a72c8 Merge pull request #1503 from kojo1/Ticket3793
HMAC with SHA2
2018-04-19 09:38:55 -06:00
23615dd15f Bring special notes inline with commit 8edbca1b21 2018-04-18 09:58:03 -06:00
bf950198f2 api.c: option conditions 2018-04-18 13:02:40 +09:00
6689ee965a Key derivation for encrypted PEM uses salt length of 8 in OpenSSL 2018-04-18 12:37:06 +10:00
7c7913264b remove printf 2018-04-18 09:25:24 +09:00
56af3a5b36 add HMAC SHA2 2018-04-18 08:47:39 +09:00
57d40bc6d1 remove internal data types in ssl.h 2018-04-17 15:57:23 -06:00
11065f9222 added the missing macro file ax_require_defined.m4. 2018-04-17 13:23:17 -07:00
48b3aa90d3 Update autoconf m4 files, except pthreads which should be its own commit 2018-04-17 13:20:33 -07:00
a116b5ba83 Merge pull request #1500 from BrianAker/patch-1
Adding Copyright notice to autoconf files.
2018-04-17 11:15:36 -07:00
09706a4ed2 Merge pull request #1488 from SparkiDev/tls13_perf
Changes for interop and performance
2018-04-16 09:16:13 -07:00
3179d6ce2b Adding Copyright notice to autoconf files. 2018-04-14 22:30:02 -10:00
942c720dc4 Merge pull request #1499 from ejohnstown/aes-asm
AES assembly file name change
2018-04-13 11:23:03 -07:00
e895bacbba update before/after dates with certificates 2018-04-13 09:31:32 -06:00
f9eda5d790 free test certificate after use 2018-04-13 09:16:22 -06:00
a0d8327320 Coverity fixes 2 (#1493)
* Coverity fixes for wolfcrypt folder
* Fixes for remaining issues
* Fixes for test files
2018-04-13 05:35:18 -07:00
9600266483 WOLFSSL_FUNC_TIME changes
Warning in code about using this define.
Remove usage of WOLFSSL_FUNC_TIME from server.c.
2018-04-13 12:13:31 +10:00
0b47811c46 Changes for interop and performance
Changes made to test.h to allow interop of PSK with OpenSSL.
Changes to allow server to pre-generate key share and perform other
operations at later time.
Fix ChaCha20 code header to have bigger state to support assembly code
for AVX1.
Fix Curve25519 code to use define instead.
Change Curve25519 to memset all object data on init.
Change Poly1305 to put both sizes into one buffer to avoid a second call
to wc_Poly1305Update().
Added WOLFSSL_START and WOLFSSL_END API and calls to show time of
protocol message function enter and leave to analyse performance
differences.
Moved Curve25519 code in KeyShare extension out of general ECC code.
2018-04-13 12:01:20 +10:00
425cee64a7 AES assembly file name change
Some versions of GCC on the Mac will not run the file aes_asm.s through the preprocessor. There are some ifdefs in the file that are included when they shouldn't be. This is not a problem on Linux. Renaming the file to have a capital S extension forces the assembler to run with the preprocessor.
2018-04-12 16:47:58 -07:00
84f7bd8cde Merge pull request #1494 from dgarske/wpas
Fix for building wpa_supplicant
2018-04-12 13:49:31 -07:00
eacd98fe4e Merge pull request #1491 from dgarske/config
Configure improvements and new options
2018-04-12 13:48:20 -07:00
8f1e8be2d0 Merge pull request #1490 from dgarske/hashoid_cleanup
Hash OID cleanup
2018-04-12 13:46:47 -07:00
cfaed48f90 adjust GetInt call with ASN1 integer to big number 2018-04-12 14:40:20 -06:00
df06707496 Handle larger values with ASN1 INTEGER structure 2018-04-12 14:07:29 -06:00
cf1230d232 Fix for building wpa_supplicant (./configure --enable-wpas) after PemToDer refactor in PR #1467. 2018-04-12 06:53:44 -07:00
1f7b954d47 Fix for wc_GetCTC_HashOID in FIPS mode. Uses the new wc_HashTypeConvert to handle conversion from unique WC_ALGO (int) to WC_HASH_TYPE_ALGO (enum wc_HashType). 2018-04-12 06:51:23 -07:00
ce6728951f Added a new --enable-opensslall option, which ensures all openssl features are enabled. Documented and tested building the various open source defines we support in our build. 2018-04-11 13:54:07 -07:00
689203d310 Added some more features to the --enable-all. Added new --enable-webclient option. 2018-04-11 13:54:07 -07:00
ee5d78f84f Added new wc_OidGetHash API for getting the hash type from a hash OID. Refactor PKCS7 and PKCS12 to use new API and reduce duplicate ocde. Updated wc_GetCTC_HashOID to use wc_HashGetOID and maintain back compat. 2018-04-11 13:53:30 -07:00
d85580691b Merge pull request #1492 from dgarske/fix_noasn_pwdbased
Fixes for ASN disabled and PWDBASED enabled / Win FIPS
2018-04-11 12:09:30 -07:00
83bfdb1594 Fix for issue with unique hash types on ctoacrypt FIPS using different values than WC_HASH_TYPE_*. Add new API wc_HashTypeConvert to handle the conversion between enum wc_HashType and int. For FIPS it uses a switch() to convert and for non-FIPS it uses a simple cast. Changed the pwdbased_test to return actual ret instead of adding values (made it difficult to track down error location). 2018-04-11 09:30:30 -07:00
3f3e332a3a Fix for evp.c statement will never be executed in wolfSSL_EVP_CIPHER_CTX_block_size. 2018-04-11 08:18:39 -07:00
38aa56cc40 Fix for Windows FIPS build in current master. Resolves issue with missing DES/AES key size enums. 2018-04-10 20:07:14 -07:00
565f394972 Fix for building without ASN and PWDBASED enabled (./configure --disable-asn --enable-pwdbased). 2018-04-10 16:36:11 -07:00
e25da80766 Merge pull request #1467 from dgarske/asnpemtoder
PEM Encrypted Keys cleanup and PemToDer move to wolfCrypt asn.c
2018-04-09 16:33:30 -07:00
a38576146e * Added support for disabling PEM to DER functionality using WOLFSSL_PEM_TO_DER. This allows way to use with DER (ASN.1) certificates only in an embedded environment. This option builds, but internal make check requires PEM support for tests.
* More cleanup to move PEM functions from ssl.c to asn.c (`wolfSSL_CertPemToDer`, `wolfSSL_KeyPemToDer`, `wolfSSL_PubKeyPemToDer`). Renamed these API's to `wc_` and added backwards compatability macro for old function names.
2018-04-09 13:28:15 -07:00
5a46bdf6f6 Added unit test for using encrypted keys with TLS. Only works with --enable-des3, since the keys are all encrypted with DES3 (also requires either --enable-opensslextra or --enable-enckeys). 2018-04-09 13:28:15 -07:00
d68a6fb4c7 Make sure wc_encrypt.h includes the ciphers. 2018-04-09 13:28:15 -07:00
98c186017a Fixes for build failures. Added new WC_MAX_SYM_KEY_SIZE macro for helping determine max key size. Added enum for unique cipher types. Added CHACHA_MAX_KEY_SZ for ChaCha. 2018-04-09 13:28:15 -07:00
2c72f72752 Fixes for FIPS, sniffer (w/o enc keys), scan-build issues and backwards compatability. 2018-04-09 13:28:15 -07:00
9be11bf62c Fix to correct missing wolfSSL_EVP_BytesToKey header int he NO_MD5 case. 2018-04-09 13:28:15 -07:00
1f00ea2115 Fixes for various build issues with type casting and unused functions. Moved mystrnstr to wc_port.c. Added some additional argument checks on pwdbased. 2018-04-09 13:28:15 -07:00
e60032b961 Fix for duplicate API defs. 2018-04-09 13:28:15 -07:00
b01535b483 Fix for stray character. 2018-04-09 13:28:15 -07:00
8a31f13cb6 Remove obsolete WOLFSSL_PEMPUBKEY_TODER_DEFINED header logic. 2018-04-09 13:28:15 -07:00
6de8348918 Fixes for various build configurations. Added --enable-enckeys option to enable support for encrypted PEM private keys using password callback without having to use opensslextra. Moved ASN CryptKey function to wc_encrypt.c as wc_CryptKey. Fixup some missing heap args on XMALLOC/XFREE in asn.c. 2018-04-09 13:28:15 -07:00
1315fad7dc Added ForceZero on the password buffer after done using it. 2018-04-09 13:28:15 -07:00
3a8b08cdbf Fix to move the hashType out of EncryptedInfo. Fix for parsing "DEC-Info: ". Fix for determining when to set and get ivSz. 2018-04-09 13:28:15 -07:00
c83e63853d Refactor unqiue hash types to use same internal values (ex WC_MD5 == WC_HASH_TYPE_MD5). Refactor the Sha3 types to use wc_ naming. 2018-04-09 13:28:15 -07:00
264496567a Improvements to EncryptedInfo. Added build option WOLFSSL_ENCRYPTED_KEYS to indicate support for EncryptedInfo. Improvements to wc_PBKDF1 to support more hash types and the non-standard extra data option. 2018-04-09 13:28:15 -07:00
f9e830bce7 First pass at changes to move PemToDer into asn.c. 2018-04-09 13:28:14 -07:00
2ded38ec2b Merge pull request #1485 from dgarske/tlskeygeneccorcurve
Fix TLS 1.3 with ED25519/CURVE25519 enabled and ECC disabled
2018-04-09 12:12:31 -07:00
21833e245f Fix TLS 1.3 with ECC disabled and CURVE25519 enabled. Resolves issue with using ./configure --disable-ecc --enable-curve25519 --enable-ed25519 --enable-tls13. Refactor TLSX_KeyShare_GenEccKey to support either ECC or CURVE25519. Fix for PemToDer to handle ED25519 without ECC enabled. 2018-04-09 10:10:08 -07:00
2a460d3d05 Merge pull request #1484 from embhorn/coverity
Coverity fixes
2018-04-06 18:18:38 -07:00
36b9b0b558 Updates from code review 2018-04-06 17:29:27 -05:00
86767e727c Fixes for CID 185033 185028 185142 185064 185068 185079 185147 2018-04-06 13:15:16 -05:00
d2c1a1906d Fixes for CID 184980 185017 185047 185167 2018-04-06 11:10:37 -05:00
6090fb9020 Merge pull request #1483 from dgarske/winvs
Fixes for unused `heap` warnings
2018-04-06 09:01:49 -07:00
e56209cee4 Merge pull request #1482 from dgarske/nourand
Added new define `NO_DEV_URANDOM` to disable the use of `/dev/urandom`
2018-04-06 09:00:37 -07:00
920e6ed911 Fix warning in ssl.c 2018-04-06 09:30:54 -05:00
c6ad885459 Coverity fixes for tls.c/n CID 184996 185112 185122 2018-04-06 09:08:00 -05:00
ec429e50b1 Fixes for ssl.c 2018-04-06 07:45:12 -05:00
426335b68f Found additional VS unused heap warnings. Replace tabs with 4-spaces. 2018-04-05 12:28:32 -07:00
2b48a074eb Merge pull request #1480 from dgarske/extcache
Fix for HAVE_EXT_CACHE callbacks not being available without OPENSSL_EXTRA
2018-04-05 10:52:44 -07:00
bab62cc435 Added new define NO_DEV_URANDOM to disable the use of /dev/urandom. Added better named define WC_RNG_BLOCKING to indicate block w/sleep(0) is okay. 2018-04-05 09:34:43 -07:00
ede006b3e1 Merge pull request #1479 from JacobBarthelmeh/HardwareAcc
Fix PIC32 AES-CBC and add test case
2018-04-05 09:15:08 -07:00
5439402c1d Refactor for max record size (#1475)
* Added new internal function `wolfSSL_GetMaxRecordSize`.
* Modified tls_bench to use dynamic buffer based on max record size.
* Added comment for DTLS maxFragment calculation.
2018-04-05 09:11:58 -07:00
412d4d76ee Fix for HAVE_EXT_CACHE callbacks not being available without OPENSSL_EXTRA defined. Added tests for external cache callbacks. 2018-04-05 07:10:04 -07:00
a1d6bc68de Merge pull request #1478 from dgarske/fixeccmaxsize
Fix for ECC max bits
2018-04-04 16:27:15 -07:00
815219b589 fix pic32 AES-CBC and add test case 2018-04-04 16:09:11 -06:00
bc76f57959 Fix for ECC max bits ( MAX_ECC_BITS). 2018-04-04 13:39:14 -07:00
a78c6ba4ea Fix for unused heap warnings. 2018-04-04 12:51:45 -07:00
aa660bc9b8 Merge pull request #1477 from dgarske/fix_strtok
Fix for issue with `wc_strtok` function declaration
2018-04-04 12:35:38 -07:00
2189827287 Fix for issue with wc_strtok function declaration not being available because of include order. Fixes issue #1469. 2018-04-04 10:41:14 -07:00
0da4a8f1fe Merge pull request #1476 from dgarske/fix_haveextcache
Fix building with `HAVE_EXT_CACHE` when `OPENSSL_EXTRA` is not defined
2018-04-04 10:34:07 -07:00
2deb977ecf Merge pull request #1473 from dgarske/pkcs7_norsa
Enabled PKCS7 support without RSA
2018-04-04 10:33:11 -07:00
960d2ec031 Merge pull request #1471 from JacobBarthelmeh/Fuzzer
sanity check on buffer read
2018-04-04 10:31:55 -07:00
1196a3b64d Merge pull request #1455 from dgarske/nitroxv
Nitrox V fixes and additions
2018-04-04 10:27:53 -07:00
5702e8ee48 Fix building with HAVE_EXT_CACHE when OPENSSL_EXTRA is not defined. Fixes issue #1474. 2018-04-04 09:02:52 -07:00
c288d0815d Added support for building and using PKCS7 without RSA (assuming ECC is enabled). 2018-04-03 09:26:57 -07:00
0c898f513d Nitrox V fixes and additions:
* Added support for ECC, AES-GCM and HMAC (SHA-224 and SHA3).
* Fixes for Nitrox V with TLS.
* ECC refactor for so key based `r` and `s` apply only when building with `WOLFSSL_ASYNC_CRYPT`.
* ECC refactor for `e` and `signK` to use key based pointer for Nitrox V.
* Improved the Nitrox V HMAC to use start, update and final API's instead of caching updates.
* Fix for Intel QuickAssist with unsupported HMAC hash algos using `IntelQaHmacGetType` (such as SHA3).
* Added new API `wc_mp_to_bigint_sz` to zero pad unsigned bin.
* Fix for AES GCM to gate HW use based on IV len in aes.c and remove the gate in test.c.
* Implemented workaround to use software for AES GCM Nitrox V hardware and 13 byte AAD length for TLS.
* New debug option `WOLFSSL_NITROX_DEBUG` to add pending count.
2018-04-03 09:14:20 -07:00
adb817e8d2 Feature update for tls_bench test that will allow passing in arguments (#1466)
* Feature update for tls_bench test that will allow passing in command line arguments that enable test features.
* Fix type conversion errors.
* Fixed use of uninitialized data. Declare DH arrays as const.
2018-04-02 14:00:34 -07:00
6a1013888f sanity check on buffer read 2018-04-02 14:30:58 -06:00
b33feb9dbf Merge pull request #1470 from kojo1/EVP
EVP_CipherUpdate return value for inlen == 0
2018-04-02 14:03:48 -06:00
c60d9ff983 if(ret != 1) error 2018-04-01 13:27:08 +09:00
1c0b84d47d openSSL compatibility, EVP_CipherUpdate, if(inlen == 0)return 1; 2018-04-01 12:13:18 +09:00
effaa18b32 Fixing some kinks 2018-03-30 12:46:59 -06:00
87c1658ab8 Merge pull request #1464 from jrblixt/unitTest_api_addPkcs7-nightlyBuildFix2
Nightly build fix for PKCS#7 errors.
2018-03-29 15:26:11 -06:00
86a5330b31 Merge pull request #1462 from ejohnstown/cxxflags
Configure Update
2018-03-28 16:41:15 -07:00
e59bb43878 Configure Update
Revise default compiler optimization flags enable name to something more descriptive.
2018-03-28 13:19:46 -07:00
3a8a7b8a55 Merge pull request #1458 from dgarske/cleanupthreaded
wolfCrypt ECC FP cleanup for thread local storage cases
2018-03-28 12:25:20 -07:00
e6a19bb1e8 Configure Update
Add a disable option to turn off the default optimization options so the user may set their own in a CFLAGS.
2018-03-27 16:41:39 -07:00
1cd6075b9d Nightly build fix. 2018-03-27 16:54:14 -06:00
c9d840ed8d Fix for the HAVE_THEAD_LS case with FP_ECC where starting a new thead and doing ECC operations and not calling wc_ecc_fp_free. Added missing wolfCrypt_Init to API docs. 2018-03-27 14:29:39 -07:00
f62d372bbe Merge pull request #1461 from cconlon/netbsd-update
update NetBSD fips-check version to include selftest ECDSA fix
2018-03-27 13:28:49 -07:00
9de2bdce24 Merge pull request #1460 from dgarske/winecc
Enable ECC, AES-GCM and SHA-512/384 by default in VS
2018-03-27 13:28:23 -07:00
504b13530e Merge pull request #1459 from cconlon/selftest_fixes
Fix for wolfCrypt test and CAVP selftest build
2018-03-27 13:27:28 -07:00
477d2413cd Configure Update
1. Initialize CXXFLAGS (C++ compiler flags) the same way we do CFLAGS.
2. Add CPPFLAGS (C preprocessor flags) to the options.h file with the other CFLAGS.
2018-03-27 10:23:44 -07:00
9f231e0020 Merge pull request #1453 from dgarske/ecc508a_linux
Support for building with `WOLFSSL_ATECC508A` on other targets
2018-03-27 09:57:39 -07:00
42e6ea8685 Added ECC_TIMING_RESISTANT to eliminate harden warnings. 2018-03-26 15:54:29 -07:00
8fbc765dba Enable ECC, AES-GCM and SHA-512/384 by default in Windows Visual Studio projects. 2018-03-26 15:09:51 -07:00
9edaac8e1c update NetBSD fips-check version to include selftest ECDSA fix 2018-03-26 14:37:39 -06:00
021560035b fix unused var warning for extNameConsOid with IGNORE_NAME_CONSTRAINTS 2018-03-26 09:43:37 -06:00
d2aa7d0a37 exclude ecc_import_unsigned test when building for CAVP selftest 2018-03-23 16:31:17 -06:00
c08f5b86cf Merge pull request #1444 from jrblixt/unitTest_api_addPkcs-PR03162018
Unit test functions for PKCS#7.
2018-03-23 10:00:33 -06:00
aee6f4d0ca Merge pull request #1457 from dgarske/base16
Base16/64 improvements
2018-03-22 15:14:57 -07:00
316a2b9fb4 Review changes: Chris. 2018-03-22 15:35:25 -06:00
a92696edec Merge pull request #1454 from dgarske/noprivkey
Support for not loading a private key when using `HAVE_PK_CALLBACKS`
2018-03-22 12:47:22 -07:00
040e0ab752 Merge pull request #1456 from dgarske/iocbname
Refactor IO callback function names to use `_CTX_`
2018-03-22 12:40:48 -07:00
43f4faa7be Merge pull request #1452 from cconlon/mcapifix
fix unused param warning with NO_ERROR_STRINGS
2018-03-22 12:39:19 -07:00
3bf325290d Base16/64 improvements:
* Add define `WOLFSSL_BASE16` to explicitly expose base16 support.
* Add `./configure --enable-base16` option (disabled by default in configure, but enabled in coding.h when required internally).
* Added base16 tests in test.c `base16_test`.
* Enabled base64 decode tests when `WOLFSSL_BASE64_ENCODE` is not defined.
2018-03-22 10:36:56 -07:00
0cff2f8b10 Replace use of PUB_KEY_SIZE (from CryptoAuthLib) with new ECC_MAX_CRYPTO_HW_PUBKEY_SIZE. 2018-03-22 09:45:27 -07:00
8c4bfd825a Support for building the ATECC508A without WOLFSSL_ATMEL defined, which enables features specific to Atmel Studio Framework (ASF) and an embedded target. This allows for building with WOLFSSL_ATECC508A defined on other targets such as Linux. 2018-03-22 09:39:21 -07:00
2989c73411 Merge pull request #1447 from JacobBarthelmeh/PKCS7
remove pkcs7 requirement of x963kdf when ecc is disabled
2018-03-22 10:01:55 -06:00
e564c973b6 Refactor IO callback function names to use _CTX_ to eliminate confusion about the first parameter. 2018-03-21 16:08:55 -07:00
4b51431546 Fix for possible unused ctx in wolfSSL_CTX_IsPrivatePkSet when no ECC, RSA or ED25519. 2018-03-21 15:46:08 -07:00
104f7a0170 Merge pull request #1451 from JacobBarthelmeh/Optimizations
Adjust X509 small build and add more macro guards
2018-03-21 15:15:27 -07:00
f3d0879ed7 Merge pull request #1449 from dgarske/asn_nullterm
ASN improvements for building header/footer in `wc_DerToPemEx`
2018-03-21 15:13:46 -07:00
2a356228be Merge pull request #1445 from SparkiDev/wpas_fix
Fixes for wpa_supplicant
2018-03-21 15:11:43 -07:00
dbb34126f6 * Added support for not loading a private key for server or client when HAVE_PK_CALLBACK is defined and the private PK callback is set. Tested with all cipher suites, TLS 1.2/1.3, client/server certs, RSA/ECC/ED25519.
* Added PK callback context tests for client/server examples (`SetupPkCallbackContexts`).
* Added new test define for `TEST_PK_PRIVKEY` to allows simulating hardware based private key.
* Added new test.h function for loading PEM key file and converting to DER (`load_key_file`).
* Added way to get private key signature size (`GetPrivateKeySigSize`).
* Added new ECC API `wc_ecc_sig_size_calc` to return max signature size for a key size.
* Added inline comments to help track down handshake message types.
* Cleanup of RSS PSS terminating byte (0xbc) to use enum value.
* Fixed bug with PK callback for `myEccVerify` public key format.
* Fixed bug with PK callback for ED25519 verify key buffer in DoServerKeyExchange.
2018-03-21 11:27:08 -07:00
26bb86690a fix for unused parameter warning 2018-03-21 10:06:06 -06:00
14bb14c6ab fix unused param warning with NO_ERROR_STRINGS 2018-03-21 09:56:08 -06:00
90f97f4a5a fix for unused variable 2018-03-21 09:16:43 -06:00
0aa3b5fa0e macros for conditionally compiling code 2018-03-21 00:09:29 -06:00
d9917049c4 use bit fields with WOLFSSL_CTX structure 2018-03-20 22:07:42 -06:00
087df8f1cd more macro guards to reduce size 2018-03-20 17:15:16 -06:00
c9c2e1a8a7 Don't base signature algorithm support on certificate
The signature algorithm support is what you can do with another key, not
what you can do with your key.
2018-03-21 08:33:54 +10:00
4d65e4cc1e add WOLFSSL_NO_DH186 macro to optionally compile out DH186 function 2018-03-20 15:31:20 -06:00
df6ea54cd5 add support for PKCS8 decryption to OPENSSL_EXTRA_X509_SMALL build 2018-03-20 15:06:35 -06:00
2788183e79 Known config. tests fix. 2018-03-20 14:35:26 -06:00
bba0a3e88c Merge pull request #1448 from dgarske/ecc_cleanup
ECC import/export cleanups and additions
2018-03-20 11:05:15 -07:00
38d1eea8cd Merge pull request #1446 from SparkiDev/tls13_draft27
TLS v1.3 support for Draft 23 and Draft 27
2018-03-20 09:13:03 -07:00
18879ce271 Merge pull request #1440 from dgarske/VerifyRsaSign_PKCallback
Added VerifyRsaSign PK callback
2018-03-20 09:02:18 -07:00
764aec071c Further improvement to the null termination and newline logic in wc_DerToPemEx. 2018-03-19 22:58:18 -07:00
59aa893260 Cleanup ECC point import/export code. Added new API wc_ecc_import_unsigned to allow importing public x/y and optional private as unsigned char. Cleanup wc_ecc_sign_hash to move the hardware crypto code into a separate function. Added missing tests for wc_ecc_export_public_raw, wc_ecc_export_private_raw and new test for wc_ecc_import_unsigned. 2018-03-19 13:28:57 -07:00
87c70e76a9 Merge pull request #1441 from dgarske/ocsp_nb
Fix for handling OCSP with non-blocking
2018-03-19 12:05:59 -07:00
2cc1a1c5bf Renamed callbacks for VerifySign to SignCheck. Switched the new callback context to use the one for the sign. Fix for callback pointer check on VerifyRsaSign. Added inline comments about the new RsaSignCheckCb and RsaPssSignCheckCb. 2018-03-19 10:19:24 -07:00
cb8f8a953b Merge pull request #1438 from SparkiDev/nginx_pem_write
Fix PEM_write_bio_X509 to work with new BIO code
2018-03-19 09:13:51 -07:00
1040cf9caa Merge pull request #1437 from dgarske/eccrsrawtosig
Added new ECC API `wc_ecc_rs_raw_to_sig`
2018-03-19 09:12:39 -07:00
467608b6c9 remove pkcs7 requirement of x963kdf when ecc is disabled 2018-03-19 10:08:46 -06:00
7ce2efd572 Merge pull request #1431 from JacobBarthelmeh/Optimizations
more aes macro key size guards
2018-03-19 09:07:05 -07:00
b28c6a394f Merge pull request #1428 from JacobBarthelmeh/Certs
Update to certificate renew scripts
2018-03-19 09:05:15 -07:00
bd53d7ba59 TLS v1.3 support for Draft 23 and Draft 27
Draft 24: Second ClientHello usees version 0x0303 - no change.
Draft 25: The record layer header is now additional authentication data to
encryption.
Draft 26: Disallow SupportedVersion being used in ServerHello for
negotiating below TLS v1.3.
Draft 27: Older versions can be negotiated (by exclusion of 0x0304) in
SupportedVersion - no change.
2018-03-19 16:15:02 +10:00
b325e0ff91 Fixes for wpa_supplicant 2018-03-19 11:46:38 +10:00
465f1d491f Merge pull request #1443 from cconlon/dhagree
check z against 1 in wc_DhAgree()
2018-03-17 20:15:31 -07:00
250cd3b7eb Merge pull request #1433 from SparkiDev/sp_size
Fix size on Intel and improve 32-bit C code performance
2018-03-16 17:05:46 -07:00
1aba6e9b44 Prepare for PR. 2018-03-16 17:07:28 -06:00
3118c8826b check z against 1 in wc_DhAgree() 2018-03-16 15:59:48 -06:00
323abafc1c backup updates for SGX and DB jobs 2018-03-16 15:34:30 -06:00
fa73f7bc55 Fix for handling OCSP with non-blocking. The HashInput function was being called on the re-entry, which produced a bad mac response from server. Also cleanup for some of the WC_PENDING_E logic for the non-async cases to reduce code size. 2018-03-16 12:05:07 -07:00
e858ec11ac Fix unused arg when building with pk callbacks disabled. 2018-03-16 09:37:07 -07:00
ed7774e94a Added new callbacks for the VerifyRsaSign, which uses a private key to verify a created signature. The new callbacks API's are wolfSSL_CTX_SetRsaVerifySignCb and wolfSSL_CTX_SetRsaPssVerifySignCb. These use the same callback prototype as the CallbackRsaVerify and use the same context. 2018-03-15 14:43:41 -07:00
f70351242b Merge pull request #1432 from kojo1/mdk5
3.14.0 update on mdk5 pack
2018-03-15 14:47:14 -06:00
3f99a2a391 Fix PEM_write_bio_X509 to work with new BIO code 2018-03-15 10:45:49 +10:00
a207cae0f4 add some more macro guards to reduce size 2018-03-14 17:24:23 -06:00
607bd96317 add ocsp cert renew and test-pathlen to script 2018-03-14 16:35:16 -06:00
4d1986fc21 Improve speed of 32-bit C code 2018-03-15 08:33:04 +10:00
9ccf876a21 Added new ECC API wc_ecc_rs_raw_to_sig to take raw unsigned R and S and encodes them into ECDSA signature format. 2018-03-14 10:59:25 -07:00
d8fe341998 First pass at added PK_CALLBACK support for VerifyRsaSign. 2018-03-14 09:54:18 -07:00
717ba83deb Merge pull request #1434 from SparkiDev/tls13_multi_recs
Fix multiple handshake messages in last record of certs
2018-03-14 09:46:32 -07:00
262aa7c9a4 Merge pull request #1429 from JacobBarthelmeh/Testing
fix for build with NTRU and certgen
2018-03-14 09:42:39 -07:00
afe300acc0 Fix multiple handshake messages in last record of certs 2018-03-14 16:37:58 +10:00
8d750a22b1 Update project files 2018-03-14 08:15:18 +09:00
1de291be8d macro INLINE 2018-03-14 07:14:07 +09:00
c4dfa41088 SP improvements
Tag functions to not be inlined so llvm doesn't make huge builds.
Add sp_mod to support new DH key generation function.
2018-03-13 14:16:48 +10:00
8fb3ccacb7 opensslextra fixs and warning for unused variable 2018-03-12 18:05:24 -06:00
c41bc8205c account for build with no aes and no des3 2018-03-12 16:41:26 -06:00
6b04ebe3a4 fix for compiling with different build settings 2018-03-12 16:12:10 -06:00
fa21fb4a27 more aes macro key size guards 2018-03-12 15:44:48 -06:00
15805d626d Merge pull request #1430 from SparkiDev/srp_test_fix
Fix SRP test to have 2048 bit test data
2018-03-12 11:33:50 -07:00
b297d9dce0 Merge pull request #1427 from JacobBarthelmeh/Compatibility-Layer
return value on bad mutex with error nodes and add x509 host check to OPENSSL_EXTRA
2018-03-12 11:33:20 -07:00
00203d66d5 Fix SRP test to have 2048 bit test data 2018-03-12 17:32:27 +10:00
8fdb99443a fix for build with NTRU and certgen 2018-03-09 14:21:43 -07:00
72f390a102 Merge pull request #1361 from connerWolfSSL/doxygen_project
wolfSSL with Doxygen Documentation
2018-03-09 13:17:54 -08:00
e41f5de556 default generate ed25519 cert with renew and add ecc crls to script 2018-03-09 14:09:34 -07:00
d9738563af add ed25519 certificate generation to renewcerts.sh 2018-03-09 10:43:36 -07:00
f6b5427f2b bad sig certificate renew script 2018-03-09 09:50:52 -07:00
849e1eb10d updating renewcerts script 2018-03-09 00:35:14 -07:00
3b4d1bc796 Merge pull request #1425 from dgarske/config_defaults
Enable ECC by default and for aarch64 more algos
2018-03-08 14:05:03 -08:00
0ab4166a80 Merge pull request #1421 from JacobBarthelmeh/Optimizations
trim out more strings and fix DN tag
2018-03-08 14:03:10 -08:00
1f9583c59c Merge pull request #1409 from SparkiDev/tls13_old_ver_fix
Fix downgrading when WOLFSSL_TLS13 is defined (despite NO_OLD_TLS being defined)
2018-03-08 13:59:59 -08:00
200077c62c Merge pull request #1426 from cconlon/dh186
DH - Use q parameter when available, add wc_DhSetKey_ex()
2018-03-08 13:57:54 -08:00
e0afec0600 fix RSA macro, tickets without server, and add test case 2018-03-08 14:36:43 -07:00
e960e0544a try to clear out error queue with failing mutex 2018-03-08 11:49:16 -07:00
2a0ef55a66 fix for check on return value with mutex error case 2018-03-08 11:26:22 -07:00
74475a26ba compile more functions in with OPENSSL_EXTRA 2018-03-08 11:06:40 -07:00
0535a8a68a Added isntall flag, improved pathing for using doxygen to generate documentation 2018-03-08 10:53:44 -07:00
0ac833790d check q in wc_CheckPubKey_ex() if available in DhKey 2018-03-08 10:17:52 -07:00
6f95677bb8 add wc_DhSetKey_ex() with support for q and SP 800-56A 2018-03-08 09:36:44 -07:00
9e6b9a3793 Merge https://github.com/wolfssl/wolfssl into doxygen_project 2018-03-08 08:10:10 -07:00
d6ffa0dd8e Fix downgrade when doing TLS v1.3 2018-03-08 15:05:36 +10:00
d35a3f1e69 Fixes from code review
If doing TLS v1.3 and version on ServerHello is below TLS v1.2 then
handle message with old code.
If doing TLS v1.3, downgrading and version ClientHello is less than
minimum downgrade then this is a version error.
2018-03-08 09:00:36 +10:00
8edbca1b21 Enable ECC for all platforms by default. For aarch64 enable SHA512, SHA224, SHA3 and FastMath by default. 2018-03-07 09:41:07 -08:00
612a80609a warning about extra set of parentheses 2018-03-07 10:35:31 -07:00
799a6b6d2d fix warning of unused variable and add guard for disable ecc build 2018-03-07 10:35:31 -07:00
a9c6385fd1 trim out more strings and fix DN tag 2018-03-07 10:35:31 -07:00
a4000ba196 Merge pull request #1418 from SparkiDev/sp_armasm
Add assembly code for ARM and 64-bit ARM
2018-03-07 09:18:16 -08:00
91a59eb625 Merge pull request #1422 from JacobBarthelmeh/Compatibility-Layer
add stub code for flag with x509 check host
2018-03-07 08:55:21 -08:00
35f8460e8a Merge pull request #1419 from dgarske/stm32f1
Added support for `WOLFSSL_STM32F1`
2018-03-07 08:51:22 -08:00
cd940ccb5c Merge pull request #1417 from dgarske/asn_x509_header
Cleanup of the ASN X509 header logic
2018-03-07 08:50:00 -08:00
71ba87bb4d Merge pull request #1416 from dgarske/fix_pluton_ecc_sign
Fix for Pluton ECC sign (2nd try)
2018-03-07 08:47:46 -08:00
89182f5ca9 Add assembly code for ARM and 64-bit ARM
Split out different implementations into separate file.
Turn on SP asm by configuring with: --enable-sp-asm
Changed small ASM code for ECC on x86_64 to be smaller and slower.
2018-03-07 11:57:09 +10:00
602874cff4 Merge pull request #1423 from ejohnstown/touch-file
Fix issue with the creation of dummy fips.h header.
2018-03-06 16:29:05 -08:00
a7fe5e3502 Fix issue with the creation of dummy fips.h header. 2018-03-06 13:15:35 -08:00
3f80006b25 add stub code for flag with x509 check host 2018-03-06 11:55:20 -07:00
fcae6d46be Merge https://github.com/wolfssl/wolfssl into doxygen_project 2018-03-06 10:16:21 -07:00
5a1bdff0bd Added wolfssl vs doxygen api checking, removed storing warnings and errors in files 2018-03-06 10:13:13 -07:00
5699afe63d Fix for minor typos in OPENSTM32 README.md. 2018-03-06 09:09:44 -08:00
5174ad77f2 Added support for WOLFSSL_STM32F1. 2018-03-06 09:07:43 -08:00
b879d138af Fix for using non-const as array sizer (resolves build error with VS). 2018-03-06 09:04:12 -08:00
57e9b3c994 Cleanup of the ASN X509 header and XSTRNCPY logic. 2018-03-05 16:11:12 -08:00
d75b3f99ac Proper fix for Pluton ECC sign. 2018-03-05 15:29:34 -08:00
317c890961 Fix minimum downgrade when NO_OLD_TLS is defined 2018-03-05 10:12:04 +10:00
dee74e98dd Fix downgrading when WOLFSSL_TLS13 is defined (despite NO_OLD_TLS being defined) 2018-03-05 10:11:51 +10:00
e95fa69a9b Merge pull request #1414 from JacobBarthelmeh/Certs
update certificate after dates
2018-03-02 15:17:25 -08:00
f223f8fdfd update certificate after dates 2018-03-02 14:31:08 -07:00
a82dc1ad22 Merge pull request #1413 from JacobBarthelmeh/Release
bump version to 3.14.0
2018-03-02 12:58:31 -08:00
48cd2806af Merge pull request #1412 from JacobBarthelmeh/PKCS12
clean up memory in error case with PKCS12 create
2018-03-02 12:37:12 -08:00
2c12b0d678 Merge pull request #1411 from ejohnstown/dtls-null-fix
DTLS Import/Export with Null Cipher
2018-03-02 11:41:04 -08:00
922d65d97c bump version to 3.14.0 2018-03-02 12:31:41 -07:00
ae23f777d6 clean up memory in error case with PKCS12 create 2018-03-02 11:35:16 -07:00
53c0bf6a20 Merge pull request #1408 from JacobBarthelmeh/Release
Testing in preparation for release
2018-03-02 10:12:27 -08:00
e698084eac Merge pull request #1406 from dgarske/mmcau_sha256_cast
Fix for cast warning with NXP CAU and SHA256.
2018-03-02 10:10:14 -08:00
edfe16ef8c Merge pull request #1410 from dgarske/fix_pluton_ecc_sign
Fix for pluton ECC sign
2018-03-02 11:07:01 -07:00
da76ee0877 allow import of DTLS sessions with null cipher as the null cipher is allowed with dtls when enabled 2018-03-02 09:57:07 -08:00
223903717a add sanity check for short read 2018-03-02 09:38:11 -07:00
f6869dfe09 AES ECB build with ARMv8 instructions enabled 2018-03-02 09:30:43 -07:00
f6d770b5bd Fix for pluton ECC sign. 2018-03-02 07:57:22 +01:00
223facc46a sanity check on index before reading from input 2018-03-01 18:03:21 -07:00
ae21c03d69 check on certificate index when getting Name 2018-03-01 18:00:52 -07:00
e80e82a89b sanity check on reading newline character 2018-03-01 18:00:52 -07:00
e7b0fefd7a add sanity check on read index 2018-03-01 18:00:52 -07:00
d46a2b449d fix for smallstack buffer size 2018-03-01 18:00:52 -07:00
df1c73c8e5 check for case that BER to DER API is available 2018-03-01 18:00:52 -07:00
db18e49920 gcc-7 warning about misleading indentation 2018-03-01 18:00:52 -07:00
2a368abd20 fix build for haproxy 2018-03-01 18:00:52 -07:00
b25ebf64b9 Merge pull request #1407 from ejohnstown/new-ca-cert
added another CA to the wolfssl website ca file
2018-03-01 17:58:19 -07:00
ecb2463bbe modify the client external test list to skip the test case when aes and aes-gcm are disabled 2018-03-01 15:22:38 -08:00
7b1f6967c8 added another CA to the wolfssl website ca file 2018-03-01 11:57:12 -08:00
ba40a71a3c added script so ensure doxygen api documentation matches wolfssl api 2018-03-01 10:27:30 -07:00
59c8d3cdf7 Fix for cast warning with NXP CAU and SHA256. 2018-03-01 08:06:29 +01:00
1b2e43478d Merge pull request #1405 from ejohnstown/selftest-errors
added error codes for the FIPS pairwise agreement tests in the POST
2018-02-28 14:16:59 -07:00
d035c1dd81 added error code for the FIPS DH agreement KAT test in the POST 2018-02-28 10:54:53 -08:00
b6aae0c2d1 Merge pull request #1402 from JacobBarthelmeh/Testing
Improve bounds and sanity checks
2018-02-28 09:45:19 -08:00
02970c9a11 Merge pull request #1404 from JacobBarthelmeh/Compatibility-Layer
reduce impact of NO_OLD_SHA256_NAMES macro
2018-02-28 16:12:37 +01:00
25e7dbd17a add comment on sanity check 2018-02-27 23:30:50 -07:00
5cc046eb6d added error codes for the FIPS pairwise agreement tests in the POST 2018-02-27 12:42:25 -08:00
06163f2bbb reduce impact of NO_OLD_SHA256_NAMES macro 2018-02-27 12:21:11 -07:00
91141e43c9 Merge pull request #1403 from cconlon/shadow_warnings
Fix shadow warnings on older compilers in tls_bench example
2018-02-27 08:32:56 -08:00
00b6419964 use XSTRLEN and revert adding outLen parameter 2018-02-26 16:52:09 -07:00
306600cba6 resolve variable shadow warnings on older compilers in tls_bench example 2018-02-26 16:14:15 -07:00
e6c95a0854 sanity check on input size 2018-02-26 14:41:00 -07:00
5ef4296b3d sanity check on buffer length with ASNToHexString 2018-02-26 14:25:39 -07:00
e4f40fb6c0 add sanity checks and change index increment 2018-02-26 13:55:56 -07:00
f7d70e4650 Merge pull request #1401 from kaleb-himes/NETOS-SV
possible shadowed global variable declaration in NETOS
2018-02-26 12:21:13 -08:00
442430d39e Merge pull request #1392 from ejohnstown/rsa-decrypt-check
RSA Decrypt Bounds Checking
2018-02-26 12:19:37 -08:00
f58619bb9f possible shadowed global variable declaration in NETOS 2018-02-26 11:48:33 -07:00
68b8557878 Merge pull request #1400 from JacobBarthelmeh/Testing
possible shadowed global variable declaration
2018-02-26 10:37:17 -08:00
512a0be75e possible shadowed global variable declaration 2018-02-26 09:52:51 -07:00
b527f6fb81 Merge pull request #1397 from JacobBarthelmeh/Optimizations
Optimizations
2018-02-26 08:43:22 -08:00
73dbc8f6e7 Merge pull request #1395 from JacobBarthelmeh/Certs
Add support for writing multiple OUs, DCs and for writing a unique EKU OID
2018-02-26 08:39:58 -08:00
a49553df6a RSA Decrypt Bounds Checking
1. Added some bounds checking on the ciphertext passed into the RSA decrypt function. NIST SP 800-56B specifies that the ciphertext shouldn't be a number larger than the modulus.
2. Added an API test to check that the direct RSA decrypt function returns an error with a "bad" message.
3. Added an ifndef guard to disable the bounds check. Default is to keep the bounds check.
4. RSA Decrypt bounds check only checked the first time into wc_RsaFunction().
2018-02-23 17:04:05 -08:00
942f39de3b cast return from XSTRLEN 2018-02-23 17:35:44 -07:00
9391c608cc remove error string function when no error strings is defined 2018-02-23 17:31:20 -07:00
f2cbab95b0 change _EncodeName, add test with wc_MakeCertReq, add XMEMSET with Cert init 2018-02-23 17:22:48 -07:00
1c2506f94c Merge pull request #1393 from SparkiDev/sp_math_dh
DH public key check working with sp-math
2018-02-23 16:15:15 -08:00
9b90cdc919 Merge pull request #1396 from JacobBarthelmeh/Testing
fix for static analysis warning of null dereference
2018-02-23 15:51:29 -08:00
22e55e72c1 Merge pull request #1394 from cconlon/selftest
Add CAVP-only Self Test for special build
2018-02-23 15:50:06 -08:00
be8cfcf587 Merge pull request #1379 from JacobBarthelmeh/Compatibility-Layer
Compatibility layer
2018-02-23 14:59:22 -08:00
9757effdc1 fix for static analysis warning of null dereference 2018-02-23 14:49:06 -07:00
79f13478df add AES macro guards and reduce code in GetName 2018-02-23 13:45:42 -07:00
453aa16e8d Add support for writing multiple OUs, DCs and for writing a unique EKU OID 2018-02-23 10:46:26 -07:00
ad53037852 add CAVP selftest option for special build 2018-02-23 10:14:56 -07:00
30e8429a3f DH public key check working with sp-math 2018-02-23 15:10:54 +10:00
89390180a0 Merge branch 'master' into Compatibility-Layer 2018-02-22 15:24:31 -07:00
6500c40015 Merge pull request #1386 from JacobBarthelmeh/RSA
add WC_RSA_NO_PADDING macro and WC_RSA_NO_PAD enum
2018-02-22 13:34:20 -08:00
fcb82d561e Merge pull request #1388 from cconlon/dh_check_pubkey
add wc_DhCheckPubKey_ex() with checks against large prime q
2018-02-22 13:10:03 -08:00
de4893486e add wc_DhCheckPubKey_ex() with checks against large prime q 2018-02-22 11:09:06 -07:00
63802849a1 remove magic number 2018-02-22 09:55:20 -07:00
41ae47fa3c Merge pull request #1390 from SparkiDev/tls13_downgrade
Fix downgrading from TLS v1.3 to TLS v1.2
2018-02-22 08:53:48 -08:00
dda7dbd7fd Merge pull request #1389 from JacobBarthelmeh/CAAM
fix unused function warning with CAAM and AES
2018-02-22 08:51:34 -08:00
4154492d4b Merge pull request #1387 from JacobBarthelmeh/Testing
fix for unused variables
2018-02-22 08:46:32 -08:00
06abc12d40 Merge pull request #1384 from SparkiDev/sp_math_dh
Enable DH public key check code with sp-math
2018-02-22 08:41:25 -08:00
5c07aadc41 Merge pull request #1383 from SparkiDev/explicit_curve
Explicit curve
2018-02-22 08:32:44 -08:00
20e7d2d426 Merge pull request #1380 from SparkiDev/ber_indef
Support indefinite length BER encodings in PKCS #7
2018-02-22 08:31:26 -08:00
6bf5f06397 Fixes from code review 2018-02-22 14:59:19 +10:00
7160384a19 Explicit curve data in public ECC key
Certificate's public key data contains more of the encoding.
PKCS #7 using public key from certificates calls proper decode.
2018-02-22 14:59:19 +10:00
274110a10c Added tests and fixes from testing 2018-02-22 14:58:37 +10:00
da4024b46a Fix downgrading from TLS v1.3 to TLS v1.2
Fix handling of ServerHello in TLS v1.3 to support TLS v1.2 when
downgrading.
Added support in client and server examples for using downgrade method:
wolfSSLv23_client_method_ex() or wolfSSLv23_server_method_ex().
Add tests, using downgrade version, of client or server downgrading from
TLS v1.3 to TLS v1.2.
2018-02-22 12:48:50 +10:00
76b0464a3b Fixes from review 2018-02-22 08:31:19 +10:00
312d1a2aaf fix unused function warning with CAAM and AES 2018-02-21 15:21:07 -07:00
fd7ffc992f fix for unused variables 2018-02-21 11:19:49 -07:00
08e199d78a add support for async with wc_RsaDirect function 2018-02-21 11:09:38 -07:00
7374e2e751 add WC_RSA_NO_PADDING macro and WC_RSA_NO_PAD enum 2018-02-21 10:10:35 -07:00
dc4edd0cd9 SNI fix for nginx 2018-02-21 23:48:43 +10:00
d1f19e8ecc Fix resumption code around when not available
Can't set a ticket if the encryption callback is NULL.
If no useable pre-shared key is found then we won't do PSK.
2018-02-21 17:45:13 +10:00
7d4c693d7e Enable DH public key check code with sp-math 2018-02-21 09:13:00 +10:00
3dfc2d87f3 Fix leak when wc_PKCS7_InitWithCert is called in verify 2018-02-21 08:29:50 +10:00
6dad94c0fa Change wc_BerToDer signature to have length as param
Clean up code to make readable
2018-02-21 08:29:50 +10:00
d09f26a69f Support indefinite length BER encodings in PKCS #7 2018-02-21 08:29:50 +10:00
7a2aa6bc13 Merge pull request #1382 from dgarske/cleanup_strncpy
Fixes for ensuring null termination on all strncpy calls
2018-02-20 08:18:08 -08:00
d34309b141 Merge pull request #1381 from JacobBarthelmeh/Testing
macro guard for redefinition warning
2018-02-20 08:14:30 -08:00
3586ae04dc Merge pull request #1373 from JacobBarthelmeh/Optimizations
Some memory optimizations
2018-02-20 08:13:02 -08:00
a275022dbe account for pwdbased being enabled with x509small 2018-02-19 17:32:39 -07:00
33b699f81a macro guards on PEM strings 2018-02-19 17:32:39 -07:00
e4df21df94 More cleanup for const strings. 2018-02-19 17:32:39 -07:00
772651c17a update tests and benchmark for HAVE_AES_DECRYPT 2018-02-19 17:32:39 -07:00
4614bd4e56 scan-build warning and AES key size builds for ARMv8 2018-02-19 17:32:39 -07:00
94b7ab92f3 fix for unused variable 2018-02-19 17:32:39 -07:00
801ce67fc9 surround BIO function with macro guard 2018-02-19 17:32:39 -07:00
2a15b3912b revert pkcs7 attrib structure for scep and add more macro guards for AES key size 2018-02-19 17:32:39 -07:00
8006b68cac more macro guards 2018-02-19 17:32:39 -07:00
c9525d9c1d add opensslextra=x509small build option 2018-02-19 17:32:39 -07:00
ae2306ebcf more structure packing and macro guards 2018-02-19 17:32:39 -07:00
e187ce42da more macro guards for asn 2018-02-19 17:28:53 -07:00
16a4aef18e clean up of macro guards on OIDs 2018-02-19 17:28:53 -07:00
02753e53a5 add some of AES key size macros to benchmark.c and test.c 2018-02-19 17:28:53 -07:00
7143b09786 pack PKCS7 structure 2018-02-19 17:28:53 -07:00
c2f660c0fc first round of adding AES key size macros 2018-02-19 17:23:49 -07:00
08696449f6 Merge pull request #1349 from JacobBarthelmeh/PKCS7
pkcs7 attribute parsing
2018-02-19 15:36:55 -08:00
44079e4bb8 Fixes for ensuring null termination on all strncpy calls. Cleanup of the null termination character '\0'; for char types. 2018-02-19 13:33:16 -08:00
b6f96d68be macro guard for redefinition warning 2018-02-19 14:11:41 -07:00
a2d96bad49 update SHA names with mcapi build 2018-02-19 09:29:21 -07:00
165059226e add HAVE_AES_ECB to enable all build 2018-02-16 17:06:26 -07:00
f569645212 add wolfSSL_SHA256 function 2018-02-16 16:57:45 -07:00
a651b08afa add wolfSSL_AES_ecb_encrypt function 2018-02-16 15:08:31 -07:00
223edab6d9 Merge pull request #1378 from dgarske/evp_gcc7_async_test
Fixes a few build errors with EVP/wolfCrypt test and async API test hang
2018-02-16 13:11:36 -07:00
62c2145e74 Merge pull request #1376 from JacobBarthelmeh/Compatibility-Layer
add wolfSSL_PEM_read_bio_RSAPrivateKey function
2018-02-16 10:20:07 -08:00
ae5dac8994 Fixes for GCC 7 build errors with evp.c and switch fall through. General EVP code formatting cleanup. Fix for wolfCrypt test un-used var when HAVE_AES_CBC not defined. Fix for async in test_wolfSSL_SESSION with err not being initialized. 2018-02-16 09:32:40 -08:00
488a795747 add wolfSSL_PEM_read_bio_RSAPrivateKey function 2018-02-15 22:34:50 -07:00
74ebf510a3 Merge pull request #1374 from dgarske/pub_ecc_mul2add
Add option for `ecc_mul2add` to be made as exposed API
2018-02-15 14:21:42 -08:00
cbd7612324 Merge pull request #1375 from dgarske/ifm_feedback
Add support for `WOLFSSL_NO_MALLOC` with memory callbacks
2018-02-15 14:19:21 -08:00
d8eff923f1 Merge pull request #1372 from JacobBarthelmeh/UnitTests
clear error node queue after test case and initialize logging buffer
2018-02-15 08:40:45 -08:00
8c8ed06202 Added the WOLFSSL_NO_MALLOC option for the realloc callback as well. 2018-02-15 07:15:30 -08:00
32547e280a Added ecc_mul2add to ecc.h header and is exposed as an API if WOLFSSL_PUBLIC_ECC_ADD_DBL is defined. 2018-02-15 07:04:29 -08:00
8285648e46 Fix to support using memory callbacks with no malloc / free using WOLFSSL_NO_MALLOC. Fix to only include <errno.h> if LWIP_PROVIDE_ERRNO is not defined. 2018-02-15 06:54:14 -08:00
ad1fc26d4e Merge pull request #1370 from JacobBarthelmeh/Testing
check on verify depth for certificates with opensslextra
2018-02-14 16:29:25 -08:00
1b98ccbac8 add else condition for logging string with OPENSSL_EXTRA 2018-02-14 17:21:42 -07:00
9ff97997a6 Merge pull request #1360 from SparkiDev/sp_math
Minimal implementation of MP when using SP.
2018-02-14 15:49:23 -08:00
a7a8ce8721 Merge pull request #1371 from ejohnstown/asn-fix
Update wc_GetKeyOID()
2018-02-14 15:10:01 -08:00
641af487ea Changed missed MP_API change 2018-02-15 08:23:49 +10:00
c1b1fbaf7e clear error node queue after test case 2018-02-14 13:55:43 -07:00
0853fcb202 Update wc_GetKeyOID()
1. Check that the algoID is not NULL.
2. Initialize algoID to 0.
3. Moved the key variables around.
2018-02-14 12:43:02 -08:00
9a4fe0fe4e Merge pull request #1353 from dgarske/asn_strict
Added RFC 5280 "must" checks
2018-02-14 10:01:58 -08:00
2e15842ef2 revert verify depth check and increase array size to account for possible cert index 2018-02-14 10:01:22 -07:00
09f1247007 Support WOLFSSL_PUBLIC_MP define in SP math 2018-02-14 15:30:33 +10:00
b18fdea2ce Fixes from code review 2018-02-14 11:09:20 +10:00
4b5524b39a Merge pull request #1368 from JacobBarthelmeh/PKCS12
add check for having ECC enabled when testing with ECC certificate
2018-02-13 11:42:11 -08:00
8b5864c475 Merge pull request #1366 from ejohnstown/hmac-sha3
HMAC-SHA-3
2018-02-13 11:41:34 -08:00
4d04f0951c Merge pull request #1363 from SparkiDev/tls13_draft23
Support TLS v1.3 Draft 23
2018-02-13 11:39:53 -08:00
9bb29c46e3 Merge pull request #1347 from kaleb-himes/SGX-FIPS-WINDOWS
windows configuration changes
2018-02-13 10:38:25 -07:00
6f1e5383da check on verify depth for certificates with opensslextra 2018-02-13 10:29:23 -07:00
e48eb1ded8 added hmac-sha-3 2018-02-12 13:24:06 -08:00
c09e55c749 add check for having ECC enabled when testing with ECC certificate 2018-02-12 09:59:35 -07:00
95ed1a88ed Merge pull request #1364 from SparkiDev/aesni_authtagsz
AES-GCM AES-NI code now handles different tag lengths
2018-02-09 13:19:14 -08:00
e254f25baf Merge pull request #1359 from SparkiDev/nginx_fixes
Fixes to get Nginx working again.
2018-02-09 13:17:38 -08:00
44be47a83b Merge pull request #1358 from dgarske/fix_aesgcm_emb
Fix for missing `ret` in some `wc_AesGcmEncrypt` functions
2018-02-09 13:16:21 -08:00
a27d2448e2 Merge pull request #1344 from dgarske/portability_cleanups
Portability cleanups and `tls_bench` fixes
2018-02-09 13:15:47 -08:00
d827e93af9 Merge pull request #1329 from JacobBarthelmeh/PKCS12
PKCS12 reverse order that certificates are compared for keypair
2018-02-09 13:15:07 -08:00
87179837e7 Merge pull request #1365 from cconlon/p7karifix
detect and set keyAgreeOID from CMS EnvelopedData if user has not set
2018-02-09 13:27:40 -07:00
fa676d96cf detect and set keyAgreeOID from CMS EnvelopedData if user has not set 2018-02-09 09:37:51 -07:00
35c993e55d AES-GCM AES-NI code now handles different tag lengths
Encrypt and decrypt code modified.
AES-NI, AVX1 and AVX2 code modified.
Test of 15 byte tag added.
2018-02-09 17:21:06 +10:00
0da8694ff3 Fix Hello Retry Request parsing of new KeyShare choice 2018-02-09 11:12:04 +10:00
9a0c822582 Support TLS v1.3 Draft 23
Change KeyShare number.
Support SignatureAlgorithmsCert extension - nothing done with
information as only one chain supported on server.
Compiling for Draft 22 supported: --enable-tls-draft22
Compiling for Draft 18 still supported.
2018-02-09 10:42:15 +10:00
e8a5af2651 Merge pull request #1362 from ejohnstown/aesgcmtest
Add AES-GCM Test Case
2018-02-08 16:41:06 -08:00
6907241180 Add AES-GCM Test Case
Added a new AES-GCM test case where the provided IV is of length 1 byte.
2018-02-08 11:37:21 -08:00
fab99f9f44 Merge https://github.com/wolfssl/wolfssl into doxygen_project 2018-02-08 10:13:43 -07:00
17e88b47f6 Migrated documentation directory to doc. README updated. Error fixes. Moved make options to doc/include.am 2018-02-08 10:05:30 -07:00
a3a4f2d59c Minimal implementation of MP when using SP.
--enable-sp-math to include minimal implementation of MP (only with
--enable-sp.)
Add futher functionality for ECC (conditionally compiled):
- check key
- is point on curve
- API to add and double projective points
- API to map from project to affine
- Uncompress point (including sqrt)
Some configuration options will not work with SP math - configure.ac
detects this and errors out.
Change test code to better support SP sizes only.
2018-02-08 15:50:17 +10:00
297fb1a447 Fixes to get Nginx working again.
Only use weOwnDH as Nginx can change from client to server.
Allow TLS v1.3 with client method for Nginx.
2018-02-08 11:14:31 +10:00
62b8c0c3fd add test case for order of certificates with PKCS12 parse 2018-02-07 16:52:39 -07:00
fbdcd3c67f Fix for missing ret in some wc_AesGcmEncrypt functions due to refactor in commit 0765aa0. 2018-02-07 15:40:28 -08:00
c2a0de93b8 Fix to resolve wolfCrypt test for `cert_test nameConstraints test. Fixed ASN check to properly determine if certificate is CA type. 2018-02-07 12:48:33 -08:00
266b6fe7a7 Merge pull request #1356 from JacobBarthelmeh/Compatibility-Layer
Fix for Windows FIPS build
2018-02-07 13:18:36 -07:00
4a6bb20ba6 Refactor the VERIFY_AND_SET_OID macro to simplify so it works on older C compilers like Visual Studio. 2018-02-07 12:17:03 -08:00
d78e45dbb6 Added check to enforce RFC 5280 Sec 4.2: "A certificate MUST NOT include more than one instance of a particular extension". Refactor of the DecodedCert struct to combine bit type options into bit-fields. Fix for wolfCrypt test for error codes to allow -161. 2018-02-07 11:15:22 -08:00
d9002bb072 Fix to enforce RFC 5280 Sec 4.2.1.6: "The name MUST NOT be a relative URI". Verifies the URI contains "://". Can be disabled using WOLFSSL_NO_ASN_STRICT. 2018-02-07 11:15:22 -08:00
f4ad808d12 Added check to enforce RFC 5280 Sec 4.2.1.10 rule: "The name constraints extension, which MUST be used only in a CA certificate". Added new define WOLFSSL_NO_ASN_STRICT to restore old behavior for compatability. Fix wc_port time HAVE_RTP_SYS (noticed it was missed during ASN time move to wc_port). 2018-02-07 11:15:22 -08:00
3e05118995 * Added the tls_bench example to the build output when threading is supported.
* Fixed some `tls_bench` build issues with various configure options.
* Moved the `WOLFSSL_PACK` and `WC_NORETURN` macros into types.h.
* Added support for `__builtin_bswap32` and `__builtin_bswap64`. Since the performance of the builtins varries by platform its off by default, but can be enabled by customer using `WOLF_ALLOW_BUILTIN`. Quick check on x86 showed the 32-bit swap performance matched, but 64-bit swap was slower.
2018-02-07 11:13:13 -08:00
e1c246f918 Merge pull request #1355 from JacobBarthelmeh/Testing
Fix for build with having opensslextra and IGNORE_NAME_CONSTRAINTS
2018-02-07 11:12:55 -08:00
69db17fcda Merge pull request #1352 from dgarske/freertos_static
Fix to allow `FREERTOS` and `WOLFSSL_STATIC_MEMORY`
2018-02-07 10:06:51 -08:00
012fb31f00 Merge pull request #1351 from dgarske/fix_ipv6
Fix for building with IPV6
2018-02-07 10:04:41 -08:00
7769ba83ad Merge pull request #1346 from dgarske/stm32_hash_ctx
STM32 Hashing Improvements
2018-02-07 10:03:50 -08:00
47aa4bbe2f handle disable md5 case 2018-02-07 10:44:16 -07:00
61da8ec1dc Fix for Windows FIPS build 2018-02-07 10:13:28 -07:00
a1a1ca9991 Fix for build with having opensslextra and IGNORE_NAME_CONSTRAINTS 2018-02-07 09:54:24 -07:00
9afd26e853 Fixes for better supporting FREERTOS with and without static memory. Added fallback case to use pvPortMalloc/vPortFree when heap ptr not available. 2018-02-06 09:28:27 -08:00
b3b3a28616 Fix logic typo for IPV6 any addr. 2018-02-06 09:18:42 -08:00
172989c3c4 Merge pull request #1343 from ghoso/dev201801
Fix decryption error when EVP_CipherInit is called mulitple times.
2018-02-05 16:51:08 -08:00
82850422fc Merge pull request #1338 from JacobBarthelmeh/Testing
set have session id flag
2018-02-05 14:58:55 -08:00
0be1c10fcd Moved the STM32 functions to their own .c file. Added GPL header. Finished testing on STM32 CubeMX with F4 and F7 and StdPeriLib with F4. 2018-02-05 12:57:06 -08:00
4803b3316e Update settings.h 2018-02-05 13:05:24 -07:00
81b64742f3 Fix to allow FREERTOS and WOLFSSL_STATIC_MEMORY. 2018-02-05 11:55:35 -08:00
1ca56f97a4 Fix warning with pointer compare to zero for IPV6 peer == INADDR_ANY in test.h. Fixes issue #1350. 2018-02-05 11:03:19 -08:00
a196fac0c2 itterate through certificates with PKCS7 2018-02-05 10:52:54 -07:00
0765aa0f20 Merge pull request #1342 from SparkiDev/aes_gcm_sb2
Improve performance of AES-GCM for AVX1 and AVX2
2018-02-02 10:56:14 -08:00
7ad0ea808c Merge pull request #1341 from JacobBarthelmeh/master
fix build for OLD_HELLO_ALLOWED macro
2018-02-02 10:53:16 -08:00
02ef52c3cd Merge pull request #1340 from dgarske/ecc_pub_import_wcurve
Adds curve information to public key import for `wc_EccPublicKeyDecode`
2018-02-02 10:52:06 -08:00
d63373066b Merge pull request #1331 from JacobBarthelmeh/Compatibility-Layer
add comments and better error checking for PKCS8 strip
2018-02-02 10:50:29 -08:00
c66ebb6748 Merge pull request #1317 from SparkiDev/chacha20_sb_avx2
Improve performance of chacha20-poly1305 on AVX and AVX2.
2018-02-02 10:46:39 -08:00
19ce41c3cc pkcs7 attribute parsing 2018-02-02 09:01:32 -07:00
f5c33a9362 added force flag to not through warning if no file present to remove 2018-02-01 10:23:10 -07:00
841e75afcf Merge branch 'master' of https://github.com/wolfssl/wolfssl 2018-02-01 09:47:13 -07:00
a6bab49f8a fixed bn.h header 2018-02-01 09:43:11 -07:00
15486ae379 windows configuration changes 2018-01-31 15:09:16 -07:00
a4a5f4f27a STM32 refactor to move hashing code into wolfssl/wolfcrypt/port/stm32.h. Supports CubeMX HAL or StdPeriLib with MD5, SHA1, SHA224 and SHA256. Detects if hardware supports SHA2. Adds hashing context save/restore and hashing clock/power optimizations. Fix for building *.c in wolfcrypt/src/port for caam_driver.c. Fix for warning with wolfSSL_CryptHwMutexUnLock when no threading defined and return code not checked. 2018-01-31 11:25:20 -08:00
640015ed5f Merge pull request #1345 from kaleb-himes/SGX-FIPS-UPDATES
Updates to settings necessary for SGX FIPS
2018-01-31 11:09:19 -07:00
5b083497da Merge pull request #1300 from kaleb-himes/SGX-FIPS-LINUX
Add build scripts for default SGX build and improve cleanup
2018-01-31 09:34:06 -07:00
0101440cc8 Fix decryption error when EVP_CipherInit is called mulitple times. 2018-01-31 17:08:06 +09:00
1af85cf9c4 Update include.am 2018-01-30 15:39:20 -07:00
7facff2fd2 Feedback update 2018-01-30 15:36:18 -07:00
229d98e1f8 Updates to settings necessary for SGX FIPS 2018-01-30 15:30:52 -07:00
03fe54dcc4 Update following review 2018-01-30 14:30:44 -07:00
3d3b9f69a6 Test larger variable data size if available 2018-01-30 12:21:25 +10:00
e82e3d3d6e Improve performance of AES-GCM for AVX1 and AVX2 2018-01-30 12:00:13 +10:00
9d7374348b Fix the ecc_decode_test to use a real OID (instead of 1), so the tests work properly. 2018-01-29 15:58:04 -08:00
580a55ce49 fix build for OLD_HELLO_ALLOWED macro 2018-01-29 14:55:32 -07:00
90a3daa887 Adds curve information to public key import for wc_EccPublicKeyDecode. Cleanup to remove the ECC_CHECK_PUBLIC_KEY_OID define. The call to wc_ecc_get_oid does the same check as CheckCurve. 2018-01-29 12:09:12 -08:00
ca5b1dbbcb set have session id flag 2018-01-26 14:18:36 -07:00
d179e442b4 Merge pull request #1337 from dgarske/pkcs7_pad
Expose the PKCS 7 pad functionality `wc_PKCS7_PadData`
2018-01-26 10:01:07 -08:00
058c2a7a25 Made public the wc_PKCS7_GetPadSize API. Cleanup to use GetPadSize for the wc_PKCS7_PadData. 2018-01-25 08:14:56 -08:00
4d75f337bb Fix AVX2 final func to reset state 2018-01-24 16:36:44 -08:00
776e222143 Merge pull request #1336 from SparkiDev/sha256_freescale
Transform_Sha256 no longer passed a buffer - fix for FREESCALE
2018-01-23 14:51:30 -08:00
138bc3e6cc Enhancement to expose the PKCS 7 pad functionality (wc_PKCS7_PadData). 2018-01-23 13:21:56 -08:00
11ea2689d8 Transform_Sha256 no longer passed a buffer - fix for FREESCALE 2018-01-23 12:45:17 -08:00
e476cb2958 Merge pull request #1334 from dgarske/fix_asn_leak
Fix for possible leak in error case for `wc_RsaKeyToDer`
2018-01-22 23:20:39 -07:00
4e10173eed Fix for possible leak in error case for wc_RsaKeyToDer. 2018-01-22 16:17:08 -08:00
79f4b963cd Merge pull request #1333 from SparkiDev/tls13_no_server
Make TLSX_SetResponse available in client and server
2018-01-22 07:43:37 -08:00
6e6085501d Make TLSX_SetResponse available in client and server 2018-01-21 18:12:34 -08:00
72b8b71082 Merge pull request #1332 from kojo1/part5
fix shadow global
2018-01-21 16:48:12 -08:00
162326dfcb fix shadow global 2018-01-22 01:19:45 +09:00
4d1ebc0827 Merge pull request #1330 from wolfSSL/revert-1315-aes_gcm_sb
Revert "Improve AES-GCM code for Intel AVX1 and AVX2"
2018-01-19 17:49:19 -07:00
1428934ad5 add comments and better error checking for PKCS8 strip 2018-01-19 16:53:12 -07:00
f06abdb3ae Revert "Improve AES-GCM code for Intel AVX1 and AVX2" 2018-01-19 15:12:08 -08:00
085d3dae14 Merge pull request #1315 from SparkiDev/aes_gcm_sb
Improve AES-GCM code for Intel AVX1 and AVX2
2018-01-19 15:09:34 -08:00
9045a2562a Merge pull request #1316 from JacobBarthelmeh/Testing
Fix for AES-CFB with --enable-armasm and fix for windows fips tests
2018-01-19 15:02:53 -08:00
8d27a2720c Merge pull request #1325 from SparkiDev/bench_rsa
Added option to benchmark RSA sign/verify instead of enc/dec
2018-01-19 14:52:40 -08:00
0059266b21 Merge pull request #1328 from dgarske/fix_async_rsapss
Fixes for wolfCrypt test RSA PSS with async enabled
2018-01-19 14:52:09 -08:00
d5c1cf4fc7 Merge pull request #1327 from dgarske/ignore_file_warn
Added `WOLFSSL_IGNORE_FILE_WARN` option
2018-01-19 14:51:31 -08:00
2efe7f6d96 Merge pull request #1319 from JacobBarthelmeh/Compatibility-Layer-Part5
Compatibility layer part4
2018-01-19 14:49:12 -08:00
213a2d0a7d reverse order that certificates are compared with private key when parsing PKCS12 2018-01-19 15:41:52 -07:00
be98e3e7f3 build condition for SendAlerts and fix free of x509 store 2018-01-19 09:48:02 -07:00
025ba1445e add WOLFSSL_VERIFY_CB_ALL_CERTS macro 2018-01-18 18:26:32 -07:00
8a0bbb0faf Fixes for wolfCrypt test RSA PSS with async enabled. 2018-01-18 15:35:21 -08:00
5d52466d6f Merge pull request #1326 from ejohnstown/rsa-test-fix
RSA Key Generation Test Fix
2018-01-18 15:01:55 -08:00
f61e56e5b6 Merge pull request #1312 from kojo1/mdk5
CMSIS pack 3.13.0
2018-01-18 14:48:37 -08:00
9654f19075 RSA Key Gen Test Fix
A recent change to the RSA key generation process is capping the number of attempts of finding a probable prime to a multiple of the prime's size, in FIPS builds. This means it might fail once in a while. (It could also fail for a couple other reasons but this is the most likely.) The API is changed to retry key generation until it succeeds. Non-FIPS builds keep trying until they find a prime.
2018-01-18 12:20:25 -08:00
584520c9b4 increase static memory bucket size with session certs 2018-01-18 10:59:20 -07:00
377f5c304c update for async build and include for getenv 2018-01-18 09:05:21 -07:00
f2079ca792 Added option to benchmark RSA sign/verify instead of enc/dec 2018-01-18 11:35:19 +10:00
2a308bdda9 add some comments and return domain name 2018-01-17 17:39:17 -07:00
a0f5126076 build option fixes 2018-01-17 16:40:06 -07:00
db970b685a Merge pull request #1324 from kaleb-himes/INLINE-STATUS
Add status of inline configure option to feature output
2018-01-17 15:36:50 -08:00
98f85c9235 wolfssl_tcp_select 2018-01-18 07:25:09 +09:00
f79a3e9ddb Reverse ByteReversWOrd64 2018-01-18 07:10:55 +09:00
cfe88b37f6 SOCK_LISTEN_MAX_QUEUE, listen arg 2018-01-18 07:04:48 +09:00
1f0171d79b hard tab 2018-01-18 07:03:19 +09:00
c7ce6ce772 fix main.c under projects 2018-01-18 07:00:51 +09:00
1276d21d8e Added WOLFSSL_IGNORE_FILE_WARN option to ignore warning for .c files that do not need to be included. 2018-01-17 13:27:59 -08:00
ed95fca448 Add status of inline configure option to feature output 2018-01-17 14:20:49 -07:00
0b8c069119 Merge pull request #1323 from JacobBarthelmeh/RSA-min
adjustment to RSA key size check
2018-01-17 13:12:47 -08:00
54acc2df51 Merge pull request #1318 from SparkiDev/tls13_draft22
Changes for TLS v1.3 Draft 22
2018-01-17 11:22:50 -08:00
19288ea127 casting values, update names, g++ build 2018-01-17 12:18:00 -07:00
fa3ab4fd61 adjustment to RSA key size check 2018-01-17 11:34:27 -07:00
676e2f1f63 add comments and remove 2999 bit rsa key test for now 2018-01-17 11:19:21 -07:00
57cbd5e53c Merge pull request #1322 from SparkiDev/poly1305_clang_fix
Fix clang using wrong registers in poly1305 AVX2 code
2018-01-17 08:30:33 -08:00
2dc60b9e01 Merge pull request #1321 from SparkiDev/fe_init_small_fix
Fix fe_init implementation to appear for small Ed25519
2018-01-17 08:30:13 -08:00
bf57da1914 static analysis fixes, free buffer return in test case, fips build 2018-01-17 09:28:25 -07:00
4915a784ec Fix clang using wrong registers in poly1305 AVX2 code 2018-01-17 15:02:58 +10:00
c09d972012 Fix fe_init implementation to appear for small Ed25519 2018-01-17 11:34:22 +10:00
5f14de33e7 Changes for TLS v1.3 Draft 22
Middlebox compatibility available too.
2018-01-17 09:38:11 +10:00
60b329f7e5 fix example client error print out and ASN1_TIME_print after rebase 2018-01-16 15:39:58 -07:00
b3ab0a9c11 simplify visibility control 2018-01-16 14:59:50 -07:00
dce628ae8e Eliminate dup _InitHmac 2018-01-16 14:59:48 -07:00
56efe657fc save iPad, oPad. test long key 2018-01-16 14:57:53 -07:00
30e6ec5396 HMAC_CTX_copy, copy save_len, save_key 2018-01-16 14:54:44 -07:00
e93d7d3c93 fix for MD5 case, "recover hmac", in HMAC_init 2018-01-16 14:54:44 -07:00
937c759998 HMAC_Init, keylen arg check 2018-01-16 14:54:44 -07:00
f38a321e64 HMAC_Init_ex with NULL key to recover Hmac initial state 2018-01-16 14:54:43 -07:00
8f1fc8ad2e Error return value of checkPad 2018-01-16 14:51:44 -07:00
ed0d4d3b06 Add ECB in wolfSSL_EVP_get_cipherbyname 2018-01-16 14:51:44 -07:00
13325606b7 Peer cert ASN PARSE ERROR 2018-01-16 14:51:42 -07:00
6f44969e23 Signature check compatibility 2018-01-16 14:48:56 -07:00
2fdf98ebd4 eliminate redandant pad block, DES3 2018-01-16 14:48:56 -07:00
e8d628f61b wrap up no certificate alert related code in OPENSSL_EXTRA directive. 2018-01-16 14:48:55 -07:00
f690a980bf Avoid duplicated callback when error is overriden 2018-01-16 14:48:53 -07:00
92c9ff5f48 reset cipher suites after call to wolfSSL_set_options 2018-01-16 14:45:58 -07:00
0a3d6534c7 add SanityCheckMsgReceived in ProcessOldClientHello 2018-01-16 14:42:17 -07:00
d6e22346e3 Regarding with commit #4899aad884880bb8ef1859ea6b57eded013cd2b4, send no certificate alert only if SSLv3, otherwise proceed with size 0 certificate. 2018-01-16 14:42:17 -07:00
a918dfdb33 discard session chain in SSL_clear 2018-01-16 14:42:17 -07:00
2a4766198a add SendAlert(ssl, alert_fatal, bad_certificate); 2018-01-16 14:42:15 -07:00
401db67bcd WOLFSSL_MIN_DOWNGRADE, default: TLSv1_MINOR 2018-01-16 14:41:03 -07:00
5a40d8b3c2 rollingback certErr_ovrdn, VerifyCallback 2018-01-16 14:41:01 -07:00
dbad348537 DES3_cbc_encrypt with fragmentary size 2018-01-16 14:39:42 -07:00
a19813eab2 CertificateVerify, getting past when the error is overridden by VerifyCallback 2018-01-16 14:39:40 -07:00
2f1f86d5f2 VerifyCallback with any reason 2018-01-16 14:35:10 -07:00
8336e02931 send no certificate alert on SSLv3 if certificate size is 0. 2018-01-16 14:32:52 -07:00
b40218f7f4 certificate verify callback override 2018-01-16 14:32:50 -07:00
3d0c850e10 Change to send certificate message on SSLv3 even though certificate size is 0. 2018-01-16 14:27:50 -07:00
21a14403c6 wolfSSL_set_options behavior with downgrade version 2018-01-16 14:27:50 -07:00
973bac429c eliminate dupricate callbacks on -188 error 2018-01-16 14:27:48 -07:00
2cee800127 verifyCallback and SendAlert on invalid certificate, 2018-01-16 14:24:00 -07:00
4ab0934000 Merge branch 'Compatibility-Layer-Part5' of https://github.com/JacobBarthelmeh/wolfssl into Compatibility-Layer-Part5 2018-01-16 14:16:14 -07:00
c80cadb25f DES_set_odd_parity to MLB 2018-01-16 14:12:43 -07:00
a3ad8c5bae Implement DomainComponent in wolfSSL_X509_NAME_get_index_by_NID() and wolfSSL_X509_NAME_get_entry(). 2018-01-16 13:50:01 -07:00
aa99031346 restore WOLFSSL_NEITHER_END value. 2018-01-16 13:50:01 -07:00
4b13a0f301 Fix code review suggestion. 2018-01-16 13:50:01 -07:00
0edd97293d Add read or write phrase at each transaction message in wolfSSL_state_string_long(). 2018-01-16 13:50:01 -07:00
54a006f47d correct wolfSSL_get_state() by code review suggestion. 2018-01-16 13:50:00 -07:00
eb9c225304 Change to 2 dimension array as messages store in wolfSSL_state_string_long(). 2018-01-16 13:50:00 -07:00
fd05de8346 Fix some memory issues in wolfSSL_state_string_long(). 2018-01-16 13:50:00 -07:00
a32ae3e516 Change to kick info callback when state transition occurs. 2018-01-16 13:50:00 -07:00
7210e881a8 eliminate empty if body 2018-01-16 13:50:00 -07:00
b6abf4596e SetDhInternal in DH_compute_key 2018-01-16 13:49:59 -07:00
a643ae1907 return code of sk num, X509 store peer chain, and get text by NID fix 2018-01-16 13:49:58 -07:00
19244fc0c9 fix memory management 2018-01-16 13:44:53 -07:00
01cd58cc43 fix wolfSSL_DH_1536_prime 2018-01-16 13:44:53 -07:00
cc5e9e3dae adjustment for verify callback and certificate error depth 2018-01-16 13:44:52 -07:00
0b4e499e1d MD4 in md_tbl 2018-01-16 13:37:27 -07:00
47bca28b1d Fix compatibility, inl == 0, EVP_CipherUpdate 2018-01-16 13:37:26 -07:00
43ae3c9f59 ASN_PARSE_E in GetASNInt 2018-01-16 13:36:35 -07:00
3af8975a66 shadow global value error with cross-compiler 2018-01-16 13:34:35 -07:00
a6e6cc781d fix comment on function 2018-01-16 13:25:46 -07:00
934d149931 macro guards for checking if sha features used 2018-01-16 13:25:44 -07:00
a18c1abc13 add comments for SHA1 function 2018-01-16 10:39:22 -07:00
479b7e5ca8 SHA1 implementation and test 2018-01-16 10:39:22 -07:00
7cc7de9d4a add set msg callback tests 2018-01-16 10:39:21 -07:00
990e1f3ddf implement wolfSSL set msg callback function 2018-01-16 10:39:20 -07:00
01e6feb060 add hmac ctx copy testing to unit tests 2018-01-16 09:27:39 -07:00
47a2783cf1 size of buffer with DES ecb encrypt 2018-01-16 09:27:37 -07:00
982e9ab8ad implement hmac ctx copy function 2018-01-16 09:25:51 -07:00
b9001d3c4d implement X509 store ctx set error function 2018-01-16 09:12:02 -07:00
86112a574f implement X509 store ctx get ssl idx 2018-01-16 02:29:51 -07:00
e1d71d7ab8 add macro guard to RSA key generation 2018-01-16 02:17:43 -07:00
c8381afdc1 implement asn1 object to nid function 2018-01-16 02:17:43 -07:00
189a4d74c0 implement get error line data function 2018-01-16 02:17:42 -07:00
f393eb9176 implement ssl set session id context 2018-01-16 02:17:42 -07:00
ede8127569 implement function for setting CTX verify depth 2018-01-16 02:17:40 -07:00
762b7144e0 implement WOLFSSL get app data and set app data functions 2018-01-16 02:13:16 -07:00
3089fa2d27 group sk x509 functions together and implement sk x509 pop free 2018-01-16 02:10:15 -07:00
b369112ed3 implement CTX check private key function 2018-01-16 01:53:05 -07:00
86deb23d2f put a macro guard on stub functions and implement quick ones, alo update macro guards on recent BN and RSA tests 2018-01-16 01:51:00 -07:00
266132521c implement RSA key generation compatibility function and BN get word 2018-01-16 01:50:58 -07:00
248dce258e update dynamic type when freeing bio mem 2018-01-16 01:44:32 -07:00
39126cbb63 move variable declaration to top of function and silence compiler warning 2018-01-16 01:44:30 -07:00
fcb1a10a3c upadte memory bio read and setting bios in ssl struct 2018-01-16 01:42:34 -07:00
d0d762c1a2 add 1536bit DH prime from RFC 3526 2018-01-16 01:28:24 -07:00
bbff8f00ae WOFLSSL_STUB: SSL_CTX_check_private_key 2018-01-16 01:27:36 -07:00
d3f4845c55 EVP_PKEY_decrypt return value 2018-01-16 01:25:17 -07:00
47f234dce2 add wolfSSL_EVP_md4 function 2018-01-16 01:22:48 -07:00
ca50d13149 update const type compatibility 2018-01-16 01:18:32 -07:00
60ea23a6de fix invalid check on unsigned type 2018-01-16 01:18:30 -07:00
ad6cc6be2e fix clang build warnings and change return type 2018-01-16 01:12:11 -07:00
db3badb73a add GENERAL NAME stack functions and fix WOLFSSL_BIO free with files 2018-01-16 01:12:09 -07:00
6455801518 add TLSv1 method, getter function for cipher key length, and start stack functions 2018-01-16 00:58:33 -07:00
071e11ed58 Remove key->rsa setting in EVP_PKEY_get1_RSA 2018-01-16 00:29:08 -07:00
2cc7057071 Rollback 2018-01-16 00:29:07 -07:00
b7ffc263cf set pkey->rsa in d2i_PUBKEY 2018-01-16 00:29:07 -07:00
522e989292 set pkey->rsa in EVP_PKEY_get1_RSA 2018-01-16 00:29:07 -07:00
84bc5ba678 update DER to internal public key and add alert functions 2018-01-16 00:29:05 -07:00
1d792b0b44 detect SHA256, SHA384, and SHA512 NID types when signing 2018-01-16 00:19:53 -07:00
1f8df3e403 fix copy of RSA key from WOLFSSL_EVP_PKEY 2018-01-16 00:16:34 -07:00
32ca91cd2f fix return value type of fread 2018-01-16 00:16:34 -07:00
d1c05c1883 fix DER to internal private key function 2018-01-16 00:14:08 -07:00
d7e844d7a2 Refined NO_WOLFSSL_STUB 2018-01-16 00:05:33 -07:00
f49e58a169 Eliminat cross compiler warnings: BUF_MEM, SESSION_set_ex_data 2018-01-15 23:43:34 -07:00
7baa65e515 OpenSSL_add_all_digests, ciphers() to wolfCrypt_Init() 2018-01-15 23:40:02 -07:00
f5913d875f return type compatibility AES_set_encrypt/decrypt_key 2018-01-15 23:39:52 -07:00
31fe154d1c removed STUB mark from wolfSSL_ERR_load_crypto_strings 2018-01-15 23:34:15 -07:00
18019f1bae evp key flags and add WOLFSSL_BUF_MEM struct to WOLFSSL_BIO 2018-01-15 23:34:13 -07:00
4ab9cc65f3 fix EVP_get_cipherbyname("RC4") 2018-01-15 23:17:05 -07:00
46a0cedb08 return value for printing asn1 time 2018-01-15 23:17:03 -07:00
be1aba1f70 Improve performance of chacha20-poly1305 on AVX and AVX2.
Create an AVX2 version of the small block size chacha20 encryption code.
Only update the poly1305 once for the two lengths in chacha20-poly1305.
Poly1305 AVX2 uses AVX code to handle last bytes, store H whole.
Fix error codes in poly1305 test and add a longer data test case.
2018-01-16 13:45:36 +10:00
9a2b1636f9 xstat2err stat shadows global 2018-01-15 18:26:10 -07:00
8db170250e add support for file type BIO to PEM read private key 2018-01-15 18:03:24 -07:00
90179e554e add RC4 to EVP_get_cipherbyname 2018-01-15 18:03:24 -07:00
8ae1b7823e ecc.c, logging.c: local value shadows global 2018-01-15 18:03:21 -07:00
32bf163633 update base64 WOLFSSL_BIO encoding and checking session context ID 2018-01-15 17:54:46 -07:00
b5ab505d1e testing with WOLFSSL_BIO write 2018-01-15 17:40:51 -07:00
cda44c89ac account for different build options 2018-01-15 17:40:46 -07:00
dc4159546b refactor WOLFSSL_BIO read/write to bio.c and update read and write for base64 formating 2018-01-15 17:22:54 -07:00
91632d64f1 word32 casting inSz, wolfSSL_d2i_PrivateKey 2018-01-15 16:19:58 -07:00
c20bff79ad fix to fix EVP_CipherFinal stream cipher outlen 2018-01-15 16:19:57 -07:00
52a89349dd resolves redefinition warnings with clang builds 2018-01-15 16:13:45 -07:00
60b21ffa62 add compat functions; rand egd, rand file, bio_f_base64, bio pop, bio set flags, crypto set id callback, crypto set locking callback, evp pkey get1 RSA, PEM write bio RSA private key, set info callback and alter ERR GET REASON 2018-01-15 16:06:36 -07:00
d0abfbf3f3 turn on AES Direct if AES-CFB is enabled 2018-01-15 16:00:31 -07:00
455ffc2ad7 fix for windows fips build 2018-01-15 15:39:33 -07:00
6fd949279d fix EVP_CipherFinal outlen for stream cipher 2018-01-15 13:48:31 -07:00
27a9b23d2b fix ToTraditionalInline inSz type 2018-01-15 13:46:19 -07:00
930930ebc4 update DER to internal function with private RSA key 2018-01-15 13:46:18 -07:00
de2e7d4f75 fix some WOLFSSL_STUB api names 2018-01-15 13:46:17 -07:00
9910c51e67 add #ifndef NO_WOLFSSL_STUB 2018-01-15 13:41:55 -07:00
3415b05732 Merge pull request #1311 from ejohnstown/rsakeygen
RSA Key Generation (FIPS 186-4)
2018-01-15 13:26:44 -07:00
9e1283aedb update WOLFSSL_STUB - Part2 2018-01-15 13:05:39 -07:00
0c4f9c39c9 adjust AES-CFB location in code or --enable-armasm build and use wc_AesEncryptDirect function calls 2018-01-15 13:00:25 -07:00
6a129ca5c7 undate WOLFSSL_STUB - Part 1 2018-01-15 12:58:31 -07:00
e9f3d7f898 add the function ERR remove state and test for it 2018-01-15 10:56:54 -07:00
2e6f97621a Merge pull request #764 from JacobBarthelmeh/Compatibility-Layer-Part3
Compatibility layer part3
2018-01-13 09:57:14 -08:00
862e59f474 FIPS Update
1. White space changes. Converting tabs to spaces.
2. Add some comments explaining where a loop bound came from.
3. Added parameter checks to a function.
2018-01-12 15:37:22 -08:00
2945213871 update to d2i_PUBKEY function 2018-01-12 16:01:23 -07:00
0590f2493e Merge pull request #1314 from dgarske/cleanups
Minor fixes and cleanups for hash digest/block size
2018-01-12 13:00:53 -08:00
df7917fcd9 add --enable-aescfb, add comments, include of stdio with snprintf 2018-01-12 11:05:43 -07:00
3f8ecb4e70 Merge pull request #1313 from JacobBarthelmeh/Testing
DHE suite with test case and set server/client method
2018-01-12 10:03:03 -08:00
d04775ecfb Add check for AES with using AES cipher suite 2018-01-12 09:10:55 -07:00
3d6d80fe21 Improve AES-GCM code for Intel AVX1 and AVX2
Improve AES-GCM Intel performance by converting to pure inline ASM.
Improve AES-GCM Intel code algorithmically.
Split out platform specific code for AES-GCM encrypt and decrypt.
Move C implementation of AES-GCM to separate function to speed up Intel
ASM code.
Modified test to try all input byte sizes up to large benchmark size
when defined.
2018-01-12 10:51:32 +10:00
e8179b29ff Merge pull request #1299 from JacobBarthelmeh/PKCS7
handle degenerate case with PKCS7
2018-01-11 16:56:39 -07:00
f254a002a8 fix small stack with X509 print function 2018-01-11 15:41:23 -07:00
29ccc36fc2 refactor openssl test in test.c and update AES CFB compatibility function 2018-01-11 15:35:38 -07:00
953fc0d4a8 update CFB mode to handle partial AES block sizes 2018-01-11 15:28:56 -07:00
c2a6c6c395 add CFB mode for AES 2018-01-11 15:23:15 -07:00
857bbe65b5 update OID check for domain component 2018-01-11 14:47:12 -07:00
e2a16190a6 add NID_domainComponent in X509_NAME_get_text_by_NID 2018-01-11 14:37:49 -07:00
2fc494f66b add NID_domainComponent 2018-01-11 14:37:49 -07:00
289ad7a42c add CRYPTO_cleanup_all_ex_data 2018-01-11 14:31:32 -07:00
ae7783847c accept no key, IV case in EVP_CipherInit 2018-01-11 14:31:32 -07:00
d39ca40fee wrapper for Aes structure added and checks on structure size 2018-01-11 14:23:51 -07:00
f5d9cf0e5d XSNPRINTF not defined in the case of having no filesystem 2018-01-11 14:17:25 -07:00
68d7d26839 account for C++ compiler and fast rsa option 2018-01-11 14:12:11 -07:00
064a54f552 static analysis and windows fix 2018-01-11 14:08:22 -07:00
d2f1ced52f added x509 functions : x509 name cmp, i2d x509 name, i2d x509, x509 print 2018-01-11 14:04:03 -07:00
31186cd341 add RSA compat function and stub for x509 name compare 2018-01-11 13:30:02 -07:00
f968e65314 add macro for get thread id and update debug message for wolfSSL_HMAC 2018-01-11 11:54:24 -07:00
f2518ecbc4 RC4 compatibility functions added 2018-01-11 11:54:24 -07:00
40b56e724f AES cbc wrapper and AES cbf stub function 2018-01-11 11:54:24 -07:00
cf03aa4f52 Fix for building with FIPS where wolfCrypt FIPS already has enum value for MAX_DIGEST_SIZE. 2018-01-11 10:53:12 -08:00
4a9f5f3a7e add DES cksum and DES set odd parity 2018-01-11 11:32:00 -07:00
481f4765eb Cleanup to remove duplicate MAX_DIGEST_SIZE in hmac.h and refactor to use WC_MAX_DIGEST_SIZE. Cleanup for HMAC to include hash.h and refactor HMAC_BLOCK_SIZE to WC_HMAC_BLOCK_SIZE. Fix build warning in benchmark.c with unused variable if features are disabled. 2018-01-11 09:52:49 -08:00
e442f8dccf DHE suite with test case and set server/client method 2018-01-11 10:24:48 -07:00
bb52b0a7b9 Merge pull request #724 from JacobBarthelmeh/Compatibility-Layer-Part2
Compatibility layer part2
2018-01-11 08:28:54 -08:00
2cdcd560a2 Merge pull request #1307 from JacobBarthelmeh/Testing
fix check key pair match with ECC
2018-01-11 08:26:25 -08:00
df3c775f1d Merge pull request #1304 from cconlon/dsa1864
DSA 186-4 Key Generation, raw params and key import/export
2018-01-11 08:25:27 -08:00
e4093a56f5 remove .uvguix 2018-01-11 07:14:13 +09:00
f55fa9260d user_settings.h under RTE 2018-01-11 06:55:51 +09:00
c53961d4c5 fix MPU menu 2018-01-11 06:55:51 +09:00
e0ab3888ec remove NO_64BIT from STM32 options 2018-01-11 06:55:51 +09:00
379c6d0ad8 dummy RTC 2018-01-11 06:55:50 +09:00
a429f5ef98 add MPU menu to user_settings.h 2018-01-11 06:55:50 +09:00
8c000c05ee refactor MDK options in client/server.c 2018-01-11 06:55:50 +09:00
d8ca8586c0 remove ByteReverseWord64 in sha512 2018-01-11 06:55:50 +09:00
28e18e35f8 mdk5 error 2018-01-11 06:53:34 +09:00
f49bd43ba1 add HAL_HASH, HAL_RNG to benchmark project 2018-01-11 06:53:33 +09:00
f1cba97773 remove wolfssl_fgets 2018-01-11 06:53:33 +09:00
109dd05bb3 Fix benchmark and test project 2018-01-11 06:53:33 +09:00
d34fb44df2 listen parrameter for Keil tcp net 2018-01-11 06:53:33 +09:00
cd0c5d4b93 refactor WOLFSSL_DMK_ARM and WOLFSSL_KEIL_TCP_NET in wolfio.h 2018-01-11 06:53:33 +09:00
bb2e73566b add WOLFSSL_CMSIS_RTOS option in internal.h 2018-01-11 06:53:32 +09:00
c1fe2f36db add WOLFSSL_CMSIS_RTOS option 2018-01-11 06:53:32 +09:00
a53b7a8ced clean up files under projects 2018-01-11 06:53:32 +09:00
cf5708d156 Update SimpleServer, clean up other project files 2018-01-11 06:53:32 +09:00
84c216a5f7 new user_settings.h for mdk5 config menu 2018-01-11 06:53:32 +09:00
76e1a34fd0 update SimpleClient example 2018-01-11 06:53:32 +09:00
3f922b4254 update CryptBenchmark 2018-01-11 06:53:31 +09:00
b569dff905 update CryptTest project 2018-01-11 06:53:31 +09:00
59b9ab9097 place buffer on stack instead and zero it when done 2018-01-10 13:36:03 -07:00
d01d255985 FIPS Update
1. When configuring FIPSv2, force enable RSA-PSS and ECC.
2. Add more checks for FIPSv2 around the code.
2018-01-10 11:29:01 -08:00
788cc39498 FIPS Update
1. Switch in different versions of rsa.c depending on FIPS v1 or v2.
2. Add the Windows pragmas to rsa.c if building for FIPS v2.
3. Leave out FIPS wrappers from rsa.c if not building for FIPS v1.
2018-01-10 11:29:01 -08:00
6fdbe02291 ECC FIPS
Add the ECC API to the FIPS boundary. Included are ECDHE and ECDSA.
2018-01-10 11:29:01 -08:00
274c6ca492 RSA Update
1. Fix issue with new key gen options and using old FIPS releases.
2. Modify the FIPS configure option to handle an option for the updated FIPS.
2018-01-10 11:29:01 -08:00
a784142edf RSA Update
1. Added FIPS wrappers for MakeRsaKey(), CheckProbablePrime(), and RsaFlattenPublicKey().
2. Update the API test so that it used appropriate key and message sizes for the RSA testing.
3. Add function to get all parts of a flattened RSA key.
2018-01-10 11:29:01 -08:00
84f6093068 RSA Update
1. Replaced MakeRsaKey() function wth a version that follows the NIST prescribed process closer.
2. Added an additional check to RSA key generation to ensure that |p-q| > 2^((nlen/2)-100) per NIST FIPS 186-4 sec B.3.1.
3. Added public API for checking a number being probably prime according to FIPS 186-4.
4. Added a large integer used to check the lower bound of a possible prime.
2018-01-10 11:13:23 -08:00
4afa7c7e22 RSA Update
Added mp wrappers for fp_abs() and fp_2expt().
2018-01-10 11:11:56 -08:00
32a345e2f2 Merge pull request #1309 from SparkiDev/pss_var_salt_len
Add support in PSS for salt lengths up to hash length
2018-01-10 11:00:47 -08:00
8c900a2391 added in comments and check on return code 2018-01-10 10:33:48 -07:00
d78a6cebd8 allow DSA raw export functions to return buffer sizes 2018-01-10 10:21:58 -07:00
9839809c99 add better comments and update return values 2018-01-10 09:28:56 -07:00
89973a7eaf cast for call to ecc_point copy function 2018-01-10 09:28:56 -07:00
e9432005d4 build for no old names and fix valgrind report 2018-01-10 09:28:56 -07:00
439498b3c1 remove redefinitions and add guards 2018-01-10 09:28:56 -07:00
23b271da84 clean up after rebase 2018-01-10 09:28:56 -07:00
0deaf1e227 increase max memory bucket size to account for larger WOLFSSL structure with sessioncerts 2018-01-10 09:28:56 -07:00
a60db81d09 check on key type with SetRsaExternal and fix for function name after rebase 2018-01-10 09:28:56 -07:00
d1b24f2bb1 remove unneeded XFREE with small stack 2018-01-10 09:28:56 -07:00
13bc1f64b8 account for larger WOLFSSL structure with save session certs 2018-01-10 09:28:56 -07:00
cecdd50eab make NID values avaliable with OPENSSL_EXTRA build 2018-01-10 09:28:56 -07:00
4d9675bebe fix for PKCS12 create with small stack 2018-01-10 09:28:56 -07:00
d758c114b0 fix return value 2018-01-10 09:28:56 -07:00
1b7f4ad1dd return value check in EVP_PKEY_encrypt 2018-01-10 09:28:56 -07:00
09eeafe4f0 add cipher name "DES-EDE3" 2018-01-10 09:28:56 -07:00
c0db7d02f7 cast for const qualifier match on argument 2018-01-10 09:28:56 -07:00
06891fa14a session SSL object size increase with compatibility layer 2018-01-10 09:28:56 -07:00
513e3b7338 rebasing compatiblity layer on nginx work 2018-01-10 09:28:56 -07:00
641af21cb0 Fix AES192-ECB in EVP_CipherInit 2018-01-10 09:28:56 -07:00
5237a25699 Add rc4 to EVP_CipherUpdate 2018-01-10 09:28:56 -07:00
21021aa408 Fix EVP_Cipher padding control 2018-01-10 09:28:56 -07:00
326d889658 initialize extra name entries to 0 2018-01-10 09:28:56 -07:00
ab0bc32d4c resolve rebase by adding an error node pull function 2018-01-10 09:28:56 -07:00
7763a002f3 fix for static analysis warning 2018-01-10 09:28:56 -07:00
0f2a4be832 update tests and memory checking 2018-01-10 09:28:56 -07:00
7a7f686f16 add test case for X509_get_pubkey, d2i_PrivateKey 2018-01-10 09:28:56 -07:00
f802103923 add RSA_new, RSA_LoadDer in d2i_PrivateKey 2018-01-10 09:28:56 -07:00
00670233af account for fast rsa when testing get rsa size 2018-01-10 09:28:56 -07:00
c8233177c3 fix bio gets and enhance x509 get public key 2018-01-10 09:28:56 -07:00
734e728fba Fix padding control: EVP_CipherUpdate 2018-01-10 09:28:56 -07:00
150481699f add BIO_new_file: ssl.c, tests/api.c 2018-01-10 09:28:56 -07:00
546d31c51c add X509_load_certificate_file 2018-01-10 09:28:56 -07:00
8928160df7 memset structures to 0 in Init functions 2018-01-10 09:28:56 -07:00
340963742a memory bio flag mapped to wolfSSL 2018-01-10 09:28:56 -07:00
1765246cf7 bio gets test, certificate buffer tests, and increase max static memory bucket size with sessioncerts 2018-01-10 09:28:56 -07:00
ff8da2d4fe windows and no filesystem build warnings 2018-01-10 09:28:56 -07:00
79ea6b78bb add name entry and fix build without RSA 2018-01-10 09:28:56 -07:00
03a4b9d2fe return code checks for PKEY, EVP Sign test 2018-01-10 09:28:56 -07:00
54246053de WOLFSSL_RSA in EVP_PKEY structure and fixes for PKCS12 build 2018-01-10 09:28:56 -07:00
863034f20f Fixed RSA_verify. Add test on EVP_Sign/Verify 2018-01-10 09:28:56 -07:00
8e41d32950 EVP MD and PKEY test. Add PKEY_new/free 2018-01-10 09:28:56 -07:00
49816b95e0 Type mismatch AssertInt(x, y, op, er) in api.c 2018-01-10 09:28:56 -07:00
7252a138e0 ASN1 object functions 2018-01-10 09:28:56 -07:00
492809203d templates for upcoming compatibility functions 2018-01-10 09:28:56 -07:00
35ad1269a8 expand compatibility layer, hmac, dsa gen, pubkey from bio, pseudo rand 2018-01-10 09:28:56 -07:00
e391931711 error put function 2018-01-10 09:28:56 -07:00
704d765501 adjust compat. layer to not include wolfSSL headers where possible, add d2i for X509's, clang-3.3 build 2018-01-10 09:28:56 -07:00
e213e60471 PKCS 8 info function 2018-01-10 09:28:56 -07:00
03b0a07adb add BN pseudo random function 2018-01-10 09:28:56 -07:00
c552de77f4 PKCS12 create function 2018-01-10 09:28:56 -07:00
2e1068f30c Added stubs for new OBJ_cleanup, OBJ_nid2obj, OBJ_obj2txt. Added openssl/objects.h for compatibility. Moved around OBJ function defs. 2018-01-10 09:28:30 -07:00
aac050369a Added API unit tests for new BUF_MEM. Fixed wolfSSL_BUF_MEM_grow handling of negative “len” input. Added GPLv2 header to new buffer.h. 2018-01-10 09:28:30 -07:00
2a4ea5843d Added new openssl compatibility functions for BUF_MEM_new, BUF_MEM_grow and BUF_MEM_free. 2018-01-10 09:28:30 -07:00
c237980d47 typedef struct Aes in openssl/aes.h 2018-01-10 09:28:30 -07:00
d5a0b81e97 fix SSL_load_error_strings redefinition 2018-01-10 09:28:30 -07:00
392b1c6f36 EVP verify final type change. Resolve Ubuntu build and clang warning 2018-01-10 09:26:58 -07:00
921eb03a01 add PEM read bio private key function and update reading a memory bio 2018-01-10 09:26:58 -07:00
f9eb8f8f6d missing rename SSL_check_private_key, DSA_dup_DH 2018-01-10 09:26:58 -07:00
9290b2e464 RAND cleanup and no-op functions for compatibility -- brackets added to ssl.c if statements for gcc-6 2018-01-10 09:26:58 -07:00
4f76e33bc7 add test on EVP_Encrypt/DecryptFinal 2018-01-10 09:26:58 -07:00
d113acb5ab add EVP_MD_CTX_type 2018-01-10 09:26:58 -07:00
a29f15feff add EVP_VerifyFinal, RSA_verify 2018-01-10 09:26:58 -07:00
54af9fb884 compatibility mapping for STORE_CTX functions and added test case 2018-01-10 09:26:58 -07:00
f0c19ba9b2 add internal to DER X509 function 2018-01-10 09:26:58 -07:00
11d42f5112 add X509 new function 2018-01-10 09:26:58 -07:00
7da0f50457 tests for added DES functions and fix check on DES key 2018-01-10 09:26:58 -07:00
cf6f4718e8 add public function to check if a DES key is weak 2018-01-10 09:26:58 -07:00
bebe60a4c1 EVP PKEY RSA encrypt/decrypt, tentative 2018-01-10 09:26:58 -07:00
a11e389bc8 EVP_PKEY templates 2018-01-10 09:26:58 -07:00
f695683fd0 begin BIO gets functions 2018-01-10 09:26:58 -07:00
2b75d0faf3 asn1 string compatibility 2018-01-10 09:26:58 -07:00
b9197f96db Merge pull request #1305 from JacobBarthelmeh/DH
add dh header to test.h and adjust macro guards
2018-01-10 08:09:51 -08:00
36f621db1c Merge pull request #1308 from JacobBarthelmeh/Compatibility-Layer
change place holders to be void* type and add comment to compatibilit…
2018-01-10 08:08:54 -08:00
87109dd46e Add support in PSS for salt lengths up to hash length
Added non-inline RSA-PSS verify
Added tests of RSA-PSS
Fixed comments in TLS v1.3 code
Added PSS salt length error
2018-01-10 10:16:32 +10:00
e77a05c3b2 change place holders to be void* type and add comment to compatibility header files 2018-01-09 17:08:54 -07:00
0bfa399b6c fix check key pair match with ECC 2018-01-09 16:13:46 -07:00
fc754ba88e Merge https://github.com/wolfssl/wolfssl 2018-01-09 14:15:39 -07:00
e6cef73658 html and pdf documentation for wolfssl, generated by doxygen 2018-01-09 14:12:06 -07:00
7d3c502c47 add dh header to test.h and adjust macro gaurds 2018-01-09 12:06:43 -07:00
30f8f7d409 Make clean rules more portable
(If this directory were ever to move using ../../ is insufficient. Use the WOLFSS_ROOT variable instead.
2018-01-09 10:48:13 -07:00
09bb2e5837 clarify DSA variable names, use WOLFSSL_BIT_SIZE 2018-01-08 17:06:33 -07:00
4c65726091 Merge pull request #1296 from JacobBarthelmeh/DH
add DH Agree callback
2018-01-08 15:19:12 -08:00
e42fea8710 add unit tests for DSA raw key and param import/export functions 2018-01-08 13:36:06 -07:00
fc563550c6 add DSA raw params import export, raw key export functions 2018-01-08 13:36:01 -07:00
61f6b9ce0f add DSA 186-4 key generation 2018-01-08 09:54:27 -07:00
11fdef0206 Merge pull request #1297 from cconlon/pkcs7signedfix
fix for PKCS#7 SignedData RSA signature types, include hash function
2018-01-05 13:34:12 -07:00
b22ae9de4c add DH callback to example server and client 2018-01-05 11:56:59 -07:00
91138648aa Merge pull request #1302 from dgarske/fix_readme
Fix typo in readme for enabling old TLS 1.0
2018-01-05 09:15:30 -07:00
e1505bb857 Merge pull request #1301 from ejohnstown/drbg-warn
DRBG Warning Fix
2018-01-04 18:43:31 -08:00
bc8625cbea Fix typo in readme for enabling old TLS 1.0 using ./configure --enable-tlsv10. 2018-01-04 15:46:03 -08:00
983aa97f94 DRBG Warning Fix
1. Some compilers will warn on unused constants. Removed the constant DRBG_ERROR which is unused and causing warnings on a particular build.
2. Renumbered the remaining internal return codes.
2018-01-04 15:22:58 -08:00
9315d18901 Merge pull request #1294 from dgarske/log_improve
Improvements to logging
2018-01-04 10:15:22 -08:00
34df8b98bf fix for PKCS#7 SignedData RSA signature types, include hash function 2018-01-04 10:55:17 -07:00
effb751204 Add build scripts for default SGX build and improve cleanup 2018-01-04 10:38:56 -07:00
bc7b1a8a1f handle degenerate case with PKCS7 2018-01-04 09:45:43 -07:00
915f628bc7 add DH Agree callback 2018-01-03 16:47:15 -07:00
3f53e8d1dd Merge pull request #1270 from JacobBarthelmeh/CAAM
add CAAM with INTEGRITY support
2018-01-03 08:14:46 -08:00
ab3d1e85cf Fix to disable log output for WOLFSSL_ERROR with WOLFSSL_NGINX defined. Cleanup on the loggingEnabled. 2018-01-02 19:30:33 -08:00
d0bd52910f Fix for issue with unit test where mutliple threads are outputting log data. 2018-01-02 18:20:23 -08:00
01f603ad65 add documentation, macro for no AES hw or HASH hw, use usleep when waiting for entropy 2018-01-02 15:00:35 -07:00
f2375f3fee Merge pull request #1271 from SparkiDev/chacha20_sb
Improve performance of small number of blocks for chacha20
2018-01-02 09:40:49 -08:00
d8ff36e692 Merge pull request #1285 from jrblixt/unitTest_api_addEcc-PR08042017
Add ECC unit test functions.
2017-12-29 15:02:07 -07:00
6c76a89785 Add ECC unit test functions.
Change per David RE: WOLFSSL_ATECC508A
Jenkins fix.
Changes per Chris.
2017-12-29 13:03:45 -07:00
b53f2a1ac1 Improvements to logging. Added new build option WOLFSSL_DEBUG_ERRORS_ONLY to reduce logging/code size when building with DEBUG_WOLFSSL. Added new WOLFSSL_ERROR_MSG(const char* msg) API for logging errors. Exposed the logging API's. Improvements to the wolfCrypt logging_test. Moved wolfSSL_Debugging_ON and wolfSSL_Debugging_OFF to logging.h. 2017-12-29 10:44:51 -08:00
0af93ffd08 Merge pull request #1290 from jrblixt/unitTest_api_addEd25519-PR08092017
Added Ed25519 to unit test functions.
2017-12-29 11:31:48 -07:00
ad4cf69993 Moved doxygen API comments in to a seperate directory 2017-12-29 10:57:14 -07:00
8a51df9fd8 Spacing issue per Chris. 2017-12-29 09:48:35 -07:00
272e37767b Merge pull request #1293 from dgarske/bench_emb
Fix for building with `BENCH_EMBEDDED`
2017-12-29 09:19:50 -07:00
f71047ef2d Fix for building with BENCH_EMBEDDED. Fix for building without OPENSSL_EXTRA where wolfSSL_OPENSSL_malloc assumes size_t is defined. Improvements to the GCC-ARM IDE example. 2017-12-29 08:19:21 -08:00
f492c4f120 Merge pull request #1264 from dgarske/wolf_extra
Adds new `WOLFSSL_EXTRA` define to expose useful compatibility API's
2017-12-28 16:10:09 -08:00
555551b745 Added Ed25519 to unit test functions. 2017-12-28 09:42:51 -07:00
83cb000958 Merge pull request #1289 from jrblixt/unitTest_api_addCmac-PR08162017
AES_CMAC unit test functions added.
2017-12-27 15:54:32 -07:00
84ecf94263 spelling mistakes, formatting, and change error name 2017-12-27 15:24:14 -07:00
0c709a9088 Merge pull request #1098 from jrblixt/unitTest_api_addSha3-PR08112017
Sha3 unit test functions.
2017-12-27 15:23:14 -07:00
3c6443e1e5 Added wolfSSL_CTX_set_client_CA_list and wolfSSL_SSL_CTX_get_client_CA_list to WOLF_EXTRA. 2017-12-27 08:55:28 -08:00
d75c2e2a91 Added new WOLFSSL_EXTRA define for expanded API's without openssl extra. Removed old GOAHEAD_WS, which had build errors and current project requires full openssl extra compatability. Fix unused arg build warnings for OCSP. The WOLFSSL_EXTRA adds: wolfSSL_CTX_set_quiet_shutdown, wolfSSL_set_quiet_shutdown, wolfSSL_set_accept_state and wolfSSL_set_connect_state. 2017-12-27 08:55:28 -08:00
0e9cd7a3d7 Merge pull request #1292 from moisesguimaraes/fixes-ocsp-stapling
fixes OCSP Stapling v2 tests
2017-12-27 08:53:18 -08:00
263525d812 enables OCSPStapling CM for ocspstapling2 2017-12-26 22:57:20 -03:00
43c234029b adds a call to wolfSSL_CTX_EnableOCSPStapling() on client.c to fix ocspstapling2 tests and removes unnecessary 'kill ' from the test scripts 2017-12-26 22:32:21 -03:00
22fc90006b AES-XTS performance enhancement 2017-12-23 14:44:32 -07:00
cf1575fafb AES-GCM performance enhancement 2017-12-23 14:44:32 -07:00
6d3166316b set input size constraints for AES-ECB mode with driver 2017-12-23 14:44:31 -07:00
fe7dec0edb refactor input/output with AES and fix sizes passed in 2017-12-22 12:18:04 -07:00
1bbe18bb8d Merge pull request #1234 from abrahamsonn/readme-fix
README updates to attempt to improve GitHub search positioning
2017-12-21 16:29:03 -07:00
2660ff0b93 Merge pull request #1251 from kojo1/openSSL-Compat-201711
openSSL compatibility 201711
2017-12-21 16:25:46 -07:00
b3eef2b10e formating and removing white space, also added sanity check on blob arguments 2017-12-21 14:26:22 -07:00
d1ee0f3d0d Merge pull request #1288 from cconlon/release3.13
wolfSSL 3.13.0 README and version updates
2017-12-21 12:01:38 -08:00
9c74c4d69b update library version for 3.13.0 in rpm/spec.in 2017-12-21 10:09:29 -07:00
8bebadcd4b update library version for 3.13.0 in configure.ac/version.h 2017-12-21 09:54:19 -07:00
d848a15fc8 update README for 3.13.0 2017-12-21 09:48:52 -07:00
5f4cc1a5ed Merge pull request #1287 from cconlon/inferfixes
Release fixes from Facebook infer
2017-12-20 17:57:17 -08:00
212f2d0ca8 Merge pull request #1286 from cconlon/fixes
Release prep fixes
2017-12-20 16:32:45 -08:00
22f25fa9bb add NULL ctx argument check to wolfSSL_X509_STORE_CTX_set_time() 2017-12-20 17:30:09 -07:00
8ab4e5d18c fix NULL pointer dereference in wolfSSL_CTX_new() for ctx->srp if ctx is NULL 2017-12-20 17:21:57 -07:00
6bb60581ea free WOLFSSL_BIGNUM when wolfSSL_BN_mod_inverse() fails if dynamic 2017-12-20 17:04:59 -07:00
4552c8a4a7 AES_CMAC unit test functions added. 2017-12-20 15:44:44 -07:00
adc8ca0f16 api.c fix for fast-rsa 2017-12-20 15:13:13 -07:00
be4d3c8321 fix for SetBitString() defined but not used 2017-12-20 15:02:35 -07:00
7bc5bcb86a benchmark.c fixes for NO_MAIN_DRIVER, const arrays 2017-12-20 14:55:35 -07:00
fd292b1ae4 check key for NULL in wc_ecc_import_private_key_ex() 2017-12-20 14:45:46 -07:00
28582ad5d9 remove HMAC from driver, it was never completely stable yet 2017-12-20 14:21:15 -07:00
51c3427a27 Merge pull request #1284 from cconlon/fixes
scan-build, valgrind, and test.c fixes
2017-12-20 13:06:26 -08:00
20e69460b0 minor change of variable name and add settings check 2017-12-20 13:59:20 -07:00
0c01533fe4 Merge pull request #1280 from dgarske/crypto_hw
Add crypto hardware support for ECC sign
2017-12-20 11:34:39 -08:00
2460a3de3d fix asn_test print in test.c 2017-12-20 12:28:27 -07:00
e97f8b5a9c fix scanbuild issues, internal.c and tfm.c 2017-12-20 12:18:49 -07:00
f93ed32cb3 fix scanbuild issue, use of NULL pointer in wc_Sha256Update 2017-12-20 11:48:09 -07:00
4dc49590db Merge pull request #1282 from SparkiDev/tls13_win
Fix for building TLS v1.3 code on Windows
2017-12-20 10:38:27 -08:00
e4ac38c532 fix valgrind use of uninitialized value warning 2017-12-20 11:35:30 -07:00
351a673ec0 Add AES-CCM hardware acceleration support and other fixes 2017-12-20 11:16:11 -07:00
3a6d5b8f90 formating / add c files to distro / remove unneeded macros 2017-12-20 11:16:11 -07:00
5fa9455bf9 add CAAM with INTEGRITY support 2017-12-20 11:16:11 -07:00
98603d9e74 Sha3 unit test functions.
Code review changes per Chris.
2017-12-20 10:49:24 -07:00
696ddc9b71 Added wolfSSL_CTX_SetDevId and wolfSSL_SetDevId to allow setting devId. Use #define macro to map the original async wolfSSL_CTX_UseAsync and wolfSSL_UseAsync API's to the new ones. 2017-12-20 09:08:01 -08:00
ac8996c9bc Merge pull request #1281 from dgarske/fix_ocsp_nb_checkall
Fix for OCSP non-blocking with check all flag set
2017-12-20 09:04:09 -08:00
d94d90a22e Merge pull request #1276 from dgarske/http_appstr_list
Fix for processing HTTP responses to accept a list of application strings
2017-12-20 09:03:14 -08:00
b40b13c0eb Merge pull request #1279 from SparkiDev/fe_init_ed25519
Fix fe_init to be avaible when compiling ED25519 only
2017-12-20 09:12:42 -07:00
4712376ce1 Fix for OCSP non-blocking with check all flag set. 2017-12-19 16:52:47 -08:00
fa2db8b22e Fix for building TLS v1.3 code on Windows 2017-12-20 10:32:33 +10:00
9f51674be4 Merge pull request #1278 from cconlon/winfix
fix Windows Visual Studio warnings
2017-12-19 15:55:13 -08:00
aa4f38143e Fix fe_init to be avaible when compiling ED25519 only 2017-12-20 09:27:50 +10:00
574beff4cc fix Windows Visual Studio warnings 2017-12-19 13:57:33 -07:00
c0f2a0c77b Support for crypto hardware on ECC sign using Crypto_EccSign. 2017-12-19 12:51:45 -08:00
5235e256c7 Merge pull request #1277 from JacobBarthelmeh/Testing
Testing
2017-12-19 12:38:35 -08:00
89e57f4159 protect against AES-CCM copy to smaller local buffer 2017-12-19 11:55:40 -07:00
0d5a772348 revert macro to allow AES keywrap and AES XTS with ARM assembly 2017-12-19 11:49:30 -07:00
d6472c7f71 Merge pull request #1272 from ejohnstown/pkcs5-fix
PKCS5 Fixes
2017-12-19 10:09:14 -08:00
05d0176b84 Fix for processing HTTP responses to accept a list of application strings. Specifically for CRL which has both "application/pkix-crl" and "application/x-pkcs7-crl". Both CRL formats are the same and both parse correctly. Applies to --enable-crl with HAVE_CRL_IO only. 2017-12-19 09:54:03 -08:00
ba4ff62953 Merge pull request #1169 from JacobBarthelmeh/Testing
fix DH free with switch from server to client side
2017-12-19 09:50:41 -08:00
9a6a4f6e02 Merge pull request #1245 from danielinux/chibios_port
Chibios port
2017-12-19 09:19:38 -08:00
fd0088fb34 Merge pull request #1269 from ghoso/signal-dev
Add support for libsignal-protocol-c
2017-12-19 09:30:03 -07:00
b9cda18be9 change type with free to match malloc'd type 2017-12-19 09:08:41 -07:00
7662bd58f0 fix DH free with switch from server to client side 2017-12-19 09:08:41 -07:00
5be8c7fa1a Merge pull request #1275 from dgarske/fix_async_sim_wctest
Fix for wolfCrypt test with async
2017-12-19 07:19:04 -08:00
d08572164f Merge pull request #1148 from dgarske/fix_ecc508a
Fixes to `WOLFSSL_ATECC508A` support to allow import/export
2017-12-19 07:17:41 -08:00
f939f407c5 Merge pull request #1268 from cconlon/eccpkcs8
Add ECC private key export for unencrypted PKCS#8
2017-12-19 07:16:21 -08:00
31aa5e308d Improve performance of small number of blocks for chacha20 2017-12-19 18:02:21 +10:00
bfed9f28d3 Modification for compliling application with libsignal-protocol-c. 2017-12-19 13:19:05 +09:00
e6334fdaf8 PKCS5 Fixes
1. Fix issue where optional and default items in the ASN.1 blob were not getting "parsed" correctly.
2. Added OIDs for the SHA based HMACs.
3. Removed some redundant constants from key decryption.
4. Updated the DecryptKey() function to handle AES256-CBC.
5. Updated the DecryptContent() function to act like DecryptKey().
2017-12-18 17:08:29 -08:00
ddae61afbd Merge pull request #1259 from dgarske/fix_ocsp_nonblock
Fixes for handling non-blocking OCSP
2017-12-18 16:43:24 -08:00
6b4b17a07d Fix for wolfCrypt test with async simulator, which requires polling on the ECC make key. 2017-12-18 16:39:53 -08:00
680f78f2ae Merge pull request #1274 from dgarske/fix_jenkins
Fixes to address Jenkins issues
2017-12-18 16:31:02 -08:00
57c0b5d4ac Adjustment to fix for --enable-32bit where time_t is not long. 2017-12-18 14:34:40 -08:00
5b003918ef Fix for #ifdef issue causing some X509 functions to be unavailable when DH and ECC were disabled. Fix for HashAlgoToType not being available if building with DH and ECC disabled and RSA PSS enabled. 2017-12-18 11:10:12 -08:00
bbd27b491e Fix for building with --enable-32bit where test assumes time_t is long. 2017-12-18 11:04:40 -08:00
7a59275688 add arg check, wolfSSL_CTX_clear_options 2017-12-16 09:03:44 +09:00
6421324287 add arg check 2017-12-15 05:45:45 +09:00
db7cd22645 remove ECC key conversion functions from WOLFSSL_KEY_GEN 2017-12-13 09:44:47 -07:00
43ef843257 add ECC private key export for unencrypted PKCS#8 2017-12-13 09:44:36 -07:00
bacbc06856 Merge pull request #1263 from SparkiDev/fe_init_fix
Only implement and call fe_init when available
2017-12-12 16:25:09 -08:00
26019b3441 Merge pull request #1262 from SparkiDev/benchmark
Improve benchmark program
2017-12-11 15:55:00 -08:00
1bf8dc5246 Merge pull request #1265 from SparkiDev/sp_init_mp
Initialize mp for compilers that don't track if conditions
2017-12-11 09:19:16 -08:00
704b332960 Add usage information
Only recognize on command line algorithms compiled in.
2017-12-11 11:40:11 +10:00
8ee1996e39 Initialize mp for compilers that don't track if conditions 2017-12-11 09:44:47 +10:00
137eb291cd Merge pull request #1261 from SparkiDev/tls_def_fix
Fix placement of #endif
2017-12-08 07:57:10 -08:00
c457ca462a Only implement and call fe_init when available 2017-12-08 14:16:24 +10:00
2954b67f96 Improve benchmark program
Supports command line choosing of algorithms to benchmark.
Display benchmarks in powers of 10 (1000, 1000*1000) instead of
powers of 2 (1024, 1024*1024).
2017-12-08 13:57:34 +10:00
de05c563b6 Fix to handle non-blocking OCSP when WOLFSSL_NONBLOCK_OCSP is defined and not using async. OCSP callback should return OCSP_WANT_READ. Added ability to simulate non-blocking OCSP using TEST_NONBLOCK_CERTS. 2017-12-08 03:12:33 +01:00
4f97a49213 Fix placement of #endif 2017-12-08 09:13:53 +10:00
87690ce8bd Merge pull request #1257 from dgarske/xcode_fixes
Xcode project improvements inc/benchmark tool
2017-12-07 08:44:03 -08:00
bababf115a Moved to IDE/XCODE. Fixed build warnings with xcode. Updated the user_settings.h to support fast math, ECC, timing resistance, single precision math, ARMv8, SHA3, ChaCha20/Poly1305, Ed/Curve25519 and ensure default disables are defined. Added Xcode iOS benchmark example. Runs wolfCrypt test, wolfCrypt benchmark and the new TLS benchmark by cipher suite. 2017-12-07 11:02:19 +01:00
24ef88f6f0 Merge pull request #1258 from SparkiDev/sp_from_mp_fix
Fix loading of MP
2017-12-07 01:58:56 -08:00
d78734f37d Fix loading of MP 2017-12-07 17:50:47 +10:00
4c4b02bb31 Merge pull request #1256 from SparkiDev/ed25519_perf
Ed25519 perf
2017-12-04 14:42:03 -08:00
5a56757018 Merge pull request #1250 from SparkiDev/curve25519_asm
Intel ASM code for Curve25519
2017-12-04 14:38:12 -08:00
d11581aaff new lines, BAD_FUNC_ARG 2017-12-01 09:49:38 +09:00
34ecfda145 Check for ADX instructions 2017-12-01 08:55:46 +10:00
e8e5179d1c Optimize the Ed25519 operations 2017-12-01 08:54:12 +10:00
29943dc352 Redo reduce and muladd to be cleaner 2017-12-01 08:54:12 +10:00
f2b8ffa919 Check for ADX instructions 2017-12-01 08:51:24 +10:00
3cdf3565c8 Intel ASM code for Curve25519
AVX2 added as well
2017-11-30 12:34:05 +10:00
98235f9e36 fix hard tabs 2017-11-30 09:08:59 +09:00
57e5648a5d Merge pull request #1247 from kaleb-himes/pre-processor-logic-fix
Proposed fix for build-time errors with (mp/fp)_s_rmap when debug ena…
2017-11-30 09:29:28 +10:00
909b519139 Merge pull request #1254 from dgarske/fix_ecpoint_leak
Fix leak with `wolfSSL_EC_POINT_mul`
2017-11-29 14:51:56 -08:00
eeca36dc75 Merge pull request #1249 from SparkiDev/avx2_fix
Make AVX2 code compile in on Mac
2017-11-29 14:49:30 -08:00
8e91d9ffd9 Merge pull request #1244 from SparkiDev/sha3_fast
SHA-3 fast code is smaller and a bit faster
2017-11-29 14:45:57 -08:00
ecb9e799a9 Merge pull request #1243 from dgarske/def_sec_reneg
Adds new define to enable secure-renegotiation by default
2017-11-29 14:40:23 -08:00
b664a1187b fix hard tabs, new line 2017-11-29 07:03:00 +09:00
af1f48ccb5 Fix leak with EC Point mul, where inSet wasn't being set, which caused a leak. 2017-11-28 13:00:26 -08:00
64caf325f8 add ctx == NULL checks, fix spacing 2017-11-28 10:16:24 +09:00
792672e77b Merge pull request #1252 from kojo1/IAR-EWARM
update IAR-EWARM projects
2017-11-27 11:37:57 -07:00
718455f9c6 Merge pull request #1248 from cconlon/oidfix
fix CTC_SHA224wECDSA oid sum
2017-11-27 09:13:03 -08:00
a4f5b2e29f Added the requested changes 2017-11-27 09:50:12 -07:00
a14b67100b refactor following feedback 2017-11-27 08:47:58 -07:00
4cd39b4bfb refine dummy current_time to avoid infinit waiting loop 2017-11-27 09:03:50 +09:00
a3b2817036 refine user_settings.h for EWARM projects 2017-11-27 09:02:40 +09:00
86a287be01 fix compile error with EWARM 2017-11-27 09:01:33 +09:00
f53fca88e6 Eliminate unused macro options in project properties 2017-11-27 09:00:19 +09:00
8a1de2f69d update file listed in wolflib project 2017-11-27 07:59:06 +09:00
8f31d36bcd gurde SSL_get_peer_cert_chain->count check by macro option 2017-11-25 06:25:15 +09:00
eb85accea9 Fix 'buffer' shadows a global (2) 2017-11-25 03:59:35 +09:00
79b648c006 Fix ‘buffer’ shadows a global 2017-11-24 18:21:32 +09:00
ac83445032 eliminate redundant dec, wolfSSL_CTX_get_options 2017-11-24 13:26:40 +09:00
a320ca92fb fix rebase miss 2017-11-24 08:21:27 +09:00
fce1b90b63 SSL_get_peer_cert_chain(ssl)->count value check in api.c 2017-11-24 08:09:41 +09:00
91c1a0a810 move (void) for Visual Studio 2017-11-24 08:07:32 +09:00
803bd7c612 Review feedbacks: refactor test_SSL_set_options and add SSL_clear_option 2017-11-24 08:07:32 +09:00
c6988b74b1 Remove unused files 2017-11-24 08:03:16 +09:00
c195c85999 merge master 2017-11-24 08:03:16 +09:00
f1befc0e87 Make AVX2 code compile in on Mac
Fix problems not seen due to AVX2 define being off.
2017-11-24 08:49:45 +10:00
3c0a146cd7 SSL_CTX_clear_options return verue 2017-11-24 06:27:36 +09:00
dace30cfac Missing X509_STORE_CTX_free(ctx); 2017-11-24 06:27:36 +09:00
a8bc2df19c static bucket size for SSL 2017-11-24 06:27:36 +09:00
05b9b39e06 free ctx->alpn_cli_protos 2017-11-24 06:27:36 +09:00
196bcf6f51 remove unused velues 2017-11-24 06:27:36 +09:00
279f12cc7d fix test_wolfSSL_msgCb 2017-11-24 06:27:35 +09:00
0d69376e95 SSL_CTX_clear_options macro switch 2017-11-24 06:05:01 +09:00
527c94c06b add test_wolfSSL_msgCb 2017-11-24 06:02:01 +09:00
a9cbb0ee10 add api tests 2017-11-24 05:52:25 +09:00
5f025de0f8 pull ssl->protoMsgCb() from Part5 2017-11-24 05:49:41 +09:00
06455436d3 add ERR_load_BIO_strings 2017-11-24 05:49:41 +09:00
5b16fe2f3c add X509_STORE_CTX_set_verify_cb 2017-11-24 05:49:41 +09:00
b8c5218ad3 add SSL_CTX_set_alpn_protos 2017-11-24 05:49:41 +09:00
1bcec16509 add SSL_get_peer_cert_chain 2017-11-24 05:47:20 +09:00
a320464c5a add SSL_set_msg_callback_arg 2017-11-24 05:44:54 +09:00
7e579e46aa pull SSL_set_msg_callback from Part5 2017-11-24 05:42:35 +09:00
12a9f41755 add SSL_CTX_clear_options 2017-11-24 05:38:24 +09:00
d967129581 add BN_mod_mul 2017-11-24 05:38:24 +09:00
cf00f6ae1d fix CTC_SHA224wECDSA oid sum 2017-11-22 17:07:13 -07:00
8c15c65343 Merge pull request #1216 from abrahamsonn/windows-errors
Windows errors
2017-11-21 15:21:14 -08:00
2308b0769a Changed "ifdef _WIN32" to "ifdef USE_WINDOWS_API" 2017-11-21 14:15:47 -07:00
ff64ca17f4 Merge branch 'origin/master' into chibios_port 2017-11-21 20:00:07 +01:00
400d56a1a9 SHA-3 fast code is smaller and a bit faster 2017-11-21 12:22:08 +10:00
01233edb44 Merge pull request #1242 from cconlon/pkcs7des
PKCS7 and SCEP need either AES or 3DES enabled, error out if not
2017-11-20 16:27:50 -08:00
60a6da1c14 Adds new option to enable secure-renegotiation by default (used by IIS for client authentication). WOLFSSL_SECURE_RENEGOTIATION_ON_BY_DEFAULT. 2017-11-20 16:15:06 -08:00
e3a4f468c1 PKCS7 and SCEP need either AES or 3DES enabled, error out if not 2017-11-20 13:16:44 -07:00
baf655df23 Merge pull request #1241 from SparkiDev/tls13_rec_pad
Handle reading record layer padding in TLS v1.3
2017-11-20 11:35:15 -08:00
5ccf54dd1a Handle reading record layer padding 2017-11-20 12:08:18 +10:00
935f33ab54 Merge pull request #1240 from cconlon/tls13issue
fix illegal use of type warning on Windows for TLS 1.3
2017-11-17 13:12:41 -08:00
21e391fbce Merge pull request #1235 from SparkiDev/tls13_draft21
Update code to support Draft 21 of TLS v1.3
2017-11-17 13:11:03 -08:00
4839aca7ba fix illegal use of type warning on Windows for TLS 1.3 2017-11-17 06:42:15 -07:00
8badc334ea Merge pull request #1239 from JacobBarthelmeh/AES
fix AES ECB sanity checks
2017-11-16 13:57:47 -08:00
6793a7bc4c Voided 2 variables outside of their ifdef's 2017-11-16 14:54:54 -07:00
53ec80b291 Merge pull request #1238 from cconlon/pkcs7cleanup
PKCS7 cleanup: remove dependencies on 3DES and SHA1
2017-11-16 13:51:57 -08:00
653cce17e5 Merge pull request #1237 from cconlon/pkcs7encrypted
PKCS7: optionally compile out EncryptedData content type
2017-11-16 13:50:43 -08:00
9d2c739d6d Merge pull request #1236 from kaleb-himes/sean-changes
Fix AES-GCM code to compile with GCC 4.8.*
2017-11-16 13:50:08 -08:00
947fceda6d Merge pull request #1232 from dgarske/disable_oldtls_v1_0
Disable TLS v1.0 by default
2017-11-16 13:49:03 -08:00
d741474f03 Merge pull request #1220 from SparkiDev/sha2_asm_perf
Improve speed of Intel AVX1/2 ASM for SHA-256 and SHA-512
2017-11-16 13:47:12 -08:00
877b6c35a2 Merge pull request #1233 from kaleb-himes/TI_CRYPT_UPDATE
resolving build-time issues when using TI-CRYPT
2017-11-16 12:40:46 -08:00
a89280ac91 fix AES ECB sanity checks 2017-11-16 13:27:57 -07:00
30e8f5539b PKCS7 cleanup: remove dependencies on 3DES and SHA1 2017-11-16 10:37:47 -07:00
ea7f2e4548 PKCS7: optionally compile out EncryptedData type with NO_PKCS7_ENCRYPTED_DATA 2017-11-16 09:15:02 -07:00
20edc0e961 Remove use of data from SHA-2 data structures
Only compiled and used with Intel speed-up code
2017-11-16 08:59:21 +10:00
fd9a2a8d62 Change function to macro for GCC 4.8.*
GCC 4.8.* bug can't handle parameter that is a pointer to __m128i
2017-11-16 08:32:45 +10:00
098edc2845 Merge pull request #1229 from dgarske/fix_static_rsa_pad
Fix for handling of static RSA padding failures
2017-11-15 12:31:38 -08:00
9dd8baecc0 Fix when RORX implementations are compiled and used 2017-11-15 16:56:19 +10:00
cb8e284464 Update code to support Draft 21 of TLS v1.3 2017-11-15 16:40:48 +10:00
901eab7e06 README updates to attempt to improve GitHub search positioning 2017-11-14 15:51:32 -07:00
9ce73cf1a6 Add stub functions for Aes/Des Init/Free in TI_CRYPT 2017-11-14 15:30:16 -07:00
fe7318455f Incorrect placement of variable casting 2017-11-14 15:19:40 -07:00
110409218c Fix for sniffer to use TLS v1.2 client method. 2017-11-14 14:09:44 -08:00
fd455d5a5e Fix for handling of static RSA PKCS formatting failures so they are indistinguishable from from correctly formatted RSA blocks (per RFC5246 section 7.4.7.1). Adjusted the static RSA preMasterSecret RNG creation for consistency in client case. Removed obsolete PMS_VERSION_ERROR. 2017-11-14 14:05:50 -08:00
f17470b42b Added more of the requested changes & made an attempt to remove merge conflicts 2017-11-14 15:05:32 -07:00
d5cc3ca198 Disable TLS v1.0 by default. Added new --enable-tlsv10 option to force enable (only works if --enable-oldtls is set, which is on by default). 2017-11-14 14:01:31 -08:00
cc65429946 Merge pull request #1231 from dgarske/fix_max_sigalgo
Fixes and cleanup for handling of sig/algo
2017-11-14 13:25:29 -08:00
815cbd8f68 Merge pull request #1227 from moisesguimaraes/adds-client-side-get-sni
enables wolfSSL_SNI_GetRequest() at client side.
2017-11-14 13:22:37 -08:00
a0931313dd Merge pull request #1226 from SparkiDev/aes_gcm_avx1_avx2
Improve AES-GCM performance on AVX1 (IvyBridge) and AVX2
2017-11-14 13:03:22 -08:00
20f5c61675 Added debug message when signature/algorithm list is truncated. 2017-11-14 10:31:48 -08:00
67451cc3e2 Fix for older compilers and AVX2 2017-11-14 11:36:22 +10:00
1ede982495 Improve speed of Intel AVX1/2 ASM for SHA-256 and SHA-512 2017-11-14 10:36:17 +10:00
0ade0eb55b Merge pull request #1224 from dgarske/get_version
Improvements to wolfSSL get/set version
2017-11-13 16:05:22 -08:00
fd4b3b40ac Merge pull request #1222 from dgarske/pem_public
Fixes for PEM public key functions
2017-11-13 16:03:04 -08:00
69461ae5e2 Merge pull request #1217 from dgarske/sha_slow
New `--enable-lowresource` option and SHA256 not unrolled support
2017-11-13 16:02:01 -08:00
35377d933e Merge pull request #1228 from abrahamsonn/2275
Moved variable declaration to beginning of block
2017-11-13 15:19:27 -08:00
b08a99057c Cleanup of hashSigAlgo handling in DoClientHello. 2017-11-13 15:02:13 -08:00
9f7e40ad5c Fix to make sure provided sigalgo list doesn't overflow the buffer. 2017-11-13 14:52:53 -08:00
2b5c4ffa7f Enhancement to allow override of maximum sig/algos using new WOLFSSL_MAX_SIGALGO define (default is 32). 2017-11-13 14:35:15 -08:00
5da82f43ed makes SNI.status available at client side 2017-11-13 16:10:23 -02:00
020a004bad makes SNI.status available at client side 2017-11-13 15:39:24 -02:00
9f72f018e0 Moved variable declaration to beginning of block 2017-11-13 10:28:22 -07:00
fe5b512af7 fixes commnet typos 2017-11-13 14:59:47 -02:00
f82f03f982 fixes API visibility 2017-11-13 14:53:56 -02:00
a23b65751d enables wolfSSL_SNI_GetRequest() at client side. 2017-11-13 13:58:14 -02:00
6c848e7133 Improve AES-GCM performance on AVX1 (IvyBridge) and AVX2 2017-11-13 15:43:30 +10:00
3b0d415ad9 Merge pull request #1223 from JacobBarthelmeh/Memory
fix for logging file names
2017-11-10 14:04:55 -08:00
149559e40f change WOLFSSL_MAX_ERROR_SZ to be a macro instead of enum 2017-11-10 13:29:49 -07:00
54c663ed49 Added new API wolfSSL_GetVersion to get version as wolfSSL value which can be passed into wolfSSL_SetVersion. Fixed duplicate CyaSSL_CTX_use_PrivateKey_buffer define. Added TLS1.3 to wolfSSL_SetVersion. 2017-11-10 11:13:48 -08:00
686f18825a Merge pull request #1209 from moisesguimaraes/tlsx-fix2
TLSX fixes
2017-11-10 08:44:58 -08:00
d7abd5c8fb changes WOLFSSL_SKIP_UNSUPPORTED_EXTENSION to WOLFSSL_OLD_UNSUPPORTED_EXTENSION 2017-11-10 11:35:49 -02:00
39ad478973 make the WOLFSSL_MAX_ERROR_SZ overridable 2017-11-09 17:07:00 -07:00
7733ee7e89 fix for logging file names 2017-11-09 15:54:24 -07:00
2ba5475cf3 Merge pull request #1219 from JacobBarthelmeh/master
fix unused variable warning
2017-11-09 14:33:49 -08:00
8ced766d61 fix warning for static analysis report 2017-11-09 13:16:29 -07:00
717ebf0146 Fix for wolfSSL_PubKeyPemToDer so its available when NO_FILESYSTEM is defined (moved it out of NO_FILESYSTEM block). Added wc_DerToPemEx support for PUBLICKEY_TYPE. 2017-11-09 11:15:33 -08:00
5a5fea7b46 Add USE_SLOW_SHA256 and USE_SLOW_SHA512 options for reduced code size of SHA. Existing USE_SLOW_SHA2 applies for SHA512 only. Cleanup formatting of the sha256.c and sha512.c code. Added new ./configure --lowresource option, which defines the memory reduction defines. Fix for make check resume.test scipt with NO_SESSION_CACHE defined. 2017-11-09 11:05:28 -08:00
40be578415 fix unused variable warning 2017-11-09 11:22:10 -07:00
29b091eae6 Merge pull request #1221 from SparkiDev/warn_fix1
Fix warnings and g++ casting error
2017-11-09 09:35:54 -08:00
127c849594 Merge pull request #1215 from dgarske/fix_stm32_cubemx_sha
Fix accidental removal of wc_Sha hashHandle for STM32 w/CubeMX
2017-11-09 09:07:34 -08:00
ddec639712 Merge pull request #1218 from dgarske/fix_powerpc_debug
Fix for build error on PowerPC with enable debug
2017-11-09 09:06:43 -08:00
6a825ea0ce Fix warnings and g++ casting error 2017-11-09 17:30:59 +10:00
a97ee6c232 Fix for build error on PowerPC with enable debug. 2017-11-08 09:21:05 -08:00
55ec382093 Merge pull request #1212 from dgarske/emscripten
Fixes for building with Emscripten (adds `--disable-asm` option).
2017-11-07 09:19:49 -08:00
1a69fb9430 Fix accidental removal of wc_Sha hashHandle for STM32 w/CubeMX. This was removed during merge of 6707be2 on 10/11/17. Thanks liubing for the report. 2017-11-07 09:10:12 -08:00
a5f7b182bf Merge pull request #1214 from moisesguimaraes/fix-tlsx-unreachable
Removes unreachable code in TLSX supported-curves and ec-point-format.
2017-11-07 08:49:15 -08:00
1c19c8847b fixes while loop 2017-11-07 10:57:06 -03:00
7674a24972 removes unreachable code with a single return point 2017-11-07 10:43:47 -03:00
7df0e7f286 Fix typo with with extra paren. 2017-11-06 16:24:12 -08:00
90c5a64547 Merge pull request #1211 from dgarske/cleanup_hardcoded
Cleanup hard coded values
2017-11-06 16:10:34 -08:00
2c5778215d Merge pull request #1210 from dgarske/fix_ti_newnames
Fix for building with TI using new names.
2017-11-06 15:59:57 -08:00
b8cc132e99 Added ability to force 32-bit mode using --enable-32bit. Added ability to disable all inline asembly using --disable-asm. Added check for __EMSCRIPTEN__ define in types.h to properly setup 64-bit type. Fixes for build combinations with SHA512 and CHACHA20. 2017-11-06 14:37:34 -08:00
096e850adb Fix a few places where there are break; and break; when TLS 1.3 is not defined. Fix TIRTOS logic for XSTRNCASECMP and XSTRTOK. 2017-11-06 13:59:36 -08:00
e591576cdf Cleanup of the RSA exponent hard coded value. 2017-11-06 10:23:06 -08:00
231ebeea0e Add unit test for BN_bn2hex. Cleanup math radix constants. 2017-11-06 09:16:37 -08:00
d2938dd13a Fix for building with TI using new names. Update TI settings for timing, blinding and strtok_r. 2017-11-06 08:25:35 -08:00
775487cab1 Support for ChibiOS. 2017-11-06 09:45:12 +01:00
94c1aab67e Merge pull request #1208 from dgarske/fix_nightlyreports
Fixes from nightly builds for time_t and no AES
2017-11-03 12:28:55 -07:00
b672616b38 fixes cast to void 2017-11-03 15:31:13 -03:00
caf5708bb6 adds unsupported_extension behavior to ALPN 2017-11-03 15:31:13 -03:00
56b38946ed adds unsupported_extension behavior to Session Tickets and Supported Curves 2017-11-03 15:31:13 -03:00
c8e5558f3f adds unsupported_extension behavior to CSR and CSR2 2017-11-03 15:31:13 -03:00
a636858a49 adds unsupported_extension behavior to THMAC 2017-11-03 15:31:13 -03:00
cd4eb2c5b1 adds unsupported_extension behavior to MFL 2017-11-03 15:31:13 -03:00
0dd2ba2d80 adds unsupported_extension behavior to SNI 2017-11-03 15:31:13 -03:00
57ea7ba319 Various fixes from nightly Jenkins builds. Fix for new test_wolfSSL_ASN1_TIME_adj API unit test to skip generalized time test when on PowerPC (which has time_t as int). Fix for building with AES disabled and PKCS7 enabled. Fix for building without openssl_extra when time_t is not present. 2017-11-03 10:16:45 -07:00
8f687e9905 Merge pull request #1206 from ejohnstown/vs-arm-update
VS-ARM Update
2017-11-02 17:14:00 -06:00
5e02100921 Merge pull request #1192 from dgarske/client_staticmem
Added static memory support to client example
2017-11-02 14:49:33 -06:00
1d1e904acb Merge pull request #942 from ghoso/dev201705
New openssl compatibility functions for: `BN_mod_inverse`, `PKCS5_PBKDF2_HMAC_SHA1` and 
`SSL_set_tlsext_status_type`.
2017-11-02 10:47:14 -07:00
4084255fd5 Improve SSL failure cleanup case where ssl->ctx isn't set yet. 2017-11-02 09:48:43 -07:00
229cecfb61 Fix static memory failure case (insuficient mem) in InitSSL case where ssl->ctx isn't set yet and SSL_ResourceFree is called NULL dereferece happens. 2017-11-02 09:48:43 -07:00
72f44aba87 Fix for X509 FreeAltNames with static memory enabled. 2017-11-02 09:48:43 -07:00
0e34f35c08 Increase the static memory pool in client to better support ECC or session certs. 2017-11-02 09:48:43 -07:00
6369794b6f Fixes for static memory with -r session resumption option on client. Fix for possible failed InitSSL cleanup using NULL ssl->ctx for static memory. 2017-11-02 09:48:43 -07:00
a4f94366a4 Added static memory code to client example. 2017-11-02 09:48:43 -07:00
a14ea92d78 Merge pull request #1204 from dgarske/ec_tests
Fixes and improvements for `EC_POINT_mul`
2017-11-02 08:50:34 -07:00
cd4dd6bd40 Merge pull request #1207 from SparkiDev/rem_cov
Remove coverage rules not required.
2017-11-02 07:03:00 -07:00
32cbff7257 Remove coverage rules not required. 2017-11-02 09:46:57 +10:00
57853fa3e9 Merge pull request #1202 from dgarske/fix_nofs
Build fixes for building without filesystem
2017-11-01 10:14:22 -07:00
d8ef0d7df1 Merge pull request #1203 from dgarske/fix_const2
Fix issue with `fp_s_rmap` not being const
2017-11-01 10:12:45 -07:00
f91b2e19d7 Merge pull request #1205 from SparkiDev/tls_ext_fix
Fix TLS extension code
2017-11-01 10:10:10 -07:00
cc7a5fd490 Fix for bug in wolfSSL_EC_POINT_free not freeing the internal ECC point. Unit test fixup for test_wolfSSL_EVP_PKEY_new_mac_key with malloc and size 0. Cleanup the EC_POINT unit test to not set Gxy->inSet, since its already 0. 2017-11-01 09:44:19 -07:00
f4ae86dc1b Fix TLS extension code
Don't respond with TLS v1.3 extensions if doing TLS v1.2 or lower.
Use calculated size in SendServerHello rather than fixed maximum.
2017-11-01 18:08:11 +10:00
9c9978ce9f OpenSSL Compatibility functions on PR#942. 2017-11-01 13:00:47 +09:00
8a016879f0 Fixes to WOLFSSL_ATECC508A support to enable use of wc_ecc_export_x963_ex and wc_ecc_import_x963_ex. These changes are experimental (builds, but not tested). 2017-10-31 16:17:03 -07:00
72a33136f5 Fix for EC_POINT_mul population of result. Add NULL arg checks for a few compatability functions. Added unit tests for compatability layer API's EC_POINT_ and EC_GROUP_ in test_wolfSSL_EC. Cleanup of the EC_POINT_dump. 2017-10-31 16:09:39 -07:00
5b55d384a7 VS-ARM Update
1. Added HAVE_SUPPORTED_CURVES and WOLFSSL_SHA384 to the user settings file.
2017-10-31 13:19:10 -07:00
68371c8e66 Merge pull request #1201 from moisesguimaraes/fix-tlsx-sig-algo
adds check for server side sig-algo extension
2017-10-31 11:40:30 -07:00
5cf175c49b adds check for server side sig-algo extension 2017-10-30 23:02:36 -03:00
fa01c41ea9 Build fixes for building without filesystem. 2017-10-30 15:25:47 -07:00
2037a6c9ea Merge pull request #1199 from JacobBarthelmeh/fast-rsa
increase test buffer size to account for edge case
2017-10-27 15:48:14 -07:00
d42ebb836f Merge pull request #1200 from JacobBarthelmeh/staticmemory
allow for adjusting static IO buffer size
2017-10-27 15:01:17 -07:00
e8627f1f93 Fix issue with fp_s_rmap not being const. 2017-10-27 11:46:24 -07:00
92b71da6d2 allow for adjusting static IO buffer size 2017-10-26 16:40:16 -06:00
016f7357d2 increase test buffer size to account for edge case 2017-10-26 16:19:56 -06:00
264c481c71 Merge pull request #1191 from SparkiDev/tls13_no_ecc
Fix no ECC builds with TLS13 code.
2017-10-26 10:49:59 -07:00
ee489b12ef Merge pull request #1198 from dgarske/fix_build
Fix build errors with various configs.
2017-10-26 09:46:50 -07:00
aa95c6bdd1 Merge pull request #1197 from dgarske/fix_const
Fix `cipher_name_idx` to be const.
2017-10-26 09:45:30 -07:00
94e0b06b9f Fix build errors with configs for no ASN and no PKI with PSK. 2017-10-26 07:34:41 -07:00
b4d802d524 Fix cipher_name_idx to be const. 2017-10-25 16:57:53 -07:00
182028819d Merge pull request #1195 from dgarske/rel_fixes2
Release updates for ec_point_formats and ASN1 SetSerialNumber bug
2017-10-24 15:20:15 -06:00
323db1a95d Fix no ECC builds with TLS13 code.
Fix tests so that having ECC disabled works as well.
Fix define protection for Draft 18 and HRR Cookie.
2017-10-24 09:11:24 -07:00
8a01d725da Merge pull request #1177 from dgarske/certreq_tests
Testing improvements for cert gen and TLS cert validation
2017-10-24 08:21:37 -07:00
c0105b3008 Merge pull request #1175 from dgarske/cleanup_inlines
Cleanup to consolidate the inline helpers
2017-10-24 08:15:12 -07:00
e0734d56df Fix to handle valid serial number with MSB set. Cleanup to consolidate max serial number length check. 2017-10-24 06:49:00 -07:00
2dfad0918a Updated release notes for added ec_point_formats extension. Fix for setting serial number with random data where the MSB was cleared and resulted in a zero. Fix for build type mismatch error in wolfCrypt test with ed25519 and WOLFSSL_TEST_CERT defined. 2017-10-23 15:36:58 -07:00
96667b47ee ec point format TLS extension (#1034)
* adds client support to ec_point_format
* adds ec_point_format support for server side
* makes ec-point-format activation dependent on supported-curves activation
* removes recursive functions preserving the writing order
* renames EllipticCurves to SupportedCurves
2017-10-23 14:06:20 -07:00
d46ab1f724 Merge pull request #1194 from dgarske/rel_fixes
Release cleanup: Remove execute bit on all code files
2017-10-23 14:23:33 -06:00
7f30397252 Remove execute bit on all code files. 2017-10-23 11:16:40 -07:00
372e8b04d0 Merge pull request #1193 from dgarske/rel_v3.12.2
Release v3.12.2 (lib 14.0.0)
2017-10-23 11:53:55 -06:00
911b6f95f8 Release v3.12.2 (lib 14.0.0). Updated copywright. 2017-10-22 15:58:35 -07:00
39749ed5be Merge pull request #1190 from dgarske/fix_ocspstaplingenable
Fix to not send OCSP stapling extensions in client_hello when not enabled
2017-10-20 12:16:56 -07:00
d7ae1df778 Fix to add keyUsage keyAgreement for the ECC server certificate. Resolves issue with openssl test using "ECDH-ECDSA" cipher suite. 2017-10-20 11:26:15 -07:00
c5f80760a8 Merge pull request #1145 from JacobBarthelmeh/HardwareAcc
init hardware acc. use of public RSA key with public key decode funct…
2017-10-20 10:32:18 -07:00
bdefdfe860 Merge pull request #1165 from JacobBarthelmeh/mysql
add check for SIZEOF_LONG with sun and LP64
2017-10-20 10:16:58 -07:00
024c8725ad Testing improvements for cert gen and TLS cert validation:
* Fixes to support certificate generation (`WOLFSSL_CERT_GEN`) without RSA enabled.
* Added new ECC CA for 384-bit tests.
* Created new server cert chain (ECC CA for 256-bit that signs server-ecc.pem)
* Created new `./certs/ecc/genecc.sh` script for generating all ECC CA's, generated server cert req (CSR), signing with CA and the required CRL.
* Moved the wolfCrypt ECC CA / ECC cert gen test into `ecc_test` as `ecc_test_cert_gen`.
* Refactor duplicate code that saves DER to disk, converts DER to PEM and saves PEM to disk into SaveDerAndPem function.
* Changed `ecc_test_make_pub` and `ecc_test_key_gen` to use XMALLOC for temp buffers (uses heap instead of stack).
* Cleanup to combine all certificate subject information into global `certDefaultName`.
* Updated cert request info to use wolfSSL instead of Yassl.
* Cleanup to combine keyUsage into `certKeyUsage` and `certKeyUsage2`.
* Re-number error codes in rsa_test.
* Moved the certext_test after the ecc_test, since it uses a file generated in `ecc_test_cert_gen`.
2017-10-19 16:17:51 -07:00
e904a38092 Fix to not send OCSP stapling extensions in client_hello when not enabled. Fix for typo in WOLFSSL_SHUTDOWN_NOT_DONE. 2017-10-19 11:18:34 -07:00
5362d46da9 Fix issues building with inline disabled. 2017-10-18 14:26:34 -07:00
06f564dea3 Merge pull request #1189 from dgarske/fix_oldnames
Fix for building with `--disable-oldnames`
2017-10-18 13:34:26 -06:00
c9558ee27b Updated a few more old names. Added PR for new configs to Jenkins. 2017-10-18 10:38:27 -07:00
f23ec7d5f2 Fix for building with --disable-oldnames. 2017-10-18 10:22:35 -07:00
e82807024b Switched word24 back to byte for compatability. 2017-10-18 09:08:22 -07:00
7f2e6e1d8a Cleanup to consolidate the inline helpers like cto, ato and bto into misc.c. Relocate the word24 typedef into types.h. 2017-10-18 09:06:48 -07:00
1377577af5 Merge pull request #1187 from dgarske/build_fixes
Build fixes for various TLS 1.3 disable options
2017-10-18 08:59:46 -07:00
c9516e20b2 Merge pull request #1158 from dgarske/openssl_compat
Minor openssl compatibility layer improvements to AES, MD5 and SSL.
2017-10-18 08:54:28 -07:00
ccda176bfa Merge pull request #1183 from SparkiDev/tls13_nu
Disallow upgrading to TLS v1.3
2017-10-18 08:53:00 -07:00
9bea6cca52 Merge pull request #1186 from SparkiDev/sha2_asm
Fix SHA-256 Intel assembly code to work with 'fasthugemath'
2017-10-18 08:51:05 -07:00
9920bdf097 Merge pull request #1103 from SparkiDev/sp_rsa
Single Precision maths for RSA, DH and ECC
2017-10-18 08:44:47 -07:00
1bf9d092af Merge pull request #1179 from ejohnstown/evp-aes
EVP-AES
2017-10-17 19:23:11 -07:00
1a7d58715a Merge pull request #1188 from dgarske/ocsp_enables
Added missing API's for disabling OCSP stapling
2017-10-17 15:26:48 -07:00
3d7e86f08d Added missing API's for disabling OCSP stapling. Added OCSP stapling enable/disable for WOLFSSL. 2017-10-17 13:52:05 -07:00
ddb5e57811 Merge pull request #1185 from cconlon/bench
Add HMAC benchmark, expand AES key size benchmarks
2017-10-17 11:15:12 -07:00
b82a529ec2 Cleanup to move the secret length to ssl.h so its accessible for the compatability layer as well. 2017-10-17 09:56:34 -07:00
aab1e060a0 Minor openssl compatability layer improvements to AES, MD5 and SSL. 2017-10-17 09:50:25 -07:00
8659140494 Build fixes for various TLS 1.3 disable options (RSA, ECC and ED/Curve 25519). 2017-10-17 09:39:32 -07:00
32103891e2 Merge pull request #1117 from dgarske/gcc_arm
Added simple GCC ARM Makefile example
2017-10-17 10:23:32 -06:00
e49560fbf0 add missing parameter in SHOW_INTEL_CYCLES 2017-10-17 09:31:21 -06:00
7dccd9d478 set hash size for PIC32MZ hardware crypto 2017-10-17 09:30:26 -06:00
d5b7c13fbf change enc/dec labels for AES, move scrypt bench below HMAC 2017-10-17 09:30:26 -06:00
d65704c6b4 add benchmarks for AES-128/192/256-ECB 2017-10-17 09:30:16 -06:00
c0472a3a89 Fix SHA-256 Intel assembly code to work with 'fasthugemath' 2017-10-17 18:35:18 +10:00
c49188cc89 Turn off SP by default 2017-10-17 09:32:24 +10:00
9e4e58fe8c Disallow upgrading to TLS v1.3
Change SupportedVersions extension to only include TLS v1.3 if downgrade
is disabled.
Fix parsing of SupportedVersions extension
Don't upgrade
Only downgrade in SupportedVersions extension if option enabled
2017-10-17 08:52:12 +10:00
f724206e37 Add test for 3072-bit RSA and DH and fix modexp 2017-10-17 08:36:39 +10:00
90f8f67982 Single Precision maths for RSA (and DH)
Single Precision ECC implementation
2017-10-17 08:36:39 +10:00
9a6e4b2939 add separate benchmarks for AES-128/192/256-GCM 2017-10-16 14:43:39 -06:00
1e445e10a1 add separate benchmarks for AES-128/192/256-CTR 2017-10-16 14:43:38 -06:00
2b077b2792 add separate benchmarks for AES-128/192/256-CBC 2017-10-16 14:43:38 -06:00
1f72696359 add HMAC-MD5/SHA/SHA224/SHA384/SHA512 benchmarks 2017-10-16 14:43:38 -06:00
130e026139 Merge pull request #1184 from dgarske/fix_fips
Fix for FIPS build to support new names
2017-10-16 13:20:05 -07:00
de34ec0f0c Fix scan-build report of possible use of unitialized output[i]. 2017-10-16 11:24:41 -07:00
02ee22e73b Support for mapping to new names with old for FIPS build. Fix to revert HMAC SHA224 type check, since SHA224 type isn't in FIPS wolfCrypt. 2017-10-16 09:57:22 -07:00
819acd18a7 Merge pull request #1180 from SparkiDev/tls13_nd
Fixed DRAFT_18 define and fixed downgrading with TLS v1.3
2017-10-13 09:24:55 -07:00
2c2217fcdc Merge pull request #1181 from dgarske/cert_serial
Certificate serial number enhancements
2017-10-13 09:22:11 -07:00
b79b816276 Merge pull request #1168 from dgarske/ctx_get_cm
Add method to get WOLFSSL_CTX certificate manager
2017-10-13 09:13:54 -07:00
6fd53d31c2 Merge pull request #1157 from dgarske/old-names
Refactor SSL_ and hashing types to use wolf specific prefix
2017-10-13 09:09:44 -07:00
04106a0089 Merge pull request #1174 from dgarske/ocsp_cb_ctx
Improvement to `wolfSSL_SetOCSP_Cb` to allow context per WOLFSSL object
2017-10-12 10:02:49 -07:00
de77d5cc83 Merge pull request #1170 from dgarske/alt_cert_chains
Alternate certificate chain support `WOLFSSL_ALT_CERT_CHAINS`
2017-10-12 10:02:29 -07:00
34cac68f81 Added wolfCrypt test example for setting a custom serial number. Changed CTC_SERIAL_SIZE to 16 (more common max). 2017-10-11 19:16:58 -07:00
6548f32ee0 Enhancement to allow a serial number to be customized via Cert.serial and Cert.serialSz for cert request or generation. Fix to make sure serial number is always postive and has no leading zeros. Increase the size of the certificate serial number to 20 bytes. 2017-10-11 17:21:26 -07:00
6021c37ec7 Refactor WOLF_SSL_ to WOLFSSL_ (much better). 2017-10-11 09:10:43 -07:00
6707be2b0e Added new --disable-oldnames option to allow for using openssl along-side wolfssl headers (without OPENSSL_EXTRA). Add --enable-opensslcoexist which makes sure oldnames is disabled. Refactor of SSL_ to WOLF_SSL_. Refactor of SHA, MD5, SHA224, SHA256, SHA512 and SHA384 to WC_ naming. 2017-10-11 09:10:42 -07:00
7dca25ea88 Fixed DRAFT_18 define and fixed downgrading with TLS v1.3
Changed the define in configure.ac to match the one used in the code.
Fixed downgrading to disallow unless ssl->options.downgrade is set.
TLS 1.3 client method does not have downgrade on anymore.
Test changed to not expect downgrading to work.
Test of TLS v1.3 client downgrade is actually upgrading on server.
Fixed 80 character line problems.
2017-10-11 12:17:28 +10:00
09f8ddd0f0 EVP-AES
1. Fixed using wolfSSL_EVP_CipherFinal() when a message's size is a round multiple of a block size. It wasn't adding the appropriate padding.
2. Update the EVP_Cipher test to call CipherUpdate and CipherFinal instead. It checks a message that is 24 bytes long and a second that is 16 bytes long.
2017-10-10 13:44:06 -07:00
4c8d228080 Added WOLFSSL_ALT_CERT_CHAINS option to enable checking cert aginst multiple CA's. Added new API's for wolfSSL_get_peer_alt_chain and wolfSSL_is_peer_alt_cert_chain, which allow a way to know if alternate cert chain is used and provides a way to get it (when SESSION_CERTS is defined). Cleanup of the defines to enable debugging certs (just use SHOW_CERTS now). 2017-10-10 08:55:35 -07:00
35141c335d Merge pull request #1178 from SparkiDev/asm_mulx_2
Fix for MULX asm
2017-10-09 18:33:29 -07:00
898893fbcd Fix for MULX asm 2017-10-10 09:41:17 +10:00
280de41515 Improvement to wolfSSL_SetOCSP_Cb to set the context per WOLFSSL object (callback functions are same). Adding API unit tests next. 2017-10-06 12:18:21 -07:00
effad6e91c clean up include paths for MySQL cmake build 2017-10-06 09:05:56 -06:00
c945e65479 Merge pull request #1171 from ejohnstown/wolfssh
wolfSSH Option
2017-10-05 09:43:17 -07:00
541f60801d Merge pull request #1172 from SparkiDev/aesgcm_avx2_fix
Fix aesni code for avx2
2017-10-05 09:10:50 -07:00
152c24f210 Fix aesni code for avx2 2017-10-05 13:02:33 +10:00
f344f04e60 wolfSSH Option
Added a configure convenience option for building wolfSSL to work with wolfSSH.
2017-10-04 16:11:52 -07:00
d855fd9452 Merge pull request #1166 from JacobBarthelmeh/Compatibility-Layer
fix for wolfSSL_ASN1_TIME_print function
2017-10-04 14:10:53 -07:00
75e04a08cd Merge pull request #1167 from ejohnstown/install-update
update INSTALL with VS-ARM build
2017-10-04 13:58:23 -07:00
c4052607d7 Updated README.md to include instructions for how to build on a different ARM architecture (like Raspberry Pi CortexA53). Moved the -T into SRC_LD so its easier to disable. 2017-10-04 13:53:39 -07:00
6058362970 Fix bug in user_settings.h which was incorrectly setting FP_MAX_BITS to 512 when RSA was enabled. This resulted in RSA_FUNCTION MP_EXPTMOD_E: memory/config problem. 2017-10-04 13:53:39 -07:00
614736cbb2 Add code to detect if Cortex M series and disable architecture specific code in armtarget.c. Improved Makefile.common to include toolchain prefix. 2017-10-04 13:53:39 -07:00
d88d8c3ed8 Updates to GCC ARM README.md for the ARCHFLAGS and correct file to update. 2017-10-04 13:53:39 -07:00
d4b18a6d3f Added warning for IO callback stubs to make sure they get implemented. 2017-10-04 13:53:39 -07:00
a02903c43e Improvements to Makefile templates. Added missing Makefile. Added new static library support. 2017-10-04 13:53:39 -07:00
2d67f46247 Minor cleanups for the GCC ARM example. Fixed build with DH enabled. Changed random.h to always make sure CUSTOM_RAND_TYPE is defined. Added TLS13 option to reference user_settings.h. 2017-10-04 13:53:39 -07:00
69b25ee508 Added simple GCC ARM gcc-arm-none-eabi Makefile project example for wolfCrypt test/benchmark and wolfSSL Client. 2017-10-04 13:53:39 -07:00
19ea4716f3 Add unit tests for wolfSSL_CTX_GetCertManager, wolfSSL_CTX_UnloadCAs, wolfSSL_CertManagerUnloadCAs and wolfSSL_CTX_get_cert_cache_memsize. Fixed comment typo PERSISTE_CERT_CACHE. 2017-10-03 10:00:20 -07:00
dcf61bd10e Added new API wolfSSL_CTX_GetCertManager for getting the WOLFSSL_CTX certificate manager. 2017-10-03 08:46:15 -07:00
5c636b4f4a update INSTALL with VS-ARM build 2017-10-02 12:00:11 -07:00
918a5fd5a6 Merge pull request #1164 from SparkiDev/asm_mulx
Get the multiplcation code using MULX to work consistently
2017-09-30 09:51:03 +09:00
9bf14a152f change return value for wolfSSL_ASN1_TIME_print 2017-09-29 10:28:10 -06:00
cb94911e1f add check for SIZEOF_LONG with sun and LP64 2017-09-28 16:39:30 -06:00
8cd0b7dfc7 fix for wolfSSL_ASN1_TIME_print function 2017-09-28 15:30:46 -06:00
09e92c518d Merge pull request #1163 from cconlon/mysql_sha
Add returns to OpenSSL compatibility SHA functions
2017-09-28 13:12:14 -06:00
3b12b7223a Merge pull request #1160 from dgarske/asn_extkeyusage
ASN Extended Key Usage Support
2017-09-28 11:31:04 -06:00
34ef7207f9 check hash function returns in wolfSSL_EVP_DigestInit 2017-09-28 11:19:51 -06:00
eff781c0aa add int return to OpenSSL compatibility MD5 functions 2017-09-28 11:12:18 -06:00
c836724685 Merge pull request #1162 from cconlon/mysql_compat
wolfSSL_ERR_peek_error() with WOLFSSL_MYSQL_COMPATIBLE
2017-09-28 09:51:07 -06:00
7350bf93b3 Merge pull request #1153 from dgarske/fix_testbench_castwarns
Fix cast warnings with wolfCrypt test/benchmark
2017-09-28 09:41:21 -06:00
fd9b2d3b8d Merge pull request #1116 from dgarske/stm32_hash
Fixes for STM32 hardware acceleration
2017-09-28 09:35:36 -06:00
0376a53f6b Get the multiplcation code using MULX to work consistently 2017-09-28 09:12:29 +10:00
ef141c3ce9 add int return to OpenSSL compatibility SHA functions 2017-09-27 14:28:19 -06:00
6c85bc5d3d enable functionality of wolfSSL_ERR_peek_error() when WOLFSSL_MYSQL_COMPATIBLE defined 2017-09-27 10:56:04 -06:00
fadee8fbf2 Merge pull request #1161 from cconlon/mysql_compat
Enable ASN1_TIME_print when WOLFSSL_MYSQL_COMPATIBLE is defined
2017-09-26 15:44:50 -07:00
4f15cde2eb Merge pull request #1155 from dgarske/fixes_pic32mz
PIC32MZ minor build warning fixes
2017-09-26 16:26:32 -06:00
e8dd7d0c4a Merge pull request #840 from koichi-tsujino/EVP
add EVP_get_cipherbynid
2017-09-26 16:23:26 -06:00
b4f7997fdc enable ASN1_TIME_print when WOLFSSL_MYSQL_COMPATIBLE is defined 2017-09-26 15:02:13 -06:00
19aaa88c72 Merge pull request #1156 from ejohnstown/ios-android
iOS and Android Project Updates
2017-09-26 12:06:17 -07:00
9eb7e2aafa ASN1 Extended Key Usage support. Adds new wc_SetExtKeyUsage() API. Available only with --enable-certext or WOLFSSL_CERT_EXT. 2017-09-26 12:05:46 -07:00
931fbde41d iOS/Android
1. Updated the iOS user_settings.h with the hardened settings.
2. Updated the iOS project file with Xcode's suggested settings.
3. Added an IDE project for building wolfSSL for Android using Visual Studio 2017.
2017-09-26 09:08:34 -07:00
b172585fc3 Resolved conflicts 2017-09-26 09:01:23 +09:00
e8f95b9252 add EVP_get_cipherbynid 2017-09-26 08:58:36 +09:00
8f3aa49ef6 Merge pull request #1149 from ejohnstown/aesgcm-init
AES-GCM-NI Init
2017-09-25 16:13:55 -07:00
d15704b2ba Merge pull request #1159 from cconlon/session_cache
exclude wolfSSL_SSL_get0_session when NO_SESSION_CACHE is defined
2017-09-25 15:20:27 -07:00
46f7e786cb exclude wolfSSL_SSL_get0_session when NO_SESSION_CACHE is defined 2017-09-25 14:07:17 -06:00
0ced1f4847 AESGCM Init
1. Update the AES-GCM with AES-NI 128-bit constant initializers so they work on both GCC/Clang and MSC.
* MSC uses a union for the type where the first member is a 16-byte array.
* GCC/Clang uses a 16-byte vector masking as a long long array.
2. Disable AES-GCM loop unrolling for Windows, when using AES-NI in 32-bit mode.
2017-09-22 15:28:47 -07:00
ee6f88cd98 Fix cast warnings with wolfCrypt test/benchmark. Cleanup of 80 char max line length in wolfCrypt test. 2017-09-22 15:22:42 -07:00
6451e12313 Merge pull request #1154 from dgarske/fix_async
Fixes for building with async
2017-09-22 16:01:28 -06:00
763d5f26c7 Merge pull request #1031 from dgarske/math_update
Math updates
2017-09-22 15:26:34 -06:00
2c4844d5ef Merge pull request #1146 from ejohnstown/compat
OpenSSL Compatibility Additions and Fixes
2017-09-22 14:19:28 -07:00
4a510218c2 Tested PPC32 with TFM_PPC32. Fixed warning with possible uninitialized use of sc0, sc1 and sc2. 2017-09-22 11:37:00 -07:00
eec5f9bb41 Fixes for benchmark after buffers were moved into thread. Needed THREAD_LS_T and fixed benchmark alloc failure cleanup. 2017-09-22 11:35:46 -07:00
218f944984 Fix for building async with AES XTS. 2017-09-22 11:12:23 -07:00
a2ed22286f Adds TFM_MIPS (tested on PIC32MZ2048EFM144 with XC32 v1.44). Adds check for mp_read_radix to return failure for invalid character. Adds checking for s_mp_sub response code. Improved mp_init_copy error handling. Improved init to use size where applicable. Asm PPC 32 changes to add r to register. Asm formatting cleanups. 2017-09-22 09:48:35 -07:00
824eb55648 Merge pull request #1151 from dgarske/fix_asn_keyusage
Fixes bug with creation of the KeyUsage BitString
2017-09-21 10:41:08 -06:00
f5c4a68ab3 Merge pull request #1152 from JacobBarthelmeh/Testing
fix for wolfSSL_X509_NAME_get_text_by_NID
2017-09-20 18:52:14 -07:00
80333979a9 fix for wolfSSL_X509_NAME_get_text_by_NID 2017-09-20 17:31:53 -06:00
3f493770d4 Fixes bug with creation of the KeyUsage BitString which was always adding the optional second byte reguardless of len, which created invalid ASN if value provided was less than 256. Bug was introduced with ASN refactor in commit fd9e41dd99. 2017-09-20 15:00:24 -07:00
2f96f1ae9f Merge pull request #1150 from kaleb-himes/HASH_DRBG_UPDATE
Update HASH_DRBG Reseed mechanism and add test case
2017-09-20 13:15:17 -07:00
1c2199be24 Merge pull request #1137 from JacobBarthelmeh/Windows
rename the file io.h to wolfio.h
2017-09-20 11:34:33 -07:00
5777b92745 Improved solution 2017-09-20 11:25:51 -06:00
5e6213bfa1 Merge pull request #1140 from JacobBarthelmeh/RSA-fix
account for 8k keys with MySQL compatibility
2017-09-20 10:05:32 -07:00
28c15bed1c Merge pull request #1141 from SparkiDev/chacha_avx1
Fix ChaCha to check for AVX1
2017-09-20 09:57:20 -07:00
3763b88397 rename the file io.h to wolfio.h 2017-09-20 10:53:11 -06:00
60dca94821 Update HASH_DRBG Reseed mechanism and add test case 2017-09-20 10:36:36 -06:00
4d8e1c9e5a Minor build fixes for unused function and variable. 2017-09-19 12:48:57 -07:00
816767744f Fix for STM32 AES-CTR (tested on STM32F437). Improvement to the STM32 RNG code to detect improper RNG_CLK. Cleanup of the PIC32MZ Aes struct variables and the AES-CTR (tested on PIC32MZ2048). 2017-09-18 16:08:09 -07:00
2620cb4559 OpenSSL Compatibility Additions and Fixes
1. Added a check on the hex2bn function for null strings to be treated like the NULL pointer.
2. Added some more test cases to the big number unit test.
3. Added wolfSSL_EVP_add_cipher() analogous to wolfSSL_EVP_add_digest().
4. Implemented `RSA_public_encrypt()` and `RSA_private_decrypt()` for the OpenSSL compatibility layer.
5. Added `RSA_PKCS1_OAEP_PADDING` as an option to the new functions.
6. Fixed the constness on the `from` parameter in function `RSA_public_decrypt()`. Note: this does not allow OAEP to be used in FIPS mode.
7. Added size constants for EVP_MAX_BLOCK_LENGTH, RSA_PKCS1_PADDING_SIZE, and RSA_PKCS1_OAEP_PADDING_SIZE.
8. Added functions `wolfSSL_EVP_PKEY_new_mac_key()` and `wolfSSL_EVP_PKEY_get0_hmac()` for storing HMAC keys in an EVP_PKEY structure for use later.
9. Added the routines EVP_DigestSignXXX(). They only work w.r.t HMAC.
10. Added the ForceZero() to EVP_MD_CTX_cleanup().
11. Modified the EVP_MD_CTX structure to have a union with both the hasher and a wolfCrypt Hmac structure.
12. Added a mapping of SHA1->SHA to the list of digest name aliases in wolfSSL_EVP_get_digestbyname().
13. Changed the mapping of ssl3-sha1->SHA.
14. When using RSA blinding, the OpenSSL compatibility layer RSA object was attempting to decrypt without an RNG. Added an RNG if needed.
15. Add comment to wolfSSL_BN_hex2bn() to cover usage w.r.t. string length. Remember to keep the length even, front-pad with zeroes if needed.
16. Added tests for the new functions.
2017-09-18 13:53:44 -07:00
c4e87c8cc4 Merge pull request #1121 from ejohnstown/solution-update
Update VS Solution Files
2017-09-15 18:22:44 -06:00
a9e540fc07 Moved the bench_ buffer allocation/free into the thread, so the THREAD_LS has a unique one for each which resolves issues with benchmark when using the USE_QAE_THREAD_LS option. 2017-09-15 14:02:06 -07:00
23903ec903 Merge pull request #1144 from kaleb-himes/FIPS-TEST
NULL plaintext input is supported in FIPS testing
2017-09-15 13:21:32 -07:00
3f16fba4f8 Fix build warning with possible use of unitialized ret. 2017-09-15 10:41:43 -07:00
27d607efa3 Fixes for AES on STM32 with StdPeriLib and fix for building with NO_STM32_CYPTO. Researching better solution for AES-CTR. 2017-09-15 10:39:09 -07:00
dcab2f47ee Fixes for STM32 hardware acceleration. Adds CubeMX HAL hashing support for MD5, SHA1, SHA224 and SHA256. Adds support for STM32F7 (WOLFSSL_STM32F7). Fixes issue with AES-GCM and STM32F2. Cleanup of the STM32 macros (adds NO_STM32_HASH, NO_STM32_CRYPTO and NO_STM32_RNG to optionally disable hardware acceleration). 2017-09-15 10:39:09 -07:00
63e8d63943 Update following review 2017-09-15 10:52:33 -06:00
0b11b265f6 Merge pull request #1143 from SparkiDev/wpas_aesctr
Fix WPAS config to not use FORTRESS config
2017-09-15 10:39:13 -06:00
5f0afcfe88 Merge pull request #1142 from JacobBarthelmeh/fast-rsa
fix for clang warning on RsaKey redefinition
2017-09-15 09:40:42 -06:00
1f7d73f626 NULL plaintext input is supported in FIPS testing 2017-09-14 20:14:21 -06:00
00e073424a Fix WPAS config to not use FORTRESS config 2017-09-15 10:49:07 +10:00
f97f9a6158 init hardware acc. use of public RSA key with public key decode functions 2017-09-14 17:07:19 -06:00
e10b2f027f fix for clang warning on RsaKey redefinition 2017-09-14 15:08:15 -06:00
1b3a8f40b8 account for 8k keys with MySQL compatibility 2017-09-14 09:37:32 -06:00
7721aca114 Fix ChaCha to check for AVX1 2017-09-14 09:07:04 +10:00
afcef7d394 Merge pull request #1136 from JacobBarthelmeh/Testing
anon flag with interop script
2017-09-13 14:40:30 -07:00
23fff62d8b Merge pull request #1135 from dgarske/cy
Fix issue with empty array (requires C99 compliance).
2017-09-13 14:39:50 -07:00
4c31c53f37 Merge pull request #1128 from JacobBarthelmeh/AES
AES XTS feature addition
2017-09-13 14:38:15 -07:00
bea82ce214 Merge pull request #1118 from JacobBarthelmeh/mysql
downgrade with options set when using opensslextra feature
2017-09-13 14:12:09 -07:00
a5eaecaa0e Fix unit API test call to wolfSSL_CertManagerLoadCA when building without file system. 2017-09-11 06:51:27 -07:00
932773735b Cleanup the wolfIO_Send function. 2017-09-11 05:48:41 -07:00
398252ddad add XtsAes structure and change XTS-AES API 2017-09-08 16:00:33 -06:00
2c39219f2a Fix issue with empty array (requires C99 compliance). 2017-09-08 11:24:55 -07:00
c018a1abf3 Merge pull request #1130 from SparkiDev/cpuid_fix
MSVC fix around cpuid check
2017-09-08 11:04:50 -06:00
1d1fc66374 double check support of SSLv3 with interop testing 2017-09-08 10:50:23 -06:00
ee9d410326 anon flag with interop script 2017-09-07 16:58:37 -06:00
a073d5d448 Merge pull request #1129 from JacobBarthelmeh/Testing
additional sanity checks
2017-09-06 15:34:26 -07:00
c482524b78 big endian testing and packing Aes struct 2017-09-01 15:32:55 -06:00
f7ea118dd7 downgrade with options set when using opensslextra feature 2017-09-01 13:47:56 -06:00
6a226efd15 MSVC fix around cpuid check 2017-09-01 08:43:28 +10:00
8807b8af4f additional sanity checks 2017-08-31 16:00:08 -06:00
3da5ddd49e Merge pull request #1123 from SparkiDev/poly1305_fix
Fix for the AVX implemetation of Poly1305
2017-08-31 10:21:00 -06:00
d48c940334 add comments for AES-XTS functions to aes.h 2017-08-30 17:52:26 -06:00
ef73c1df7c add AES-XTS mode --enable-xts 2017-08-30 17:50:15 -06:00
7ac0bab37e Merge pull request #1114 from kojo1/tls1.3
bring up settings.h in tls13.c
2017-08-30 13:00:40 -07:00
9aef8a91fd Merge pull request #1120 from JacobBarthelmeh/Testing
fix creating shared secret with ECC private only key
2017-08-30 11:02:14 -07:00
1ba77e4306 Merge pull request #1122 from JacobBarthelmeh/Compatibility-Layer
using memory bio with no filesystem and adjustment for Windows line e…
2017-08-30 10:58:30 -07:00
3b351fd640 Fix to stop inlining of assembly code with fixed label 2017-08-30 10:51:44 +10:00
3dbe5d2af9 fixes for Windows build 2017-08-29 12:02:24 -06:00
34dc4a493d Merge pull request #1124 from JacobBarthelmeh/UnitTests
fix memory management in unit test with --disable-fastmath
2017-08-29 09:06:14 -06:00
61ff3e136a fix memory management in unit test with --disable-fastmath 2017-08-28 16:23:44 -06:00
e6cf3c88f2 Fix for the AVX implemetation of Poly1305
Need one more multiple of r (0..6 instead of 0..5)
2017-08-28 11:44:27 +10:00
a8417c1078 using memory bio with no filesystem and adjustment for Windows line ending 2017-08-25 15:11:10 -06:00
6970333473 1. Set the base address of the 32-bit DLL builds.
2. Add LTCG option for 64-bit DLL Debug build. Fixes issue with VS2015.
3. Fixed sln issue where test tools linked against the DLL are built outside the DLL build directories.
2017-08-25 11:21:11 -07:00
a308a56044 fix creating shared secret with ECC private only key 2017-08-25 09:07:03 -06:00
59358fd91d Merge pull request #1119 from JacobBarthelmeh/Windows
cast to fix warning on Windows with Visual Studio
2017-08-25 07:04:42 -07:00
7918b31cae cast to fix warning on Windows with Visual Studio 2017-08-24 15:22:32 -06:00
23342337ab Merge pull request #1115 from JacobBarthelmeh/Compatibility-Layer
fix advancing memory WOLFSSL_BIO when reading
2017-08-24 10:45:32 -07:00
2d5194cdf0 Merge pull request #1113 from JacobBarthelmeh/Testing
add function to generate public ECC key from private key
2017-08-24 10:40:27 -07:00
b10e0b789b fix error return value when unable to extract ECC public key 2017-08-23 14:45:08 -06:00
4b630b67fa fix advancing memory WOLFSSL_BIO when reading 2017-08-23 11:37:19 -06:00
73b8be8fcc Merge pull request #1039 from jrblixt/unitTest_api_addDsa-PR07192017
Add Dsa unit test functions.
2017-08-22 15:46:46 -06:00
7c604bfc48 Fixes for building with WOLFSSL_ATECC508A. 2017-08-22 13:11:20 -07:00
c25832ad14 type cast the return of fread 2017-08-22 14:06:25 -06:00
71f4d546a8 add function to generate public ECC key from private key 2017-08-22 14:06:25 -06:00
fbae4420ad Merge pull request #1110 from dgarske/pic32mz_largehash
Fixes for PIC32MZ to support large hashing using hardware
2017-08-22 09:24:05 -07:00
8865b272bb Merge pull request #1112 from dgarske/async_sniff
Adds async blocking support for sniffer tool
2017-08-22 09:19:45 -07:00
439e803bd1 Merge pull request #1107 from JacobBarthelmeh/UnitTests
build option for certificate buffers with PKCS7 test
2017-08-22 10:05:36 -06:00
7892714516 bring up settings.h before #ifdef WOLFSSL_TLS13 2017-08-22 20:13:17 +09:00
07d137480d Fix to PIC32MZ handling of hashing empty string. Changed default MPLABX/MCAPI user_settings.h to use 2048-bit. All tests passed! 2017-08-21 15:19:18 -07:00
075adcb15b Add wolfCrypt hash tests for empty string. Add large hash test for SHA2 384/512 and SHA3. Cleanup hashing error handling to call free. RSA spelling fixes. RSA error detail for bad padding. 2017-08-21 14:03:48 -07:00
5a27e2f621 Fix so PIC32MZ works in caching mode after large hash. Reduced default block size for large hash to 256 (512 bytes total). 2017-08-21 11:10:16 -07:00
2b7f4b0903 Adds async blocking support for sniffer tool. 2017-08-21 11:07:13 -07:00
c9d6a4de6f Fixes for building --enable-mcapi. 2017-08-21 09:18:53 -07:00
c330c6b7f9 Merge pull request #1109 from JacobBarthelmeh/Testing
fix check on ephemeral key type before free'ing
2017-08-18 11:53:08 -07:00
8a37af42bf Merge pull request #1108 from dgarske/fix_async_misc
Fixes for async ECC encrypt, ParseCertRelative and API Unit test inits
2017-08-18 11:44:28 -07:00
d7f7c27e0a Merge pull request #1106 from JacobBarthelmeh/NTRU
QSH update
2017-08-18 11:35:48 -07:00
74ed94ddb1 Fixes to support large hashing against HW without caching (in exclusive hardware access) Large hashing uses previous hash code with two descriptors and polling. Added wolfCrypt large hash tests for MD5, SHA and SHA256. Add missing MCAPI set size API's. Cleanup AES GCM large test. Changed MPLABX projects to default to PIC32MZ2048EFM144. 2017-08-18 11:25:30 -07:00
7460aaf5ea build option for certificate buffers with PKCS7 test 2017-08-18 11:07:40 -06:00
c6e722170e fix check on ephemeral key type before free'ing 2017-08-18 10:55:38 -06:00
c9efcc4561 Merge pull request #1105 from dgarske/strtok
Enhancement to add strtok implementation for platforms where its not avail
2017-08-17 14:02:32 -07:00
84a396b7dc Additional init fixes for unit tests based on async valgrind report. 2017-08-17 12:41:18 -07:00
f6ad5524eb remove invalid test-qsh version tests, revert if statement check in internal.c 2017-08-17 11:27:47 -06:00
c06e672eb7 Added missing AES/DES3/HMAC init functions for helping with valgrind reports on unitialized use for async markers. 2017-08-17 09:58:46 -07:00
9909c8428c Code review changes per Chris. 2017-08-16 16:08:50 -06:00
3ca679c1d7 Added ability to force use of `USE_WOLF_STRTOK. 2017-08-16 13:21:31 -07:00
9fb0862bc1 Fix for TI RTOS (WOLFSSL_TIRTOS) to use our wc_strtok for the XSTRTOK macro. 2017-08-16 13:21:31 -07:00
ff6a136b8a Enhancement to add strtok implementation for platforms where it is not available such as MinGW. 2017-08-16 13:21:31 -07:00
3fda99cbc4 seperate build of QSH from build of NTRU 2017-08-16 14:19:38 -06:00
f7ca2f157d Improvement on the ParseCertRelative fixes for intializing the event prior to operation. Fix possible uninitialized value with DecryptKey and DES3. 2017-08-16 13:19:31 -07:00
68c04bd821 Fix for ECC encrypt/decrypt with async enabled. Reverts previous change from PR #1101 and adds return code checking for wc_AsyncWait. ECC shared secret needs to be in loop to call again for completion. 2017-08-16 12:04:57 -07:00
53e05786da Merge pull request #1101 from dgarske/fix_bench_async
Fixes for async multi-threading
2017-08-16 10:15:55 -07:00
ad4849d692 Merge pull request #1100 from JacobBarthelmeh/Testing
Fix for test script: add ECDH-RSA server for interop tests
2017-08-16 09:54:16 -07:00
0ed03987df Merge pull request #1099 from cconlon/micrium
Update Micrium uC/OS-III Port
2017-08-16 09:48:56 -07:00
2e4000acb4 Merge pull request #1102 from cconlon/ocsp-certs
Update root certs for OCSP scripts
2017-08-16 09:50:02 -06:00
1f80fb952f Fix issue with using wrong asyncDev in ConfirmSignature. Fix un-initialized Hmac in API unit tests. 2017-08-15 21:20:32 -07:00
ccc226eae4 Fixes for refactor to initialize the asyncDev.event prior to call for ParseCertRelative, ConfirmSignature and ECC shared secret (return code). Scan-build and G++ fixes. 2017-08-15 21:20:32 -07:00
b32be20110 Refactored async event intialization so its done prior to making possible async calls. Added threadId and removed volatile attribs in WOLF_EVENT. Fixed possible unitialized value in benchmark ret. 2017-08-15 21:19:28 -07:00
a9c943d5bd Fix jenkins warning with possible uninitialized 'ret'. 2017-08-15 21:19:28 -07:00
b4aaeb5768 Fix for possible leak with multi-threading and curve cache. Note memory leak still possible with --enable-fpecc and async multithreading. Add voltaile on event state and ret to resolve possible multi-thread timing issue. Use define for --enable-stacksize init value. 2017-08-15 21:19:28 -07:00
44a3622248 Fixes to better handle threading with async. Fix wc_CamelliaCbcEncrypt return code checking. Fix to ensure cycles per byte shows on same line. Refactor of async event state. Refactor to initalize event prior to operation (in case it finishes before adding to queue). Add HAVE_AES_DECRYPT to --enable-all option. Cleanup benchmark error display. 2017-08-15 21:19:28 -07:00
dd5430d188 Code review changes, Chris. 2017-08-14 16:09:35 -06:00
af00787f80 update root certs for ocsp scripts 2017-08-14 12:58:36 -06:00
a6db5fc882 add ECDH-RSA server for interop tests 2017-08-11 16:41:27 -06:00
2f92998529 update test.c for Micrium port and XSTRNCPY 2017-08-11 14:30:25 -06:00
f6d0b2898d update Micrium uC/OS-III port 2017-08-11 14:30:15 -06:00
2740d313a7 fix unused variable warning in load_verify_locations with NO_WOLFSSL_DIR 2017-08-11 11:37:30 -06:00
7736125156 Merge pull request #1095 from jrblixt/unitTest_hashReorder
Re-order hash functions in unit test.
2017-08-11 10:15:37 -06:00
21a8662948 Merge pull request #1093 from toddouska/polyold
have poly asm detect older compilers w/o avx2 like chacha does
2017-08-11 08:27:34 +10:00
963746fb3e Merge pull request #1094 from JacobBarthelmeh/Testing
Testing
2017-08-10 13:01:46 -07:00
294a13f9a2 Merge pull request #1097 from cconlon/validate_ecc_import
WOLFSSL_VALIDATE_ECC_IMPORT fixes
2017-08-10 12:45:26 -07:00
5865816198 fix wc_ecc_import_private_key_ex() with WOLFSSL_VALIDATE_ECC_IMPORT with private only, wolfcrypt test 2017-08-10 10:04:14 -06:00
3c1140d90e Re-order hash functions in unit test. 2017-08-09 15:23:01 -06:00
8b41fc841b remove setting variable that is currently not used after being set 2017-08-09 13:43:28 -06:00
219fcde773 fix shadow declaration warning 2017-08-09 11:58:29 -06:00
36b1a666d0 have poly asm detect older compilers w/o avx2 like chacha does 2017-08-09 09:52:06 -07:00
df1e5f2e1a Merge pull request #1091 from dgarske/fix_async_aes
Fix async issue with AES set key trying to use a NULL IV.
2017-08-09 09:44:46 -07:00
04c16ca843 Merge pull request #1086 from SparkiDev/sha256_sha512_gcc44
GCC 4.4 on Linux doesn't like empty clobber list
2017-08-09 09:41:58 -07:00
af4158d231 Merge pull request #1084 from SparkiDev/aesni_avx2_fix
Fix for AVX2 unrolled code
2017-08-09 09:39:38 -07:00
d12e98eea3 Merge pull request #1079 from SparkiDev/poly1305_asm
Poly1305 Intel Assembly code - AVX and AVX2
2017-08-09 09:37:09 -07:00
f27b3a83aa Fix async issue with AES set key trying to use a NULL IV. 2017-08-07 17:47:59 -07:00
d195009dcb Merge pull request #1090 from JacobBarthelmeh/Release
update readme for known issue
2017-08-07 13:36:53 -07:00
6717035563 update readme for known issue 2017-08-07 13:13:43 -06:00
d949832059 Merge pull request #1088 from JacobBarthelmeh/Release
prepare for release v3.12.0
2017-08-07 11:49:27 -07:00
e9c6fa5f22 Merge pull request #1089 from JacobBarthelmeh/StaticAnalysisTests
fix potential memory leaks
2017-08-07 11:47:33 -07:00
1dc2889388 fix potential memory leaks 2017-08-04 16:49:31 -06:00
b55f981d5b prepare for release v3.12.0 2017-08-04 15:32:27 -06:00
032d606f99 GCC 4.4 on Linux doesn't like empty clobber list 2017-08-04 14:07:55 +10:00
32cedb2b12 Fix for AVX2 unrolled code 2017-08-04 12:40:10 +10:00
d0ff6067a6 Chacha asm fix - can't use buffer in old compiler 2017-08-04 12:17:41 +10:00
df4387cff4 Merge pull request #1083 from dgarske/chacha_noasm
Option to disable Intel speedups for ChaCha using `--enable-chacha=noasm`
2017-08-03 15:45:47 -07:00
ea6b719ec2 Fix register issue 2017-08-04 08:39:09 +10:00
3be4e0823e Adds option --enable-chacha=noasm to allow disabling the Intel AVX/AVX2 speedups when used with --enable-intelasm. 2017-08-03 13:39:46 -07:00
4d6cb66bc1 Merge pull request #1082 from dgarske/fix_intelasm_aesgcm
Fixes for `intelasm` and AES GCM with AVX2
2017-08-03 12:35:00 -07:00
3f2de7154f Merge pull request #1080 from abrahamsonn/vcxproj_update
added files to wolfssl.vcxproj includes list for windows config testing
2017-08-03 12:15:23 -07:00
977e909f60 Merge pull request #1081 from dgarske/chacha20_asm
Fix for `intelasm` and ChaCha20
2017-08-03 12:11:59 -07:00
4a5ecb8a15 Fix typo with xmm5 (was xxm5). Workaround for Clang issues with AVX2 and using register __m128i tmp3 asm("xmm6"); syntax by using NO_UNROLL option. 2017-08-03 10:47:21 -07:00
089a050d7a added files to wolfssl.vcxproj includes list for windows config testing 2017-08-03 11:00:30 -06:00
b0eeed364b Fix for intelasm and ChaCha20 with causing "error: unknown type name '__m256i'" on some compilers. Fix is to change the __m128i and __m256i to arrays of word64 (source Sean PR #1079). 2017-08-03 10:00:20 -07:00
80bc089cb5 Merge pull request #1078 from SparkiDev/intel_asm_fixup
Stop using positional parameters in inline asm. Fixes issue with `--enable-intelasm --enable-debug` for AES GCM.
2017-08-03 09:32:50 -07:00
5c2736f1a9 Poly1305 Intel Assembly code - AVX and AVX2 2017-08-03 14:35:09 +10:00
31854c1566 Stop using positional parameters in inline asm 2017-08-03 13:55:30 +10:00
108f6a4958 Merge pull request #1077 from JacobBarthelmeh/StaticAnalysisTests
Static analysis tests
2017-08-02 15:08:32 -07:00
635bacef28 Merge pull request #357 from kojo1/PIC32
Fixes for PIC32MZ
2017-08-02 13:14:06 -07:00
433ca50292 remove unneeded XMEMSETs 2017-08-02 14:04:41 -06:00
e77e93ef2e Merge pull request #1065 from JacobBarthelmeh/Testing
update DTLS export session version and tests
2017-08-02 11:40:38 -07:00
edce23b563 use memset when initializing DecodedCert structure 2017-08-02 10:50:34 -06:00
43b04af388 adjust sanity check in integer.c to avoid reading uninitialized values 2017-08-02 10:39:05 -06:00
062f3efa6d adjust integer.c for loop range 2017-08-02 10:29:34 -06:00
65b8389af0 Fix for handling hash copies to make sure copied buffer is not free’d. Resolves issues when testing TLS connection with wolfssl_tcp_client and openurl https://www.google.com/. 2017-08-02 08:42:04 -07:00
9f1b17effc Merge pull request #1076 from JacobBarthelmeh/UnitTests
place macro guard on test of RSA-OAEP with SHA1 dependency
2017-08-01 14:05:58 -07:00
2d94a3954a Merge pull request #1075 from JacobBarthelmeh/fast-rsa
add sanity check in fast-rsa and change loop behavior when generating…
2017-08-01 14:05:03 -07:00
bd20729fba Merge pull request #1069 from ejohnstown/dtls-mac
DTLS Bad MAC Checks
2017-08-01 13:45:19 -07:00
c93d348ecd fix sesion export buffer to be not dependent on macros defined 2017-08-01 14:19:06 -06:00
be432d8d3a Fix for building in Harmony with crypto.h path. 2017-08-01 12:48:44 -07:00
4e735631e7 Fixes for PIC32MZ:
* Adds crypto HW support for AES Direct and AES CCM.
* Fixes to enable PIC32MZ hardware hashing where updates are cached via heap buffer and final performs single operations against hardware.
* Fix for benchmark with 1024-bit certs passing in wrong size for `wc_RsaPrivateDecrypt` when using `USE_CERT_BUFFERS_1024`.
* Fix to resolve missing `strncasecmp` for the Microchip XC32. Workaround to use case sensitive version instead. This error occurred when building with HAVE_ECC defined in Harmony with XC32.
* Cleanup of the PIC32MZ crypto and hashing hardware code. Replace `pic32mz-hash.c` with `pic32mz-crypt.c`
* Add user_settings.h for mplabx and mcapi examples.
* Sync up with Harmony changes for MCAPI.
2017-08-01 12:42:09 -07:00
af0514704f place macro guard on test of RSA-OAEP with SHA1 dependency 2017-08-01 11:46:49 -06:00
c20859e67d add sanity check in fast-rsa and change loop behavior when generating fast-rsa key 2017-08-01 11:29:16 -06:00
b553d36548 Merge pull request #1074 from SparkiDev/tls13_cr
Add NULL check after signature alg extension search
2017-08-01 09:01:42 -06:00
24e9f7c43d Add NULL check after signature alg extension search 2017-08-01 13:55:06 +10:00
7cee1c5e8a Merge pull request #1072 from toddouska/alert
add AlertCount to detect dos attempt
2017-07-31 18:29:23 -07:00
2296f4806c Merge pull request #1073 from JacobBarthelmeh/StaticAnalysisTests
Static analysis tests
2017-07-31 18:24:17 -07:00
0c753718bd Merge pull request #1042 from SparkiDev/chacha_asm
Intel Assembly optimizations for ChaCha20 - AVX and AVX2
2017-07-31 16:27:17 -07:00
a27738b5f9 Merge pull request #1071 from dgarske/cleanup_tests
Cleanup AES GCM large test
2017-07-31 16:13:06 -07:00
a55e42c14f Merge pull request #1070 from dgarske/fix_qat_normal_math
Fix normal math issue with async and `mp_read_unsigned_bin`
2017-07-31 16:12:08 -07:00
01099fd97e cast for when compiling with g++-7 2017-07-31 16:58:53 -06:00
08da8df455 sanity check on peer sequence for static analysis report 2017-07-31 16:37:34 -06:00
66852a9252 add AlertCount to detect dos attempt 2017-07-31 15:17:54 -07:00
2051a05139 Cleanup AES GCM large test. Move test into stack and disable if using BENCH_EMBEDDED. 2017-07-31 14:09:30 -07:00
8a11b78960 Fix for normal math mp_read_unsigned_bin where mp_zero was also resetting the raw source. This caused failures with QAT when using normal math. 2017-07-31 14:09:15 -07:00
36a539760a DTLS Bad MAC Checks
1. Make the decrypt and verify MAC failure cases behave the same with
   respect to DTLS messages. It should pretend the message never happened.
2. Allow the echoclient to survive the echoserver sending a message with
   a bad MAC.
3. Allow the server to survive the client sending a message with a bad MAC.
2017-07-31 13:54:53 -07:00
fb53fac1c1 Merge pull request #1067 from JacobBarthelmeh/Memory
sanity check on index when adding cipher suites
2017-07-31 12:03:49 -07:00
62ce8c8b81 Merge pull request #1066 from dgarske/no_certs
Fix for building with `NO_CERTS` or `NO_WOLFSSL_SERVER` defined.
2017-07-31 12:01:39 -07:00
87611fdb5d Merge pull request #1064 from SparkiDev/cpuid_fix
Fix cpuid to work with different configs
2017-07-31 11:59:17 -07:00
5564be6113 sanity check on index when adding cipher suites 2017-07-28 17:42:52 -06:00
3387b12a9a Fix for building with NO_CERTS or NO_WOLFSSL_SERVER defined. 2017-07-28 15:24:53 -07:00
e1ccc5acad update DTLS export session version and tests 2017-07-28 14:27:24 -06:00
d452f97e99 Fix cpuid to work with different configs
Fix 'may be uninitialized' warning in aes.c
Fix memory overwrite in AES-CBC when using AESNI.
2017-07-28 08:41:49 +10:00
bc72d0c2d5 Merge pull request #1063 from JacobBarthelmeh/Testing
C89 compliance with variable declaration
2017-07-26 16:19:25 -07:00
d5cf5f9887 Merge pull request #1062 from JacobBarthelmeh/UnitTests
update sanity checks with ARMv8 port
2017-07-26 16:18:37 -07:00
0978dd4285 C89 compliance with variable declaration 2017-07-26 15:29:00 -06:00
dc7acc0400 Merge pull request #1059 from dgarske/fix_leaks
Fix for PKCS12 dynamic type names
2017-07-26 11:52:42 -06:00
637ca44e6a update sanity checks with ARMv8 port 2017-07-26 11:05:20 -06:00
3560eed52b Add Dsa unit test functions. 2017-07-26 09:01:36 -06:00
05ed5cafc2 Merge pull request #1061 from SparkiDev/tls13_leantls
Fixes for LEANTLS and TLS13 builds
2017-07-25 21:01:00 -07:00
41e2b236aa Merge pull request #1051 from kaleb-himes/fsanitize-fixes
Fsanitize fixes
2017-07-25 20:57:43 -07:00
fbf4e94bcf Merge pull request #1060 from SparkiDev/tls13_memleak
Fix memory leak when not using fast math and TLS13.
2017-07-25 20:55:42 -07:00
038d16212f Fixes for LEANTLS and TLS13 builds 2017-07-26 10:43:36 +10:00
59450e83fa Fix memory leak when not using fast math. 2017-07-26 09:48:34 +10:00
e1830772de Merge pull request #1056 from JacobBarthelmeh/UnitTests
check return values with new unit tests
2017-07-25 16:34:41 -06:00
55b07019a0 Fix for PKCS12 dynamic type names (also fix to use manual realloc since its NUMA type and that behaves different). 2017-07-25 15:19:34 -07:00
c03487d463 Fix for dynamic type of ED25519 key and PK_CALLBACK buffer not being free’d. Fix for portNumber stack var being used out of scope. 2017-07-25 15:07:58 -07:00
4fead493e7 add to return values checked 2017-07-25 14:44:40 -06:00
4438b8e92d update unit test case with DES3 and FIPS 2017-07-25 14:42:17 -06:00
5b0022fba0 HMAC key size when testing with FIPS 2017-07-25 14:42:17 -06:00
1b80e5a75f check return values with new unit tests 2017-07-25 14:42:17 -06:00
ef98e96767 Merge pull request #1058 from jrblixt/fix-AesFipsSanityCheck
Unit test GCM sanity check Fips change.
2017-07-25 13:30:35 -07:00
a076a2f0d8 Merge pull request #1055 from JacobBarthelmeh/Memory
fix memory management with --enable-fast-rsa make key and free RSA ke…
2017-07-25 11:03:16 -07:00
69d4bcbfd5 Merge pull request #1048 from dgarske/fix_custcurve
Fixes for using custom curves with `wc_ecc_set_custom_curve`
2017-07-25 10:59:58 -07:00
f9dee9adcc Merge pull request #1057 from kaleb-himes/TIRTOS-UPDATE
Add dependancy file to tirtos package.bld
2017-07-25 10:25:52 -07:00
4939c3eeef Merge pull request #1030 from SparkiDev/aesni_sha384
Assembly optimization for AES-NI, and AVX1 and AVX2
2017-07-25 09:35:43 -07:00
874144be73 Merge pull request #1046 from kojo1/zendesk-3052
io.h for VxWorks
2017-07-25 09:53:15 -06:00
f8e2f596d6 Unit test GCM sanity check Fips change. 2017-07-25 09:23:19 -06:00
e9f87b9f33 Merge pull request #1054 from jrblixt/fix-RsaSetRng
Fix rsa set rng
2017-07-25 09:16:14 -06:00
e8e1504d9f Alignment fix 2017-07-25 15:41:33 +10:00
08488b52b7 Fix for wolfCrypt test custom curve test not setting wc_ecc_set_custom_curvebefore calling wc_ecc_import_x963_ex. Fix for using ECC_CACHE_CURVE option and wc_ecc_set_custom_curve. Added error checking for wc_ecc_set_custom_curve calls. Reverted ASN header change in test.c. 2017-07-24 21:04:18 -07:00
33e214ffc1 Fix to allow ECC set curve size with curve_id == 0. Added wolfCrypt tests / example for using wc_ecc_set_custom_curve for BRAINPOOLP256R1. 2017-07-24 17:24:23 -07:00
5180cf4cce Fix ECC sign with custom curves so the custom params (dp) are passed to public key used for sign. 2017-07-24 17:21:51 -07:00
f147b01674 Fixes for using WOLFSSL_CUSTOM_CURVES and wc_ecc_set_custom_curve. Fixes resolves issue with ->dp and ->idx getting reset which caused curve parameters to not be set correctly. Proper sequence for using custom curves is ‘wc_ecc_init, wc_ecc_set_custom_curve then wc_ecc_make_key_ex(…, ECC_CUSTOM_IDX)’ or wc_ecc_import_x963_ex(…, ECC_CUSTOM_IDX). Test case and example to follow shortly. 2017-07-24 17:21:51 -07:00
b23f983604 Intel Assembly optimizations for ChaCha20 - AVX and AVX2 2017-07-25 10:19:02 +10:00
2329e37d97 Remove options outside VxWorks 2017-07-25 09:07:30 +09:00
8e38dcc347 Tidy code up - use local static for cpuid flags 2017-07-25 08:50:39 +10:00
bde6a35ac4 Assembly optimization for AES-NI, and AVX1 and AVX2
Unroll the loop for 8.
Use new optimized maths.
Fix SHA-384 to use SHA-512 assembly code.
Only perform CPU id check in one place.
2017-07-25 08:50:39 +10:00
36c2ee92dc Merge pull request #1050 from JacobBarthelmeh/ARMv8
Xilinx port
2017-07-24 15:37:05 -07:00
1040bbde16 fix memory management with --enable-fast-rsa make key and free RSA key before calling make key function 2017-07-24 16:20:27 -06:00
be61d7fca3 Merge pull request #1044 from ejohnstown/dtls-multicast
DTLS Multicast
2017-07-24 14:20:26 -07:00
6df9bc07a4 RSA Fips harness fix. 2017-07-24 13:21:06 -06:00
e68ceb3d2c Guard against WC_RSA_BLINDING in api.c unit test. 2017-07-24 09:51:50 -06:00
95664fdd05 Merge pull request #1041 from dgarske/armc0
Fixes for building with custom options
2017-07-24 08:40:51 -07:00
9d919ca947 Merge pull request #1049 from dgarske/fix_asynchmac
Fixes for building with Async
2017-07-24 08:36:20 -07:00
0fed9c1dc5 Add dependancy file to tirtos package.bld 2017-07-24 08:32:01 -06:00
59a46d08d9 Xilinx port 2017-07-21 17:39:47 -06:00
26ac5e1ab7 Fix for error: array subscript is below array bounds warning with GCC 7. Added check to prevent negative value from being used against array. 2017-07-21 12:00:28 -07:00
b7dac4911b Fix for using Async and HMAC when its not Intel QuickAssist. 2017-07-21 11:43:01 -07:00
9e3497b3d5 Merge pull request #1047 from JacobBarthelmeh/Testing
macro guard to check if ECC is enabled
2017-07-21 10:34:13 -07:00
f0d6299581 Fix issue with benchmark_init refactor where malloc failure could use null pointer. Added error checking on the wolfCrypt_Init(). 2017-07-21 09:31:12 -07:00
173283208b add WOLFSSL_HAVE_MAX in settings.h 2017-07-21 12:42:24 +09:00
bd6633a31c #elif defined(WOLFSSL_VXWORKS) in io.h 2017-07-21 12:37:32 +09:00
e3ffd7d539 macro guard to check if ECC is enabled 2017-07-20 16:38:53 -06:00
7a972d9611 Fix warning for signed/unsigned comparison. 2017-07-20 11:35:52 -07:00
cf9dfac877 Merge pull request #1043 from SparkiDev/sha3_be
Big endian fix for SHA-3
2017-07-20 09:14:00 -07:00
d6190507ac Big endian fix for SHA-3 2017-07-20 16:53:36 +10:00
8bfbabd147 Merge pull request #1040 from jrblixt/fix-FreeToHash
Added Free functions to hash unit test.
2017-07-19 18:19:28 -07:00
0a63221220 Fix for SHA3 benchmark digest size for 224. Fix for building track and debug memory together. Fix for hash test order of SHA256 wrong. Fix for asn SkipObjectId missing, when RSA and ECC disabled. Enhancement to allow individual bench calls with bench init/free. 2017-07-19 18:14:57 -07:00
7d82d7235a Merge pull request #1038 from JacobBarthelmeh/Testing
fix warnings found building on a PPC
2017-07-19 16:54:50 -07:00
0fee243b75 Multicast DTLS
Restored the multicast key setting code that was lost during rebase.
2017-07-19 14:01:29 -07:00
935bf9028d DTLS Multicast
1. Keep track of the number of records a session drops for having a
   bad MAC or detected as replayed.
2. Add function to access the drop statistics.
2017-07-19 13:38:31 -07:00
3329aa7bef DTLS Multicast
Added an API so a session may be queried to see if it has seen any messages
from a specified peerId.
2017-07-19 13:38:31 -07:00
6223f4cd8e fix a couple rebase merge errors 2017-07-19 13:38:31 -07:00
43f3e304e6 DTLS Multicast
Added a parameter check to wolfSSL_mcast_read().
2017-07-19 13:36:42 -07:00
1d32409651 DTLS Multicast
1. Allow the MTU size to be changed at compile time for memory
   contrained environments using static memory.
2. Add compile time option to disable the check for DTLS messages
   in the current epoch with an outside-the-window sequence number.
2017-07-19 13:36:42 -07:00
3b5e537f08 DTLS Multicast
wolfSSL_set_secret() was checking the preMasterSz against the sizeof
the preMasterSecret member of the Arrays structure. That member
was changed to a pointer and allocated dynamically for the session
write-duping. The comparison between the passed in size and the size
of the parameter started failing. The check now uses the constant
that is used for allocating the preMasterSecret member.
2017-07-19 13:36:42 -07:00
4c5ddc8482 Multicast DTLS
Handshake resources are required for Multicast DTLS to calculate the
session keys. When the session key is set, free the handshake resources.
2017-07-19 13:36:42 -07:00
6509faa78d Several parameters stored with DTLS session export have moved into
a wrapper structure. Updated the references.
2017-07-19 13:36:42 -07:00
1d5c6cce00 Fix some small things compiling with a different compiler, and some
other options.
1. Missing prototype for the Mcast receive I/O callback.
2. When disabling SHA-1, the old DTLS cookie callback wouldn't work.
   Allow for SHA-256.
2017-07-19 13:36:42 -07:00
fbd7f7972b Multicast
1. Used quotes rather than angle-brackets when including
   user_settings.h.
2. Used angle-brackets rather than quotes when including
   the ThreadX and NetX headers.
3. Added a define flag to include types.h with NetX or ThreadX.
4. Added a void typecast to hush a warning about an unused variable
   in the I/O callbacks for NetX.
5. Clean up static analysis warning in the peer sequence
   number selection for DTLS.
2017-07-19 13:36:41 -07:00
b40aad3f9e Added new “wolfSSL_mcast_get_max_peers” API. Minor cleanup with examples/client failure case. Fix possible unused var in wolfSSL_set_secret with DTLS disabled. 2017-07-19 13:35:59 -07:00
6097d29045 DTLS Multicast
1. Restore original EmbedRecvFrom callback.
2. Add new EmbedRecvFromMcast callback. (EmbedSendTo still the same.)
3. Set new receive from callback when setting the member ID.
4. Fixed bad rebase change.
2017-07-19 13:34:32 -07:00
af1a9ca908 Multicast
1. Squash a couple unused variable warnings.
2017-07-19 13:34:32 -07:00
1657569605 DTLS Multicast
1. Adding the prototypes for the sequence number high water callback.
2. Added the accessors to set the highwater callback function,
   trigger levels, and application context.
3. Calls the highwater callback at specified sequence number thresholds
   per peer.
2017-07-19 13:34:32 -07:00
96c25b2caa DTLS Multicast
1. Separated the peer ID from the array index into the peer sequence
   list. This allows peer IDs to range from 0..255, and to have an
   arbitrary size for the sequence list.
2. Add API to add and remove peer IDs from the sequence number list.
2017-07-19 13:33:58 -07:00
3f330a2b21 Multicast
1. Move the function `wolfSSL_mcast_read()` to
   follow `wolfSSL_read_internal()`.
2. Implemented `wolfSSL_mcast_read()`.
2017-07-19 13:33:58 -07:00
60c6c32ad3 Multicast DTLS
Tweak the size of the Peer Sequence list.
2017-07-19 13:33:58 -07:00
fa4a8fee8c DTLS Multicast
1. Temporary change to io.c to recieve datagrams from any peer.
2. Uses an array of Peer Sequence structures to track the current
   sequence number of all the peers.
2017-07-19 13:33:57 -07:00
0457df83d4 Multicast
1. When setting the key data, use same keys for server and client
   sides of the different keys. This feels a little kludgey, and
   won't work when using separate senders and listeners who may
   use unicast messages. But this works for the all peers are
   multicast senders case.
2017-07-19 13:33:57 -07:00
30a54a4860 Multicast
1. Add haveMcast as an exception case for needing a signing key along
   with havePSK and haveAnon.
2017-07-19 13:31:39 -07:00
41638b437b DTLS Multicast
1. Add configured group ID to outbound DTLS datagrams.
2. Parse the group ID from inbound DTLS datagrams.
2017-07-19 13:31:39 -07:00
dd9800856d Multicast DTLS
When setting the new secret, in DTLS mode, update the sequence
numbers, message windows, and epoch.
2017-07-19 13:31:39 -07:00
431a0cbea9 Multicast
1. Since multicast's only cipher suite uses null cipher
   automatically enable it.
2. Add options to example client and server to start
   testing multicast API. (Uses TLS over TCP.)
3. Updates to use the forced secrets set by API.
2017-07-19 13:31:39 -07:00
f83a593f27 Added Free functions to hash unit test. 2017-07-19 14:28:41 -06:00
b616b8df02 Multicast DTLS
1. Update API
2. Update unit test
3. Partially implemented wolfSSL_set_secret().
2017-07-19 13:26:23 -07:00
0838a3828b Multicast DTLS
1. Added new cipher suite for use with Multicast DTLS,
   WDM_WITH_NULL_SHA256. (It should be a private suite.)
2. Update the API test to use the new suite.
2017-07-19 13:26:23 -07:00
5154584576 Multicast DTLS
1. Add DTLS-multicast to the enable options.
2. Reorg DTLS related enable options together.
3. Update a couple enable option texts to use the AS_HELP_STRING() macro.
4. Add three new APIs for managing a DTLS Multicast session.
5. Add test code for new APIs.
6. Add stub code for the new APIs.
2017-07-19 13:26:23 -07:00
b3a20470fd Merge pull request #1036 from jrblixt/unitTest_api_addHc128-PR07182017
Unit test functions for HC128.
2017-07-19 13:29:18 -06:00
5c19b7bfe0 Changes per Chris. 2017-07-19 11:24:56 -06:00
667b8431cc Merge pull request #683 from moisesguimaraes/wolfssl-py
wolfssl python wrapper
2017-07-19 09:22:02 -07:00
81f09e575e fix warnings found building on a PPC 2017-07-19 09:24:45 -06:00
d2245b9614 Unit test functions for HC128. 2017-07-19 09:18:48 -06:00
5f17598d47 Merge pull request #1035 from jrblixt/Api_c-Fix
api.c fix.
2017-07-18 15:46:12 -07:00
0e6b0a6156 Merge pull request #1033 from jrblixt/unitTest_api_addAesCcm-PR07172017
Unit test functions for AES-CCM.
2017-07-18 15:44:12 -07:00
e68f1b2cec api.c fix. 2017-07-18 11:02:19 -06:00
c93a903cae atualiza lista de arquivos incluídos na versão de distribuição. 2017-07-18 11:36:07 -03:00
47fd21dc63 Merge pull request #1032 from JacobBarthelmeh/SGX
fix macro check with SGX settings
2017-07-17 19:07:28 -07:00
5671a4cb49 Added unit test functions for AES-CCM. 2017-07-17 15:58:11 -06:00
808f4692c7 Merge pull request #993 from jrblixt/unitTest_api_addRsa-PR06222017
Add RSA to unit test.
2017-07-17 13:42:42 -07:00
fdb371e82e Changes per Chris. 2017-07-17 10:43:36 -06:00
c4f0bd6172 fix macro check with SGX settings 2017-07-17 09:36:45 -06:00
cc4ca6a44a Merge pull request #1029 from kaleb-himes/RIOT_OS_PORTABILITY
Riot os portability and minor design modifications
2017-07-17 05:16:56 -07:00
a7390e32ec Identified two more old-style definitions in test app 2017-07-16 16:01:52 -06:00
e51225aca6 Address typo in RIOT_OS settings and removed ECC as a default feature 2017-07-16 14:22:15 -06:00
8acf709b59 Address some old-style function definitions found in RIOT testing 2017-07-16 14:18:58 -06:00
f7cd8a0f15 Merge pull request #1028 from JacobBarthelmeh/SGX
update SGX macros for harden
2017-07-14 19:42:29 -07:00
12795e9a40 update SGX macros for harden 2017-07-14 16:59:11 -06:00
9e9dbc5e97 Merge pull request #1026 from dgarske/curve_128bit
Fix for ARMv8 and Curve25519 with debug enabled
2017-07-14 13:27:22 -07:00
8612d52844 Fix issue with ARMv8 not performing 128-bit math against constants correctly in debug builds. Fix was to use the __int128_t as const for integers. Also added ./configure --enable-curve25519=no128bit option to force FE to not use the int128_t math. 2017-07-14 10:39:30 -07:00
8b55122ba0 Merge pull request #1024 from JacobBarthelmeh/UnitTests
adjust size of test buffer
2017-07-13 16:48:00 -07:00
a0e918c350 Merge pull request #1022 from JacobBarthelmeh/curve25519
build for ed25519 only
2017-07-13 12:30:26 -07:00
ba48221c41 adjust size of test buffer 2017-07-13 13:21:09 -06:00
af8b96e277 Merge pull request #1021 from toddouska/zeroret
don't treat peer closed / zero return as hard error in example servers
2017-07-13 09:11:31 -07:00
4491102eed Merge pull request #1018 from dgarske/fix_tfm_rusb_max
Fix for fast math `fp_read_unsigned_bin` function to check max size
2017-07-13 09:27:02 -06:00
d559eb0f4f Fix for fast math fp_read_unsigned_bin function to check max and correctly set a->used (is handled in fp_mul_2d). 2017-07-12 16:39:26 -07:00
43260f02f4 Merge pull request #1020 from toddouska/null
add NULL checks to check_domain_name()
2017-07-12 14:58:07 -07:00
b12e3c6579 Merge pull request #1019 from JacobBarthelmeh/Testing
update AES CTR API with ARMv8 port
2017-07-12 15:57:25 -06:00
c4fe67b633 build for ed25519 only 2017-07-12 15:53:11 -06:00
b4f9c46069 Merge pull request #1011 from dgarske/fixes_armv8
Fixes for building ARMv8 (--enable-armasm)
2017-07-12 15:44:31 -06:00
19787e6d4f don't treat peer closed / zero return as hard error in example servers 2017-07-12 14:15:16 -06:00
c777097e54 Fix wc_AesGcmDecrypt arg check for authIn. 2017-07-12 09:49:27 -07:00
b02c995fff add NULL checks to check_domain_name() 2017-07-12 10:16:31 -06:00
5bb8de627e Fixes based on peer review (thanks). 2017-07-12 09:04:10 -07:00
43ad30d364 Merge pull request #1016 from dgarske/fix_harden
Warn if hardening options are not defined and not disabled using `WC_NO_HARDEN`
2017-07-12 09:27:32 -06:00
dc5e6f789d Merge pull request #1017 from dgarske/bigend
Fix for big endian seg fault in `SendCertificateVerify`
2017-07-12 09:25:25 -06:00
9d7e8a83c9 update AES CTR API with ARMv8 port 2017-07-11 17:13:32 -06:00
7853440d89 Merge pull request #1015 from dgarske/config_ignore_cleanup
Improve the Git ignore formula for `config`
2017-07-11 15:42:08 -07:00
3ff088b92f Merge pull request #1014 from dgarske/atecc508a
Fixes for building with ATECC508A
2017-07-11 15:41:05 -07:00
00724c95a9 Add RSA to unit test. 2017-07-11 09:57:33 -06:00
f8c0a52170 Merge pull request #996 from jrblixt/unitTest_api_addAes-PR06152017
Unit test api add AES.
2017-07-11 08:36:13 -07:00
69e9aa29f2 Fix for big endian platform in SendCertificateVerify where seg fault occurred due to passing a int pointer to a word16 pointer, which caused wrong bits to get set. Fix to replace int with word16. Tests pass now. Also searched for other (word16*)& scenarios and only other place was in ntru code, which was also fixed. 2017-07-10 20:00:37 -07:00
a5cdbb18cb Reworked the AES Key Wrap to use existing code in aes.c (instead of duplicating code in armv8-aes.c). Cleanup for GE/FE math on 32-bit to remove duplicate #ifdef check. Fixed AES GCM arg check for authIn to allows NULL. 2017-07-10 19:12:41 -07:00
792fcefbb7 Fix to not warn about WC_RSA_BLINDING in FIPS mode. Add WC_RSA_BLINDING to Windows user_settings.h. 2017-07-10 18:41:22 -07:00
171796e8e2 Fix up for building without ./configure to warn if hardening options are not enabled. Currently ./configure defaults to --enable-harden, but if building sources directly and using settings.h or user_settings.h the hardening defines will not be set by default. If a user wants to use without hardening they can suppress the warning by defining WC_NO_HARDEN. 2017-07-10 14:40:07 -07:00
cebcee34dd Improve the Git ignore formula for config. Fixes issue #1012. 2017-07-10 14:21:19 -07:00
f9c949e7e5 Merge pull request #871 from danielinux/rm-wolfssl.pc
Remove automatically generated file wolfssl.pc
2017-07-10 14:16:48 -07:00
58c05123da Fixes for building with ATECC508A. Allow ECC check key to pass if slot numb is valid. 2017-07-10 11:07:24 -07:00
205da48416 Fixes for building ARMv8. Adds missing SHA224 and AES KeyWrap. Fixes for FE/GE warning with Aarch32. Fix possible build error with ed25519_test with ret not defined. 2017-07-07 15:12:51 -07:00
b6854d620f Merge pull request #1009 from dgarske/fix_tls13_async_aes
Fix problem with async TLS 1.3 and raw AES encryption key change
2017-07-06 15:39:22 -07:00
626eeaa63d Merge pull request #1005 from SparkiDev/nginx-1.13.2
Changes for Nginx
2017-07-06 14:33:46 -07:00
ced45ced41 Changes requested by Chris. 2017-07-06 13:42:54 -06:00
31ac379c4f Code review fixes
Change verify depth and set curve to be compiled in whe using:
OPENSSL_EXTRA
Fix comparison of curve name strings to use ecc function.
Fix verify depth check when compiling with both OPENSSL_EXTRA and
WOLFSSL_TRUST_PEER_CERT.
2017-07-06 15:32:34 +10:00
4b9069f786 Merge pull request #1008 from dgarske/fix_async_frag
Fixes for using async with max fragment
2017-07-05 11:00:26 -07:00
e767d40656 Merge pull request #1006 from cconlon/mqx
Update MQX Classic, mmCAU Ports
2017-07-05 10:30:20 -07:00
df119692d1 Fixes for using async with HAVE_MAX_FRAGMENT or --enable-maxfragment which affected TLS 1.2/1.3. Added TLS 1.2 test for using max fragment. 2017-07-03 19:57:37 -07:00
5bddb2e4ef Changes for Nginx
Support TLS v1.3 clients connecting to Nginx.
Fix for PSS to not advertise hash unless the signature fits the private
key size.
Allow curves to be chosen by user.
Support maximum verification depth (maximum number of untrusted certs in
chain.)
Add support for SSL_is_server() API.
Fix number of certificates in chain when using
wolfSSL_CTX_add_extra_chain_cert().
Allow TLS v1.2 client hello parsing to call TLS v1.3 parsing when
SupportedVersions extension seen.
Minor fixes.
2017-07-04 09:37:44 +10:00
2939fbe242 Merge pull request #1004 from dgarske/fix_qat_dh
Fixes for QAT with DH and HMAC
2017-07-03 12:31:48 -07:00
1729e0205f reads _CADATA from file 2017-07-03 12:39:42 -03:00
54177c14b4 imports certs from ./certs 2017-07-03 12:31:47 -03:00
bba3fcf772 removes certs 2017-07-03 12:22:22 -03:00
c9a2c4ef02 Fix problem with async TLS 1.3 with hardware where encryption key is referenced into ssl->keys and changes before it should be used. Solution is to make raw copy of key and IV for async AES. 2017-06-30 16:41:01 -07:00
6a695b76cb Fixed server side case for DH agree issue with QAT hardware where agreeSz is not set. Fix to allow QAT start failure to continue (this is useful since only one process can use hardware with default QAT configuration). 2017-06-30 11:48:59 -07:00
a025417877 Fix issue with QAT and DH operations where key size is larger than block size. Fix issue with DhAgree in TLS not setting agreeSz, which caused result to not be returned. Renamed the internal.c HashType to HashAlgoToType static function because of name conflict with Cavium. Optimize the Hmac struct to replace keyRaw with ipad. Enable RNG HW for benchmark. Fixed missing AES free in AES 192/256 tests. 2017-06-30 11:35:51 -07:00
a3375ef961 Merge pull request #997 from NickolasLapp/master
Updates to Linux-SGX README, and disable automatic include of
2017-06-30 11:48:12 -06:00
d956181911 Merge pull request #1003 from jrblixt/asn_cMemLeak-fix
Fix possible memory leak in wc_SetKeyUsage.
2017-06-29 15:28:53 -07:00
baf6bdd6e1 asn.c memory leak fix. 2017-06-29 14:55:19 -06:00
31e1d469c0 Merge pull request #1002 from SparkiDev/tls13_imprv
Improvements to TLS v1.3 code
2017-06-29 09:21:20 -07:00
bba914f92e protect wolfSSL_BN_print_fp with NO_STDIO_FILESYSTEM 2017-06-29 08:52:45 -06:00
d2ce95955d Improvements to TLS v1.3 code
Reset list of supported sig algorithms before sending certificate
request on server.
Refactored setting of ticket for both TLS13 and earlier.
Remember the type of key for deciding which sig alg to use with TLS13
CertificateVerify.
RSA PKCS #1.5 not allowed in TLS13 for CertificateVerify.
Remove all remaining DTLS code as spec barely started.
Turn off SHA512 code where decision based on cipher suite hash.
Fix fragment handling to work with encrypted messages.
Test public APIS.
2017-06-29 09:00:44 +10:00
c099137450 add classic Kinetis mmCAU support, FREESCALE_USE_MMCAU_CLASSIC 2017-06-28 16:32:35 -06:00
15a1c9d48e fixes for MQX classic with Codewarrior 2017-06-28 12:28:40 -06:00
a89e50b7b7 include settings.h in wc_port.h to pick up user_settings.h 2017-06-28 12:25:44 -06:00
c748d9dae9 Merge pull request #998 from dgarske/fix_no_server_or_client
Fix build with either `NO_WOLFSSL_SERVER` or `NO_WOLFSSL_CLIENT` defined
2017-06-28 10:30:08 -07:00
b29cd414ef Merge pull request #995 from SparkiDev/tls13_cookie
Add TLS v1.3 Cookie extension support
2017-06-28 10:12:49 -07:00
47cc3ffdbc Fix build with either NO_WOLFSSL_SERVER or NO_WOLFSSL_CLIENT defined. 2017-06-26 23:05:32 -07:00
7aee92110b Code review fixes
Also put in configuration option for sending HRR Cookie extension with
state.
2017-06-27 08:52:53 +10:00
9ca1903ac5 Change define name for sending HRR Cookie 2017-06-27 08:37:55 +10:00
d4e104231c Updates to Linux-SGX README, and disable automatic include of
benchmark/wolfcrypt tests in static library compile
2017-06-26 14:55:13 -07:00
a3b21f0394 Aes unit test functions. 2017-06-26 15:16:51 -06:00
8bd6a1e727 Add TLS v1.3 Cookie extension support
Experimental stateless cookie
2017-06-26 16:41:05 +10:00
3bdf8b3cfd remove fcntl.h include when custom generate seed macro is defined (#994) 2017-06-23 14:03:07 -07:00
fbc4123ec0 Added -x option to allow example server to continue running when errors occur. 2017-06-22 21:19:59 -07:00
8ef556c2a0 Merge pull request #991 from JacobBarthelmeh/Testing
update .am files for make dist
2017-06-22 15:02:12 -07:00
b0f87fdcf7 update .am files for make dist 2017-06-22 14:14:45 -06:00
72da8a9a07 Merge pull request #731 from moisesguimaraes/fixes-ocsp-responder
adds OCSP Responder extKeyUsage validation
2017-06-22 11:43:51 -07:00
d017274bff Merge pull request #976 from levi-wolfssl/PemToDer-overflow-fix
Fix potential buffer over-read in PemToDer()
2017-06-22 10:07:11 -07:00
3a4edf75bd Rename the option to disable the new issuer sign check to ‘WOLFSSL_NO_OCSP_ISSUER_CHECK`. 2017-06-22 09:56:43 -07:00
06fa3de31c Merge pull request #980 from SparkiDev/tls13_0rtt
TLS v1.3 0-RTT
2017-06-22 09:44:41 -07:00
ccb8e8c976 Merge pull request #988 from jrblixt/unitTest_api_addArc4-PR06212017
Add Arc4 to unit test.
2017-06-22 09:15:28 -06:00
207b275d24 Fix HelloRetryRequest for Draft 18 2017-06-22 14:40:09 +10:00
08a0b98f52 Updates from code review 2017-06-22 12:40:41 +10:00
a37808b32c Sanity checkes added 2017-06-21 17:14:20 -06:00
1aee054902 Add Arc4 to unit test. 2017-06-21 17:03:27 -06:00
a3578c6643 Adds WOLFSSL_NO_OCSP_EXTKEYUSE_OCSP_SIGN option to provide backwards compatibility option for OCSP checking. 2017-06-21 14:12:12 -07:00
7a3769f435 Fix wolfCrypt errors test to allow -178. 2017-06-21 14:12:12 -07:00
4bb17205fe adds new ocsp test 2017-06-21 14:12:12 -07:00
a9d5dcae58 updates ocsp tests; adds check for OCSP response signed by issuer. 2017-06-21 14:12:12 -07:00
42a2f5858e adds OCSP Responder extKeyUsage validation 2017-06-21 14:12:12 -07:00
9ead657723 Merge pull request #989 from dgarske/testing
Fixes for CRL handling and possible false failure in `wolfSSL_CTX_load_verify_locations`
2017-06-21 14:10:49 -07:00
cd570a01f2 Merge pull request #975 from dgarske/ed_curve_small
Allow different Ed25519/Curve25519 math versions
2017-06-21 13:00:33 -07:00
247388903b Remove double cast + move min() calls 2017-06-21 13:56:34 -06:00
fec75e445e Fix for build error in master from QAT fixes in PR #967. Odd that this build error didn’t show up till just now. 2017-06-21 12:52:03 -07:00
64873489ef Merge pull request #977 from cconlon/cms
add PKCS7/CMS decode support for KARI with IssuerAndSerialNumber
2017-06-21 11:54:20 -06:00
d75a9f2436 Fix for wc_ReadDirFirst to return non-zero value if no files found. Fix for wolfSSL_CTX_load_verify_locations to not return failure due to wc_ReadDirNext “no more files” -1 response. 2017-06-21 10:36:49 -07:00
2f9f746053 Fix for CRL serial number matching to also check length. Fix for testing the verify callback override ‘-j’ to not enable CRL since the CA’s are not loaded for this test. 2017-06-21 10:36:49 -07:00
0fa99fcc2e Fix for openssl script test reporting ./scripts/openssl.test: line 219: psk: command not found. 2017-06-21 10:36:49 -07:00
3e06beac19 Additional edge case build error with 32-bit and small where int32_t not defined due to stdint.h not being included. 2017-06-21 10:13:20 -07:00
c183e03802 Merge pull request #986 from jrblixt/unitTest_api_addRabbit-PR06192017
Add Rabbit unit test functions.
2017-06-21 10:45:41 -06:00
decdf7ae8b Cleanup 2017-06-21 16:56:51 +10:00
1549a60aa5 Put back Draft 18 code 2017-06-21 08:35:28 +10:00
350ce5fcef TLS v1.3 0-RTT 2017-06-21 08:35:28 +10:00
97906bfdb2 Merge pull request #982 from JacobBarthelmeh/Testing
set return code to TEST_SUCCESS on successful connection
2017-06-20 16:21:50 -06:00
8b637cbd1b Merge pull request #967 from dgarske/fix_qat
Fixes and Improvements for Intel QuickAssist
2017-06-20 14:49:56 -07:00
a555b5e54a Merge pull request #987 from SparkiDev/nginx_fix
Fix for Nginx - return specific error when at end of file
2017-06-20 14:28:34 -07:00
c14e2d5888 Add Rabbit unit test functions. 2017-06-20 15:16:12 -06:00
6e6b341b46 Removed automatically generated file wolfssl.pc 2017-06-20 10:39:02 +02:00
d5b1698c43 Fix for Nginx - return specific error when at end of file 2017-06-20 09:27:24 +10:00
4950c644cd Fix edge case on 32-bit with ED small only. 2017-06-19 10:15:05 -07:00
7fdb7037d8 Fixes for building Ed/Curve for building on 32/64 bit with uint64_t. Fixes for build with Ed/Curve with ECC disabled. 2017-06-19 10:09:12 -07:00
2a688bf905 Merge pull request #972 from jrblixt/unitTest_api_addCamellia-PR06142017
Add Camellia unit test functions.
2017-06-19 09:33:19 -06:00
c118146803 set return code to TEST_SUCCESS on successful connection 2017-06-19 09:26:16 -06:00
ee83710a0a Fix for building only curve small and ed disabled. Fix for client assuming supported curves is enabled with curve. 2017-06-16 16:17:01 -07:00
6a2824f199 Add Camellia unit test functions.. 2017-06-16 16:27:03 -06:00
e0e8d14630 Merge pull request #970 from jrblixt/unitTest_api_addChacha-PR06142017
Add ChaCha unit test functions.
2017-06-16 16:15:39 -06:00
816b0b058c add PKCS7/CMS decode support for KARI with IssuerAndSerialNumber 2017-06-16 15:16:32 -06:00
43d6b7a145 Add ChaCha unit test functions. 2017-06-16 13:00:17 -06:00
17936d65e0 please Jenkins + a bit of cleanup 2017-06-16 12:27:59 -06:00
2f36b24796 Merge pull request #973 from JacobBarthelmeh/Testing
add sanity check for wolfSSL_X509_NAME_oneline function
2017-06-16 10:54:02 -07:00
4389d271cc Fixed potential buffer overflows when configured with --enable-opensslextra 2017-06-16 11:02:06 -06:00
3c173ba366 Enhancement to support different sized Curve/Ed math library implementations for FE/GE. Remains backwards compatible with CURVED25519_SMALL define. Adds new defines CURVE25519_SMALL and ED25519_SMALL to allow individual enabling of math library choice (_low_mem or _operations). Example: ./configure --enable-ed25519=small --enable-curve25519. 2017-06-16 09:41:10 -07:00
e6f0ee84ec Merge pull request #971 from jrblixt/unitTest_api_addIdea-PR06142017
Add IDEA unit test functions.
2017-06-15 13:12:52 -06:00
bb6582896d add sanity check for wolfSSL_X509_NAME_oneline function 2017-06-15 11:55:37 -06:00
d5a43af751 Code review changes. Reviewer: Chris. 2017-06-15 11:12:01 -06:00
1d303f5f61 Merge pull request #966 from cconlon/ecc_asn
fix wc_EccPrivateKeyDecode when pub exists
2017-06-15 08:42:09 -07:00
25ce52cd0c Add IDEA unit test functions. 2017-06-14 23:43:00 -06:00
2b085351b6 Merge pull request #968 from JacobBarthelmeh/Testing
silence "may be used uninitialized" warning
2017-06-14 18:05:45 -07:00
55d421d8b6 Merge pull request #964 from SparkiDev/ecc_priv_only
Ecc priv only
2017-06-14 16:42:24 -07:00
e1fef39aa2 silence "may be used uninitialized" warning 2017-06-14 16:58:22 -06:00
f008350afd Added QAT DRBG support. 2017-06-14 15:45:34 -07:00
73567853d3 Fix possible memory leak in DSA and ECC (mp_clear should always be called since async was implemented… even for fast math). Fix dynamic type mismatch in PKCS7. 2017-06-14 15:11:43 -07:00
68439d4317 Completed refactor to cleanup dynamic types. Refined the tmp buffers to new types for more granularity. Fixed several places where malloc/free type was mis-matched. Cleanup of the PKCS12 code to improve cleanup handling. Fix wc_PKCS12_parse to return 0 on success else failure. 2017-06-14 15:11:43 -07:00
88afc7a92f Progress on dynamic type cleanup for over-use of tmp_buffer. Increases performance on NUMA memory platform having ability to be more selective about the types that are NUMA allocated for use against QuickAssist hardware. 2017-06-14 15:11:43 -07:00
40d94724eb Added async hardware support for p_hash (PRF). Fix BuildTls13HandshakeHmac to use async devId. Rename poor global variable names for rng with QSH/NTRU. 2017-06-14 15:11:43 -07:00
131ccf289f Disable large alloc scrypt test. Fix unused ret warning in DH key gen from prev change. 2017-06-14 15:11:43 -07:00
a77f9fe3e6 Fix for DH so software math is used if prime is under 768 bits. 2017-06-14 15:11:43 -07:00
b778ddfea2 Merge pull request #957 from SparkiDev/tls13_updates
Tls13 updates
2017-06-14 14:59:11 -07:00
c283d4aece Merge pull request #962 from NickolasLapp/linux-sgx
Add LINUX SGX Support for building of wolfSSL static library. See README
2017-06-14 15:56:30 -06:00
70eddc4336 Merge pull request #965 from cconlon/threadx
ThreadX/NetX warning and optional dc_log_printf exclusion
2017-06-14 14:56:12 -07:00
ff48d19727 fix wc_EccPrivateKeyDecode when pub exists 2017-06-14 14:49:52 -06:00
89e6ac91bf Improve PSK timeout checks
Post-handshake Authentication

Fix KeyUpdate to derive keys properly

Fix supported curves (not checking ctx extensions)
2017-06-14 11:28:53 -07:00
6d5c257010 Merge pull request #963 from dgarske/fix_tls13_options
Fixes for TLS 1.3 without ECC or RSA
2017-06-14 11:19:14 -07:00
ea9e4887e9 ThreadX/NetX warning and optional dc_log_printf exclusion 2017-06-14 11:12:27 -06:00
1e94868432 Add LINUX SGX Support for building of wolfSSL static library. See README
in IDE/LINUX-SGX/README.md.
2017-06-13 17:34:45 -07:00
13c4fe6cc4 Add test 2017-06-14 09:44:26 +10:00
62ae1d3023 Fix for private key only ECC key. 2017-06-14 09:33:27 +10:00
19f22edd9a Merge pull request #949 from cconlon/string_abstraction
Fix mystrnstr() prototype declaration
2017-06-13 16:06:31 -07:00
1ddd6fd3fe Merge pull request #933 from jrblixt/unitTest_api_add3des
Add 3Des to unit test.
2017-06-13 15:35:54 -06:00
189d579bec Merge pull request #960 from levi-wolfssl/void
Add void to function prototype.
2017-06-13 13:58:34 -07:00
76aa1f855f Merge branch 'masterB' of https://github.com/jrblixt/wolfssl into unitTest_api_add3des-cpy 2017-06-13 14:06:30 -06:00
0ef1129f18 Changes WRT small stack. 2017-06-13 13:44:06 -06:00
042ee817f3 Merge pull request #757 from moisesguimaraes/updates-wolfcrypt-py-docs
Removes 3DES from the wolfCrypt Python docs
2017-06-13 10:55:21 -06:00
048b074894 Merge pull request #932 from jrblixt/unitTest_api_addHmac-mergeWolfMaster
Add HMAC test functions to unit test.
2017-06-13 10:53:09 -06:00
adf819458c Fixes for TLS 1.3 without ECC or RSA. Fix for building without ECC where HAVE_SUPPORTED_CURVES was getting defined because of ENABLED_TLSX. 2017-06-13 09:44:14 -07:00
a18e9a220f Merge pull request #956 from dgarske/fix_tls13_async
Fixes for asynchronous TLS 1.3
2017-06-13 08:08:34 -07:00
af2cbcdbab Added new arg documentation for asyncOkay in doxygen style. 2017-06-12 11:42:48 -07:00
ce231e0cbc Fixes for asynchronous TLS 1.3. Fixes for PK_CALLBACKS with async. New helper API's for wolfSSL_CTX_GetDevId and wolfSSL_CTX_GetHeap. Fix for build to not include tls13.c if not enabled to suppress empty object file warning. Fix typo in fe_low_mem.c. General cleanup. Extra tls13.c debug messages. 2017-06-12 11:42:48 -07:00
1d2b4226a4 Merge pull request #959 from SparkiDev/tls_pss_fix
Fix check for PSS availability in peer
2017-06-12 11:20:29 -07:00
894f4f6fa5 Merge pull request #954 from jrblixt/asn_cSetKeyUsage-fix
Fix wc_SetKeyUsage() value error.
2017-06-12 10:48:56 -07:00
0fcd1617eb Merge pull request #952 from JacobBarthelmeh/Testing
sanity check on build with ECC or RSA
2017-06-12 10:47:53 -07:00
7cc455259e Merge pull request #941 from SparkiDev/ed25519
ED25519 with certificates and TLS
2017-06-12 10:47:21 -07:00
267753acdd add void to function prototype 2017-06-12 10:28:10 -06:00
8dbd9a88ee Fix for CCM - TLS v1.3 needs all nonce/IV bytes 2017-06-12 14:21:43 +10:00
044417ba01 Fix for cache only SNI and TLS v1.3 2017-06-12 09:46:50 +10:00
fdcf25b6d1 Fix check for PSS availability in peer 2017-06-12 09:05:32 +10:00
c70fa33094 Merge pull request #958 from kaleb-himes/OPENSSL_EVP
Fix compile time Error with openssl extra and cryptonly
2017-06-09 11:12:36 -07:00
86809cca74 Fix compile time warning with openssl extra and cryptonly 2017-06-08 20:14:15 -06:00
90287c8857 Merge pull request #955 from kaleb-himes/ARG-ERR
Fix compile error, too many args with --enable-wpas
2017-06-08 14:59:55 -07:00
a00165768c Fix compile error, too many args with --enabl-wpas 2017-06-08 13:34:44 -06:00
3429b5a3b5 Rework CheckPrivateKey 2017-06-08 09:26:49 +10:00
1db52f0c04 Fix to use different PEM header for EDDSA keys
Include new cert and key files in distribution
Fix compile issue when only doing TLS13.
2017-06-08 09:26:49 +10:00
a30e8eb4ad Fix for benchmarking X25519 2017-06-08 09:26:49 +10:00
1bc862ae24 Ed25519 testing in test.c 2017-06-08 09:26:49 +10:00
613d30bcae ED25519 TLS support 2017-06-08 09:26:49 +10:00
4beda52dcd Ed25519 Certificates 2017-06-08 09:26:49 +10:00
1be0b2aa30 Merge pull request #953 from SparkiDev/tls13_psk
External PSK working in TLS13
2017-06-07 13:58:03 -07:00
2c84eee2df Fix wc_SetKeyUsage() value error. 2017-06-07 13:58:13 -06:00
5d5ff56336 External PSK working in TLS13 2017-06-07 17:20:22 +10:00
26f106c42b Merge pull request #948 from SparkiDev/tls13_down
Implement TLS v1.3 specified downgrade protection mechanism
2017-06-05 16:17:49 -07:00
63c85f72d2 sanity check on build with ECC or RSA 2017-06-05 15:21:34 -06:00
af03b7a4ff Merge pull request #944 from SparkiDev/tls13_20
Updates for Draft 20 of TLS v1.3
2017-06-05 14:06:09 -07:00
026a95ff10 Merge pull request #950 from dgarske/fix_ocsp_crl
Fixes for OCSP and CRL with non-blocking sockets
2017-06-05 13:59:36 -07:00
642795db1b Implement TLS v1.3 specified downgrade protection mechanism
TLS v1.2 implementations whould implement the downgrade protection
mechanism too and so is included.
2017-06-05 09:18:46 +10:00
c55575665f Cleanup to use WANT_READ instead of async WC_PENDING_E for non-blocking OCSP and CRL. 2017-06-02 10:35:26 -07:00
c3d29ddfe3 Merge pull request #946 from SparkiDev/jenkins
Fix NO_DH build issue
2017-06-02 09:46:55 -07:00
b3a85bc2c7 Fixes for OCSP and CRL with non-blocking sockets. Fix for OCSP and CRL file descriptor check to allow 0. 2017-06-02 09:36:35 -07:00
3df565475a protect mystrnstr prototype with WOLFSSL_LEANPSK instead of STRING_USER 2017-06-02 09:26:40 -06:00
0b32d0368f Updates for Draft 20 of TLS v1.3 2017-06-02 15:59:49 +10:00
6b34a94589 Fix NO_DH build issue 2017-06-01 11:56:53 +10:00
7a52b5b394 fixes makefiles and requiremets 2017-05-29 20:44:28 -03:00
38c6d2e3eb Merge pull request #737 from embray/patch-1
wolfcrypt Python: work around minor issue in Random.__del__
2017-05-29 20:19:21 -03:00
320ad56139 Merge pull request #939 from dgarske/fixes_async
Fixes for build with async
2017-05-26 17:04:57 -07:00
c0408aebb4 Merge pull request #938 from dgarske/fix_asn_noocspoptcert
Fixes for OCSP workaround for incomplete cert chain
2017-05-26 17:02:31 -07:00
e345471b21 Logical error fix. 2017-05-26 13:27:27 -06:00
a0345f6ba9 Fix for building without WOLFSSL_NO_TRUSTED_CERTS_VERIFY. 2017-05-26 10:53:42 -07:00
53021a5df7 Increased security for WOLFSSL_NO_TRUSTED_CERTS_VERIFY workaround so it only applies to OCSP. Fix for the workaround to still return date or parsing errors. 2017-05-26 10:01:42 -07:00
1c0006882a Remove AssertIntEq from within function. 2017-05-26 09:44:12 -06:00
a44df73151 Merge pull request #937 from SparkiDev/sha3
Initial revision of SHA-3
2017-05-25 10:48:28 -07:00
7ef5aeaf13 Fixes from review and tidy up code. 2017-05-25 09:09:50 +10:00
4134073c8d Initial revision of SHA-3 2017-05-25 09:09:50 +10:00
0e22752af4 Jenkins fixes. 2017-05-24 16:32:21 -06:00
47b0a62c88 Hmac unit test functions ready for PR. 2017-05-24 16:32:17 -06:00
edddd05226 Changes per Chris. 2017-05-24 11:50:18 -06:00
4d458831b7 Jenkins fixes. 2017-05-24 11:50:18 -06:00
b47fca5760 Patched and Clean up for PR. 2017-05-24 11:50:13 -06:00
60c51db831 Merge pull request #928 from jrblixt/unitTest_api_sha224-RipeMd
Add sha224 RipeMd to unit test
2017-05-24 09:00:35 -06:00
c1664bd1a0 Fixes for async with benchmark tool. 2017-05-23 15:41:42 -07:00
64de29f277 Fix for wolfCrypt test with enable-all and asynccrypt. 2017-05-23 15:23:58 -07:00
77dbf539c8 Merge pull request #934 from JacobBarthelmeh/mysql
some MYSQL updates for cmake and with sun 64 bit
2017-05-23 15:01:39 -07:00
720f3fdad2 Fixed a few minor build errors with async enabled. 2017-05-23 15:00:55 -07:00
d2b6ab0796 Merge pull request #935 from JacobBarthelmeh/Testing
remove size_t dependency with default build
2017-05-23 14:58:50 -07:00
6b09a7c6e1 Merge pull request #922 from SparkiDev/tls_pss
TLS v1.2 and v1.3 RSA PSS
2017-05-23 14:57:10 -07:00
1880677232 Disable wc_scrypt tests that use high memory for BENCH_EMBEDDED. 2017-05-23 14:42:19 -07:00
fc5a37ac02 Changes per Chris. 2017-05-23 10:01:31 -06:00
9f5f1dd00f Merge pull request #936 from SparkiDev/cplusplus
Compiling with g++ when configured with --enable-distro
2017-05-22 16:02:56 -07:00
19edd47018 Merge pull request #917 from SparkiDev/tls_curve25519
Enable X25519 for Key Exchange in TLS
2017-05-22 16:00:00 -07:00
47d04ebaff Fix from review. 2017-05-23 08:54:25 +10:00
c85d07a49d Merge pull request #929 from dgarske/fix_asn_perm_dirname
Fix for parsing permitted name constraint for subject directory name
2017-05-22 09:55:49 -07:00
a8f08d1d70 Merge pull request #807 from kojo1/AES-GCM-stm32f4
Fixes for STM32F4 AES GCM
2017-05-22 09:53:53 -07:00
0e860b0d55 Merge pull request #925 from dgarske/enable_all
Added new `./configure --enable-all` option to enable all features
2017-05-22 09:22:50 -07:00
15a2323c09 Compiling with g++ when configured with --enable-distro 2017-05-22 10:14:02 +10:00
6c6069bed8 Fixes from review 2017-05-22 09:47:45 +10:00
8920cd89e4 Fixes from review 2017-05-22 09:09:31 +10:00
570c3f02b8 Merge pull request #931 from JacobBarthelmeh/Memory
add trackmemory enable option
2017-05-19 17:21:56 -07:00
398c27d848 remove size_t dependency with default build 2017-05-19 16:16:08 -06:00
b6c2e2acf9 require using wolfSSL memory when enabling trackmemory 2017-05-19 15:24:38 -06:00
184e9c4090 Fix typo from intermediate change for unaligned CBC fixes. Thanks Nick. 2017-05-19 14:10:50 -07:00
a616513860 Added support for AES GCM with STM32F2/STM32F4 using Standard Peripheral Library and CubeMX. Added AES ECB Decrypt for Standard Peripheral Library. Fixes for wolfCrypt test with STM32 crypto hardware for unsupported tests (AES CTR plus 9 and AES GCM with IV != 12). Improve AES CBC for STM32 to handle block aligned only. Added IDE example for SystemWorkbench for STM32 (Open STM32 tools) IDE. 2017-05-19 11:15:46 -07:00
0a28b76e8b Refactor of the ./configure help to use AS_HELP_STRING. 2017-05-19 10:54:13 -07:00
1cf3530124 Fix for building with WOLFSSL_NO_OCSP_OPTIONAL_CERTS defined. 2017-05-19 09:59:03 -07:00
bdaa827114 Merge pull request #927 from dgarske/fix_nxp_ltc
Build fixes for NXP KSDK with MMCAU / LTC after Hexiwear changes
2017-05-19 08:49:54 -07:00
7f01aa917a Merge pull request #930 from dgarske/fix_win
Fixes for building AES key wrap and PKCS7 on Windows
2017-05-19 08:16:21 -07:00
4390f4c711 TLS v1.2 and PSS
Cleanup the TLS v1.3 PSS code as well.
Added RSA API wc_RsaPSS_CheckPadding() to check the padding - no longer
a simple memcmp with the digest.
2017-05-19 11:49:43 +10:00
5ef977aa3d Put X25519 behind P256
Option to have X25519 prioritized.
Show curve name and DH key size in TLS v1.3.
2017-05-19 10:58:43 +10:00
7f350a726b Merge pull request #926 from dgarske/bench_block_size
Added argument for benchmark block size
2017-05-18 16:45:00 -07:00
452e057dbf Merge pull request #919 from dgarske/bshg
Add `WOLFSSL_NO_TRUSTED_CERTS_VERIFY` option
2017-05-18 16:44:14 -07:00
c3a7497562 Merge pull request #923 from JacobBarthelmeh/staticmemory
updated static memory feature with pkcs7
2017-05-18 16:42:21 -07:00
4737b97503 add trackmemory enable option 2017-05-18 16:46:56 -06:00
cbb2c73828 Improve NXP MMCAU/LTC AES CBC handling for unaligned sizes. Cleanup formatting in a few places. 2017-05-18 15:04:01 -07:00
d61e0243a3 Fixes for building AES key wrap and PKCS7 on Windows. Cleanup snprintf to use XSNPRINTF and changed so define is always setup. 2017-05-18 14:44:19 -07:00
36e1fb5e5b Fix for parsing permitted name constraint for subject directory name. Cleanup to use switch in ConfirmNameConstraints. 2017-05-18 14:06:56 -07:00
09ca962d66 use LP64 for CPU arch type when sun or __sun is defined 2017-05-18 14:39:26 -06:00
2086394a35 compatibility of get cipher list function and update cmake files 2017-05-18 14:36:34 -06:00
77ac61c0f4 Prepare for PR Add Sha224 and RipeMd to unit test. 2017-05-18 13:08:25 -06:00
30db8e95a7 Build fixes for KSDK NXP MMCAU / LTC after Hexiwear changes. 2017-05-18 11:52:20 -07:00
48895cf03b Added argument for benchmark block size. Usage: ./wolfcrypt/benchmark/benchmark 128. Automatic calculation for showing as bytes, KB or MB. 2017-05-18 11:24:32 -07:00
7bd1e0b80a Added new ./configure --enable-all option to enable all features. Allows building all features without using the --enable-distro option, which only allows shared build and does not generate an options.h file. 2017-05-18 10:57:28 -07:00
c5cc9f5392 Patch from customer that adds new WOLFSSL_NO_TRUSTED_CERTS_VERIFY option to load CA using subject and match using publicKey. This is a workaround for situation where entire cert chain is not loaded/available. This is not a secure solution because it does not perform PKI validation. 2017-05-18 09:55:39 -07:00
4370a01778 Merge pull request #921 from dgarske/fix_crl
Fix for CRL issue with XFREE using invalid arg for heap.
2017-05-18 09:40:40 -07:00
b5e74878b3 Merge with wolfSSL master for PR includes RipeMd and Sha224 unit test
functions.
2017-05-18 10:05:22 -06:00
4edcbc79c1 RipeMd and Sha224 added to unit test. 2017-05-18 09:32:11 -06:00
548c01ce54 updated static memory feature with pkcs7 2017-05-18 09:31:09 -06:00
9fb6373cfb Get PSS going on server side 2017-05-18 15:36:01 +10:00
c1f82ece7a Fix for CRL issue with XFREE using invalid arg for heap. 2017-05-17 16:39:35 -07:00
2f15d57a6f Merge pull request #640 from jrblixt/unitTest_api_dev
unit test md5, sha, sha256, sha384, sha512
2017-05-17 09:17:32 -07:00
63a6618feb Enable X25519 for Key Exchange in TLS 2017-05-17 08:58:12 +10:00
4c451a6c61 Merge pull request #920 from dgarske/fix_sb_tls
Fix for scan-build warning for possible use of uninitialized `eccKey`
2017-05-16 12:56:50 -07:00
5621fad02b Merge pull request #918 from cconlon/vxworksreadme
fix VxWorks README formatting
2017-05-16 12:46:26 -07:00
cb3b10054d unwanted removal added back. 2017-05-16 13:13:53 -06:00
270d6cbae3 Merge branch 'unitTest_api_dev' of https://github.com/jrblixt/wolfssl into unitTest_api_dev 2017-05-16 13:05:26 -06:00
6acd5dafa7 Changes from Todd's code review. 2017-05-16 12:58:07 -06:00
81b6894f6f Merge pull request #841 from SparkiDev/nginx2
Fix loading of CRLs and certs from a file.
2017-05-16 09:13:29 -07:00
289f60e2c9 Changes from Todd's code review. 2017-05-16 10:04:30 -06:00
79b0311952 Fix for scan-build warning src/tls.c:4898:20: warning: The left operand of '!=' is a garbage value. 2017-05-16 08:50:06 -07:00
c960faffeb fix VxWorks README formatting 2017-05-16 09:21:54 -06:00
e5fe1a3750 Unlock on memory allocation failure. 2017-05-16 09:41:17 +10:00
da15b54529 Merge pull request #915 from SparkiDev/blake2b_init
Blake2b fix for GCC 5.4
2017-05-15 08:59:54 -07:00
bb60f7a4a4 Merge pull request #914 from JacobBarthelmeh/Testing
check return value of test case
2017-05-15 08:58:31 -07:00
d53a77a589 Merge pull request #916 from SparkiDev/ecc_unused
Fix for scan_build_known_configs warning
2017-05-14 21:51:02 -07:00
1a08143946 Fixup for async on master 2017-05-15 10:10:28 +10:00
1e2a6412d7 Find the CRL entry again after lock 2017-05-15 10:10:28 +10:00
ff4fcf21d6 Add test for private key only ecc key 2017-05-15 10:04:42 +10:00
c6ce1fe330 Allow private key only ECC key to be loaded 2017-05-15 10:04:42 +10:00
c7e57e9c6c Late CRL check - copy data before use 2017-05-15 10:04:42 +10:00
c8e6c64e51 Fix warning when building for Windows 2017-05-15 10:04:42 +10:00
4723b8470a Allow a CRL's signature to be verified on use 2017-05-15 10:04:42 +10:00
4d77e80d04 Fix loading of CRLs and certs.
Change function wolfSSL_X509_LOOKUP_load_file to load multiple CRLs and
certificates from a file.
Change CRL loading to have a flag to not verify CRL signature - only do
this when using wolfSSL_X509_LOOKUP_load_file() as the certificate is
not always available.
Add test case for loading multiple CRLs in one file without certificate.
2017-05-15 10:04:42 +10:00
224c1b2645 Fix for scan_build_known_configs warning 2017-05-15 09:59:34 +10:00
f8023b808f Blake2b fix for GCC 5.4
Memsetting P and then setting non-zero fields works with GCC 5.4.
2017-05-15 09:47:11 +10:00
3297280e62 Merge pull request #913 from JacobBarthelmeh/Compatibility-Layer
allow re-using WOLFSSL structure after calling shutdown
2017-05-12 16:50:14 -07:00
dcd3a6a478 Merge pull request #907 from dgarske/fix_verifycb
Fixes for verify callback override
2017-05-12 16:45:55 -07:00
66e086a0bf check return value of test case 2017-05-12 16:40:37 -06:00
0374907acc allow re-using WOLFSSL structure after calling shutdown 2017-05-12 13:54:20 -06:00
d03f97dafc Merge pull request #911 from dgarske/gcc_7
Fixes to work with gcc 7.1
2017-05-12 12:08:08 -07:00
606aca9916 Merge branch 'master' of https://github.com/jrblixt/wolfssl into unitTest_api_dev 2017-05-12 02:04:58 -06:00
01a5f901d0 Merge pull request #909 from dgarske/fix_no_harden
Fix issue with --disable-harden
2017-05-11 16:42:19 -07:00
53a837b230 Fix to only use FALL_THROUGH macro for GCC 7.1 or later. 2017-05-11 15:52:32 -07:00
7c7503449f Removed the -Wimplicit-fallthrough=5 from autogen.sh, since older GCC throws “error: unknown warning option”. 2017-05-11 15:28:49 -07:00
562db08c3d Implemented strict switch fall-through handling using new macro FALL_THROUGH. 2017-05-11 15:15:19 -07:00
c0c98c8f64 Fixes to address build warnings for GCC 7. Used -Wimplicit-fallthrough=0 to suppress all switch fall-through warnings. 2017-05-11 15:12:16 -07:00
f1e6f7d01d Attempt to fix Visual Studio 2012 compiler issue with test.h myVerify callback. 2017-05-11 13:53:04 -07:00
ce42738198 Merge pull request #900 from dgarske/coverity_part3
Coverity fixes for TLS 1.3, async, small stack and normal math.
2017-05-11 13:05:53 -07:00
5c652e398f Merge pull request #896 from dgarske/async_cleanups
Fixes for async and smallstack
2017-05-11 13:05:25 -07:00
e12545ac38 Merge pull request #846 from SparkiDev/renum
Renumbered return values in test.c
2017-05-11 13:05:08 -07:00
05d2032661 Fix for useVerifyCb variable not used warning with NO_CERTS defined. 2017-05-11 12:57:12 -07:00
1b21df9b2b Fix issue with --disable-harden build due to wc_off_on_addr defined but not used. Cleanup of the wc_off_on_addr code to combine duplicate definitions. Fixes issue #908. 2017-05-11 12:49:34 -07:00
2efa7d5b8b Fix for verify callback override, peerVerifyRet code on success and ensuring DOMAIN_NAME_MISMATCH error gets passed down in ECDSAk case. Added unit test case to verify callback override works. Fixes issue #905 and issue #904. Fix for async build goto label typo. 2017-05-11 12:23:17 -07:00
a79f9c93c9 Merge pull request #906 from cconlon/tls13beta
wolfSSL 3.11.1 release, TLS 1.3 BETA
2017-05-11 11:46:10 -07:00
7d6597fe55 wolfSSL 3.11.1 release, TLS 1.3 BETA 2017-05-11 10:01:04 -06:00
dcc9f9ae63 Merge pull request #903 from SparkiDev/tls13_interop3
Interop testing fixes
2017-05-10 23:04:56 -07:00
22ce2f183d Interop testing fixes
Fix TLS13 cipher suite name to CHACHA20
Include SignatureAlgorithm in older versions of TLS when compiling for
TLS v1.3.
BIT STRING unused bits doesn't necessarily indicate last unused bit.
Fix ecc_dsa_sa_algo value.
2017-05-11 10:42:09 +10:00
01586b26ae Merge pull request #902 from SparkiDev/tls13_interop2
TLS v1.3 Interop changes
2017-05-10 09:28:22 -07:00
ec6d8f48b8 Add PSS for TLS v1.3 2017-05-10 17:22:53 +10:00
df3abee72c TLS v1.3 Interop changes
Added Curve25519 for TLS v1.3 only. Curve25519 won't work with older
protocol versions.
Always send signature algorithm extension in TLS v1.3 for server
certificates. If only doing PSK doesn't need to be sent though.
2017-05-10 15:16:27 +10:00
8d4f8c6d80 Fixes for build with distro for BuildTls13HandshakeHmac arg change. 2017-05-09 10:09:43 -07:00
c47826cc8f Additional TLS 1.3 return code checking. 2017-05-09 09:45:40 -07:00
e8cf4b5ff0 Coverity fixes for TLS 1.3, async, small stack and normal math. 2017-05-09 09:13:21 -07:00
dea092fa0a Merge pull request #901 from SparkiDev/tls13_interop
TLS v1.3 interop fixes
2017-05-09 09:08:31 -07:00
46c4adcf4c TLS v1.3 interop fixes 2017-05-09 14:49:21 +10:00
2e016f3b25 Refactor of the rsa_test and dh_test to better handle cleanup. 2017-05-08 12:30:54 -07:00
285a338054 Merge pull request #899 from kaleb-himes/release-update
Credit E.S. from W.A. with report of DTLS interop bug
2017-05-08 12:06:41 -06:00
7b6e2b1002 Credit E.S. from W.A. with report of DTLS interop bug 2017-05-08 10:26:08 -06:00
5726c23d81 Fix for scan-build warning with ret not being read in DoServerHello. 2017-05-06 14:00:24 -07:00
8cd78edac1 Fixes for building with smallstack 2017-05-06 00:39:12 -04:00
011178994b Fix typos with goto exit labels and heap. 2017-05-06 00:32:02 -04:00
6cc3983894 Fix for using async with —enable-eccencrypt. 2017-05-06 00:28:01 -04:00
17587d38f8 Fix for new AES 192/256 tests to handle async wait. 2017-05-06 00:28:01 -04:00
d23f1e5637 Merge pull request #895 from JacobBarthelmeh/Testing
use type with XFREE
2017-05-05 16:27:03 -07:00
176193a835 Merge pull request #877 from dgarske/tls13
Add TLS 1.3 support
2017-05-05 12:50:40 -07:00
a4ceeed462 use type with XFREE 2017-05-05 13:27:33 -06:00
fdb46ac24c Fix typo with blake2b_test return code. 2017-05-05 11:11:17 -07:00
0ca2d7c137 Renumbered return values. 2017-05-04 14:53:39 -07:00
af0103bc94 Fix for Valgrind memory leak with the “ssl->hsHashes”. The DTLS wolfSSL_connect for “IsDtlsNotSctpMode” at line 8134 calls InitHandshakeHashes, but doesn’t free existing. Best overall solution is to make sure and free an existing on InitHandshakeHashes, since WOLFSSL is memset to 0. 2017-05-04 14:51:31 -07:00
758c2a761c Increase timeout on ready file for tls13.test 2017-05-04 14:51:31 -07:00
902f5cf53f Stack size enabled config fix 2017-05-04 14:51:31 -07:00
f0204de881 Fix for async and tls13 config 2017-05-04 14:51:31 -07:00
570befb63f Fixes for using async. Combine duplicate DoCertificate and DoTls13Certificate code into ProcessPeerCerts. Cleanup of the XMALLOC/XFREE to use ssl->heap. 2017-05-04 14:51:31 -07:00
efb4b3c183 Fix for unit test with non-blocking set. 2017-05-04 14:51:31 -07:00
253140f37e Fixes for TLS 1.3. Fix issue with wc_AesGcmDecrypt checking for authIn arg (allowed to be NULL). Fix for preMasterSz in TLSX_KeyShare_ProcessEcc. Fix for building with --disable-asn (NO_CERTS). Fix to remove client “-t” option from help, which no longer exists. Added new WOLFSSL_DEBUG_TLS option for new messages added. 2017-05-04 14:51:31 -07:00
77f9126edf Rebase fixes for TLS 1.3. Getting a decrypt error with the TLS 1.3 test from the SendTls13CertificateVerify. 2017-05-04 14:51:31 -07:00
2b1e9973ec Add TLS v1.3 as an option 2017-05-04 14:51:30 -07:00
edf5d6d777 Merge pull request #894 from JacobBarthelmeh/Release
Prepare for release 3.11.0
2017-05-04 14:49:43 -07:00
b51643c344 prepare for release version 3.11.0 2017-05-04 14:17:35 -06:00
7dd877554b build for windows visual studio with AES GCM 2017-05-04 14:14:12 -06:00
9b5340d3af sanity checks before copying copying peer certificate 2017-05-04 13:10:46 -06:00
bfc43cee15 Merge pull request #893 from cconlon/pkcs7-valgrind-fix
fix PKCS7 signedData valgrind issue
2017-05-03 18:14:32 -07:00
5e06d59c79 fix PKCS7 signedData valgrind issue 2017-05-03 17:16:44 -06:00
e771611c29 Merge pull request #891 from JacobBarthelmeh/Testing
sanity check on input buffer index
2017-05-03 12:13:43 -07:00
86f10086bb Merge pull request #890 from dgarske/fix_sb_sni
Fix for scan build warning for `TLSX_SNI_GetRequest` possible use of null ptr
2017-05-03 10:03:59 -07:00
55538b5de0 sanity check on input buffer index 2017-05-03 10:21:03 -06:00
338194be25 Fix for scan build warning for TLSX_SNI_GetRequest possible use of null pointer. 2017-05-03 07:33:13 -07:00
1dc5a0fba2 Merge pull request #889 from JacobBarthelmeh/master
add digsigku to renewcerts script and update the not after date
2017-05-02 19:59:07 -07:00
a8a5841b7c Merge pull request #888 from JacobBarthelmeh/Testing
Testing
2017-05-02 17:52:14 -07:00
4c8fdf99c5 add digsigku to renewcerts script and update the not after date 2017-05-02 18:08:10 -06:00
8146f73eff warnings when using g++ compiler 2017-05-02 15:20:20 -06:00
aa990ed1ce in error case close FILE 2017-05-02 14:54:27 -06:00
dbb67d8582 warnings for builds of haproxy, nginx, and leanpsk 2017-05-02 14:29:53 -06:00
0532adf653 Merge pull request #887 from dgarske/minor_cleanups
Added return code checking for `wolfCrypt_Init()`
2017-05-02 12:19:12 -07:00
ddcf11011e Added return code checking for wolfCrypt_Init(). Added initRefCount check on wolfCrypt_Cleanup(). Fix link for tenAsys INtime RTOS readme. 2017-05-02 10:20:31 -07:00
27aafd674a Merge pull request #886 from dgarske/fixes_coverity2
Fixes for coverity scan (part 2)
2017-05-02 08:53:03 -07:00
8d032081ae Merge pull request #767 from shihrer/hexiwear_pr
Hexiwear changes and KDS Project for Hexiwear platform
2017-05-02 07:31:41 -06:00
4135279f82 Merge pull request #843 from kaleb-himes/dtls-interop
DTLS update per RFC 6347 Section 4.2.3
2017-05-01 19:29:27 -07:00
f61380da21 Merge pull request #870 from kaleb-himes/PSK-UPDATE
Update PSK identity length per RFC 4279 - section 5.3
2017-05-01 19:04:32 -07:00
3647e50c17 Fixes for the GrowInputBuffer and GrowOutputBuffer changes to only use align when WOLFSSL_GENERAL_ALIGNMENT > 0. 2017-05-01 18:48:54 -07:00
9491027c85 Fixes for coverity scan (part 2). 2017-05-01 16:34:24 -07:00
1a0b408658 Merge pull request #883 from dgarske/fixes_coverity
Fixes for coverity scan
2017-05-01 16:30:04 -07:00
9655a1e38c Merge pull request #885 from dgarske/async_cavium
Fixes for Cavium Nitrox with async
2017-05-01 13:36:59 -07:00
f19cf4cb34 Fix the client PSK callback to always null terminate after callback. Remove the +1 on the test.h examples for PSK callbacks. 2017-05-01 12:10:05 -07:00
7a1776e931 Merge pull request #881 from cconlon/sniffer
fix sniffer with AES-GCM, add scratch authTag buffer
2017-05-01 11:51:01 -07:00
893b6f7d75 Merge pull request #884 from JacobBarthelmeh/Testing
fix warnings and errors with FreeBSD PowerPC
2017-05-01 11:37:04 -07:00
9269298034 Merge branch 'hexiwear_pr' of https://github.com/shihrer/wolfssl into hexiwear_pr 2017-05-01 12:04:35 -06:00
abe5a318f2 Added hexiwear to include.am and removed dev environment specific variable 2017-05-01 10:44:09 -06:00
2de6c88b80 correct typo when checking if variable rng is null 2017-04-30 18:53:58 -06:00
7270134aec Merge pull request #788 from takotakot/readme
Fix spacing and comma
2017-04-30 06:48:45 +09:00
450ff55d83 fix warnings and errors with FreeBSD PowerPC 2017-04-28 17:57:48 -06:00
db63fe83d4 Initial pass at fixes for coverity scan. 2017-04-28 14:59:45 -07:00
4387e1f08e Merge pull request #855 from insane-adding-machines/master
Added support for HAproxy load balancer
2017-04-28 13:10:58 -07:00
885b301e72 Merge pull request #882 from dgarske/fix_memleak
Fix memory leak with InitSSL having duplicate RNG creation code
2017-04-28 12:07:45 -07:00
c92b497ea3 Fix async merge error which duplicated the wolfSSL_new RNG creation and caused a memory leak. Fix for build error with plainDigestSz not being initialized. 2017-04-28 10:11:17 -07:00
ab78bd0d90 Merge pull request #880 from dgarske/intime_rtos2
tenAsys INtime RTOS port fixes from customer peer review
2017-04-27 21:47:53 -07:00
b8917baa6a fix sniffer with AES-GCM, add scratch authTag buffer 2017-04-27 15:22:30 -06:00
053594eb98 Workaround for expected failed RSA operations in test.c not failing for Cavium Nitrox V. 2017-04-27 14:21:38 -07:00
2deced22dc Merge pull request #879 from dgarske/fix_builderrors2
Fix for scan-build issues with possible use of null’s
2017-04-27 15:06:37 -06:00
b61f279b61 Merge pull request #878 from cconlon/serialfix
skip removal of leading zero in GetASNInt() when INTEGER is only a si…
2017-04-27 13:13:21 -07:00
a4efaf5eaa Fix mutex to use single count for semaphore so behavior is like mutex. Fix typo with “received”. Fix for mp_clear with fast math to do null check on arg (noticed null with ecc make key benchmark with wc_ecc_free). 2017-04-27 13:09:11 -07:00
3e6243eb08 Fix for scan-build issues with possible use of null’s in evp.c wolfSSL_EVP_CipherFinal out arg and DoCertificate args->certs. Removed obsolete client example help arg “-t”. 2017-04-27 10:53:47 -07:00
8118762dc4 skip removal of leading zero in GetASNInt() when INTEGER is only a single zero byte 2017-04-27 11:07:59 -06:00
fd2996bdeb Progress with RSA fixes for Cavium Nitrox after async refactor. Improved method for RsaKey and ecc_key typedef to work with async. 2017-04-26 16:40:10 -07:00
774ce1a47c Fixes for build with Cavium. 2017-04-26 16:39:41 -07:00
4363cf8a5c Merge pull request #876 from dgarske/fix_jenkins_errors
Fix minor build errors and warnings
2017-04-26 16:54:49 -06:00
d612b827b7 Fixes for build warnings on Windows. Fix PKCS7 to use const for byte array declaration. Cleanup of the pkcs7 MAX_PKCS7_DIGEST_SZ. Fix for unsigned / signed comparison warning for pkcs7_load_certs_keys in test.c. Fix for cast warning from word16 to byte in asn.c. Fix for build error with io.h refactor for InTime RTOS. 2017-04-26 09:40:33 -07:00
325a3ce418 Merge pull request #875 from dgarske/fix_asn_setname_len
Fix issue with ASN encoding SetName function header length
2017-04-26 10:03:25 -06:00
5a77eaa579 Fix issue with XFREE in asn.c using invalid heap pointer. Fix issue with bad variable names and missing asterisk in test.c pkcs7_load_certs_keys. 2017-04-26 08:45:05 -07:00
7db30ef550 Merge pull request #690 from embray/build/enable_aes_counter
Add a configure flag specifically for enabling AES CTR mode
2017-04-25 15:14:13 -07:00
1f923a11ee Merge pull request #874 from dgarske/fix_builderrors
Build fixes to address Jenkins reports
2017-04-25 15:14:37 -06:00
ac2835ec2e Merge pull request #873 from dgarske/fix_crl_smallstack
Fix build error with CRL and WOLFSSL_SMALL_STACK.
2017-04-25 15:02:04 -06:00
d435c16fe8 Fix issue with ASN encoding, where the SetName function was incorrectly adding extra byte for object id tag. Refactor changed lines 7694 and 7700 to use SetObjectId which handles length (was using SetLength prior to refactor). Issue was noticed via compatibility testing using generated cert against openssl asn1parse. 2017-04-25 12:06:08 -07:00
fb90a4e498 Fix issue with PSK max length by adding 1 for the null terminator on the strings and allowing up to 128 characters for the PSK. Improved the test.h example for PSK callbacks. 2017-04-25 11:43:45 -07:00
be6b12a350 Build fixes to address Jenkins reports. Additionally tested with enable-distro and small-stack identified issue in ssl.c (note: we need to add this combination to Jenkins). 2017-04-25 11:10:36 -07:00
92d3c7cd59 Merge pull request #872 from JacobBarthelmeh/Testing
handle redefinition warnings
2017-04-24 15:08:13 -07:00
8b0784bdfa Fix build error with CRL and WOLFSSL_SMALL_STACK. 2017-04-24 14:08:59 -07:00
4dad4b6962 handle redefinition warnings 2017-04-24 10:40:56 -06:00
dd2915f4fa Merge pull request #869 from cconlon/ecckeytoder
Fix leading zero in wc_BuildEccKeyDer
2017-04-24 09:02:41 -07:00
08787621ea wolfssl.pc: Prefix reset to /usr/local 2017-04-24 12:45:23 +02:00
6ada67f93f Prefix stubs with wolfSSL_ 2017-04-24 11:43:19 +02:00
7bd7de350c More fixes for haproxy port 2017-04-24 10:41:39 +02:00
7058211860 Merge from latest masterbranch 2017-04-24 06:18:44 +02:00
ebb32265eb Minor fixes after PR review 2017-04-24 06:16:35 +02:00
db835da00b Fixes after wolfSSL feedback 2017-04-22 10:58:05 +02:00
348536af9a Update PSK identity length per RFC 4279 - 5.3 2017-04-21 16:38:19 -06:00
3600371abf Merge pull request #848 from ghoso/des_ecb_encrypt_impl
openSSL compatibility API
2017-04-21 14:05:22 -06:00
af26708330 Fix leading zero in wc_BuildEccKeyDer 2017-04-21 11:40:50 -06:00
7a3f7ad9be Merge pull request #868 from kaleb-himes/ARDUINO-UPDATE
Update ARDUINO script per issue #859 from @pasko-zh
2017-04-20 17:02:49 -07:00
a857da23c0 Merge pull request #862 from kaleb-himes/STUNNEL-FIX
Fix this issue: PKCS12 is defined to be WC_PKCS12, then redefined as an enumerated value of 12 in asn.h
2017-04-20 13:24:39 -07:00
1dd16e6702 Update enum name from peer review 2017-04-20 10:05:12 -06:00
c9d53a4ca2 Merge pull request #854 from NickolasLapp/master
Add AES 192/256 bit wolfCrypt tests
2017-04-19 16:50:18 -07:00
d6abd4d131 Merge pull request #867 from JacobBarthelmeh/mutex
fix mutex allocation sanity checks
2017-04-19 13:32:55 -07:00
a8eb2614f6 Update reference for aes192/256 test to remove bad url and give specific
NIST reference document.
2017-04-19 13:13:34 -06:00
14e37cdc4c Change variable name, add comment 2017-04-19 13:10:55 -06:00
5b257d6fd8 Merge pull request #866 from JacobBarthelmeh/Testing
add back in haveTrustPeer variable and put macro guard on WC_RNG typedef
2017-04-19 11:57:56 -07:00
32e83cb55d Update ARDUINO script per issue #859 from @pasko-zh 2017-04-19 11:53:58 -06:00
344c0ec747 Merge branch 'master' of github.com:wolfSSL/wolfssl 2017-04-19 10:10:23 -06:00
4eecaf2574 fix mutex allocation sanity checks 2017-04-18 17:18:19 -06:00
a8115d51fa add back in haveTrustPeer variable and put macro guard on WC_RNG typedef 2017-04-18 16:53:02 -06:00
5b82c2f6ec Merge pull request #853 from JacobBarthelmeh/Windows
testsuite time check on Windows system and fix dh_test if statement
2017-04-18 14:57:53 -07:00
1215203c39 Update sha384 fips. 2017-04-18 12:53:54 -06:00
4a8259b2ad Jenkin's Fips corrections. 2017-04-18 11:29:35 -06:00
5486a60326 sha512.c updates. 2017-04-18 11:18:29 -06:00
3279865610 Fixes after jenkins report
https://test.wolfssl.com/jenkins/job/windows_pull_request_builder/1453/
2017-04-18 18:47:04 +02:00
bf877a636f Merge from masterbranch 2017-04-18 18:34:14 +02:00
7df7a07a68 Merge pull request #863 from JacobBarthelmeh/Testing
fix old version of AEAD cipher suite
2017-04-18 09:33:00 -07:00
8e7d0ba243 Merge pull request #860 from dgarske/fix_allow_old_tls_wsha1
Fix for building with NO_OLD_TLS and WOLFSSL_ALLOW_TLS_SHA1
2017-04-18 09:31:45 -07:00
fbd5d5bfc6 Merge pull request #865 from cconlon/pkcs7-signed-ecc
PKCS#7 SignedData - ECDSA and hash options
2017-04-18 09:30:47 -07:00
bab3fd5925 fix clang/scan-build warnings for PKCS7 2017-04-17 14:23:37 -06:00
4f26e0341b allow different hashes with PKCS7 SignedData, cleanup conditional builds 2017-04-17 09:46:26 -06:00
f7c58b0643 Updated wolfcrypt/src/sha256.c. 2017-04-14 16:42:18 -06:00
3749988ee2 Updated wolfcrypt/src/sha.c. 2017-04-14 16:24:25 -06:00
5b5c8f1e95 Updated mcapi/mcapi_test.c ; wolfcrypt/src/md5.c ; wolfcrypt/src/pwdbased.c. 2017-04-14 16:12:29 -06:00
b08e5f3b82 Merge branch 'master' into hexiwear_pr 2017-04-14 12:03:42 -06:00
53eca92cc0 change type for test instead and add RSA blinding check 2017-04-14 12:02:49 -06:00
21d2becd6b Modified settings.h to allow building on KSDK 1.3, modified test.c and benchmark.c to work with KSDK, added KDS project for building wolfSSL for Hexiwear 2017-04-14 12:02:28 -06:00
999328f2a0 fix old version of AEAD cipher suite 2017-04-14 10:32:15 -06:00
3f067bccf0 fix redefinition of PKCS12 version and PKCS12 struct when building w/ STUNNEL 2017-04-14 10:20:35 -06:00
74aafb1679 add PKCS7 SignedData with ECDSA 2017-04-14 09:29:22 -06:00
609ca3c823 Jenkin's Visual Studio status check correction. 2017-04-14 02:34:31 -06:00
b5d856eada Merge branch 'master' of https://github.com/wolfSSL/wolfssl into unitTest_api_dev 2017-04-14 02:17:57 -06:00
00ea508751 Param check fix in hash files. 2017-04-14 02:16:04 -06:00
7779a64cae Fix for building with NO_OLD_TLS and WOLFSSL_ALLOW_TLS_SHA1. 2017-04-13 21:26:20 -07:00
f2ac410f1e Merge pull request #858 from dgarske/fix_bench_count
Fix build/test error with `--enable-scrypt` and build error for ARMv8 AES init
2017-04-13 21:14:44 -07:00
ac6b840dc5 Merge Conflict with wolfSSL master. 2017-04-13 16:51:08 -06:00
85b78835a6 Merge branch 'master' into unitTest_api_dev
src/keys.c
	wolfcrypt/src/hmac.c
	wolfcrypt/src/md5.c
	wolfcrypt/src/sha256.c
	wolfcrypt/src/sha512.c
	wolfssl/wolfcrypt/md5.h
2017-04-13 16:33:23 -06:00
ebde18af59 silence static analysis tool warning about null parameter after sanity check 2017-04-13 15:32:31 -06:00
620d21c850 fix scrypt test with no password 2017-04-13 15:06:26 -06:00
3df47d57ab Fix error with armv8-aes wc_AesInit function using h instead of heap variable. (moved from PR #852). 2017-04-13 14:50:55 -06:00
4c6a70861b Fix build errors with --enable-scrypt. 2017-04-13 09:37:48 -07:00
723ee69114 Fixed missing braces in wolfcrypt test 2017-04-13 15:31:50 +02:00
ef231a039d Updated to latest masterbranch 2017-04-13 15:28:19 +02:00
fe215c4a57 Fix DES_ecb_encrypt function in terms of reviewing point. 2017-04-13 12:31:52 +09:00
460197a5e0 Add aes192 and aes256 tests
Fix bug with AES decrypt for non-128 bit sizes on STM32F4 hardware
crypto
2017-04-12 20:09:47 -06:00
3ac35ce3b3 Merge pull request #838 from SparkiDev/curve25519_51-bit
Curve25519 51-bit Implementation
2017-04-12 16:06:37 -06:00
26c8958d1e testsuite time check on Windows system and fix dh_test if statement 2017-04-12 15:56:45 -06:00
8ee9e4ff8b Merge pull request #851 from toddouska/nosessid
don't send session ID on server side if session cache is off unless w…
2017-04-12 14:50:43 -07:00
3abcff4db5 Merge pull request #850 from JacobBarthelmeh/Testing
fix invalid check on unsigned type
2017-04-12 13:56:44 -07:00
27d009475c Merge pull request #847 from dgarske/distro_options
Fixes for --enable-distro to include more features by default
2017-04-12 13:56:24 -07:00
e1a53a6c36 Merge pull request #845 from SparkiDev/cert_file
Rename caCertFile
2017-04-12 13:55:56 -07:00
4f7b27fc88 Merge pull request #844 from SparkiDev/size_t-printf
32-bit size_t and printf fix
2017-04-12 13:54:52 -07:00
3810571e0d Merge pull request #715 from dgarske/async_intelqa
Intel QuickAssist (QAT) support and async enhancements/fixes
2017-04-12 13:54:19 -07:00
b1d59a2334 don't send session ID on server side if session cache is off unless we're echoing session ID as part of session tickets 2017-04-12 10:54:19 -07:00
11133e578d Fixes and cleanups based on feedback from Sean. Added ifdef checks around WC_PENDING_E code to reduce code size for non-async builds. Cleanup accumulative result code checking in SSL_hmac. Cleanup of the RSA async state advancement. 2017-04-12 10:07:38 -07:00
b510c8199e fix invalid check on unsigned type 2017-04-12 10:41:35 -06:00
df70b3c859 Removed empty ifdef 2017-04-12 12:50:17 +02:00
3e9a5fd433 Updated to latest masterbranch 2017-04-12 12:48:38 +02:00
9ca49e7f56 Add more stubs for haproxy 2017-04-12 11:59:17 +02:00
02513792b6 Make new function stubs public 2017-04-12 10:37:17 +02:00
d0f31d4a30 Fix issue with wc_ecc_make_key where state failure can occur if the wc_ecc_init hasn’t been called on key prior. Now wc_ecc_make_key and wc_ecc_import_private_key (and _ex versions) can be called without having to call wc_ecc_init first. This keeps backwards compatibility. If async or static memory is desired then wc_ecc_init_ex must be called first. 2017-04-11 15:57:09 -07:00
85bef98331 Fix wc_ecc_alloc_rs memset logic. Fix error handling in hmac.c for SHA224. Cleanup of the wc_DhGenerateKeyPair_Async function. Added comment about the “BuildTlsFinished” allocation for hash buffer. Fixed issue with example server that caused the benchmark script to fail in throughput mode. 2017-04-11 14:13:08 -07:00
0cebc2172c Fix WolfSSL_DES_ecb_encrypt(). 2017-04-12 00:03:35 +09:00
d399b51ba8 Fix WolfSSL_DES_ecb_encrypt(). 2017-04-11 23:49:10 +09:00
de017b0028 Added stubs required to compile HAPROXY 2017-04-11 16:03:08 +02:00
8f300515bd Grouped HAPROXY compatibility into WOLFSSL_HAPROXY flag
now haproxy compatible wolfssl builds with:

./configure --prefix=/usr --sysconfdir=/etc --disable-fastmath \
iam * ] 2:18 PM
    --disable-fasthugemath --disable-bump \
    --enable-opensslextra \
    --enable-keygen --enable-certgen \
    --disable-ntru --disable-examples \
    --enable-tlsx --enable-haproxy \
    --enable-savecert --enable-savesession --enable-sessioncerts \
    --enable-webserver --enable-sslv3 --enable-stunnel
2017-04-11 14:18:41 +02:00
213afe18c3 Merge pull request #842 from JacobBarthelmeh/Testing
fix c32toa needed with --enable-session-ticket
2017-04-10 19:10:35 -07:00
eb1a191fd2 Refactor to add the wc_HmacInit and wc_HmacFree calls. 2017-04-10 14:47:08 -07:00
e419a6f899 Fixes and cleanups based on feedback from Sean. 2017-04-10 14:47:07 -07:00
62e7dc87c3 Fix merge error with verify callback and totalCerts. 2017-04-10 14:45:05 -07:00
56a1618ba0 Fixes to a few things based on peer review. 2017-04-10 14:45:05 -07:00
c1640e8a3d Intel QuickAssist (QAT) support and async enhancements/fixes:
* Adds ./configure "--with-intelqa=../QAT1.6”, port files, memory management and README.md (see wolfcrypt/src/port/intel/).
* Added Intel QAT support for RSA public/private (CRT/non-CRT), AES CBC/GCM, ECDH/ECDSA, DH, DES3, SHA, SHA224, SHA256, SHA384, SHA512, MD5 and HMAC.
* wolfSSL async enabled all client and server: PKI, Encrypt/Decrypt, Hashing/HMAC and Certificate Sign/Verify.
* wolfSSL async support in functions: Encrypt, Decrypt, VerifyMAC, BuildMessage, ConfirmSignature, DoCertificate, ParseCertRelative, and MakeSignature.
* wolfCrypt test and benchmark async support added for all HW acceleration.
* wolfCrypt benchmark multi-threading support.
* Added QuickAssist memory overrides for XMALLOC, XFREE and XREALLOC. XREALLOC determines if existing pointer needs reallocated for NUMA.
* Refactor to make sure “heap” is available for async dev init.
* Added async support for all examples for connect, accept, read and write.
* Added new WC_BIGINT (in wolfmath.c) for async hardware support.
* Added async simulator tests for DES3 CBC, AES CBC/GCM.
* Added QAT standalone build for unit testing.
* Added int return code to SHA and MD5 functions.
* Refactor of the async stack variable handling, so async operations have generic args buffer area and cleanup function pointer.
* Combined duplicate code for async push/pop handling.
* Refactor internal.c to add AllocKey / FreeKey.
* Refactor of hash init/free in TLS to use InitHashes and FreeHashes.
* Refactor of the async event->context to use WOLF_EVENT_TYPE_ASYNC_WOLFSSL for WOLFSSL* and WOLF_EVENT_TYPE_ASYNC_WOLFCRYPT for WC_ASYNC_DEV*.
* Suppress error message for WC_PENDING_E.
* Implemented "wolfSSL_EVP_MD_CTX_init" to do memset.
* Cleanup of the openssl compat CTX sizes when async is enabled.
* Cleanup of AES, DES3, DH, SHA, MD5, DES3, DH, HMAC, MD5 for consistency and readability.
* Cleanup of the OPAQUE_LEN.
* Cleanup to use ENCRYPT_LEN instead of sizeof(ssl->arrays.preMasterSecret).
* Changed ssl->arrays.preMasterSecret to use XMALLOC (accelerates HW operations)
* Reduce verbosity with debug enabled for "GetMyVersion", "wolfSSL Using RSA OAEP padding" and "wolfSSL Using RSA PKCSV15 padding".
* Updated RSA un-padding error message so its different than one above it for better debugging.
* Added QAT async enables for each algorithm.
* Refactor of the async init to use _ex.
* Added WC_ASYNC_THRESH_NONE to allow bypass of the async thresholds for testing.
* Reformatted the benchmark results:
PKI: "RSA 2048 private HW 18522 ops took 1.003 sec, avg 0.054 ms, 18467.763 ops/sec"
Crypto/Hashing: SHA-256 SW 350 megs took 1.009 seconds, 346.946 MB/s Cycles per byte = 9.87
* Added min execution time for all benchmarks.
* Moved wc_*GetHash and wc_*RestorePos to appropriate files so use of isCopy flag is local.
* Fix for ECC sign status sometimes being invalid due to uninitialized ECC digest in benchmark.
* Added new DECLARE_VAR/FREE_VAR and DECLARE_ARRAY/FREE_ARRAY macros for helping setup test/benchmark variables to accelerate async.
* Added NO_SW_BENCH option to only run HW bench.
* Added support for PRNG to use hardware SHA256 if _wc devId provided.
* Fix to prevent curve tests from running against wrong curve sizes. Changed wc_ecc_set_curve to match on exact size.
* Added the wc_*GetHash calls to the wolfCrypt tests.
* Added async hardware start/stop to wolfSSL init/cleanup.
* Refactor to add wc_*Copy for hashing context (for async), which replaces wc_*RestorePos.
* Fixes for building with TI hashing (including: SHA224, missing new API’s and building with dummy build for non hw testing). Note: We need to add build test for this `./configure CFLAGS="-DWOLFSSL_TI_HASH -DTI_DUMMY_BUILD”`.
* Added arg checks on wc_*GetHash and wc_*Copy.
* Cleanup of the BuildMD5, BuildSHA, BuildMD5_CertVerify and BuildSHA_CertVerify functions.
* Added new ./configure --enable-asyncthreads, to allow enable/disable of the async threading support. If --enable-asynccrypt set this will be enabled by default if pthread is supported. Allows multi-threaded benchmarks with async simulator.
* Added checks for all hashing to verify valid ->buffLen.
* Fix for SHA512 scan-build warning about un-initialized “W_X”.
* Fix for valgrind un-initialized use of buffer in AllocDer (der->buffer) and BuildTlsFinished handshake_hash.
* Refactor of the benchmarking to use common function for start, check and finish of the stats.
* Fixed issue with ECC cache loading in multi-threading.
* Fix bug with AESNI not aligned code that assumes XMALLOC is 16-byte aligned.
* Added new WC_ASYNC_NO_… options to allow disabling of individual async algorithms. New defines are: WC_ASYNC_NO_CRYPT, WC_ASYNC_NO_PKI and WC_ASYNC_NO_HASH. Additionally each algorithm has a WC_ASYNC_NO_[ALGO] define.
* Added “wolfSSL_GetAllocators” API and fixed the wolfCrypt memcb_test so it restores callback pointers after test is complete (fixes issue with using custom allocators and test breaking it).
2017-04-10 14:45:05 -07:00
dc65a9a277 Distro fix to enable SHA224 by default. Was causing Debian build error since SHA224 is enabled by default only for the x86_64 architecture. Updated --enable-distro option to include new features for aeskeywrap, x963kdf and scrypt. Changed the ECC custom curve option to enable all curve types when used with distro. 2017-04-10 11:45:26 -07:00
dccff615d5 Add wolfSSL_DES_ecb_encrypt() encrypt/decrypt parameter check. 2017-04-10 16:19:44 +09:00
97c22c88d8 Add test result message for test_wolfSSL_DES_ecb_encrypt(). 2017-04-10 15:37:47 +09:00
27c6625bfe Fix #ifdef in WolfSSL_DES_ecb_encrypt and test_WolfSSL_DES_ecb_encrypt. 2017-04-10 14:44:48 +09:00
5edcf685ca Rename caCertFile 2017-04-10 10:38:16 +10:00
335b6d41c1 32-bit size_t and printf fix 2017-04-10 10:26:36 +10:00
cbe46f8d74 Include new file in dist 2017-04-10 08:30:44 +10:00
b19cf2cfb8 Add test_wolfSSL_DES_ecb_encrypt() 2017-04-08 17:03:58 +09:00
e8971c361a Merge pull request #830 from kaleb-himes/suite-typo
Fixes for using default ciphers
2017-04-07 17:20:54 -07:00
8953ed9f30 DTLS update per RFC 6347 Section 4.2.3 2017-04-07 14:26:33 -06:00
3478c9b937 Added return checks to src/keys.c. 2017-04-07 14:15:53 -06:00
80d88b9421 fix c32toa needed with --enable-session-ticket 2017-04-07 11:46:27 -06:00
4ff2903b55 Fix to allow anonymous ciphers to work with the new default suite testing. 2017-04-07 10:20:41 -07:00
eb40175cc6 Fix to calc BuildSHA_CertVerify if WOLFSSL_ALLOW_TLS_SHA1. Fix to add check for DTLS to not allow stream ciphers. Removed the RC4 tests from the test-dtls.conf. Added support for using default suites on client side. Switched the arg to “-H”. Cleanup of the example server/client args list. Fixes for build with “--disable-sha”. 2017-04-07 10:20:41 -07:00
6a1ae7ee5b Fix on server side to make sure SHA hash is setup even with NO_OLD_TLS. Fix to initialize hsHashes to zero. Fix in PickHashSigAlgo to not default to SHA if NO_OLD_TLS is defined (unless WOLFSSL_ALLOW_TLS_SHA1 is set). Fix to allow pre TLS 1.2 for “AES128-SHA256” and “AES256-SHA256”. 2017-04-07 10:20:18 -07:00
b14da2622e Fix InitSuites to allow old TLS for DHE_RSA with AES 128/256 for SHA256. Reverted changes to test.conf and test-dtls.conf. 2017-04-07 10:20:18 -07:00
4dcad96f97 Added test for server to use the default cipher suite list using new “-U” option. This allows the InitSuites logic to be used for determining cipher suites instead of always overriding using the “-l” option. Now both versions are used, so tests are done with wolfSSL_CTX_set_cipher_list and InitSuites. Removed a few cipher suite tests from test.conf that are not valid with old TLS. These were not picked up as failures before because wolfSSL_CTX_set_cipher_list matched on name only, allowing older versions to use the suite. 2017-04-07 10:20:18 -07:00
b827380baf Typo in cipher suite pre-processor macro 2017-04-07 10:19:24 -07:00
4e703b6805 Merge pull request #839 from JacobBarthelmeh/Testing
build with session tickets and without client
2017-04-07 09:39:47 -07:00
2b443a79f2 Merge pull request #836 from dgarske/stack_check_free
Fix leak in StackSizeCheck and build error with debug enabled
2017-04-07 09:35:01 -07:00
ecaaf19ebf Merge pull request #835 from dgarske/fix_name_conflict
Fix name conflicts in wolfCrypt test with --enable-stacksize
2017-04-07 09:33:00 -07:00
c466e3c078 Implements wolfSSL_DES_ecb_encrypt function. 2017-04-07 11:21:32 +09:00
2c13ea9a67 Cleanup name conflicts with test.h cert files (by adding “File” to end). Fix memory leak in ecc_test_buffers function. 2017-04-06 15:54:59 -07:00
b49a2561bc build with session tickets and without client 2017-04-06 16:19:21 -06:00
6e16410e25 Modifications per Todd's requests. 2017-04-06 15:47:53 -06:00
d62d0aaa26 Changes made per Todd's instruction. 2017-04-06 14:42:42 -06:00
9ef26679df Merge pull request #833 from SparkiDev/asn_func
ASN Code Rework
2017-04-06 12:47:40 -07:00
bb8e67b79c Merge pull request #837 from cconlon/release-3.10.4
3.10.4 release
2017-04-06 11:39:31 -06:00
706c02deed Changes Chris requested. 2017-04-06 10:53:14 -06:00
c8400e9ff1 Merge pull request #824 from dgarske/fix_asn_confirm_sig
Fix for return code checking on ConfirmSignature
2017-04-05 16:58:47 -07:00
b11bb5325a Implementation of 51-bit curve25519 2017-04-06 09:48:01 +10:00
c9bb75c0f3 3.10.4 release 2017-04-05 16:37:35 -06:00
d648d4f6c7 Fix leak in StackSizeCheck. Fix build error with debug enabled and stack size check. 2017-04-05 14:24:55 -07:00
338c70a1ab Merge pull request #834 from cconlon/ecc_name_from_params
add wc_ecc_get_curve_id_from_params()
2017-04-05 14:09:41 -07:00
3328b4d38b Cleanup the unit test naming for new signature failure tests. 2017-04-05 11:24:22 -07:00
0c61a5b1fd add invalid test case for wc_ecc_get_curve_id_from_params() 2017-04-05 11:18:47 -06:00
4eefa22629 Merge pull request #810 from toddouska/write-dup
add wolfSSL_write_dup(), creates write_only WOLFSSL to allow concurre…
2017-04-05 10:06:20 -06:00
15091675fe Fix VS warning about long to size_t conversion in load_buffer. 2017-04-05 07:23:53 -07:00
e101dfa26e add wc_ecc_get_curve_id_from_params() 2017-04-04 14:49:46 -06:00
deb80e5ddb Fix load_file/load_buffer enables. Fix error in load_buffer with “ret”. 2017-04-04 11:45:55 -07:00
e0a4758c0f Fixes with load_file helper to make sure return code is set correctly and args are initialized. 2017-04-04 11:40:54 -07:00
2aa523e0ea Added API unit test for certificate validation failure using corrupted signature in cert. 2017-04-04 11:15:32 -07:00
26f3924c93 Fix for return code checking on ConfirmSignature, so it returns actual error codes or 0 on success. 2017-04-04 10:55:22 -07:00
e740756706 Merge pull request #832 from toddouska/rdrand64
allow rdrand to use full 64bit output
2017-04-04 08:58:06 -07:00
36e81b650e Fix missing symbol for specific configs 2017-04-04 14:33:14 +10:00
683a655908 Starting 128-bit FE implementation 2017-04-04 14:17:54 +10:00
b02a75510e Fix Windows warnings 2017-04-04 11:19:06 +10:00
abaf820537 Improvements and comments 2017-04-04 10:42:04 +10:00
cd358bd2ab protect against multiple write dups 2017-04-03 15:58:33 -07:00
2d323dee42 Merge pull request #829 from cconlon/ecc_import
fix curve selection on ecc private only import
2017-04-03 15:44:42 -07:00
59dc839341 Merge pull request #819 from dgarske/test_static_fixes
Fixes for wolfCrypt test/benchmark with static memory
2017-04-03 15:25:45 -07:00
1d48fba032 allow rdrand to use full 64bit output 2017-04-03 15:08:35 -07:00
68076dee45 Merge pull request #805 from dgarske/rng_cleanup
Fix RNG issue with Intel RD and cleanup to remove old ARC4 support
2017-04-03 14:57:09 -07:00
29eabe5535 Better stack size check return code handling. 2017-04-03 09:41:12 -07:00
8cde26a6c5 fix curve selection on ecc private only import 2017-04-03 09:50:46 -06:00
e168d4db09 Merge pull request #821 from SparkiDev/wpas_fips
FIPS changes and fixups for wpa_supplicant
2017-04-03 08:27:25 -07:00
fd9e41dd99 ASN functions added to simplify code
Functions to get and set different ASN.1 tags have been added.
The functions are used in the asn.c file to simplify the code and ensure
all checks are done.
2017-04-03 16:56:21 +10:00
d626c917dd Merge branch 'master' of https://github.com/wolfSSL/wolfssl into unitTest_api_dev 2017-03-31 14:18:27 -06:00
d69c860ab8 Fix bad #elif logic cleanup for using “USE_TEST_GENSEED”. 2017-03-31 13:16:21 -07:00
c532819659 Fixes for building with “CUSTOM_RAND_GENERATE_BLOCK”. Removed seed as backup RNG source. Fixed building on embedded system with time_t not defined (test.c should use long for asn_test). 2017-03-31 13:16:21 -07:00
69535198ca Fix RNG to only allow disabling HASHDRBG if CUSTOM_RAND_GENERATE_BLOCK is defined. Added support for CUSTOM_RAND_GENERATE_BLOCK with Intel RDRAND. 2017-03-31 13:16:21 -07:00
1251607b04 Retain existing HAVE_HASHDRBG functionality and only disable if ./configure --disable-hashdrbg or WC_NO_HASHDRBG defined. Fix use of warning with VS. Fix to only use rng seed as source if no DRBG. 2017-03-31 13:16:21 -07:00
5e3d8e705e Fix RNG issue with Intel RDRAND and RDSEED accelerations not being used because HAVE_HASHDRBG was always being defined if !WOLFSSL_FORCE_RC4_DRBG. Added new --enable-intelrand option to indicate use of RDRAND preference for RNG source (if RDRAND not supported by CPU then HASHDRBG will be used). The --enable-intelasm option enables the RDSEED support for seeding HASHDRBG if CPU supports it. Allow use of seed as RNG source if --disable-hashdbrg (shows build warning). Cleanup to remove old ARC4 RNG support. Fixed random_test return code with !HAVE_HASHDRBG. Cleanup of ./configure --help alignment. 2017-03-31 13:16:21 -07:00
34a4f1fae0 Move wolfCrypt test/benchmark to move static memory pool to global (not in stack). Fix wolfCrypt test wc_InitRng to use _ex with HEAP_HINT (when not FIPS). Added ability to use HAVE_STACK_SIZE with wolfCrypt test and benchmark. Cleanup of the benchmark_test function main wrapper. 2017-03-31 13:11:23 -07:00
ccad9f5575 Merge pull request #818 from dgarske/tkernel_port
TKernel port
2017-03-31 10:10:26 -07:00
9455c3b469 Merge pull request #826 from cconlon/ecc_adds
add XSTRLEN cast in ecc helper
2017-03-31 10:08:05 -07:00
6a4b71de05 Merge pull request #822 from JacobBarthelmeh/Testing
testing buffer size with const DH and remove redeclaration of WOLFSSL…
2017-03-31 08:53:49 -07:00
e1f6dbe74e add XSTRLEN cast in ecc helper 2017-03-31 09:17:42 -06:00
cc4cc41ccf Merge pull request #825 from cconlon/ecc_der
add EccPrivateKeyToDer()
2017-03-30 20:07:26 -07:00
5d840751c0 Merge pull request #823 from cconlon/ecc_adds
add ECC helpers to get size and id from curve name
2017-03-30 17:28:29 -07:00
4e829bc0a5 Fix to assign default OID for TLS supported curves based on loaded extension order. 2017-03-30 13:54:24 -07:00
507f052b3f ECC helper cleanup 2017-03-30 14:34:12 -06:00
6735dd7031 add EccPrivateKeyToDer() 2017-03-30 13:56:48 -06:00
347f4e3e4d Merge pull request #820 from JacobBarthelmeh/PKCS8
PKCS8 create function
2017-03-30 13:54:30 -06:00
61d82790e4 add ECC helpers to get size and id from curve name 2017-03-30 11:32:56 -06:00
5c2b5f86b9 testing buffer size with const DH and remove redeclaration of WOLFSSL_CRL 2017-03-30 10:53:13 -06:00
71b75efd63 move PKCS8 create function and remove PWDBASED requirement 2017-03-30 10:46:58 -06:00
c74c2ce00c FIPS changes and fixups
Enable ex data explicitly.
Keep the peer cert for verification callback.
External session cache for hostapd.
Enable DES_ECB when not FIPS.
Don't send the peer cert if it is not received from peer.
Initialize the peer cert after free as will be freed on tear down of
SSL.
Allow a server to become a client.
2017-03-30 11:53:35 +10:00
9ebfb0e953 make the function wc_CreatePKCS8Key public 2017-03-29 16:42:51 -06:00
5663fbf41a adjust placement of ECC curve OID in PKCS8 and add parameter notes 2017-03-29 16:17:54 -06:00
219fb584e2 fix for lenght of PKCS8 with ECC and for ECC get key algo ID 2017-03-29 16:17:26 -06:00
72d11e19cd add create PKCS8 key 2017-03-29 16:14:34 -06:00
36d9504bc3 Added NO_WRITE_TEMP_FILES option to prevent writing temp files during wolfCrypt test. 2017-03-28 19:37:55 -07:00
75abeaecfc Updates for TKernel port (WOLFSSL_uTKERNEL2). Added support for InterNiche prconnect_pro using WOLFSSL_PRCONNECT_PRO. Cleanup the min/max functions. Add NO_STDIO_FGETS_REMAP to not include the fgets remap for WOLFSSL_uTKERNEL2. Fix TFM build warning. Added HAVE_POCO_LIB. Added wolfCrypt test temp cert path for WOLFSSL_uTKERNEL2 = /uda/. Added WOLFSSL_CURRTIME_REMAP for benchmark to allow different function name to be used for system which have a conflicting name. Add ability to use normal malloc/free with WOLFSSL_uTKERNEL2 using NO_TKERNEL_MEM_POOL. Added new XMALLOC_OVERRIDE to allow custom XMALLOC/XFREE/XREALLOC macros. Move CUSTOM_RAND_GENERATE up in RNG choices. Rename tls.c STK macros due to conflict. 2017-03-28 19:10:19 -07:00
25779dfb4f Introduce HAPROXY config flag + get/set app_data 2017-03-28 13:28:36 +02:00
d94fcd8b69 Implemented wolfSSL_EVP_PKEY_base_id, wolfSSL_BIO_read_filename. Added wolfSSL_EVP_PKEY_type stub 2017-03-28 11:42:30 +02:00
14efd9735d Merge pull request #816 from kaleb-himes/eccCaKeyFile-undefined
Fix for: 'Fix for build error with unused eccCaKeyFile'
2017-03-27 21:18:46 -07:00
2bcb8e53fc Address case from review 2017-03-27 16:53:13 -06:00
5cffae2e3f Merge branch 'master' of https://github.com/wolfSSL/wolfssl into eccCaKeyFile-undefined 2017-03-27 16:52:51 -06:00
10bf955b70 Merge pull request #817 from kaleb-himes/ocsp-cert-update
add 'Class 3 Public Primary Certification Authority' to ocspstapling …
2017-03-27 15:21:55 -07:00
9c8574111e Merge pull request #815 from toddouska/switchcerts
better handling of TLS layer switching out CTX layer keys/certs
2017-03-27 15:57:58 -06:00
bddf0c52a6 add 'Class 3 Public Primary Certification Authority' to ocspstapling test certificate 2017-03-27 14:13:22 -06:00
00ca1dcbb7 Fix for: 'Fix for build error with unused eccCaKeyFile' 2017-03-24 14:01:06 -06:00
a7c131c0a1 fix vs warning 2017-03-24 11:19:01 -07:00
86efbbbb1d simplify reset suites on cert/key changes to end of function 2017-03-24 10:40:42 -07:00
4783fbfc4f better handling of TLS layer switching out CTX layer keys/certs 2017-03-24 10:19:01 -07:00
d8261796a6 Merge pull request #813 from cconlon/addcert
add server-keyPkcs8.der to include.am
2017-03-22 14:58:22 -07:00
a216da38d2 Merge pull request #798 from toddouska/trackmem
add deallocs to memory tracker
2017-03-22 13:59:29 -06:00
0983536c98 Merge pull request #814 from dgarske/fix_crl_redef
Fix build warning with redefinition of typedef 'WOLFSSL_CRL’
2017-03-22 08:59:02 -07:00
5f7e77f131 Merge branch 'master' of https://github.com/jrblixt/wolfssl into unitTest_api_dev 2017-03-21 16:48:55 -06:00
4e6f70e15e Merge pull request #784 from JacobBarthelmeh/Cert-Report2
error out with duplicate policy OID in a certificate policies extension
2017-03-21 15:21:46 -07:00
a6ecf793ba Merge pull request #806 from dgarske/tfm_heap_reduce
Reduce heap usage with fast math when not using ALT_ECC_SIZE
2017-03-21 15:21:09 -07:00
360fb2db0a Merge pull request #808 from kojo1/TrialProj
eccCaKeyFile in RSA/ECC test
2017-03-21 15:21:00 -07:00
3e2fe536ad Merge pull request #809 from JacobBarthelmeh/Testing
test case when not using RSA blinding
2017-03-21 15:18:53 -07:00
30024b7e7f Merge pull request #812 from SparkiDev/valgrind_ecc
Fix leak in test
2017-03-21 15:18:09 -07:00
88679a6a0c Merge wolfSSL master. 2017-03-21 15:33:40 -06:00
739436d7a8 Merge with wolfSSL master. 2017-03-21 15:23:47 -06:00
d829e5ba5a Fix build warning with redefinition of typedef 'WOLFSSL_CRL’. 2017-03-21 09:13:50 -07:00
c46eb36b4e add server-keyPkcs8.der to include.am 2017-03-21 09:53:24 -06:00
7be1077216 Fix for build error with unused “eccCaKeyFile”. 2017-03-21 08:31:07 -07:00
8bf22b253a Fix leak in test
Use new points for compressed point testing.
2017-03-21 23:34:48 +10:00
15423428ed add wolfSSL_write_dup(), creates write_only WOLFSSL to allow concurrent access 2017-03-20 15:08:34 -07:00
f26d584cec test case when not using RSA blinding 2017-03-20 14:15:34 -06:00
4cb891334d Merge pull request #801 from toddouska/fipscheck
add keep option to fips-check.sh to keep FIPS temp folder around
2017-03-20 13:44:01 -06:00
15e442637d Fix “#error old TLS requires MD5 and SHA” to only occur if !WOLFCRYPT_ONLY. 2017-03-20 10:42:08 -07:00
e35489fd75 eccCaKeyFile in RSA/ECC test 2017-03-20 13:46:26 +09:00
52215b3ecf Merge pull request #734 from kaleb-himes/csharp-addition
Adds wrapper for CTX_load_verify_locations to C# wrapper
2017-03-17 18:18:17 -06:00
10bf3c4d1d Merge pull request #804 from SparkiDev/wpas_shared
Wpas shared
2017-03-17 16:15:51 -07:00
6cc42dcacb Reduce TFM fp_int size by only adding the “int size” if ALT_ECC_SIZE or WOLFSSL_ASYNC_CRYPT is defined. Fix couple of async build errors in wolfCrypt test. 2017-03-17 15:01:18 -07:00
3bb1723476 Merge pull request #768 from dgarske/crl_lookup
Added support for inline CRL lookup when HAVE_CRL_IO is defined
2017-03-17 12:18:45 -07:00
b9d3db8b47 Merge pull request #800 from SparkiDev/no_fs
If there is no filesystem then still compile and run
2017-03-17 12:08:49 -07:00
ad57738cc6 Merge pull request #795 from JacobBarthelmeh/Testing
bounds checking with adding string terminating character
2017-03-17 12:07:55 -07:00
db526999c3 Merge pull request #803 from dgarske/fix_int_cast_warn
Fix warning with "implicit conversion loses integer precision”.
2017-03-17 12:05:29 -07:00
c69dea624c Merge pull request #802 from cconlon/rsa_decode
add wc_GetPkcs8TraditionalOffset()
2017-03-17 12:04:44 -07:00
461f051ef1 Only expose ECC APIs on config define 2017-03-17 10:52:38 +10:00
37a52414cc Make MP and ECC APIs public
These APIs are needed by wpa_supplicant.
2017-03-17 10:23:37 +10:00
141210dcc0 Fix warning with "implicit conversion loses integer precision”. 2017-03-16 14:56:03 -07:00
3f33f2b995 add duplicate policy OID cert to dist 2017-03-16 15:49:40 -06:00
92587651c9 variable i is not used when WOLFSSL_SEP is enabled 2017-03-16 15:48:15 -06:00
faf2bacd56 error out with duplicate policy OID in a certificate policies extension 2017-03-16 15:48:15 -06:00
efc2bb43d2 add wc_GetPkcs8TraditionalOffset() 2017-03-16 15:14:20 -06:00
ce6e3ce8d0 Merge pull request #799 from cconlon/ecc_decode
remove EccPublicKeyDecode() from WOLFSSL_CERT_EXT guard
2017-03-16 12:47:19 -07:00
c62b4e8ed5 Merge pull request #797 from cconlon/ecc_private
allow ECC private key only import
2017-03-16 12:45:49 -07:00
7651afbd38 Merge pull request #794 from dgarske/fix_rsa_e_overflow_w32bit
Fix issue with TFM mp_set_int, which should handle unsigned long.
2017-03-16 11:49:07 -07:00
2b1b7632fc add keep option to fips-check.sh to keep FIPS temp folder around 2017-03-16 11:10:12 -07:00
d22dcdb78d If there is no filesystem then still compile and run
Defaults to 2048-bit FF and 256-bit EC keys.
2017-03-16 16:00:31 +10:00
94d56fda59 Merge pull request #796 from toddouska/noasntime
fix NO_ASN_TIME build with --enable-wpas
2017-03-16 14:46:10 +10:00
a7f8bdb387 remove EccPublicKeyDecode() from WOLFSSL_CERT_EXT guard 2017-03-15 17:28:52 -06:00
5839bd0177 add deallocs to memory tracker 2017-03-15 15:36:12 -07:00
a13cce9213 allow ECC private key only import 2017-03-15 16:04:17 -06:00
36ecbfb1a8 fix NO_ASN_TIME build with --enable-wpas 2017-03-15 14:57:38 -07:00
0ef1b5d298 bounds checking with adding string terminating character 2017-03-15 13:40:41 -06:00
2c890e6827 Fix mp_set_int to use calc for 32 const. Changed it to sizeof(b) instead of sizeof(long). 2017-03-15 12:34:55 -07:00
4eb76e1d71 Fixes for building with IPV6. Added new WOLFSSL_IPV6 define to indicate IPV6 support. Fix to not include connect() and socket() calls unless HAVE_HTTP_CLIENT, HAVE_OCSP or HAVE_CRL_IO defined. Typo fixes. 2017-03-15 12:27:02 -07:00
cf73a2244f Fix for stray brace in wolfIO_TcpConnect. Fix to typedef sockaddr_in6 only when TEST_IPV6 is defined. Moved XSOCKLENT into io.h. Added useful WOLFSSL_NO_SOCK, which can be used with WOLFSSL_USER_IO. 2017-03-15 12:26:40 -07:00
d3a07858c0 Fixes based on peer review feedback. Fix to only include the non-blocking / select timeout functions when HAVE_IO_TIMEOUT is defined. Fix to only include TCP connect if HAVE_GETADDRINFO or HAVE_SOCKADDR defined. Cleanup of the “struct sockaddr*” to use typedef with HAVE_SOCKADDR. Moved helpful XINET_* and XHTONS/XNTOHS macros to io.h. 2017-03-15 12:26:18 -07:00
628f740363 Added support for inline CRL lookup when HAVE_CRL_IO is defined (shares code with OCSP lookup in io.c). Added http chunk transfer encoding support. Added default connection timeout value (DEFAULT_TIMEOUT_SEC) and new wolfIO_SetTimeout() API with HAVE_IO_TIMEOUT. Added generic wolfIO_ API’s for connect, select, non-blocking, read and write. Added new define USE_WOLFSSL_IO to enable access to new wolfIO_* socket wrappers even when WOLFSSL_USER_IO is defined. Moved all API declarations for io.c into new io.h header. Added HAVE_HTTP_CLIENT to expose HTTP API’s. Moved SOCKET_T and SOCKET_ defines into io.h. Added WOLFIO_DEBUG define to display request/responses. 2017-03-15 12:26:18 -07:00
5a24fd9237 Fix TFM mp_set_int to handle long. Enhance mp_set_int to use mp_set if less than max mp_digit. Added new MP_SET_CHUNK_BITS to eliminate hard coded const’s and allow build time adjustment. 2017-03-15 12:23:50 -07:00
4725a8aea6 Merge pull request #775 from SparkiDev/wpas
Changes for WPA Supplicant
2017-03-15 11:19:46 -06:00
f38d23a315 Merge pull request #791 from dgarske/fix_ecc_test_curve_idx
Fix wc_ecc_export_point_der to use curve_id
2017-03-14 19:22:53 -07:00
916a5c97ce Merge pull request #793 from SparkiDev/scan_build
Fixes for scan-build
2017-03-14 19:19:09 -07:00
003e18ecbc Fixes for scan-build 2017-03-15 09:38:53 +10:00
97b98c5c44 Changes from review
Add a free handshake resources API.
Rename to wolfSSL_KeepHandshakeResources().
Add APIs to indicate the client's preference order is to be used when
matching cipher suites.
2017-03-15 09:09:25 +10:00
ac713e62c5 Code review fixes
Put back check for server end when setting DH.
Add option to keep resources rather than free after handshake.
2017-03-15 09:09:25 +10:00
122f648fd8 Only support client preference order as default for WPAS. 2017-03-15 09:09:02 +10:00
7897d04145 Need GetHMACSize and GetIVSize for wpas 2.0 2017-03-15 09:09:02 +10:00
fd3093f937 Protect code with #ifdefs 2017-03-15 09:09:02 +10:00
e2930b0a43 Changes for WPA Supplicant 2017-03-15 09:09:02 +10:00
7bef7aaa81 Merge pull request #792 from SparkiDev/valgrind
Fix valgrind issues
2017-03-14 13:50:26 -07:00
4210ce0f67 Merge pull request #789 from SparkiDev/jenkins
Fixes for extended configuration testing
2017-03-14 10:00:39 -07:00
cccaa8671e Merge pull request #778 from dgarske/intime_rtos
INtime RTOS port
2017-03-14 09:55:50 -07:00
2fbce65975 Revert change in types.h for INTIME_RTOS. HAVE_THREAD_LS is not supported here, so don’t define out. Added note in INtime RTOS user_settings.h to indicate this. 2017-03-13 20:03:09 -07:00
0eb01698f4 Fix for wolfCrypt ECC import/export point test to not use const idx and instead lookup using the “ecc_curve_id” enum value. Added new “wc_ecc_get_curve_idx” and “wc_ecc_get_curve_id” API’s. Redirected duplicate ECC function “wc_ecc_get_curve_name_from_id” to “wc_ecc_get_name”. Added “ECC_CURVE_INVALID” to indicate invalid curve_id. 2017-03-13 19:58:15 -07:00
72728b21af Undo as mp_digit is not allowed to get as large as tested 2017-03-14 10:23:13 +10:00
81731df72f Fix valgrind issues
Test program was re-using RSA and ECC key with multiple imports ops.
wc_RsaPublicKeyDecode() leaked if n parseable but not e.
2017-03-14 09:47:34 +10:00
8a562c817c Fix build issues with DEBUG_WOLFSSL defined. Fix typo in user_settings.h for DEBUG_WOLFSSL. Fix issue with example client waiting on local server (shouldn’t be). Updated README.md with example output. 2017-03-13 12:22:44 -07:00
e98a0465ae tenAsys INtime RTOS port. Porting complete for mutex semaphores, threading, file, socket and RNG. Added projects for libwolfssl and wolfExamples. The wolfExamples project includes examples for wolfCrypt Test/Benchmark and wolfSSL TLS client/server. Provided reference user_settings.h with comments and enable/disable gates. Added README.md with overview and instructions. Fixed issue building master with NO_WOLFSSL_DIR defined. Added check if old TLS is enabled that SHA and MD5 are enabled. Cleanup of the wolfCrypt test use of USE_CERT_BUFFERS with file system enabled. 2017-03-13 09:48:55 -07:00
610ac07cd8 Add MP_MASK 2017-03-13 16:28:36 +10:00
8ac2f5cb9c Windows warning about negating unsigned fix 2017-03-13 12:29:58 +10:00
d4f0c79272 Cast for Windows 2017-03-13 12:18:45 +10:00
614231f71c Fixes for extended configuration testing 2017-03-13 11:33:39 +10:00
9780f1faef Fix spacing and comma 2017-03-12 23:01:32 +09:00
a6cbfe6f93 Merge pull request #787 from SparkiDev/def_p256
Fix elliptic curve selection.
2017-03-11 08:35:11 -08:00
91737ceb3f Merge pull request #786 from JacobBarthelmeh/Testing
Testing
2017-03-10 17:03:24 -08:00
80fe2a3524 Fix elliptic curve selection.
Preference by:
1. the default for the curve strength (eccTempKeySz),
2. a curve at the curve strength (eccTempKeySz),
3. the default for next higher curve strength,
4. the first curve (client order) with the next highest curve strength
2017-03-11 10:17:15 +10:00
93f1e7cf2e remove magic number in test case 2017-03-10 13:16:22 -07:00
bb81ea804c add AES get key to ARMv8 port and add check for BASE 64 encode to tests 2017-03-10 09:55:27 -07:00
dee3159f0f update byte size conversion 2017-03-10 09:39:18 -07:00
e8d97c9b1e make test buffers large enough for results 2017-03-10 09:36:29 -07:00
5a803730b8 Merge pull request #785 from SparkiDev/fixes
Fixes from merge of test coverage changes
2017-03-09 17:58:15 -08:00
2b5dba798f Merge pull request #783 from JacobBarthelmeh/Cert-Report1
Add error case for critical Subject Key ID extension
2017-03-09 15:39:23 -08:00
5c9eedbf69 Fixes from merge of test coverage changes
Include new certificates in distribution.
Casting changes for clang.
Extra error code - recognize in test.
2017-03-10 09:15:18 +10:00
2444a55afe Merge pull request #708 from SparkiDev/test_cov
Extend testing for coverage
2017-03-09 12:52:17 -08:00
2bb14903f9 Merge pull request #698 from SparkiDev/nginx
Get Nginx working with wolfSSL
2017-03-09 10:23:20 -08:00
0e64c7708f Merge pull request #769 from JacobBarthelmeh/Testing
Testing
2017-03-09 10:17:48 -08:00
fd50fd8a3e Add error case for critical Subject Key ID extension 2017-03-08 16:40:07 -07:00
df32c6fb0b Merge pull request #782 from dgarske/ecc_mem
Fix to reduce ECC memory usage when async crypt is not enabled
2017-03-08 15:35:47 -08:00
2b0963c42a Merge pull request #780 from dgarske/crl_win
Fixes for building CRL with Windows
2017-03-08 15:31:02 -08:00
a55ebb4c18 Fixes for building CRL with Windows. Refactor load_verify_buffer and LoadCRL to use new wc_ReadDir* functions. Added new directory/file API's: wc_ReadDirFirst(), wc_ReadDirNext(), wc_ReadDirClose(). Moved MAX_PATH and MAX_FILENAME_SZ to wc_port.h. Moved BAD_PATH_ERROR into error-crypt.h. The wc_ReadDir is only supported when NO_WOLFSSL_DIR and NO_FILESYSTEM are not defined. Add map to __FUNCTION__ macro in Windows with debug enabled (to resolve build error with VS and __func__ missing). Fix cast warning on response from EncodeOcspRequestExtensions. Fix for cast to call to BuildCertificateStatus. 2017-03-08 11:21:11 -08:00
a0effa6329 call mp_clear to match call to mp_init 2017-03-08 11:26:16 -07:00
e115205d18 Fix to reduce ECC memory usage when async crypt is not enabled. Fix uses local for r and s instead of key->r and key->s. 2017-03-07 13:45:02 -08:00
e7445b8e49 Merge pull request #781 from dgarske/fix_sb_int_dp
Fix integer.c scan-build warning for possible use of NULL dp
2017-03-07 12:03:20 -08:00
be42a575da Fix additional integer.c report of possible use of NULL dp (after normal math performance improvement to defer dp pointer alloc commit bdbb98ed20 2017-03-06 13:19:52 -08:00
ebef5083ca Merge pull request #777 from toddouska/dhpub
add check dh public key to agree()
2017-03-06 10:16:57 -07:00
bb3bea3d4c Merge pull request #773 from toddouska/authtag
add defined for default AES AUTH_TAG_MIN_SZ
2017-03-06 09:53:01 -07:00
ae6fbb220f Pass the context to statusCb (needed in Nginx 1.10.3) 2017-03-06 10:58:25 +10:00
ba1a8d7681 Merge pull request #765 from dgarske/scanbuild_fixes
Fixes for scan-build warnings
2017-03-03 15:58:10 -08:00
0d3ef0b399 Merge pull request #776 from dgarske/fix_iis_signature_algorithms
Fix issue with IIS servers and NO_OLD_TLS
2017-03-03 12:51:22 -08:00
a348898e96 add AUTH_SZ size check to ti and armv8 ports 2017-03-03 11:42:24 -08:00
7bcd26e321 add check dh public key to agree() 2017-03-03 11:30:38 -08:00
6800ffe8fa Merge pull request #772 from toddouska/sr3-fix
fix signer memory takeover on malformed data
2017-03-03 10:21:01 -07:00
eef3ec4a87 Merge pull request #763 from NickolasLapp/master
Changes to bring wolfssl up to date with stunnel 5.40
2017-03-03 09:00:11 -08:00
ace417b087 Merge pull request #774 from ejohnstown/psk-staticmemory
Static Memory Handshake Fix
2017-03-03 09:38:19 -07:00
2b937e2f23 Merge pull request #771 from JacobBarthelmeh/master
account for static memory IO_POOL free when general memory was used
2017-03-03 08:31:55 -08:00
431f363520 Better fixes for suppressing scan-build warning with normal math enabled. 2017-03-03 07:35:26 -08:00
0182d99efb Updates for nginx 1.10.3
Don't return global error when: SOCKET_PEER_CLOSED_E or SOCKET_ERROR_E
Increase max ex_data items to 5
2017-03-03 16:38:29 +10:00
b5fe3ddbfa Fix to allow connection to IIS server which requires SHA1 hash algo to be present in signature_algos extension. Issue only exists when NO_OLD_TLS is defined. To enable SHA1 with TLS 1.2 define "WOLFSSL_ALLOW_TLS_SHA1”. 2017-03-02 18:18:05 -08:00
67a8626430 Fix for scan-build warning with “->dp == NULL”. Scenario can’t happen, but adding sanity check to suppress warning. 2017-03-02 15:56:31 -08:00
ec1d8c7090 Fixed where the client was using NULL instead of ssl->heap when allocating memory during SendClientKeyExchange(). Failing on an embedded static build. 2017-03-02 10:05:24 -08:00
d903059e05 Fixes to allow signature_algorithms extension to send SHA1 (if enabled) and NO_OLD_TLS is defined. This resolves an issue connected to ISS servers. 2017-03-01 19:07:13 -08:00
c1c7c90345 add defined for default AES AUTH_TAG_MIN_SZ 2017-03-01 11:17:24 -08:00
9ab28f9756 account for static memory IO_POOL free when general memory was used 2017-03-01 11:39:00 -07:00
2d612da9f4 fix signer memory takeover on malformed data 2017-03-01 10:25:54 -08:00
7ca19f9fff Protect other call to wc_EccPublicKeyDecode 2017-03-01 09:37:18 +10:00
292a17fff8 wc_EccPublicKeyDecode changes from review 2017-03-01 09:37:18 +10:00
455fb96faa Extend testing for coverage 2017-03-01 09:37:18 +10:00
0608cd0dd3 Merge pull request #770 from JacobBarthelmeh/master
adjust return value of hash update and address warning with NO_SHA
2017-02-28 14:56:43 -08:00
13e6217fd5 Changes from code review 2017-03-01 08:38:54 +10:00
d4abeb56db Fixes required after logging changes to master. 2017-03-01 08:38:54 +10:00
e6434f380b Get Nginx working with wolfSSL 2017-03-01 08:38:54 +10:00
d5d7a4ae7b Report failure but continue to run. 2017-02-28 14:44:11 -07:00
f77458992e resolve windows warnings and add sanity check with PKCS12 parse 2017-02-28 14:33:07 -07:00
0ed8024bcf adjust return value of hash update and address warning with NO_SHA 2017-02-28 13:40:03 -07:00
b86dfd582f Merge pull request #766 from JacobBarthelmeh/Testing
debug message fix
2017-02-27 12:09:43 -08:00
b2fc525a1d update MD5, SHA, SHA256, SHA384, SHA512 Update functions. 2017-02-24 15:58:47 -07:00
c467bbd776 Reasses return values on all Init, Update, Final functions. 2017-02-24 15:16:54 -07:00
26bd19bbd8 debug message fix 2017-02-23 17:15:44 -07:00
9db6a27921 Fixes for scan-build warnings. Fix possible memory leak in wolfSSL_DH_new on failure. Add null checks in integer.c for destination to make sure “dp” grows when NULL (even though never happens in real-use). Added suppression of wc_port.c warning “Value stored to 'ret' is never read”. 2017-02-23 14:47:36 -08:00
6ca16b06d2 MergeConflicts 2017-02-23 11:13:32 -07:00
6425a654be Merge pull request #761 from dgarske/stm32_fixes
Fix for AES-GCM with STM32 and CubeMX HAL
2017-02-22 14:31:36 -08:00
302db35b2f Merge pull request #752 from dgarske/fix_ecc_import_wstaticmem
Fix issue with wc_ecc_import_x963_ex() loosing heap pointer
2017-02-22 14:30:57 -08:00
bdbb98ed20 Merge pull request #735 from dgarske/norm_math_speedup
Normal math speed-up to not allocate on mp_int and defer until mp_grow
2017-02-22 14:29:51 -08:00
d52f44108c Merge pull request #762 from moisesguimaraes/fix-ocsp-request
Adds missing free(request) in CheckOcspRequest()
2017-02-22 14:19:51 -08:00
8bbcdf977d adds missing free(request) in CheckOcspRequest() 2017-02-22 10:43:07 -08:00
2ef4525d4d Changes to bring wolfssl up to date with stunnel 5.40 2017-02-22 11:15:59 -07:00
5a539751a2 Fixes for AES with STM32 and CubeMX. The key size was not being set and causing issues with AES GCM. 2017-02-21 15:12:40 -08:00
aeea24a5e3 Merge pull request #760 from toddouska/mcheck
fix small stack malloc checks
2017-02-21 14:33:44 -08:00
e01da5c44c Fix mp_set to return int after rebase. 2017-02-21 14:12:27 -08:00
b05cfec057 Fix build warning with missing “mp_to_unsigned_bin_at_pos” declaration. 2017-02-21 14:03:21 -08:00
4cbfec1c7d Implemented ksdk_port fixes to handle mp_ response codes. Added KSDK support for normal math. Regression testing against K82 hardware (MMCAU/LTC) and software with normal and fast math. 2017-02-21 14:03:21 -08:00
3008c888bf Fix mp_cmp_d logic to handle a->used == 0. Revert mp_copy and mp_set 0 size workarounds. 2017-02-21 14:03:21 -08:00
9c7407d18c Added return codes to wc_InitDhKey, wc_InitDsaKey and mp_set. Added missing return code checks on mp_copy in ecc.c. Fixed build with DSA and no ECC where mp_set function def would be missing. 2017-02-21 14:03:21 -08:00
d14be65315 Improve handling of mp_clear for RSA after speed-up. 2017-02-21 13:59:38 -08:00
bced81d234 Improve handling of mp_init / mp_clear for DH and DSA after speed-up. 2017-02-21 13:59:38 -08:00
da5825b94d Normal math speed-up to not allocate on mp_int and defer until mp_grow. Added memory tracker support to ./tests/unit.test. Fix memory leak with curve cache enabled, by adding to wolfSSL_Cleanup. 2017-02-21 13:59:38 -08:00
e9c806a639 Merge pull request #743 from JacobBarthelmeh/master
change pem_password_cb typedef for compatibility
2017-02-21 13:23:05 -08:00
ce94243a20 Merge pull request #746 from cconlon/pkcs7ukm
PKCS7: fix optional UserKeyingMaterial encoding
2017-02-21 13:22:31 -08:00
f4f5d2d569 Merge pull request #747 from dgarske/integer_min_max
Fix naming for integer.c min/max local variables
2017-02-21 13:21:52 -08:00
988f7fa983 Merge pull request #759 from dgarske/fix_smallstack_procuserhcain
Fix for ProcessUserChain with WOLFSSL_SMALL_STACK defined causing stack corruption
2017-02-21 13:20:43 -08:00
c01fb8f655 Merge pull request #758 from kaleb-himes/mp_set
Fix for building with ECC disabled and DSA enabled with mp_set API.
2017-02-21 12:59:53 -08:00
7125d16f3e Fix issue with wc_ecc_import_x963_ex() and wc_ecc_import_raw_private() loosing heap pointer. Fixes issue #750. 2017-02-21 12:19:48 -08:00
fc85b8189c fix small stack malloc checks 2017-02-21 11:18:09 -08:00
f0112c2f7d Fix for ProcessUserChain with WOLFSSL_SMALL_STACK defined causing stack corruption. 2017-02-21 10:38:44 -08:00
fddf3bc664 pre-processor-macro update for mp_set API 2017-02-20 16:31:19 -07:00
db1f205522 Merge pull request #756 from toddouska/release3-10-3
3.10.3 rel
2017-02-20 10:08:14 -07:00
ebb21fc284 update rpm spec 2017-02-17 15:02:04 -08:00
e3503b8f9b 3.10.3 rel 2017-02-17 14:49:18 -08:00
3837173f93 Merge pull request #754 from wolfSSL/ecc_cdh
Added ECC Cofactor DH (ECC-CDH) support
2017-02-17 14:26:09 -08:00
19ee115392 Merge pull request #755 from toddouska/kat-errors
add ECC_CDH KAT error code
2017-02-17 14:25:51 -08:00
b4802cd73d add ECC_CDH KAT error code 2017-02-17 12:26:35 -08:00
bdd3f2be41 Make sure ecc key is always memset to 0 2017-02-17 12:15:18 -08:00
3e6ef835b1 Free the ecc keys 2017-02-17 12:06:27 -08:00
09bae9da3e Fixup from review 2017-02-17 11:18:05 -08:00
24cd46f1f1 Fixes from code review 2017-02-17 11:05:29 -08:00
d625645338 Refactor to combine ECC-CDH with existing “wc_ecc_shared_secret()” and use flag to perform cofactor computation on private key. Added new API “wc_ecc_set_flags()” and flag “WC_ECC_FLAG_COFACTOR” to indicate key should use cofactor. Added NIST CAVS test vector for ECC CDH Primitive with P-256. 2017-02-16 16:30:30 -08:00
39607984f7 Added ECC Cofactor DH (ECC-CDH) support with new “wc_ecc_cdh()” and “wc_ecc_cdh_ex()” API’s. Enable using “HAVE_ECC_CDH” define. 2017-02-16 13:17:08 -08:00
7da446c25a Merge pull request #748 from JacobBarthelmeh/Release
Release
2017-02-12 21:55:31 -08:00
337c52b4cf prepare for release 3.10.2 2017-02-10 10:19:34 -07:00
6c55701725 c89 build with ECC compresed key 2017-02-10 10:09:45 -07:00
4f53761faf Fix naming for integer.c min/max local variables to resolve reported “error: declaration of 'min' shadows a global declaration”. 2017-02-09 15:52:25 -08:00
e307f3e89d free decoded cert with small stack build 2017-02-09 16:06:34 -07:00
0cbc640aad memory managment in crl.c with crl monitor 2017-02-09 15:39:55 -07:00
c022614e07 Merge pull request #742 from dgarske/fix_asn_getlen
Improved ASN error checking
2017-02-09 13:05:26 -08:00
93642cfcb9 PKCS7: fix optional UserKeyingMaterial encoding 2017-02-09 12:04:19 -07:00
8763a71420 Merge pull request #745 from JacobBarthelmeh/Windows
wolfCrypt cleanup in test.c moved and add wolfSSL init to testsuite w…
2017-02-09 10:19:51 -08:00
3a6e8bf0d0 Merge pull request #744 from JacobBarthelmeh/Testing
static analysis fixes for memory management and possible null dereference
2017-02-09 10:18:26 -08:00
321392998d Additional ASN checks for GetSequence and GetSet. Cleanup of the buffer space check error to use BUFFER_E. 2017-02-09 09:50:06 -08:00
6a6e61f1d8 wolfCrypt cleanup in test.c moved and add wolfSSL init to testsuite with single threaded 2017-02-08 18:52:16 -07:00
b6b3021def gcc-6 uninitialized warning with srp build 2017-02-08 16:49:58 -07:00
b0728645c9 static analysis fixes for memory management and possible null derefrence 2017-02-08 16:29:54 -07:00
ef38ab8fc5 Merge pull request #701 from JacobBarthelmeh/mutex
better compatibility with printing errors to a file
2017-02-08 11:12:17 -08:00
c02f35c128 change pem_password_cb typedef for compatibility 2017-02-08 11:48:50 -07:00
868e704b82 Merge pull request #732 from kaleb-himes/openrtos-3.9.2-checkout
fips checkout for OpenRTOS v9.0.0 w/ wolfCrypt v3.9.2 on Atmels ATSAM…
2017-02-07 21:19:43 -08:00
c074ab273f Merge pull request #740 from toddouska/ocsp
Fix OCSP signature leading zero, certdecode free on parse failure. Add WOLFSSL_NO_OCSP_OPTIONAL_CERTS to skip optional OCSP certs, responder issuer must still be trusted. Add user clock skew defines for date skew before checks (WOLFSSL_AFTER_DATE_CLOCK_SKEW=# and WOLFSSL_BEFORE_DATE_CLOCK_SKEW=#).
2017-02-07 18:46:31 -08:00
993a604124 remove extern variables and use error queue instead 2017-02-07 17:16:22 -07:00
6fc81652b7 Merge pull request #738 from JacobBarthelmeh/Testing
align compatibility layer sha256 and sha224 structs
2017-02-07 13:59:34 -08:00
8f1c2965af Fix build warning in asn.c with “potentially uninitialized local variable 'length' used”. 2017-02-07 13:34:27 -08:00
468df109b6 add WOLFSSL_NO_OCSP_OPTIONAL_CERTS to skip optional OCSP certs, responder issuer must still be trusted 2017-02-07 13:31:59 -08:00
19204ab1ac Fix comment. 2017-02-07 11:07:48 -08:00
a2984553d7 Fixes for build with user-crypto RSA (--enable-fast-rsa). 2017-02-07 11:03:17 -08:00
3a1921e107 Fixes to ASN GetLength changes. Additional GetLength checks in PKCS7 and PKCS12. 2017-02-07 10:59:34 -08:00
0286d157a7 First pass at cleanup of the GetLength function handling of 0 length value. Added some asn.c build option comments. 2017-02-06 20:05:04 -08:00
7ddeb1afd9 add user clock skew defines for date skew before checks 2017-02-06 16:30:48 -08:00
f938a75780 fix OCSP signature leading zero, certdecode free on parse failure 2017-02-06 14:10:38 -08:00
53bebb4785 add error code for wolfCrypt_Cleanup 2017-02-06 14:51:55 -07:00
1f7976a587 Merge pull request #739 from JacobBarthelmeh/Memory
reduction of mp_jacobi stack usage
2017-02-06 11:59:52 -08:00
daafb2c5ac changes docs to single page 2017-02-05 18:56:19 -03:00
e33d4c0172 adds full docs 2017-02-05 18:51:13 -03:00
00a74d0da4 adds initial doc files 2017-02-05 16:43:43 -03:00
0f91542cf4 add peek error node function to make use of debug mutex 2017-02-03 11:52:36 -07:00
e8110e773e reduction of mp_jacobi stack usage 2017-02-02 17:13:26 -07:00
b1522e0c59 pack Sha256 struct 2017-02-02 14:55:51 -07:00
e722459df3 align compatibility layer sha256 and sha224 structs 2017-02-02 11:57:29 -07:00
bf12e4ecca wolfcrypt Python: work around minor issue in Random.__del__
During interpreter shutdown, depending on the order in which things happen, a module can be unloaded before all instances of classes defined in that module are garbage collected.

In particular, this means that any global variables (including imported modules) become `None` by the time the instances `__del__` is called, resulting in
```
AttributeError: 'NoneType' object has no attribute 'wc_FreeRng'
```
being displayed while the process exits.  This can be avoided simply by catching and ignoring the `AttributeError` in this case, since the process is shutting down anyways.
2017-02-02 16:51:41 +01:00
895bf8dfbc Merge pull request #728 from embray/patch-1
Fixes a serious bug in Random.byte
2017-02-01 21:07:20 -03:00
16698db48f Merge pull request #733 from kaleb-himes/tirtos-updates
updates for TIRTOS build following release 3.10.0
2017-02-01 14:47:12 -08:00
fde6700d89 fix typo 2017-01-31 15:10:49 -07:00
d1f323ca58 Adds wrapper for CTX_load_verify_locations to C# wrapper 2017-01-31 14:45:33 -07:00
b11265dbf5 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into unitTest_api_dev 2017-01-31 14:34:58 -07:00
de9f05f3c5 Update sha256.c function punctuation. 2017-01-31 14:33:21 -07:00
af355f7472 updates for TIRTOS build following release 3.10.0 2017-01-31 13:15:45 -08:00
b2e4a50bf4 fips checkout for OpenRTOS v9.0.0 w/ wolfCrypt v3.9.2 on Atmels ATSAM4L CPU 2017-01-30 15:32:59 -07:00
29f52ec735 Merge pull request #730 from toddouska/ocsp
Better CheckOcspRequest error detection on retry
2017-01-30 12:59:58 -03:00
ea96fa95b3 add new OCSP response validated debug message and remove redundant ret set 2017-01-28 11:11:25 -08:00
a094a36fa8 Update random.py
Realized that `ffi.string()` could truncate the output on null bytes.
2017-01-28 15:55:42 +01:00
a10d464126 fix scan-build warning and simplify CheckOcspRequest validation 2017-01-27 17:07:31 -08:00
f44bbe9ba3 Better CheckOcspRequest error detection on retry 2017-01-27 15:42:00 -08:00
1108ea0303 Merge pull request #729 from JacobBarthelmeh/staticmemory
account for unaligned memory when computing optimum size and update s…
2017-01-27 15:00:18 -08:00
0b8730f0b6 check bounds of buffer and get file buffer size 2017-01-27 15:14:25 -07:00
fc899029fb account for unaligned memory when computing optimum size and update static memory tests 2017-01-27 10:50:47 -07:00
e4942eaa3d Reorder restore statement. 2017-01-26 17:03:05 -07:00
74f72b5c6b Jenkins fix. 2017-01-26 13:15:11 -07:00
e96a720f04 Fixes a serious bug in Random.byte
Python's bytecode compiler has a peephole optimizer which, among other things, can recognize constant expressions and replace them with a constant.

In `Random.byte` the expression `t2b('\0')` is recognized as a constant and is replaced with a single constant compiled into the function's bytecode.

This means that every time you run `Random.byte`, rather than creating a new `str` object (or `bytes` in Python 3) it's reusing the same one each time, and `wc_RNG_GenerateByte` is writing right into that constant object's buffer; hence the following behavior:

```
In [55]: rng = Random()

In [56]: a = rng.byte()

In [57]: a
Out[57]: "'"

In [58]: rng.byte()
Out[58]: '\x11'

In [59]: a
Out[59]: '\x11'

In [60]: rng.byte()
Out[60]: '\x16'

In [61]: a
Out[61]: '\x16'

In [62]: rng.byte.__func__.__code__.co_consts
Out[62]:
('\n        Generate and return a random byte.\n        ',
 '\x16',
 0,
 'RNG generate byte error (%d)')

In [63]: rng.byte()
Out[63]: '\xad'

In [64]: rng.byte.__func__.__code__.co_consts
Out[64]:
('\n        Generate and return a random byte.\n        ',
 '\xad',
 0,
 'RNG generate byte error (%d)')
```

`Random.bytes` does not necessarily have this problem since its result buffer is not a constant expression, though I feel like it could also in principle be affected if the string were interned (though I couldn't produce such a result). Nevertheless, it doesn't seem like a good idea to be updating `str` objects' buffers directly.
2017-01-26 20:48:15 +01:00
3ca087e850 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into unitTest_api_dev 2017-01-26 12:48:03 -07:00
79e8bd2f2b Restore the ssl->hsHashes->hashSha384 before returning on failure. 2017-01-26 12:44:20 -07:00
be768f5395 Made changes in api.c to reflect Update() changes. 2017-01-26 12:34:09 -07:00
d22bc5d347 Merge pull request #727 from ejohnstown/minor-cleanups
Minor Cleanups
2017-01-26 08:50:28 -08:00
d93f856081 Minor Cleanups
1. Removed the execute bit from a few C source files.
2. Changed a couple letters in Moises's name in tfm.h to
   the non-extended/accented versions of "e" and "a".
2017-01-25 14:17:17 -08:00
1e02d00f61 Merge pull request #725 from toddouska/psk
add PSK test support to openssl script interop
2017-01-24 13:52:23 -08:00
d60d0b4e3f Merge pull request #726 from ejohnstown/static-memory-fix
Allow Static Memory...
2017-01-24 09:38:08 -07:00
13d0908b09 Allow static memory option when not using fast math or not using
slow math for anything.
2017-01-23 16:38:29 -08:00
a9a0cdfe71 add PSK test support to openssl script interop 2017-01-23 16:10:01 -08:00
52bc606ef9 Merge pull request #723 from dgarske/fix_ecc_noshamir_wstaticmem
Fix issue with wc_ecc_verify_hash_ex when not using SHAMIR and using static memory
2017-01-23 14:00:43 -08:00
a1b79abedb Merge pull request #717 from wolfSSL/auto_ecc_sup_curves
Added code to automatically populate supported ECC curve information
2017-01-23 13:57:56 -08:00
b7c3a340c1 Fix issue with wc_ecc_verify_hash_ex when not using SHAMIR and using static memory. Fixes issue #722. 2017-01-23 09:12:03 -08:00
008a69f185 Merge pull request #721 from ejohnstown/cleanups-for-multicast
Small Fixes for Multicast
2017-01-22 13:19:10 -08:00
d3d7446a24 removes 3DES from docs 2017-01-21 15:31:26 -02:00
8e0affb4a3 Merge pull request #692 from moisesguimaraes/fixes-ocsp-stapling-parser
Fixes certificate status parsing, adds behavior for unknown status type
2017-01-20 16:41:28 -07:00
ac0181d527 In benchmark, change the calls to InitRNG to the explicit
heap versions like all the other crypt calls so it works
with static memory. Plays nice with FIPS mode if available.
2017-01-20 15:36:08 -08:00
4d83ef1c23 Merge pull request #712 from moisesguimaraes/fixes-ocsp-lookup
fixes CA matching when using NO_SKID
2017-01-20 16:15:12 -07:00
497313978f Multicast
1. Opt-out the wolfmath code if not using big integers.
2. Opt-in a few functions when using lean PSK and DTLS.
3. Add a couple (void)heap to hush the compiler for
   usused variables in lean PSK.
4. Add include limits.h to internal.h if CHAR_BIT isn't
   defined. This is mainly for DTLS with lean PSK.
2017-01-20 11:59:28 -08:00
3918cdef03 Wrapped functions. 2017-01-19 13:35:23 -07:00
784ce57f45 Fix for TLSX_PopulateExtensions to not use #else HAVE_QSH case for populating supported curves. 2017-01-19 09:23:07 -08:00
835e3b7953 Merge pull request #719 from dgarske/fix_aes_no_dec
Fixes for building with NO_AES_DECRYPT
2017-01-19 08:52:32 -08:00
e86d59b3f7 Merge pull request #718 from dgarske/fix_ecc_comp_err
Fix scan-build warning with err not being read with HAVE_COMP_KEY defined
2017-01-19 08:50:44 -08:00
18b78795fb Merge pull request #716 from dgarske/fix_no_asn_time
Fix build with NO_ASN_TIME
2017-01-19 08:43:50 -08:00
fa2882322d Merge pull request #713 from JacobBarthelmeh/master
chacha20_poly1305 function expects a key size of 32 bytes
2017-01-19 08:41:48 -08:00
1afe613512 Fixes for building with NO_AES_DECRYPT. Added new HAVE_AESGCM_DECRYPT to allow AES GCM Decrypt with NO_AES_DECRYPT defined, since GCM uses only encrypt routine. Only allow TLS AES if NO_AES_DECRYPT is not defined. 2017-01-18 15:56:18 -08:00
b3721c6808 Fix scan-build warning with err not being read with HAVE_COMP_KEY defined. Okay to always call wc_ecc_curve_free, since DECLARE_CURVE_SPECS does a memset. 2017-01-18 14:05:32 -08:00
a761a7fc64 updates provisioners 2017-01-18 19:19:03 -02:00
feb6617dc9 updates centos provisioner 2017-01-18 18:41:15 -02:00
51bf46288b adds client example 2017-01-18 18:18:19 -02:00
5c8e69eb5e updates vagrant configs; updates server example, updates copyright year. 2017-01-18 17:59:48 -02:00
01f4a7b5bd Added code to automatically populate supported ECC curve information, unless already provided by user via wolfSSL_CTX_UseSupportedCurve or wolfSSL_UseSupportedCurve. 2017-01-18 11:54:43 -08:00
31981cc365 Merge pull request #711 from cconlon/ecc
add ECC export raw, sig to (R,S), helper functions
2017-01-18 09:27:42 -08:00
58f1fd2cc9 Merge pull request #704 from SparkiDev/memfail
Fixes from failure testing
2017-01-17 12:53:56 -08:00
c5bd24c1b7 Added changes Chris requested.
Moved error-crypt.h location and corrected FIPS return code.

Made requested changes to printf where 0 == 0.
2017-01-17 13:51:17 -07:00
a00bdb0de7 Merge pull request #714 from wolfSSL/fix_intelasm_debug
Fixed issue with intelasm and debug with SHA256
2017-01-17 12:50:17 -08:00
e84528205e chacha20_poly1305 function expects a key size of 32 bytes 2017-01-17 13:39:26 -07:00
2281560f1a Merge pull request #710 from JacobBarthelmeh/staticmemory
pass heap hint to temporary public ECC key
2017-01-17 12:15:45 -08:00
2e60330796 Merge pull request #703 from JacobBarthelmeh/SGX
wolfcrypt only build with Windows
2017-01-17 12:13:37 -08:00
c7ecf23c85 Merge pull request #696 from JacobBarthelmeh/Testing
fix possible memory leak on error case with ASN1 INTEGER to BN function
2017-01-17 12:10:21 -08:00
a0dc8dc8f9 Fix build with NO_ASN_TIME. Kaleb, add to future build options tests. 2017-01-17 10:35:48 -08:00
bb97e03a44 initial server tests 2017-01-16 19:40:46 -02:00
089387906e updates tests 2017-01-16 18:52:34 -02:00
715d6afeda updates tox config 2017-01-16 18:48:01 -02:00
0a9f66338c adds coverity tests 2017-01-15 12:51:09 -02:00
2d56f09320 adds accept() behavior to SSLSocket; Migrates tests to pytest. 2017-01-15 12:26:22 -02:00
1aeab91828 Fixed issue with intelasm and debug with SHA256 due to stack variable W_K alignment. Removed obsolete DEBUG_XMM code. 2017-01-13 15:50:04 -08:00
56091e267f moving source code into src 2017-01-12 19:27:36 -02:00
00fed61d36 Merge pull request #709 from JacobBarthelmeh/PKCS12
heap hint with PKCS7
2017-01-12 09:34:20 -07:00
75e3b5a297 pass heap hint to temporary public ECC key 2017-01-12 09:10:25 -07:00
86a3039e0b fixes CA matching when using NO_SKID 2017-01-12 13:56:38 -02:00
ba1315a499 Fixes from failure testing 2017-01-12 16:22:35 +10:00
f6647fbf84 add ECC export raw, sig to (R,S), helper functions 2017-01-11 17:08:35 -07:00
36d34ce069 free WOLFSSL_BN in SetIndividualExternal error case and simplify mpi_clear call 2017-01-11 14:53:32 -07:00
fc8ab42612 Merge pull request #671 from dgarske/ecc_curve_cache
New ECC curve cache feature to improve performance
2017-01-11 13:34:32 -08:00
575ac7b9d3 Merge pull request #707 from JacobBarthelmeh/master
fix location in tfm.c that could result in potential cache attack
2017-01-11 12:35:22 -08:00
bafddd1ba8 heap hint with PKCS7 2017-01-11 11:38:21 -07:00
e3277c19b7 fix location in tfm.c that could result in potential cache attack 2017-01-10 15:00:00 -07:00
8954de40ff Merge pull request #706 from JacobBarthelmeh/Windows
open test file in binary mode
2017-01-10 11:54:47 -08:00
c191a19a77 Merge pull request #705 from cconlon/pkcs7rng
fix RNG to WC_RNG typo in pkcs7.c
2017-01-10 10:15:05 -07:00
6732961e0d open test file in binary mode 2017-01-10 09:57:29 -07:00
993e6298ac fix RNG to WC_RNG typo in pkcs7.c 2017-01-09 16:59:42 -07:00
3338ea9ef7 Added ecc.c documentation for WOLFSSL_VALIDATE_ECC_IMPORT. Note: Add this define to enable checks for Jenkins (after this is merged). 2017-01-09 15:01:17 -08:00
0722f4d20f Fixes to reduce stack usage with ECC_CACHE_CURVE disabled (same as previous code). Added USE_ECC_B_PARAM macro (enabled with ECC_CACHE_CURVE or HAVE_COMP_KEY). Fixed bug with WOLFSSL_VALIDATE_ECC_KEYGEN defined and args to ecc_check_pubkey_order. Fixed counts for DECLARE_CURVE_SPECS(). Fixed wc_ecc_import_point_der to use curve cache. Enhance wc_ecc_check_key to support ECC_CACHE_CURVE for b or load using read_radix. Enhance to expose wc_ecc_is_point with all required mp_int* args directly. 2017-01-09 11:15:13 -08:00
6edb639d9d wolfcrypt only build with Windows 2017-01-09 10:33:46 -07:00
af00ad7683 Merge pull request #700 from JacobBarthelmeh/master
run peek last error line test only when NO_OLD_TLS is not defined
2017-01-07 11:37:27 -08:00
4be5f624e8 include logging.h in test.c 2017-01-06 16:40:19 -07:00
dcb9ef6651 better compatibility with printing errors to a file 2017-01-06 14:29:16 -07:00
274ac21450 Merge pull request #699 from kaleb-himes/FREERTOS_TCP
Remove toolchain level define from OS_TCP section
2017-01-06 13:23:22 -08:00
d3604f1061 run peek last error line test only when NO_OLD_TLS is not defined 2017-01-06 13:22:49 -07:00
2b49f4205f Remove toolchain level define from OS level define section 2017-01-06 11:44:04 -07:00
08f188ab44 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into unitTest_api_dev 2017-01-06 11:26:06 -07:00
2c87f8d33c merge with wolfSSL master. 2017-01-06 11:06:01 -07:00
050ba9d6e0 unit test md5, sha, sha256, sha384, sha512
Memory leak fix.
2017-01-06 10:57:50 -07:00
c20a35f1db Merge pull request #697 from JacobBarthelmeh/master
adjust dynamic types with PKCS12 parse
2017-01-05 14:39:17 -08:00
1afb7e20db fix for freeing copy of mpi in the case of not using fastmath 2017-01-05 13:49:07 -07:00
147a7d5096 adjust dynamic types with PKCS12 parse 2017-01-05 10:21:14 -07:00
1a55309207 fix possible memory leak on error case with ASN1 INTEGER to BN function 2017-01-05 10:00:17 -07:00
ea47d76bf7 Merge pull request #695 from dgarske/openssl_compat_enums
Additional openssl compatibility enums for X509_V_ERR and SSL_CB
2017-01-04 16:35:09 -07:00
cb0cc92ff2 Fixes for building with CRL monitor when not linux, OS X or FreeBSD and --enable-distro set. Cleanup of the crl.c HAVE_CRL_MONITOR checks for OS and make sure if StopMonitor preprocessor is defined the function will also be defined. 2017-01-04 15:27:15 -07:00
2f3ec778bd For distro build don't install options.h (conflicts with multi-arch). Fix for BUILD_DISTRO excludes with indent. 2017-01-04 15:27:15 -07:00
d3195d0b75 Pulled in patches from Debian package. 2017-01-04 15:27:15 -07:00
fc6217e4f6 Added stubs for the set_msg_callback functions. Cleanup of the SSL_ST_* and SSL_CB_* enums. 2017-01-04 12:14:09 -08:00
7c7b1233f7 Additional enums needed for compatibility with openssl for paho c mqtt client SSLSocket.c layer. 2017-01-04 11:00:08 -08:00
f25416d424 Merge pull request #689 from dgarske/fix_iar_arm
Fixes for compiler warnings with IAR EWARM 8
2017-01-03 15:46:12 -08:00
916e58b93c Merge pull request #694 from moisesguimaraes/fixes-ocsp-nonce-check
removes request->nonceSz check to fully validate response->nonce.
2017-01-03 13:04:24 -08:00
dd737ca103 Merge pull request #618 from kojo1/openssl-ex
Openssl Extra
2017-01-03 12:40:51 -08:00
11775acb86 Merge pull request #691 from JacobBarthelmeh/Windows
random port for MinGW with unit tests
2017-01-03 11:46:33 -08:00
c82372cf78 removes request->nonceSz check to fully validate response->nonce. 2017-01-02 14:59:00 -02:00
07ce995b12 Fix issue with imported key not having a reset key->r, key->s and key->state, which was causing wc_ecc_encrypt to fail. 2016-12-30 12:24:03 -08:00
762064c292 fixes certificate status parsing, adds behavior for unknown status type. 2016-12-29 22:29:46 -02:00
e3ec769107 Adds an --enable-aesctr flag to the configure script to explicitly compile with -DWOLFSSL_AES_COUNTER and -DWOLFSSL_AES_DIRECT
If --enable-fortress or --enable-mcapi are used they effectively force --enable-aesctr
2016-12-29 21:26:34 +01:00
073aa95496 Merge pull request #678 from dgarske/cleanup_macros
Cleanup min(), TRUE, FALSE, ALIGN16 and ALIGN32
2016-12-29 11:19:05 -08:00
0decefed11 Merge pull request #679 from dgarske/wolfmath
Combine generic math functions into new wolfmath.c/.h
2016-12-29 11:17:44 -08:00
fab72ed163 Merge pull request #688 from JacobBarthelmeh/master
fix C++ compiler warnings for distro build
2016-12-29 11:06:47 -08:00
f550172fd4 Merge pull request #687 from JacobBarthelmeh/Testing
update Windows FIPS build
2016-12-29 11:06:11 -08:00
5abfe9d1cf random port for MinGW with unit tests 2016-12-29 11:05:10 -07:00
19ee499c96 Fix to improve fp_copy performance without ALT_ECC_SIZE defined. This change is required for async because we can’t memcpy/memset the entire fp_int. 2016-12-28 16:47:14 -08:00
e75fddd49e Moving macType below hash in WOLFSSL_EVP_MD_CTX (instead of ALIGN16) to resolve 16-bit alignment crash I was seeing on CentOS due to size change of “WOLFSSL_Hasher”. 2016-12-28 16:31:41 -08:00
a854320a96 Revert changes to aes.c roll_auth. 2016-12-28 16:28:02 -08:00
6c90f097ca remove extra white space 2016-12-28 15:40:34 -07:00
c77a18f0ec add EVP_CIPHER_CTX_mode 2016-12-28 14:45:29 -07:00
f60cb08c29 macro and tests for get_passwd_cb functions 2016-12-28 14:45:29 -07:00
4f317a9a1d wolfSSL_EVP_CipherInit_ex handle ENGINE argument and add a sanity check 2016-12-28 14:45:29 -07:00
1326fe1b0d return values of DES set key and return block size for EVP block_size getter function 2016-12-28 14:45:29 -07:00
ccc72d72c2 change argument to pointer. In most cases NULL is used for this argument, as was the case in previous ports 2016-12-28 14:45:29 -07:00
95ea74a91e sanity checks and one function return type for better compatibility 2016-12-28 14:45:29 -07:00
091fc10147 adjust read ahead, some sanity checks and rebase 2016-12-28 14:45:29 -07:00
724e50c4fd cast flag to byte type from int 2016-12-28 14:45:29 -07:00
aabe456592 sanity checks, remove some magic numbers, TLS read ahead 2016-12-28 14:45:29 -07:00
ed5ff77e4f account for BIO with no filesystem and rebase commits 2016-12-28 14:45:29 -07:00
f7737fdc55 expand BIO compatibility 2016-12-28 14:45:29 -07:00
a2d1db4b73 Merge branch 'openssl-ex' of https://github.com/kojo1/wolfssl into openssl-ex 2016-12-28 14:45:29 -07:00
5a2794fe9c add EVP_MD_CTX_md, EVP_MD_type 2016-12-28 14:45:29 -07:00
2b3438e11b pem x509 read from bio and bio set fd 2016-12-28 14:45:29 -07:00
80efc366df add wolfSSL_EVP_MD_CTX_new/free 2016-12-28 14:45:29 -07:00
b377125ad1 add alias to EVP_get_cipher/digestbyname 2016-12-28 14:45:29 -07:00
c57803a4a5 add test EVP_CIPHER_CTX_new/free 2016-12-28 14:45:29 -07:00
a774f26613 add EVP_get_cipherbyname 2016-12-28 14:45:29 -07:00
2ef85e3d4d EVP_CIPHER_CTX_new/free, EVP_get_digestbyname 2016-12-28 14:45:29 -07:00
0c742654dc EVP_add_digest 2016-12-28 14:45:29 -07:00
64a3333870 adjust wolfSSL_set_options and test case 2016-12-28 14:45:29 -07:00
2daeecdb90 BIO s_socket and BN mod exp 2016-12-28 14:45:29 -07:00
e741a24089 add get last error and line function, fix ASN1 object redeclaration 2016-12-28 14:45:29 -07:00
1d0fc83d40 function to add X509 to cert chain 2016-12-28 14:45:29 -07:00
280f5cb542 fix int long type mismatch 2016-12-28 14:45:29 -07:00
1704a8d683 expand compatibility layer with write bio function 2016-12-28 14:45:29 -07:00
778680116e HMAC_cleanup, MD5xxx for bsd 2016-12-28 14:45:29 -07:00
570486b90c add SL_CTX_need/set_tmp_RSA 2016-12-28 14:45:29 -07:00
4baf494ddd add EVP_CipherUpdate/Final 2016-12-28 14:45:29 -07:00
869529642d Add #define EVP_DigestInit_ex 2016-12-28 14:45:29 -07:00
781c7d0055 check for user RSA 2016-12-28 14:45:29 -07:00
7e91838d4a memory management and add to compatibility layer 2016-12-28 14:45:29 -07:00
ff05c8a7a5 expanding compatibility layer 2016-12-28 14:45:29 -07:00
9d1cb18616 add function X509_get_ext_d2i 2016-12-28 14:45:29 -07:00
5f3fa171cd templates wolfSSL_ctrl and wolfSSL_CTX_ctrl 2016-12-28 14:44:05 -07:00
79472e11a1 add bio.c to dist and implement wolfSSL_check_private_key , wolfSSL_get_server_random 2016-12-28 14:44:05 -07:00
fed4ed40a9 compatibility functions for X509 2016-12-28 14:44:05 -07:00
0d7c259282 compatibility functions for ssl cert and private key 2016-12-28 14:44:05 -07:00
d8d3cd5269 staub: SSL_get_server_random 2016-12-28 14:44:05 -07:00
3946931320 stubs: SSL_get_server_random/verify_result/session/set_accept_state 2016-12-28 14:44:05 -07:00
a09a761d07 stubs: PEM_read_bio_DSAparams/X509_AUX/PrivateKey,SSL_CTX_get_default_passwd_cb/userdata 2016-12-28 14:44:05 -07:00
ee86325ae4 template: ERR_peek_last_error_line/print_errors_fp, EVP_add_digest 2016-12-28 14:44:05 -07:00
63dcacb437 templates: ENGINE_cleanup, BN_mod_exp 2016-12-28 14:44:05 -07:00
f3435eefbd templates: ASN1_INTEGER_to_BN, BN_mod_exp, CONF_modules_free/unload, DSA_dup_DH 2016-12-28 14:44:05 -07:00
f2f52c3ec9 add more compatiblity functions 2016-12-28 14:44:05 -07:00
6520a77fac DES ECB prototypes 2016-12-28 14:44:05 -07:00
526b602ebd AESNI support with EVP AES 2016-12-28 14:44:05 -07:00
8554912d68 COMPAT. LAYER : jenkins warnings and build configurations 2016-12-28 14:44:05 -07:00
464543df26 COMPAT. LAYER : jenkins warnings and spacing around if statements 2016-12-28 14:44:05 -07:00
8844554fca Templates BIO/SSL/SSL_CTX_ctrl 2016-12-28 14:44:05 -07:00
86014fb0d0 add BIO_ctrl and other BIO templates 2016-12-28 14:44:05 -07:00
8ed0b83c21 Test on EVP_Cipher AES Counter 2016-12-28 14:44:05 -07:00
de91e7df03 add EVP_Cipher with AES Counter 2016-12-28 14:44:05 -07:00
aed9b2d3bb add EVP_CIPHER_CTX_block_size/mode/set_flags/set_padding 2016-12-28 14:44:05 -07:00
bb400789b8 add EVP_Cipher with EVP_aes_256_ecb() 2016-12-28 14:44:05 -07:00
0fd50cd57a Added AES_set_encrypt/decrypt_key, AES_ecnrypt/decrypt 2016-12-28 14:44:05 -07:00
b57e576abd Fixes for compiler warnings with IAR EWARM 8.
* Fix “wc_PKCS7_DecodeUnprotectedAttributes” return prior to free in GetSet error case.
* Fix “wc_PKCS7_KariGenerateKEK” type mismatch for kdfType.
* Fix aes.c roll_auth use of inSz over 24-bit.
* Fix ecc “build_lut”, “accel_fp_mul” and “accel_fp_mul2add” use of err as unsigned.
* Fix “wc_HKDF” use of un-initialized “myHmac” for heap.
* Fix undefined reference to __REV for IAR due to missing intrinsics.h.
* Fix build error for “wolfSSL_CTX_set_tmp_dh” if OPENSSL_EXTRA not defined and “HAVE_LIGHTY || HAVE_STUNNEL || WOLFSSL_MYSQL_COMPATIBLE”.
* Cleanup of “wolfSSL_get_chain_X509” brace..
* Cleanup SSL_CtxResourceFree use of `i` and define comments.
* Added “SIZEOF_LONG_LONG” to IAR-EWARM user_settings.h to support word64 (required for SHA512, etc).
2016-12-28 11:18:41 -08:00
a40a3cb142 Merge pull request #686 from jay/fix_poly1305_ADD_macros
poly1305: fix ADD macros for multi-line
2016-12-27 17:52:53 -07:00
511f41b0e4 fix C++ compiler warnings for distro build 2016-12-27 14:38:14 -07:00
fb49dbd083 update Windows FIPS build 2016-12-27 10:34:13 -07:00
3b6dac9751 poly1305: fix ADD macros for multi-line 2016-12-24 02:46:35 -05:00
2cf7785068 Merge pull request #682 from JacobBarthelmeh/Release
prepare for release 3.10.0
2016-12-23 09:10:35 -07:00
c4af58b973 Refined the FIPS “min” logic. 2016-12-22 18:11:25 -08:00
fc16890641 Fix “min” with ctaocrypt FIPS. 2016-12-22 14:01:05 -08:00
7752f9ad05 prepare for release 3.10.0 2016-12-22 14:23:41 -07:00
784b24eebc Merge pull request #680 from ejohnstown/dtls-sctp-fix
DTLS-SCTP fix
2016-12-22 13:10:29 -07:00
53d4c171c8 adds more client tests 2016-12-22 17:58:13 -02:00
35f03eb00a fixes docs. 2016-12-22 16:59:50 -02:00
1c9147a41e adds supported curves to context; fixes compatibility issues with py27 2016-12-22 15:01:58 -02:00
9b58ab0211 renames exceptions file 2016-12-22 15:01:58 -02:00
4b75d11164 fixes socket calls 2016-12-22 15:01:58 -02:00
f3c1522608 always treat native_object as a pointer 2016-12-22 15:01:58 -02:00
b9934695fb pretest version of SSLSocket 2016-12-22 15:01:58 -02:00
567dfd76b3 adds initial code for SSLSocket 2016-12-22 15:01:58 -02:00
2cbdd45e8f adds negotiate() to ssl interface 2016-12-22 15:01:58 -02:00
07072ef266 moving SSLContext and SSLSocket to __init__ to avoid ciclic includes 2016-12-22 15:01:58 -02:00
baeba53527 adds wrap_socket to the context 2016-12-22 15:01:58 -02:00
445e375daa adds ssl interface to ffi 2016-12-22 15:01:58 -02:00
52eb0becf0 adds set_ciphers to context 2016-12-22 15:01:58 -02:00
368f2baf88 adds verify_mode to context 2016-12-22 15:01:58 -02:00
8eec3cb874 adds initial code for SSLSocket 2016-12-22 15:01:58 -02:00
0ed0672b16 fixes pylint warnings 2016-12-22 15:01:58 -02:00
c0b59a585b adds support for buffered ca certificates 2016-12-22 15:01:58 -02:00
015ffecbab fixes unicode quotes and adds load_cert_chain test. 2016-12-22 15:01:58 -02:00
760ddd14f5 fixes pylint warnings;
adds more tests to load_verify_locations;
fixes data type when calling C functions;
fixes result verification when calling C functions.
2016-12-22 15:01:58 -02:00
7201435f2d adds initial context tests. 2016-12-22 15:01:58 -02:00
bd14611879 adds load_verify_locations and load_cert_chain implementations. 2016-12-22 15:01:58 -02:00
c8ae6abb43 adds context functions. 2016-12-22 15:01:58 -02:00
e1c01378c7 fixes ssl version in test to maintain backward compatibility. 2016-12-22 15:01:58 -02:00
20cfbe399c fixes integer comparison and adds virtual env to ignored files. 2016-12-22 15:01:58 -02:00
e06b17e170 adds methods and client tests;
adds context creation;
adds memory module;
removes init and cleanup functions.
2016-12-22 15:01:58 -02:00
0df897d4b9 adds methods 2016-12-22 15:01:58 -02:00
7b884ad72a removes non-ASCII chars from docs. 2016-12-22 15:01:58 -02:00
8b0edafef3 adds build_ffI.py 2016-12-22 15:01:58 -02:00
f4d6890b51 adds basic files and exception classes. 2016-12-22 15:01:58 -02:00
d6a6226c8e Merge pull request #681 from JacobBarthelmeh/Testing
static analysis check of null dereference and memory management
2016-12-22 08:43:55 -08:00
93c87eb777 Merge pull request #677 from ejohnstown/dtls-prevseq
DTLS Previous Epoch Sequence Number Update
2016-12-22 08:42:56 -08:00
1c17b8eed6 static analysis check of null dereference and memory management 2016-12-21 16:20:18 -07:00
40800d8065 DTLS-SCTP fix
1. Add the SCTP suite test file to the include.am.
2. Skip the sequence number increment for client_hello messages in
   DTLS, but do the increment for SCTP.
2016-12-21 14:24:20 -08:00
338cc9e873 Added wolfevent.c and wolfmath.c to ltc project. 2016-12-21 14:09:19 -08:00
3bec816f97 Cleanup min(), TRUE, FALSE, ALIGN16 and ALIGN32. Replace only use of BYTE3_LEN with OPAQUE24_LEN. Replace “ “ with “\t” (saves bytes and is consistent). Fix align issue with “WOLFSSL_EVP_MD_CTX” hash. 2016-12-21 14:05:00 -08:00
d73338851d Combine generic math functions into new wolfmath.c/.h. Cleanup of the !ALT_ECC_SIZE code so fp_int always has size. This is in prep for async changes for new WC_BIGINT type for hardware crypto. 2016-12-21 13:39:33 -08:00
6cc1fd293e Fixed issue with stack increase with curve cache disabled. Fixed issue with missing wc_ecc_curve_free() in wc_ecc_verify_hash_ex() causing mem leak. Changed ecc_curve_spec_cache to be allocated per curve. Added new wc_ecc_curve_cache_free() API to release all curve cache memory. Moved ecc_curve_spec struct and ecc_curve_load_mask enum to ecc.c. Add missing wc_ecc_fp_free() to wolfCrypt test. Added ecc.c comment for FP_ECC. 2016-12-21 12:31:02 -08:00
ac27d6d7ca DTLS Sequence Number update
1. Set the prevSeq to nextSeq on CCS.
2. Fully clear nextSeq on CCS.
2016-12-20 09:30:46 -08:00
1a5c5d0011 Merge pull request #676 from cconlon/fortify
address fortify high issues
2016-12-19 20:03:24 -08:00
07e7521f34 Merge pull request #674 from JacobBarthelmeh/Testing
Bug fix for cache attack
2016-12-19 18:31:04 -08:00
125cfcacc3 Merge pull request #675 from JacobBarthelmeh/SGX
fix make dist with SGX project
2016-12-19 17:06:14 -07:00
46f3b2a367 address fortify high issues 2016-12-19 15:50:11 -07:00
345df93978 Bug fix for cache attack 2016-12-19 14:51:42 -07:00
6cefca6a49 Merge pull request #672 from cconlon/pkcs7fix
PKCS#7: fixes for building with AES disabled, smallstack
2016-12-19 13:46:35 -08:00
dca57bf2f0 Merge pull request #673 from cconlon/fortify
address fortify critical issues
2016-12-19 13:42:11 -08:00
4d637146d7 fix make dist with SGX project 2016-12-19 14:03:07 -07:00
060ff5e5ef address fortify critical issues 2016-12-19 11:53:14 -07:00
168203ff9d Merge pull request #649 from dgarske/distro
Linux Distro Patches
2016-12-16 16:03:16 -08:00
c313d97579 Merge pull request #622 from SparkiDev/sha384
SHA384
2016-12-16 15:57:40 -08:00
50cf1df8da Merge pull request #669 from SparkiDev/scrypt
Implementation of scrypt
2016-12-16 15:53:48 -08:00
c73ddf3f8a Merge pull request #670 from dgarske/executebit
Removed the execute bit on the new port files.
2016-12-16 15:52:26 -08:00
c5fbf96557 PKCS#7: fixes for building with AES disabled, smallstack 2016-12-16 15:58:18 -07:00
57571cb45e Fix merge issues with ECC HAVE_COMP_KEY after rebase. 2016-12-16 14:20:00 -08:00
f990775451 Fix issue with ECC_SHAMIR disabled due to curve->b remnant from async branch. 2016-12-16 11:53:33 -08:00
cbc3cc6e91 Removed the execute bit on the new port files. 2016-12-16 11:35:40 -08:00
f1ead30987 New ECC curve cache feature to improve performance. Disabled by default and enabled using ./configure CFALGS="-DECC_CACHE_CURVE" or #define ECC_CACHE_CURVE. Added internal ECC states. Combined wc_ecc_mulmod_ex versions for timing rest / not. Tested with all math, timing, FP variants and NXP LTC and ECC508A hardware. Pulled in from latest async branch. Added new ECC_MAX_SIG_SIZE enum to help with sizing the sign buffer.
Performance Increases with ECC_CACHE_CURVE enabled:
* Key Gen 4.2%
* Key Agree, 4.0%
* Sign 6.8%
* Verify 5.8%
2016-12-16 11:32:59 -08:00
a9e7c4081f Merge pull request #660 from ejohnstown/win-renegotiation
Enable secure renegotiation by default for Windows library build.
2016-12-15 16:17:15 -08:00
7b948fe04d Merge pull request #667 from JacobBarthelmeh/SGX
add Windows build for SGX
2016-12-15 16:23:29 -07:00
ec90d72412 Merge pull request #666 from cconlon/chachafix
fix CertificateRequest cert type for ECDSA ChaCha suites
2016-12-15 12:08:08 -08:00
01d8201284 Merge pull request #665 from cconlon/certs
add missing certs and keys to certs/include.am
2016-12-15 12:03:12 -08:00
d0533c6dad Merge pull request #664 from cconlon/pkcs7
PKCS#7/CMS expansion
2016-12-15 12:01:00 -08:00
9d94474133 Merge pull request #668 from ejohnstown/handshake-size
Fail on redundant handshake message data
2016-12-15 11:41:53 -08:00
6959c21fdd Merge pull request #663 from dgarske/stm32_iar
Fixes to build STM32 with IAR
2016-12-15 11:26:43 -08:00
be65f26dd2 If there is a badly formed handshake message with extra data at the
end, but the correct size with the extra data, send a decode_error
alert and fail the handshake.
2016-12-14 16:02:29 -08:00
33f21e8b8d set correct cert type in CertificateRequest when using ChaCha suite with ECDSA 2016-12-14 11:34:10 -07:00
e16f2c0722 add Windows build for SGX 2016-12-14 10:41:52 -07:00
41f6863970 add missing certs and keys to certs/include.am 2016-12-14 09:46:41 -07:00
55554b79a9 PKCS#7: fix use after free in wc_DecodeKtri 2016-12-14 09:15:45 -07:00
20887a8c35 Implementation of scrypt
Tests and benchmarking added.
Configure with --enable-scrypt and requires --enable-pwdbased
2016-12-14 16:57:41 +10:00
e5d1e3ae10 PKCS#7: only output test bundles when PKCS7_OUTPUT_TEST_BUNDLES is defined 2016-12-13 15:27:46 -07:00
22ecd55964 Don't ForceZero in assembly optimized versions. 2016-12-14 08:22:05 +10:00
a1b92dc809 Tidy up CPU Id check not not reference SHA384 2016-12-14 08:22:05 +10:00
24cfba4276 Fix ForceZero calls 2016-12-14 08:22:05 +10:00
0e4aa233ba Use ForceZero in all implementations of Transform 2016-12-14 08:22:05 +10:00
fd21023823 Share code between SHA512 and SHA384 2016-12-14 08:22:05 +10:00
811be0eb9e Faster zeroize on x86_64 2016-12-14 08:22:05 +10:00
f70860a9af Make sure NO_64BIT is defined. 2016-12-13 12:18:21 -08:00
fd9a94b2bd Fixes to build STM32 with IAR. 2016-12-13 10:24:55 -08:00
dad0cfda92 add EnvelopedData ECC support, refactor pkcs7 2016-12-13 09:40:54 -07:00
483e461c49 Merge pull request #647 from kaleb-himes/RIOT_OS
RIOT OS support, test scripts will be submitted to RIOT-OS repository
2016-12-10 19:13:19 -08:00
6c7e1785aa EXIT_TEST macro added for cleaner implementation and maintenance 2016-12-09 19:39:36 -07:00
1748045d52 use NO_WRITEV for portability 2016-12-09 19:12:25 -07:00
5006306bb8 PKCS#7: add support for optional unprotectedAttributes with EncryptedData 2016-12-09 17:02:57 -07:00
abf18858a8 refactor PKCS#7 functionality into separate functions for Enveloped and EncryptedData 2016-12-09 17:02:57 -07:00
b5eb8dce2f add PKCS#7/CMS EncryptedContent support 2016-12-09 16:57:31 -07:00
e80331e03a fix Windows debug build warning with secure renegotiation 2016-12-09 14:31:21 -08:00
7fa825fde0 Enable secure renegotiation by default for Windows library build. 2016-12-09 13:39:00 -08:00
e3b57211d5 undo whitespace modification 2016-12-09 14:36:06 -07:00
fc9d689bc6 fastmath works with RIOT_OS if defined TFM_NO_ASM 2016-12-09 14:34:14 -07:00
b0b80bed78 Merge pull request #657 from cconlon/x963kdf
add ANSI-X9.63-KDF support [SEC1]
2016-12-09 13:29:41 -08:00
ad2b0810c6 Merge pull request #648 from cconlon/keywrap
add AES key wrap support, RFC 3394
2016-12-09 13:23:39 -08:00
7a76baa83e restore .am and gitignore 2016-12-09 13:13:43 -07:00
c957107d76 merge with master and remove RIOT_Make directory, keep changes for working on Mac OS X 2016-12-09 13:11:45 -07:00
9e17b2b0aa Merge branch 'master' of https://github.com/wolfssl/wolfssl into RIOT_OS 2016-12-09 13:09:25 -07:00
8b1a6d4c70 Merge pull request #658 from kaleb-himes/sniffer
Prevent forcezero from running on freed memory
2016-12-09 09:04:01 -08:00
33e840b01b add AES key wrap support, RFC 3394 2016-12-09 09:30:56 -07:00
fdbb142699 Merge pull request #659 from toddouska/distcheck
fix nxp distcheck filename typo
2016-12-09 08:04:02 -08:00
d2ed611757 fix nxp distcheck filename typo 2016-12-08 16:52:12 -08:00
6cfb8e30b2 Merge pull request #591 from dgarske/STM32_CUBEMX
STM32 F2/F4 CubeMX and Std Peripheral Library hardware crypto support
2016-12-08 16:36:43 -08:00
ab7849be0d Merge pull request #655 from JacobBarthelmeh/ARMv8
ARMv8
2016-12-08 16:34:19 -08:00
2db7bf0dc0 use static digest for X9.63 KDF, add smallstack support 2016-12-08 17:28:53 -07:00
5da564d03c Merge pull request #656 from SparkiDev/hashes
Get the hash of the handshake messages rather than finalize.
2016-12-08 16:23:28 -08:00
d2b5a9538d Prevent forcezero from running on freed memory 2016-12-08 15:11:41 -07:00
289acd088a Remove state save and restore 2016-12-08 15:21:04 +10:00
ea1a03d538 Get the hash of the handshake messages rather than finalize.
Inconsistency between SHA256 and SHA384/SHA512 when getting hash.
More handshake messages can be added after this operation.
2016-12-08 15:21:04 +10:00
a5b267087f add ANSI-X9.63-KDF support [SEC1] 2016-12-07 20:26:09 -07:00
2a3f3433e7 Merge pull request #652 from ejohnstown/autoconf-size-check
Move autoconf size checks
2016-12-07 15:23:25 -08:00
3dec222969 Merge pull request #523 from dgarske/atmel_pr
Support for Atmel ATECC508A
2016-12-07 15:01:08 -08:00
074741aabf Merge pull request #651 from dgarske/ksdk_dup_dec
Remove obsolete duplicate declaration for wc_RsaFunction in the KSDK header
2016-12-07 13:48:53 -08:00
a1bd2c8b35 Merge pull request #654 from dgarske/smallstackfixes
Fixes for build with WOLFSSL_SMALL_STACK defined
2016-12-07 13:41:45 -08:00
da4a46ddf6 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into RIOT_OS 2016-12-07 14:16:34 -07:00
477ec3c3d1 Merge pull request #2 from NickolasLapp/STM32_CUBEmX
Fix DES3 on STM32 CUBEMX
2016-12-07 11:27:24 -08:00
82c12fb7be Fix DES3 on STM32 CUBEMX 2016-12-07 10:20:46 -07:00
5c59ccdeb9 Fix scan-build warning. Updated "side" variable failure case to return proper error code. 2016-12-07 07:57:55 -08:00
4dd393077f Updated EccSharedSecret callback to use ecc_key* peer directly. Passes examples with "-P" tests and new pkcallback test script. 2016-12-07 07:57:55 -08:00
45d26876c8 Moved wolfSSL_GetEccKey logic to internal.c and use only for PK_CALLBACK. Added other ECC key info to the EccSharedSecretCb. Cleanup of the "if (ssl->ctx->EccSharedSecretCb == NULL)" logic to revert indent so changes are minimized. Removed new wolfSSL_GetEccKey API. 2016-12-07 07:57:55 -08:00
eaca90db28 New Atmel support (WOLFSSL_ATMEL) and port for ATECC508A (WOLFSSL_ATECC508A). Adds wolfCrypt support for ECC Hardware acceleration using the ATECC508A. Adds new PK callback for ECC shared secret. Fixed missing "wc_InitRng_ex" when using "CUSTOM_RAND_GENERATE_BLOCK". Added ATECC508A RNG block function for P-RNG bypass ability. Added internal "wolfSSL_GetEccPrivateKey" function for getting reference to private key for ECC shared secret (used in test.h for testing PK_CALLBACK mode). Added README.md for using the Atmel ATECC508A port. 2016-12-07 07:57:55 -08:00
9399cc05cb Fixes for building with CRL monitor when not linux, OS X or FreeBSD and --enable-distro set. Cleanup of the crl.c HAVE_CRL_MONITOR checks for OS and make sure if StopMonitor preprocessor is defined the function will also be defined. 2016-12-07 07:07:27 -08:00
fdc297f6bd Moved the check for the size of long, long long, and __m128 to before
the checks for libraries. In some combination of autotools, making a
32-bit build, the autoconf test code can't link libnetwork and crashes,
leaving those sizes all set to 0.
2016-12-06 16:15:45 -08:00
55b1ced783 Merge pull request #653 from toddouska/pkcallbacks
add pkcallbacks script test
2016-12-06 15:15:50 -08:00
944e5fba03 ARMv8 : load pointer to AES key and counter into a register along with pointer to SHA256 K table to handle tight optimized loops on function call with -flto 2016-12-06 21:42:15 +00:00
ed8e0132a7 do_cleanup on pkcallbacks.test 2016-12-06 13:04:12 -08:00
c0e006d42c Fixes for build with small stack enabled. 2016-12-06 12:38:05 -08:00
80cc737ffa add pkcallbacks script test 2016-12-06 11:27:05 -08:00
9fcb6e4e3c Remove obsolete duplicate declaration for wc_RsaFunction in the KSDK port header. 2016-12-06 10:25:56 -08:00
932199c5e9 Fix build warning about unused static functions wc_AesEncrypt and wc_AesDecrypt with STM32. 2016-12-05 14:22:59 -08:00
4a7651a09a STM32 F2/F4 CubeMX and Std Peripheral Library hardware crypto support for RNG, AES, SHA1, DES3 and MD5. Adds new WOLFSSL_STM32_CUBEMX and WOLFSSL_STM32F4 defines. Tested on STM32F437II. 2016-12-05 14:22:59 -08:00
f3816a4dc5 Merge pull request #597 from dgarske/NXPLTC
NXP (K82) LTC math hardware acceleration support
2016-12-05 13:50:31 -08:00
1d14ac5ff3 Fixes to include.am and sha256.c after master rebase. Retested on NXP K82 with and without HW accel (all tests/benchmarks pass). 2016-12-05 09:15:58 -08:00
877ea7011c Fix for LTC RSA-4096. Use original wolfSSL code for RSA operation, reduce in LTC port layer. 2016-12-05 09:01:59 -08:00
0611c45869 Attempt to fix sha.c error with older visual studio compiler. 2016-12-05 09:01:59 -08:00
08b8af5f83 Fix for forced software crypto build. 2016-12-05 09:01:59 -08:00
c35daa877e Fix to allow disabling MMCAU/LTC for software only test (moved preprocessor defines to Kinetis). Updated K82 software benchmark with actual values. 2016-12-05 09:01:59 -08:00
ae75842021 Fix build issues with rebase for ECC and RSA. Changed user_settings.h example when LTC is enabled to disable Shamir and ECC-521. Cleanup to add USE_NXP_MMCAU and USE_NXP_LTC for the example user_settings.h, so the project file can automatically configure. 2016-12-05 09:01:59 -08:00
a6b96b17ff Fixes to include path for NXP ksdk_port. Fixes for time USER/OVERRIDES so their #ifdef's are checked first. Fix to initialize LTC via new "ksdk_port_init" function. Cleanup of the ksdk_port.c for formatting, macros, statics and line length. Cleanup of the AES code for key size. Cleanup of the wolfCrypt sha.c for readability. Added support for the KSDK bare metal drivers to the IDE Rowley CrossWorks example. Updated the settings.h to allow for overrides in Freescale section. Updated README with info for using LTC. 2016-12-05 09:01:59 -08:00
8e64d564dc NXP/Freescale K8X MMCAU / LTC core support for RSA, ECC, Ed/Curve25519, AES, DSA, DES3, MD5, RNG, SHA and SHA2. 2016-12-05 09:01:59 -08:00
ddeb9da502 warning on empty translation units ignored, move cflags to Makefile 2016-12-03 11:55:24 -07:00
d2aef9a82a README update 2016-12-03 11:03:17 -07:00
43525343fc add RIOT tests to dist and make sure Makefiles are not excluded by .gitignore 2016-12-02 17:30:57 -07:00
162294e3e5 added benchmark app for RIOT and updated test error handling 2016-12-02 14:39:37 -07:00
684f9bad22 RIOT OS build and test scripts, build instructions 2016-12-02 13:53:05 -07:00
4317141260 Merge pull request #646 from JacobBarthelmeh/master
remove fPIE flag
2016-12-01 12:56:56 -08:00
d32af7e44b remove fPIE flag : fPIE is suitable for use with executables and not when creating libraries 2016-12-01 12:01:38 -07:00
92377140b7 Merge pull request #520 from dgarske/compat_fixes
Add user cert chain DER support and OpenSSL compatibility fixes/improvements
2016-12-01 09:23:49 -08:00
650ddb8d23 Fixes so make check works with NO_FILESYSTEM and FORCE_BUFFER_TEST. Example: ./configure CFLAGS="-DNO_FILESYSTEM -DFORCE_BUFFER_TEST" 2016-11-30 16:27:24 -08:00
039aedcfba Added "wolfSSL_use_certificate_chain_buffer_format". Added "wolfSSL_SESSION_CIPHER_get_name" to get cipher suite name using WOLFSSL_SESSION*. Moved the "wolfSSL_get_cipher_name_from_suite" function to internal.c. Added new server-cert-chain.der, which is combination of ca-cert.der and server-cert.der. Enhanced load_buffer to detect format using file extension. Can test use of DER cert chain with NO_FILESYSTEM defined using "./examples/server/server -c ./certs/server-cert-chain.der -k ./certs/server-key.der". 2016-11-30 16:26:02 -08:00
3d920b23a0 Fix for building with NO_ERROR_STRINGS. 2016-11-30 16:26:02 -08:00
7a35d904c2 Added new API "wolfSSL_CIPHER_get_name_from_suite" to allow use of the cipherSuite and cipherSuite0 args directly to get cipher suite name. Changed "wolfSSL_CIPHER_get_name" to call new API (based on original). ASN change to allow ToTraditional and SetName for OPENSSL_EXTRA. 2016-11-30 16:26:02 -08:00
c3c3419138 Added processing of user cert chain in DER format. Added arg check on "wolfSSL_get_certificate" to fix NULL dereference if certificate not yet set via "wolfSSL_use_certificate_buffer" or "wolfSSL_use_certificate_file". Added "wolfSSL_CTX_use_certificate_chain_buffer_format" to expose way to import certificate chain buffer as ASN1 (since "wolfSSL_CTX_use_certificate_chain_buffer" assumes PEM) . Changed ProcessFile from static and added as local in internal.h. 2016-11-30 16:26:01 -08:00
cfc5de8c5a Merge pull request #645 from toddouska/fds
allow separate set fds for read/write, helpful for DTLS multicast
2016-11-30 13:17:58 -08:00
8f89d4922f allow separate set fds for read/write, helpful for DTLS multicast 2016-11-30 11:15:57 -08:00
a2dc01413c For distro build don't install options.h (conflicts with multi-arch). Fix for BUILD_DISTRO excludes with indent. 2016-11-29 13:29:19 -08:00
235060eff2 Merge pull request #644 from cconlon/return_fix
correct MEMORY_E returns in asn.c
2016-11-28 10:58:06 -08:00
a9936cf3ee correct MEMORY_E returns in asn.c 2016-11-28 10:39:07 -07:00
2cbc6ed673 ARMv8 : handle aggressive optimizers 2016-11-23 15:44:53 -07:00
7dab97fb01 Merge pull request #641 from dgarske/verifycb_peer_cert_chain
Add the peer cert buffer and count to X509_STORE_CTX for verify callback
2016-11-23 12:59:00 -08:00
1240014fab Fix OCSP to use public buffer type (now WOLFSSL_BUFFER_INFO). 2016-11-22 19:33:40 -08:00
8a8274d403 Merge pull request #643 from dgarske/fix_hmac_224
Fix wc_HmacSizeByType for SHA224.
2016-11-23 13:28:37 +10:00
50131b410d Added new "WOLFSSL_BUFFER_INFO" type to represent internal "buffer" type and the "WOLFSSL_X509_STORE_CTX" certs. Added "VERIFY_CALLBACK_SHOW_PEER_CERTS" to print peer certs pointer and length. 2016-11-22 19:24:54 -08:00
ff16ecda5e Merge pull request #642 from dgarske/ecc_custcurve_speedup
ECC performance increase with custom curves enabled
2016-11-22 16:05:57 -08:00
a540169b72 Merge pull request #638 from ejohnstown/dtls-window-update
DTLS Sequence Window Tracking Update
2016-11-22 16:53:04 -07:00
16907de633 Fix wc_HmacSizeByType for SHA224. 2016-11-22 14:45:10 -08:00
13cf313001 ECC performance increase with custom curves enabled (WOLFSSL_CUSTOM_CURVES) when A param is 3. 2016-11-22 13:43:18 -08:00
5b76a37234 Add the peer cert buffer and count to the X509_STORE_CTX used for the verify callback. Fixes #627. 2016-11-22 11:45:00 -08:00
13bdcc518d Pulled in patches from Debian package. 2016-11-22 11:25:40 -08:00
2d9d3aeb91 DTLS Window Update: fixes and changes 2016-11-22 10:12:18 -08:00
b61e6e1219 Merge pull request #639 from moisesguimaraes/fixes-srp-priv-key-size
fixes random keys size ('a' and 'b')
2016-11-21 15:59:32 -07:00
64fc68920d fixes random keys size ('a' and 'b') 2016-11-21 18:08:19 -03:00
ec6fec452d Update session export with the new sequence number windows. 2016-11-21 09:16:53 -08:00
2507c4da8a DTLS Sequence Window Tracking Update
1. Modify the DTLS sequence window to use an array of word32 instead
   of a word32 or word64 depending on the availability of word64.
2. One can change the array size to have a bigger window.
2016-11-18 11:52:43 -08:00
b380eef3e2 Merge pull request #637 from JacobBarthelmeh/master
PKCS12 : return on memory error
2016-11-18 11:03:57 -08:00
ac5436b462 PKCS12 : return on memory error 2016-11-18 09:40:26 -07:00
1289e66641 Merge pull request #636 from dgarske/fix-ti-hash-mem-leak
Fix memory leak issue in ti-hash.c with small stack
2016-11-17 16:19:37 -08:00
f167fe3d4a Merge pull request #625 from dgarske/tls_nosha256
Fix to allow TLS with NO_SHA256
2016-11-17 16:14:28 -08:00
bfd0a1b405 Fix to allow SHA384 cipher suite with NO_SHA256 defined. Without this fix the BUILD_AESGCM wasn't getting defined. 2016-11-17 10:29:48 -08:00
b01952ea40 Cleanup the hash free in FreeHandshakeResources. 2016-11-17 09:34:31 -08:00
de1ee91863 Fix memory leak issue with WOLFSSL_SMALL_STACK defined and using TI hardware accelerated hashing. 2016-11-17 09:24:56 -08:00
f275331e44 Merge pull request #634 from toddouska/sha512-length
Sha512 length
2016-11-16 15:06:20 -08:00
5c3bd7e1a0 Merge pull request #635 from cconlon/pkcs7signed
fix wc_PKCS7_EncodeSignedData with no signed attributes
2016-11-16 14:07:58 -08:00
8cea6ad148 fix wc_PKCS7_EncodeSignedData when used with empty or no signed attributes 2016-11-16 13:35:57 -07:00
44a23b072f fix mcapi with size change 2016-11-16 09:39:21 -08:00
afc54c3dff change sha512 hi/loLen to 64bits 2016-11-16 09:30:35 -08:00
f922d3f2d6 Merge pull request #624 from SparkiDev/sha224
SHA224 implementation added
2016-11-15 13:53:34 -08:00
98b57e045a Merge pull request #629 from SparkiDev/rsa-crt
Make RSA CRT constant time
2016-11-15 13:36:32 -08:00
f27159f2db Merge pull request #633 from cconlon/renegotiation_info
add server side empty renegotiation_info support
2016-11-15 11:11:17 -08:00
a10ec0ff91 adjust suiteSz and use SUITE_LEN in FindSuite() 2016-11-15 10:49:37 -07:00
ee53853d2f Merge pull request #632 from toddouska/init_multi
fix non ecc_make_key init_mulit potential problems
2016-11-14 19:34:14 -08:00
cbb2ce6baf Merge pull request #626 from dgarske/fix_ecc_make_rngfail
Fix for "wc_ecc_make_key_ex" if call to rng fails
2016-11-14 17:35:15 -08:00
49978d1417 server side empty renegotiation_info support 2016-11-14 15:33:36 -07:00
1a7fe0d4c5 fix non ecc_make_key init_mulit potential problems 2016-11-14 12:49:42 -08:00
82e8210208 Support for building without SHA256 with NO_OLD_TLS and SHA384/512. Although TLS 1.2 default digest for certs is SHA256 and our test cert signatures use SHA256, so make check will fail. Also requires disabling the P-RNG which uses SHA256. Added missing "wc_InitRng_ex" when using "CUSTOM_RAND_GENERATE_BLOCK". Cleanup of the BuildCertHashes, DoRounds, HashInput, HashOutput and HashOutputRaw return codes. 2016-11-14 12:47:24 -08:00
cee321323a Better handle "mp_init_multi" failure in "wc_ecc_make_key_ex". 2016-11-14 12:38:01 -08:00
fa816f0460 Merge pull request #631 from dgarske/ecc_privkey_import_oid
Fix for "wc_EccPrivateKeyDecode" to handle custom curve OID.
2016-11-14 11:52:48 -08:00
047b6df1a2 Merge pull request #630 from JacobBarthelmeh/master
remove include of ec.h in ecc.c
2016-11-14 11:51:15 -08:00
ecc5fccf07 Merge pull request #628 from JacobBarthelmeh/Testing
revert AESNI padding and handle the case in aes.c
2016-11-14 11:50:35 -08:00
a2d29e4c71 Further improve the "wc_EccPrivateKeyDecode" to use the CheckCurve return code, which is the curve_id in the success case. Fixes scan-build warning. 2016-11-14 10:06:20 -08:00
07efd88e4d Fix for "wc_EccPrivateKeyDecode" to handle custom curve OID. 2016-11-14 09:53:31 -08:00
dad628cb0d remove include of ec.h in ecc.c 2016-11-14 10:03:19 -07:00
2023b65f4c Make RSA CRT constant time
Identifying which part of the CRT failed, through timing, reveals
information useful to an attacker.
2016-11-14 08:57:28 +10:00
6d5485b88f Fix to "mp_init_multi" so failure ensures a later "mp_clear" won't free on un-initialized pointer. Applies to !USE_FAST_MATH only. No measurable benchmark difference. 2016-11-11 20:03:58 -08:00
9b0d53ba50 Fixes from review
Remove ForceZero changes (better version in another pull request)
Remove SHA-224 APIs for FIPS (algorithm not avaialable in FIPS.
2016-11-12 09:52:07 +10:00
0b3d9cbccd revert AESNI padding and handle the case in aes.c 2016-11-11 16:26:29 -07:00
cc303a3035 Merge pull request #623 from SparkiDev/ecc
ECC improvements/fixes
2016-11-11 12:53:12 -08:00
478f279b3c Fix logic 2016-11-11 16:38:28 +10:00
abcd6af512 Disable SHA-224 in FIPS 2016-11-11 16:29:34 +10:00
9e81261f1e Fixes 2016-11-11 16:11:16 +10:00
8a7bb3fad4 Z will be 0 not 1 2016-11-11 12:53:48 +10:00
71259113b2 ECC improvements/fixes
When checking for 1 actually check for 1 and not the digit count.
When checking for negative use a macro - for speed.
2016-11-11 12:41:25 +10:00
45983c3b32 Fix SHA224 enum in HMAC code 2016-11-11 12:17:32 +10:00
a0ee159fa5 Merge pull request #617 from JacobBarthelmeh/Compatibility-Layer
Compatibility layer
2016-11-10 11:47:42 -08:00
1aca9a6079 Fix for "wc_ecc_make_key_ex" if call to rng fails. Issue only applies to !USE_FAST_MATH case on failure response from call to "wc_RNG_GenerateBlock". 2016-11-10 11:39:29 -08:00
eb0de32aa2 Merge pull request #621 from JacobBarthelmeh/Testing
adjust alignment of arrays used for case with AESNI
2016-11-10 10:00:54 -08:00
fdfc177254 SHA224 implementation added
Added SHA24 implementation and tetss.
Added HMAC-SHA224 implementation and tests.
Added RSA-SHA224 and ECDSA-SHA224.
Added MGF1-SHA224
Added OpenSSL APIs for SHA224
Configuration option to enable SHA224 and it is on by default for x86_64
2016-11-10 15:52:26 +10:00
55401fceb8 adjust alignment of arrays used for case with AESNI 2016-11-09 15:03:26 -07:00
af44b2527a Merge pull request #620 from JacobBarthelmeh/PKCS12
PKCS12 : visibility of structs and guards
2016-11-09 08:59:31 -07:00
e9cda7b93f Merge pull request #619 from JacobBarthelmeh/ARMv8
ARMv8
2016-11-08 16:21:01 -08:00
fa48bca262 PKCS12 : visibility of structs and guards 2016-11-08 16:49:09 -07:00
c122558810 COMPAT. LAYER : fix missing return value and alignment 2016-11-08 14:16:02 -07:00
208f747a47 ARMv8 : add armv8-aes.c to EXTRA_DIST 2016-11-08 10:28:01 -07:00
d4b45c4299 Merge pull request #616 from moisesguimaraes/fixes-wolfcrypt-py
Fixes wolfcrypt py
2016-11-08 09:07:21 -08:00
5f6cf282b1 fixes include.am comments 2016-11-07 21:15:23 -03:00
88df983251 moves include.am into wolfcrypt-py folder 2016-11-07 21:09:08 -03:00
46dee9e792 ARMv8 : clang 32 bit build 2016-11-07 15:48:06 -08:00
668af9b32f POLY1305 : clang 32 bit warning about macros 2016-11-07 15:28:30 -08:00
f7a951709f COMPAT. LAYER : get SSL client random bytes 2016-11-07 13:21:35 -07:00
f06a392764 COMPAT. LAYER : DES set key and malloc/free 2016-11-07 13:21:05 -07:00
b50914f2c7 Drops 3DES and adds int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng); for RSA blinding 2016-11-07 16:06:35 -03:00
08f6d23e84 moves wolfcrypt-py implementation to wrapper/python/wolfcrypt 2016-11-07 16:02:41 -03:00
68c43e4344 Merge pull request #615 from ejohnstown/dtls-verify-retry-fix
Fix dropped DTLS Hello Verify retransmit
2016-11-04 15:52:13 -07:00
70b227011d Merge pull request #604 from JacobBarthelmeh/PKCS12
Pkcs12
2016-11-04 15:50:50 -07:00
c271806936 Merge pull request #614 from toddouska/scr-verify
add SCR client and server verify data check
2016-11-04 10:11:05 -07:00
ada2573009 Increment the expected handshake number if the call to the handhsake
message processing function is successful, but not if the handshake
message is the client_hello. Process client hello clears that counter
and incrementing it breaks the handshake. Fixes issue #612.
2016-11-03 14:49:21 -07:00
87e3f45f52 add SCR client and server verify data check 2016-11-03 14:45:24 -07:00
356c3a37aa Merge pull request #613 from JacobBarthelmeh/Testing
MODE : change source file mode back to 644
2016-11-03 13:16:59 -07:00
0839925797 PKCS12 : visibility, check on key match, sanity check on malloc 2016-11-03 11:14:29 -06:00
668e9a8e08 MODE : change source file mode back to 644 2016-11-03 10:08:13 -06:00
3780f452e8 Merge pull request #609 from JacobBarthelmeh/ARMv8
ARMv8 : clang build with ARMv8
2016-11-03 09:02:20 -07:00
8e0ab18924 Merge pull request #611 from cconlon/pkcs7
allow PKCS#7 to be compiled with AES disabled
2016-11-03 09:00:46 -07:00
9a735fc873 allow PKCS#7 to be compiled with AES disabled 2016-11-02 12:18:45 -06:00
d4b8320226 Merge pull request #606 from ejohnstown/dtls-pool
DTLS Pool Change
2016-11-02 10:54:53 -07:00
a3ea8378ec Cap the size of the transmit and receive DTLS message lists at 255. 2016-11-02 09:15:05 -07:00
6f06b60bc0 ARMv8 : clang build with ARMv8 2016-11-01 13:38:01 -07:00
624ec3d492 Merge pull request #607 from cconlon/pkcs7
add AES content encryption support to PKCS#7 EnvelopedData
2016-11-01 12:03:24 -07:00
22c5e22698 Merge pull request #608 from JacobBarthelmeh/master
Option to disable RNG (WC_NO_RNG or --disable-rng). If RNG is disabled and building in crypto that makes calls to RNG functions the build will fail with linker undefined symbol errors.
2016-11-01 11:53:53 -07:00
ffe905afbf Moved the checks for the new session ticket and certificate verify
messages from the change cipher spec handler to the sanity check
handshake message function. It provides support for DTLS missing
and duplicate messages.
2016-11-01 09:53:53 -07:00
3075269326 Replace the DTLS MsgPool for saving transmit handshake messages with
the DTLS MsgList.
2016-11-01 09:53:53 -07:00
3065bb2178 Merge pull request #588 from steweg/fix_dtls_retranmission
Adjust DTLS retranmission logic
2016-11-01 09:29:30 -07:00
70e7e34c87 RNG : change to --disable-rng, non-autoconf scenario, help msg 2016-11-01 10:21:29 -06:00
09c32de412 RNG : option to not use RNG 2016-10-31 16:51:02 -06:00
50464d4aef gitignore PKCS#7 test files, delete on make clean 2016-10-31 14:46:03 -06:00
fa9a9175d0 add AES-256-CBC to PKCS#7 Encode/DecodeEnvelopedData 2016-10-31 14:45:57 -06:00
8c23c3cdd0 add AES-192-CBC to PKCS#7 Encode/DecodeEnvelopedData 2016-10-31 14:27:21 -06:00
17c184e720 add AES-128-CBC to PKCS#7 Encode/DecodeEnvelopedData 2016-10-31 14:27:14 -06:00
b686deecbe PKCS12 : Add PKCS12 parsing 2016-10-29 13:12:26 -06:00
79cba75925 Merge pull request #603 from ejohnstown/aes-ctr
expand the AES-CTR test to 4 blocks for 192 and 256 bit cases
2016-10-28 13:52:50 -06:00
849ae72d3a expand the AES-CTR test to 4 blocks for 192 and 256 bit cases 2016-10-27 15:54:22 -07:00
7ef037af0f Merge pull request #602 from kaleb-himes/forums-support-case-user-sp
IAR compiler for ARM 7.70.2.11706 - unitialized warning
2016-10-26 20:04:02 -07:00
2122ee2eb5 IAR compiler for ARM 7.70.2.11706 - unitialized warning 2016-10-26 09:33:15 -06:00
59fdd98f1d Adjust DTLS retranmission logic
This patch adjust DTLS retranmission logic
in order to avoid message floods between client
and server
2016-10-26 10:37:23 +02:00
703d504b58 Merge pull request #600 from kaleb-himes/scan-build-async
Check for sigLen size to resolve scan-build warning.
2016-10-25 11:08:14 -07:00
bc1fca5620 modified handler to return error on invalid condition post review
update
2016-10-25 11:07:35 -06:00
33ab901b3f prevent allocation of size 0 2016-10-24 16:44:43 -06:00
b8aa335dd6 Merge pull request #598 from dgarske/ecc_cacheres_w_altsize
Fix for ECC with ALT_ECC_SIZE and cache resistance enabled
2016-10-17 15:01:43 -07:00
d2a6c6838e Fix for ECC with !WC_NO_CACHE_RESISTANT and ALT_ECC_SIZE causing invalid mp_int*. An ecc_point with ALT_ECC_SIZE is "mp_int* x" vs. "mp_int x[1]". The resulting pointer for &M[0]->x is not valid in the ALT_ECC_SIZE case. This was found while testing ECC on a Cortex M4 (32-bit) and caused a hard fault. 2016-10-14 16:44:57 -07:00
2ecf7090ca Merge pull request #595 from JacobBarthelmeh/Testing
static analysis : Fix warnings with wc_AesCcmSetKey
2016-10-12 11:27:29 -07:00
88a82f519e Merge pull request #594 from JacobBarthelmeh/DTLS-MultiCore
session export : Increment DTLS export version with serialization cha…
2016-10-12 11:25:23 -07:00
ffb2a8ff12 Merge pull request #593 from JacobBarthelmeh/ARMv8
ARMv8 : sanity checks
2016-10-12 11:23:27 -07:00
11102b6726 Merge pull request #585 from NickolasLapp/master
Rename *Mutex Functions with wc_ prefix. Expose these functions for Stunnel.
2016-10-12 11:19:32 -07:00
9cf4d7ca8e Merge pull request #584 from kaleb-himes/aes-gcm-bo
sanity check on memcpy and xorbuf
2016-10-12 11:18:03 -07:00
54c51ec4a0 static analysis : Fix warnings with wc_AesCcmSetKey 2016-10-12 10:02:53 -06:00
3c03aa453b session export : Increment DTLS export version with serialization changes 2016-10-11 14:01:38 -06:00
86bf50ea70 Ensure dh->q is nulled on init and free 2016-10-10 16:21:30 -06:00
eb9161d8a7 ARMv8 : sanity checks 2016-10-10 15:08:59 -06:00
395972e6a8 Merge pull request #592 from cconlon/eccfix
fix ecc_check_privkey_gen() parameters with WOLFSSL_VALIDATE_ECC_IMPORT
2016-10-07 14:30:06 -07:00
ab966a72da fix ecc_check_privkey_gen() parameters with WOLFSSL_VALIDATE_ECC_IMPORT 2016-10-07 14:14:50 -06:00
05fcbb001a move sanity check and remove silent truncation 2016-10-06 15:01:16 -06:00
ef5f55f6e4 Optimize memory usage for ARM Cortex M and similar embedded systems (#578)
* Changed ge_precomp data to const to reduce RAM usage on embedded systems.
* Add configuration option "WOLFSSL_NRF5x" for Nordic nRF5x platform in settings.h
2016-10-06 12:49:14 -07:00
f4c654dd6e Merge pull request #590 from JacobBarthelmeh/ARMv8
ARMv8 additions
2016-10-06 10:04:07 -07:00
4181b744ab stunnel 5.36 requires des3. Enable by default 2016-10-05 13:17:26 -06:00
d07746de09 ARMv8 : Remove dependency on load 2016-10-05 11:02:51 -06:00
69483366fb Fixes for fips compatibility 2016-10-05 10:20:13 -06:00
89aec2c565 Add cast for g++ compiler 2016-10-05 09:37:44 -06:00
21dd236ef2 ARMv8 : increase performance 2016-10-05 09:04:18 -06:00
1e028c3566 Merge pull request #589 from cconlon/ipproto
Wrap IPPROTO_SCTP use with WOLFSSL_SCTP in test.h
2016-10-04 19:48:32 -07:00
29cf90a425 protect IPPROTO_SCTP with WOLFSSL_SCTP in test.h 2016-10-04 16:42:53 -06:00
81a8ad0a48 Merge pull request #587 from ejohnstown/seq64
64-bit Sequence Number
2016-10-04 06:01:26 -07:00
1792eba1a2 Rename *Mutex Functions with wc_ prefix. Expose these functions for
Stunnel. Various other changes to enable stunnel compling
2016-10-03 16:36:05 -06:00
12ac0346f5 change magic numbers to constants, rename verify parameter of WriteSEQ() and subfunctions 2016-10-03 13:51:10 -07:00
a839b61e81 initialize temp sequence number 2016-10-02 13:02:20 -07:00
575785db3e Fixes for DTLS sequence number checking. 2016-10-02 12:03:44 -07:00
ab371365b9 updated sequence number window 2016-09-30 17:02:05 -07:00
62d58a7084 updated session import/export for seq number 2016-09-29 23:09:42 -07:00
4522fa335e Fixing DTLS for 64-bit sequence numbering
1. Simplify away the DtlsState record.
2. Adding in high order bits for the DTLS sequence number.
3. For DTLS, separated copying the sequence number from incrementing it.
2016-09-29 15:51:33 -07:00
a630fda509 Sanity check on memcpy and xorbuf
Sanity check on memcpy and xorbuf
2016-09-29 13:26:50 -06:00
1a7f1d3b26 Merge pull request #583 from JacobBarthelmeh/CSharp
C# Wrapper : TCP check connection termination
2016-09-28 16:31:29 -06:00
1ed06b53df C# Wrapper : TCP check connection termination 2016-09-28 15:00:30 -06:00
6f4b704552 ARMv8 : Aarch32 support, SHA256 speedup 2016-09-28 10:22:27 -06:00
be86308a33 Merge pull request #556 from danielinux/frosted-fix
Fix compilation on Frosted
2016-09-26 12:53:39 -06:00
124a8c0c1f Merge pull request #582 from ejohnstown/lean-psk
Fixes for building the library for Lean PSK
2016-09-24 10:59:54 -06:00
af5d790aea Merge pull request #581 from ejohnstown/tlsx
Fixes for building the library with a C++ compiler with TLSX enabled
2016-09-24 10:45:33 -06:00
8d1aa2238b Fixes for building the library for Lean PSK
1. Needed to enable static PSK when using Lean PSK
2. Fixed complaints about unused variables.
2016-09-24 00:18:36 -07:00
5e852dc1a1 Fixes for building the library with a C++ compiler with TLSX enabled
1. Add many typecasts for malloc() data to proper pointer type.
2. Add many typecasts for constants in tertiary operators.
3. ECC to use local copy of wc_off_on_addr instead of extern copy.
2016-09-23 23:22:58 -07:00
5ec5b9b07d Merge pull request #580 from JacobBarthelmeh/Testing
NTRU : warning of variable size as argument
2016-09-23 15:52:48 -07:00
02b3aa51bd NTRU : warning of variable size as argument 2016-09-23 15:30:33 -06:00
fb01cf7e1b Merge pull request #579 from ejohnstown/release-v3.9.10
Prepare release v3.9.10
2016-09-23 15:05:21 -06:00
6895803f2b Prepare release v3.9.10 2016-09-23 12:19:24 -07:00
049956d852 Merge pull request #577 from kaleb-himes/fix-typos
Fixing typos
2016-09-23 12:18:23 -07:00
4fc0c6c646 fix unused parameter build time error
fix unused parameter build time error
2016-09-23 12:23:26 -06:00
3bd86d3f87 Fixing typos 2016-09-23 10:45:29 -06:00
91580552bc ARMv8 : AES-GCM encryption speed ups 2016-09-23 10:20:52 -06:00
78246e0fc2 Merge pull request #575 from ejohnstown/fix-option
move an ifndef NO_AES for one more configure disable/enable combination
2016-09-22 16:15:49 -06:00
98841e8b47 Merge pull request #576 from toddouska/dsa_zero
add dsa sign sanity check on r/s
2016-09-22 15:14:43 -06:00
e4b8e6a447 Merge pull request #574 from JacobBarthelmeh/Testing
Static Analysis : fix a warning of unused variable
2016-09-22 14:09:46 -07:00
d9163e4554 add dsa sign sanity check on r/s 2016-09-22 12:04:48 -07:00
ba6e2b1037 move an ifndef NO_AES for one more configure disable/enable combination 2016-09-22 11:41:16 -07:00
c43fd150e9 Static Analysis : fix a warning of unused variable 2016-09-22 09:31:26 -07:00
18944dacbf Merge pull request #573 from toddouska/dsa_pad
fix dsa pre padding
2016-09-22 09:42:23 -06:00
9e4e08d7a7 fix dsa pre padding 2016-09-21 18:51:11 -07:00
2368d49678 Merge pull request #572 from ejohnstown/pathlen
CA Certificate Path Length Checking
2016-09-21 14:36:24 -07:00
b8704d2dfe Merge pull request #571 from toddouska/new_rng
Fix Jenkins build 389 single-threaded issue
2016-09-21 12:59:06 -07:00
74002ce66a Add the new path length test certs to include.am. 2016-09-21 12:34:01 -07:00
ab887b88dc Merge pull request #570 from ejohnstown/des3-disable-fix
Disable DES3 compiler warning fix
2016-09-21 13:25:00 -06:00
de81c81eae Fixed unused variable complaints when OPENSSL_EXTRA and MD5 are enabled
and when AES is disabled.
2016-09-21 10:21:03 -07:00
489345f0d4 move CTX new_rng out of with certs block 2016-09-21 09:02:38 -07:00
95acd9c907 Fixed unused variable complaints when KEYGEN and OPENSSL_EXTRA are enabled
and when AES and MD5 are disabled. It was in the same encrypt function as
before and in the paired decrypt function.
2016-09-21 07:32:17 -07:00
a42bd30278 CA Certificate Path Length Checking
1. Check the path length between an intermediate CA cert and its
   signer's path length.
2. Always decode the path length if present and store it in the decoded
   certificate.
3. Save the path length into the signer list.
4. Path length capped at 127.
5. Added some test certs for checking CA path lengths.
2016-09-20 21:36:37 -07:00
ef7183dcf7 delete redundant #else 2016-09-20 15:59:08 -07:00
d9862c1c1a Merge pull request #569 from kaleb-himes/CUSTOMER_REQUEST
addition to previous customer request
2016-09-20 12:09:15 -07:00
65a7978dec Merge pull request #567 from toddouska/rng
RDSEED enhancements
2016-09-20 12:09:01 -07:00
df1d8200ef Fixed unused variable complaint when KEYGEN and OPENSSL_EXTRA are enabled
and when AES and DES3 are disabled.
2016-09-20 12:07:58 -07:00
67a112773e fix secure renegotiation 2016-09-19 17:31:20 -07:00
21726d5ae4 64bit sequence tls proof of concept, dlts needs some work 2016-09-19 16:02:27 -07:00
4214f52d77 addition to previous customer request 2016-09-19 16:01:24 -06:00
0718aba655 fix comment typo 2016-09-19 13:28:14 -07:00
485d814aed Merge pull request #563 from JacobBarthelmeh/ARMv8
ARMv8 : AES-GCM constraint fix
2016-09-19 09:30:08 -07:00
e0b8e55198 Merge pull request #553 from ejohnstown/disable-des3
Disable DES3 by default
2016-09-19 09:27:32 -07:00
b4b0b2433e Merge pull request #555 from ejohnstown/autogen-tweak
Autogen tweak for git worktrees
2016-09-19 09:26:06 -07:00
4c295cd13d Merge pull request #564 from kaleb-himes/CUSTOMER_REQUEST
Implement requested change from customer
2016-09-19 09:24:43 -07:00
1bab8822a9 Merge pull request #565 from ejohnstown/enable-ecccurveext
Enable the ECC Supported Curves extension by default
2016-09-19 09:24:05 -07:00
afd039d2e1 Merge pull request #566 from JacobBarthelmeh/master
Benchmark App : fixed some invalid set key sizes
2016-09-19 09:23:12 -07:00
6d73175b22 Benchmark App : fixed some invalid set key sizes 2016-09-17 15:07:38 -06:00
c51444bec5 update rdseed to 64bit get, more retries, fallback to /dev/urandom on failure 2016-09-16 18:54:47 -07:00
3f95bac55f Merge pull request #562 from ejohnstown/pre-release3.9.9
Bump version for pre-release REDUX
2016-09-16 15:07:00 -06:00
67c7e7c8de Implement requested change from customer
Implement requested change from customer
2016-09-16 14:38:33 -06:00
f191cf206e allow single threaded mode to share an RNG at WOLFSSL_CTX level 2016-09-16 13:35:29 -07:00
781e800486 1. Enable the extension ECC Supported Curves by default.
2. Force the extention disabled if ECC is disabled.
2016-09-16 13:26:56 -07:00
f755591316 ARMv8 : AES-GCM constraint fix 2016-09-16 19:43:47 +00:00
7a7f2fbe78 Bump version for pre-release. 2016-09-16 10:58:31 -07:00
ef0cd908ea Merge pull request #557 from kaleb-himes/arduino-updates
fix distribution issue
2016-09-16 10:55:48 -07:00
c85b3b84d9 Merge pull request #554 from JacobBarthelmeh/ARMv8
ARMv8 : AES-CTR/CBC/GCM speed ups and refactor AES
2016-09-16 09:34:24 -07:00
03ebb4825e Merge pull request #552 from toddouska/aesca
prevent compiler from optimzing out PreFetch Td4
2016-09-16 09:16:07 -07:00
14a7065f6e fix distribution issue 2016-09-16 10:04:50 -06:00
b869641de6 Merge branch 'master' into frosted-fix 2016-09-16 11:46:01 +02:00
890bcde1cd Don't include <sys/uio.h> when running on Frosted 2016-09-16 11:43:34 +02:00
4087f6904c Treat project directory as in version control if .git is
either directory or file.
2016-09-15 16:09:27 -07:00
6d82cba29c ARMv8 : AES-CTR/CBC/GCM speed ups and refactor AES 2016-09-15 22:50:00 +00:00
ef9c4bf5c9 Add client-ca.pem to the automake include for dist. 2016-09-15 15:38:41 -07:00
bad6be5c76 1. Updated sniffer to allow DES3 to be disabled.
2. Fixed an unused variable in OpenSSL Extras when DES3 is disabled.
3. Force DES3 enabled when enabling MCAPI.
2016-09-15 14:53:28 -07:00
e92f0e32b0 Undo making the ECC supported curves extension default to enabled. 2016-09-15 13:15:49 -07:00
78c0f98ea9 Merge pull request #551 from kaleb-himes/arduino-updates
Updates to make building for ARDUINO more intuitive
2016-09-15 13:01:42 -07:00
0ee7d7cc17 1. Add DES3 enable to full commit test.
2. Added DES3 to the list of FIPS prereqs.
2016-09-15 12:19:32 -07:00
e3bb4c29e2 Fix openssl.test with the lean-TLS option
1. Make new CA cert for test that is both client-cert.pem andr
   client-ecc-cert.pem.
2. Use the new client-ca.pem cert in the test script.
3. Update renewcerts script to generate client-ca.pem.
2016-09-15 11:39:30 -07:00
c1ac0c0f8c Merge pull request #545 from ejohnstown/ems
Extended Master Secret
2016-09-15 11:25:41 -07:00
2d4757b446 Disable DES3 by default. Force it enabled when it is a prereq for
another option. (SCEP and PKCS7)
2016-09-15 11:23:36 -07:00
19434e285a Update the resume test to rerun itself with the "-n" option to disable
extended master secret if the option is enabled.
2016-09-15 10:13:31 -07:00
8cdaa06127 prevent compiler from optimzing out PreFetch Td4 2016-09-15 10:02:30 -07:00
9d49fae600 Updates to make building for ARDUINO more intuitive
NO_INLINE not necessary, update README
2016-09-14 17:01:35 -06:00
01be5cdc07 Merge pull request #550 from toddouska/rsainit
make sure rsa rng is null on init
2016-09-14 16:31:07 -06:00
dc337946d5 make sure rsa rng is null on init 2016-09-14 14:33:08 -07:00
8b713adcfd Extended Master Secret Peer Review Changes
1. Checked the returns on the hash functions in the sniffer,
   return new error if any fail.
2. Removed the SHA-512 hash from the sniffer's collection of
   hashes. Never used in a cipher suite.
3. Added some logging messages in the EMS support in wolfSSL.
2016-09-14 13:43:02 -07:00
7410b5784f Merge pull request #548 from toddouska/nocache
add WC_NO_CACHE_RESISTANT option for old code paths
2016-09-14 10:24:29 -07:00
e039fcefc0 Merge pull request #549 from JacobBarthelmeh/master
aes.c : check ILP32 macro defined
2016-09-14 09:58:19 -07:00
109642fef4 aes.c : check ILP32 macro defined 2016-09-14 09:33:48 -06:00
b6937626b4 don't require uneeded temp with WC_NO_CACHE_RESISTANT 2016-09-13 17:01:50 -07:00
7b3fc558ec add WC_NO_CACHE_RESISTANT option for old code path 2016-09-13 16:45:15 -07:00
b77c350153 Merge pull request #547 from toddouska/mathca
Remove timing resistant cache key bit monitor leaks
2016-09-13 14:34:23 -07:00
05d78dc2ce Merge pull request #544 from cconlon/rsafix
include MAX_RSA_INT_SZ in wc_RsaKeyToPublicDer(), for 4096-bit keys
2016-09-13 11:24:03 -07:00
46a0ee8e69 switch ecc timising resistant mulmod double to use temp instead of leaking key bit to cache monitor 2016-09-13 11:10:10 -07:00
0477d5379e Merge pull request #546 from toddouska/aesca
AES T table cache preload.
2016-09-13 11:05:28 -07:00
6ef9e79ff5 switch timing resistant exptmod to use temp for square instead of leaking key bit to cache monitor 2016-09-13 09:13:39 -07:00
6ae1a14c9f do aes cache line stride by bytes, not word32s 2016-09-12 21:09:08 -07:00
77cf700657 Update to allow resumption with session tickets and extended master secret. 2016-09-12 16:06:51 -07:00
c6256211d6 compress aes last round decrypt table, prefetch Td tables before aes decrypt rounds, prefecth compressed table before last round 2016-09-12 13:04:30 -07:00
97a64bcc7c remove unique aes last round Te table, pre fetch Te tables during software aes encrypt 2016-09-12 12:03:37 -07:00
c1136a30e9 1. Enabled the extended master secret in the Windows IDE user_settings.h
file by default.
2. Fixed scan-build warning about an assignment to a variable that isn't
used again in the function. Commented out the line.
2016-09-12 09:42:42 -07:00
b994244011 Revising the Extended Master Secret support. Removing the dynamic
TLSX support for the extention and treating it like the Signature
and Hash algorithms extension. It is to be enabled by default and
the user can turn it off at run time or build time.
2016-09-11 18:05:44 -07:00
a149d83bff include MAX_RSA_INT_SZ in wc_RsaKeyToPublicDer(), for 4096-bit keys 2016-09-09 16:11:56 -06:00
68e48e84fd Merge pull request #541 from toddouska/comp
detect server forcing compression on client w/o support
2016-09-09 13:00:22 -07:00
fc54c53f38 Merge pull request #543 from JacobBarthelmeh/ARMv8
ARMv8 : increase performance with SHA256
2016-09-09 10:23:44 -07:00
3ec66dd662 ARMv8 : sanity checks and change constraint type 2016-09-09 00:27:40 +00:00
bd3e40d2fc Merge pull request #542 from JacobBarthelmeh/master
verify case with unexpected input
2016-09-08 16:07:28 -07:00
f4e604dec3 verify case with unexpected input 2016-09-08 15:32:09 -06:00
0c21d76ce3 detect client not sending any compression types 2016-09-08 12:06:22 -07:00
4fb1431727 Added support for the extended master secret extension to the sniffer. 2016-09-08 11:25:02 -07:00
79af4d30e0 ARMv8 : increase performance with SHA256 2016-09-08 18:00:24 +00:00
3e80d966d2 Merge pull request #540 from dgarske/fix_noprng_nosha2
Fix to allow disabling P-RNG and SHA256 with CUSTOM_RAND_GENERATE_BLOCK
2016-09-07 16:33:32 -07:00
3aefc42f04 have TLS server side verify no compression is in list if not using compression 2016-09-07 15:28:30 -07:00
f6b786cfb5 Updated the random.h source inline comments to clarify SHA256 and RC4. 2016-09-07 09:23:43 -07:00
baebec4ca4 Merge pull request #538 from JacobBarthelmeh/ARMv8
initial ARMv8 instructions
2016-09-07 09:20:14 -07:00
a5db13cd01 detect server forcing compression on client w/o support 2016-09-07 09:17:14 -07:00
8d6ea61a4f Fix to allow disabling P-RNG and SHA256 when CUSTOM_RAND_GENERATE_BLOCK is used. Added inline documentation to describe RNG source options. Example: ./configure --enable-cryptonly --disable-hashdrbg CFLAGS="-DNO_SHA256 -DCUSTOM_RAND_GENERATE_BLOCK" 2016-09-06 16:42:53 -07:00
09b29cb1d4 ARMv8 AES: remove extra memcpy during encrypt/decrypt 2016-09-02 22:55:17 +00:00
33f24ebaa8 Merge pull request #537 from ejohnstown/ocsp-issuerKeyHash
OCSP Fixes
2016-09-02 14:57:07 -06:00
8e4ccd355c refactor ALIGN16 macro to types.h 2016-09-01 21:24:03 +00:00
0f0e0ca9a5 add extended master to example client 2016-09-01 15:17:46 -06:00
88fab67804 add extended master unit tests 2016-09-01 15:15:17 -06:00
e4f527a332 initial extended master secret support 2016-09-01 15:12:54 -06:00
5bf8806655 add wc_Sha384/512GetHash() functions 2016-09-01 15:05:27 -06:00
41912b92c6 initial ARMv8 instructions 2016-09-01 18:10:06 +00:00
963b9d4c4d OCSP Fixes
1. When using Cert Manager OCSP lookup, the issuer key hash wasn't
being set correctly. This could lead to unknown responses from lookup.
2. Default OCSP lookup callback could get blocked waiting for server
to close socket.
2016-09-01 09:58:34 -07:00
a0b02236b8 Merge pull request #527 from danielinux/master
Support for Frosted OS
2016-08-31 10:07:25 -06:00
092916c253 Merge pull request #536 from ejohnstown/dtls-sctp
DTLS over SCTP
2016-08-30 13:09:40 -07:00
e0a035a063 DTLS-SCTP Tests
1. Added a check to configure for SCTP availablility.
2. Added DTLS-SCTP to the cipher suite test.
2016-08-29 15:24:51 -07:00
de3f66b946 Merge pull request #515 from dgarske/cryptonly_static_mem
Added support for static memory with wolfCrypt
2016-08-29 15:23:28 -06:00
ddff90ea26 Fix duplicate declaration of "wolfSSL_init_memory_heap" (errors after rebase). 2016-08-29 11:50:43 -07:00
6a70403547 Fix for "not used" devId in benchmark. 2016-08-29 11:01:16 -07:00
2ecd80ce23 Added support for static memory with wolfCrypt. Adds new "wc_LoadStaticMemory" function and moves "wolfSSL_init_memory_heap" into wolfCrypt layer. Enhanced wolfCrypt test and benchmark to use the static memory tool if enabled. Added support for static memory with "WOLFSSL_DEBUG_MEMORY" defined. Fixed issue with have-iopool and XMALLOC/XFREE. Added check to prevent using WOLFSSL_STATIC_MEMORY with HAVE_IO_POOL, XMALLOC_USER or NO_WOLFSSL_MEMORY defined. 2016-08-29 10:38:06 -07:00
05a35a8332 fix scan-build warning on the simple SCTP example server 2016-08-26 20:33:05 -07:00
aed68e1c69 1. Needed to tell the client to use sctp.
2. Creating the example sockets needed the IPPROTO type.
2016-08-26 19:58:36 -07:00
46e92e0211 DTLS-SCTP example client and server
1. Update the example client and server to test DTLS-SCTP.
2. Modify the test.h functions for setting up connections to allow
for a SCTP option.
3. Update other examples to use the new test.h functions.
4. Removed some prototypes in the client header file were some functions
that should have been static to the client.c file and made them static.
2016-08-26 19:58:36 -07:00
6d5df3928f SCTP-DTLS examples
1. Added the set SCTP mode command to client and server.
2. Added a 4K buffer test case.
2016-08-26 19:58:36 -07:00
bab071f961 1. Implemented the SCTP MTU size changes for transmit.
2. Simplified the MAX_FRAGMENT size when calling SendData().
2016-08-26 19:58:36 -07:00
a6c0d4fed7 1. Added missing -DWOLFSSL_SCTP to configure.ac.
2. Don't do hello verify requests in SCTP mode.
3. Implemented the SCTP MTU size changes.
4. Simplified the MAX_FRAGMENT size when calling ReceiveData().
2016-08-26 19:58:36 -07:00
52e2f1a7ab typecasts to clear static analysis warnings on SCTP examples 2016-08-26 19:58:36 -07:00
f3dca48e99 Fix polarity on the DTLS-SCTP check. 2016-08-26 19:58:36 -07:00
7b3255b5bb 1. Simplified the IsDtlsSctpMode() check.
2. Checked IsDtlsSctpMode() to skip saving messages to retransmit and
skip retransmissions.
2016-08-26 19:57:09 -07:00
c1970434d1 simplify the SCTP options 2016-08-26 19:43:52 -07:00
b7a35eabd2 Add simple SCTP example tools 2016-08-26 19:40:50 -07:00
ebbf5ec72b add new options and accessors for SCTP 2016-08-26 19:40:50 -07:00
2d9b6cf27a added SCTP to configure.ac 2016-08-26 19:40:50 -07:00
d7ac7af4b0 Merge pull request #532 from toddouska/sb-aiaddr
make sure static analysis realizes err_sys does exit()
2016-08-26 16:29:20 -07:00
930c692598 Merge pull request #535 from toddouska/ecc521-no64
fix normal math 16bit digit_bit for all ecc sizes
2016-08-26 14:59:01 -07:00
bd312cb766 Merge pull request #533 from dgarske/dg_fixes
Fixes for HMAC/small stack heap and disable RSA warnings
2016-08-26 14:30:55 -07:00
401463a983 Merge pull request #534 from dgarske/ecc_cust_fix
Fixed issue with "wc_ecc_set_custom_curve" function and ECC test improvements
2016-08-26 14:25:15 -07:00
efabbcf305 fix normal math 16bit digit_bit for all ecc sizes 2016-08-26 13:47:53 -07:00
bf23b2f9d1 Fix issue with "wc_ecc_set_custom_curve" function not setting index as "ECC_CUSTOM_IDX". Cleanup of the ECC tests to return actual error code (when available) and make sure keys are free'd. Some trailing whitespace cleanup. 2016-08-26 12:35:47 -07:00
925e5e3484 Fixes typo issue with heap in hmac and small stack enabled. Fixed "never read" scan-build warnings with typeH and verify when RSA is disabled. 2016-08-26 10:33:01 -07:00
86e889a7fa only force exit() in all cases with gcc since we know noreturn attribute there 2016-08-26 10:20:58 -07:00
dd7f9b618d make sure static analysis realizes err_sys does exit() 2016-08-25 12:23:57 -07:00
78ca9e7716 Merge pull request #482 from dgarske/async
Asynchronous wolfCrypt RSA and TLS client support
2016-08-25 10:06:18 -07:00
07345579ec Merge pull request #531 from cconlon/distro
Add "--enable-distro" build option
2016-08-23 14:31:23 -07:00
a9278fe492 Added check for GetLength result in asn GetIntRsa function. Fixed return code in random.c for "wolfAsync_DevCtxInit" due to copy/paste error. Added RSA wc_RsaCleanup to make sure allocated tmp buffer is always free'd. Eliminated invalid RSA key type checks and "RSA_CHECK_KEYTYPE". 2016-08-23 11:31:15 -07:00
91ccf1bd86 do not enable ARC4 or sniffer in distro build 2016-08-22 15:33:45 -06:00
45c8ed1436 remove -X from ocsp stapling tests that are not external 2016-08-22 14:18:35 -06:00
ebba0efaa4 Merge pull request #528 from jrblixt/tests_api_develop
Added Functions to wolfSSL/test/api.c
2016-08-22 09:38:23 -07:00
1a94c0bbdd add distro build option 2016-08-22 10:00:37 -06:00
6f0239441b Merge pull request #530 from ejohnstown/dtls-ticket
DTLS and Session Ticket fix
2016-08-22 09:37:28 -06:00
a9935cbc28 Made changes found by Jenkins. 2016-08-19 10:23:55 -06:00
fa1989b729 fix building the new session ticket message for DTLS, take into account the additional header sizes 2016-08-18 17:51:25 -07:00
813a9b05b5 Clean up and Chris check added the changes. 2016-08-18 15:07:07 -06:00
f61c045e65 Changes to the Assert Macros used and added wolfSSL_CTX_use_certificate_buffer() 2016-08-18 10:03:33 -06:00
3d3f8c9dd3 Support for Frosted OS 2016-08-18 14:56:14 +02:00
b068eec96d added wolfSSL_CTX_SetMinVersion 2016-08-17 14:41:37 -06:00
73089200bf Merge branch 'master' of https://github.com/wolfSSL/wolfssl into tests_api_develop 2016-08-17 14:12:43 -06:00
cddc771829 Added wolfSSL_SetMinVersion 2016-08-17 14:05:37 -06:00
584733b138 Chris looked at functions added for correctness. 2016-08-17 11:27:14 -06:00
65b2b14a0f added test functions for wolfCrypt_Init and OCSP stapling v1 and v2 2016-08-17 10:32:03 -06:00
3e6be9bf2c Fix in "wc_InitRsaKey_ex" for normal math so mp_init isn't called to defer allocation. 2016-08-15 14:07:16 -06:00
17a34c5899 Added asynchronous wolfCrypt RSA, TLS client and Cavium Nitrox V support. Asynchronous wolfSSL client support for "DoServerKeyExchange", "SendClientKeyExchange", "SendCertificateVerify" and "DoCertificateVerify". Fixes for async DTLS. Refactor of the wolf event and async handling for use in wolfCrypt. Refactor of the async device support so its hardware agnostic. Added Cavium Nitrox V support (Nitrox tested using SDK v0.2 CNN55XX-SDK with new configure "--with-cavium-v=/dir" option). Moved Nitrox specific functions to new port file "port/cavium/cavium_nitrox.c". RSA refactor to handle async with states. RSA optimization for using dpraw for private key decode. Use double linked list in wolf event for faster/cleaner code. Use typedef for wolf event flag. Cleanup of the async error codes. wolfCrypt test and benchmark support for async RSA. Asynchronous mode enabled using "./configure --enable-asynccrypt". If no async hardware is defined then the internal async simulator (WOLFSSL_ASYNC_CRYPT_TEST) is used. Note: Using async mode requires async.c/h files from wolfSSL. If interested in using asynchronous mode please send email to info@wolfssl.com. 2016-08-15 13:59:41 -06:00
5347e32d63 Merge pull request #526 from toddouska/fm64-types
don't setup 64bit typedef with fastmath if not needed
2016-08-15 13:14:59 -06:00
d1d6571575 Merge pull request #525 from toddouska/session
add resume session string script check, make GetDeepCopySession stati…
2016-08-15 13:11:53 -06:00
527c375884 don't setup 64bit typedef with fastmath if not needed 2016-08-15 11:02:06 -07:00
d74fa8299a add resume session string script check, make GetDeepCopySession static local and check reutrn code 2016-08-15 09:32:36 -07:00
b38218a0b9 Merge pull request #524 from kaleb-himes/certs-buffs-and-tests
cert updates, new buffers, new test with buffers
2016-08-14 08:39:37 -07:00
da18e463ed remove constraints on inclusion of certs_test.h 2016-08-12 17:00:22 -06:00
03295ec6d7 update certs, extend ntru to 1000 days, add der formatted ecc, new ecc buffer test
changes from first review

move to 256 bit defines
2016-08-12 13:00:52 -06:00
7cf13f84b7 Merge pull request #522 from JacobBarthelmeh/master
help static analysis tools
2016-08-10 16:37:16 -07:00
b502d9dcf7 help static analysis tools 2016-08-10 14:23:27 -06:00
fd9f8125e3 Merge pull request #521 from dgarske/improve_inline_misc
Change misc.c error to warning when trying to be compiled and inline enabled
2016-08-09 13:09:20 -06:00
a8b2ced588 Merge pull request #519 from dgarske/fix_compat_wo_ecc
Fix for openssl compatibility without ECC
2016-08-08 13:46:58 -07:00
317a7f2662 Change misc.c error to warning and exclude the misc.c code from being compiled. Most people include all .c files and by default inlining is allowed, which in turn causes an #error in misc.c and it must be excluded. Since we know its already been properly included there is no reason to throw error here. Instead, show warning and exclude code in .c file. 2016-08-08 13:13:59 -07:00
b0e4acaac1 Fix for openssl compatibility without ECC. Disable "wolf_OBJ_nid2sn", "wolf_OBJ_sn2nid" and "wolf_OBJ_obj2nid" when "OPENSSL_EXTRA" defined and "HAVE_ECC" is not defined. 2016-08-08 10:29:58 -07:00
76e8438059 Merge pull request #518 from dgarske/fix_build_w_callbacks
Fix build with "WOLFSSL_CALLBACKS" defined.
2016-08-06 10:11:53 -07:00
49fb0d56b0 Merge pull request #516 from dgarske/fix_asn_wo_hmac
Fix build issue with ASN enabled and no HMAC
2016-08-06 10:07:00 -07:00
c8cfe1ffa1 Merge pull request #511 from dgarske/openssl_compat_fixes
Various improvements to support openssl compatibility
2016-08-06 09:59:31 -07:00
dd03af2cf4 Merge pull request #512 from dgarske/fix_crl_pad
Fixed issue with CRL check and zero pad
2016-08-06 09:56:59 -07:00
cc462e2c50 Merge pull request #513 from kojo1/Der2Pem
Adds "wc_DerToPem" CRL_TYPE support
2016-08-05 14:35:15 -07:00
d8c63b8e66 Various improvements to support openssl compatibility.
* Fixed bug with "wolfSSL_get_cipher_name_internal" for loop using incorrect max length for "cipher_name_idx" (this caused fault when library built with NO_ERROR_STRINGS and calling it).
* Adds new "GetCipherNameInternal" function to get cipher name using internal "cipherSuite" index only (for scenario where WOLFSSL object does not exist).
* Implements API's for "wolf_OBJ_nid2sn" and "wolf_OBJ_sn2nid". Uses the ecc.c "ecc_sets" table to locate NID (ECC ID and NID are same).
* Added "WOLFSSL*" to HandShakeInfo.
* Allowed "SetName" to be exposed.
* Added "wolfSSL_X509_load_certificate_buffer". Refactor "wolfSSL_X509_load_certificate_file" to use new function (no duplicate code).
2016-08-05 14:15:47 -07:00
32b0303beb Fix build with "WOLFSSL_CALLBACKS" defined. 2016-08-05 14:06:58 -07:00
6b1ff8e9d7 Only try and return serial number or check padding if the serial number size is greater than 1. 2016-08-05 12:53:26 -07:00
a17bc2a42e Fix build issue with ASN enabled and no HMAC (missing MAX_DIGEST_SIZE). Switch to using WC_MAX_DIGEST_SIZE from hash.h, which is always available. Added small stack option for digest in MakeSignature. Fixed build error with unused "testVerifyCount" if "NO_ECC_SIGN" or "NO_ECC_VERIFY". 2016-08-05 12:19:30 -07:00
eeb506b8c0 Merge pull request #514 from dgarske/fix_arm_cc_warn
Fixes for warnings when cross-compiling with GCC ARM.
2016-08-05 10:07:32 -07:00
96da2df7ec Additional max index and serial number size checks in "GetSerialNumber". 2016-08-03 17:04:44 -07:00
2c1309ffc7 Fixes for warnings when cross-compiling with GCC ARM. 2016-08-03 16:53:53 -07:00
e01dcb671d eliminate tail nl 2016-08-03 11:12:10 +09:00
ed4cd2438f CRL_Type to wc_DerToPem 2016-08-03 10:53:54 +09:00
9ddfe93c43 Fixed issue with CRL check and zero pad (the GetRevoked function was not trimming pad). Added new ASN "GetSerialNumber" function and implemented it in three places in asn.c. 2016-08-02 16:47:21 -07:00
67d607324a Merge pull request #509 from JacobBarthelmeh/Release
prepare for release 3.9.8
2016-07-28 18:47:39 -07:00
32c0b6d97a prepare for release 3.9.8 2016-07-28 15:46:45 -06:00
dcc0f87ce6 Merge pull request #506 from toddouska/del_point
fix remaining non fpecc ecc_del_point w/o heap
2016-07-27 18:54:46 -06:00
303561c1a1 Merge pull request #505 from toddouska/timing
fix scan-build warning on ecc memory alloc failure
2016-07-27 15:52:01 -07:00
a94f34c8e2 fix remaining non fpecc ecc_del_point w/o heap 2016-07-27 14:24:34 -07:00
6cd4acbdba Merge pull request #504 from dgarske/oid_unknown_fix
Fix for "OID Check Failed"
2016-07-27 14:16:04 -07:00
20c991717f Merge pull request #503 from JacobBarthelmeh/mysql
change priority of cipher suite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
2016-07-27 12:13:47 -07:00
7cf0b8fe85 fix scan-build warning on ecc memory alloc failure 2016-07-27 11:20:08 -07:00
b0e72dd692 Fix for "OID Check Failed". This restores behavior to what it was prior to commit "7a1acc7". If an OID is not known internally skip the verify and return success and the OID sum. 2016-07-27 10:39:42 -07:00
37b84abe0b change priority of cipher suite TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 2016-07-27 09:36:16 -06:00
c834216cca Merge pull request #501 from ejohnstown/key-usage
only check server's cert key encipher on client for RSA key exchange
2016-07-26 15:45:38 -07:00
0265b0f4bb only check server's cert key encipher on client for RSA key exchange 2016-07-26 13:32:54 -07:00
993838153e Merge pull request #487 from moisesguimaraes/fix-ocspstapling-getca
fixes ocsp signer lookup in the cert manager.
2016-07-26 12:42:47 -07:00
edbec4db20 Merge pull request #500 from dgarske/ocsp2_asn_fix
Fix for failing OID check with "ocspstapling2" enabled
2016-07-26 12:41:50 -07:00
242d26eba2 Merge pull request #488 from cconlon/sig_algo
leave off SHA1-RSA/ECDSA signature algorithms when NO_OLD_TLS is defined
2016-07-26 11:05:24 -07:00
c80f1805f0 Fix for failing OID check with "ocspstapling2" enabled. Found OID type in "ToTraditional" that should be keyType, not sigType. Added optional OID decode function and optional OID info dump in "GetObjectId" (both off by default). 2016-07-26 10:35:40 -07:00
5bb250583e Merge pull request #499 from toddouska/timing
add --enable-harden swtich for timing resistance and blinding, on by …
2016-07-26 10:14:20 -07:00
fc6a5c0702 fix mcapi w/o harden 2016-07-26 09:06:46 -07:00
a274386693 fix user rsa no error codes? 2016-07-25 19:19:46 -07:00
51042e166f fix mcapi with blinding API addition 2016-07-25 15:57:38 -07:00
cd5486a4e6 fix user_rsa with blinding API addition 2016-07-25 15:33:28 -07:00
ea683f493a Merge pull request #498 from kaleb-himes/cert-updates
update certs pre-release: NTRU certs expired in mid june
2016-07-25 15:19:34 -07:00
16336e37ec fix blinding with fips 2016-07-25 13:47:53 -07:00
88f847de90 add --enable-harden swtich for timing resistance and blinding, on by default 2016-07-25 13:24:36 -07:00
4121667586 update certs pre-release: NTRU certs expired in mid june 2016-07-25 13:05:52 -06:00
096e3f9b8b Merge pull request #496 from JacobBarthelmeh/staticmemory
add helper functions for choosing static buffer size
2016-07-21 16:17:34 -07:00
e8f7d78fc4 add helper functions for choosing static buffer size 2016-07-21 12:11:15 -06:00
b81e687bf3 Merge pull request #490 from JacobBarthelmeh/master
Static Memory Fixes
2016-07-20 20:27:03 -07:00
8f2af608a7 Merge pull request #492 from JacobBarthelmeh/staticmemory
set heap hint for ctx
2016-07-20 20:25:38 -07:00
e920e6cee0 Merge pull request #495 from toddouska/rng-redef
fix WC_RNG redeclare
2016-07-20 19:22:08 -07:00
2c92fee59f fix WC_RNG redeclare 2016-07-20 17:18:58 -07:00
b265666174 Merge pull request #491 from toddouska/rsab-fixes
fix rsablind other builds
2016-07-20 15:22:19 -07:00
81526f8384 move wolfSSL Get RNG out of ifdef in header 2016-07-20 11:35:57 -07:00
1b980867d6 fix rsablind other builds 2016-07-20 11:35:57 -07:00
5d8a78be30 set heap hint for ctx 2016-07-20 11:47:36 -06:00
1f5b6d4e66 sanity check on buffer size 2016-07-20 11:44:22 -06:00
01ecc64052 avoid race condition with IO and handshake counter 2016-07-20 11:44:22 -06:00
17207ff61b account for when FreeHandshakeResources is not called 2016-07-20 11:44:22 -06:00
8423ad0e96 Merge pull request #493 from dgarske/ecc_fixes
ECC fixes with Shamir disabled
2016-07-20 10:40:14 -07:00
e0f2bbd1b4 Added comment about why 0's test is disabled. ECC without Shamir fails with fast or normal math. 2016-07-19 19:12:45 -07:00
5e2502fa95 ECC without Shamir has issues testing all zero's digest, so disable this test if not using Shamir method. Fixed comment about "NO_ECC_SECP". 2016-07-19 14:34:32 -07:00
7a419ba6d8 Merge pull request #472 from dgarske/ecc_brainpool_koblitz
ECC and TLS support for all SECP, Koblitz and Brainpool curves
2016-07-19 11:44:53 -07:00
bdbf972d42 Merge pull request #486 from cconlon/openssl-script
openssl.test, switch -Verify to -verify to accomodate ADH cipher suites
2016-07-19 11:38:52 -07:00
32a2bd3863 Merge pull request #489 from toddouska/rsablind
Adds WC_RSA_BLINDING for RSA Private Operations
2016-07-19 09:03:09 -07:00
f88f501923 add unique RNG missing error 2016-07-18 18:10:38 -07:00
e866b55bb7 removes fallback. 2016-07-18 22:02:41 -03:00
1c71fb4ad1 scope tmpa/b with blinding, document RSA options 2016-07-18 17:37:03 -07:00
c2b55f69fa fix 32bit mp_add_d need 2016-07-18 12:49:31 -07:00
d235a5f0cc add WC_RSA_BLINDING, wc_RsaSetRNG() for RSA Private Decrypt which doesn't have an RNG 2016-07-18 11:57:47 -07:00
d3f7ddc486 leave off SHA1-RSA/ECDSA signature algorithms when NO_OLD_TLS is defined 2016-07-15 14:32:24 -06:00
dd329ac97b fixes ocsp signer lookup in the cert manager. 2016-07-15 17:12:04 -03:00
e75642f011 openssl.test, switch -Verify to -verify to accomodate ADH cipher suites 2016-07-15 13:39:32 -06:00
c47f5f404c Merge pull request #480 from toddouska/noecho
don't echo session id on blank ticket if we're going to create a new …
2016-07-15 13:12:27 -06:00
b1de4dcbbb Merge pull request #481 from wolfSSL/fix_anon_cipher
Anonymous cipher fix
2016-07-15 13:05:32 -06:00
9a6f66a093 Merge pull request #484 from JacobBarthelmeh/master
add ARM 64bit type macro
2016-07-15 09:50:39 -07:00
aa9b1e964c Fix for possible seg fault with anonymous cipher mode enabled. Do not perform signature/verify when using anon_cipher. 2016-07-14 15:58:35 -07:00
515bf5e135 add ARM 64bit type macro 2016-07-14 15:29:32 -06:00
c7b969b5b4 don't echo session id on blank ticket if we're going to create a new ticket 2016-07-13 18:45:10 -07:00
9a9a98ac82 Merge pull request #479 from toddouska/idlen
allow bogus client sessoinID of non 32 bytes with session ticket
2016-07-13 14:57:33 -06:00
5f21f93c61 allow bogus sessionID when ticket callback rejects ticket 2016-07-13 12:47:59 -06:00
c20551cc56 Merge pull request #478 from toddouska/flatten-fix
fix rsa flatten eSz check
2016-07-13 08:50:39 -07:00
7b76c3ab36 allow bogus client sessoinID of non 32 bytes with session ticket 2016-07-13 09:47:49 -06:00
b6aefad568 Merge pull request #477 from JacobBarthelmeh/master
remove hard tabs and replace with spaces
2016-07-12 16:31:13 -06:00
7a906e47ed fix rsa flatten eSz check 2016-07-12 16:28:59 -06:00
97f60bc831 Merge pull request #476 from dgarske/fix_lpcxpresso
Fixes for LPCXpresso eclipse project
2016-07-12 15:23:09 -06:00
92341292c7 remove hard tabs and replace with spaces 2016-07-12 14:12:44 -06:00
8a20f7a909 Fix to exclude misc.c by default to eliminate #error about inline. 2016-07-12 13:07:08 -07:00
1c9f013c09 Include the .project and .cproject files in distribution. Fix issue with adding wolfssl to existing project, so the <name> is "wolfssl", not "lib_wolfssl". 2016-07-12 13:03:47 -07:00
1b149d3941 Merge pull request #474 from ejohnstown/dtls-ver
One last fix of the DTLS version numbers
2016-07-11 12:35:27 -07:00
3dc09ae0fb one last fix of the DTLS version numbers 2016-07-08 17:20:56 -07:00
24ad3f7f3e Merge pull request #473 from toddouska/ecc-timing-fix
Fix ecc timming missing variable. Fix fpecc thread local storage size with clang. Don't include comba includes if FP_SIZE is too small for index.
2016-07-08 15:08:58 -07:00
acc5389f9a Fixed possible issue with OID pointer returned from "wc_ecc_get_oid" if "HAVE_OID_ENCODING" enabled. Was previously returning static pointer, which was shared for all OID's. Now uses cache for each OID, which also improves performance on subsequent calls to the same OID. 2016-07-08 14:22:21 -07:00
19db78fc76 Moved the ECC OID's into separate static const array to reduce ecc_sets size. Added "ecc_oid_t" typedef to determine "oid" size based on HAVE_OID_ENCODING option. Reduced the encoded variable size to word16. 2016-07-08 14:15:54 -07:00
8da8c87fa4 don't include comba includes if FP_SIZE is too small for index 2016-07-08 12:29:38 -07:00
c7318c8576 fix fpecc thread local storage size with clang 2016-07-08 12:01:52 -07:00
68d66d12d6 fix ecc timming missing variable 2016-07-08 11:57:24 -07:00
7a1acc7e56 Added TLS support for all SECP and Brainpool curves. Added ECC curve specs for all Brainpool, Koblitz and R2/R3. Adds new "HAVE_ECC_BRAINPOOL", "HAVE_ECC_KOBLITZ", "HAVE_ECC_SECPR2" and "HAVE_ECC_SECPR3" options. ECC refactor to use curve_id in _ex functions. NID and ECC Id's match now. Added ability to encode OID (HAVE_OID_ENCODING), but leave off by default and will use pre-encoded value for best performance. 2016-07-07 10:59:45 -07:00
0f25ee703d Merge pull request #468 from JacobBarthelmeh/master
option to use test.h without gettimeofday
2016-07-06 18:48:18 -07:00
5fbab0e6a7 option to use test.h without gettimeofday
revert parameter passed to current_time with TIRTOS
2016-07-01 16:57:49 -06:00
00cd0a3146 Merge pull request #471 from dgarske/fixdoubleinit
Remove double call to "wolfCrypt_Init()" in test.c
2016-06-30 19:32:52 -07:00
df87ee810f Merge pull request #469 from cconlon/bug-fixes
update README with CU bug fix note
2016-06-30 19:31:58 -07:00
000f1a19e5 Merge pull request #470 from JacobBarthelmeh/Testing
sanity checks
2016-06-30 19:30:28 -07:00
dcdc28e014 Remove double call to "wolfCrypt_Init()" in test.c. Appears to have been added in static memory merge on 6/10. 2016-06-30 16:51:13 -07:00
8bba628f3f sanity check in function GetInputData and when shrinking buffer 2016-06-30 13:42:38 -06:00
f194c216c0 Merge pull request #466 from JacobBarthelmeh/mutex
free ctx in case of InitMutex fail
2016-06-30 12:05:06 -07:00
cf522314ce sanity checks 2016-06-30 11:41:22 -06:00
a2bd4719ee update README with CU bug fix note 2016-06-29 16:54:25 -06:00
3f36a914da remove cast from enum to int 2016-06-29 14:28:36 -06:00
c17830e5c7 Merge pull request #467 from dgarske/stdlib_macro_cleanup
Cleanup of stdlib function calls
2016-06-29 12:14:09 -07:00
5b3a72d482 Cleanup of stdlib function calls in the wolfSSL library to use our cross-platform "X*" style macros in types.h. 2016-06-29 11:11:25 -07:00
eb072e0344 Merge pull request #463 from JacobBarthelmeh/master
update mysql port
2016-06-28 14:56:57 -07:00
981cf9cbcb Merge pull request #462 from cconlon/bug-fixes
PemToDer Bug Fixes
2016-06-28 09:58:18 -07:00
0589fe0d39 free ctx in case of InitMutex fail 2016-06-28 09:29:28 -06:00
7da797dd4c Merge pull request #464 from wolfSSL/revert-461-bio
Revert "Bio"
2016-06-27 14:50:50 -07:00
f18ff8bfa4 update mysql patch 2016-06-27 15:44:52 -06:00
ac6635593b Revert "Bio" 2016-06-27 10:53:34 -07:00
9c7bea46d2 fix out of bounds read in PemToDer with 0 size der buffer, CU #4 2016-06-27 10:53:19 -06:00
92e501c8e4 fix possible out of bound read in PemToDer header, CU #3 2016-06-27 10:53:19 -06:00
2951e167b5 check return code of PemToDer in wolfSSL_CertManagerVerifyBuffer, CU #2 2016-06-27 10:23:22 -06:00
8fac3fffea fix possible out of bounds read in PemToDer, CU #1 2016-06-27 10:23:22 -06:00
3a18b057d7 Merge pull request #460 from dgarske/DerBufMemcpyCleanup
Cleanup of DerBuffer duplication
2016-06-24 14:51:30 -07:00
fbef3c2523 Merge pull request #461 from JacobBarthelmeh/bio
Bio
2016-06-24 14:50:52 -07:00
49934a5c91 Merge https://github.com/wolfSSL/wolfssl into bio 2016-06-24 14:22:14 -06:00
d0e832bda9 change file name from compat-wolfssl to compat-wolfcrypt 2016-06-24 19:10:39 +02:00
033f308a08 change file name from compat-wolfssl to compat-wolfcrypt 2016-06-24 19:00:39 +02:00
19da114c0c Merge pull request #454 from ejohnstown/dtls-version
DTLS Hello Verify Request Version Number
2016-06-24 08:44:55 -07:00
4215182945 fix macro error 2016-06-24 13:27:49 +02:00
0c43123a01 Fix BIO based on review 2016-06-24 10:54:58 +02:00
379af941a8 Merge pull request #459 from ejohnstown/aes-cmac-fixes
AES-CMAC Fixes
2016-06-23 22:10:26 -06:00
b0f7d819bd Cleanup of DerBuffer duplication that was using memcpy still after refractor and should be direct pointer copy. 2016-06-23 18:14:22 -07:00
ffb537c33f removed dependency on AES-NI for the AES-direct test 2016-06-23 15:34:09 -06:00
0d031fcbd7 added parameter checking to Generate and Verify 2016-06-23 15:34:09 -06:00
746ae2f4e5 Merge pull request #458 from JacobBarthelmeh/master
fix secure renegotiation build
2016-06-23 13:34:39 -07:00
0b91e000bb fix secure renegotiation build 2016-06-23 13:10:39 -06:00
02ef518a75 Merge pull request #456 from dgarske/FixEccCompKey
Fixes for ECC compressed keys
2016-06-22 14:47:42 -07:00
f6bbe845f5 Merge https://github.com/wolfSSL/wolfssl into bio 2016-06-22 09:14:53 -06:00
47c1f4e68f Fix possible use of ForceZero with NULL pointer. Improve init of "kb" when small stack disabled, so memset isn't performed twice. 2016-06-22 07:22:30 -07:00
69db94d668 Fix build error for un-initialized "kb" variable when built with fixed point cache and small stack enabled. 2016-06-22 07:06:07 -07:00
d294dc363e Fix scan-build warning with "redundant redeclaration of 'fp_isprime'". Changed "fp_isprime" and "fp_isprime_ex" to local static only. Also made "fp_gcd", "fp_lcm", and "fp_randprime" static functions. 2016-06-21 19:35:25 -07:00
1db880b6bf Fixed issue with compressed keys and custom curves. The inLen adjustment for compressed curves was only be done for built-in curves. 2016-06-21 15:55:17 -07:00
dd52af0872 ECC cleanup / fixes. Improvements to ECC with fast math enabled to avoid mp_clear on stack variables. Refactor of ECC failure cleanup (fixes possible mem leaks with small stack enabled). Refactor of "fp_is*" response checks to use FP_YES or FP_NO. Pulled libtom enhancement/cleanup of fp_isprime. Fix for compressed keys import with custom curves (still having some issues though). 2016-06-21 15:27:51 -07:00
aa1a405dd1 Fixes for compressed keys. Fix to fast math "mp_cnt_lsb" to return proper value, which fixes "mp_jacobi", which fixes "mp_sqrtmod_prime", which fixes compressed keys for 224-bit key. Removed workarounds for compressed keys. Added new configure option "--enable-compkey". Fixed issue with normal math and custom curves where "t2" could be free'd and used. Fixed issue with mp_dump in integer.c, with not allocating correctly sized buffer for toradix. 2016-06-21 14:06:02 -07:00
5fa80a2667 Merge pull request #455 from toddouska/version
bump dev version
2016-06-20 22:07:18 -07:00
f4473edfb1 bump dev version 2016-06-20 16:20:18 -07:00
335865a5b2 Merge pull request #447 from ejohnstown/dtls-retx
DTLS Retransmit Fix
2016-06-20 15:46:55 -07:00
79e2af8c15 Merge pull request #445 from ejohnstown/dtls-alert
DTLS bad MAC alert
2016-06-20 15:36:18 -07:00
a859cf189d Merge pull request #443 from ejohnstown/new-ccm-suite
Add cipher suite ECDHE-ECDSA-AES128-CCM
2016-06-20 15:34:55 -07:00
6d520e0da9 hello verify request handshake version number to match server hello version number 2016-06-20 11:08:45 -06:00
de4448c59b Merge pull request #452 from dgarske/fixeccscanbuildwarning
Fixes scan-build warning in ecc.c line 2208
2016-06-20 09:09:21 -07:00
3789d9913c Fixes scan-build warning "wolfcrypt/src/ecc.c:2208:6: warning: Use of memory after it is freed". This is due to a rebase issue with static memory changes after the new ECC custom curves changes. The precomp[] is init to NULL at top so cleanup can always be done at end (shouldn't be done in middle). 2016-06-18 22:35:52 -07:00
9173ecdc04 Merge pull request #450 from dgarske/NidFix
Fix for NID names on NIST prime 192 and 256 curves
2016-06-18 16:14:04 -07:00
eb1d8d5df6 Fix for NID names on NIST prime 192 and 256 curves. Cleanup of the memcpy/memset in .i files to use portable names. 2016-06-17 15:59:25 -07:00
ffee1eafd9 add test_bio.txt to .getignore 2016-06-17 16:20:54 -06:00
b8e00a3448 Merge pull request #449 from moisesguimaraes/fix-ocsp-stapling-tests
fixes ocsp stapling tests ignoring CRL
2016-06-17 15:16:39 -06:00
ea71814518 Merge https://github.com/wolfSSL/wolfssl 2016-06-17 13:58:53 -06:00
e8c4950a83 Merge pull request #446 from cconlon/cleanup
Remove unimplemented function prototypes
2016-06-17 12:57:55 -07:00
4fc07a2e9e Merge pull request #415 from dgarske/customcurve-mathupdate
Support for custom ECC curves and math lib updates
2016-06-17 12:56:52 -07:00
db7aab5e37 fixes ocsp stapling tests ignoring CRL 2016-06-17 08:19:57 -03:00
16b85cee8f Merge pull request #448 from cconlon/winfix
Fix windows example echoserver
2016-06-16 18:18:32 -06:00
a7c7407406 fix windows example echoserver 2016-06-16 16:39:18 -06:00
6da166d83b Enhancement / cleanup of the "wc_ecc_make_key_ex" API so it can be used with "keysize" or "dp" and allows compatibility with existing "wc_ecc_make_key". Note: "wc_ecc_make_key_ex" was not previously public, so changing it at this point is okay. 2016-06-16 10:38:15 -07:00
d55663eaee Added ECC API's for using custom curves that are not in the "ecc_sets" list. Added wolfCrypt test to validate/demonstrate custom curve using BRAINPOOL256R1. Exposed "wc_ecc_make_key_ex" and added "wc_ecc_import_x963_ex" / "wc_ecc_import_raw_ex" API's that accept "const ecc_set_type*" for custom curve. Internally use "ECC_CUSTOM_IDX" (-1) to define custom curve is used. Added "--enable-ecccustcurves" option to configure.ac. 2016-06-16 10:09:41 -07:00
69b6ac504f Fixes for ecc heap errors after rebase. 2016-06-16 06:46:22 -07:00
8f3c56c03f Fix where the last flight was getting retransmit on timeout notification. 2016-06-15 18:44:25 -07:00
31908b7263 remove unused protos for wc_Sha384Free and wc_Sha512Free, not impmlemented by ti-hash.c 2016-06-15 11:34:29 -06:00
3fec69d3f8 remove unused proto for wc_SetCertificatePolicies 2016-06-15 10:50:41 -06:00
237193fdee Fixed scan-build warning about "len" being used un-initialized in ecc_mul2add. Cleanup of the "mu" variable handling. 2016-06-15 08:41:51 -07:00
7c5483ba0b Performance improvements in fp_mulmod, fp_submod and fp_submod to handle ALT_ECC_SIZE better. Revert fp_clear to fp_add_d, since it isn't required and slows it down. 2016-06-15 08:41:51 -07:00
5703e5eadb ECC changes to support custom curves. Added new "WOLFSSL_CUSTOM_CURVES" option to support non-standard ECC curves in ecc_is_point and ecc_projective_dbl_point. Refactor to load and pass curve "a" parameter down through ECC functions. Relocated mp_submod and added mp_addmod. Refactor to pass mp variable directly (not pointer) for montgomery variable. Fix in mp_jacobi to also handle case of a == 0. Cleanup of *_ecc_mulmod and wc_ecc_make_key_ex error handling. Cleanup of ecc_map for handling normal, fast and alt_ecc math for optimization of performance and allowing reduced ecc_size. 2016-06-15 08:41:51 -07:00
bb17bac018 Updated the naming for the ECC curve sets. Additional comments for each curve parameter. 2016-06-14 16:56:22 -07:00
87c00eb3f3 Math updates from libtom. Fixes in mp_read_radix for to include char 36 and clear the destination before checks. Fix to clear tmp value on fp_sub_d and fp_add_d. Fixes in assembly for x86-32 INNERMUL, PPC32 INNERMUL and PROPCARRY and x86-64 SQRADD. Added mp_isneg. Refactor of mp_iszero, mp_iseven, mp_isodd and mp_isneg to check using MP_YES or MP_NO. Changed fp_read_unsigned_bin "b" arg to const. Removal of the "register" on stack variables to let compiler determine best optimization. 2016-06-14 16:56:22 -07:00
7a3cb23af9 Merge pull request #444 from JacobBarthelmeh/master
prepare for version 3.9.6
2016-06-14 15:51:01 -07:00
35f43f9216 In DTLS, if a mac or decrypt error is detected, just drop the datagram and don't send an alert 2016-06-14 14:36:08 -07:00
03de8e3464 prepare for version 3.9.6 2016-06-14 14:35:12 -06:00
2f9c9b9a22 Add cipher suite ECDHE-ECDSA-AES128-CCM
1. Added the usual cipher suite changes for the new suite.
2. Added a build option, WOLFSSL_ALT_TEST_STRINGS, for testing
   against GnuTLS. It wants to receive strings with newlines.
3. Updated the test configs for the new suite.

Tested against GnuTLS's client and server using the options:

    $ gnutls-cli --priority "NONE:+VERS-TLS-ALL:+AEAD:+ECDHE-ECDSA:+AES-128-CCM:+SIGN-ALL:+COMP-NULL:+CURVE-ALL:+CTYPE-X509" --x509cafile=./certs/server-ecc.pem --no-ca-verification -p 11111 localhost
    $ gnutls-serv --echo --x509keyfile=./certs/ecc-key.pem --x509certfile=./certs/server-ecc.pem --port=11111 -a --priority "NONE:+VERS-TLS-ALL:+AEAD:+ECDHE-ECDSA:+AES-128-CCM:+SIGN-ALL:+COMP-NULL:+CURVE-ALL:+CTYPE-X509"

To talk to GnuTLS, wolfSSL also needed the supported curves option
enabled.
2016-06-13 14:39:41 -07:00
2752f3f9c9 Merge pull request #442 from toddouska/mcapi-aes
fix mcapi aes size with heap
2016-06-11 12:52:59 -07:00
02985b16ac fix mcapi aes size with heap 2016-06-11 09:29:20 -07:00
a156cedabc Merge pull request #435 from JacobBarthelmeh/staticmemory
Staticmemory
2016-06-10 17:03:49 -07:00
707714dd38 threaded fixes with static memory 2016-06-10 15:35:02 -06:00
3d3591a227 typdef gaurd / error out on bad mutex init / handle no maxHa or maxIO set 2016-06-10 14:13:27 -06:00
cbefaef6bc Merge pull request #440 from toddouska/output-size
Output size
2016-06-10 11:33:31 -06:00
2bda6c6449 16 byte aligned static memory 2016-06-10 11:15:54 -06:00
620ea41191 Merge pull request #439 from kaleb-himes/update-cert-buffers
update certificate buffers per github issue #422
2016-06-10 10:08:25 -06:00
dede05db9e Merge pull request #441 from dgarske/time_base64enc
Public "wc_GetTime" API and "configure --enable-base64encode"
2016-06-10 08:47:08 -07:00
ea3d1f8e17 extended method function 2016-06-09 23:41:51 -06:00
b3068ffef5 Added new public "wc_GetTime" API for getting seconds from the asn.c XTIME. Added new "./configure --enable-base64encode" to enable Base64 encoding (now enabled by default for "x86_64"). 2016-06-09 16:26:39 -07:00
6551c9fcab add getter for max output size 2016-06-09 14:51:07 -07:00
76d960c4c0 update certificate buffers per github issue #422 2016-06-09 13:47:33 -06:00
7943f68f2a run allocation tool on ocsp and check for mallocs 2016-06-09 12:03:28 -06:00
367b519407 Merge pull request #424 from kojo1/MDK5
updated MDK5 projects
2016-06-09 10:47:04 -07:00
8be5409bc5 static method func / ocsp callbacks / heap test / alpn free func / remove timing resistant constraint 2016-06-09 11:36:31 -06:00
664d2190ba session ticket extension fix with static memory heap hint 2016-06-08 10:50:20 -06:00
a2d7ba0dd9 add output size getter 2016-06-08 09:32:34 -07:00
e214086dce tlsx with static memory / account for session certs size 2016-06-08 09:18:43 -06:00
c48db891d1 Merge pull request #433 from ejohnstown/aes-cmac
Aes cmac
2016-06-07 16:48:46 -07:00
c1c1990247 Merge pull request #437 from tisb-vikram/master
Enable ECC features for TI devices
2016-06-07 16:00:20 -07:00
57675dc51d add ALT_ECC_SIZE for TI build to reduce memory usage 2016-06-07 14:05:35 -07:00
738373038b clean up staticmemory with crl 2016-06-06 17:50:54 -06:00
e1edadafe1 ocsp with static memory, remove unused function 2016-06-06 16:19:33 -06:00
9f7e8a6f4b Merge pull request #436 from JacobBarthelmeh/master
fix index to check for sperator value
2016-06-06 14:52:20 -07:00
4ba77a7059 add HAVE_SUPPORTED_CURVES to TI-RTOS wolfSSL configuration 2016-06-06 13:50:14 -07:00
db90594909 adjust pointer cast, ssl rng with fips and unused param 2016-06-06 14:32:49 -06:00
e085be9485 fix index to check for sperator value 2016-06-06 10:34:35 -06:00
a25df5b78e Merge pull request #434 from toddouska/crlbuffer
add wolfSSL and wolfSSL_CTX LoadCRLBuffer()
2016-06-06 09:01:25 -07:00
38d5480256 Merge pull request #432 from JacobBarthelmeh/DTLS-MultiCore
import / export of peer connection information
2016-06-06 08:51:24 -07:00
2feee8856e revise static memory and update heap hint 2016-06-04 19:03:48 -06:00
104ff12e76 add staticmemory feature 2016-06-04 19:01:23 -06:00
3f205d19f4 add wolfSSL and wolfSSL_CTX LoadCRLBuffer() 2016-06-03 15:13:16 -07:00
d05754f9db Merge pull request #404 from moisesguimaraes/wolfcrypt-py
wolfcrypt Python wrapper
2016-06-03 08:24:12 -07:00
7f71c526f6 adds python3 support 2016-06-03 10:37:41 -03:00
6736ffe10e adds links to wolfssl.com 2016-06-02 22:08:57 -03:00
a76291c2e2 adds tox instructions 2016-06-02 21:38:34 -03:00
046b987324 callbacks for setting and getting peer ip/port/family 2016-06-02 09:23:12 -06:00
5be916e336 Merge pull request #403 from ejohnstown/dtls-fix
when dropping a DTLS message, drop the whole datagram
2016-05-30 17:26:25 -06:00
73328ac4bc import / export of peer connection information 2016-05-26 16:26:08 -06:00
a4fa4d5253 Merge pull request #431 from JacobBarthelmeh/master
sanity checks on wolfSSL_dtls_get_peer arguments
2016-05-26 14:46:58 -07:00
806a0bbaa7 Merge pull request #430 from toddouska/sesstick_type_typo
fix dynamic type session ticket typos
2016-05-26 11:35:46 -07:00
61801e06df add benchmark for AES-CMAC 2016-05-25 16:12:19 -07:00
1b9b7f52c9 1. Reformat a couple of #ifdefs around if(dtls) checks.
2. Move fuzz update for DTLS GetRecordHeader to be like the TLS case.
3. DtlsCheckWindow only allows current epoch and last epoch.
4. ProcessReply only retransmits flight on a CCS out of sequence when
   still retaining the handshake data.
2016-05-25 15:44:06 -07:00
5e1f06ce52 sanity checks on wolfSSL_dtls_get_peer arguments 2016-05-25 10:57:00 -06:00
669cdfc357 fix dynamic type session ticket typos 2016-05-25 09:47:54 -07:00
ae093ded8f add standalone AES-CMAC generate and verify functions 2016-05-25 09:22:39 -07:00
5d67bb881e fix memory leaks 2016-05-25 17:44:31 +02:00
bb754bb46a Fix Win32 warnings 2016-05-25 13:49:06 +02:00
9bf4598772 use constant for Cmac type 2016-05-24 16:46:04 -07:00
dbfd5dffaf added parameter checks 2016-05-24 11:21:06 -07:00
b3d068dc40 Merge pull request #418 from toddouska/dyntickets
Dyntickets
2016-05-24 11:00:14 -07:00
1d675ed1e6 Fix va_copy error for Win32 build and AES-NI segfault 2016-05-24 18:17:26 +02:00
c0cbc97b06 add AES-CMAC 2016-05-23 17:50:36 -07:00
07ce928bf3 adds installation testing with vagrant 2016-05-23 21:10:44 -03:00
04d5ca41df adds --enable-Sha512 to make sure it is always present 2016-05-23 20:33:11 -03:00
9ab5ec4a36 Merge pull request #428 from dgarske/eccmathfixes
Fixed bug with "ecc_projective_add_point"
2016-05-23 11:46:54 -07:00
61f0af5cf3 Merge pull request #429 from dgarske/wolfcryptinit
Added missing wolfCrypt_Init() to wolfCrypt test application
2016-05-23 09:23:42 -07:00
ab1d6c91bf fix errors (win32, met leak) 2016-05-23 13:46:26 +02:00
99b5aa587f Fix errors (jenkins) 2016-05-23 11:11:57 +02:00
5eb7768d00 Added missing wolfCrypt_Init() to wolfCrypt tests. 2016-05-22 18:18:06 -07:00
15cd06b7ca Fixed bug with "ecc_projective_add_point" that was not protecting the case where Q == R and using the R variable directly for the result. Now if Q == R then swap P and Q and using a local x,y,z, is only required when used with ALT_ECC_SIZE. 2016-05-22 17:31:36 -07:00
7c93912f1d reject messages that are too far from the future 2016-05-22 16:10:47 -07:00
eb6153f028 Merge pull request #425 from shihrer/master
Fixed scripts/benchmark.test, replaced == with -eq
2016-05-20 14:49:43 -06:00
f369f8a434 Merge pull request #426 from jrblixt/master
Changes to date
2016-05-20 14:48:04 -06:00
ed4f67058a Merge branch 'master' of https://github.com/wolfssl/wolfssl 2016-05-20 21:51:13 +02:00
f1860d6263 Changes to date 2016-05-20 09:48:03 -06:00
fa94f5ffe9 Replaced == with -eq to fix benchmark.test scripting error 2016-05-20 09:43:30 -06:00
fcc0eb7a6a fixes install instructions 2016-05-20 03:55:57 -03:00
217ccd8b6a updated MDK5 projects for 3.9.0. Eliminated files for older versions 2016-05-20 13:32:23 +09:00
504081e602 Merge pull request #421 from ejohnstown/limit-country-code
Limit Country Name size
2016-05-19 16:05:15 -07:00
1bb5c48080 Merge pull request #423 from dgarske/bench-ecc-encrypt-decrypt
Added a benchmark for ECC encrypt/decrypt
2016-05-19 14:47:03 -07:00
c1507957c4 Added a benchmark for ECC encrypt/decrypt when enabled via "HAVE_ECC_ENCRYPT" or "--enable-eccencrypt --enable-hkdf". 2016-05-19 11:42:00 -07:00
bae0fe9b63 MakeCertReq() was not checking return codes correctly for the SetFoo()
functions.
2016-05-18 15:14:23 -07:00
5c8daa0ac6 1. SetName() should return error if country code isn't 2 bytes.
2. MakeCert() was not checking return codes correctly for the SetFoo()
    functions.
3. Added error code for invalid country code length.
2016-05-18 15:04:40 -07:00
03e6f7cca3 RFC 5280 Appendix A.1 states that the Country Name in a certificate
shall have a size of 2 octets. Restrict country name length to 2 or 0.
2016-05-18 10:39:18 -07:00
b8c0802e3c Merge pull request #414 from JacobBarthelmeh/DTLS-MultiCore
Dtls multi core
2016-05-17 17:39:18 -07:00
47a1dd8cc4 fixes install steps 2016-05-17 14:15:17 -03:00
9fe6ca3130 remove XSNPRINTF
add a full BIO client/server test
2016-05-17 17:49:30 +02:00
1b278edfd0 fix unused functions, make WOLFSSL first parameter, add comments 2016-05-16 23:48:26 -06:00
a000ee4db3 remove empty dirs 2016-05-16 22:17:09 -03:00
dc080694b4 reorder installation steps 2016-05-16 21:55:31 -03:00
2851f7d6a1 remove unnecessary dependency 2016-05-16 20:37:42 -03:00
2a0adc74a0 fixes wrapper path 2016-05-16 20:13:26 -03:00
347d80e879 removes folders from include.am 2016-05-16 15:49:32 -03:00
40cf30a13d adds .gitignore to include.am 2016-05-16 15:31:51 -03:00
4017e0f8dd fix BIO issues :
- remove unrequited tests
- fix compilations for lighty, stunned, openssh
- wc_BioGetAcceptSocket IPv4 / IPv6 support
- remove <stdio.h> from bio.h
- add NO_STDIO_FILESYSTEM for BIO_printf
- memset -> XMEMSET
- strlen -> XSTRLEN
2016-05-15 20:22:19 +02:00
d76d74d6c5 updates Linux deps on README 2016-05-15 15:08:16 -03:00
c8576566cc add public wolfSSL_dtls_export and api tests 2016-05-14 12:49:09 -06:00
185e60ad19 based on pr#316; turns isDynamic ticket off on some failure cases, move an XFREE out of a Lock that isn't required 2016-05-13 14:11:46 -07:00
1ea01a7ad8 Merge branch 'master' of https://github.com/NickolasLapp/wolfssl into dyntickets 2016-05-13 09:07:55 -07:00
3897f78073 truncated hmac export and sanity checks 2016-05-13 09:11:38 -06:00
67ab30088b Merge pull request #416 from dgarske/mathmemleakfix
Fix mem leak with fast math disabled due to recent ecc_projective_add_point changes
2016-05-12 15:23:19 -07:00
2ad9d41641 Performance improvement for fast math mp_clear to use fp_zero (memset) instead of fp_clear(ForceZero). Added new mp_forcezero function for clearing/free'ing sensitive private key data. Changed ECC and RSA to use mp_forcezero to explicitly handle private key clearing. 2016-05-12 11:50:34 -07:00
8d66ba2923 refactor export/import of cipher specs struct 2016-05-12 10:06:15 -06:00
fbf39a761a refactor export/import of key struct 2016-05-12 09:23:38 -06:00
f9ce2f2677 verify cipher suite is valid on import 2016-05-12 09:09:07 -06:00
39833768cf Merge pull request #417 from toddouska/stdio
make sure stdio.h can be swtiched off if not available
2016-05-11 14:55:05 -07:00
cc16a543dd make sure stdio.h can be swtiched off if not available 2016-05-11 10:11:25 -07:00
440956f8d4 Fixed new issue with ecc_projective_add_point not free'ing the local x, y, z if fast math was disabled. Formatting cleanup in integer.c. 2016-05-11 08:47:30 -07:00
3bff6f10e3 Merge pull request #411 from dgarske/mathfixes
Math fixes
2016-05-10 14:45:20 -07:00
8c45cb1938 add DTLS session export option 2016-05-10 13:27:45 -06:00
2fb4506922 iFixes to FP_MAX_BITS_ECC calculation. Alignment check against digit_bits is based on max ecc bits times two. If alignment check fails we add a digit_bit to make sure we have enough room. 2016-05-10 12:20:39 -07:00
9659505260 updates python docs 2016-05-09 18:46:01 -03:00
d71d0f2cb4 Fix with fast math disabled so ecc_projective_add_point uses temp local variable for x,y,z result. 2016-05-09 13:29:25 -07:00
412141198e drops 'import about' requirement 2016-05-09 15:25:18 -03:00
8f6352725a Fixed math for FP_MAX_BITS_ECC calculations. Error in alignment check. Altered non-aligned formula to be (max bits * 2) + digit, then 8-bit aligned. Cleanup of the example user_settings.h. 2016-05-09 10:34:37 -07:00
8c9b8a596a Fixed calculation of max ECC bits with ALT_ECC_SIZE defined so it only allocates what is required. For 8-bit aligned curve sizes its double the max bits. For un-aligned curves sized, like ECC521, its 521 8-bit aligned, doubled, plus digit bit. 2016-05-09 09:51:11 -07:00
44b1f98b39 Fixed issue with ALT_ECC_SIZE and default value for FP_MAX_BITS_ECC so its based on max enabled ECC curve bits. 2016-05-09 09:51:11 -07:00
880b2e454b Refactor of the ecc_projective_add_point and ecc_projective_dbl_point functions to eliminate duplicate versions. Modified new single functions to work with normal, fast and alt_ecc_size math options. Careful use of mp_clear to retain original performance. 2016-05-09 09:51:11 -07:00
fe58db2a07 Fixed typo with new "eccshamir" configure option. 2016-05-09 09:51:11 -07:00
1b602d783c Fast math correction of "sizeof" to use (). Updates to tfm and ecc comments. 2016-05-09 09:51:11 -07:00
5cbc4bdf29 Added new "WOLFSSL_DEBUG_MATH", which enables use of "mp_dump" to display information about an mp_int. 2016-05-09 09:51:11 -07:00
a4782fcf01 Fix in fast math version of ecc_projective_dbl_point to use a local for x,y,z since ecc_point fp_int's are reduced size and cause math issues with ALT_ECC_SIZE enabled. Added local stack variable cleanups for ecc_projective_add_point. 2016-05-09 09:51:11 -07:00
0ddbe0e60e Enhancement to RSA math function "_fp_exptmod" (non timing resistant version) to support WOLFSSL_SMALL_STACK, which moves the allocation of the 64 fp_int's from the stack to the heap. 2016-05-09 09:51:11 -07:00
fa5dd01001 Fixes/improvements to the wolfCrypt ECC tests. Fixed bug with sharedA/sharedB being too small when BENCH_EMBEDDED is used and curve size over 256 bit. Added error message for ECC test failures, to show the curve size used. Fix to wc_ecc_verify_hash test to use digest that is not all zeros as that doesn't work correctly for non-Shamir ECC math. Changed return code for wc_ecc_check_check so its unique. 2016-05-09 09:51:11 -07:00
a5d27853fa Fixes to fp_mul and fp_div to clear any excess digits on the destination. Added compile-time check to confirm FP_SIZE is compatible with TFM_ acceleration defines enabled. Updated comments in other places where excess digits are cleared. 2016-05-09 09:51:11 -07:00
7c3fbd7644 Fix for fp_copy() when used with ALT_ECC_SIZE so any excess digits on the destination that we didn't write to are set to zero. 2016-05-09 09:51:11 -07:00
9001036e09 Fixes memory leak in the wc_RsaFunction if failure happens when using normal math (not fast math) and RSA_LOW_MEM is not defined. 2016-05-09 09:51:11 -07:00
9f0fa7500f Added configure "--disable-eccshamir" option. 2016-05-09 09:51:11 -07:00
f438e7ac65 Fix for Fedora 32/64 2016-05-09 08:13:17 +02:00
03b571cde4 fix some bugs, add Windows support 2016-05-07 21:12:08 +02:00
ecba5161ac default copyInto static instead of dynamic 2016-05-06 13:15:21 -06:00
1c664ae710 Merge pull request #412 from cconlon/netRandom
add support for Whitewood netRandom
2016-05-06 07:31:18 -07:00
3449990374 add example netRandom config file 2016-05-05 15:34:52 -06:00
8f3e1165a1 add Whitewood netRandom client library support 2016-05-05 15:31:25 -06:00
ee21d33794 Merge pull request #407 from wolfSSL/embOS-port
embOS port
2016-05-05 13:27:27 -07:00
4df12e1bd5 Add note for users about embOS directory 2016-05-05 12:29:20 -06:00
e5f1ad5702 Merge pull request #410 from kaleb-himes/master
update version to 3.9.1
2016-05-05 10:59:05 -07:00
6b8c6cebc7 Merge pull request #409 from dgarske/rowleyfixes
Rowley Crossworks updates/fixes
2016-05-05 11:49:46 -06:00
726703e903 Added details on RTC oscillator startup delay and implemented a delay_us function. Added information about NO_INLINE and USE_SLOW_SHOW to example user_settings.h. Moved the USE_SLOW_SHA2 into the SHA512 area. 2016-05-05 09:43:11 -07:00
b0c23ceafa fixes about 2016-05-05 12:48:47 -03:00
5d1de3bb33 One file for all BIO functions in wolfcrypt
move required functions from wolfssl to wolfcrypt
add client/server tests for BIO
2016-05-05 12:58:21 +02:00
5ee0659e1b Rowley Crossworks updates/fixes. Fixed issue with the RTC init for scenario where TIF is set. Added support for HW RNG only by providing reference custom_rand_generate_block. Updated kinetis_hw.c comments about serial ports on boards. Updated the stack/heap settings. Updated the user_settings.h with a well documented and configurable reference. 2016-05-04 23:11:08 -07:00
9e9fd24d68 updates metadata; drops py26 tests 2016-05-04 21:38:27 -03:00
ca2f0af2e4 Make suggested changes from first review
Add changes to the example user settings noted by david

missed .dep files, exclude these as well

.dep files are necessary

rebase
2016-05-04 17:28:19 -06:00
3e19316f8a update version to 3.9.1 2016-05-04 16:45:51 -06:00
f9f9546d0e Merge pull request #408 from cconlon/header-fix
fix aes_asm.asm header format
2016-05-04 14:38:23 -07:00
84651e97d3 Merge pull request #405 from dgarske/memtrackdebug
Memory tracking cleanup and new debug memory option
2016-05-04 14:01:37 -07:00
41d19b49ae Remove WOLFSSL_TRACK_MEMORY 2016-05-04 14:09:45 -06:00
6e26cac686 Reworking directories and simplify README 2016-05-04 13:03:05 -07:00
822d71431e Moved mem_track.h into wolfssl/wolfcrypt. Added new WOLFSSL_DEBUG_MEMORY option. Added documentation for using mem_track and new debug memory option. 2016-05-04 10:04:38 -07:00
ab53d732ce Merge pull request #398 from JacobBarthelmeh/master
update to MYSQL compatibility
2016-05-04 09:10:39 -07:00
1b5ed7fb09 Merge pull request #406 from cconlon/starttls
fix type comparison on 32bit for starttls
2016-05-04 09:06:46 -07:00
8176c74b3e Merge branch 'embOS-port' of https://github.com/wolfssl/wolfssl into embOS-port 2016-05-04 08:57:06 -07:00
197672d4fc define KEEP_OUR_CERT to set keeping ssl certificate 2016-05-04 09:05:11 -06:00
d91ec3ce77 fix aes_asm.asm header format 2016-05-04 09:02:50 -06:00
d184f8b1aa wolfSSL embOS port Initialize
self-review complete

Removed autogenerated files
2016-05-03 17:09:55 -06:00
4b16600011 fix type comparison on 32bit for starttls, zero tmp buffer 2016-05-03 13:52:04 -06:00
b2325aad6d option to keepCert for ssl lifetime, refactor of ourCert process 2016-05-03 09:22:16 -06:00
d1ab51e10f maintain lighttpd port 2016-05-03 09:22:16 -06:00
05e56b75f6 scan-build, valgrind issues and fix issue with ExtractDate, struct tm 2016-05-03 09:22:16 -06:00
38bbd41f99 add EDH-RSA-AES256-SHA, used in one mysql test 2016-05-03 09:22:16 -06:00
bd4e8ac714 cipher name string format 2016-05-03 09:22:15 -06:00
6613ebb642 persistant X509 struct with ssl session 2016-05-03 09:22:15 -06:00
f88d82375e add function wolfSSL_ASN1_TIME_to_string 2016-05-03 09:22:15 -06:00
f19541ffe5 update to MYSQL compatibility 2016-05-03 09:22:15 -06:00
3181731404 adds docs 2016-05-03 00:49:56 -03:00
f9ab61db5d Merge pull request #402 from cconlon/starttls
use send/recv instead of write/read with STARTTLS
2016-05-02 17:19:50 -07:00
ddcf47eadd when dropping a DTLS message, drop the whole datagram 2016-05-02 15:18:08 -07:00
a94383037c use send/recv instead of write/read with STARTTLS for winsock compatibility 2016-05-02 14:36:59 -06:00
52d6fb575b Merge pull request #395 from cconlon/starttls
add STARTTLS support to example client
2016-04-29 14:24:08 -07:00
69ac477976 updates docs template 2016-04-29 16:25:53 -03:00
1efd1343ee initial docs 2016-04-29 16:13:38 -03:00
89f15f9393 Merge pull request #400 from ejohnstown/dtls-sanity-check
Fixes DTLS sanity check and bug with DTLS timeout notification deleting the peer's received msg list.
2016-04-29 11:55:40 -07:00
00737d1e82 Ensure that tmpBuff gets assigned null after free. 2016-04-29 09:45:44 -06:00
1bd65cc8a9 First version for OpenSSL BIO compatibility 2016-04-29 16:34:11 +02:00
0a1212924e Merge pull request #401 from cconlon/warning-fixes
fix visual studio code analysis warnings
2016-04-28 16:45:08 -07:00
46addfb130 move example client STARTTLS into separate funcs 2016-04-28 14:21:33 -06:00
78e62eddd7 fix visual studio code analysis warnings 2016-04-28 13:08:50 -06:00
2f05c96004 added braces to else clause for compiler warning differences 2016-04-28 11:33:29 -07:00
e0c7739fd6 fix bug with non-blocking DTLS where the stored peer messages were deleted after a timeout 2016-04-28 10:50:51 -07:00
0511c8cac8 delay check of DTLS handshake message's RH version until the handshake header check 2016-04-28 10:50:51 -07:00
7123b080ed fix issue with missing client key exchange and duplicate change cipher spec messages. 2016-04-28 10:50:51 -07:00
66d41eee36 updates python README 2016-04-28 13:36:41 -03:00
d8309ab624 adds python ignored files 2016-04-28 13:26:59 -03:00
7e661ab866 importing wolfcrypt-py repo 2016-04-28 13:20:10 -03:00
a54b0f9d0c Merge pull request #397 from lchristina26/master
VxWorks updates: add pthreads define
2016-04-26 18:17:56 -07:00
b2af02a783 Merge pull request #383 from kojo1/MDK5
fixes for MDK5 compiler
2016-04-26 16:11:59 -06:00
8f8f4129fd VxWorks updates: add pthreads define 2016-04-26 09:36:01 -06:00
ccee49978b Fix scan-build warning 2016-04-25 11:00:56 -06:00
1c9bf483ec Reorder check for thread modified in addSession. Make sure tick assigned
correctly in non dynamic case
2016-04-25 11:00:56 -06:00
5f12b4c2ae Add check to see if thread modified session in AddSession 2016-04-25 11:00:56 -06:00
5f9c1ffca6 Initial support for deep copying of session 2016-04-25 11:00:42 -06:00
f27aca0956 Remove redundant dynTicket pointer. Reorder struct for packing/alignment 2016-04-25 11:00:31 -06:00
cc56e1da48 Merge pull request #393 from JacobBarthelmeh/RSA-min
use short for RSA min key size and check casts
2016-04-22 13:56:59 -07:00
5abeeff919 add STARTTLS support to example client 2016-04-22 13:46:54 -06:00
77a9343973 use short for RSA min key size and check casts 2016-04-22 12:56:51 -06:00
1e821dbd59 Merge pull request #394 from cconlon/sigalgo
Omit NULL parameter in AlgorithmIdentifier encoding for ECDSA OIDs
2016-04-22 11:37:17 -07:00
70aa4a99a0 Merge pull request #390 from JacobBarthelmeh/ECC-min
minimum ECC key size check at TLS/SSL level
2016-04-22 11:33:43 -07:00
0eb59d5c35 Fix rand num generation on MacOS, Improve organization with tic storage 2016-04-22 10:35:44 -06:00
c8b20d9090 Add support for dynamic session tickets, add openssl.test to testuiste 2016-04-22 10:35:44 -06:00
27814ca1df omit NULL AlgorithmIdentifier parameter for ECDSA algoOID types in SetAlgoID 2016-04-21 14:32:28 -06:00
1dac3841ca change type to short for comparision and up default min size 2016-04-20 15:44:45 -06:00
86cbabf035 Merge pull request #392 from wolfSSL/aesni-update
AES-NI Update
2016-04-20 14:27:52 -07:00
ee8ec1fb1d Merge pull request #391 from JacobBarthelmeh/master
update oid value for secp160r1
2016-04-20 09:02:50 -07:00
659d6c0689 update oid value for secp160r1 2016-04-19 17:01:39 -06:00
3129bb22cd minimum ECC key size check at TLS/SSL level 2016-04-19 15:50:25 -06:00
73c830a576 Merge pull request #388 from JacobBarthelmeh/master
fix NID name in openssl compatibility
2016-04-19 13:57:33 -07:00
117231c0e3 Merge pull request #387 from JacobBarthelmeh/RSA-min
add check for min RSA key size at TLS/SSL level
2016-04-19 13:57:26 -07:00
e0a9b365cc fix NID name in openssl compatibility 2016-04-19 13:17:32 -06:00
789f346c5f follow verifyNone variable when checking key size 2016-04-19 10:23:01 -06:00
0eb57ccab0 set return error before jumping to end of function 2016-04-18 14:27:34 -06:00
0dbdc8eab0 Merge pull request #372 from dgarske/mingwfixes
MinGW fixes
2016-04-18 12:50:13 -07:00
09e4e13958 update comment about MinGW 2016-04-18 12:14:47 -06:00
e15aca4189 static and shared library with MinGW 2016-04-15 16:04:15 -06:00
3ce01192ac Merge pull request #384 from tisb-vikram/master
enable aesgcm and alpn support in TI-RTOS/WolfSSL configuration
2016-04-15 14:56:56 -06:00
72bfc2aa09 Merge pull request #382 from JacobBarthelmeh/master
build with asn disabled and opensslextra enabled
2016-04-15 10:12:52 -07:00
8cf57845ff Merge pull request #386 from JacobBarthelmeh/RSA-fix
fix check on RSA key size
2016-04-14 17:53:26 -07:00
1e766b23cf check return value of ping.test 2016-04-14 14:42:01 -06:00
c9891567e8 add check for min RSA key size at TLS/SSL level 2016-04-14 13:35:49 -06:00
4506839c6d back out last commit. it was a pain to use. 2016-04-14 11:57:42 -07:00
526606e42f added conditional assembly for the intel-format AES_NI decrypt procedures 2016-04-14 11:30:10 -07:00
5340ea0d79 fixed a missing operand swap in the AES-CBC decrypt by 6 2016-04-14 10:47:14 -07:00
f998851642 fix check on RSA key size 2016-04-14 09:33:25 -06:00
cab1ebf2d6 move MDK5 current_time to test.h 2016-04-14 18:47:16 +09:00
98dffc070a current_time in test.h 2016-04-14 18:32:33 +09:00
35c5353698 fixed current_time argument 2016-04-14 16:26:51 +09:00
6f51c2a8f8 1. Fix bad opcode mnemonics in the intel-format source listing.
2. Update the aes.c file to call both format assembly routines the same
way.
2016-04-13 16:42:58 -07:00
c34944e389 added intel-format translations of new att-format AES-NI decrypt routines 2016-04-13 16:02:18 -07:00
9781fa3dc9 relabel jump points in new code with D (decrypt) mnemonics rather than E (encrypt) 2016-04-13 15:51:19 -07:00
d0717c7b76 Merge pull request #385 from cconlon/freertos-fix
Fix typo in FREERTOS_TCP settings.h
2016-04-13 13:28:04 -07:00
57fce85531 modify AES-CBC with AESNI test to check all key sizes for each message size checked 2016-04-13 12:18:59 -07:00
13f002f186 only compile in the AES-CBC decrypt-by-size variant selected by define, default by 8 blocks at a time 2016-04-13 12:00:53 -07:00
451fd878f9 touching whitespace in assembly routines being touched right now 2016-04-13 11:48:25 -07:00
d5df119c65 fix typo in FREERTOS_TCP settings.h 2016-04-12 15:03:34 -06:00
c7ad33e5d4 enable aesgcm and alpn support in TI-RTOS/WolfSSL configuration
These macros enable the AES GCM cipher suites and application layer
protocol negotiation in the TLS layer. Adding these macros would
allow connecting to websites with higher security requirements and
also support newer web technologies like HTTP/2 but the drawback is
that they add ~2K increase in memory footprint. Applications not
requiring these features can comment the macros and rebuild the
library to get smaller footprint.

Signed-off-by: Vikram Adiga <vikram.adiga@ti.com>
2016-04-12 12:25:32 -07:00
8524afc56a 1. Rename routine AES_CBC_decrypt_ex as AES_CBC_decrypt_by8
2. Added routine AES_CBC_decrypt_by6 that does six at a time.
3. Setting HAVE_AES_DECRYPT_BY6 or _BY8 (or not setting it) selects
   the 6, 8, or 4 way version of the assembly routine.
4. Modified AES-NI decrypt test to loop checking against the test
   bolus from 1 AES block to the whole 24 blocks.
2016-04-12 10:10:55 -07:00
cfd5af341b fixed test.c compile error and server.c/client.c/ssl.c warnings with MDK5 compiler. 2016-04-12 11:05:30 +09:00
4d38813b0c Merge pull request #381 from kaleb-himes/scan-build-psk
scan-build warnings related to enable-psk, disable-asn,rsa,ecc
2016-04-11 14:52:38 -06:00
1b7cd5cb06 consolidate handling of dead assignment warnings 2016-04-11 13:39:44 -06:00
23ab4247ea build with asn disabled and opensslextra enabled 2016-04-11 11:56:30 -06:00
c6e9021732 scan-build warnings related to enable-psk, disable-asn,rsa,ecc 2016-04-11 11:13:26 -06:00
85505b99b9 Merge pull request #380 from cconlon/utasker
uTasker Port
2016-04-08 15:08:39 -07:00
7a0f8672e7 Merge pull request #375 from dgarske/stm32hashfixes
Fixes when using the STM32 with STM32F2_HASH defined.
2016-04-08 15:04:46 -06:00
698b1cc7dc update benchmark to show AES-CBC decrypt speed 2016-04-08 13:33:41 -07:00
b75dc127f3 1. Attempting to perform 8 AES-CBC decrypt operations simultaneously.
2. Added code to test large AES-CBC decrypts.
2016-04-08 11:53:40 -07:00
c6e4fb8cf8 Merge pull request #378 from JacobBarthelmeh/Testing
autoconf checks on some builds that break, macro for no server, and u…
2016-04-08 11:01:46 -07:00
993972162e MinGW fixes, server port assigning cleanup and ping test cleanup. Fixes issue with visibility detection with MinGW. The visibility.m4 script was not actually trying to call the hidden function, which caused MinGW to detect improperly that visibility was supported. Fix for bogusFile on Windows build. Fixes to build warnings for unused variable 'res' and signed/unsigned comparison for sizeof min(). Cleanup of the server side port assignment to allow use with Windows/MinGW/Cygwin. If Windows uses new GetRandomPort() function in test.h to get port in in the 49152 - 65535 range. If *nix then uses the tcp_listen returned port. Otherwise uses the default wolfSSLPort. Refactor of the ping test code to use common file and properly handle ping count differences (Windows "-c" vs. *Nix style "-n"). Workaround for MinGW and cyassl/options.h getting file permissions error. Added non-fatal compile warning if using MinGW that "strtok_s" might be missing along with a link to public domain source that can be used. 2016-04-08 11:48:14 -06:00
2aab090c8b Fixes when using the STM32 with STM32F2_HASH defined. 2016-04-08 11:39:15 -06:00
46f4be357b uTasker: add note about XTIME to settings.h 2016-04-08 11:20:58 -06:00
8d040ad41f uTasker: add initial port, WOLFSSL_UTASKER 2016-04-08 11:12:17 -06:00
255d9ecfb3 Merge pull request #377 from JacobBarthelmeh/master
add wc_EccPublicKeyToDer function
2016-04-07 12:20:05 -07:00
5b4f17545b autoconf checks on some builds that break, macro for no server, and user rsa 2016-04-06 15:36:50 -06:00
665fb3076c add trailing zero enum and correct call for export key size 2016-04-06 15:15:56 -06:00
4f8fffbc37 add wc_EccPublicKeyToDer function 2016-04-06 15:15:56 -06:00
a0cd888fbf Merge pull request #379 from JacobBarthelmeh/PSK
fix c89 build on windows
2016-04-06 14:02:55 -07:00
85a9c55048 fix c89 build on windows 2016-04-06 11:16:40 -06:00
9f86a91dbd Merge pull request #374 from dgarske/asyncfixes
Fix build issues with new async changes
2016-04-01 16:04:08 -07:00
29194bd977 Merge pull request #371 from cconlon/sniffer-fix
Extra cleanup in sniffer.c with ForceZero
2016-04-01 13:39:29 -07:00
2d4aa1bbb5 Better fix for scan-build warning regarding possible use of NULL in AddRecordHeader. Scan-build considers paths where output is set to NULL, but ssl->spec.kea is corrupted/changed, which could result in output == NULL (even though it should never happen). So added proper NULL check in SendServerKeyExchange on AddHeader to make sure output isn't NULL. 2016-04-01 12:57:33 -07:00
19f0769ec4 Fix for scan-build warning where async changes make it appear like the output buffer could be NULL (even though its not). Added NULL check on the AddRecordHeader function. 2016-04-01 10:55:01 -07:00
dd28d53cfb Fix build issues with new async changes. Fixed issue with unused args preSigSz and preSigIdx with PSK enabled and ECC + RSA disabled. Fixed issue with missing qsSz variable in DoClientKeyExchange. Fixed missing DhAgree and DhKeyGen with NO_CERTS and PSK enabled. Fixed a couple scan-build warnings with "Value stored to '' is never read". 2016-04-01 09:23:46 -07:00
2939c3ace1 add ssl_FreeZeroDecode() to sniffer.c 2016-03-31 13:25:39 -06:00
63b1282e67 Merge pull request #335 from dgarske/asynccrypt
Asynchronous crypto and wolf event support
2016-03-30 20:12:41 -07:00
4472152b18 Added new "wolfSSL_poll" which filters event queue by ssl object pointer. Changed wolfSSL_CTX_poll to support using WOLF_POLL_FLAG_PEEK flag to peek at events and return count. Removed "wolfssl_CTX_poll_peek". Switched the examples (test.h AsyncCryptPoll) to use just the WOLFSSL object and call new wolfSSL_poll. Added warning when using the "--enable-asynccrypt" option to make sure users know they need real async.c/.h files. 2016-03-30 15:15:38 -07:00
6e5b23e102 Merge pull request #370 from dgarske/stm_aes_gcm_ccm
Enhancement to the STM32F2_CRYPTO port to support AES GCM, AES CCM an…
2016-03-30 13:39:35 -07:00
ec9f10d74f extra cleanup in sniffer.c with ForceZero 2016-03-30 10:52:27 -06:00
d30f410768 Merge pull request #368 from JacobBarthelmeh/master
Check for compile of misc.c and fix disable inline
2016-03-29 17:26:55 -07:00
49e117ebb5 Merge pull request #369 from JacobBarthelmeh/Testing
if using inline do not compile misc.c in iOS XCode builds
2016-03-29 14:41:20 -07:00
e60adfc9da better naming of macro and alter misc.c check 2016-03-29 13:42:40 -06:00
2437e97d70 if using inline do not compile misc.c in iOS XCode builds 2016-03-28 17:33:38 -06:00
2733f0a7ca Merge pull request #309 from coletiv/add-tvos-target
Add tvos target to the xcode project
2016-03-28 17:29:32 -06:00
7e90e2e540 misc.c compile warning accounts for FIPS 2016-03-28 17:22:39 -06:00
2665db73a4 check for compiling misc.c when not needed 2016-03-28 16:03:15 -06:00
79a212da8d fix disable inline build 2016-03-28 14:24:12 -06:00
59a84b40c7 Merge pull request #364 from toddouska/ecc-test-free
Fixes to cleanup unnecessary ECC make key, check key and free in ECC vector item test.
2016-03-28 13:15:20 -07:00
137f477277 Merge pull request #363 from JacobBarthelmeh/master
sanity check on ssl pased to wolfSSL_set_fd
2016-03-28 11:47:22 -07:00
03765ecca7 Fixes to cleanup unnecessary ECC make key, check key and free in ECC vector item test. 2016-03-25 13:22:31 -07:00
67b4d2e2f4 case where memory is exhausted before ctx copied to ssl 2016-03-25 14:19:51 -06:00
696169634e check return value of wolfSSL_set_fd 2016-03-25 13:59:04 -06:00
190d30f336 Merge pull request #362 from dgarske/bench_rng
Added benchmark for the RNG.
2016-03-25 12:12:20 -07:00
1649af37be fix ecc curve test in normal math mode, free is needed 2016-03-25 11:33:35 -07:00
57ea1cdcd7 sanity check on ssl pased to wolfSSL_set_fd 2016-03-25 11:32:53 -06:00
5569dfe838 Fix with FIPS build and RNG_MAX_BLOCK_LEN define location. 2016-03-25 08:56:11 -07:00
f539a60a40 Adjusted the RNG benchmark to split into smaller requests of max allowed RNG size. 2016-03-25 06:59:35 -07:00
27e041246f Added benchmark for the RNG. 2016-03-24 08:42:19 -07:00
855e42b66a Merge pull request #359 from cconlon/ecc-comment
Fix wc_ecc_import_raw() comment
2016-03-24 08:21:42 -07:00
3796fc1322 Enhancement to the STM32F2_CRYPTO port to support AES GCM, AES CCM and AES-Direct (for encrypt only) using combination of software and AES HW acceleration. 2016-03-24 07:08:42 -07:00
3509ff0c73 Merge pull request #358 from JacobBarthelmeh/master
fix free of WOLFSSL_METHOD pointer on create ctx fail
2016-03-23 15:35:16 -07:00
20285bec01 fix wc_ecc_import_raw comment, public key instead of base point 2016-03-23 15:33:53 -06:00
8f8f7ac152 remove unecessary XFREE 2016-03-23 13:40:45 -06:00
2dfc7faa73 Merge pull request #355 from dgarske/EccTestCleanup
wolfCrypt ECC test improvements and code cleanup
2016-03-23 12:18:42 -07:00
18961e5620 Merge pull request #351 from dgarske/ChaChaRefactor
Refactor of the ChaCha hard coded variables
2016-03-23 12:17:23 -07:00
620e4fa5ca fix free of WOLFSSL_METHOD pointer on create ctx fail 2016-03-23 09:27:27 -06:00
d8fb4b6ee7 Merge pull request #352 from dgarske/DRBGSmallStack
Fix to reduce stack usage in the hash-based random number generator h…
2016-03-21 12:20:48 -07:00
0fc5575b8b Fixed typo with WOLFSSL_VALIDATE_ECC_IMPORT defined. Disable ECC-224 bit compressed key test since it isn't working. Cleanup in accel_fp_mul for KB_SIZE. 2016-03-18 15:41:03 -07:00
71683e23e9 Resolve 2nd unused "typeH" warning. 2016-03-18 06:27:42 -07:00
51a911c727 Merge pull request #354 from JacobBarthelmeh/master
prepare for release v3.9.0
2016-03-17 16:10:18 -07:00
0e43fca1f3 Resolve unused "typeH" warning. 2016-03-17 15:56:51 -07:00
369930238a Cleanup of the ecc_test functions to break areas into separate functions providing WC_RNG and key size. Added ECC tests by key size for all enabled curves. Added actual key size on wc_ecc_make_key for the NIST test vectors. Added ECC testing of wc_ecc_verify_hash with digests having 0's and sequence (1,2,3,...) and made sure it runs verify twice. 2016-03-17 15:31:45 -07:00
e99a5b0483 prepare for release v3.9.0 2016-03-17 16:02:13 -06:00
e1787fe160 Added "--enable-asynccrypt" option for enabling asynchronous crypto. This includes a refactor of SendServerKeyExchange and DoClientKeyExchange to support WC_PENDING_E on key generation, signing and verification. Currently uses async simulator (WOLFSSL_ASYNC_CRYPT_TEST) if cavium not enabled. All of the examples have been updated to support WC_PENDING_E on accept and connect. A generic WOLF_EVENT infrastructure has been added to support other types of future events and is enabled using "HAVE_WOLF_EVENT". Refactor the ASN OID type (ex: hashType/sigType) to use a more unique name. The real "async.c" and "async.h" files are in a private repo. 2016-03-17 13:31:03 -07:00
10e74f7200 Merge pull request #353 from dgarske/EccUnsignedSizeCheckFix
Fixed bug where mp_unsigned_bin_size returning 0 could produce a UINT…
2016-03-17 10:50:01 -07:00
19967dd264 Fixed bug where mp_unsigned_bin_size returning 0 could produce a UINT_MAX (based on -1) resulting in invalid index to an array. Added test case for this if FP_ECC is defined. 2016-03-17 09:39:10 -07:00
bda69decc1 Fix to reduce stack usage in the hash-based random number generator health tests when WOLFSSL_SMALL_STACK is defined. 2016-03-16 17:04:07 -07:00
46a01c29d8 Merge pull request #350 from JacobBarthelmeh/master
check for invalid RSA OAEP with SHA512 test case
2016-03-16 16:25:13 -07:00
2dd5efd969 sanity check for RSA key size and hash digest size 2016-03-16 15:25:52 -06:00
4c3ddac23c catch invalid test case of RSA-OAEP and fix cast 2016-03-16 14:51:25 -06:00
473ea567bd Refactor of the ChaCha hard coded variables. 2016-03-16 13:36:44 -07:00
7722c4484a Merge pull request #349 from dgarske/CobiPort
Port for Nordic nRF51 RNG, RTC and AES. Added RNG test for wc_RNG_Gen…
2016-03-16 13:36:27 -07:00
0683ecb727 Fixed FreeCRL issue with strdup memory. Added additional checks for WOLF_AES_CBC and WOLF_AES_COUNTER. Disabled memory tracker by default for wolfCrypt test and benchmark. Updated README to better document Linux Binutils LD bug workaround. 2016-03-16 09:41:19 -07:00
f0ea9d747f Fix possible positive return value for random_rng_test. Removed reference to nrf51_aes_decrypt, which is not supported, and added compile error for it. Corrected ecc_test_raw_vector return code checking. Cleanup in InitMemoryTracker. 2016-03-15 18:33:24 -07:00
bf058ef1b9 Fixed Jenkins error reports for mem_track msg, incorrect #ifdef in aes_test and ecc_test_raw_vector response code checking. Fixed C89 compliance with wc_AesSetKey. Fixed nrf_drv_rng_init response checks in RNG code. Reverted comment change in AES. Fixed nRF51 AES CBC Encrypt support. Added response code checking for nrf51_aes_set_key. 2016-03-15 17:18:03 -07:00
a38183b816 Port for Nordic nRF51 RNG, RTC and AES. Added RNG test for wc_RNG_GenerateBlock 0's check even if HAVE_HASHDRBG is enabled. Added NIST test vectors for ECC P-256, P-384 and P-521. Added helpful debug message in ECC import if issue finding ecc_sets[] for curve. Moved memory tracker into separate file and added support for it to wolfcrypt test and benchmark. Added Ed255519/Curve25519 options for granular control of sign, verify, shared secret, import and export. Added AES options for max key size (AES_MAX_KEY_SIZE), no decrypt (NO_AES_DECRYPT) and no CBC (NO_AES_CBC). 2016-03-15 13:58:51 -07:00
47491e6c22 Merge pull request #332 from JacobBarthelmeh/Certs
Certs
2016-03-14 13:24:03 -07:00
db758dc98b update test script, fall back to cert name search, fix der free 2016-03-12 09:37:32 -07:00
060e278559 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into Certs 2016-03-11 23:48:39 -07:00
154f027c54 Merge pull request #347 from dgarske/ScanBuildFix214
Address scan-build issue on build #214 after DerBuffer refactor part 2
2016-03-11 16:53:41 -07:00
81b0ccdb1a Address scan-build issue on build #214 after DerBuffer refactor part 2 (ceafb25). 2016-03-11 09:39:13 -08:00
98f40fa132 Merge pull request #345 from moisesguimaraes/remove_unnecessary_condition
remove unnecessary condition
2016-03-11 09:27:22 -08:00
2e1c1ca7f8 remove unnecessary condition 2016-03-10 23:07:36 -03:00
0171aefc65 Merge pull request #344 from JacobBarthelmeh/master
K64F RNGA register
2016-03-10 16:05:19 -08:00
1bd7de46bb Merge pull request #342 from dgarske/JenkinsFixes20160310
Fixes multiple Jenkins warnings/failures
2016-03-10 14:19:47 -08:00
3976a3e2f2 K64F RNGA register 2016-03-10 14:35:55 -07:00
80aa431689 Fixes multiple Jenkins warnings/failures. First is PickHashSigAlgo is required for client builds or if certs are enabled. Fixed scan-build warning with OCSP not recognized ForceZero as cleaning memory and using possible garbage value. Also cleaned up the OCSP functions to use struct buffer* instead of void* for clarity with a little forward declaration. 2016-03-10 09:38:11 -08:00
1435a6ce92 Merge pull request #341 from JacobBarthelmeh/master
SEP and CERTEXT, QSH debug
2016-03-10 09:36:25 -08:00
0a1871e77c Merge pull request #337 from dgarske/WarnDoubleFree
Fixes scan-build warning with "--enable-opensslextra --disable-memory"
2016-03-09 16:28:18 -08:00
6e1c5b3801 disable CERT_EXT policies check when SEP is used instead 2016-03-09 17:22:38 -07:00
49b547db08 make QSH debug compile for C89 2016-03-09 17:15:28 -07:00
ceafb25f49 Merge pull request #338 from dgarske/DerBufferRefactor2
Refactor of DerBuffer, so WOLFSSL object doesn't have to grow as a re…
2016-03-09 12:36:22 -08:00
2f060dd860 Merge pull request #312 from dgarske/LeanTls
New LeanTLS configure option
2016-03-09 10:13:00 -08:00
f17dfa5b03 Moved the x509 XFREE to outside the FreeX509 function. Internally FreeX509 is only used in two places. One is for the ssl->peerCert, which is not dynamic anyways. The second is in the ExternalFreeX509 where it calls FreeX509 if its dynamic and will XFREE there. 2016-03-09 09:15:00 -08:00
c863300805 Fixed scan-build error with possibly using a NULL pointer. 2016-03-08 09:34:56 -08:00
0f93b86b61 Fixes for PK_CALLBACKS and sniffer after DerBuffer refactor #2. 2016-03-08 08:56:14 -08:00
ce9f14f713 Refactor of DerBuffer, so WOLFSSL object doesn't have to grow as a result of additional functionality. Removed InitDer. Changed all DerBuffers to use pointer and pass pointer to DerBuffer* to AllocDer and FreeDer. Result is more efficient code and reduced WOLFSSL object size. AllocDer uses first part of the allocated buffer for the actual DerBuffer. 2016-03-08 08:56:14 -08:00
daa1cd634e Fixes scan-build warning with "--enable-opensslextra --disable-memory". Problem was different #if defines on the InitX509 and FreeX509, which caused the static analyzer to think the "x509->dynamicMemory" was always true. 2016-03-08 08:38:02 -08:00
0ed26ad262 Updated build for "leantls" to support building only the client, by splitting BUILD_EXAMPLES into 3 parts (BUILD_EXAPLE_SERVERS, BUILD_EXAMPLE_CLIENTS and BUILD_TESTS). This allows the make check to perform the external tests to validate the client only "leantls" configuration option. 2016-03-08 08:35:28 -08:00
2891939098 Remove NO_CERT and NO_CODING. Enable building of the client with leantls. 2016-03-08 08:35:28 -08:00
8e8ee45828 LeanTLS: Fixed issue with GetCA, GetCAByName and PickHashSigAlgo with HAVE_ECC, NO_RSA and NO_CERTS defined. Added new "--enable-leantls" option, which enables TLS 1.2 client only with ECC256, AES128 and SHA256 (no RSA, DH, DSA, MD4, MD5, SHA, PSK, PWD, CERTS, DES3, Error Strings, ARC4, Coding, Memory or File System). 2016-03-08 08:35:28 -08:00
375d85fe9a Merge pull request #336 from dgarske/ASNCertPolicyExtFix
Fixed bug with ASN.1 X509V3 Certificate Policy extension parsing
2016-03-08 08:59:24 -07:00
b549c81337 Fix the WOLFSSL_SEP (--enable-sep) build scenario where extCertPoliciesNb is not available. 2016-03-07 14:49:24 -08:00
05fb648747 Remove white-space. 2016-03-07 14:33:22 -08:00
9b79d8643e Added checks for total length and the cert policy OID len to make sure they don't exceed buffer. 2016-03-07 14:20:37 -08:00
dee3645c4e Fixed bug with ASN.1 X509V3 Certificate Policy extension parsing. Bug had to do with parsing when OID contains multiple items such as example 2 below. The wolfssl.com server key now contains a URL in the certificate policy "https://secure.comodo.com/CPS0", which wasn't being parsed over correctly. Also cleanup to use loop instead of duplicate code.
Example 1:
30 12
30 06 06 04 55 1D 20 00
30 08 06 06 67 81 0C 01 02 01

Result:
2.5.29.32.0
2.23.140.1.2.1

Example 2:
30 46
30 3A 06 0B 2B 06 01 04 01 B2 31 01 02 02 07
   30 2B 30 29 06 08 2B 06 01 05 05 07 02 01 16 1D 68 74 74 70 73 3A 2F 2F 73 65 63 75 72 65 2E 63 6F 6D 6F 64 6F 2E 63 6F 6D 2F 43 50 53
30 08 06 06 67 81 0C 01 02 01

Result:
1.3.6.1.4.1.6449.1.2.2.7
2.23.140.1.2.1
2016-03-07 13:40:25 -08:00
98a72a3f9d Merge pull request #334 from JacobBarthelmeh/master
update wolfssl-ntru vs project and fix warnings
2016-03-03 15:53:52 -08:00
8ca1c3935d Merge pull request #322 from ejohnstown/dtls-handshake
DTLS Handshake Update
2016-03-03 14:33:31 -08:00
c98c457b9b update wolfssl-ntru vs project and fix warnings 2016-03-03 14:35:39 -07:00
b9ecd9474c Merge pull request #330 from kaleb-himes/CID-66007-coverity
avoid dereference of null pointer if args is null
2016-03-02 18:22:07 -08:00
112cf1f0c9 fix example client help print out 2016-03-02 16:51:57 -07:00
7a599c1309 Account for not used case 2016-03-02 16:31:58 -07:00
a0f1e1e3ea Merge pull request #331 from kaleb-himes/CID-66006-coverity
Move assignment to after the null check
2016-03-02 15:23:58 -08:00
aab44eb26b adjest example server PSK plus flag 2016-03-02 15:43:17 -07:00
267dc48d95 fixs after testing : hash table, using NO_SKID, sanity check, and freeing dCert 2016-03-02 15:23:50 -07:00
d969e2ba11 automated test for trusted peer certs 2016-03-02 11:42:00 -07:00
85215cc174 clean up braces left over from local declaration of ready 2016-03-02 11:39:34 -07:00
05d2cec7c1 addition to api tests and refactor location of trusted peer cert check 2016-03-02 11:35:03 -07:00
01cd43c319 Seperate declaration and assignment per c99 standards 2016-03-02 11:31:08 -07:00
7df22ee210 Trusted peer certificate use 2016-03-02 11:22:34 -07:00
1f4ddb20df Move assignment to after the null check 2016-03-01 17:00:27 -07:00
d15dac04b8 remove unnecessary NULL assignment 2016-03-01 16:33:47 -07:00
d473452769 avoid dereference of null pointer if args is null 2016-03-01 16:21:03 -07:00
7c63ac4f6a Merge pull request #329 from dgarske/BuildErrDerBuf
Fixes build error with new DerBuffer with ASN, ECC and RSA disabled.
2016-02-26 08:44:30 -08:00
79ef8e232b Fixes build error with new DerBuffer with ASN, ECC and RSA disabled. 2016-02-26 15:39:30 +01:00
0c45a7a028 Merge pull request #317 from dgarske/DerBufferRefactor
Refactor of the DER buffer handling
2016-02-25 09:35:50 -08:00
a46fd6612b Changed CopyDecodedToX509 AllocDer error code handing to return MEMORY_E, since that is an explicitly handled case. Also resolves the issue with "warning: Value stored to 'ret' is never read". 2016-02-25 14:35:54 +01:00
f549f71912 Merge pull request #325 from kaleb-himes/CID-66016-coverity
Always execute wc_InitRsaKey if we are always going to execute wc_Fre…
2016-02-25 08:45:06 +01:00
f0b1d2fd9d Merge pull request #324 from JacobBarthelmeh/master
argument peer can be NULL when macro INADDR_ANY is NULL
2016-02-25 08:40:37 +01:00
aa7eae3294 Merge pull request #320 from moisesguimaraes/fix-ocsp-dependency-check
fixes ocsp dependency check on asn during configure.
2016-02-24 16:21:51 -08:00
16dac5597f prevent buffer overflows if sigSz > MAX_ENCODED_SIG_SZ 2016-02-24 16:08:54 -07:00
fb9697bda6 adds check for missing rsa and ecc at the same time 2016-02-24 18:57:16 -03:00
4858a65984 Always execute wc_InitRsaKey if we are always going to execute wc_FreeRsaKey 2016-02-24 14:42:07 -07:00
6ee3c0ae59 argument peer can be NULL when macro INADDR_ANY is NULL 2016-02-24 13:55:44 -07:00
1824a494d1 adds missing ENABLED_OCSP test 2016-02-24 16:45:07 -03:00
35b48250ad Merge pull request #321 from dgarske/FixCryptBenchEdCurve25519
Fixes issue with building crypt benchmark with only ED/Curve25519 ena…
2016-02-24 11:19:30 -08:00
12bb050ec9 Merge pull request #323 from JacobBarthelmeh/master
check for RSA and ECC before testing RSA signed ECC cert
2016-02-24 09:34:37 -08:00
1227db4e44 Fixed issue with not properly returning memory error in CopyDecodedToX509 after DER refactor. 2016-02-24 07:04:03 +01:00
dcfec3d2fa check for RSA and ECC before testing RSA signed ECC cert 2016-02-23 17:03:52 -07:00
143b9fda1b adds build dependency check for OCSP 2016-02-23 15:19:04 -03:00
a92d2d582f Revert "fixes ocsp dependency check on asn during configure."
This reverts commit 46ade8f03f.
2016-02-23 14:13:52 -03:00
69e00a3f97 allow dtls timeout to be 0 in the recvfrom callback, set to 0 if the handshake is done 2016-02-22 21:13:05 -08:00
f621f81fa2 1. Some DTLS code was missing an ifdef.
2. If receiving a handshake message that's already been processed,
    retransmit the previous message flight.
2016-02-22 14:08:35 -08:00
8dbef9b14b Merge pull request #318 from dgarske/BuildErrorNoFileSysWCerts
Fixes build error with NO_FILESYSTEM and !NO_CERTS
2016-02-22 12:12:24 -08:00
731e13ecf2 Fixes issue with building crypt benchmark with only ED/Curve25519 enabled with static rng missing. 2016-02-22 16:46:13 +01:00
f6fafe6738 for DTLS, retain the handshake resources until peer sends application data record 2016-02-21 21:52:38 -08:00
46ade8f03f fixes ocsp dependency check on asn during configure. 2016-02-21 20:54:45 -03:00
953a3bd01d Fixes build error with NO_FILESYSTEM and !NO_CERTS where the wolfssl/test.h load_buffer() function is passing non-existent enum value. Was renamed from CYASSL_ to WOLFSSL_. 2016-02-19 13:52:06 -08:00
3fe5ee1a7c Refactor of the DER buffer handling. Added new DerBuffer struct that includes the type and heap ptr. Added new InitDer, AllocDer and FreeDer functions. Cleanup of some missing "heap" args on XMALLOC/XFREE. In FreeDer uses ForceZero if type is private key. 2016-02-18 22:42:15 -08:00
b72c83e191 Merge pull request #315 from kaleb-himes/fix-no-sha
update for configure option --disable-sha
2016-02-16 13:08:59 -08:00
c1ef4d4521 Merge pull request #313 from kaleb-himes/master
wolfssl.com and google.com now differ in pre-reqs for external test
2016-02-16 11:05:55 -08:00
24d93c90cd update for configure option --disable-sha 2016-02-16 12:03:37 -07:00
46b34c19d0 wolfssl.com and google.com now differ in pre-reqs for external test 2016-02-15 13:30:11 -07:00
3d8f91d418 Merge pull request #302 from dgarske/EccOnlyNoSignVerify
New ECC and ASN build options for reduce build size options
2016-02-15 12:13:43 -08:00
d7d2a6f565 Merge pull request #307 from JacobBarthelmeh/PSK
New fail with no peer cert behavior and allow RSA signed ECC key certs
2016-02-12 15:27:18 -08:00
7de352a0e9 Merge pull request #311 from dgarske/FixSkipObjectIdWarn
Fixes warning with SkipObjectId defined but not used.
2016-02-12 15:04:04 -07:00
951fe0a927 Merge pull request #310 from dgarske/CustRngGenBlock
Added new CUSTOM_RAND_GENERATE_BLOCK option that allows override and …
2016-02-12 13:51:06 -08:00
a969dd8efd Fixed "error: unused function 'StoreRsaKey'" with NO_ASN_TIME and RSA enabled. 2016-02-12 13:19:58 -08:00
aeaac15682 Fixed compile errors in signature.c if ECC on but ECC sign/verify disabled. Added new NO_ASN_TIME option to reduce ASN size for space constrained or missing RTC. Added check to make sure ASN is enabled if ECC sign/verify is enabled. 2016-02-12 13:16:39 -08:00
8073024ee7 fix formatting of .conf file so ephemeral port is used 2016-02-12 13:41:30 -07:00
f328c6bdf7 Fixes warning with SkipObjectId defined but not used. 2016-02-12 12:34:22 -08:00
08c663a4ac Added new CUSTOM_RAND_GENERATE_BLOCK option that allows override and disabling of the HASHDRBG for customers who have a HW RNG they would like to use instead.
Examples:
"./configure --disable-hashdrbg CFLAGS="-DCUSTOM_RAND_GENERATE_BLOCK= custom_rand_generate_block".
OR
/* RNG */
//#define HAVE_HASHDRBG
extern int custom_rand_generate_block(unsigned char* output, unsigned int sz);
2016-02-12 11:59:51 -08:00
4872f2bc33 Added the following ECC optional config defines: HAVE_ECC_SIGN, HAVE_ECC_VERIFY, HAVE_ECC_DHE, HAVE_ECC_KEY_IMPORT and HAVE_ECC_KEY_EXPORT. Still working through issues with using ECC sign/verify with ASN disabled. Added documentation to top of ecc.c for all the ECC define options. 2016-02-12 11:07:50 -08:00
8f5cd98857 Added tvos target to the xcode project 2016-02-12 10:23:23 +01:00
3e860107f3 remove extra cert and key, plus add new test 2016-02-11 13:49:07 -07:00
1197f88c4f add psk.test script for testing 2016-02-11 09:15:04 -07:00
09f631238e Merge pull request #306 from kaleb-himes/master
correct logic to allow for static RSA if ECC and no Curves
2016-02-10 16:47:17 -08:00
49a5ea18e8 Merge pull request #303 from ejohnstown/sniffer-check
When loading a named key, check that the save buffer mallocs.
2016-02-10 13:19:59 -08:00
b0a51a22a1 Merge pull request #304 from cconlon/testh-fix
Check build_addr() arguments for NULL
2016-02-10 13:19:28 -08:00
a83ff6aada Updated the configure.ac comments about big int being used for ECC and DH. Moved the checks for ecc/asn and psk/asn until after cryptonly value is set and fixed so those checks work for normal build and are excluded for crypt only builds. 2016-02-10 13:03:53 -08:00
9defe9b42b fix warning of unused variable and adjust debug statements 2016-02-10 13:57:10 -07:00
ffe7b38409 correct logic to allow for static RSA if ECC and no Curves
use same coding standards as the rest of the libraries
2016-02-10 13:39:59 -07:00
69fc400d28 add new certs to EXTRA_DIST 2016-02-10 13:26:03 -07:00
2f74706367 allow use of RSA signed ECC key certs 2016-02-10 13:26:03 -07:00
ff7a9d9f78 option for fail on no peer cert except PSK suites 2016-02-10 13:26:03 -07:00
3293857834 check build_addr() arguments for NULL before memset 2016-02-10 10:35:48 -07:00
8d0d5a3f90 Fixes so ECC only build works. Fixes so ECC enabled with ASN disabled works and will prevent ECC sign/verify. 2016-02-10 08:53:09 -08:00
9a5938432b Merge pull request #301 from kaleb-himes/master
if connecting to google.com and using ECC need supported curves
2016-02-10 08:42:28 -08:00
bf4d6454b1 if connection to google.com and using ECC need supported curves 2016-02-09 17:06:06 -07:00
ccffee1617 When loading a named key, check that the save buffer mallocs. It calls a library function that checks the pointer, but an application of the library shouldn't depend on side effects. This fixes #300. 2016-02-09 15:17:05 -08:00
62a2efdacc Merge pull request #298 from kaleb-himes/master
Avoid unnecessary assignments in client example
2016-02-09 09:54:55 -08:00
f30ef33d8b Merge pull request #295 from JacobBarthelmeh/master
ECDHE-PSK and added cipher suites
2016-02-09 09:40:13 -08:00
66aa1da829 Merge pull request #299 from dgarske/MinGWFixes
Fixes for warnings found using MinGW
2016-02-09 09:32:18 -08:00
2e88785358 Merge pull request #282 from dgarske/WinUserSettings
Refactor of Visual Studio projects to centralize preprocessors into IDE/WIN/user_settings.h
2016-02-09 09:27:32 -08:00
014740eda0 Merge pull request #289 from dgarske/SigHashFixes
Fixes/improvements to the signature and hash wrappers:
2016-02-09 09:23:18 -08:00
2af9fb91b3 Use += approach to detect "done" in example client for external tests. Cleaner and code is smaller to accomplish same thing. 2016-02-08 19:54:22 -08:00
4ea76b8ac8 Fixes for warnings found using MinGW. Fixes for WOLFSSL_SOCKET_IS_INVALID and WOLFSSL_SOCKET_INVALID to use the SOCKET_T. 2016-02-08 15:44:22 -08:00
53162d5fc4 addjust size according to offset length and add PMS size comment 2016-02-08 15:22:49 -07:00
f6bebc1cf4 Merge pull request #297 from dgarske/RemoveExeBitOnCFiles
Removed the execute bit on all .c files
2016-02-08 14:22:05 -07:00
2e0d05f727 Fixes issues with new IDE/WIN/user_settings.h and FIPS. Fixed issue with using CYASSL_USER_SETTINGS in ctaocrypt/settings.h with FIPS by moving settings_comp.h to after user_settings.h. Fixed issue with non-existent ctaocrypt/signature.c file being included. Added the user_settings.h file to the FIPS project. 2016-02-08 12:22:20 -08:00
09615c01cc Updated the naming for the new encoding DER signature enum and function. 2016-02-08 12:04:38 -08:00
97edaf88d4 Added the new IDE/WIN/user_settings.h to the include.am file. Changed the WOLFSSL library to use macro WOLFSSL_LIB for clarity. 2016-02-08 11:28:46 -08:00
cb3a9cc348 Removed the execute bit on all .c, .h, and .cs files. 2016-02-08 09:45:31 -08:00
a607c5dcc4 Merge pull request #296 from cconlon/freescale-fix
Freescale: USER_TIME fixes, enable ECC and AES-GCM by default
2016-02-08 09:36:53 -08:00
c920e6dd30 Avoid unnecessary assignments in client example 2016-02-07 08:27:01 -07:00
d5f410523a Fixed possible memory leak on signature wrapper ASN encode and corrected the maximum header size. Added new MAX_ENCODED_HEADER_SZ which is the maximum encoded ASN header size and update asn.c to use it. Added comment about key size sanity check. Renamed wc_SignatureRsaEncode to wc_SignatureAsnEncode. 2016-02-05 16:01:42 -08:00
e031d2fa06 Removed the execute bit on all .c files. These were inadvertently set in PR #293 due to editing files through Windows VMWare shared folder. 2016-02-05 14:25:43 -08:00
fa4da43655 Freescale: remove USER_TIME after recent time fixes, enable ECC and AES-GCM by default 2016-02-05 14:09:43 -07:00
a4f1138e5b Merge pull request #293 from dgarske/WinWarnFixes
Fixes several warnings that were seeing building with Visual Studio 2…
2016-02-05 13:20:22 -07:00
244bea18b9 Merge pull request #292 from dgarske/WolfRootFindFix
Fixed bug with "ChangeToWolfRoot" that was incorrectly seeking previo…
2016-02-05 11:28:39 -08:00
25959bfb62 Merge pull request #279 from dgarske/CustRandGenSeed_OSArg
Added new CUSTOM_RAND_GENERATE_SEED_OS macro
2016-02-05 11:18:18 -07:00
3dc2e01180 warning from windows build with ECDHE-PSK and fix potential memory leak 2016-02-05 09:54:39 -07:00
be99fcff43 Fixed typo in wc_SignatureGetSize causing error. 2016-02-05 07:32:47 -08:00
ee4b8b2f10 Merge pull request #291 from kaleb-himes/master
Fixes for disabling the crypt test and benchmark. Added new "./configure --disable-crypttests" option. Added new NO_CRYPT_BENCHMARK define.
2016-02-04 17:06:59 -08:00
ae19b7a272 Merge pull request #290 from dgarske/PemPubKey_CertExt_Fixes
Public key PEM to DER fixes
2016-02-04 15:19:15 -08:00
60668be1c0 Merge pull request #285 from ejohnstown/dtls-hello
DTLS server should be able to receive multiple client hellos without …
2016-02-04 14:27:03 -07:00
faf590eb22 Fix for "warning: Value stored to 'ret' is never read". Now explicitly set SIG_TYPE_E in each case. Fixed wc_SignatureGetSize so it will return SIG_TYPE_E for unsupported type scenario. 2016-02-04 12:49:39 -08:00
bc059e12c2 Cleanup to remove trailing whitespace and convert tabs to spaces. 2016-02-04 12:31:08 -08:00
be4c400d16 Fixes for disabling the crypt test and benchmark. Added new "./configure --disable-crypttests" option. Also made sure use of both NO_CRYPT_BENCHMARK and NO_CRYPT_TEST in "./configure CFLAGS=-D" scenario work correctly. 2016-02-04 12:06:24 -08:00
2257c1dcef Fixes several warnings that were seeing building with Visual Studio 2015. Also noticed issue with "struct Options" in internal.h for the bit flags that was causing split due to type difference (byte vs. word16). 2016-02-04 11:30:48 -08:00
e63989dcfd Fixed bug with "ChangeToWolfRoot" that was incorrectly seeking previous directories where depth 2 was using ..\..\ and skipping one. This bug applied to both Win and Lin*. For example running ./server from inside examples/server would not find the wolf root. 2016-02-04 11:26:33 -08:00
2db6246abc Fixed typo with testsuite preprocessor. Added missing chacha.c, chacha20_poly1305.c, pkcs7.c and poly1305.c. Also added the IDE/WIN/user_settings.h to the project so its easy to find. 2016-02-04 11:19:51 -08:00
bf1af39027 benchmark needs a main if NO_CRYPT_BENCHMARK defined 2016-02-04 12:07:39 -07:00
7936c7a72e Merge pull request #286 from dgarske/DisableBench
Added optional define "NO_CRYPT_BENCHMARK" to allow disabling benchmark
2016-02-04 10:59:55 -08:00
d39c6a6e13 Merge pull request #287 from JacobBarthelmeh/fast-rsa
Force Zero of data when done
2016-02-04 10:59:21 -08:00
42219a327a refactor ForceZero of memory to gain performance 2016-02-04 10:31:05 -07:00
3ce64da44c ChaCha20-Poly1305 PSK cipher suites 2016-02-04 09:50:29 -07:00
5a9175a758 add cipher suite ECDHE-PSK-AES128-SHA256 and adjustments to ECDHE-PSK 2016-02-04 09:39:34 -07:00
f3399b6578 Fixes/improvements to the signature and hash wrappers:
Fixed output buffer to wc_RsaSSL_Verify so its min size is the key size (needed for inline operations).
Fixed the signature wrapper return codes when using RSA so 0 indicates success.
Fixed signature wrappers use of wc_HashGetDigestSize to return the error code result.
Changed enum wc_HashType and enum wc_SignatureType so all values always exist.
Added new "wc_HashGetOID" which returns the OID for an enum wc_HashType.
Added new "WC_SIGNATURE_TYPE_RSA_W_ENC", that adds the encoded ASN header to the digest using wc_EncodeSignature for RSA signatures.
Added new SIG_TYPE_E and HASH_TYPE_E error types for explicit reporting of sig/hash type not available.
2016-02-03 15:07:56 -08:00
a6b7c00c9c Fix so WOLFSSL_CERT_EXT can be defined without WOLFSSL_CERT_GEN. Added new WOLFSSL_PUB_PEM_TO_DER to allow the public key PEM to DER functions to be available without CERT_GEN or CERT_EXT. Fix to add NO_FILESYSTEM check around wolfSSL_PemPubKeyToDer in ssl.h. Cleanup in coding.h for the #if check. 2016-02-03 14:58:46 -08:00
d04a7e802a add ECDHE-PSK and cipher suite ECDHE-PSK-NULL-SHA256 2016-02-03 13:44:13 -07:00
d26ca17efd Merge pull request #288 from moisesguimaraes/add_python_pbkdf2_tests
adds pbkdf_pcscs12 tests
2016-02-03 11:09:28 -08:00
1ad497177a adds pbkdf_pcscs12 tests 2016-02-02 15:43:48 -03:00
dc316d13bf Merge pull request #250 from ikudriavtsev/master
Wrapping PBKDF PKCS#12 algorithm.
2016-02-02 15:40:50 -03:00
8edf38632b Merge pull request #284 from JacobBarthelmeh/DH
fixed point DH operations
2016-02-02 08:31:30 -08:00
cad6a08f10 comment for clarifying table of DH sizes 2016-02-01 17:11:01 -07:00
f84c0742ad fix clang warning about potentially unset value 2016-02-01 15:23:24 -07:00
93c54c07ea cipher suite ECDHE-ECDSA-NULL-SHA 2016-02-01 14:43:17 -07:00
dda0de4baa Added optional define "NO_CRYPT_BENCHMARK" to allow disabling benchmark code. 2016-02-01 13:04:30 -08:00
7fe73c7cbd DTLS server should be able to receive multiple client hellos without advancing state 2016-02-01 11:06:24 -08:00
d0f8132cdc forcing sensitive memory to be all zeros when done with it 2016-02-01 10:45:09 -07:00
b6017c59ba Merge pull request #275 from dgarske/WolfErrorTypo
Fixed spelling errors
2016-02-01 09:00:10 -08:00
6fd5579130 Merge pull request #281 from toddouska/math-rsa-fix
fix normal math off by one loop error in fast_s_mp_mul_high_digs
2016-01-29 16:59:36 -08:00
f8876854f4 Spelling fixes in comments and error strings (ALGO_ID_E, ASN_TIME_E and WOLFSSL_ERROR function). 2016-01-29 16:13:09 -08:00
41f7cb0482 Forgot to change the testsuite and sslSniffer projects. Now these also use the IDE/WIN/user_settings.h. 2016-01-29 15:07:03 -08:00
ebd14a657d Added signature.c to Visual Studio project files. Added new "IDE/WIN/user_settings.h" which contains all the defines for the various Windows Visual Studio projects. Moved the settings into this new file and added the WOLFSSL_USER_SETTINGS and CYASSL_USER_SETTINGS macros and include path to IDE/WIN to all project files. This allows the settings (defines) to be adjusted in a single place for Win VS. 2016-01-29 14:29:31 -08:00
3f87d28190 Merge pull request #280 from JacobBarthelmeh/master
Update ChaCha20-Poly1305 cipher suites
2016-01-29 14:12:53 -08:00
fa25e5d09d fix normal math off by one loop error in fast_s_mp_mul_high_digs 2016-01-29 13:54:41 -08:00
9a5ad356a6 fixed point DH operations 2016-01-29 10:31:49 -07:00
611e37b3e8 naming for AEAD macros and TLSX with chacha-poly 2016-01-29 09:38:13 -07:00
6856e5bbe6 Merge pull request #261 from dgarske/AsnIoCleanup
asm.c time cleanup and io.c include cleanup
2016-01-28 13:25:21 -08:00
2bc0ae05b5 Added new CUSTOM_RAND_GENERATE_SEED_OS macro to allow custom random generation, which includes the OS_Seed. Opted to create new macro instead of modifying existing CUSTOM_RAND_GENERATE_SEED. 2016-01-28 09:31:36 -08:00
fa64abd83e Fix for deleted USER_TIME gmtime forward declaration. Fix to make sure XGMTIME maps to gmtime just as previous code did. 2016-01-27 13:20:06 -08:00
7d71d756f3 update ChaCha20-Poly1305 to most recent RFCs 2016-01-27 14:03:05 -07:00
fadd97de3a Moved the forward declarations until after the struct tm and time_t have been defined. 2016-01-27 11:17:54 -08:00
3b6f2b0330 Merge pull request #274 from JacobBarthelmeh/master
Updated comments for adding new error id strings and added missing UNKNOWN_MAX_FRAG_LEN_E.
2016-01-27 09:28:56 -08:00
18f1faa13d check error strings and update comment 2016-01-27 09:50:20 -07:00
71fcc1e478 comment for adding new wolfCrypt error id strings 2016-01-26 17:12:31 -07:00
5c4a3462ee Cleanup of the time macros in asn.c to allow expanded use of wolf "struct tm", "time_t" and "gmtime". Cleanup of the io.c socket includes for clarity. Cleanup trailing spaces in io.c and asn.c. 2016-01-26 13:47:01 -08:00
02397623be Merge pull request #273 from toddouska/bump-version
bump dev version
2016-01-26 13:18:11 -08:00
ee512cac4a bump dev version 2016-01-25 13:12:45 -08:00
18c25b5d04 Merge pull request #272 from cconlon/ksdk-fixes
Update support for Freescale KSDK 1.3.0, fix Freescale+FreeRTOS build
2016-01-25 12:24:01 -08:00
0801eeac8d update support for Freescale KSDK 1.3.0 2016-01-25 10:41:26 -07:00
993ae48502 Merge pull request #271 from JacobBarthelmeh/mysql
function needed for MYSQL compatibility
2016-01-25 09:39:18 -07:00
5df55e053d function needed for MYSQL compatibility 2016-01-22 16:33:54 -07:00
e1abf5f623 Merge pull request #270 from JacobBarthelmeh/OAEP
Use type enum wc_HashType rather than int for OAEP functions.
2016-01-21 08:50:00 -08:00
63d1f81fb1 cast XMALLOC to byte pointer 2016-01-21 09:05:19 -07:00
197f25f135 use type enum wc_HashType rather than int 2016-01-20 15:31:08 -07:00
3098e09f42 Merge pull request #269 from cconlon/coverity-fix
fix recursive include in wc_port.h
2016-01-20 09:01:09 -07:00
122a67139d fix recursive include in wc_port.h 2016-01-19 14:23:47 -07:00
f84722bbac Merge pull request #267 from moisesguimaraes/fix_ocspstapling_dtls_typo
Fix ocspstapling dtls typo
2016-01-19 10:34:15 -07:00
04a1bf0086 Merge pull request #265 from toddouska/cov-tfm
fix coverity report for fp_mont reduce where m is half max size, not …
2016-01-19 10:30:09 -07:00
a7bac3ae9b Merge pull request #266 from JacobBarthelmeh/master
check not CHACHA_BYTE before considering normal suite
2016-01-18 17:55:02 -08:00
a6a2214306 removes 'end of line' spaces; 2016-01-18 20:51:27 -03:00
08c67e5cdc fixes typo; 2016-01-18 20:51:27 -03:00
33a71fb456 Merge pull request #264 from JacobBarthelmeh/OAEP
help out clang static analyzer
2016-01-18 15:31:18 -08:00
3a65f55bd3 check not CHACHA_BYTE before considering normal suite 2016-01-18 15:33:32 -07:00
04b8df09e3 Merge pull request #260 from kaleb-himes/master
system read returns ssize_t, cast to int
2016-01-18 13:55:35 -08:00
8e97145682 fix coverity report for fp_mont reduce where m is half max size, not currently called that big but let's allow 2016-01-18 13:53:01 -08:00
93e454f09a Merge pull request #259 from dgarske/UnusedParamError
Fixes unused argument build error seen on CrossWorks (Issue #255).
2016-01-18 09:40:30 -08:00
268515018d help out clang static analyzer 2016-01-18 10:22:12 -07:00
1ab9f19541 Merge pull request #256 from JacobBarthelmeh/fast-rsa
fix for size of buffer when reading fast-rsa BN data
2016-01-15 15:47:57 -08:00
71741847d3 system read return size_t, cast to int
remove whitespace
2016-01-15 16:03:45 -07:00
014b849af4 Merge pull request #258 from toddouska/no-sha384
resolve issue #257, no sha384 with wolfssl cert chain and external test
2016-01-15 13:29:06 -08:00
81d26b83c3 Merge pull request #246 from JacobBarthelmeh/OAEP
RSA OAEP padding
2016-01-15 11:34:37 -08:00
476355b5bf fix potential memory leak on fail 2016-01-14 23:58:30 -07:00
07c79f9dc3 Fixes unused argument build error seen on CrossWorks (Issue #255). 2016-01-14 21:09:01 -08:00
1d473ab7b5 resolve issue #255, no sha284 with wolfssl cert chain and external test 2016-01-14 20:25:50 -08:00
d20b8880f0 Merge pull request #254 from lchristina26/master
Fix formatting to VxWorks README
2016-01-14 16:49:13 -08:00
dec13db1e7 Merge pull request #252 from moisesguimaraes/fix_srp_build
fixes srp build without sha512
2016-01-14 15:48:39 -08:00
3347bea0d5 fix for size of buffer when reading fast-rsa BN data 2016-01-14 15:00:59 -07:00
008612ec70 OAEP w/ smallstack and fixs 2016-01-14 14:26:17 -07:00
df0d2e8c3a Merge pull request #248 from JacobBarthelmeh/CSharp
C# wrapper fixes account for null terminator. Added additional read/write overrides for byte[] data.
2016-01-14 08:46:18 -08:00
c41b5ac3d2 Fix formatting to VxWorks README 2016-01-13 10:42:30 -07:00
10df002ec5 fixes srp build without sha512 2016-01-12 15:42:58 -03:00
037f4c60ab Merge pull request #251 from ejohnstown/dtls-handshake
fix a sequence number issue with DTLS epoch 0 messages earlier in the…
2016-01-11 11:29:25 -08:00
03fd89bc45 Wrapping PBKDF PKCS#12 algorithm. 2016-01-10 10:50:02 +01:00
db1f321ae3 Merge pull request #249 from lchristina26/master
Updates for VxWorks entropy and README, Arduino functionality
2016-01-08 16:08:13 -08:00
5e0fa1de90 utf8 switched to default and added comments 2016-01-08 16:50:49 -07:00
86ddeeb110 Add steps for including wolfSSL as an Arduino library 2016-01-08 12:07:35 -07:00
ae92a41512 Update fork to upstream: Merge https://github.com/wolfSSL/wolfssl 2016-01-08 11:59:35 -07:00
f7baf9e392 settings for Arduino functionality 2016-01-08 11:54:46 -07:00
efae688120 add entropy steps for VxWorks 2016-01-08 11:43:05 -07:00
ee1a767332 account for null terminator 2016-01-07 17:39:00 -07:00
5360e22ba5 fix a sequence number issue with DTLS epoch 0 messages earlier in the handshake 2016-01-07 13:18:01 -08:00
431951a692 Merge pull request #247 from kaleb-himes/null-pointer-excptn
safeguards to avoid de-referencing a null pointer
2016-01-06 10:25:14 -08:00
38392ce56a safeguards to avoid de-referencing a null pointer 2016-01-06 10:12:52 -07:00
251550ea62 Merge pull request #242 from kaleb-himes/scan-build-fixes
avoid unused variable warnings
2016-01-05 15:31:52 -08:00
a6ca2c3bdd Avoid un-necessary cast 2016-01-05 14:32:45 -07:00
29e6f283cf Implement peer suggestion 2016-01-05 14:19:46 -07:00
ef95000236 Merge pull request #243 from kaleb-himes/scan-build-fixes2
Avoid unused variable warnings with dead store in AES_GCM_decrypt
2016-01-05 12:30:32 -08:00
db55f0f8dd Merge pull request #235 from moisesguimaraes/fix_localhost_ocsp_stapling_tests
Fixes --enable-ocspstapling and --enable-ocspstapling2 Jenkins failures
2016-01-05 12:07:43 -08:00
1a16001dac Merge pull request #245 from kaleb-himes/scan-build-fixes4
check err after set
2016-01-05 10:52:53 -08:00
1fd496a5a7 Merge pull request #244 from kaleb-himes/scan-build-fixes3
Remove unnecessary assignment prior to return
2016-01-05 15:27:26 -03:00
d815affe83 RSA OAEP padding 2016-01-05 10:56:15 -07:00
e4c4c5a73a white space change removed 2016-01-05 07:37:31 -07:00
699597bb21 execute undef before checking and return 2016-01-05 07:35:28 -07:00
3725133592 Merge pull request #240 from kaleb-himes/myStack-init-check
compiler warning about myStack use in unique environment
2016-01-04 16:45:12 -08:00
fcfef59c43 check err after set 2016-01-04 17:04:10 -07:00
21c972f805 Remove unnecessary assignment prior to return 2016-01-04 16:08:04 -07:00
023052eaf1 Avoid unused variable warnings with dead store in AES_GCM_decrypt 2016-01-04 15:40:10 -07:00
dd469bb67d avoid unused variable warnings 2016-01-04 15:03:39 -07:00
0718f4b9a3 formatting fixes for VxWorks README 2016-01-04 14:44:08 -07:00
9351f0d2e7 updates to VxWorks README 2016-01-04 14:41:31 -07:00
4834e2d5cf updates for VxWorks simulator entropy 2016-01-04 14:33:30 -07:00
15918ebd99 initialize myStack to NULL for the later check against NULL 2016-01-04 13:18:43 -07:00
858da86c05 restore original certs, without OCSP Authority Information Access; 2016-01-04 17:15:29 -03:00
e6398998b1 check for NULL after malloc in posix_memalign 2016-01-04 12:55:35 -07:00
723a7fcf90 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into myStack-init-check 2016-01-04 09:17:04 -07:00
8a47c1d01e Merge pull request #237 from kaleb-himes/32-bit-ocsp
Also account for 32-bit users with ocsp test
2016-01-04 09:33:12 -03:00
d817f0fbc8 fixes test scripts to avoid bash-isms 2016-01-04 09:27:58 -03:00
7bbd93b609 Merge pull request #239 from kaleb-himes/openx-curve-unused
Fix cases that were not detected in Jenkins
2015-12-31 18:35:03 -08:00
fa3f0660b6 compiler warning about myStack use 2015-12-31 13:59:11 -07:00
51e365541f Merge pull request #238 from toddouska/aesni-192key
fix aesni 192bit key expansion over read of 64bits
2015-12-31 12:55:28 -08:00
b78fb311bb Fix cases that were not detected in Jenkins 2015-12-31 13:18:37 -07:00
99539b8875 fix aesni 192bit key expansion over read of 64bits 2015-12-31 11:19:47 -08:00
84ae9a9ae5 Also account for 32-bit users 2015-12-31 12:05:45 -07:00
71a3555f6f Merge pull request #236 from kaleb-himes/ed-openx-unused
catching up on old jenkins issues that need fixed
2015-12-31 10:29:32 -08:00
6a56a53545 catching up on old jenkins issues 2015-12-31 09:33:01 -07:00
1bef0ba455 cosmetic changes to OCSP Stapling options. 2015-12-30 17:10:25 -03:00
5fb8ea691a updates ocsp certs with better OCSP Responder URI. 2015-12-30 16:50:22 -03:00
5040820f98 prepare for 3.8.0 release 2015-12-30 12:09:31 -07:00
2145eebd1a Merge pull request #234 from JacobBarthelmeh/master
add ocsp needed certs to dist
2015-12-30 10:51:17 -08:00
0c21b67bb6 add ocsp needed certs to dist 2015-12-30 10:19:20 -07:00
87e828bf17 Merge pull request #233 from toddouska/hint-types
fix hint types for misuse of in_buffer and out_buffer
2015-12-30 09:34:25 -07:00
71218169c1 Merge pull request #232 from kaleb-himes/master
accounts for assumptions with external ocsp stapling test
2015-12-29 18:22:11 -08:00
157486ce0d fix hint types for misuse of in_buffer and out_buffer 2015-12-29 16:13:09 -08:00
a973eca4b8 accounts for assumptions with external ocsp stapling test 2015-12-29 17:05:51 -07:00
6ba14fa241 fixes some errors from Jenkins Expected Configurations Build # 111 2015-12-29 10:19:27 -03:00
0a14e6f3c6 Merge pull request #230 from cconlon/mcp_time_fix
fix LowResTimer on Microchip ports
2015-12-28 21:56:07 -08:00
774d335387 Merge branch 'csr' 2015-12-28 19:53:27 -03:00
ec9d23a9c3 Merge branch 'csr' 2015-12-28 19:38:04 -03:00
487bb4eb5e fixes before merge 2015-12-28 19:33:06 -03:00
a9894e9033 Merge pull request #229 from ejohnstown/dtls-warnings
fix DTLS warnings for Windows
2015-12-28 14:20:03 -07:00
47426b1f8d fix LowResTimer on Microchip ports 2015-12-28 13:58:01 -07:00
2e00b12b69 updates configure.ac with better option naming. 2015-12-28 17:55:41 -03:00
91c06736cb Merge pull request #228 from kaleb-himes/typo-corrections
minor typo corrections
2015-12-28 11:56:48 -08:00
2d33380abc Merge pull request #225 from JacobBarthelmeh/master
help message to use NTRU key in example server
2015-12-28 11:56:13 -08:00
c3df8af997 Merge pull request #223 from cconlon/vswarnings
fix Visual Studio warnings
2015-12-28 11:55:13 -08:00
3a1909dab9 Merge pull request #209 from kaleb-himes/master
OpenSSH added support for additional NID types. Update our compatibil…
2015-12-28 11:52:38 -08:00
92cb8eee61 revise the comments about port 0 use in the example client and server 2015-12-24 15:42:52 -08:00
99797eb4f6 Merge pull request #227 from ejohnstown/example-comments
Example comments
2015-12-23 15:09:54 -07:00
cc8633fe7f minor typo corrections 2015-12-23 13:28:45 -07:00
4b836f8476 added note to client and server regarding port 0 2015-12-23 12:20:53 -08:00
d17549f848 update example client ShowVersions() to not show disabled old-tls versions 2015-12-23 12:12:41 -08:00
558d2566cc Merge pull request #226 from toddouska/ranports-scripts
add random ports for all make check scripts, unique ready file
2015-12-23 12:49:16 -07:00
5cbaa9de20 Merge pull request #224 from ejohnstown/windows-fips-segments
add the Windows object ordering tags to wolfCrypt first and last sources
2015-12-22 17:08:57 -07:00
22385f2b39 add random ports for all make check scripts, unique ready file 2015-12-22 14:35:34 -08:00
41f50b7a73 NTRU suites considered part of static RSA suites group 2015-12-22 15:19:11 -07:00
0721b79282 help message to use NTRU key in example server 2015-12-22 11:51:26 -07:00
44c4f18d3e fix DTLS warnings for Windows 2015-12-22 09:45:54 -08:00
cbf3213c4f correct logic on pre-processor macro 2015-12-21 23:33:33 -07:00
0cb2374c69 Ensure configured before assuming message digest is supported 2015-12-21 23:03:45 -07:00
b153ac002c fix Visual Studio warnings 2015-12-21 16:11:02 -07:00
d5295edbd1 add the Windows object ordering tags to wolfCrypt first and last sources 2015-12-21 11:01:09 -08:00
37b8e60537 Merge branch 'toddouska-hello-size' 2015-12-18 10:00:00 -07:00
4da1ae3947 Merge branch 'hello-size' of https://github.com/toddouska/wolfssl into toddouska-hello-size 2015-12-18 09:33:13 -07:00
917edc5f18 Merge pull request #218 from toddouska/ssl3-aes256
add aes256 key derivation to ssl3
2015-12-17 18:30:23 -08:00
b89354880f switch pragma once uses, causes warnings on some compilers 2015-12-17 13:19:17 -07:00
e503b89ca1 allow sniffer build with -v 0 examples to work 2015-12-17 12:10:22 -08:00
6c69b7f109 make hello suite size user settable, increase default 2015-12-17 09:57:44 -08:00
d395c5aba3 condense to one switch statement for testing of message digests 2015-12-16 11:40:58 -07:00
46c4653f60 Merge branch 'master' of https://github.com/wolfSSL/wolfssl 2015-12-16 11:37:07 -07:00
ed8a50ce69 Merge pull request #211 from lchristina26/master
GenerateSeed() Function for VxWorks compatibility
2015-12-15 15:59:20 -08:00
94b1df49ae Merge pull request #219 from JacobBarthelmeh/master
install user_rsa.h and fix leading bit function
2015-12-15 15:57:48 -08:00
3113c8db9b update VXWORKS GenerateSeed() - no printf, error return 2015-12-15 16:52:21 -07:00
1cdc6d5edb refactoring dist and install of user/fast-rsa 2015-12-15 16:09:49 -07:00
b87c7fb460 install user_rsa.h and fix leading bit function 2015-12-15 13:50:01 -07:00
eed40eb690 add aes256 key derivation to ssl3 2015-12-15 11:54:03 -08:00
b9e2ff3055 Merge pull request #217 from NickolasLapp/openssl_version_increase
Add in stub functions for opensslv1.0.1 w/ stunnel and lighttpd
2015-12-15 11:17:52 -08:00
9688a0f0db fixes API names (marketing wise); 2015-12-14 23:12:08 -03:00
a15c003211 adds extra certs for ocspstapling tests; 2015-12-14 23:02:49 -03:00
0ca6a5601e fixes OCSP_MULTI check;
adds root-ca-cert to index0.txt;
adds keyUsage to CA certs;
sets fixed serial to root-ca-cert;
2015-12-14 20:22:48 -03:00
bf621f1832 Add in stub functions for opensslv1.0.1 w/ stunnel and lighttpd 2015-12-14 15:36:04 -07:00
196b983b7b adds ocsp test scripts; 2015-12-13 18:06:08 -03:00
a834c2acf6 improved DTLS handshake sequence numbering when retransmitting finished message 2015-12-11 18:41:09 -08:00
6ab9c87f13 add comment to VXWORKS GenerateSeed() 2015-12-11 13:41:05 -07:00
e2456214f4 update random.c for better entropy with VXWORKS 2015-12-11 13:22:33 -07:00
8b99cea5c8 update README with entropy instructions 2015-12-11 13:19:44 -07:00
af4eb590a6 Merge pull request #214 from aburks/IS-213-AESFailsWithFreescaleCAU
Issue #213: AES fails with Freescale (mm)CAU
2015-12-10 17:08:52 -08:00
838c5297c3 Merge pull request #216 from aburks/IS-215-SignatureUsesOldRNG
Issue #215: Signature module uses old RNG
2015-12-10 17:08:36 -08:00
03a643cc35 Issue #215: Signature module uses old RNG. Use the new WC_RNG construct instead in order to prevent conflicts with board support packages. 2015-12-10 17:04:48 -08:00
bc54b18cad Issue #213: AES fails with Freescale (mm)CAU. 2015-12-10 16:55:49 -08:00
4f0c2177b2 Merge pull request #212 from dgarske/CleanupAsnLeadingZero
Cleanup of the leading zero detection in wc_RsaKeyToDer and wc_DsaKey…
2015-12-10 11:11:58 -08:00
89518ad445 Cleanup of the leading zero detection in wc_RsaKeyToDer and wc_DsaKeyToDer to use existing mp_leading_bit function. 2015-12-10 10:48:50 -08:00
1c4b3016e6 set required tls1_2 for when using ChaCha20-Poly1305 suite 2015-12-10 11:45:27 -07:00
5c5c7ffaec Merge pull request #210 from dgarske/CheckEccAltwFastMath
Added compile time check for ALT_ECC_SIZE requiring USE_FAST_MATH.
2015-12-10 10:24:20 -08:00
cb73064c10 format changes to VXWORKS GenerateSeed() 2015-12-09 13:22:13 -07:00
38ac17864e added entropy, wc_GenerateSeed() for VxWorks 2015-12-09 13:18:42 -07:00
1153c31bbb Added compile time check for ALT_ECC_SIZE requiring USE_FAST_MATH. 2015-12-09 09:53:59 -08:00
97dcb5e567 Merge branch 'master' of https://github.com/wolfSSL/wolfssl 2015-12-08 13:45:25 -08:00
5fd4903fde bump version to 3.7.3 2015-12-08 09:32:00 -08:00
1d1af6410d OpenSSH added support for additional NID types. Update our compatibility layer 2015-12-08 07:27:43 -08:00
d30a1be572 adds new certificates for OCSP tests 2015-12-07 19:55:33 -03:00
8756c31a01 Merge branch 'master' of github.com:wolfSSL/wolfssl 2015-12-07 12:43:01 -08:00
c7fdc9ba9e DTLS Hello Verify and Server Hello should use the sequence number of the Client Hello 2015-12-07 11:24:14 -08:00
4a0c4fbf3f remove fprintf from ecdsa verify fail wrapper 2015-12-07 09:25:19 -08:00
beebc87bc8 Merge pull request #208 from JacobBarthelmeh/master
example IO callback and keep memory alive when needed
2015-12-07 09:12:07 -08:00
1600ba7f3d example IO callback and keep memory alive when needed 2015-12-06 14:30:00 -07:00
6c70e3233d fix bug where unknown OIDs were treated as parsing errors rather than ignored 2015-12-05 13:14:29 -08:00
89a65b0aa0 Fixed compile error in signature.c with g++. Corrected comment. 2015-12-04 15:22:06 -08:00
179f1cab9b Merge branch 'keyex' 2015-12-03 12:38:02 -08:00
37bc497f21 fix merge conflict 2015-12-03 12:37:49 -08:00
532d1da9c0 Merge pull request #206 from dgarske/FixExtraMalloc_wNotTLS12
Fixed issue with "WOLFSSL_SMALL_STACK" and pre TLS 1.2 in "SendServer…
2015-12-03 11:26:43 -08:00
0c9dca3a5f Merge pull request #201 from JacobBarthelmeh/fast-rsa
modification to fast-rsa sign operation and make key
2015-12-03 11:19:02 -08:00
1c2a920b8f Merge pull request #203 from dgarske/SendServerHelloRNGCombine
Combined "wc_RNG_GenerateBlock" calls in "SendServerHello".
2015-12-03 11:16:00 -08:00
b1d18d8455 Fixed issue with "WOLFSSL_SMALL_STACK" and pre TLS 1.2 in "SendServerKeyExchange" where "encodedSig" is allocated and not used. 2015-12-02 19:43:05 -08:00
fea769816c ed25519 verify function return descriptive error value 2015-12-02 15:55:40 -07:00
e08fa67a32 fix clang --disable-memory issues 2015-12-02 14:40:32 -08:00
5cf94166b2 silently drop epoch 0 messages when handshake completed 2015-12-01 14:59:32 -08:00
d673a56c83 change line ending of license to match Windows CR LF 2015-12-01 14:49:16 -07:00
5687562e7b back out change to decryptedCur flag 2015-12-01 13:32:00 -08:00
a5f689168e fix call to IsEncryptionOn for session tickets 2015-12-01 09:18:21 -08:00
bb5de34e5c cast type on XMALLOC with ntru 2015-12-01 09:24:44 -07:00
654e17379e Combined "wc_RNG_GenerateBlock" calls in "SendServerHello". 2015-11-30 19:29:20 -08:00
251d0364f8 check DTLS sequence number against window a little earlier 2015-11-30 17:16:47 -08:00
346dcb0fd9 adds WOLFSSL_CSR2_OCSP_MULTI support; 2015-11-30 21:26:00 -03:00
514aa331f8 wrapped checks for encryptionOn with a function to allow more complicated checks like for epoch 0 being unencrypted 2015-11-30 14:43:03 -08:00
07356af78e prepares BuildCertificateStatus() to send more than one certificate status; 2015-11-30 18:34:00 -03:00
767da41b16 allow 1024 and 2048 example cert buffers to be enabled at same time, gencertbuf.pl 2015-11-30 14:18:17 -07:00
d2a80ba1bc remove extra NULL check in SetTmpDH_buffer/file_wrapper, fix API tests 2015-11-30 10:25:55 -07:00
6030970026 perfer local IPP libraries, memory usage and casting 2015-11-29 23:34:58 -07:00
db599bb361 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into fast-rsa 2015-11-29 13:39:45 -07:00
4217ef5475 fixed mdk4 macro control in example server/client, echoserver/client 2015-11-27 11:31:12 +09:00
7f1b9a1e13 storing DTLS handshake messages takes into account overlapping data 2015-11-25 20:25:57 -08:00
83f26abdde Merge pull request #198 from JacobBarthelmeh/master
C Sharp wrapper
2015-11-25 14:11:52 -08:00
e4894bfd0b add comments to clarify accept and connect state advancement due to sending fragments 2015-11-25 11:10:42 -08:00
02411ccced add F back into the client command line options scanning 2015-11-25 10:36:51 -08:00
1b3254cc47 Merge pull request #202 from NickolasLapp/openssl_test_update
Clarify Openssl.test results messaging
2015-11-25 09:12:52 -08:00
f7fac88e8b Don't error out when calling ippInit to find optimized IPP library, just fall back to use standard 2015-11-24 17:28:43 -07:00
33eb4b98d3 Clarify Openssl.test results messaging 2015-11-24 15:16:26 -07:00
1626ae6287 Merge pull request #200 from lchristina26/master
Update VxWorks README to assume a filesystem, fix typos
2015-11-24 13:31:16 -08:00
c5c9991d11 modification to fast-rsa sign operation and make key 2015-11-24 13:41:04 -07:00
da127dfb17 warrning for unused function in user-crypto / fast-rsa mode 2015-11-24 13:18:39 -07:00
76952d9ea9 updated README to leave out NO_FILESYSTEM 2015-11-24 12:21:01 -07:00
1fbaf089ae adds support to WOLFSSL_CSR2_OCSP in both DoCertificateStatus() and SendCertificateStatus();
adds contingence plan for status_request_v2;
2015-11-24 00:47:27 -03:00
f9d6464793 adds basic extension code for CERTIFICATE_STATUS_REQUEST_V2;
fixes EncodeOcspRequestExtensions() length check;
2015-11-23 23:42:05 -03:00
e4bed957b3 #1591: fixed macro control for MDK4 2015-11-24 11:26:08 +09:00
91b7cddb7c better error checking on condition variable operations, cleanup 2015-11-23 15:13:36 -08:00
b9f0243528 Merge pull request #195 from dgarske/LPCXpresso
Adds LPCXpresso IDE support
2015-11-23 14:47:20 -08:00
6c1fd13184 Merge pull request #199 from dgarske/ChangeToWolfRootWarnFix
Fixes "warning: Size argument is greater than the free space in the d…
2015-11-23 14:43:45 -08:00
c3b3ba4a2a Fixes "warning: Size argument is greater than the free space in the destination buffer" with XSTRNCAT(). 2015-11-23 14:41:24 -08:00
feef035c06 Merge branch 'crl-monitor' 2015-11-23 14:17:27 -08:00
32b2d7f9e4 have calling thread wait for crl monitor thread to setup for simpler cleanup 2015-11-23 14:15:12 -08:00
96e18a8c68 adds next update verification when decoding the OcspResponse;
fixes memleak in GetOcspStatus(); If the status was outdated, the responseBuffer was allocated twice;
consider error in OcspResponseDecode() also a BAD_CERTIFICATE_STATUS_ERROR;
2015-11-23 15:11:51 -03:00
f3131fb5d6 adds next update time to ocspd.sh 2015-11-23 13:34:27 -03:00
b820619e6c updates certs;
adds ocsp certs;
2015-11-23 09:56:45 -03:00
51f5ded392 adds config to generate ocsp certs 2015-11-23 09:44:39 -03:00
aaad9787db updates box version to trusty64;
fixes provisioning errors;
2015-11-23 09:19:33 -03:00
d248a7660c ASN: when getting OID from stream, check the summed value; added utility to skip OID; setting OID uses same strings as getting, separated NULL tag from the OID 2015-11-21 12:00:34 -08:00
9c6b52876a add SetTmpDH file/buffer functions to API tests 2015-11-20 13:32:44 -07:00
85373f7b6e move SetTmpDH buffer functions out of NO_FILESYSTEM 2015-11-20 13:30:22 -07:00
7d13fe9017 license heading 2015-11-20 10:19:55 -07:00
39d6992759 logging levels added 2015-11-20 09:59:08 -07:00
b9dae51658 C Sharp wrapper 2015-11-19 20:51:32 -07:00
6abfaf6df4 Implemented Wolf version of LPC18XX startup code to eliminate NXP code from our repo. Cleanup of trailing spaces and convert tabs to spaces. 2015-11-19 19:06:40 -08:00
14cb082a37 Merge pull request #197 from dgarske/RowleyIDECleanup
Rowley IDE fix to exclude .asm and .s files. Cleanup to remove Rowley…
2015-11-19 18:16:57 -08:00
c898c582f9 Corrected filename in include.am and top of file. 2015-11-19 17:56:49 -08:00
1894358bec Rowley IDE fix to exclude .asm and .s files. Cleanup to remove Rowley example code, leaving just stubs and Wolf code. 2015-11-19 14:32:45 -08:00
6d67ee11b6 Merge pull request #196 from NickolasLapp/SNI_ConditionalCompile
Define SNI func condtionally. Declare var at top of func
2015-11-19 13:18:23 -08:00
c3cdbf31bb Define SNI func condtionally. Declare var at top of func 2015-11-19 13:49:57 -07:00
2698736aaf fix missing XMALLOC/FREE types 2015-11-19 10:20:28 -08:00
e51f99a5c3 Adds LPCXpresso IDE support. Tested with the OM13076 (LPCXpresso18S37) board. 2015-11-18 17:16:33 -08:00
4da70f9fe9 Merge pull request #193 from dgarske/SigHashFixes
Fixes for build errors with new signature and hash wrapping functions…
2015-11-17 12:19:21 -08:00
a2915fbc57 Merge pull request #194 from dgarske/BenchmarkAddHeader
Added benchmark.h to expose the benchmark_test function. Updated a co…
2015-11-17 12:13:08 -08:00
cdc830c1cc Fixes for build errors with new signature and hash wrapping functions. Disabled MD2/4 hash wrapping. 2015-11-17 10:15:36 -08:00
09793e3206 Added benchmark.h to expose the benchmark_test function. Updated a couple of projects to use the new benchmark header. 2015-11-17 08:52:12 -08:00
5e80bf46bf Merge branch 'master' of github.com:wolfssl/wolfssl 2015-11-16 13:20:26 -08:00
ca7956b50d update cavium nitrox port to wolfssl 2015-11-16 13:20:19 -08:00
4e7935f5f5 Merge pull request #188 from dgarske/HashSignVerifyWrappers
New hash and signature wrapper functions:
2015-11-16 12:16:55 -08:00
103f984421 Cleanup of the signature wrapper error cases to be more explicit. 2015-11-16 11:54:23 -08:00
60b1a0c8be fixes scan-build warnings 2015-11-16 16:16:48 -03:00
5e4955f689 reuse OcspRequest data in ocsp stapling; 2015-11-16 16:03:48 -03:00
6d6ca56e4e fixes SendCertificateStatus() loading the CA in the server side to build the OCSP request properly. 2015-11-16 15:31:50 -03:00
24907fc818 adds buffer logging; 2015-11-15 18:43:29 -03:00
12802f40c5 finishes SendCertificateStatus(); sending the stored status; 2015-11-15 16:40:47 -03:00
8ae6bf1641 adds server side Certificate Status Request extension;
missing: Finish SendCertificateStatus();
2015-11-15 00:26:11 -03:00
cc684f8593 fixes OCSP nonce extension size estimation at client hello message; 2015-11-14 22:28:52 -03:00
a38f7bb937 fix jni build enabling ecc on non 64 bit platforms 2015-11-13 16:58:05 -07:00
b870bad63e Added new "SIG_VERIFY_E" type for "wc_SignatureVerify" failure. Added argument checking on new signature wrapper functions. Added new "NO_SIG_WRAPPER" to optionally disable wrappers to reduce code size. 2015-11-13 12:22:32 -08:00
4a853b7318 Update README.md 2015-11-13 10:45:11 -07:00
bcff81fd64 Update README.md 2015-11-13 10:38:58 -07:00
9007d4b655 Update README.md 2015-11-13 10:37:46 -07:00
0994491916 Update README.md 2015-11-13 10:36:36 -07:00
e5707f0d49 Update README.md 2015-11-13 10:35:13 -07:00
0c1a4dfd12 Merge pull request #190 from NickolasLapp/stunnel_session_changes
Implement missing openssl API
2015-11-12 16:11:01 -08:00
66965759d5 Implement missing openssl API 2015-11-12 16:52:56 -07:00
5c96be4d19 fix idea conversion warnings 2015-11-12 15:14:00 -08:00
806a2748bf Merge pull request #189 from lchristina26/master
Updates for Wind River WORKBENCH/ VxWorks Compatibility
2015-11-12 13:33:27 -08:00
307413f11b Update README.md 2015-11-12 13:34:36 -07:00
db6920d372 updates for vxworks compatibility 2015-11-12 13:33:47 -07:00
261fedd906 idea_mult() now works on 16,32, AND 64bit systems 2015-11-12 10:32:35 -08:00
d9cb1cfbe1 fix idea_mult() for 16 and 32bit systems 2015-11-12 10:22:31 -08:00
ba92b2db7b Update README.md 2015-11-12 10:47:38 -07:00
f692c8cefb New hash and signature wrapper functions:
1. Added new hash wrapper function "wc_Hash". Hash functions support Md# and SHA# using "enum wc_HashType". Added new "wc_HashGetDigestSize" function to get hash size (returns 0 if not supported).
2. Added new signature wrapper functions "wc_SignatureGenerate" and "wc_SignatureVerify" to perform hash then sign/verify of bytes. Signature functions support ECC and RSA using "enum wc_SignatureType". Added new "wc_SignatureGetSize" function to get the signature size using the key (returns 0 if not supported).
2015-11-12 09:36:14 -08:00
302fd05edd Change "//" to "/* */" comment. Removed unreferred functions. 2015-11-12 15:31:58 +09:00
866b1517d3 Merge pull request #187 from NickolasLapp/fix_getShutdown
Make get_shutdown return correct results with stunnel
2015-11-11 11:15:22 -08:00
e49b12c7cc Make get_shutdown return correct results with stunnel 2015-11-11 11:43:38 -07:00
01e649210d Update README.md 2015-11-11 10:16:48 -07:00
6cdeebc4da Update README.md 2015-11-11 10:03:49 -07:00
27e523a85a Update README.md 2015-11-11 10:00:53 -07:00
d34f2ebc35 Update README.md 2015-11-11 09:30:03 -07:00
cdea03fdf3 Update README.md 2015-11-11 09:28:59 -07:00
f9cd90872d Update README.md 2015-11-11 09:21:27 -07:00
4063fbc2b5 Update README.md 2015-11-11 09:18:00 -07:00
7d9356ae04 Update README.md 2015-11-11 09:13:04 -07:00
19ebc5b600 Update README.md 2015-11-11 09:12:10 -07:00
c3540b2f6e Update README.md 2015-11-11 09:11:14 -07:00
28cbe7e7a5 Merge pull request #186 from tisb-vikram/master
add HAVE_ECC to WolfSSL/TI-RTOS settings
2015-11-10 19:58:46 -08:00
196b965be5 add HAVE_ECC to WolfSSL/TI-RTOS settings 2015-11-10 18:06:55 -08:00
d076fdf0cd Merge pull request #185 from tisb-vikram/master
fix TI-RTOS makefiles to build wolfSSL from local dir
2015-11-10 17:41:57 -08:00
3211817f59 fix TI-RTOS makefiles to build wolfSSL from local dir
Signed-off-by: Vikram Adiga <vikram.adiga@ti.com>
2015-11-10 17:21:10 -08:00
a69d99981f Merge pull request #184 from kaleb-himes/master
allow openssl extra tests if configuration supports
2015-11-10 15:15:30 -08:00
c3a249009f allow openssl extra tests if configuration supports 2015-11-10 15:29:05 -07:00
9b8f26329d improves srp unit test to use random salt; 2015-11-10 17:43:02 -03:00
5823485f61 Merge pull request #182 from lchristina26/master
Update the README for VxWORKS
2015-11-10 12:36:59 -08:00
56e94cb3a9 Update README.md 2015-11-09 22:37:21 -07:00
9c43e94746 Update README.md 2015-11-09 22:36:00 -07:00
ebd1e2b35d Update README.md 2015-11-09 22:35:16 -07:00
a0f3fa1f1a Update README.md 2015-11-09 22:34:53 -07:00
54c5a3a10c update VxWorks readme 2015-11-09 17:23:25 -07:00
6efd8e2db0 fix unused PemToDer() vars depending on build options 2015-11-09 14:58:20 -08:00
906be9fb20 add printf to logger w/o callbacks w/ WOLFSSL_LOG_PRINTF 2015-11-09 14:55:09 -08:00
417f85da86 use gmtime_r if there 2015-11-09 14:48:39 -08:00
756feb37f5 Merge pull request #179 from kaleb-himes/master
SAFESEH:NO in DLL Debug|Win32
2015-11-09 14:25:23 -08:00
e9348635a0 SAFESEH:NO in DLL Debug|Win32 2015-11-09 15:11:58 -07:00
d869279ad5 Merge branch 'custom-seed' 2015-11-06 15:37:26 -08:00
099b6bc3df Updated the Rowley Crossworks example so it builds due to new user-crypto. Tested and verified new "CUSTOM_RAND_TYPE" using 8, 16 and 32 bit values. 2015-11-06 09:41:16 -08:00
05f4c83b98 Optimizations to improve random number generation performance and provide additional ways to implement custom versions of custom random handlers. Added new "CUSTOM_RAND_TYPE" to define the datatype for the "CUSTOM_RAND_GENERATE" function. Added new "CUSTOM_RAND_GENERATE_SEED" option for anyone who wants to implement their own equivalent "wc_GenerateSeed()" function. Added generic FREESCALE_RNGA and FREESCALE_RNGB options. 2015-11-05 22:20:11 -08:00
dccbc1cdd4 fixes ocsp nonce extension decoding;
enables use of ocsp nonce extension in the client example.
2015-11-05 11:45:42 -03:00
62210186c7 fix code logic to single if 2015-11-05 11:45:41 -03:00
17c9494a2d fix gfmul intel calling convention 2015-11-04 13:26:38 -08:00
124f1f8ce7 switch gfmul to intel syntax in aes_asm.asm 2015-11-04 11:55:04 -08:00
3b102862b1 exclude new AES-GCM test when in FIPS mode 2015-11-03 16:57:38 -08:00
23ba31cbdd 1. Fixed bug where AES-GCM IVs had to only be 12 bytes. Now
accepts any length.
2. Added test case for AES-GCM using an 60 byte IV.
3. AesGcmSetKey doesn't calculate H value in AES-NI mode.
2015-11-03 16:47:42 -08:00
427405fff9 Merge branch 'timediff' 2015-11-03 14:21:55 -08:00
44165371bc timediff fixup 2015-11-03 14:15:15 -08:00
69d5f2e43c Merge branch 'DateFormat' of https://github.com/kojo1/wolfssl into timediff 2015-11-03 14:04:14 -08:00
5c9089651a fix github issue #174 , disable des3 with (else if) logic broken 2015-11-03 12:03:35 -08:00
8d4d9ebe12 fix jenkins ec 56 2015-11-03 11:30:56 -08:00
37f4fbc000 Merge branch 'openssl-script' 2015-11-02 13:27:20 -08:00
fbd4f8a6ed fix merge conflict 2015-11-02 13:26:46 -08:00
54a0a3370a fix wolfSSL_Init to only call new wolfCrypt_Init() once 2015-11-02 12:35:43 -08:00
a1d1155b0c add missing error strings 2015-11-02 12:18:12 -08:00
b13ae543ec bump dev version 2015-11-02 11:15:21 -08:00
3db5a5f2c2 Merge branch csr into 'master' 2015-11-02 15:54:41 -03:00
21d70636dc Merge branch csr into 'master' 2015-11-02 15:51:01 -03:00
1d32ff2c59 Merge branch 'aes-ni-gcm' 2015-11-02 09:42:10 -08:00
28dcef2d71 gcm benchmark results format alignment 2015-11-02 09:39:34 -08:00
f8aeac608c 1. Add C NI-intrinsic AES-GCM encrypt and decrypt.
2. Fix error string for wolfcrypt test of GMAC.
3. Add AES-GCM Decrypt to benchmark.
2015-10-30 16:03:26 -07:00
5d2d249673 turn on OpenSSL public key type decodes unless explicitly turned off 2015-10-30 13:40:05 -07:00
d741d4cddc Adding UTC Time Differential in ValidateDate 2015-10-30 11:26:54 +09:00
e76f95465d Merge pull request #170 from dgarske/master
Fixes initialization of the Crypto HW protection, which could leak a …
2015-10-29 13:56:18 -07:00
8dfa1af9e9 Merge pull request #169 from lchristina26/master
updates for VxWorks

Update example client/server to be compatible with VxWorks builds
2015-10-29 13:50:13 -06:00
5bcb7e98cb readme updates 2015-10-29 13:47:40 -06:00
1a96ff6766 readme updates 2015-10-29 13:45:58 -06:00
4061346f77 more readme updates 2015-10-29 13:44:22 -06:00
dd99948bcd Workbench readme update 2015-10-29 13:41:17 -06:00
723fc3761b Example client/server compatible with VxWorks 2015-10-29 13:39:02 -06:00
dacfd84bea Enhanced "ChangeToWolfRoot" to report error if the root was not found. Also fixed the depth limit. 2015-10-29 10:45:37 -07:00
f977caa492 Cleanup of the test code that looks for the WolfSSL root directory. Now it tries to open the certs/ntru-cert.pem file in each directory up (limited to 5) until it opens it. 2015-10-28 23:54:08 -07:00
d31cec0df0 Fixes initialization of the Crypto HW protection, which could leak a mutex if two calls to "wolfSSL_CryptHwMutexLock()" occurred at the same time prior to calling "wolfSSL_CryptHwMutexInit()". Fixes #164. 2015-10-28 23:07:52 -07:00
3e9fd1c542 Merge branch 'master' into csr
Conflicts:
	configure.ac
	wolfssl/wolfcrypt/types.h
2015-10-28 14:34:15 -03:00
071a452bec fix indentation and enum conflict 2015-10-28 12:20:20 -03:00
a914ca74f2 updates for VxWorks 2015-10-27 21:24:21 -06:00
cddebfa941 changes --enable-statusrequest to --enable-ocspstapling 2015-10-27 19:27:56 -03:00
f37ea955ec improves OCSP response signature verification;
reference: RFC 2560 -  Section 4.2.2.2  Authorized Responders:

   The key that signs a certificate’s status information need not be the
   same key that signed the certificate. It is necessary however to
   ensure that the entity signing this information is authorized to do
   so.  Therefore, a certificate’s issuer MUST either sign the OCSP
   responses itself or it MUST explicitly designate this authority to
   another entity.
2015-10-26 19:33:35 -03:00
a47f98ee19 adds support to nonce extension in OCSP stapling (status request tls extension);
fix nonce encoding, there was a missing ASN.1 OctetString header;
2015-10-26 18:11:38 -03:00
14fa980dad adds contingence plan (force OCSP check when the server answer the status_request extension but doesn't sends a CertificateStatus message);
adds back status_request to context level;
2015-10-26 18:11:38 -03:00
42380793c9 adds comparison of OcspRequest and OcspResponse;
removes TLS Extension Status Request at context level as specific data is always needed for each session;
2015-10-26 18:11:38 -03:00
daf3155d3c adds partial client support to TLS Extension Status Request, a.k.a. OCSP stapling;
missing:
 - compare OcspRequest and OcspResponse;
 - execute contingence plan;
 - add nonce extension;
2015-10-26 18:11:38 -03:00
82f86adb8e renames TLS Extension types to follow the TLSX_ + "extension name" pattern; using names listed by IANA:
http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml

fixes ocsp response extensions parsing in asn.c;

fixes dir slashes in .gitignore: replaces '\' with '/';

removes trailing white spaces;
2015-10-26 18:11:38 -03:00
1481 changed files with 793924 additions and 67937 deletions

183
.gitignore vendored
View File

@ -9,7 +9,8 @@ ctaocrypt/src/src/
*.cache
.dirstamp
*.user
config*
configure
config.*
*Debug/
*Release/
*.ncb
@ -19,6 +20,7 @@ config*
ipch/
build-aux/
rpm/spec
*.rpm
stamp-h
cyassl/options.h
wolfssl/options.h
@ -36,17 +38,37 @@ tags
cyassl-config
wolfssl-config
cyassl.sublime*
fips.h
fips.c
fips_test.c
fips
wolfcrypt_first.c
wolfcrypt_last.c
selftest.c
fipsv2.c
src/async.c
wolfssl/async.h
wolfcrypt/src/async.c
wolfssl/wolfcrypt/async.h
wolfcrypt/src/port/intel/quickassist.c
wolfcrypt/src/port/intel/quickassist_mem.c
wolfcrypt/src/port/cavium/cavium_nitrox.c
wolfssl/wolfcrypt/port/intel/quickassist.h
wolfssl/wolfcrypt/port/intel/quickassist_mem.h
wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
ctaocrypt/benchmark/benchmark
ctaocrypt/test/testctaocrypt
wolfcrypt/benchmark/benchmark
wolfcrypt/test/testwolfcrypt
examples/benchmark/tls_bench
examples/client/client
examples/echoclient/echoclient
examples/echoserver/echoserver
examples/server/server
examples/sctp/sctp-server
examples/sctp/sctp-server-dtls
examples/sctp/sctp-client
examples/sctp/sctp-client-dtls
server_ready
snifftest
output
@ -55,6 +77,8 @@ testsuite/testsuite
tests/unit
testsuite/testsuite.test
tests/unit.test
tests/bio_write_test.txt
test-write-dhparams.pem
testsuite/*.der
testsuite/*.pem
testsuite/*.raw
@ -64,18 +88,99 @@ certecc.der
certecc.pem
othercert.der
othercert.pem
certeccrsa.der
certeccrsa.pem
ntru-cert.der
ntru-cert.pem
ntru-key.raw
key.der
key.pem
ecc-public-key.der
ecc-key-pkcs8.der
ecc-key.der
ecc-key.pem
certreq.der
certreq.pem
pkcs7cert.der
pkcs7signedData.der
pkcs7envelopedData.der
pkcs7authEnvelopedDataAES128GCM.der
pkcs7authEnvelopedDataAES128GCM_ECDH_SHA1KDF.der
pkcs7authEnvelopedDataAES128GCM_KEKRI.der
pkcs7authEnvelopedDataAES128GCM_ORI.der
pkcs7authEnvelopedDataAES128GCM_PWRI.der
pkcs7authEnvelopedDataAES192GCM.der
pkcs7authEnvelopedDataAES256GCM.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA256KDF.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA256KDF_authAttribs.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA256KDF_bothAttribs.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA256KDF_fw_bothAttribs.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA256KDF_unauthAttribs.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA512KDF.der
pkcs7authEnvelopedDataAES256GCM_ECDH_SHA512KDF_ukm.der
pkcs7authEnvelopedDataAES256GCM_firmwarePkgData.der
pkcs7authEnvelopedDataAES256GCM_IANDS.der
pkcs7authEnvelopedDataAES256GCM_SKID.der
pkcs7compressedData_data_zlib.der
pkcs7compressedData_firmwarePkgData_zlib.der
pkcs7encryptedDataAES128CBC.der
pkcs7encryptedDataAES192CBC.der
pkcs7encryptedDataAES256CBC.der
pkcs7encryptedDataAES256CBC_attribs.der
pkcs7encryptedDataAES256CBC_firmwarePkgData.der
pkcs7encryptedDataAES256CBC_multi_attribs.der
pkcs7encryptedDataDES.der
pkcs7encryptedDataDES3.der
pkcs7envelopedDataAES128CBC.der
pkcs7envelopedDataAES128CBC_ECDH_SHA1KDF.der
pkcs7envelopedDataAES128CBC_KEKRI.der
pkcs7envelopedDataAES128CBC_PWRI.der
pkcs7envelopedDataAES128CBC_ORI.der
pkcs7envelopedDataAES192CBC.der
pkcs7envelopedDataAES256CBC.der
pkcs7envelopedDataAES256CBC_IANDS.der
pkcs7envelopedDataAES256CBC_SKID.der
pkcs7envelopedDataAES256CBC_ECDH_SHA256KDF.der
pkcs7envelopedDataAES256CBC_ECDH_SHA512KDF.der
pkcs7envelopedDataAES256CBC_ECDH_SHA512KDF_ukm.der
pkcs7envelopedDataDES3.der
pkcs7signedData_ECDSA_SHA224.der
pkcs7signedData_ECDSA_SHA256_custom_contentType.der
pkcs7signedData_ECDSA_SHA256.der
pkcs7signedData_ECDSA_SHA256_firmwarePkgData.der
pkcs7signedData_ECDSA_SHA256_SKID.der
pkcs7signedData_ECDSA_SHA384.der
pkcs7signedData_ECDSA_SHA512.der
pkcs7signedData_ECDSA_SHA.der
pkcs7signedData_ECDSA_SHA_noattr.der
pkcs7signedData_RSA_SHA224.der
pkcs7signedData_RSA_SHA256_custom_contentType.der
pkcs7signedData_RSA_SHA256.der
pkcs7signedData_RSA_SHA256_firmwarePkgData.der
pkcs7signedData_RSA_SHA256_SKID.der
pkcs7signedData_RSA_SHA256_with_ca_cert.der
pkcs7signedData_RSA_SHA256_detachedSig.der
pkcs7signedData_RSA_SHA384.der
pkcs7signedData_RSA_SHA512.der
pkcs7signedData_RSA_SHA.der
pkcs7signedData_RSA_SHA_noattr.der
pkcs7signedCompressedFirmwarePkgData_ECDSA_SHA256.der
pkcs7signedCompressedFirmwarePkgData_ECDSA_SHA256_noattr.der
pkcs7signedCompressedFirmwarePkgData_RSA_SHA256.der
pkcs7signedCompressedFirmwarePkgData_RSA_SHA256_noattr.der
pkcs7signedEncryptedFirmwarePkgData_ECDSA_SHA256.der
pkcs7signedEncryptedFirmwarePkgData_ECDSA_SHA256_noattr.der
pkcs7signedEncryptedFirmwarePkgData_RSA_SHA256.der
pkcs7signedEncryptedFirmwarePkgData_RSA_SHA256_noattr.der
pkcs7signedFirmwarePkgData_ECDSA_SHA256.der
pkcs7signedFirmwarePkgData_ECDSA_SHA256_SKID.der
pkcs7signedFirmwarePkgData_ECDSA_SHA256_noattr.der
pkcs7signedFirmwarePkgData_RSA_SHA256.der
pkcs7signedFirmwarePkgData_RSA_SHA256_SKID.der
pkcs7signedFirmwarePkgData_RSA_SHA256_noattr.der
pkcs7signedFirmwarePkgData_RSA_SHA256_with_ca_cert.der
pkcs7signedEncryptedCompressedFirmwarePkgData_ECDSA_SHA256.der
pkcs7signedEncryptedCompressedFirmwarePkgData_ECDSA_SHA256_noattr.der
pkcs7signedEncryptedCompressedFirmwarePkgData_RSA_SHA256.der
pkcs7signedEncryptedCompressedFirmwarePkgData_RSA_SHA256_noattr.der
diff
sslSniffer/sslSnifferTest/tracefile.txt
tracefile.txt
@ -96,6 +201,7 @@ autoscan.log
TAGS
.DS_Store
support/cyassl.pc
support/wolfssl.pc
cyassl/ctaocrypt/stamp-h1
swig/_cyassl.so
swig/_wolfssl.so
@ -112,11 +218,11 @@ cov-int
cyassl.tgz
*.log
*.trs
IDE\MDK-ARM\Projects/
IDE\MDK-ARM\STM32F2xx_StdPeriph_Lib/inc
IDE\MDK-ARM\STM32F2xx_StdPeriph_Lib/src
IDE\MDK-ARM\LPC43xx\Drivers/
IDE\MDK-ARM\LPC43xx\LPC43xx/
IDE/MDK-ARM/Projects/
IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/inc
IDE/MDK-ARM/STM32F2xx_StdPeriph_Lib/src
IDE/MDK-ARM/LPC43xx/Drivers/
IDE/MDK-ARM/LPC43xx/LPC43xx/
*.gcno
*.gcda
*.gcov
@ -136,6 +242,13 @@ mplabx/wolfcrypt_test.X/nbproject/Makefile-*
mplabx/wolfcrypt_test.X/nbproject/Package-default.bash
mplabx/wolfssl.X/nbproject/Makefile-*
mplabx/wolfssl.X/nbproject/Package-default.bash
mplabx/wolfssl.X/nbproject/private
mplabx/wolfcrypt_test.X/nbproject/private
mplabx/wolfcrypt_benchmark.X/nbproject/private
mplabx/wolfssl.X/dist/default/
mplabx/wolfcrypt_test.X/dist/default/
mplabx/wolfcrypt_benchmark.X/dist/default/
*.dSYM
# Vagrant folder
.vagrant/
@ -168,3 +281,57 @@ wolfcrypt/user-crypto/m4
wolfcrypt/user-crypto/missing
wolfcrypt/user-crypto/Makefile.in
wolfcrypt/user-crypto/lib/libusercrypto.*
*.hzs
# wolfSSL CSharp wrapper
wrapper/CSharp/x64/
# Visual Studio Code Workspace Files
*.vscode
*.userprefs
*.exe
*.dll
.vs
Backup
UpgradeLog.htm
*.aps
*.VC.db
*.filters
IDE/INTIME-RTOS/Debug_*
IDE/VS-ARM/.vs
# Hexiwear
IDE/HEXIWEAR/wolfSSL_HW/Debug
# Linux-SGX
IDE/LINUX-SGX/*.a
# Binaries
wolfcrypt/src/port/intel/qat_test
/mplabx/wolfssl.X/dist/default/
/mplabx/wolfcrypt_test.X/dist/default/
# Arduino Generated Files
/IDE/ARDUINO/wolfSSL
scripts/memtest.txt
# Doxygen generated files
doc/doxygen_warnings
doc/html
doc/pdf
# XCODE Index
IDE/XCODE/Index
# ARM DS-5 && Eclipse
\.settings/
\.cproject
\.project
\.autotools
# Renesas e2studio
/IDE/Renesas/e2studio/Projects/test/src/smc_gen
/IDE/Renesas/e2studio/Projects/test/trash
/IDE/Renesas/e2studio/Projects/test/*.launch
/IDE/Renesas/e2studio/Projects/test/*.scfg

2421
ChangeLog.md Normal file

File diff suppressed because it is too large Load Diff

37
IDE/ARDUINO/README.md Normal file
View File

@ -0,0 +1,37 @@
### wolfSSL with Arduino
##### Reformatting wolfSSL as a compatible Arduino Library
This is a shell script that will re-organize the wolfSSL library to be
compatible with Arduino projects. The Arduino IDE requires a library's source
files to be in the library's root directory with a header file in the name of
the library. This script moves all src/ files to the `IDE/ARDUINO/wolfSSL`
directory and creates a stub header file called `wolfssl.h`.
Step 1: To configure wolfSSL with Arduino, enter the following from within the
wolfssl/IDE/ARDUINO directory:
`./wolfssl-arduino.sh`
Step 2: Copy the directory wolfSSL that was just created to:
`~/Documents/Arduino/libraries/` directory so the Arduino IDE can find it.
Step 3: Edit `<arduino-libraries>/wolfSSL/user_settings.h`
If building for Intel Galileo platform add: `#define INTEL_GALILEO`.
Add any other custom settings, for a good start see the below in wolfssl root.
(See wolfssl/IDE/ROWLEY-CROSSWORKS-ARM/user_settings.h)
Step 4: If you experience any issues with custom user_settings.h see the wolfssl
porting guide here for more assistance: https://www.wolfssl.com/docs/porting-guide/
Step 5: If you still have any issues contact support@wolfssl.com for more help.
##### Including wolfSSL in Arduino Libraries (for Arduino version 1.6.6)
1. In the Arduino IDE:
- In `Sketch -> Include Library -> Add .ZIP Library...` and choose the
`IDE/ARDUNIO/wolfSSL` folder.
- In `Sketch -> Include Library` choose wolfSSL.
2. Open an example Arduino sketch for wolfSSL:
- wolfSSL Client INO sketch: `sketches/wolfssl_client/wolfssl_client.ino`
- wolfSSL Server INO sketch: `sketches/wolfssl_server/wolfssl_server.ino`

8
IDE/ARDUINO/include.am Normal file
View File

@ -0,0 +1,8 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/ARDUINO/README.md
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_client/wolfssl_client.ino
EXTRA_DIST+= IDE/ARDUINO/sketches/wolfssl_server/wolfssl_server.ino
EXTRA_DIST+= IDE/ARDUINO/wolfssl-arduino.sh

View File

@ -0,0 +1,156 @@
/* wolfssl_client.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl.h>
#include <wolfssl/ssl.h>
#include <Ethernet.h>
const char host[] = "192.168.1.148"; // server to connect to
const int port = 11111; // port on server to connect to
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
int reconnect = 10;
EthernetClient client;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL;
void setup() {
WOLFSSL_METHOD* method;
Serial.begin(9600);
method = wolfTLSv1_2_client_method();
if (method == NULL) {
Serial.println("unable to get method");
return;
}
ctx = wolfSSL_CTX_new(method);
if (ctx == NULL) {
Serial.println("unable to get ctx");
return;
}
// initialize wolfSSL using callback functions
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
return;
}
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx) {
int sent = 0;
sent = client.write((byte*)msg, sz);
return sent;
}
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
int ret = 0;
while (client.available() > 0 && ret < sz) {
reply[ret++] = client.read();
}
return ret;
}
void loop() {
int err = 0;
int input = 0;
int total_input = 0;
char msg[32] = "hello wolfssl!";
int msgSz = (int)strlen(msg);
char errBuf[80];
char reply[80];
const char* cipherName;
if (reconnect) {
reconnect--;
if (client.connect(host, port)) {
Serial.print("Connected to ");
Serial.println(host);
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
Serial.println("Unable to allocate SSL object");
return;
}
err = wolfSSL_connect(ssl);
if (err != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Connect Error: ");
Serial.println(errBuf);
}
Serial.print("SSL version is ");
Serial.println(wolfSSL_get_version(ssl));
cipherName = wolfSSL_get_cipher(ssl);
Serial.print("SSL cipher suite is ");
Serial.println(cipherName);
if ((wolfSSL_write(ssl, msg, msgSz)) == msgSz) {
Serial.print("Server response: ");
while (client.available() || wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
total_input += input;
if (input < 0) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Read Error: ");
Serial.println(errBuf);
break;
} else if (input > 0) {
reply[input] = '\0';
Serial.print(reply);
} else {
Serial.println();
}
}
} else {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Write Error: ");
Serial.println(errBuf);
}
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
client.stop();
Serial.println("Connection complete.");
reconnect = 0;
} else {
Serial.println("Trying to reconnect...");
}
}
delay(1000);
}

View File

@ -0,0 +1,176 @@
/* wolfssl_server.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl.h>
#include <wolfssl/ssl.h>
#include <Ethernet.h>
#define USE_CERT_BUFFERS_256
#include <wolfssl/certs_test.h>
#ifdef NO_WOLFSSL_SERVER
#error Please undefine NO_WOLFSSL_SERVER for this example
#endif
const int port = 11111; // port to listen on
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx);
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx);
EthernetServer server(port);
EthernetClient client;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL;
void setup() {
int err;
WOLFSSL_METHOD* method;
Serial.begin(9600);
method = wolfTLSv1_2_server_method();
if (method == NULL) {
Serial.println("unable to get method");
return;
}
ctx = wolfSSL_CTX_new(method);
if (ctx == NULL) {
Serial.println("unable to get ctx");
return;
}
// initialize wolfSSL using callback functions
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_SetIOSend(ctx, EthernetSend);
wolfSSL_SetIORecv(ctx, EthernetReceive);
// setup the private key and certificate
err = wolfSSL_CTX_use_PrivateKey_buffer(ctx, ecc_key_der_256,
sizeof_ecc_key_der_256, WOLFSSL_FILETYPE_ASN1);
if (err != WOLFSSL_SUCCESS) {
Serial.println("error setting key");
return;
}
err = wolfSSL_CTX_use_certificate_buffer(ctx, serv_ecc_der_256,
sizeof_serv_ecc_der_256, WOLFSSL_FILETYPE_ASN1);
if (err != WOLFSSL_SUCCESS) {
Serial.println("error setting certificate");
return;
}
// Start the server
server.begin();
return;
}
int EthernetSend(WOLFSSL* ssl, char* msg, int sz, void* ctx) {
int sent = 0;
sent = client.write((byte*)msg, sz);
return sent;
}
int EthernetReceive(WOLFSSL* ssl, char* reply, int sz, void* ctx) {
int ret = 0;
while (client.available() > 0 && ret < sz) {
reply[ret++] = client.read();
}
return ret;
}
void loop() {
int err = 0;
int input = 0;
char errBuf[80];
char reply[80];
int replySz = 0;
const char* cipherName;
// Listen for incoming client requests.
client = server.available();
if (!client) {
return;
}
if (client.connected()) {
Serial.println("Client connected");
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
Serial.println("Unable to allocate SSL object");
return;
}
err = wolfSSL_accept(ssl);
if (err != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Accept Error: ");
Serial.println(errBuf);
}
Serial.print("SSL version is ");
Serial.println(wolfSSL_get_version(ssl));
cipherName = wolfSSL_get_cipher(ssl);
Serial.print("SSL cipher suite is ");
Serial.println(cipherName);
Serial.print("Server Read: ");
while (client.available() || wolfSSL_pending(ssl)) {
input = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
if (input < 0) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Read Error: ");
Serial.println(errBuf);
break;
} else if (input > 0) {
replySz = input;
reply[input] = '\0';
Serial.print(reply);
} else {
Serial.println();
}
}
// echo data
if ((wolfSSL_write(ssl, reply, replySz)) != replySz) {
err = wolfSSL_get_error(ssl, 0);
wolfSSL_ERR_error_string(err, errBuf);
Serial.print("TLS Write Error: ");
Serial.println(errBuf);
}
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
}
client.stop();
Serial.println("Connection complete");
}

68
IDE/ARDUINO/wolfssl-arduino.sh Executable file
View File

@ -0,0 +1,68 @@
#!/bin/sh
# this script will reformat the wolfSSL source code to be compatible with
# an Arduino project
# run as bash ./wolfssl-arduino.sh
DIR=${PWD##*/}
space(){
echo "" >> "$1"
}
if [ "$DIR" = "ARDUINO" ]; then
rm -rf wolfSSL
mkdir wolfSSL
cp ../../src/*.c ./wolfSSL
cp ../../wolfcrypt/src/*.c ./wolfSSL
mkdir wolfSSL/wolfssl
cp ../../wolfssl/*.h ./wolfSSL/wolfssl
mkdir wolfSSL/wolfssl/wolfcrypt
cp ../../wolfssl/wolfcrypt/*.h ./wolfSSL/wolfssl/wolfcrypt
# support misc.c as include in wolfcrypt/src
mkdir ./wolfSSL/wolfcrypt
mkdir ./wolfSSL/wolfcrypt/src
cp ../../wolfcrypt/src/misc.c ./wolfSSL/wolfcrypt/src
cp ../../wolfcrypt/src/asm.c ./wolfSSL/wolfcrypt/src
# put bio and evp as includes
mv ./wolfSSL/bio.c ./wolfSSL/wolfssl
mv ./wolfSSL/evp.c ./wolfSSL/wolfssl
echo "/* Generated wolfSSL header file for Arduino */" > ./wolfSSL/wolfssl.h
echo "#include <wolfssl/wolfcrypt/settings.h>" >> ./wolfSSL/wolfssl.h
echo "#include <wolfssl/ssl.h>" >> ./wolfSSL/wolfssl.h
echo "/* Generated wolfSSL user_settings.h file for Arduino */" > ./wolfSSL/user_settings.h
echo "#ifndef ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
echo "#define ARDUINO_USER_SETTINGS_H" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "/* Platform */" >> ./wolfSSL/user_settings.h
echo "#define WOLFSSL_ARDUINO" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "/* Math library (remove this to use normal math)*/" >> ./wolfSSL/user_settings.h
echo "#define USE_FAST_MATH" >> ./wolfSSL/user_settings.h
echo "#define TFM_NO_ASM" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "/* RNG DEFAULT !!FOR TESTING ONLY!! */" >> ./wolfSSL/user_settings.h
echo "/* comment out the error below to get started w/ bad entropy source" >> ./wolfSSL/user_settings.h
echo " * This will need fixed before distribution but is OK to test with */" >> ./wolfSSL/user_settings.h
echo "#error \"needs solved, see: https://www.wolfssl.com/docs/porting-guide/\"" >> ./wolfSSL/user_settings.h
echo "#define WOLFSSL_GENSEED_FORTEST" >> ./wolfSSL/user_settings.h
space wolfSSL/user_settings.h
echo "#endif /* ARDUINO_USER_SETTINGS_H */" >> ./wolfSSL/user_settings.h
cp wolfSSL/wolfssl/wolfcrypt/settings.h wolfSSL/wolfssl/wolfcrypt/settings.h.bak
echo " /* wolfSSL Generated ARDUINO settings */" > ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo "#ifndef WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo " #define WOLFSSL_USER_SETTINGS" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo "#endif /* WOLFSSL_USER_SETTINGS */" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
echo " /* wolfSSL Generated ARDUINO settings: END */" >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
cat ./wolfSSL/wolfssl/wolfcrypt/settings.h.bak >> ./wolfSSL/wolfssl/wolfcrypt/settings.h
else
echo "ERROR: You must be in the IDE/ARDUINO directory to run this script"
fi

116
IDE/CRYPTOCELL/README.md Normal file
View File

@ -0,0 +1,116 @@
# ARM® TrustZone® CryptoCell 310 Port
## Overview
ARM® TrustZone® CryptoCell 310 is a security subsystem which provides root of trust (RoT) and cryptographic services for a device.
You can enable the wolfSSL support for ARM CryptoCell using the `#define WOLFSSL_CRYPTOCELL`, The CryptoCell APIs are distributed as part of the Nordic nRF5 SDKs [here](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__cryptocell__api.html) .
## Prerequisites
1. Follow the Nordic website [here](https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK) to download the Nordic nRF5-SDK and software tools.
2. Install the SEGGER Embedded Studio IDE.
3. Run a simple blinky application on your Nordic nRF52840 (PCA10056) development board to confirm that your board functions as expected and the communication between your computer and the board works.
## Usage
You can start with a wolfcrypt SEGGER embedded studio (ses) example project to integrate the wolfSSL source code.
wolfSSL supports a compile-time user configurable options in the `IDE/CRYPTOCELL/user_settings.h` file.
The `IDE/CRYPTOCELL/main.c` example application provides a function to run the selected examples at compile time through the following two #defines in user_settings.h. You can define these macro options to disable the test run.
```
- #undef NO_CRYPT_TEST
- #undef NO_CRYPT_BENCHMARK
```
## Supported features
- SHA-256
- AES CBC
- CryptoCell 310 RNG
- RSA sign/verify and RSA key gen
- RSA encrypt/decrypt
- ECC sign/verify/shared secret
- ECC key import/export and key gen pairs
- Hardware RNG
- RTC for benchmark timing source
## Setup
### Setting up Nordic SDK with wolfSSL
1. Download the wolfSSL source code or a zip file from GitHub and place it under your SDK `InstallFolder/external/` directory. You can also copy or simlink to the source.
```
For example,
$cd ~/nRF5_SDK_15.2.0_9412b96/external
$git clone --depth=1 https://github.com/wolfSSL/wolfssl.git
Or, assuming you have already cloned the wolfSSL source code under ~/wolfssl.
$cd ~/nRF5_SDK_15.2.0_9412b96/external
$ln -s ~/wolfssl wolfssl
```
2. Copy the example project from [here](https://github.com/tmael/nRF5_SDK/tree/master/examples/crypto/nrf_cc310/wolfcrypt) into your `nRF5_SDK_15.2.0_9412b96/examples/crypto/nrf_cc310/` directory.
```
$git clone https://github.com/tmael/nRF5_SDK.git
$cd ~/nRF5_SDK_15.2.0_9412b96/examples/crypto/nrf_cc310
$cp -rf ~/nRF5_SDK/examples/crypto/nrf_cc310/wolfcrypt .
OR
$ln -s ~/nRF5_SDK/examples/crypto/nrf_cc310/wolfcrypt wolfcrypt
```
3. Launch the SEGGER Embedded Studio IDE
4. In the main menu, go to File >Open Solutions to open the example solution. Browse to the location containing the wolfcrypt code `/examples/crypto/nrf_cc310/wolfcrypt/pca10056/blank/ses/wolfcrypt_pca10056.emProject` and choose Open.
## Building and Running
In the main menu, go to Build > Rebuild your project, then load and run your image on your nRF52840 target platform. Review the test results on the console output.
### `wolfcrypt_test()`
wolfcrypt_test() prints a message on the target console similar to the following output:
```
wolfCrypt Test Started
error test passed!
base64 test passed!
asn test passed!
SHA test passed!
SHA-256 test passed!
Hash test passed!
HMAC-SHA test passed!
HMAC-SHA256 test passed!
AES test passed!
RANDOM test passed!
RSA test passed!
ECC test passed!
ECC buffer test passed!
logging test passed!
mutex test passed!
wolfCrypt Test Completed
```
### `benchmark_test()`
benchmark_test() prints a message on the target console similar to the following output.
```
Benchmark Test Started
------------------------------------------------------------------------------
wolfSSL version 3.15.7
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 5 MB took 1.000 seconds, 4.858 MB/s
AES-128-CBC-enc 17 MB took 1.001 seconds, 17.341 MB/s
AES-128-CBC-dec 17 MB took 1.000 seconds, 17.285 MB/s
SHA 425 KB took 1.040 seconds, 408.654 KB/s
SHA-256 26 MB took 1.000 seconds, 25.903 MB/s
HMAC-SHA 425 KB took 1.049 seconds, 405.148 KB/s
HMAC-SHA256 24 MB took 1.000 seconds, 23.877 MB/s
RSA 1024 key gen 2 ops took 1.579 sec, avg 789.500 ms, 1.267 ops/sec
RSA 2048 key gen 1 ops took 9.695 sec, avg 9695.000 ms, 0.103 ops/sec
RSA 2048 public 328 ops took 1.001 sec, avg 3.052 ms, 327.672 ops/sec
RSA 2048 private 4 ops took 1.713 sec, avg 428.250 ms, 2.335 ops/sec
ECC 256 key gen 55 ops took 1.017 sec, avg 18.491 ms, 54.081 ops/sec
ECDHE 256 agree 56 ops took 1.017 sec, avg 18.161 ms, 55.064 ops/sec
ECDSA 256 sign 50 ops took 1.004 sec, avg 20.080 ms, 49.801 ops/sec
ECDSA 256 verify 48 ops took 1.028 sec, avg 21.417 ms, 46.693 ops/sec
Benchmark Test Completed
```
## References
The test results were collected from an nRF52840 reference platform target with the following software and tool chains:
- Nordic nRF52840 development board (PCA10056 1.0.0 2018.49 683529999).
- nRF5_SDK_15.2.0_9412b96
- SEGGER Embedded Studio for ARM, Release 4.12 Build 2018112601.37855 Linux x64Segger J-Link software
- gcc-arm-none-eabi-8-2018-q4-major
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
For more information or questions, please email [support@wolfssl.com](mailto:support@wolfssl.com)

View File

@ -0,0 +1,8 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST += \
IDE/CRYPTOCELL/README.md \
IDE/CRYPTOCELL/main.c \
IDE/CRYPTOCELL/user_settings.h

64
IDE/CRYPTOCELL/main.c Normal file
View File

@ -0,0 +1,64 @@
/* main.c
*
* Copyright (C) 2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>
/* wolfCrypt_Init/wolfCrypt_Cleanup to turn CryptoCell hardware on/off */
#include <wolfssl/wolfcrypt/wc_port.h>
/* SEGGER_RTT_Init, you can potential replace it with other serial terminal */
#include "SEGGER_RTT.h"
int main(void)
{
int ret;
SEGGER_RTT_Init();
if ((ret = wolfCrypt_Init()) != 0) {
printf("wolfCrypt_Init failed %d\n", ret);
return -1;
}
#ifndef NO_CRYPT_TEST
printf("\nwolfCrypt Test Started\n");
wolfcrypt_test(NULL);
printf("\nwolfCrypt Test Completed\n");
#endif
#ifndef NO_CRYPT_BENCHMARK
printf("\nBenchmark Test Started\n");
benchmark_test(NULL);
printf("\nBenchmark Test Completed\n");
#endif
if ((ret = wolfCrypt_Cleanup()) != 0) {
printf("wolfCrypt_Cleanup failed %d\n", ret);
return -1;
}
while(1) {
__WFI();
}
return 0;
}

View File

@ -0,0 +1,589 @@
/* user_settings.h
*
* Copyright (C) 2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Example Settings for CryptoCell */
#ifndef WOLFSSL_USER_SETTINGS_H
#define WOLFSSL_USER_SETTINGS_H
#ifdef __cplusplus
extern "C" {
#endif
/* ------------------------------------------------------------------------- */
/* CryptoCell */
/* ------------------------------------------------------------------------- */
#if 1
#define WOLFSSL_CRYPTOCELL
#define WOLFSSL_nRF5x_SDK_15_2 /* for benchmark timer */
#define WOLFSSL_CRYPTOCELL_AES /* only CBC mode is supported */
#else
/* run without CryptoCell,
include IDE/GCC-ARM/Source/wolf_main.c for current_time(). */
#endif
#if defined(WOLFSSL_CRYPTOCELL)
#define AES_MAX_KEY_SIZE 128
#endif /* WOLFSSL_CRYPTOCELL*/
/* ------------------------------------------------------------------------- */
/* Platform */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_GENERAL_ALIGNMENT
#define WOLFSSL_GENERAL_ALIGNMENT 4
#undef SINGLE_THREADED
#define SINGLE_THREADED
#undef WOLFSSL_SMALL_STACK
#define WOLFSSL_SMALL_STACK
#undef WOLFSSL_USER_IO
#define WOLFSSL_USER_IO
/* ------------------------------------------------------------------------- */
/* Math Configuration */
/* ------------------------------------------------------------------------- */
#undef SIZEOF_LONG_LONG
#define SIZEOF_LONG_LONG 8
#undef USE_FAST_MATH
#if 1
#define USE_FAST_MATH
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT
/* Optimizations */
//#define TFM_ARM
#endif
/* Wolf Single Precision Math */
#undef WOLFSSL_SP
#if 0
#define WOLFSSL_SP
#define WOLFSSL_SP_SMALL /* use smaller version of code */
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_CACHE_RESISTANT
//#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
/* Assembly */
//#define WOLFSSL_SP_ASM /* required if using the ASM versions */
//#define WOLFSSL_SP_ARM_CORTEX_M_ASM
#endif
/* ------------------------------------------------------------------------- */
/* Crypto */
/* ------------------------------------------------------------------------- */
/* RSA */
#undef NO_RSA
#if 1
#ifdef USE_FAST_MATH
/* Maximum math bits (Max RSA key bits * 2) */
#undef FP_MAX_BITS
#define FP_MAX_BITS 4096
#endif
/* half as much memory but twice as slow */
#undef RSA_LOW_MEM
//#define RSA_LOW_MEM
/* Enables blinding mode, to prevent timing attacks */
#if 1
#undef WC_RSA_BLINDING
#define WC_RSA_BLINDING
#else
#undef WC_NO_HARDEN
#define WC_NO_HARDEN
#endif
/* RSA PSS Support */
#if 0
#define WC_RSA_PSS
#endif
#if 0
#define WC_RSA_NO_PADDING
#endif
#else
#define NO_RSA
#endif
/* ECC */
#undef HAVE_ECC
#if 1
#define HAVE_ECC
/* Manually define enabled curves */
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
#ifdef ECC_USER_CURVES
/* Manual Curve Selection */
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
#define HAVE_ECC384
//#define HAVE_ECC521
#endif
/* Fixed point cache (speeds repeated operations against same private key) */
#undef FP_ECC
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#undef FP_ENTRIES
#define FP_ENTRIES 2
#undef FP_LUT
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#undef ECC_SHAMIR
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#undef ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
/* Enable cofactor support */
#undef HAVE_ECC_CDH
//#define HAVE_ECC_CDH
/* Validate import */
#undef WOLFSSL_VALIDATE_ECC_IMPORT
//#define WOLFSSL_VALIDATE_ECC_IMPORT
/* Compressed Key Support */
#undef HAVE_COMP_KEY
//#define HAVE_COMP_KEY
/* Use alternate ECC size for ECC math */
#ifdef USE_FAST_MATH
#ifdef NO_RSA
/* Custom fastmath size if not using RSA */
/* MAX = ROUND32(ECC BITS 384) + SIZE_OF_MP_DIGIT(32) */
#undef FP_MAX_BITS
#define FP_MAX_BITS (384 + 32)
#else
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#endif
/* Speedups specific to curve */
#ifndef NO_ECC256
#undef TFM_ECC256
#define TFM_ECC256
#endif
#ifndef HAVE_ECC384
#undef TFM_ECC384
#define TFM_ECC384
#endif
#endif
#endif
/* DH */
#undef NO_DH
#if 0
/* Use table for DH instead of -lm (math) lib dependency */
#if 0
#define WOLFSSL_DH_CONST
#endif
#define HAVE_FFDHE_2048
//#define HAVE_FFDHE_4096
//#define HAVE_FFDHE_6144
//#define HAVE_FFDHE_8192
#else
#define NO_DH
#endif
/* AES */
#undef NO_AES
#if 1
#undef HAVE_AES_CBC
#define HAVE_AES_CBC
/* If you need other than AES-CBC mode, you must undefine WOLFSSL_CRYPTOCELL_AES */
#if !defined(WOLFSSL_CRYPTOCELL_AES)
#undef HAVE_AESGCM
#define HAVE_AESGCM
/* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#define GCM_SMALL
#undef WOLFSSL_AES_DIRECT
//#define WOLFSSL_AES_DIRECT
#undef HAVE_AES_ECB
//#define HAVE_AES_ECB
#undef WOLFSSL_AES_COUNTER
//#define WOLFSSL_AES_COUNTER
#undef HAVE_AESCCM
//#define HAVE_AESCCM
#endif
#else
#define NO_AES
#endif
/* DES3 */
#undef NO_DES3
#if 0
#else
#define NO_DES3
#endif
/* ChaCha20 / Poly1305 */
#undef HAVE_CHACHA
#undef HAVE_POLY1305
#if 0
#define HAVE_CHACHA
#define HAVE_POLY1305
/* Needed for Poly1305 */
#undef HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH
#endif
/* Ed25519 / Curve25519 */
#undef HAVE_CURVE25519
#undef HAVE_ED25519
#if 0
#define HAVE_CURVE25519
#define HAVE_ED25519 /* ED25519 Requires SHA512 */
/* Optionally use small math (less flash usage, but much slower) */
#if 1
#define CURVED25519_SMALL
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Hashing */
/* ------------------------------------------------------------------------- */
/* Sha */
#undef NO_SHA
#if 1
/* 1k smaller, but 25% slower */
//#define USE_SLOW_SHA
#else
#define NO_SHA
#endif
/* Sha256 */
#undef NO_SHA256
#if 1
/* not unrolled - ~2k smaller and ~25% slower */
//#define USE_SLOW_SHA256
/* Sha224 */
#if 0
#define WOLFSSL_SHA224
#endif
#else
#define NO_SHA256
#endif
/* Sha512 */
#undef WOLFSSL_SHA512
#if 0
#define WOLFSSL_SHA512
/* Sha384 */
#undef WOLFSSL_SHA384
#if 0
#define WOLFSSL_SHA384
#endif
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA512
#endif
/* Sha3 */
#undef WOLFSSL_SHA3
#if 0
#define WOLFSSL_SHA3
#endif
/* MD5 */
#undef NO_MD5
#if 0
#else
#define NO_MD5
#endif
/* HKDF */
#undef HAVE_HKDF
#if 0
#define HAVE_HKDF
#endif
/* CMAC */
#undef WOLFSSL_CMAC
#if 0
#define WOLFSSL_CMAC
#endif
/* ------------------------------------------------------------------------- */
/* Benchmark / Test */
/* ------------------------------------------------------------------------- */
/* Use reduced benchmark / test sizes */
#undef BENCH_EMBEDDED
#define BENCH_EMBEDDED
#undef USE_CERT_BUFFERS_2048
#define USE_CERT_BUFFERS_2048
//#undef USE_CERT_BUFFERS_1024
//#define USE_CERT_BUFFERS_1024
#undef USE_CERT_BUFFERS_256
#define USE_CERT_BUFFERS_256
/* ------------------------------------------------------------------------- */
/* Debugging */
/* ------------------------------------------------------------------------- */
#undef DEBUG_WOLFSSL
#undef NO_ERROR_STRINGS
#if 0
#define DEBUG_WOLFSSL
#else
#if 0
#define NO_ERROR_STRINGS
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Memory */
/* ------------------------------------------------------------------------- */
/* Override Memory API's */
#if 0
#undef XMALLOC_OVERRIDE
#define XMALLOC_OVERRIDE
/* prototypes for user heap override functions */
/* Note: Realloc only required for normal math */
#include <stddef.h> /* for size_t */
extern void *myMalloc(size_t n, void* heap, int type);
extern void myFree(void *p, void* heap, int type);
extern void *myRealloc(void *p, size_t n, void* heap, int type);
#define XMALLOC(n, h, t) myMalloc(n, h, t)
#define XFREE(p, h, t) myFree(p, h, t)
#define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
#endif
#if 0
/* Static memory requires fast math */
#define WOLFSSL_STATIC_MEMORY
/* Disable fallback malloc/free */
#define WOLFSSL_NO_MALLOC
#if 1
#define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
#endif
#endif
/* Memory callbacks */
#if 0
#undef USE_WOLFSSL_MEMORY
#define USE_WOLFSSL_MEMORY
/* Use this to measure / print heap usage */
#if 1
#undef WOLFSSL_TRACK_MEMORY
#define WOLFSSL_TRACK_MEMORY
#undef WOLFSSL_DEBUG_MEMORY
#define WOLFSSL_DEBUG_MEMORY
#endif
#else
#ifndef WOLFSSL_STATIC_MEMORY
#define NO_WOLFSSL_MEMORY
/* Otherwise we will use stdlib malloc, free and realloc */
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Port */
/* ------------------------------------------------------------------------- */
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
#define WOLFSSL_GMTIME
#define USER_TICKS
#if !defined(WOLFSSL_CRYPTOCELL)
// extern unsigned long my_time(unsigned long* timer);
// #define XTIME my_time
#endif
/* ------------------------------------------------------------------------- */
/* RNG */
/* ------------------------------------------------------------------------- */
#if defined(WOLFSSL_CRYPTOCELL)
// /* Override P-RNG with HW RNG */
#undef CUSTOM_RAND_GENERATE_BLOCK
#define CUSTOM_RAND_GENERATE_BLOCK cc310_random_generate
//#define CUSTOM_RAND_GENERATE_BLOCK nrf_random_generate
//#define WOLFSSL_GENSEED_FORTEST /* for software RNG*/
#else
#define WOLFSSL_GENSEED_FORTEST
#endif
/* ------------------------------------------------------------------------- */
/* Enable Features */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_TLS13
#if 0
#define WOLFSSL_TLS13
#endif
#undef WOLFSSL_KEY_GEN
#if 1
#define WOLFSSL_KEY_GEN
#endif
/* reduce DH test time */
#define WOLFSSL_OLD_PRIME_CHECK
#undef KEEP_PEER_CERT
//#define KEEP_PEER_CERT
#undef HAVE_COMP_KEY
//#define HAVE_COMP_KEY
#undef HAVE_TLS_EXTENSIONS
#define HAVE_TLS_EXTENSIONS
#undef HAVE_SUPPORTED_CURVES
#define HAVE_SUPPORTED_CURVES
#undef WOLFSSL_BASE64_ENCODE
#define WOLFSSL_BASE64_ENCODE
/* TLS Session Cache */
#if 0
#define SMALL_SESSION_CACHE
#else
#define NO_SESSION_CACHE
#endif
/* ------------------------------------------------------------------------- */
/* Disable Features */
/* ------------------------------------------------------------------------- */
#undef NO_WOLFSSL_SERVER
//#define NO_WOLFSSL_SERVER
#undef NO_WOLFSSL_CLIENT
//#define NO_WOLFSSL_CLIENT
#undef NO_CRYPT_TEST
//#define NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
//#define NO_CRYPT_BENCHMARK
#undef WOLFCRYPT_ONLY
//#define WOLFCRYPT_ONLY
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */
#undef NO_INLINE
//#define NO_INLINE
#undef NO_FILESYSTEM
#define NO_FILESYSTEM
#undef NO_WRITEV
#define NO_WRITEV
#undef NO_MAIN_DRIVER
#define NO_MAIN_DRIVER
#undef NO_DEV_RANDOM
#define NO_DEV_RANDOM
#undef NO_DSA
#define NO_DSA
#undef NO_RC4
#define NO_RC4
#undef NO_OLD_TLS
#define NO_OLD_TLS
#undef NO_HC128
#define NO_HC128
#undef NO_RABBIT
#define NO_RABBIT
#undef NO_PSK
#define NO_PSK
#undef NO_MD4
#define NO_MD4
#undef NO_PWDBASED
#define NO_PWDBASED
#undef NO_CODING
//#define NO_CODING
#undef NO_ASN_TIME
//#define NO_ASN_TIME
#undef NO_CERTS
//#define NO_CERTS
#undef NO_SIG_WRAPPER
//#define NO_SIG_WRAPPER
#ifdef __cplusplus
}
#endif
#endif /* WOLFSSL_USER_SETTINGS_H */

183
IDE/CSBENCH/.cproject Normal file
View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug.16169494">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug.16169494" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/wolfcrypt"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/wolfcrypt/Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="wolfssl" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.mentor.embedded.toolchains.core.nucleus.FuseErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="wolfssl" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="cs-rm -rf" description="" id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug.16169494" name="Debug" parent="cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug.16169494." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mentor.nucleus.lib.debug.223487397" name="Sourcery CodeBench for Nucleus" superClass="cdt.managedbuild.toolchain.gnu.mentor.nucleus.lib.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.mentor.nucleus.1602489785" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.mentor.nucleus"/>
<builder buildPath="${workspace_loc:/wolfcrypt}/Debug" id="cdt.managedbuild.builder.gnu.mentor.nucleus.1164120304" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CodeSourcery GNU Builder" superClass="cdt.managedbuild.builder.gnu.mentor.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.archiver.nucleus.729368558" name="CodeSourcery GNU Archiver" superClass="cdt.managedbuild.tool.gnu.mentor.archiver.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.cpp.compiler.nucleus.1374010562" name="CodeSourcery GNU C++ Compiler" superClass="cdt.managedbuild.tool.gnu.mentor.cpp.compiler.nucleus">
<option id="mentor.gnu.cpp.compiler.option.optimization.level.2002648562" name="Optimization Level" superClass="mentor.gnu.cpp.compiler.option.optimization.level" value="mentor.gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="mentor.gnu.cpp.compiler.option.debugging.level.498021118" name="Debug Level" superClass="mentor.gnu.cpp.compiler.option.debugging.level" value="mentor.gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="mentor.gnu.cpp.compiler.option.indexer_include.2050335782" name="Include paths for indexer" superClass="mentor.gnu.cpp.compiler.option.indexer_include" valueType="includePath">
<listOptionValue builtIn="false" value="${CFG_INCLUDE}"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/./"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/bsp/arch/plat-realview_eb/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/arch/arm/tool-csgnu_arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/tool-csgnu_arm/"/>
</option>
</tool>
<tool id="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.2014778929" name="CodeSourcery GNU C Compiler" superClass="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus">
<option defaultValue="mentor.gnu.c.optimization.level.none" id="mentor.gnu.c.compiler.option.optimization.level.398007200" name="Optimization Level" superClass="mentor.gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="mentor.gnu.c.compiler.option.debugging.level.732537986" name="Debug Level" superClass="mentor.gnu.c.compiler.option.debugging.level" value="mentor.gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="mentor.gnu.c.compiler.option.indexer_include.1166025607" name="Include paths for indexer" superClass="mentor.gnu.c.compiler.option.indexer_include" valueType="includePath">
<listOptionValue builtIn="false" value="${CFG_INCLUDE}"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/./"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/bsp/arch/plat-realview_eb/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/arch/arm/tool-csgnu_arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/tool-csgnu_arm/"/>
</option>
<option id="mentor.gnu.c.compiler.option.preprocessor.def.symbols.1143748896" name="Defined symbols (-D)" superClass="mentor.gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="WOLFSSL_USER_SETTINGS"/>
</option>
<option id="mentor.gnu.c.compiler.option.include.paths.194565509" name="Include paths (-I)" superClass="mentor.gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.input.923848555" superClass="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.mentor.c.linker.nucleus.1059991805" name="CodeSourcery GNU C Linker" superClass="cdt.managedbuild.tool.gnu.mentor.c.linker.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.cpp.linker.nucleus.1339624750" name="CodeSourcery GNU C++ Linker" superClass="cdt.managedbuild.tool.gnu.mentor.cpp.linker.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.assembler.nucleus.729188509" name="CodeSourcery GNU Assembler" superClass="cdt.managedbuild.tool.gnu.mentor.assembler.nucleus">
<option id="gnu.both.asm.option.debugging.level.260047724" name="Debug Level" superClass="gnu.both.asm.option.debugging.level" value="gnu.both.asm.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.376260780" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="com.mentor.embedded.toolchains.core.nucleus.exportgen.process.403073591" name="Nucleus Exports Generator" superClass="com.mentor.embedded.toolchains.core.nucleus.exportgen.process"/>
<tool id="com.mentor.embedded.toolchains.core.nucleus.exportgen.application.645196251" name="Nucleus Exports Generator" superClass="com.mentor.embedded.toolchains.core.nucleus.exportgen.application"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="src/src/evp.c|src/src/aes_asm.S|src/benchmark|src/user-crypto|src/src/misc.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
<externalSettings containerId="system-project;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
</storageModule>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.release.1927475508">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.release.1927475508" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/wolfcrypt"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/wolfcrypt/Release"/>
<entry flags="RESOLVED" kind="libraryFile" name="wolfssl" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.mentor.embedded.toolchains.core.nucleus.FuseErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="wolfssl" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="cs-rm -rf" description="" id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.release.1927475508" name="Release" parent="cdt.managedbuild.config.gnu.mentor.nucleus.lib.release">
<folderInfo id="cdt.managedbuild.config.gnu.mentor.nucleus.lib.release.1927475508." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mentor.nucleus.lib.release.215643800" name="Sourcery CodeBench for Nucleus" superClass="cdt.managedbuild.toolchain.gnu.mentor.nucleus.lib.release">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.mentor.nucleus.1262083747" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.mentor.nucleus"/>
<builder buildPath="${workspace_loc:/wolfcrypt}/Release" id="cdt.managedbuild.builder.gnu.mentor.nucleus.656729475" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CodeSourcery GNU Builder" superClass="cdt.managedbuild.builder.gnu.mentor.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.archiver.nucleus.1642691673" name="CodeSourcery GNU Archiver" superClass="cdt.managedbuild.tool.gnu.mentor.archiver.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.cpp.compiler.nucleus.53089999" name="CodeSourcery GNU C++ Compiler" superClass="cdt.managedbuild.tool.gnu.mentor.cpp.compiler.nucleus">
<option id="mentor.gnu.cpp.compiler.option.optimization.level.1972432162" name="Optimization Level" superClass="mentor.gnu.cpp.compiler.option.optimization.level" value="mentor.gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="mentor.gnu.cpp.compiler.option.debugging.level.1063240694" name="Debug Level" superClass="mentor.gnu.cpp.compiler.option.debugging.level"/>
<option id="mentor.gnu.cpp.compiler.option.indexer_include.482283905" name="Include paths for indexer" superClass="mentor.gnu.cpp.compiler.option.indexer_include" valueType="includePath">
<listOptionValue builtIn="false" value="${CFG_INCLUDE}"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/./"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/bsp/arch/plat-realview_eb/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/arch/arm/tool-csgnu_arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/tool-csgnu_arm/"/>
</option>
</tool>
<tool id="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.768508310" name="CodeSourcery GNU C Compiler" superClass="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus">
<option defaultValue="mentor.gnu.c.optimization.level.most" id="mentor.gnu.c.compiler.option.optimization.level.1172306433" name="Optimization Level" superClass="mentor.gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="mentor.gnu.c.compiler.option.debugging.level.1416772866" name="Debug Level" superClass="mentor.gnu.c.compiler.option.debugging.level"/>
<option id="mentor.gnu.c.compiler.option.indexer_include.190263447" name="Include paths for indexer" superClass="mentor.gnu.c.compiler.option.indexer_include" valueType="includePath">
<listOptionValue builtIn="false" value="${CFG_INCLUDE}"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/./"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/bsp/realview_eb_ct926ejs/include/bsp/arch/plat-realview_eb/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/arch/arm/tool-csgnu_arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/"/>
<listOptionValue builtIn="false" value="${SYSTEM_HOME}/os/include/arch/arm/tool-csgnu_arm/"/>
</option>
<option id="mentor.gnu.c.compiler.option.include.paths.378624521" name="Include paths (-I)" superClass="mentor.gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
</option>
<option id="mentor.gnu.c.compiler.option.preprocessor.def.symbols.377672412" name="Defined symbols (-D)" superClass="mentor.gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="WOLFSSL_USER_SETTINGS"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.input.390280819" superClass="cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.mentor.c.linker.nucleus.1383453309" name="CodeSourcery GNU C Linker" superClass="cdt.managedbuild.tool.gnu.mentor.c.linker.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.cpp.linker.nucleus.543421555" name="CodeSourcery GNU C++ Linker" superClass="cdt.managedbuild.tool.gnu.mentor.cpp.linker.nucleus"/>
<tool id="cdt.managedbuild.tool.gnu.mentor.assembler.nucleus.115889274" name="CodeSourcery GNU Assembler" superClass="cdt.managedbuild.tool.gnu.mentor.assembler.nucleus">
<option id="gnu.both.asm.option.debugging.level.886431226" name="Debug Level" superClass="gnu.both.asm.option.debugging.level" value="gnu.both.asm.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.419671347" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="com.mentor.embedded.toolchains.core.nucleus.exportgen.process.278067994" name="Nucleus Exports Generator" superClass="com.mentor.embedded.toolchains.core.nucleus.exportgen.process"/>
<tool id="com.mentor.embedded.toolchains.core.nucleus.exportgen.application.1699281427" name="Nucleus Exports Generator" superClass="com.mentor.embedded.toolchains.core.nucleus.exportgen.application"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="src/src/evp.c|src/src/aes_asm.S|src/benchmark|src/user-crypto|src/src/misc.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
<externalSettings containerId="system-project;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"/>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="wolfcrypt.cdt.managedbuild.target.gnu.mentor.nucleus.lib.1763261605" name="Static Library" projectType="cdt.managedbuild.target.gnu.mentor.nucleus.lib"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mentor.nucleus.lib.release.1927475508;cdt.managedbuild.config.gnu.mentor.nucleus.lib.release.1927475508.;cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.768508310;cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.input.390280819">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.mentor.embedded.toolchains.core.nucleus.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug.16169494;cdt.managedbuild.config.gnu.mentor.nucleus.lib.debug.16169494.;cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.2014778929;cdt.managedbuild.tool.gnu.mentor.c.compiler.nucleus.input.923848555">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.mentor.embedded.toolchains.core.nucleus.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="com.mentor.embedded">
<project systemProject="system-project" version="2017.02.1"/>
</storageModule>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>

33
IDE/CSBENCH/.project Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>wolfcrypt</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>src</name>
<type>2</type>
<locationURI>PARENT-2-PROJECT_LOC../wolfcrypt</locationURI>
</link>
</linkedResources>
</projectDescription>

8
IDE/CSBENCH/include.am Normal file
View File

@ -0,0 +1,8 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/CSBENCH/.project
EXTRA_DIST+= IDE/CSBENCH/.cproject
EXTRA_DIST+= IDE/CSBENCH/user_settings.h

View File

@ -0,0 +1,22 @@
#ifndef WOLFSSL_CSBENCH_H
#define WOLFSSL_CSBENCH_H
/* wolfSSL settings */
#define WOLFCRYPT_ONLY
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#define WC_RSA_BLINDING
#define SINGLE_THREADED
#define HAVE_AESGCM
#define NO_ASN_TIME
#define HAVE_ECC
#define ECC_TIMING_RESISTANT
#define WOLFSSL_NUCLEUS
/* wolfSSH settings */
#define WOLFSSH_SFTP
//#define DEBUG_WOLFSSH
#endif

225
IDE/ECLIPSE/DEOS/README.md Normal file
View File

@ -0,0 +1,225 @@
# Deos Port
## Overview
You can enable the wolfSSL support for Deos RTOS available [here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using the `#define WOLFSSL_DEOS`.
Deos is a time & space partitioned, multi-core enabled, DO-178C DAL A certifiable RTOS.
## Usage
You can start with your OpenArbor IDE-based example project for Deos with the network stack (lwip) to integrate wolfSSL source code.
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/DEOS/user_settings.h` file.
The `tls_wolfssl.c` example application provides a simple function to run the selected examples at compile time through the following four #defines in user_settings.h. You can undefine any of these macro options to run a test.
```
1. #undef NO_CRYPT_TEST
2. #undef NO_CRYPT_BENCHMARK
3. #undef NO_WOLFSSL_CLIENT
4. #undef NO_WOLFSSL_SERVER
```
Do one of the following steps for building and running wolfSSL with the Deos kernel examples, which are included in the DDS release:
If you want to create a project from scratch, skip the Importing the project section and follow the steps in the other sections.
If you want to use an pre-configured example project, go to the Importing the project section, skip the other sections and follow the Building and Running section.
#### Importing the project
In this section you will import a pre-configured example project.
1. Launch the OpenArbor IDE as an administrator
2. In the Workspace Launcher dialog, in the Workspace field, enter your
workspace
3. Right-click in the Project Explorer view and select Import
4. In the Import dialog, select General > Existing Projects into Workspace, then click Next.
5. In the Import Projects dialog, select Select archive file, then browse to `IDE/ECLIPSE/DEOS/` and double-click `deosWolfssl.zip` file
6. In the Import Projects dialog, click Finish
#### Setting up a Deos project with wolfSSL
1. Download the wolfSSL source code or a zip file from GitHub. You can remove all of the files except for these folders and its contents. The top folder for this example is wolfsslPort.
```
wolfsslPort
|-- IDE
| -- ECLIPSE
| -- DEOS
|-- src
|-- wolfcrypt
| -- benchmark
| -- src
| -- test
|-- wolfssl
|-- openssl
|-- wolfcrypt
|-- port
```
2. Remove these two platform specific assembly source files:
- wolfsslPort/wolfcrypt/src/aes_asm.asm
- wolfsslPort/wolfcrypt/src/aes_asm.S
3. Launch the OpenArbor IDE as an administrator
4. Create a DDC-I Deos example project. In the main menu, go to File >DDC-I Deos example project > socket > udp-vs-tcp
5. Import the `wolfSSLPort` source code into your project.
- Right-click the ` udp-vs-tcp` project and choose File -> Import.
- Expand the General folder and select File System, then click Next. You should now see the Import File system dialog.
- Browse to the location containing the wolfSSL code and choose OK. Select the `wolfsslPort` folder and check the `Create top-level folder` button, then select Finish. You should see the folder hierarchy the same as wolfSSL folder structures.
6. Review the configuration in $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h
7. Review the custom malloc/realloc/free configuration $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/deos_malloc.c . Memory allocated with malloc() is never freed.
#### Configuring the Deos Project
1. Customize your config/udp-vs-tcp.pd.xml with the following changes:
```
<processTemplate
mutexQuota = "5"
>
<logicalMemoryPools>
pagesNeeded = "500"
></pool>
</logicalMemoryPools>
<threadTemplate
stackSizeInPages = "20"
></threadTemplate>
<mutexTemplates>
<mutexTemplate
name = "protectWolfSSLTemp"
lockTimeInUsec = "40"
priority = "fastest"
></mutexTemplate>
</mutexTemplates>
</processTemplate>
```
Depending on your configuration, wolfSSL uses upto four mutexes. You also need to configure enough memory for the stack of each threads and the process logical memory pool.
2. Right click on the `udp-vs-tcp` project, select properties and add the following macros in the DDC-I Options > C Compile > Preprocessor
- DEOS_ALLOW_OBSOLETE_DEFINITIONS
- WOLFSSL_USER_SETTINGS
3. Add the following directory paths in the DDC-I Options > C Compile > Directories and in the DDC-I Options > C++ Compile > Directories
- $(PROJECT_DIR)/wolfsslPort
- $(PROJECT_DIR)/wolfsslPort/wolfssl
- $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS
- $(PROJECT_DIR.printx)/code
4. Change the optimization level in the DDC-I Options > C Compile > Code Generation > Optimization level:g
- g
5. Add the following library dependencies in the DDC-I Options > Deos > Dependencies
- math
- dart
- ansi
- printx
- You must add printx into your workspace, File >DDC-I Deos example project > training > printx
6. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to customize your configuration. For example, you can undef or define these tests.
- #undef NO_CRYPT_TEST
- #undef NO_CRYPT_BENCHMARK
- #undef NO_WOLFSSL_CLIENT
- #undef NO_WOLFSSL_SERVER
7. Edit your application source file where main() thread is defined and add the following:
- #include "printx.h"
- #include "tls_wolfssl.h"
- and a call to `wolfsslRunTests()`
Here's an example:
```
#include <deos.h>
#include <printx.h>
#include <tls_wolfssl.h>
#include <user_settings.h>
int main(void)
{
initPrintx("");
printf("TLS wolfssl example!\n");
(void) waitUntilNextPeriod();
wolfsslRunTests();
deleteThread(currentThreadHandle());
}
```
8. Review $(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config configuration.
```
transportConfigurationId
2 # Client thread quota - for client and server TCP
2 # Client connection quota - one for client and one for server
0 # Server startup quota
0 # Server connection quota
transportMemoryObject # Name of memory object used for managing connections
/
connectionId1 # TCP client connection
Network # Server process name
defaultMailbox # Server connection request mailbox name
0 # Server connection mailbox queue size (unused by Network process)
userServiceThread # Server thread template name
* # Error timeout
1 # Client connection mailbox queue size
/
connectionId2 # TCP connection
Network # Server process name
defaultMailbox # Server connection request mailbox name
0 # Server connection mailbox queue size (unused by Network process)
userServiceThread # Server thread template name
* # Error timeout
1 # Client connection mailbox queue size
/
```
#### Building and Running
1. Build your project, then load and run your image on a target platform. Review the test results on the console output.
### `wolfcrypt_test()`
wolfcrypt_test() prints a message on the target console similar to the following output:
```
error test passed!
base64 test passed!
asn test passed!
...
```
This example doesn't show the whole output.
### `benchmark_test()`
benchmark_test() prints a message on the target console similar to the following output.
```
------------------------------------------------------------------------------
wolfSSL version 3.15.5
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 225 KB tooks 1.026 seconds, 219.313 KB/s
AES-128-CBC-enc 250 KB toks 1.105 seconds 226.210 KB/s
AES-128-CBC-dec 225 KB tooks 1.005 seconds, 223.922 KB/s
...
```
This example doesn't show the whole output.
### `wolfssl_client_test()`
You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros in the `tls_wolfssl.c` file to configure the host address and port. You will also need to define the server certificate. The example client uses the GET request to get a web resource from the server at https://google.com.
### `wolfssl_server_test()`
You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to configure the port number to listen on a local-host.
Once you start the TLS server and `Listening for client connection` displays on the serial console, the server is ready to accept client connections.
You can connect to the server using the wolfssl TLS client example from your Linux or Windows host as follows:
```
$ ./examples/client/client.exe -h TLS_SERVER_IP_ADDRESS
The client outputs messages similar to the following:
SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
SSL curve name is SECP256R1
I hear ya fa shizzle!
```
## References
The test results were collected from the qemu-x86 reference platform target with the following software and tool chains:
- OpenArbor, eclipse based IDE, toolVersion = "3.31.0"
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
For more information or questions, please email [support@wolfssl.com](mailto:support@wolfssl.com)

View File

@ -0,0 +1,108 @@
/* deos_malloc.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1))
#define SIZEOF_HEADER sizeof(size_t) /* tracks size of allocated block */
#define HEAP_SIZE_MAX (1*1024*1024)
static size_t allocatedMemory = 0;
size_t getMemAllocatedSize_deos(size_t* size){
if (size)
*size = allocatedMemory;
return allocatedMemory;
}
/* Simply returns without freeing any memory. */
void free_deos(void *ptr) {
//printf("fake free_deos()\n");
return;
}
void *realloc_deos(void *ptr, size_t size) {
void *newptr;
if (size == 0)
return ptr;
newptr = malloc_deos(size);
if (ptr != NULL && newptr != NULL) {
if ( *((char *)ptr - SIZEOF_HEADER) < *((char *)newptr - SIZEOF_HEADER))
size = *((char *)ptr - SIZEOF_HEADER);
XMEMCPY((char *) newptr, (const char *) ptr, size);
free_deos(ptr);
}
return newptr;
}
void *malloc_deos(size_t size) {
PDEOS_SYSTEM_INFO systemInfoPtr;
static VirtualAddressTYP heapAddr = NULL;
static VirtualAddressTYP freeAddr = NULL;
VirtualAddressTYP retAddr = NULL;
DWORD allocationSize = 0;
static int initialized = 0;
if (size <= 0)
return NULL;
if (!initialized) {
systemInfoPtr = (PDEOS_SYSTEM_INFO)getSystemInfoDEOS();
freeAddr = (VirtualAddressTYP)getNextLibraryStartAddress();
allocationSize = (((HEAP_SIZE_MAX - 1) / systemInfoPtr->dwPageSize) + 1) *
systemInfoPtr->dwPageSize;
if (virtualAllocDEOS(freeAddr, allocationSize) != allocSuccess){
printf("ERROR: virtualAllocDEOS failed\n");
return NULL;
}
setNextLibraryStartAddress(freeAddr + allocationSize);
heapAddr = freeAddr;
initialized = 1;
}
size = ROUND_UP(size, sizeof(size_t));
if ((size + SIZEOF_HEADER) > (HEAP_SIZE_MAX - (freeAddr - heapAddr))){
printf("ERROR: malloc_deos cannot allocate from heap memory anymore\n");
return NULL;
}
*freeAddr = size;
freeAddr += SIZEOF_HEADER;
retAddr = freeAddr;
XMEMSET(retAddr, 0, size);
freeAddr += size;
allocatedMemory += size;
return retAddr;
}

View File

@ -0,0 +1,10 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST += \
IDE/ECLIPSE/DEOS/README.md \
IDE/ECLIPSE/DEOS/user_settings.h \
IDE/ECLIPSE/DEOS/tls_wolfssl.h \
IDE/ECLIPSE/DEOS/tls_wolfssl.c \
IDE/ECLIPSE/DEOS/deos_malloc.c

View File

@ -0,0 +1,599 @@
/* tls_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfcrypt/test/test.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include <wolfssl/wolfcrypt/logging.h> /* to use WOLFSSL_MSG */
#include <tls_wolfssl.h>
int setupTransport(clientConnectionHandleType* connectionHandle,
char* connectionId) {
int ret, error;
void * sendBuffer;
DWORD bufferSizeInBytes;
if ((ret = socketTransportInitialize("mailbox-transport.config",
"transportConfigurationId",
(DWORD)waitIndefinitely,&error)) != transportSuccess)
printf("Initialize 0x%x, error=%d\n", ret, error);
else if ((ret = socketTransportClientInitialize((DWORD)waitIndefinitely,
&error)) != transportSuccess)
printf("ClientInitialize 0x%x, error=%d\n", ret, error);
else if ((ret = socketTransportCreateConnection(connectionId,
(DWORD)waitIndefinitely,
COMPATIBILITY_ID_2,
connectionHandle,
&sendBuffer,
&bufferSizeInBytes,
&error)) != transportSuccess)
printf("CreateConnection 0x%x, error=%d\n", ret, error);
else if ((ret = socketTransportSetConnectionForThread(currentThreadHandle(),
*connectionHandle,
(DWORD)waitIndefinitely,
&error)) != transportSuccess)
printf("SetConnectionForThread 0x%x, error=%d\n", ret, error);
return ret;
}
#if !defined(NO_WOLFSSL_CLIENT )
/* 172.217.3.174 is the IP address of https://www.google.com */
#define TCP_SERVER_IP_ADDR "172.217.3.174"
#define TCP_SERVER_DOMAIN_NAME "www.google.com"
#define TCP_SERVER_PORT 443
#define TX_BUF_SIZE 64
#define RX_BUF_SIZE 1024
#define TX_MSG "GET /index.html HTTP/1.0\n\n"
#define TX_MSG_SIZE sizeof(TX_MSG)
static const unsigned char google_certs_ca[]="\n\
## Google Internet Authority G3 \n\
-----BEGIN CERTIFICATE-----\n\
MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAw\n\
HgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFs\n\
U2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEy\n\
MTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29nbGUgVHJ1c3Qg\n\
U2VydmljZXMxJTAjBgNVBAMTHEdvb2dsZSBJbnRlcm5ldCBBdXRob3JpdHkgRzMw\n\
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDKUkvqHv/OJGuo2nIYaNVW\n\
XQ5IWi01CXZaz6TIHLGp/lOJ+600/4hbn7vn6AAB3DVzdQOts7G5pH0rJnnOFUAK\n\
71G4nzKMfHCGUksW/mona+Y2emJQ2N+aicwJKetPKRSIgAuPOB6Aahh8Hb2XO3h9\n\
RUk2T0HNouB2VzxoMXlkyW7XUR5mw6JkLHnA52XDVoRTWkNty5oCINLvGmnRsJ1z\n\
ouAqYGVQMc/7sy+/EYhALrVJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWT\n\
kaIeoYvy/sGIJEmjR0vFEwHdp1cSaWIr6/4g72n7OqXwfinu7ZYW97EfoOSQJeAz\n\
AgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUH\n\
AwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCa\n\
Z3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYu\n\
MDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdv\n\
b2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb29nL2dz\n\
cjIvZ3NyMi5jcmwwPwYDVR0gBDgwNjA0BgZngQwBAgIwKjAoBggrBgEFBQcCARYc\n\
aHR0cHM6Ly9wa2kuZ29vZy9yZXBvc2l0b3J5LzANBgkqhkiG9w0BAQsFAAOCAQEA\n\
HLeJluRT7bvs26gyAZ8so81trUISd7O45skDUmAge1cnxhG1P2cNmSxbWsoiCt2e\n\
ux9LSD+PAj2LIYRFHW31/6xoic1k4tbWXkDCjir37xTTNqRAMPUyFRWSdvt+nlPq\n\
wnb8Oa2I/maSJukcxDjNSfpDh/Bd1lZNgdd/8cLdsE3+wypufJ9uXO1iQpnh9zbu\n\
FIwsIONGl1p3A8CgxkqI/UAih3JaGOqcpcdaCIzkBaR9uYQ1X4k2Vg5APRLouzVy\n\
7a8IVk6wuy6pm+T7HT4LY8ibS5FEZlfAFLSW8NwsVz9SBK2Vqn1N0PIMn5xA6NZV\n\
c7o835DLAFshEWfC7TIe3g==\n\
-----END CERTIFICATE-----\n\
## Google Trust Services- GlobalSign Root CA-R2\n\
-----BEGIN CERTIFICATE-----\n\
MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G\n\
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp\n\
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1\n\
MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG\n\
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\n\
hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL\n\
v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8\n\
eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq\n\
tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd\n\
C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa\n\
zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB\n\
mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH\n\
V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n\n\
bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG\n\
3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs\n\
J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO\n\
291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS\n\
ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd\n\
AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7\n\
TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n\
-----END CERTIFICATE-----\n\
";
void wolfssl_client_test(uintData_t statusPtr) {
int sock;
char rx_buf[RX_BUF_SIZE];
char tx_buf[TX_BUF_SIZE];
int ret = 0, error = 0;
sockaddr_in server_addr;
clientConnectionHandleType TCPclientHandle;
WOLFSSL* ssl;
WOLFSSL_CTX* ctx;
/* set up the mailbox transport */
if (setupTransport(&TCPclientHandle, (char*)"connectionId1") != transportSuccess){
printf("TCP transport set up failed \n");
return;
}
printf("Creating a network socket...\n");
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock == SOCKET_ERROR) {
printf("ERROR: Failed to create socket, err = %d\n", errno);
return;
}
printf("Clearing memory for server_addr struct\n");
XMEMSET((char *) &server_addr, 0u, sizeof(server_addr));
printf("Connecting to server IP address: %s, port: %d\n",
TCP_SERVER_IP_ADDR, TCP_SERVER_PORT);
server_addr.sin_family = AF_INET;
server_addr.sin_addr = inet_addr(TCP_SERVER_IP_ADDR);
server_addr.sin_port = htons(TCP_SERVER_PORT);
printf("Calling connect on socket\n");
if (connect(sock, (sockaddr *) &server_addr, sizeof(server_addr)) < 0 ) {
printf("ERROR: connect, err = %d\n", errno);
closesocket(sock);
return;
}
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
/* wolfSSL INIT and CTX SETUP */
wolfSSL_Init();
/* chooses the highest possible TLS version */
ctx = wolfSSL_CTX_new(wolfSSLv23_client_method());
/* SET UP NETWORK SOCKET */
if (ctx == 0) {
printf("ERROR: wolfSSL_CTX_new failed\n");
closesocket(sock);
return;
}
WOLFSSL_MSG("wolfSSL_CTX_new done");
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
ret = wolfSSL_CTX_load_verify_buffer(ctx,
google_certs_ca,
sizeof(google_certs_ca),
SSL_FILETYPE_PEM);
if (ret != SSL_SUCCESS) {
printf("ERROR: wolfSSL_CTX_load_verify_buffer() failed\n");
closesocket(sock);
wolfSSL_CTX_free(ctx);
return;
}
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
printf("ERROR: wolfSSL_new() failed\n");
closesocket(sock);
wolfSSL_CTX_free(ctx);
return;
}
WOLFSSL_MSG("wolfSSL_new done");
ret = wolfSSL_set_fd(ssl, sock);
if (ret != SSL_SUCCESS) {
printf("ERROR: wolfSSL_set_fd() failed\n");
closesocket(sock);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
WOLFSSL_MSG("wolfSSL_set_fd done");
do {
error = 0; /* reset error */
ret = wolfSSL_connect(ssl);
if (ret != SSL_SUCCESS) {
error = wolfSSL_get_error(ssl, 0);
printf("ERROR: wolfSSL_connect() failed, err = %d\n", error);
if (error != SSL_ERROR_WANT_READ) {
closesocket(sock);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
/* goToSleep() for 1 sec*/
}
} while ((ret != SSL_SUCCESS) && (error == SSL_ERROR_WANT_READ));
printf("wolfSSL_connect() ok... sending GET\n");
XSTRNCPY(tx_buf, TX_MSG, TX_MSG_SIZE);
if (wolfSSL_write(ssl, tx_buf, TX_MSG_SIZE) != TX_MSG_SIZE) {
error = wolfSSL_get_error(ssl, 0);
printf("ERROR: wolfSSL_write() failed, err = %d\n", error);
closesocket(sock);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
do {
error = 0; /* reset error */
ret = wolfSSL_read(ssl, rx_buf, RX_BUF_SIZE - 1);
if (ret < 0) {
error = wolfSSL_get_error(ssl, 0);
if (error != SSL_ERROR_WANT_READ) {
printf("wolfSSL_read failed, error = %d\n", error);
closesocket(sock);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
/* goToSleep() for 1 second*/
} else if (ret > 0) {
rx_buf[ret] = 0;
printf("%s\n", rx_buf);
}
} while (error == SSL_ERROR_WANT_READ);
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
wolfSSL_Cleanup();
closesocket(sock);
return;
}
#endif /* NO_WOLFSSL_CLIENT */
#if !defined(NO_WOLFSSL_SERVER)
#define TLS_SERVER_PORT 11111
#define TX_BUF_SIZE 64
#define RX_BUF_SIZE 1024
#define TCP_SERVER_CONN_Q_SIZE 1
/* derived from wolfSSL/certs/server-ecc.der */
static const unsigned char server_ecc_der_256[] = { 0x30, 0x82, 0x03, 0x10,
0x30, 0x82, 0x02, 0xB5, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00,
0xEF, 0x46, 0xC7, 0xA4, 0x9B, 0xBB, 0x60, 0xD3, 0x30, 0x0A, 0x06, 0x08,
0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x81, 0x8F, 0x31,
0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x57,
0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30,
0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74,
0x74, 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A,
0x0C, 0x07, 0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31, 0x0C, 0x30,
0x0A, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43, 0x43, 0x31,
0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77,
0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x1E,
0x17, 0x0D, 0x31, 0x36, 0x30, 0x38, 0x31, 0x31, 0x32, 0x30, 0x30, 0x37,
0x33, 0x38, 0x5A, 0x17, 0x0D, 0x31, 0x39, 0x30, 0x35, 0x30, 0x38, 0x32,
0x30, 0x30, 0x37, 0x33, 0x38, 0x5A, 0x30, 0x81, 0x8F, 0x31, 0x0B, 0x30,
0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x57, 0x61, 0x73,
0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06,
0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74, 0x74, 0x6C,
0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x07,
0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31, 0x0C, 0x30, 0x0A, 0x06,
0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43, 0x43, 0x31, 0x18, 0x30,
0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31,
0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C,
0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x59, 0x30, 0x13,
0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A,
0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xBB,
0x33, 0xAC, 0x4C, 0x27, 0x50, 0x4A, 0xC6, 0x4A, 0xA5, 0x04, 0xC3, 0x3C,
0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE, 0x94, 0xEA, 0x2B, 0xFA, 0xCB,
0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61, 0x02, 0xE9, 0xAF, 0x4D, 0xD3,
0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97, 0x92, 0x21, 0x7F, 0xF0, 0xCF, 0x18,
0xDA, 0x91, 0x11, 0x02, 0x34, 0x86, 0xE8, 0x20, 0x58, 0x33, 0x0B, 0x80,
0x34, 0x89, 0xD8, 0xA3, 0x81, 0xF7, 0x30, 0x81, 0xF4, 0x30, 0x1D, 0x06,
0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x5D, 0x5D, 0x26, 0xEF,
0xAC, 0x7E, 0x36, 0xF9, 0x9B, 0x76, 0x15, 0x2B, 0x4A, 0x25, 0x02, 0x23,
0xEF, 0xB2, 0x89, 0x30, 0x30, 0x81, 0xC4, 0x06, 0x03, 0x55, 0x1D, 0x23,
0x04, 0x81, 0xBC, 0x30, 0x81, 0xB9, 0x80, 0x14, 0x5D, 0x5D, 0x26, 0xEF,
0xAC, 0x7E, 0x36, 0xF9, 0x9B, 0x76, 0x15, 0x2B, 0x4A, 0x25, 0x02, 0x23,
0xEF, 0xB2, 0x89, 0x30, 0xA1, 0x81, 0x95, 0xA4, 0x81, 0x92, 0x30, 0x81,
0x8F, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C,
0x0A, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31,
0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65,
0x61, 0x74, 0x74, 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
0x04, 0x0A, 0x0C, 0x07, 0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31,
0x0C, 0x30, 0x0A, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43,
0x43, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F,
0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F,
0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
0x82, 0x09, 0x00, 0xEF, 0x46, 0xC7, 0xA4, 0x9B, 0xBB, 0x60, 0xD3, 0x30,
0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01,
0xFF, 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03,
0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xF1, 0xD0, 0xA6,
0x3E, 0x83, 0x33, 0x24, 0xD1, 0x7A, 0x05, 0x5F, 0x1E, 0x0E, 0xBD, 0x7D,
0x6B, 0x33, 0xE9, 0xF2, 0x86, 0xF3, 0xF3, 0x3D, 0xA9, 0xEF, 0x6A, 0x87,
0x31, 0xB3, 0xB7, 0x7E, 0x50, 0x02, 0x21, 0x00, 0xF0, 0x60, 0xDD, 0xCE,
0xA2, 0xDB, 0x56, 0xEC, 0xD9, 0xF4, 0xE4, 0xE3, 0x25, 0xD4, 0xB0, 0xC9,
0x25, 0x7D, 0xCA, 0x7A, 0x5D, 0xBA, 0xC4, 0xB2, 0xF6, 0x7D, 0x04, 0xC7,
0xBD, 0x62, 0xC9, 0x20 };
/* derived from wolfSSL/certs/ecc-key.der */
static const unsigned char ecc_key_der_256[] = { 0x30, 0x77, 0x02, 0x01, 0x01,
0x04, 0x20, 0x45, 0xB6, 0x69, 0x02, 0x73, 0x9C, 0x6C, 0x85, 0xA1, 0x38,
0x5B, 0x72, 0xE8, 0xE8, 0xC7, 0xAC, 0xC4, 0x03, 0x8D, 0x53, 0x35, 0x04,
0xFA, 0x6C, 0x28, 0xDC, 0x34, 0x8D, 0xE1, 0xA8, 0x09, 0x8C, 0xA0, 0x0A,
0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0xA1, 0x44,
0x03, 0x42, 0x00, 0x04, 0xBB, 0x33, 0xAC, 0x4C, 0x27, 0x50, 0x4A, 0xC6,
0x4A, 0xA5, 0x04, 0xC3, 0x3C, 0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE,
0x94, 0xEA, 0x2B, 0xFA, 0xCB, 0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61,
0x02, 0xE9, 0xAF, 0x4D, 0xD3, 0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97, 0x92,
0x21, 0x7F, 0xF0, 0xCF, 0x18, 0xDA, 0x91, 0x11, 0x02, 0x34, 0x86, 0xE8,
0x20, 0x58, 0x33, 0x0B, 0x80, 0x34, 0x89, 0xD8 };
void wolfssl_server_test(uintData_t statusPtr)
{
int sock_listen;
int bindStatus;
int sock_req;
sockaddr_in socketAddr;
sockaddr_in server_addr;
int socketAddrLen=sizeof(sockaddr);
char rx_buf[RX_BUF_SIZE];
char tx_buf[TX_BUF_SIZE];
unsigned char attempt_conn;
clientConnectionHandleType TCPserverHandle;
void * sendBuffer;
DWORD bufferSizeInBytes;
WOLFSSL * ssl;
WOLFSSL_CTX * ctx;
int tx_buf_sz = 0, ret = 0, error = 0;
/* set up the mailbox transport */
/* connectionId2 is defined in the mailbox-transport.config*/
if (setupTransport(&TCPserverHandle, (char*)"connectionId2") != transportSuccess){
printf("TCP transport set up failed \n");
return;
}
/* SET UP NETWORK SOCKET */
printf("Opening network socket...\n");
sock_listen = socket(AF_INET, SOCK_STREAM, 0);
if (sock_listen == SOCKET_ERROR) {
printf("ERROR: socket, err = %d\n", errno);
return;
}
printf("Clearing memory for server_addr struct\n");
XMEMSET((char *) &server_addr, 0u, sizeof(server_addr));
printf("Setting up server_addr struct\n");
server_addr.sin_family = AF_INET;
server_addr.sin_addr = INADDR_ANY;
server_addr.sin_port = htons(TLS_SERVER_PORT);
bindStatus = bind(sock_listen, (sockaddr *) &server_addr, sizeof(server_addr));
if (bindStatus == SOCKET_ERROR) {
printf("ERROR: bind, err = %d\n", errno);
closesocket(sock_listen);
return;
}
/* wolfSSL INIT and CTX SETUP */
wolfSSL_Init();
/* chooses the highest possible TLS version */
ctx = wolfSSL_CTX_new(wolfSSLv23_server_method());
if (ctx == 0) {
printf("ERROR: wolfSSL_CTX_new failed\n");
closesocket(sock_listen);
return;
}
WOLFSSL_MSG("wolfSSL_CTX_new done");
ret = wolfSSL_CTX_use_certificate_buffer(ctx,
server_ecc_der_256,
sizeof(server_ecc_der_256),
SSL_FILETYPE_ASN1);
if (ret != SSL_SUCCESS) {
printf("ERROR: wolfSSL_CTX_use_certificate_buffer() failed, \
err = %d\n", ret);
closesocket(sock_listen);
wolfSSL_CTX_free(ctx);
return;
}
ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
ecc_key_der_256,
sizeof(ecc_key_der_256),
SSL_FILETYPE_ASN1);
if (ret != SSL_SUCCESS) {
printf("ERROR: wolfSSL_CTX_use_PrivateKey_buffer() failed\n");
closesocket(sock_listen);
wolfSSL_CTX_free(ctx);
return;
}
/* accept client socket connections */
printf("Listening for client connection\n");
printf("E.g, you can use ./examples/client/client.exe -h 192.168.219.100\n");
printf(" \n");
listen(sock_listen, TCP_SERVER_CONN_Q_SIZE);
sock_req = accept(sock_listen,
(sockaddr *) &socketAddr,
&socketAddrLen);
if (sock_req == -1) {
printf("ERROR: accept, err = %d\n", errno);
closesocket(sock_listen);
return;
}
printf("Got client connection! Starting TLS negotiation\n");
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
/* set up wolfSSL session */
ssl = wolfSSL_new(ctx);
if (ssl == NULL) {
printf("ERROR: wolfSSL_new() failed\n");
closesocket(sock_req);
closesocket(sock_listen);
wolfSSL_CTX_free(ctx);
return;
}
WOLFSSL_MSG("wolfSSL_new done");
ret = wolfSSL_set_fd(ssl, sock_req);
if (ret != SSL_SUCCESS) {
printf("ERROR: wolfSSL_set_fd() failed\n");
closesocket(sock_req);
closesocket(sock_listen);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
WOLFSSL_MSG("wolfSSL_set_fd done");
do {
error = 0; /* reset error */
if (ret != SSL_SUCCESS) {
error = wolfSSL_get_error(ssl, 0);
printf("ERROR: wolfSSL_accept() failed, err = %d\n", error);
if (error != SSL_ERROR_WANT_READ) {
closesocket(sock_req);
closesocket(sock_listen);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
/* goToSleep() for 500 milli sec*/
}
} while ((ret != SSL_SUCCESS) && (error == SSL_ERROR_WANT_READ));
printf("wolfSSL_accept() ok...\n");
/* read client data */
error = 0;
XMEMSET(rx_buf, 0u, RX_BUF_SIZE);
ret = wolfSSL_read(ssl, rx_buf, RX_BUF_SIZE - 1);
if (ret < 0) {
error = wolfSSL_get_error(ssl, 0);
if (error != SSL_ERROR_WANT_READ) {
printf("wolfSSL_read failed, error = %d\n", error);
closesocket(sock_req);
closesocket(sock_listen);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
}
printf("AFTER wolfSSL_read() call, ret = %d\n", ret);
if (ret > 0) {
rx_buf[ret] = 0;
printf("Client sent: %s\n", rx_buf);
}
/* write response to client */
XMEMSET(tx_buf, 0u, TX_BUF_SIZE);
tx_buf_sz = 22;
XSTRNCPY(tx_buf, "I hear ya fa shizzle!\n", tx_buf_sz);
if (wolfSSL_write(ssl, tx_buf, tx_buf_sz) != tx_buf_sz) {
error = wolfSSL_get_error(ssl, 0);
printf("ERROR: wolfSSL_write() failed, err = %d\n", error);
closesocket(sock_req);
closesocket(sock_listen);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return;
}
ret = wolfSSL_shutdown(ssl);
if (ret == SSL_SHUTDOWN_NOT_DONE)
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
wolfSSL_Cleanup();
closesocket(sock_req);
closesocket(sock_listen);
return;
}
#endif /* NO_WOLFSSL_SERVER */
int wolfsslRunTests (void)
{
thread_handle_t TCPhandle;
threadStatus ts;
int ret;
#if !defined(NO_CRYPT_TEST)
wolfcrypt_test(NULL);
#endif
#if !defined(NO_CRYPT_BENCHMARK)
benchmark_test(NULL);
#endif
#if !defined(NO_WOLFSSL_CLIENT)
ts = createThread("TCPclient", "TCPThreadTemplate", wolfssl_client_test,
0, &TCPhandle );
if (ts != threadSuccess) {
printf("Unable to create TCP client thread, %i ", (DWORD)ts);
}
#endif
#if !defined(NO_WOLFSSL_SERVER)
ts = createThread("TCPserver", "TCPThreadTemplate", wolfssl_server_test,
0, &TCPhandle );
if (ts != threadSuccess) {
printf("Unable to create TCP server thread, %i ", (DWORD)ts);
}
#endif
return 0;
}

View File

@ -0,0 +1,37 @@
/* tls_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef __TLS_WOLFSSL_H__
#define __TLS_WOLFSSL_H__
#ifdef __cplusplus
extern "C" {
#endif
int wolfsslRunTests(void);
void wolfssl_client_test(uintData_t);
void wolfssl_server_test(uintData_t);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* TLS_WOLFSSL_H */

View File

@ -0,0 +1,112 @@
/* user_setting.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef DEOS_USER_SETTINGS_H_
#define DEOS_USER_SETTINGS_H_
#ifdef __cplusplus
extern "C" {
#endif
#define WOLFSSL_DEOS
/* You can select none or all of the following tests
using #define instead of #undef.
By default, all four tests run*/
#undef NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
#undef NO_WOLFSSL_CLIENT
#undef NO_WOLFSSL_SERVER
/* adjust CURRENT_UNIX_TIMESTAMP to seconds since Jan 01 1970. (UTC)
You can get the current time from https://www.unixtimestamp.com/
*/
#define CURRENT_UNIX_TIMESTAMP 1545864916
#define NO_FILESYSTEM
#define SIZEOF_LONG_LONG 8
/* prevents from including multiple definition of main() */
#define NO_MAIN_DRIVER
#define NO_TESTSUITE_MAIN_DRIVER
/* includes certificate test buffers via header files */
#define USE_CERT_BUFFERS_2048
/*use kB instead of mB for embedded benchmarking*/
#define BENCH_EMBEDDED
#define NO_WRITE_TEMP_FILES
#define HAVE_AESGCM
#define WOLFSSL_SHA512
#define HAVE_ECC
#define HAVE_CURVE25519
#define CURVE25519_SMALL
#define HAVE_ED25519
#define ED25519_SMALL
/* TLS 1.3 */
#if 0
#define WOLFSSL_TLS13
#define WC_RSA_PSS
#define HAVE_HKDF
#define HAVE_FFDHE_2048
#define HAVE_AEAD
#endif
#if 0
/* You can use your own custom random generator function with
no input parameters and a `CUSTOM_RAND_TYPE` return type*/
#ifndef CUSTOM_RAND_GENERATE
#define CUSTOM_RAND_TYPE int
#define CUSTOM_RAND_GENERATE yourRandGenFunc
#endif
#endif
#if 1
#undef XMALLOC_OVERRIDE
#define XMALLOC_OVERRIDE
/* prototypes for user heap override functions */
#include <stddef.h> /* for size_t */
extern void *malloc_deos(size_t size);
extern void free_deos(void *ptr);
extern void *realloc_deos(void *ptr, size_t size);
#define XMALLOC(n, h, t) malloc_deos(n)
#define XFREE(p, h, t) free_deos(p)
#define XREALLOC(p, n, h, t) realloc_deos(p, n)
#endif
#define printf printx
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif

View File

@ -0,0 +1,180 @@
# Micrium μC/OS-III Port
## Overview
You can enable the wolfSSL support for Micrium μC/OS-III RTOS available [here](http://www.micriums.com/) using the define `MICRIUM`.
## Usage
You can start with your IDE-based example project for Micrium uC/OS-III and uC/TCPIP stack. You must include the uC-Clk module into your project because wolfSSL uses Micriums Clk_GetTS_Unix () function from <clk.h> in order to authenticate the start and end dates of certificates.
wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/MICRIUM/user_settings.h` file.
The `wolfsslRunTests.c` example application provides a simple function to run the selected examples at compile time through the following four #defines in user_settings.h.
```
1. #define WOLFSSL_WOLFCRYPT_TEST
2. #define WOLFSSL_BENCHMARK_TEST
3. #define WOLFSSL_CLIENT_TEST
4. #define WOLFSSL_SERVER_TEST
You can define one or all of the above options.
```
1. Open your IDE-based example project for Micrium uC/OS-III (with the uC-Clk module) and uC/TCPIP stack.
2. Create the following folder and sub-folders structures in your project.
```
wolfssl
|src
|wolfcrypt
|benchmark
|src
|test
|wolfssl
|openssl
|wolfcrypt
|exampleTLS
```
The folder hierarchy is the same as the wolfSSL folders with an exception of the exampleTLS folder.
3. Right click on the exampleTLS folder, add or link all of the header and source files in `IDE/ECLIPSE/MICRIUM/` folder into the exampleTLS folder.
4. Right click on each folders, add or link all the source code in the corresponding folder in wolfSSL.
5. Remove non-C platform dependent files from your build. At the moment, only aes_asm.asm and aes_asm.s must be removed from your wolfssl/wolfcrypt/src folder.
6. In your C/C++ compiler preprocessor settings, add the wolfSSL directories to your include paths.
Here's an example of the paths that must be added.
```
$PROJ_DIR$\...
$PROJ_DIR$\...\wolfcrypt
$PROJ_DIR$\...\wolfssl
$PROJ_DIR$\...\IDE\ECLIPSE\MICRIUM
```
7. In your C/C++ compiler preprocessor settings, define the WOLFSSL_USER_SETTINGS symbol to add user_settings.h file in your project.
8. Add a call to `wolfsslRunTests()` from your startup task. Here's an example:
```
static void App_TaskStart (void *p_arg)
{
OS_ERR os_err;
...
while (DEF_TRUE) {
wolfsslRunTests();
OSTimeDlyHMSM(0u, 5u, 0u, 0u,OS_OPT_TIME_HMSM_STRICT, &os_err);
}
}
```
9. Rebuild all your project.
10. Now you are ready to download and debug your image on the board.
The test results below were collected from the NXP Kinetis K70 (Freescale TWR-K70F120M MCU) tower system board with the following software and tool chains:
- IAR Embedded Workbench IDE - ARM 8.32.1 (IAR ELF Linker V8.32.1.169/W32 for ARM)
- The starting project is based on an IAR EWARM project from Micrium download center at [micrium_twr-k70f120m-os3/](https://www.micrium.com/download/micrium_twr-k70f120m-os3/) but the K70X_FLASH.icf linker script file was slightly modified to configure the stack and heap sizes to 16KB and 20KB. The test was run on a 1 MBytes of program flash and 128 KBytes of static RAM.
- wolfssl [latest version](https://github.com/wolfSSL/wolfssl)
### `WOLFSSL_WOLFCRYPT_TEST` output of wolfcrypt_test()
```
error test passed!
base64 test passed!
asn test passed!
MD5 test passed!
MD4 test passed!
SHA test passed!
SHA-256 test passed!
SHA-512 test passed!
Hash test passed!
HMAC-MD5 test passed!
HMAC-SHA test passed!
HAC-SHA256 test passed!
HMAC-SHA512 test passed!
GMC test passed!
HC-128 test passed!
Rabbit test passed!
DS test passed!
DS3 test passed!
AES test passed!
AES192 test passed!
AES256 test passed!
AES-GM test passed!
RANDOM test passed!
RSA test passed!
DH test passed!
DSA test passed!
PWDBASED test passed!
ECC test passed!
ECC buffer test passed!
CURVE25519 test passed!
ED25519 test passed!
logging test passed!
mutex test passed!
memcb test passed!
```
### `WOLFSSL_BENCHMARK_TEST` output of benchmark_test()
```
------------------------------------------------------------------------------
wolfSSL version 3.15.5
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG 225 KB tooks 1.026 seconds, 219.313 KB/s
AES-128-CBC-enc 250 KB toks 1.105 seconds 226.210 KB/s
AES-128-CBC-dec 225 KB tooks 1.005 seconds, 223.922 KB/s
AES-192-CBC-enc 225 KB tooks 1.076 seconds, 209.104 KB/s
AES-192-CBC-dec 225 KB tooks 1.077 seconds, 208.981 K/s
AES-56-CBC-enc 200 KB tooks 1.029 seconds, 19.396 KB/s
AES-256-CBC-dec 200 KB toks 1.022 seconds, 195.785 KB/s
AES-128-GCM-enc 125 KB tooks 1.28 secnds, 101.70 KB/s
AES-128-GC-dec 125 KB tooks 1.228 seconds 101.756 KB/s
AES-192-GCM-enc 100 KB tooks 1.026 seconds, 97.493 KB/s
AES-192-GCM-dec 100 KB tooks 1.026 seconds, 97.480 KB/s
AES-256-GCM-enc 100 KB tooks 1.065 seconds, 93.909 KB/s
AES-256-GC-dec 100 KB tooks 1.065 seconds, 93.897 KB/s
RABBIT 2 MB tooks 1.011 seconds, 2.19 MB/s
3DES 100 KB tooks 1.007 sconds, 99.312 KB/s
MD5 3MB tooks 1.008 seonds, 2.907 MBs
SHA 1 MB tooks 1.09 secnds, 1.283 MB/s
SHA-256 575 KB tooks 1.037 seconds, 554.501 KB/s
SHA-512 200 KB tooks 1.003 seconds, 199.444 KB/s
HMAC-MD5 3 B tooks 1.002 seconds, 2.876 MB/s
HMAC-SHA26 550 KB tooks 1.000 seconds, 549.95 KB//s
HMAC-SHA512 200 KB toks 1.018 seconds, 196.452 KB/s
RSA 2048 public 8 ops took 1.025 sec, avg 128.135 ms, 7.804 op/sec
RSA 2048 private 2 ops took 4.972 ec, avg 2485.951 s, 0.402 ops/sec
DH 2048 key en 2 ops took 1.927 sec, avg 96.303 ms, 1.038 op/sec
DH 2048 agree 2ops took 1.937 sc, avg 968.578 ms, 1.032 ops/sec
ECC 256 key gen 3 ops took 1.185 sec, avg 394.944 ms, 2.53 ops/sec
ECDHE 256 agree 4 ops took 1.585 sec, avg 396.168 ms, 2.524 ops/sec
ECSA 256 sign 4 ops took 1.611 sec, avg 402.865 ms, 2.482 ops/sec
ECDSA 256verif 2 ops tok 1.586 sec, avg 793.153 ms, 1.261 opssec
CURVE 25519 key gen 2 ops took 1.262 sec, avg 630.907 ms, 1.585 ops/sec
CURE 25519 agree 2 ops took 1.261 sec, avg630.469 ms, 1.586 ops/sec
ED 2519 key gen 2 ops took 1.27 sec, avg 66.099ms, 1.572 ops/sec
ED 25519 sign 2 ops took 1.303 sec, ag 65.633 ms, 1.35 op/sec
ED 25519 verify 2 ops took 2.674 sec, avg1337.68 ms 0.748 ops/ec
```
### `WOLFSSL_CLIENT_TEST` wolfssl_client_test()
You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros at top of the `client_wolfssl.c` file to configure the host address and port. You will also need the server certificate. This example uses TLS 1.2 to connect to a remote host.
### `WOLFSSL_SERVER_TEST` wolfssl_server_test()
You can modify the `TLS_SERVER_PORT` at top of `server_wolfssl.c` to configure the port number to listen on local-host.
Once you start the TLS server and `Listening for client connection` displays on the serial console, the server is ready to accept client connections.
You can connect to the server using the wolfssl TLS client example from your Linux or Windows host as follows:
$ ./examples/client/client.exe -h TLS_SERVER_IP_ADDRES
SSL version is TLSv1.2
SSL cipher suite is TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
SSL curve name is SECP256R1
I hear ya fa shizzle!
## References
For more information please contact info@wolfssl.com.

View File

@ -0,0 +1,277 @@
/* client_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <Source/net_sock.h>
#include <Source/net_app.h>
#include <Source/net_ascii.h>
#include <Source/net_util.h>
#include <lib_str.h>
#include <app_cfg.h>
#include <wolfssl/ssl.h>
#include "client_wolfssl.h"
/* 172.217.3.174 is the IP address of https://www.google.com */
#define TCP_SERVER_IP_ADDR "172.217.3.174"
#define TCP_SERVER_DOMAIN_NAME "www.google.com"
#define TCP_SERVER_PORT 443
#define TX_BUF_SIZE 64
#define RX_BUF_SIZE 1024
#define TX_MSG "GET /index.html HTTP/1.0\r\n\r\n"
#define TX_MSG_SIZE sizeof(TX_MSG)
static const CPU_INT08U google_certs_ca[]="\n\
## Google Internet Authority G3 \n\
-----BEGIN CERTIFICATE-----\n\
MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAw\n\
HgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFs\n\
U2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEy\n\
MTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29nbGUgVHJ1c3Qg\n\
U2VydmljZXMxJTAjBgNVBAMTHEdvb2dsZSBJbnRlcm5ldCBBdXRob3JpdHkgRzMw\n\
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDKUkvqHv/OJGuo2nIYaNVW\n\
XQ5IWi01CXZaz6TIHLGp/lOJ+600/4hbn7vn6AAB3DVzdQOts7G5pH0rJnnOFUAK\n\
71G4nzKMfHCGUksW/mona+Y2emJQ2N+aicwJKetPKRSIgAuPOB6Aahh8Hb2XO3h9\n\
RUk2T0HNouB2VzxoMXlkyW7XUR5mw6JkLHnA52XDVoRTWkNty5oCINLvGmnRsJ1z\n\
ouAqYGVQMc/7sy+/EYhALrVJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWT\n\
kaIeoYvy/sGIJEmjR0vFEwHdp1cSaWIr6/4g72n7OqXwfinu7ZYW97EfoOSQJeAz\n\
AgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUH\n\
AwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCa\n\
Z3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYu\n\
MDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdv\n\
b2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb29nL2dz\n\
cjIvZ3NyMi5jcmwwPwYDVR0gBDgwNjA0BgZngQwBAgIwKjAoBggrBgEFBQcCARYc\n\
aHR0cHM6Ly9wa2kuZ29vZy9yZXBvc2l0b3J5LzANBgkqhkiG9w0BAQsFAAOCAQEA\n\
HLeJluRT7bvs26gyAZ8so81trUISd7O45skDUmAge1cnxhG1P2cNmSxbWsoiCt2e\n\
ux9LSD+PAj2LIYRFHW31/6xoic1k4tbWXkDCjir37xTTNqRAMPUyFRWSdvt+nlPq\n\
wnb8Oa2I/maSJukcxDjNSfpDh/Bd1lZNgdd/8cLdsE3+wypufJ9uXO1iQpnh9zbu\n\
FIwsIONGl1p3A8CgxkqI/UAih3JaGOqcpcdaCIzkBaR9uYQ1X4k2Vg5APRLouzVy\n\
7a8IVk6wuy6pm+T7HT4LY8ibS5FEZlfAFLSW8NwsVz9SBK2Vqn1N0PIMn5xA6NZV\n\
c7o835DLAFshEWfC7TIe3g==\n\
-----END CERTIFICATE-----\n\
## Google Trust Services- GlobalSign Root CA-R2\n\
-----BEGIN CERTIFICATE-----\n\
MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G\n\
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp\n\
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1\n\
MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG\n\
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\n\
hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL\n\
v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8\n\
eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq\n\
tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd\n\
C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa\n\
zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB\n\
mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH\n\
V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n\n\
bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG\n\
3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs\n\
J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO\n\
291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS\n\
ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd\n\
AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7\n\
TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n\
-----END CERTIFICATE-----\n\
";
int wolfssl_client_test(void) {
NET_ERR err;
NET_SOCK_ID sock;
NET_IPv4_ADDR server_ip_addr;
NET_SOCK_ADDR_IPv4 server_addr;
CPU_CHAR rx_buf[RX_BUF_SIZE];
CPU_CHAR tx_buf[TX_BUF_SIZE];
OS_ERR os_err;
int ret = 0, error = 0;
WOLFSSL* ssl;
WOLFSSL_CTX* ctx;
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
/* wolfSSL INIT and CTX SETUP */
wolfSSL_Init();
/* SET UP NETWORK SOCKET */
APP_TRACE_INFO(("Opening a network socket...\r\n"));
sock = NetSock_Open(NET_SOCK_ADDR_FAMILY_IP_V4,
NET_SOCK_TYPE_STREAM,
NET_SOCK_PROTOCOL_TCP,
&err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_Open, err = %d\r\n", (int) err));
return -1;
}
#ifdef NET_SECURE_MODULE_EN
APP_TRACE_INFO(("Setting the socket as secure...\r\n"));
(void)NetSock_CfgSecure(sock,
DEF_YES,
&err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_CfgSecure, err = %d\r\n", (int) err));
NetSock_Close(sock, &err);
return -1;
}
APP_TRACE_INFO(("Configure the common name of the server...\r\n"));
(void)NetSock_CfgSecureClientCommonName(sock,
TCP_SERVER_DOMAIN_NAME,
&err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_CfgSecureClientCommonName, \
err = %d\r\n", (int) err));
NetSock_Close(sock, &err);
return -1;
}
#endif /* NET_SECURE_MODULE_EN */
APP_TRACE_INFO(("Calling NetASCII_Str_to_IPv4...\r\n"));
server_ip_addr = NetASCII_Str_to_IPv4(TCP_SERVER_IP_ADDR, &err);
if (err != NET_ASCII_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetASCII_Str_to_IPv4, err = %d\r\n", (int) err));
NetSock_Close(sock, &err);
return -1;
}
APP_TRACE_INFO(("Clearing memory for server_addr struct\r\n"));
Mem_Clr((void *) &server_addr, (CPU_SIZE_T) sizeof(server_addr));
APP_TRACE_INFO(("Setting server IP address: %s, port: %d\r\n",
TCP_SERVER_IP_ADDR, TCP_SERVER_PORT));
server_addr.AddrFamily = NET_SOCK_ADDR_FAMILY_IP_V4;
server_addr.Addr = NET_UTIL_HOST_TO_NET_32(server_ip_addr);
server_addr.Port = NET_UTIL_HOST_TO_NET_16(TCP_SERVER_PORT);
/* CONNECT SOCKET */
APP_TRACE_INFO(("Calling NetSock_Conn on socket\r\n"));
NetSock_Conn((NET_SOCK_ID) sock,
(NET_SOCK_ADDR *) &server_addr,
(NET_SOCK_ADDR_LEN) sizeof(server_addr),
(NET_ERR*) &err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_Conn, err = %d\r\n", (int) err));
NetSock_Close(sock, &err);
return -1;
}
ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
if (ctx == 0) {
APP_TRACE_INFO(("ERROR: wolfSSL_CTX_new failed\r\n"));
NetSock_Close(sock, &err);
return -1;
}
APP_TRACE_INFO(("wolfSSL_CTX_new done\r\n"));
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
ret = wolfSSL_CTX_load_verify_buffer(ctx,
google_certs_ca,
sizeof(google_certs_ca),
SSL_FILETYPE_PEM);
if (ret != SSL_SUCCESS) {
APP_TRACE_INFO(("ERROR: wolfSSL_CTX_load_verify_buffer() failed\r\n"));
NetSock_Close(sock, &err);
wolfSSL_CTX_free(ctx);
return -1;
}
if ((ssl = wolfSSL_new(ctx)) == NULL) {
APP_TRACE_INFO(("ERROR: wolfSSL_new() failed\r\n"));
NetSock_Close(sock, &err);
wolfSSL_CTX_free(ctx);
return -1;
}
APP_TRACE_INFO(("wolfSSL_new done\r\n"));
ret = wolfSSL_set_fd(ssl, sock);
if (ret != SSL_SUCCESS) {
APP_TRACE_INFO(("ERROR: wolfSSL_set_fd() failed\r\n"));
NetSock_Close(sock, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
APP_TRACE_INFO(("wolfSSL_set_fd done\r\n"));
do {
error = 0; /* reset error */
ret = wolfSSL_connect(ssl);
if (ret != SSL_SUCCESS) {
error = wolfSSL_get_error(ssl, 0);
APP_TRACE_INFO(
("ERROR: wolfSSL_connect() failed, err = %d\r\n", error));
if (error != SSL_ERROR_WANT_READ) {
NetSock_Close(sock, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
OSTimeDlyHMSM(0u, 0u, 1u, 0u, OS_OPT_TIME_HMSM_STRICT, &os_err);
}
} while ((ret != SSL_SUCCESS) && (error == SSL_ERROR_WANT_READ));
APP_TRACE_INFO(("wolfSSL_connect() ok... sending GET\r\n"));
Str_Copy_N(tx_buf, TX_MSG, TX_MSG_SIZE);
if (wolfSSL_write(ssl, tx_buf, TX_MSG_SIZE) != TX_MSG_SIZE) {
error = wolfSSL_get_error(ssl, 0);
APP_TRACE_INFO(("ERROR: wolfSSL_write() failed, err = %d\r\n", error));
NetSock_Close(sock, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
do {
error = 0; /* reset error */
ret = wolfSSL_read(ssl, rx_buf, RX_BUF_SIZE - 1);
if (ret < 0) {
error = wolfSSL_get_error(ssl, 0);
if (error != SSL_ERROR_WANT_READ) {
APP_TRACE_INFO(("wolfSSL_read failed, error = %d\r\n", error));
NetSock_Close(sock, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
OSTimeDlyHMSM(0u, 0u, 1u, 0u, OS_OPT_TIME_HMSM_STRICT, &os_err);
} else if (ret > 0) {
rx_buf[ret] = 0;
APP_TRACE_INFO(("%s\r\n", rx_buf));
}
} while (error == SSL_ERROR_WANT_READ);
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
wolfSSL_Cleanup();
NetSock_Close(sock, &err);
return 0;
}

View File

@ -1,8 +1,8 @@
/* time-dummy.c.c
/* client_wolfssl.h
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,19 +16,20 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifndef __CLIENT_WOLFSSL_H__
#define __CLIENT_WOLFSSL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "time.h"
int wolfssl_client_test(void);
struct tm *Cyassl_MDK_gmtime(const time_t *c)
{
static struct tm date ;
return(&date) ;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
time_t time(time_t * t) { return 0 ; }
#endif /* CLIENT_WOLFSSL_H */

View File

@ -0,0 +1,12 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST += \
IDE/ECLIPSE/MICRIUM/README.md \
IDE/ECLIPSE/MICRIUM/user_settings.h \
IDE/ECLIPSE/MICRIUM/client_wolfssl.h \
IDE/ECLIPSE/MICRIUM/server_wolfssl.h \
IDE/ECLIPSE/MICRIUM/client_wolfssl.c \
IDE/ECLIPSE/MICRIUM/server_wolfssl.c \
IDE/ECLIPSE/MICRIUM/wolfsslRunTests.c

View File

@ -0,0 +1,335 @@
/* server_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <Source/net_sock.h>
#include <Source/net_app.h>
#include <Source/net_util.h>
#include <Source/net_ascii.h>
#include <app_cfg.h>
#include "wolfssl/ssl.h"
#include "server_wolfssl.h"
#define TLS_SERVER_PORT 11111
#define TX_BUF_SIZE 64
#define RX_BUF_SIZE 1024
#define TCP_SERVER_CONN_Q_SIZE 1
/* derived from wolfSSL/certs/server-ecc.der */
static const CPU_INT08U server_ecc_der_256[] = { 0x30, 0x82, 0x03, 0x10,
0x30, 0x82, 0x02, 0xB5, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00,
0xEF, 0x46, 0xC7, 0xA4, 0x9B, 0xBB, 0x60, 0xD3, 0x30, 0x0A, 0x06, 0x08,
0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x81, 0x8F, 0x31,
0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x57,
0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30,
0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74,
0x74, 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A,
0x0C, 0x07, 0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31, 0x0C, 0x30,
0x0A, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43, 0x43, 0x31,
0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77,
0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x1E,
0x17, 0x0D, 0x31, 0x36, 0x30, 0x38, 0x31, 0x31, 0x32, 0x30, 0x30, 0x37,
0x33, 0x38, 0x5A, 0x17, 0x0D, 0x31, 0x39, 0x30, 0x35, 0x30, 0x38, 0x32,
0x30, 0x30, 0x37, 0x33, 0x38, 0x5A, 0x30, 0x81, 0x8F, 0x31, 0x0B, 0x30,
0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13,
0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x57, 0x61, 0x73,
0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06,
0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74, 0x74, 0x6C,
0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x07,
0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31, 0x0C, 0x30, 0x0A, 0x06,
0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43, 0x43, 0x31, 0x18, 0x30,
0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31,
0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C,
0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x59, 0x30, 0x13,
0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A,
0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xBB,
0x33, 0xAC, 0x4C, 0x27, 0x50, 0x4A, 0xC6, 0x4A, 0xA5, 0x04, 0xC3, 0x3C,
0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE, 0x94, 0xEA, 0x2B, 0xFA, 0xCB,
0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61, 0x02, 0xE9, 0xAF, 0x4D, 0xD3,
0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97, 0x92, 0x21, 0x7F, 0xF0, 0xCF, 0x18,
0xDA, 0x91, 0x11, 0x02, 0x34, 0x86, 0xE8, 0x20, 0x58, 0x33, 0x0B, 0x80,
0x34, 0x89, 0xD8, 0xA3, 0x81, 0xF7, 0x30, 0x81, 0xF4, 0x30, 0x1D, 0x06,
0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x5D, 0x5D, 0x26, 0xEF,
0xAC, 0x7E, 0x36, 0xF9, 0x9B, 0x76, 0x15, 0x2B, 0x4A, 0x25, 0x02, 0x23,
0xEF, 0xB2, 0x89, 0x30, 0x30, 0x81, 0xC4, 0x06, 0x03, 0x55, 0x1D, 0x23,
0x04, 0x81, 0xBC, 0x30, 0x81, 0xB9, 0x80, 0x14, 0x5D, 0x5D, 0x26, 0xEF,
0xAC, 0x7E, 0x36, 0xF9, 0x9B, 0x76, 0x15, 0x2B, 0x4A, 0x25, 0x02, 0x23,
0xEF, 0xB2, 0x89, 0x30, 0xA1, 0x81, 0x95, 0xA4, 0x81, 0x92, 0x30, 0x81,
0x8F, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C,
0x0A, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31,
0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65,
0x61, 0x74, 0x74, 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
0x04, 0x0A, 0x0C, 0x07, 0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31,
0x0C, 0x30, 0x0A, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43,
0x43, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F,
0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F,
0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
0x82, 0x09, 0x00, 0xEF, 0x46, 0xC7, 0xA4, 0x9B, 0xBB, 0x60, 0xD3, 0x30,
0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01,
0xFF, 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03,
0x02, 0x03, 0x49, 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xF1, 0xD0, 0xA6,
0x3E, 0x83, 0x33, 0x24, 0xD1, 0x7A, 0x05, 0x5F, 0x1E, 0x0E, 0xBD, 0x7D,
0x6B, 0x33, 0xE9, 0xF2, 0x86, 0xF3, 0xF3, 0x3D, 0xA9, 0xEF, 0x6A, 0x87,
0x31, 0xB3, 0xB7, 0x7E, 0x50, 0x02, 0x21, 0x00, 0xF0, 0x60, 0xDD, 0xCE,
0xA2, 0xDB, 0x56, 0xEC, 0xD9, 0xF4, 0xE4, 0xE3, 0x25, 0xD4, 0xB0, 0xC9,
0x25, 0x7D, 0xCA, 0x7A, 0x5D, 0xBA, 0xC4, 0xB2, 0xF6, 0x7D, 0x04, 0xC7,
0xBD, 0x62, 0xC9, 0x20 };
/* derived from wolfSSL/certs/ecc-key.der */
static const CPU_INT08U ecc_key_der_256[] = { 0x30, 0x77, 0x02, 0x01, 0x01,
0x04, 0x20, 0x45, 0xB6, 0x69, 0x02, 0x73, 0x9C, 0x6C, 0x85, 0xA1, 0x38,
0x5B, 0x72, 0xE8, 0xE8, 0xC7, 0xAC, 0xC4, 0x03, 0x8D, 0x53, 0x35, 0x04,
0xFA, 0x6C, 0x28, 0xDC, 0x34, 0x8D, 0xE1, 0xA8, 0x09, 0x8C, 0xA0, 0x0A,
0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0xA1, 0x44,
0x03, 0x42, 0x00, 0x04, 0xBB, 0x33, 0xAC, 0x4C, 0x27, 0x50, 0x4A, 0xC6,
0x4A, 0xA5, 0x04, 0xC3, 0x3C, 0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE,
0x94, 0xEA, 0x2B, 0xFA, 0xCB, 0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61,
0x02, 0xE9, 0xAF, 0x4D, 0xD3, 0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97, 0x92,
0x21, 0x7F, 0xF0, 0xCF, 0x18, 0xDA, 0x91, 0x11, 0x02, 0x34, 0x86, 0xE8,
0x20, 0x58, 0x33, 0x0B, 0x80, 0x34, 0x89, 0xD8 };
int wolfssl_server_test(void)
{
NET_ERR err;
NET_SOCK_ID sock_listen;
NET_SOCK_ID sock_req;
NET_SOCK_ADDR_IPv4 server_addr;
NET_SOCK_ADDR_LEN server_addr_len;
NET_SOCK_ADDR_IPv4 client_sock_addr_ip;
NET_SOCK_ADDR_LEN client_sock_addr_ip_size;
CPU_CHAR rx_buf[RX_BUF_SIZE];
CPU_CHAR tx_buf[TX_BUF_SIZE];
CPU_BOOLEAN attempt_conn;
OS_ERR os_err;
WOLFSSL * ssl;
WOLFSSL_CTX * ctx;
int tx_buf_sz = 0, ret = 0, error = 0;
#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif
/* wolfSSL INIT and CTX SETUP */
wolfSSL_Init();
/* SET UP NETWORK SOCKET */
APP_TRACE_INFO(("Opening network socket...\r\n"));
sock_listen = NetSock_Open(NET_SOCK_ADDR_FAMILY_IP_V4,
NET_SOCK_TYPE_STREAM,
NET_SOCK_PROTOCOL_TCP,
&err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_Open, err = %d\r\n", (int) err));
return -1;
}
APP_TRACE_INFO(("Clearing memory for server_addr struct\r\n"));
server_addr_len = sizeof(server_addr);
Mem_Clr((void *) &server_addr, (CPU_SIZE_T) server_addr_len);
APP_TRACE_INFO(("Setting up server_addr struct\r\n"));
server_addr.AddrFamily = NET_SOCK_ADDR_FAMILY_IP_V4;
server_addr.Addr = NET_UTIL_HOST_TO_NET_32(NET_SOCK_ADDR_IP_V4_WILDCARD);
server_addr.Port = NET_UTIL_HOST_TO_NET_16(TLS_SERVER_PORT);
NetSock_Bind((NET_SOCK_ID) sock_listen,
(NET_SOCK_ADDR*) &server_addr,
(NET_SOCK_ADDR_LEN) NET_SOCK_ADDR_SIZE,
(NET_ERR*) &err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_Bind, err = %d\r\n", (int) err));
NetSock_Close(sock_listen, &err);
return -1;
}
ctx = wolfSSL_CTX_new(wolfTLSv1_2_server_method());
if (ctx == 0) {
APP_TRACE_INFO(("ERROR: wolfSSL_CTX_new failed\r\n"));
NetSock_Close(sock_listen, &err);
return -1;
}
APP_TRACE_INFO(("wolfSSL_CTX_new done\r\n"));
ret = wolfSSL_CTX_use_certificate_buffer(ctx,
server_ecc_der_256,
sizeof(server_ecc_der_256),
SSL_FILETYPE_ASN1);
if (ret != SSL_SUCCESS) {
APP_TRACE_INFO(
("ERROR: wolfSSL_CTX_use_certificate_buffer() failed\r\n"));
NetSock_Close(sock_listen, &err);
wolfSSL_CTX_free(ctx);
return -1;
}
ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx,
ecc_key_der_256,
sizeof(ecc_key_der_256),
SSL_FILETYPE_ASN1);
if (ret != SSL_SUCCESS) {
APP_TRACE_INFO(
("ERROR: wolfSSL_CTX_use_PrivateKey_buffer() failed\r\n"));
NetSock_Close(sock_listen, &err);
wolfSSL_CTX_free(ctx);
return -1;
}
/* accept client socket connections */
APP_TRACE_INFO(("Listening for client connection\r\n"));
NetSock_Listen(sock_listen, TCP_SERVER_CONN_Q_SIZE, &err);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_Listen, err = %d\r\n", (int) err));
NetSock_Close(sock_listen, &err);
wolfSSL_CTX_free(ctx);
return -1;
}
do {
client_sock_addr_ip_size = sizeof(client_sock_addr_ip);
sock_req = NetSock_Accept((NET_SOCK_ID) sock_listen,
(NET_SOCK_ADDR*) &client_sock_addr_ip,
(NET_SOCK_ADDR_LEN*) &client_sock_addr_ip_size,
(NET_ERR*) &err);
switch (err) {
case NET_SOCK_ERR_NONE:
attempt_conn = DEF_NO;
break;
case NET_ERR_INIT_INCOMPLETE:
case NET_SOCK_ERR_NULL_PTR:
case NET_SOCK_ERR_NONE_AVAIL:
case NET_SOCK_ERR_CONN_ACCEPT_Q_NONE_AVAIL:
attempt_conn = DEF_YES;
break;
case NET_SOCK_ERR_CONN_SIGNAL_TIMEOUT:
APP_TRACE_INFO(
("NetSockAccept err = NET_SOCK_ERR_CONN_SIGNAL_TIMEOUT\r\n"));
attempt_conn = DEF_YES;
break;
default:
attempt_conn = DEF_NO;
break;
}
} while (attempt_conn == DEF_YES);
if (err != NET_SOCK_ERR_NONE) {
APP_TRACE_INFO(("ERROR: NetSock_Accept, err = %d\r\n", (int) err));
NetSock_Close(sock_listen, &err);
return -1;
}
APP_TRACE_INFO(("Got client connection! Starting TLS negotiation\r\n"));
/* set up wolfSSL session */
if ((ssl = wolfSSL_new(ctx)) == NULL) {
APP_TRACE_INFO(("ERROR: wolfSSL_new() failed\r\n"));
NetSock_Close(sock_req, &err);
NetSock_Close(sock_listen, &err);
wolfSSL_CTX_free(ctx);
return -1;
}
APP_TRACE_INFO(("wolfSSL_new done\r\n"));
ret = wolfSSL_set_fd(ssl, sock_req);
if (ret != SSL_SUCCESS) {
APP_TRACE_INFO(("ERROR: wolfSSL_set_fd() failed\r\n"));
NetSock_Close(sock_req, &err);
NetSock_Close(sock_listen, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
APP_TRACE_INFO(("wolfSSL_set_fd done\r\n"));
do {
error = 0; /* reset error */
if (ret != SSL_SUCCESS) {
error = wolfSSL_get_error(ssl, 0);
APP_TRACE_INFO(
("ERROR: wolfSSL_accept() failed, err = %d\r\n", error));
if (error != SSL_ERROR_WANT_READ) {
NetSock_Close(sock_req, &err);
NetSock_Close(sock_listen, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
OSTimeDlyHMSM(0u, 0u, 0u, 500u, OS_OPT_TIME_HMSM_STRICT, &os_err);
}
} while ((ret != SSL_SUCCESS) && (error == SSL_ERROR_WANT_READ));
APP_TRACE_INFO(("wolfSSL_accept() ok...\r\n"));
/* read client data */
error = 0;
Mem_Set(rx_buf, 0, RX_BUF_SIZE);
ret = wolfSSL_read(ssl, rx_buf, RX_BUF_SIZE - 1);
if (ret < 0) {
error = wolfSSL_get_error(ssl, 0);
if (error != SSL_ERROR_WANT_READ) {
APP_TRACE_INFO(("wolfSSL_read failed, error = %d\r\n", error));
NetSock_Close(sock_req, &err);
NetSock_Close(sock_listen, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
}
APP_TRACE_INFO(("AFTER wolfSSL_read() call, ret = %d\r\n", ret));
if (ret > 0) {
rx_buf[ret] = 0;
APP_TRACE_INFO(("Client sent: %s\r\n", rx_buf));
}
/* write response to client */
Mem_Set(tx_buf, 0, TX_BUF_SIZE);
tx_buf_sz = 22;
Str_Copy_N(tx_buf, "I hear ya fa shizzle!\n", tx_buf_sz);
if (wolfSSL_write(ssl, tx_buf, tx_buf_sz) != tx_buf_sz) {
error = wolfSSL_get_error(ssl, 0);
APP_TRACE_INFO(("ERROR: wolfSSL_write() failed, err = %d\r\n", error));
NetSock_Close(sock_req, &err);
NetSock_Close(sock_listen, &err);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
ret = wolfSSL_shutdown(ssl);
if (ret == SSL_SHUTDOWN_NOT_DONE)
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
wolfSSL_Cleanup();
NetSock_Close(sock_req, &err);
NetSock_Close(sock_listen, &err);
return 0;
}

View File

@ -1,8 +1,8 @@
/* time-dummy.c.c
/* server_wolfssl.h
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,19 +16,20 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifndef __SERVER_WOLFSSL_H__
#define __SERVER_WOLFSSL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "time.h"
int wolfssl_server_test(void);
struct tm *Cyassl_MDK_gmtime(const time_t *c)
{
static struct tm date ;
return(&date) ;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
time_t time(time_t * t) { return 0 ; }
#endif /* SERVER_WOLFSSL_H */

View File

@ -0,0 +1,75 @@
/* user_setting.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef MICRIUM_USER_SETTINGS_H_
#define MICRIUM_USER_SETTINGS_H_
#ifdef __cplusplus
extern "C" {
#endif
#define MICRIUM
/* You can select one or all of the following tests */
#define WOLFSSL_WOLFCRYPT_TEST
#define WOLFSSL_BENCHMARK_TEST
#define WOLFSSL_CLIENT_TEST
#define WOLFSSL_SERVER_TEST
/* adjust CURRENT_UNIX_TS to seconds since Jan 01 1970. (UTC)
You can get the current time from https://www.unixtimestamp.com/
*/
#define CURRENT_UNIX_TS 1542605837
/* When using Windows simulator, you must define USE_WINDOWS_API for test.h to build */
#ifdef _WIN32
#define USE_WINDOWS_API
#endif
#define NO_FILESYSTEM
#define SIZEOF_LONG_LONG 8
/* prevents from including multiple definition of main() */
#define NO_MAIN_DRIVER
#define NO_TESTSUITE_MAIN_DRIVER
/* includes certificate test buffers via header files */
#define USE_CERT_BUFFERS_2048
/*use kB instead of mB for embedded benchmarking*/
#define BENCH_EMBEDDED
#define NO_WRITE_TEMP_FILES
#define XSNPRINTF snprintf
#define HAVE_AESGCM
#define WOLFSSL_SHA512
#define HAVE_ECC
#define HAVE_CURVE25519
#define CURVE25519_SMALL
#define HAVE_ED25519
#define ED25519_SMALL
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif

View File

@ -0,0 +1,80 @@
/* wolfsslRunTests.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <includes.h> /* master includes from Micrium Freescale Kinetis K70*/
#include <wolfssl/ssl.h>
/*
* Description : This function runs wolfssl tests.
* Caller(s) : main() in app.c
* Note(s) : none.
*/
int wolfsslRunTests (void)
{
CLK_ERR err;
CLK_TS_SEC ts_unix_sec;
CPU_BOOLEAN valid;
static int initialized = 0;
if(!initialized) {
Clk_Init(&err);
if (err == CLK_ERR_NONE) {
APP_TRACE_INFO(("Clock module successfully initialized\n"));
} else {
APP_TRACE_INFO(("Clock module initialization failed\n"));
return -1;
}
valid = Clk_GetTS_Unix(&ts_unix_sec);
if (valid == DEF_OK) {
APP_TRACE_INFO(("Timestamp Unix = %u\n", ts_unix_sec));
} else {
APP_TRACE_INFO(("Get TS Unix error\n"));
}
#if defined(CURRENT_UNIX_TS)
valid = Clk_SetTS_Unix(CURRENT_UNIX_TS);
if (valid != DEF_OK) {
APP_TRACE_INFO(("Clk_SetTS_Unix error\n"));
return -1;
}
#endif
initialized = 1;
}
#if defined(WOLFSSL_WOLFCRYPT_TEST)
wolfcrypt_test(NULL);
#endif
#if defined(WOLFSSL_BENCHMARK_TEST)
benchmark_test(NULL);
#endif
#if defined(WOLFSSL_CLIENT_TEST)
wolfssl_client_test();
#endif
#if defined(WOLFSSL_SERVER_TEST)
wolfssl_server_test();
#endif
return 0;
}

View File

@ -0,0 +1 @@
This folder has moved to `IDE/RISCV/SIFIVE-HIFIVE1`.

View File

@ -0,0 +1,6 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST += \
IDE/ECLIPSE/SIFIVE/README.md

View File

@ -0,0 +1,35 @@
# ESP-IDF port
## Overview
ESP-IDF development framework with wolfSSL by setting *WOLFSSL_ESPIDF* definition
Including the following examples:
* simple tls_client/server
* crypt test
* crypt benchmark
The *user_settings.h* file enables some of the hardened settings.
## Requirements
1. ESP-IDF development framework
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
Note: This expects to use Linux version.
## Setup
1. Run *setup.sh* to deploy files into ESP-IDF tree
2. Find Wolfssl files at /path/to/esp-idf/components/wolfssl/
3. Find Example programs under /path/to/esp-idf/examples/protocols/wolfssl_xxx
4. Uncomment out #define WOLFSSL_ESPIDF in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
Uncomment out #define WOLFSSL_ESPWROOM32 in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
## Configuration
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
## Build examples
1. See README in each example folder
## Support
For question please email [support@wolfssl.com]
Note: This is tested with "Ubuntu 18.04.1 LTS" and ESP32-WROOM-32.

View File

@ -0,0 +1,58 @@
# DEMO program with ATECC608A on ESP-WROOM-32SE
## Overview
Running demo programs with ATECC608A on 32SE by setting *WOLFSSL_ESPWROOM32SE* definition
Including the following examples:
* simple tls_client/tls_server
* crypt benchmark
The *user_settings.h* file enables some of the hardened settings.
## Requirements
1. ESP-IDF development framework
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
2. Microchip CryptoAuthentication Library
[https://github.com/MicrochipTech/cryptoauthlib]
## Setup
1. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
2. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
3. Uncomment out #define WOLFSSL_ESPWROOM32SE in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
Note : Need to enable WOLFSSL_ESPIDF
Note : crypt test will fail if enabled WOLFSSL_ESPWROOM32SE
## Configuration
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
## Build examples
1. See README in each example folder
## Benchmark
w/o atecc608a
```
ECC 256 key gen 4 ops took 1.092 sec, avg 273.000 ms, 3.663 ops/sec
ECDHE 256 agree 4 ops took 1.091 sec, avg 272.750 ms, 3.666 ops/sec
ECDSA 256 sign 4 ops took 1.102 sec, avg 275.500 ms, 3.630 ops/sec
ECDSA 256 verify 2 ops took 1.091 sec, avg 545.500 ms, 1.833 ops/sec
```
w/ atecc608a
```
ECC 256 key gen 11 ops took 1.074 sec, avg 97.636 ms, 10.242 ops/sec
ECDHE 256 agree 6 ops took 1.068 sec, avg 178.000 ms, 5.618 ops/sec
ECDSA 256 sign 8 ops took 1.009 sec, avg 126.125 ms, 7.929 ops/sec
ECDSA 256 verify 14 ops took 1.079 sec, avg 77.071 ms, 12.975 ops/sec
```
## Support
For question please email [support@wolfssl.com]
Note: This is tested with the following condition:
- Model : ESP32-WROOM-32SE
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
- CryptAuthLib: commit hash : c6b176e
- OS : Ubuntu 18.04.1 LTS (Bionic Beaver)

View File

@ -1,8 +1,8 @@
/* time-dummy.c.c
/* config.h - dummy
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,19 +16,9 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifndef _CONFIG_H_
#define _CONFIG_H_
#endif
#include "time.h"
struct tm *Cyassl_MDK_gmtime(const time_t *c)
{
static struct tm date ;
return(&date) ;
}
time_t time(time_t * t) { return 0 ; }

View File

@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wolfssl_benchmark)

View File

@ -0,0 +1,11 @@
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#
PROJECT_NAME := wolfssl_benchmark
CFLAGS += -DWOLFSSL_USER_SETTINGS
include $(IDF_PATH)/make/project.mk

View File

@ -0,0 +1,16 @@
#wolfSSL Example
The Example contains of wolfSSL benchmark program.
1. "make menuconfig" to configure the program.
1-1. Example Configuration ->
BENCH_ARG : argument that you want to use. Default is "-lng 0"
The list of argument can be find in help.
When you want to run the benchmark program
1. "make flash" to compile and load the firmware
2. "make monitor" to see the message
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -0,0 +1,10 @@
#
# wolfssl benchmark test
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "benchmark.c" "helper.c")
set(COMPONENT_ADD_INCLUDEDIRS ".")
register_component()

View File

@ -0,0 +1,29 @@
menu "Example Configuration"
config BENCH_ARGV
string "Arguments for benchmark test"
default "-lng 0"
help
-? <num> Help, print this usage
0: English, 1: Japanese
-csv Print terminal output in csv format
-base10 Display bytes as power of 10 (eg 1 kB = 1000 Bytes)
-no_aad No additional authentication data passed.
-dgst_full Full digest operation performed.
-rsa_sign Measure RSA sign/verify instead of encrypt/decrypt.
-<alg> Algorithm to benchmark. Available algorithms include:
cipher aes-cbc aes-gcm chacha20 chacha20-poly1305
digest md5 poly1305 sha sha2 sha224 sha256 sha384 sha512 sha3
sha3-224 sha3-256 sha3-384 sha3-512
mac hmac hmac-md5 hmac-sha hmac-sha224 hmac-sha256 hmac-sha384
hmac-sha512
asym rsa rsa-sz dh ecc-kg ecc
other rng
-lng <num> Display benchmark result by specified language.
0: English, 1: Japanese
<num> Size of block in bytes
e.g -lng 1
e.g sha
endmenu

View File

@ -0,0 +1,8 @@
#
# Main component makefile.
#
# This Makefile can be left empty. By default, it will take the sources in the
# src/ directory, compile them and link them into lib(subdirectory_name).a
# in the build directory. This behaviour is entirely configurable,
# please read the ESP-IDF documents if you need to do this.
#

View File

@ -0,0 +1,172 @@
/* helper.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include "sdkconfig.h"
#include "esp_log.h"
#define WOLFSSL_BENCH_ARGV CONFIG_BENCH_ARGV
/* proto-type */
extern void wolf_benchmark_task();
static const char* const TAG = "wolfbenchmark";
char* __argv[22];
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you need to use a custom slot allocation, */
/* enable the definition CUSTOM_SLOT_ALLOCAION. */
#if defined(CUSTOM_SLOT_ALLOCATION)
static byte mSlotList[ATECC_MAX_SLOT];
/* initialize slot array */
void my_atmel_slotInit()
{
int i;
for(i = 0;i < ATECC_MAX_SLOT;i++) {
mSlotList[i] = ATECC_INVALID_SLOT;
}
}
/* allocate slot depending on slotType */
int my_atmel_alloc(int slotType)
{
int i, slot = -1;
switch(slotType){
case ATMEL_SLOT_ENCKEY:
slot = 4;
break;
case ATMEL_SLOT_DEVICE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE_ENC:
slot = 4;
break;
case ATMEL_SLOT_ANY:
for(i = 0;i < ATECC_MAX_SLOT;i++){
if(mSlotList[i] == ATECC_INVALID_SLOT){
slot = i;
break;
}
}
}
return slot;
}
/* free slot array */
void my_atmel_free(int slotId)
{
if(slotId >= 0 && slotId < ATECC_MAX_SLOT){
mSlotList[slotId] = ATECC_INVALID_SLOT;
}
}
#endif /* CUSTOM_SLOT_ALLOCATION */
#endif /* WOLFSSL_ESPWROOM32SE && HAVE_PK_CALLBACK && WOLFSSL_ATECC508A */
int construct_argv()
{
int cnt = 0;
int i = 0;
int len = 0;
char *_argv; /* buffer for copying the string */
char *ch; /* char pointer to trace the string */
char buff[16] = { 0 }; /* buffer for a argument copy */
printf("arg:%s\n", CONFIG_BENCH_ARGV);
len = strlen(CONFIG_BENCH_ARGV);
_argv = (char*)malloc(len + 1);
if (!_argv) {
return -1;
}
memset(_argv, 0, len+1);
memcpy(_argv, CONFIG_BENCH_ARGV, len);
_argv[len] = '\0';
ch = _argv;
__argv[cnt] = malloc(10);
sprintf(__argv[cnt], "benchmark");
__argv[9] = '\0';
cnt = 1;
while (*ch != '\0')
{
/* skip white-space */
while (*ch == ' ') { ++ch; }
memset(buff, 0, sizeof(buff));
/* copy each args into buffer */
i = 0;
while ((*ch != ' ') && (*ch != '\0') && (i < 16)) {
buff[i] = *ch;
++i;
++ch;
}
/* copy the string into argv */
__argv[cnt] = (char*)malloc(i + 1);
memset(__argv[cnt], 0, i + 1);
memcpy(__argv[cnt], buff, i + 1);
/* next args */
++cnt;
}
free(_argv);
return (cnt);
}
/* entry point */
void app_main(void)
{
(void) TAG;
#ifndef NO_CRYPT_BENCHMARK
/* when using atecc608a on esp32-wroom-32se */
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#if defined(CUSTOM_SLOT_ALLOCATION)
my_atmel_slotInit();
/* to register the callback, it needs to be initialized. */
if ((wolfCrypt_Init()) != 0) {
ESP_LOGE(TAG, "wolfCrypt_Init failed");
return;
}
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
#endif
#endif
wolf_benchmark_task();
#else
#endif /* NO_CRYPT_BENCHMARK */
}

View File

@ -0,0 +1,6 @@
CONFIG_BENCH_ARGV="-lng 0"
CONFIG_MAIN_TASK_STACK_SIZE=7000
CONFIG_FREERTOS_HZ=1000
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
170 CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240

View File

@ -0,0 +1,11 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
# (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
# disable the following line if there isn't the directory
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wolfssl_client)

View File

@ -0,0 +1,12 @@
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#
PROJECT_NAME := wolfssl_client
CFLAGS += -DWOLFSSL_USER_SETTINGS
# if there isn't the directory, please disable the line below.
EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
include $(IDF_PATH)/make/project.mk

View File

@ -0,0 +1,22 @@
#wolfSSL Example
The Example contains of wolfSSL tls client demo.
1. "make menuconfig" to config the project
1-1. Example Configuration ->
WIFI SSID: your own WIFI, which is connected to the Internet.(default is "myssid")
WIFI Password: WIFI password, and default is "mypassword"
Target host ip address : the host that you want to connect to.(default is 127.0.0.1)
Note: the example program uses 11111 port. If you want to use different port
, you need to modify DEFAULT_PORT definition in the code.
When you want to test the wolfSSL client
1. "make flash monitor" to load the firmware and see the context
2. You can use <wolfssl>/examples/server/server program for test.
e.g. Launch ./examples/server/server -v 4 -b -i
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -0,0 +1,10 @@
#
# wolfssl client test
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "client-tls.c" "wifi_connect.c")
set(COMPONENT_ADD_INCLUDEDIRS "." "./include")
register_component()

View File

@ -0,0 +1,21 @@
menu "Example Configuration"
config WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.
config WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.
config TARGET_HOST
string "Target host"
default "127.0.01.1"
help
host address for the example to connect
endmenu

View File

@ -0,0 +1,291 @@
/* client-tls-callback.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* the usual suspects */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
/* ESP specific */
#include "wifi_connect.h"
/* socket includes */
#include "lwip/netdb.h"
#include "lwip/sockets.h"
/* wolfSSL */
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/certs_test.h>
#ifdef WOLFSSL_TRACK_MEMORY
#include <wolfssl/wolfcrypt/mem_track.h>
#endif
static const char* const TAG = "tls_client";
#if defined(DEBUG_WOLFSSL)
static void ShowCiphers(void)
{
char ciphers[4096];
int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));
if (ret == WOLFSSL_SUCCESS)
printf("%s\n", ciphers);
}
#endif
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you want to use custom slot allocation */
/* enable the definition CUSTOM_SLOT_ALLOCATION.*/
#if defined(CUSTOM_SLOT_ALLOCATION)
static byte mSlotList[ATECC_MAX_SLOT];
int atmel_set_slot_allocator(atmel_slot_alloc_cb alloc,
atmel_slot_dealloc_cb dealloc);
/* initialize slot array */
void my_atmel_slotInit()
{
int i;
for(i=0;i<ATECC_MAX_SLOT; i++) {
mSlotList[i] = ATECC_INVALID_SLOT;
}
}
/* allocate slot depending on slotType */
int my_atmel_alloc(int slotType)
{
int i, slot = -1;
switch(slotType){
case ATMEL_SLOT_ENCKEY:
slot = 2;
break;
case ATMEL_SLOT_DEVICE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE_ENC:
slot = 4;
break;
case ATMEL_SLOT_ANY:
for(i=0;i<ATECC_MAX_SLOT;i++){
if(mSlotList[i] == ATECC_INVALID_SLOT){
slot = i;
break;
}
}
}
return slot;
}
/* free slot array */
void my_atmel_free(int slotId)
{
if(slotId >= 0 && slotId < ATECC_MAX_SLOT){
mSlotList[slotId] = ATECC_INVALID_SLOT;
}
}
#endif /* CUSTOM_SLOT_ALLOCATION */
#endif /* WOLFSSL_ESPWROOM32SE && HAVE_PK_CALLBACK && WOLFSSL_ATECC508A */
/* client task */
void tls_smp_client_task()
{
int ret;
int sockfd;
int doPeerCheck;
int sendGet;
struct sockaddr_in servAddr;
char buff[256];
const char* ch = TLS_SMP_TARGET_HOST;
size_t len;
struct hostent *hp;
struct ip4_addr *ip4_addr;
const char sndMsg[] = "GET /index.html HTTP/1.0\r\n\r\n";
/* declare wolfSSL objects */
WOLFSSL_CTX *ctx;
WOLFSSL *ssl;
WOLFSSL_ENTER("tls_smp_client_task");
doPeerCheck = 0;
sendGet = 0;
#ifdef DEBUG_WOLFSSL
WOLFSSL_MSG("Debug ON");
wolfSSL_Debugging_ON();
ShowCiphers();
#endif
/* Initialize wolfSSL */
wolfSSL_Init();
/* Create a socket that uses an internet IPv4 address,
* Sets the socket to be stream based (TCP),
* 0 means choose the default protocol. */
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
ESP_LOGE(TAG,"ERROR: failed to create the socket\n");
}
ESP_LOGI(TAG, "get target IP address");
hp = gethostbyname(TLS_SMP_TARGET_HOST);
if (!hp) {
ESP_LOGE(TAG, "Failed to get host name.");
ip4_addr = NULL;
} else {
ip4_addr = (struct ip4_addr *)hp->h_addr;
ESP_LOGI(TAG, IPSTR, IP2STR(ip4_addr));
}
/* Create and initialize WOLFSSL_CTX */
if ((ctx = wolfSSL_CTX_new(wolfSSLv23_client_method())) == NULL) {
ESP_LOGE(TAG,"ERROR: failed to create WOLFSSL_CTX\n");
}
WOLFSSL_MSG("Loading...cert");
/* Load client certificates into WOLFSSL_CTX */
if ((ret = wolfSSL_CTX_load_verify_buffer(ctx, ca_cert_der_2048,
sizeof_ca_cert_der_2048, WOLFSSL_FILETYPE_ASN1)) != SSL_SUCCESS) {
ESP_LOGE(TAG,"ERROR: failed to load %d, please check the file.\n",ret);
}
/* not peer check */
if( doPeerCheck == 0 ){
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, 0);
} else {
WOLFSSL_MSG("Loading... our cert");
/* load our certificate */
if ((ret = wolfSSL_CTX_use_certificate_chain_buffer_format(ctx, client_cert_der_2048,
sizeof_client_cert_der_2048, WOLFSSL_FILETYPE_ASN1)) != SSL_SUCCESS) {
ESP_LOGE(TAG,"ERROR: failed to load chain %d, please check the file.\n",ret);
}
if ((ret = wolfSSL_CTX_use_PrivateKey_buffer(ctx, client_key_der_2048,
sizeof_client_key_der_2048, WOLFSSL_FILETYPE_ASN1)) != SSL_SUCCESS) {
wolfSSL_CTX_free(ctx); ctx = NULL;
ESP_LOGE(TAG,"ERROR: failed to load key %d, please check the file.\n", ret);
}
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_PEER, 0);
}
/* Initialize the server address struct with zeros */
memset(&servAddr, 0, sizeof(servAddr));
/* Fill in the server address */
servAddr.sin_family = AF_INET; /* using IPv4 */
servAddr.sin_port = htons(DEFAULT_PORT); /* on DEFAULT_PORT */
if(*ch >= '1' && *ch <= '9') {
/* Get the server IPv4 address from the command line call */
WOLFSSL_MSG("inet_pton");
if ((ret = inet_pton(AF_INET, TLS_SMP_TARGET_HOST,
&servAddr.sin_addr)) != 1) {
ESP_LOGE(TAG,"ERROR: invalid address ret=%d\n", ret);
}
} else {
servAddr.sin_addr.s_addr = ip4_addr->addr;
}
/* Connect to the server */
sprintf(buff, "Connecting to server....%s(port:%d)", TLS_SMP_TARGET_HOST
, DEFAULT_PORT);
WOLFSSL_MSG(buff);
printf("%s\n",buff);
if ((ret = connect(sockfd, (struct sockaddr *)&servAddr,
sizeof(servAddr))) == -1){
ESP_LOGE(TAG,"ERROR: failed to connect ret=%d\n", ret);
}
WOLFSSL_MSG("Create a WOLFSSL object");
/* Create a WOLFSSL object */
if ((ssl = wolfSSL_new(ctx)) == NULL) {
ESP_LOGE(TAG,"ERROR: failed to create WOLFSSL object\n");
}
/* when using atecc608a on esp32-wroom-32se */
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
atcatls_set_callbacks(ctx);
/* when using custom slot-allocation */
#if defined(CUSTOM_SLOT_ALLOCATION)
my_atmel_slotInit();
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
#endif
#endif
/* Attach wolfSSL to the socket */
wolfSSL_set_fd(ssl, sockfd);
WOLFSSL_MSG("Connect to wolfSSL on the server side");
/* Connect to wolfSSL on the server side */
if (wolfSSL_connect(ssl) != SSL_SUCCESS) {
ESP_LOGE(TAG,"ERROR: failed to connect to wolfSSL\n");
}
/* Get a message for the server from stdin */
WOLFSSL_MSG("Message for server: ");
memset(buff, 0, sizeof(buff));
if(sendGet){
printf("SSL connect ok, sending GET...\n");
len = XSTRLEN(sndMsg);
strncpy(buff, sndMsg, len);
buff[len] = '\0';
} else {
sprintf(buff, "message from esp32 tls client\n");
len = strnlen(buff, sizeof(buff));
}
/* Send the message to the server */
if (wolfSSL_write(ssl, buff, len) != len) {
ESP_LOGE(TAG,"ERROR: failed to write\n");
}
/* Read the server data into our buff array */
memset(buff, 0, sizeof(buff));
if (wolfSSL_read(ssl, buff, sizeof(buff) - 1) == -1) {
ESP_LOGE(TAG,"ERROR: failed to read\n");
}
/* Print to stdout any data the server sends */
printf("Server:");
printf("%s", buff);
/* Cleanup and return */
wolfSSL_free(ssl); /* Free the wolfSSL object */
wolfSSL_CTX_free(ctx); /* Free the wolfSSL context object */
wolfSSL_Cleanup(); /* Cleanup the wolfSSL environment */
close(sockfd); /* Close the connection to the server */
vTaskDelete(NULL);
return; /* Return reporting a success */
}

View File

@ -0,0 +1,8 @@
#
# Main component makefile.
#
# This Makefile can be left empty. By default, it will take the sources in the
# src/ directory, compile them and link them into lib(subdirectory_name).a
# in the build directory. This behaviour is entirely configurable,
# please read the ESP-IDF documents if you need to do this.
#

View File

@ -0,0 +1,43 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef _TLS_WIFI_H_
#define _TLS_WIFI_H_
#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_wifi.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#include "esp_event.h"
#else
#include "esp_event_loop.h"
#endif
#define DEFAULT_PORT 11111
#define TLS_SMP_CLIENT_TASK_NAME "tls_client_example"
#define TLS_SMP_CLIENT_TASK_WORDS 10240
#define TLS_SMP_CLIENT_TASK_PRIORITY 8
#define TLS_SMP_WIFI_SSID CONFIG_WIFI_SSID
#define TLS_SMP_WIFI_PASS CONFIG_WIFI_PASSWORD
#define TLS_SMP_TARGET_HOST CONFIG_TARGET_HOST
#endif

View File

@ -0,0 +1,162 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/*ESP specific */
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "wifi_connect.h"
#include "lwip/sockets.h"
#include "lwip/netdb.h"
#include "lwip/apps/sntp.h"
#include "nvs_flash.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#include "protocol_examples_common.h"
#endif
const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
/* proto-type */
extern void tls_smp_client_task();
static void tls_smp_client_init();
const static char *TAG = "tls_client";
static EventGroupHandle_t wifi_event_group;
extern void tls_smp_client_task();
static void set_time()
{
/* set dummy wallclock time. */
struct timeval utctime;
struct timezone tz;
struct strftime_buf;
time_t now;
struct tm timeinfo;
char strftime_buf[64];
/* please update the time if seeing unknown failure. */
/* this could cause TLS communication failure due to time expiration */
utctime.tv_sec = 1567125910; /* dummy time: Fri Aug 30 09:45:00 2019 */
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;
settimeofday(&utctime, &tz);
time(&now);
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
ESP_LOGI(TAG, "The current date/time is: %s", strftime_buf);
#if ESP_IDF_VERSION_MAJOR < 4
/* wait until wifi connect */
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT,
false, true, portMAX_DELAY);
#endif
/* now we start client tasks. */
tls_smp_client_init();
}
/* create task */
static void tls_smp_client_init(void)
{
int ret;
xTaskHandle _handle;
/* http://esp32.info/docs/esp_idf/html/dd/d3c/group__xTaskCreate.html */
ret = xTaskCreate(tls_smp_client_task,
TLS_SMP_CLIENT_TASK_NAME,
TLS_SMP_CLIENT_TASK_WORDS,
NULL,
TLS_SMP_CLIENT_TASK_PRIORITY,
&_handle);
if (ret != pdPASS) {
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_CLIENT_TASK_NAME);
}
}
/* event hander for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
switch (event->event_id)
{
case SYSTEM_EVENT_STA_START:
esp_wifi_connect();
break;
case SYSTEM_EVENT_STA_GOT_IP:
ESP_LOGI(TAG, "got ip:%s",
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
/* http://esp32.info/docs/esp_idf/html/dd/d08/group__xEventGroupSetBits.html */
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
esp_wifi_connect();
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
break;
default:
break;
}
return ESP_OK;
}
/* entry point */
void app_main(void)
{
ESP_LOGI(TAG, "Start app_main...");
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
tcpip_adapter_init();
/* */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
(void) wifi_event_handler;
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.
*/
ESP_ERROR_CHECK(example_connect());
#else
wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_event_loop_init(wifi_event_handler, NULL));
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
wifi_config_t wifi_config = {
.sta = {
.ssid = TLS_SMP_WIFI_SSID,
.password = TLS_SMP_WIFI_PASS,
},
};
/* WiFi station mode */
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
/* Wifi Set the configuration of the ESP32 STA or AP */
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
/* Start Wifi */
ESP_ERROR_CHECK(esp_wifi_start() );
ESP_LOGI(TAG, "wifi_init_sta finished.");
ESP_LOGI(TAG, "connect to ap SSID:%s password:%s",
TLS_SMP_WIFI_SSID, TLS_SMP_WIFI_PASS);
#endif
ESP_LOGI(TAG, "Set dummy time...");
set_time();
}

View File

@ -0,0 +1,11 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
# (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
# disable the following line if there isn't the directory
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wolfssl_server)

View File

@ -0,0 +1,14 @@
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#
PROJECT_NAME := tls_server
CFLAGS += -DWOLFSSL_USER_SETTINGS
# if there isn't the directory, please disable the line below.
EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
include $(IDF_PATH)/make/project.mk

View File

@ -0,0 +1,22 @@
#wolfSSL Example
The Example contains a wolfSSL simple server.
1. "make menuconfigure" to configure the project
1-1. Example Configuration ->
WIFI SSID : your own WIFI, which is connected to the Internet.(default is "myssid")
WIFI Password : WIFI password, and default is "mypassword"
When you want to test the wolfSSL simple server demo
1. "make flash" to compile the code and load the firmware
2. "make monitor" to see the context. The assigned IP address can be found in output message.
3. Once the server connects to the wifi, it is waiting for client request.
("Waiting for a connection..." message will be displayed.)
4. You can use <wolfssl>/examples/client to test the server
e.g ./example/client/client -h xx.xx.xx
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -0,0 +1,10 @@
#
# wolfssl server test
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "server-tls.c" "wifi_connect.c")
set(COMPONENT_ADD_INCLUDEDIRS "." "./include")
register_component()

View File

@ -0,0 +1,15 @@
menu "Example Configuration"
config WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.
config WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.
endmenu

View File

@ -0,0 +1,3 @@
#
# Main Makefile. This is basically the same as a component makefile.
#

View File

@ -1,8 +1,8 @@
/* time-STM32F2.c
/* wifi_connect.h
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,26 +16,27 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifndef _TLS_WIFI_H_
#define _TLS_WIFI_H_
#include "esp_idf_version.h"
#include "esp_log.h"
#include "esp_wifi.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#include "esp_event.h"
#else
#include "esp_event_loop.h"
#endif
#define DEFAULT_PORT 11111
#include <stdint.h>
#define DWT ((DWT_Type *) (0xE0001000UL) )
typedef struct
{
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
} DWT_Type;
#define TLS_SMP_SERVER_TASK_NAME "tls_sever_example"
#define TLS_SMP_SERVER_TASK_WORDS 10240
#define TLS_SMP_SERVER_TASK_PRIORITY 8
extern uint32_t SystemCoreClock ;
#define TLS_SMP_WIFI_SSID CONFIG_WIFI_SSID
#define TLS_SMP_WIFI_PASS CONFIG_WIFI_PASSWORD
double current_time(int reset)
{
if(reset) DWT->CYCCNT = 0 ;
return ((double)DWT->CYCCNT/SystemCoreClock) ;
}
#endif

View File

@ -0,0 +1,267 @@
/* server-tls-callback.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* the usual suspects */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
/* socket includes */
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
/* wolfSSL */
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/certs_test.h>
/* ESP specific */
#include "wifi_connect.h"
#ifdef WOLFSSL_TRACK_MEMORY
#include <wolfssl/wolfcrypt/mem_track.h>
#endif
static const char* const TAG = "tls_server";
#if defined(DEBUG_WOLFSSL)
static void ShowCiphers(void)
{
char ciphers[4096];
int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));
if (ret == WOLFSSL_SUCCESS)
printf("%s\n", ciphers);
}
#endif
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you want to use a custom slot allocation */
/* enable the difinition CUSTOM_SLOT_ALLOCATION. */
#if defined(CUSTOM_SLOT_ALLOCATION)
static byte mSlotList[ATECC_MAX_SLOT];
int atmel_set_slot_allocator(atmel_slot_alloc_cb alloc, atmel_slot_dealloc_cb dealloc);
/* initialize slot array */
void my_atmel_slotInit()
{
int i;
for(i=0;i<ATECC_MAX_SLOT; i++) {
mSlotList[i] = ATECC_INVALID_SLOT;
}
}
/* allocate slot depending on slotType */
int my_atmel_alloc(int slotType)
{
int i, slot = -1;
switch(slotType){
case ATMEL_SLOT_ENCKEY:
slot = 4;
break;
case ATMEL_SLOT_DEVICE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE:
slot = 0;
break;
case ATMEL_SLOT_ECDHE_ENC:
slot = 4;
break;
case ATMEL_SLOT_ANY:
for(i=0;i<ATECC_MAX_SLOT;i++){
if(mSlotList[i] == ATECC_INVALID_SLOT){
slot = i;
break;
}
}
}
return slot;
}
/* free slot array */
void my_atmel_free(int slotId)
{
if(slotId >= 0 && slotId < ATECC_MAX_SLOT){
mSlotList[slotId] = ATECC_INVALID_SLOT;
}
}
#endif /* CUSTOM_SLOT_ALLOCATION */
#endif /* WOLFSSL_ESPWROOM32SE && HAVE_PK_CALLBACK && WOLFSSL_ATECC508A */
void tls_smp_server_task()
{
int sockfd;
int connd;
struct sockaddr_in servAddr;
struct sockaddr_in clientAddr;
socklen_t size = sizeof(clientAddr);
char buff[256];
size_t len;
int shutdown = 0;
int ret;
const char msg[] = "I hear you fa shizzle!";
/* declare wolfSSL objects */
WOLFSSL_CTX* ctx;
WOLFSSL* ssl;
WOLFSSL_ENTER("tls_smp_server_task");
#ifdef DEBUG_WOLFSSL
WOLFSSL_MSG("Debug ON");
wolfSSL_Debugging_ON();
ShowCiphers();
#endif
/* Initialize wolfSSL */
WOLFSSL_MSG("Start wolfSSL_Init()");
wolfSSL_Init();
/* Create a socket that uses an internet IPv4 address,
* Sets the socket to be stream based (TCP),
* 0 means choose the default protocol. */
WOLFSSL_MSG( "start socket())");
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
ESP_LOGE(TAG, "ERROR: failed to create the socket");
}
/* Create and initialize WOLFSSL_CTX */
WOLFSSL_MSG("Create and initialize WOLFSSL_CTX");
if ((ctx = wolfSSL_CTX_new(wolfSSLv23_server_method())) == NULL) {
ESP_LOGE(TAG, "ERROR: failed to create WOLFSSL_CTX");
}
WOLFSSL_MSG("Loading certificate...");
/* Load server certificates into WOLFSSL_CTX */
if ((ret = wolfSSL_CTX_use_certificate_buffer(ctx, server_cert_der_2048,
sizeof_server_cert_der_2048,
WOLFSSL_FILETYPE_ASN1)) != SSL_SUCCESS) {
ESP_LOGE(TAG, "ERROR: failed to load cert");
}
WOLFSSL_MSG("Loading key info...");
/* Load server key into WOLFSSL_CTX */
if((ret=wolfSSL_CTX_use_PrivateKey_buffer(ctx,
server_key_der_2048, sizeof_server_key_der_2048,
WOLFSSL_FILETYPE_ASN1)) != SSL_SUCCESS) {
ESP_LOGE(TAG, "ERROR: failed to load privatekey");
}
/* TO DO when using ECDSA, it loads the provisioned certificate and present it.*/
/* TO DO when using ECDSA, it uses the generated key instead of loading key */
/* Initialize the server address struct with zeros */
memset(&servAddr, 0, sizeof(servAddr));
/* Fill in the server address */
servAddr.sin_family = AF_INET; /* using IPv4 */
servAddr.sin_port = htons(DEFAULT_PORT); /* on DEFAULT_PORT */
servAddr.sin_addr.s_addr = INADDR_ANY; /* from anywhere */
/* Bind the server socket to our port */
if (bind(sockfd, (struct sockaddr*)&servAddr, sizeof(servAddr)) == -1) {
ESP_LOGE(TAG, "ERROR: failed to bind");
}
/* Listen for a new connection, allow 5 pending connections */
if (listen(sockfd, 5) == -1) {
ESP_LOGE(TAG, "ERROR: failed to listen");
}
#if defined(WOLFSSL_ESPWROOM32SE) && defined(HAVE_PK_CALLBACKS) \
&& defined(WOLFSSL_ATECC508A)
atcatls_set_callbacks(ctx);
/* when using a custom slot allocation */
#if defined(CUSTOM_SLOT_ALLOCATION)
my_atmel_slotInit();
atmel_set_slot_allocator(my_atmel_alloc, my_atmel_free);
#endif
#endif
/* Continue to accept clients until shutdown is issued */
while (!shutdown) {
WOLFSSL_MSG("Waiting for a connection...");
/* Accept client connections */
if ((connd = accept(sockfd, (struct sockaddr*)&clientAddr, &size))
== -1) {
ESP_LOGE(TAG, "ERROR: failed to accept the connection");
}
/* Create a WOLFSSL object */
if ((ssl = wolfSSL_new(ctx)) == NULL) {
ESP_LOGE(TAG, "ERROR: failed to create WOLFSSL object");
}
/* Attach wolfSSL to the socket */
wolfSSL_set_fd(ssl, connd);
/* Establish TLS connection */
ret = wolfSSL_accept(ssl);
if (ret != SSL_SUCCESS) {
ESP_LOGE(TAG, "wolfSSL_accept error %d", wolfSSL_get_error(ssl, ret));
}
WOLFSSL_MSG("Client connected successfully");
/* Read the client data into our buff array */
memset(buff, 0, sizeof(buff));
if (wolfSSL_read(ssl, buff, sizeof(buff)-1) == -1) {
ESP_LOGE(TAG, "ERROR: failed to read");
}
/* Print to stdout any data the client sends */
WOLFSSL_MSG("Client sends:");
WOLFSSL_MSG(buff);
/* Check for server shutdown command */
if (strncmp(buff, "shutdown", 8) == 0) {
WOLFSSL_MSG("Shutdown command issued!");
shutdown = 1;
}
/* Write our reply into buff */
memset(buff, 0, sizeof(buff));
memcpy(buff, msg, sizeof(msg));
len = strnlen(buff, sizeof(buff));
/* Reply back to the client */
if (wolfSSL_write(ssl, buff, len) != len) {
ESP_LOGE(TAG, "ERROR: failed to write");
}
/* Cleanup after this connection */
wolfSSL_free(ssl); /* Free the wolfSSL object */
close(connd); /* Close the connection to the client */
}
/* Cleanup and return */
wolfSSL_CTX_free(ctx); /* Free the wolfSSL context object */
wolfSSL_Cleanup(); /* Cleanup the wolfSSL environment */
close(sockfd); /* Close the socket listening for clients */
vTaskDelete(NULL);
return; /* Return reporting a success */
}

View File

@ -0,0 +1,159 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/*ESP specific */
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "wifi_connect.h"
#include "lwip/sockets.h"
#include "lwip/netdb.h"
#include "lwip/apps/sntp.h"
#include "nvs_flash.h"
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
#include "protocol_examples_common.h"
#endif
const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
/* prefix for logging */
const static char *TAG = "tls_server";
/* proto-type difinition */
extern void tls_smp_server_task();
static void tls_smp_server_init();
static void set_time()
{
/* set dummy wallclock time. */
struct timeval utctime;
struct timezone tz;
struct strftime_buf;
time_t now;
struct tm timeinfo;
char strftime_buf[64];
/* please update the time if seeing unknown failure. */
/* this could cause TLS communication failure due to time expiration */
utctime.tv_sec = 1567125910; /* dummy time: Fri Aug 30 09:45:00 2019 */
utctime.tv_usec = 0;
tz.tz_minuteswest = 0;
tz.tz_dsttime = 0;
settimeofday(&utctime, &tz);
time(&now);
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
ESP_LOGI(TAG, "The current date/time is: %s", strftime_buf);
#if ESP_IDF_VERSION_MAJOR < 4
/* wait until wifi connect */
xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT,
false, true, portMAX_DELAY);
#endif
/* now we start client tasks. */
tls_smp_server_init();
}
/* create task */
static void tls_smp_server_init(void)
{
int ret;
xTaskHandle _handle;
/* http://esp32.info/docs/esp_idf/html/dd/d3c/group__xTaskCreate.html */
ret = xTaskCreate(tls_smp_server_task,
TLS_SMP_SERVER_TASK_NAME,
TLS_SMP_SERVER_TASK_WORDS,
NULL,
TLS_SMP_SERVER_TASK_PRIORITY,
&_handle);
if (ret != pdPASS) {
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_SERVER_TASK_NAME);
}
}
/* event hander for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
switch (event->event_id)
{
case SYSTEM_EVENT_STA_START:
esp_wifi_connect();
break;
case SYSTEM_EVENT_STA_GOT_IP:
ESP_LOGI(TAG, "got ip:%s",
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
/* http://esp32.info/docs/esp_idf/html/dd/d08/group__xEventGroupSetBits.html */
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
esp_wifi_connect();
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
break;
default:
break;
}
return ESP_OK;
}
/* entry point */
void app_main(void)
{
ESP_LOGI(TAG, "Start app_main...");
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
tcpip_adapter_init();
/* */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
(void) wifi_event_handler;
ESP_ERROR_CHECK(esp_event_loop_create_default());
/* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
* Read "Establishing Wi-Fi or Ethernet Connection" section in
* examples/protocols/README.md for more information about this function.
*/
ESP_ERROR_CHECK(example_connect());
#else
wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_event_loop_init(wifi_event_handler, NULL));
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
wifi_config_t wifi_config = {
.sta = {
.ssid = TLS_SMP_WIFI_SSID,
.password = TLS_SMP_WIFI_PASS,
},
};
/* WiFi station mode */
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
/* Wifi Set the configuration of the ESP32 STA or AP */
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
/* Start Wifi */
ESP_ERROR_CHECK(esp_wifi_start() );
ESP_LOGI(TAG, "wifi_init_sta finished.");
ESP_LOGI(TAG, "connect to ap SSID:%s password:%s",
TLS_SMP_WIFI_SSID, TLS_SMP_WIFI_PASS);
#endif
ESP_LOGI(TAG, "Set dummy time...");
set_time();
}

View File

@ -0,0 +1,6 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wolfssl_test)

View File

@ -0,0 +1,11 @@
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#
PROJECT_NAME := wolfssl_test
CFLAGS += -DWOLFSSL_USER_SETTINGS
include $(IDF_PATH)/make/project.mk

View File

@ -0,0 +1,10 @@
#wolfSSL Example
The Example contains of wolfSSL test program.
When you want to run the benchmark program
1. "make menuconfig" to configure the program,first
2. "make flash" to compile and load the firmware
3. "make monitor" to see the message
See the README.md file in the upper level 'examples' directory for more information about examples.

View File

@ -0,0 +1,10 @@
#
# wolfssl crypt test
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCS "test.c")
set(COMPONENT_ADD_INCLUDEDIRS ".")
register_component()

View File

@ -0,0 +1,3 @@
#
# Main Makefile. This is basically the same as a component makefile.
#

View File

@ -0,0 +1,2 @@
CONFIG_MAIN_TASK_STACK_SIZE=9000
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=

View File

@ -0,0 +1,37 @@
#
# cmake for wolfssl
#
cmake_minimum_required(VERSION 3.5)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS")
set(CMAKE_CURRENT_SOURCE_DIR ".")
set(WOLFSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(INCLUDE_PATH ${WOLFSSL_ROOT})
set(COMPONENT_SRCDIRS "./src/"
"./wolfcrypt/src/"
"./wolfcrypt/src/port/Espressif/"
"./wolfcrypt/src/port/atmel/"
)
set(COMPONENT_REQUIRES lwip)
set(COMPONENT_ADD_INCLUDEDIRS
"."
"./include"
"../freertos/include/freertos"
"${WOLFSSL_ROOT}"
)
if(IS_DIRECTORY ${IDF_PATH}/components/cryptoauthlib)
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../cryptoauthlib/lib")
endif()
set(COMPONENT_SRCEXCLUDE
"wolfcrypt/src/aes_asm.S"
"wolfcrypt/src/evp.c"
"wolfcrypt/src/misc.c"
"src/bio.c"
)
register_component()

View File

@ -0,0 +1,17 @@
#
# Component Makefile
#
COMPONENT_ADD_INCLUDEDIRS := . ./include
COMPONENT_ADD_INCLUDEDIRS += ../freertos/include/freertos/
COMPONENT_SRCDIRS := src wolfcrypt/src
COMPONENT_SRCDIRS += wolfcrypt/src/port/Espressif
COMPONENT_SRCDIRS += wolfcrypt/src/port/atmel
CFLAGS +=-DWOLFSSL_USER_SETTINGS
COMPONENT_OBJEXCLUDE := wolfcrypt/src/aes_asm.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/evp.o
COMPONENT_OBJEXCLUDE += wolfcrypt/src/misc.o
COMPONENT_OBJEXCLUDE += src/bio.o

113
IDE/Espressif/ESP-IDF/setup.sh Executable file
View File

@ -0,0 +1,113 @@
#!/bin/bash
# check if IDF_PATH is set
if [ -z "$IDF_PATH" ]; then
echo "Please follows the instruction of ESP-IDF installation and set IDF_PATH."
exit 1
fi
RMDCMD='/bin/rm -rf'
MKDCMD='/bin/mkdir'
CPDCMD='/bin/cp'
SCRIPTDIR=`dirname $0`
SCRIPTDIR=`cd $SCRIPTDIR && pwd -P`
WOLFSSL_ESPIDFDIR=${SCRIPTDIR}
WOLFSSL_ESPIDFDIR=`cd $WOLFSSL_ESPIDFDIR && pwd -P`
BASEDIR=${SCRIPTDIR}/../../../
BASEDIR=`cd ${BASEDIR} && pwd -P`
# echo $WOLFSSL_ESPIDFDIR
WOLFSSLLIB_TRG_DIR=${IDF_PATH}/components/wolfssl
WOLFSSLEXP_TRG_DIR=${IDF_PATH}/examples/protocols
if [ ! -d $IDF_PATH ]; then
echo "ESP-IDF Development Framework doesn't exist.: $IDF_PATH"
exit 1
fi
# Copy files into ESP-IDF development framework
pushd $IDF_PATH > /dev/null
echo "Copy files into $IDF_PATH"
# Remove/Create directories
${RMDCMD} ${WOLFSSLLIB_TRG_DIR}/
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/src
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/wolfssl
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/test
${MKDCMD} ${WOLFSSLLIB_TRG_DIR}/include
popd > /dev/null # $WOLFSSL_ESPIDFDIR
pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR
# copying ... files in src/ into $WOLFSSLLIB_TRG_DIR/src
${CPDCMD} ./src/*.c ${WOLFSSLLIB_TRG_DIR}/src/
${CPDCMD} -r ./wolfcrypt/src/*.{c,i} ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src/
${CPDCMD} -r ./wolfcrypt/src/port ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/src/port/
${CPDCMD} -r ./wolfcrypt/test ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/
${CPDCMD} -r ./wolfcrypt/benchmark ${WOLFSSLLIB_TRG_DIR}/wolfcrypt/
${CPDCMD} -r ./wolfssl/*.h ${WOLFSSLLIB_TRG_DIR}/wolfssl/
${CPDCMD} -r ./wolfssl/wolfcrypt ${WOLFSSLLIB_TRG_DIR}/wolfssl/
# user_settings.h
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/user_settings.h ${WOLFSSLLIB_TRG_DIR}/include/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/dummy_config_h ${WOLFSSLLIB_TRG_DIR}/include/config.h
# unit test app
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/test/* ${WOLFSSLLIB_TRG_DIR}/test/
popd > /dev/null #
${CPDCMD} ./libs/CMakeLists.txt ${WOLFSSLLIB_TRG_DIR}/
${CPDCMD} ./libs/component.mk ${WOLFSSLLIB_TRG_DIR}/
pushd ${BASEDIR} > /dev/null # WOLFSSL TOP DIR
# Benchmark program
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
${CPDCMD} -r ./wolfcrypt/benchmark/benchmark.c ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_benchmark/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_benchmark/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_benchmark/main/
# Crypt Test program
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
${CPDCMD} -r ./wolfcrypt/test/test.c ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_test/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_test/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_test/main/
# TLS Client program
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/include
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_client/main/include/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_client/main/include/
# TLS Server program
${RMDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/main/
${MKDCMD} ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/main/include
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_server/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_server/main/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/main/
${CPDCMD} -r ${WOLFSSL_ESPIDFDIR}/examples/wolfssl_server/main/include/* ${WOLFSSLEXP_TRG_DIR}/wolfssl_server/main/include/
popd > /dev/null #
exit 1

View File

@ -0,0 +1,6 @@
set(COMPONENT_SRCDIRS ".")
set(COMPONENT_ADD_INCLUDEDIRS ".")
set(COMPONENT_REQUIRES unity test_utils wolfssl)
register_component()

View File

@ -0,0 +1,11 @@
# wolfSSL unit-test app
The test contains of wolfSSL unit-test app on Unity.
When you want to run the app
1. Copy *test.c* file at /path/to/esp-idf/components/wolfssl/wolfcrypt/test/ folder to the wolfssl/test folder
2. Go to /esp-idf/tools/unit-test-app/ folder
3. "make menuconfig" to configure unit test app.
4. "make TEST_COMPONENTS=wolfssl" to build wolfssl unit test app.
See [https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/unit-tests.html] for more information about unit test app.

View File

@ -0,0 +1,10 @@
#
#Component Makefile
#
#CFLAGS := -v
CFLAGS += -DNO_MAIN_DRIVER
CFLAGS += -DWOLFSSL_USER_SETTINGS
#CFLAGS += -DWOLFSSL_ESP32WROOM32_CRYPT_DEBUG
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,82 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#define BENCH_EMBEDDED
#define USE_CERT_BUFFERS_2048
/* TLS 1.3 */
#define WOLFSSL_TLS13
#define HAVE_TLS_EXTENSIONS
#define WC_RSA_PSS
#define HAVE_HKDF
#define HAVE_AEAD
#define HAVE_SUPPORTED_CURVES
/* when you want to use SINGLE THREAD */
/* #define SINGLE_THREADED */
#define NO_FILESYSTEM
#define HAVE_AESGCM
/* when you want to use SHA384 */
/* #define WOLFSSL_SHA384 */
#define WOLFSSL_SHA512
#define HAVE_ECC
#define HAVE_CURVE25519
#define CURVE25519_SMALL
#define HAVE_ED25519
/* esp32-wroom-32se specific definition */
#if defined(WOLFSSL_ESPWROOM32SE)
#define WOLFSSL_ATECC508A
#define HAVE_PK_CALLBACKS
/* when you want to use a custom slot allocation for ATECC608A */
/* unless your configuration is unusual, you can use default */
/* implementation. */
/* #define CUSTOM_SLOT_ALLOCATION */
#endif
/* rsa primitive specific definition */
#if defined(WOLFSSL_ESPWROOM32) || defined(WOLFSSL_ESPWROOM32SE)
/* Define USE_FAST_MATH and SMALL_STACK */
#define ESP32_USE_RSA_PRIMITIVE
/* threshold for performance adjustment for hw primitive use */
/* X bits of G^X mod P greater than */
#define EPS_RSA_EXPT_XBTIS 36
/* X and Y of X * Y mod P greater than */
#define ESP_RSA_MULM_BITS 2000
#endif
/* debug options */
/* #define DEBUG_WOLFSSL */
/* #define WOLFSSL_ESP32WROOM32_CRYPT_DEBUG */
/* #define WOLFSSL_ATECC508A_DEBUG */
/* date/time */
/* if it cannot adjust time in the device, */
/* enable macro below */
/* #define NO_ASN_TIME */
/* #define XTIME time */
/* when you want not to use HW acceleration */
/* #define NO_ESP32WROOM32_CRYPT */
/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH*/
/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_AES */
/* #define NO_WOLFSSL_ESP32WROOM32_CRYPT_RSA_PRI */

View File

@ -0,0 +1,641 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Custom wolfSSL user settings for GCC ARM */
#ifndef WOLFSSL_USER_SETTINGS_H
#define WOLFSSL_USER_SETTINGS_H
#ifdef __cplusplus
extern "C" {
#endif
/* ------------------------------------------------------------------------- */
/* Platform */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_GENERAL_ALIGNMENT
#define WOLFSSL_GENERAL_ALIGNMENT 4
#undef SINGLE_THREADED
#define SINGLE_THREADED
#undef WOLFSSL_SMALL_STACK
#define WOLFSSL_SMALL_STACK
#undef WOLFSSL_USER_IO
#define WOLFSSL_USER_IO
/* ------------------------------------------------------------------------- */
/* Math Configuration */
/* ------------------------------------------------------------------------- */
#undef SIZEOF_LONG_LONG
#define SIZEOF_LONG_LONG 8
#undef USE_FAST_MATH
#if 1
#define USE_FAST_MATH
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT
/* Optimizations */
//#define TFM_ARM
#endif
/* Wolf Single Precision Math */
#undef WOLFSSL_SP
#if 0
#define WOLFSSL_SP
#define WOLFSSL_SP_SMALL /* use smaller version of code */
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_CACHE_RESISTANT
//#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
/* 64 or 32 bit version */
//#define WOLFSSL_SP_ASM /* required if using the ASM versions */
//#define WOLFSSL_SP_ARM32_ASM
//#define WOLFSSL_SP_ARM64_ASM
#endif
/* ------------------------------------------------------------------------- */
/* FIPS - Requires eval or license from wolfSSL */
/* ------------------------------------------------------------------------- */
#undef HAVE_FIPS
#if 0
#define HAVE_FIPS
#undef HAVE_FIPS_VERSION
#define HAVE_FIPS_VERSION 2
#ifdef SINGLE_THREADED
#undef NO_THREAD_LS
#define NO_THREAD_LS
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Crypto */
/* ------------------------------------------------------------------------- */
/* RSA */
#undef NO_RSA
#if 1
#ifdef USE_FAST_MATH
/* Maximum math bits (Max RSA key bits * 2) */
#undef FP_MAX_BITS
#define FP_MAX_BITS 4096
#endif
/* half as much memory but twice as slow */
#undef RSA_LOW_MEM
//#define RSA_LOW_MEM
/* Enables blinding mode, to prevent timing attacks */
#if 1
#undef WC_RSA_BLINDING
#define WC_RSA_BLINDING
#else
#undef WC_NO_HARDEN
#define WC_NO_HARDEN
#endif
/* RSA PSS Support */
#if 0
#define WC_RSA_PSS
#endif
#if 0
#define WC_RSA_NO_PADDING
#endif
#else
#define NO_RSA
#endif
/* ECC */
#undef HAVE_ECC
#if 1
#define HAVE_ECC
/* Manually define enabled curves */
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
#ifdef ECC_USER_CURVES
/* Manual Curve Selection */
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
//#define HAVE_ECC384
//#define HAVE_ECC521
#endif
/* Fixed point cache (speeds repeated operations against same private key) */
#undef FP_ECC
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#undef FP_ENTRIES
#define FP_ENTRIES 2
#undef FP_LUT
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#undef ECC_SHAMIR
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#undef ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
/* Enable cofactor support */
#ifdef HAVE_FIPS
#undef HAVE_ECC_CDH
#define HAVE_ECC_CDH
#endif
/* Validate import */
#ifdef HAVE_FIPS
#undef WOLFSSL_VALIDATE_ECC_IMPORT
#define WOLFSSL_VALIDATE_ECC_IMPORT
#endif
/* Compressed Key Support */
#undef HAVE_COMP_KEY
//#define HAVE_COMP_KEY
/* Use alternate ECC size for ECC math */
#ifdef USE_FAST_MATH
#ifdef NO_RSA
/* Custom fastmath size if not using RSA */
/* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
#undef FP_MAX_BITS
#define FP_MAX_BITS (256 + 32)
#else
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#endif
/* Speedups specific to curve */
#ifndef NO_ECC256
#undef TFM_ECC256
#define TFM_ECC256
#endif
#endif
#endif
/* DH */
#undef NO_DH
#if 1
/* Use table for DH instead of -lm (math) lib dependency */
#if 0
#define WOLFSSL_DH_CONST
#define HAVE_FFDHE_2048
#define HAVE_FFDHE_4096
//#define HAVE_FFDHE_6144
//#define HAVE_FFDHE_8192
#endif
#ifdef HAVE_FIPS
#define WOLFSSL_VALIDATE_FFC_IMPORT
#define HAVE_FFDHE_Q
#endif
#else
#define NO_DH
#endif
/* AES */
#undef NO_AES
#if 1
#undef HAVE_AES_CBC
#define HAVE_AES_CBC
#undef HAVE_AESGCM
#define HAVE_AESGCM
/* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#define GCM_SMALL
#undef WOLFSSL_AES_DIRECT
//#define WOLFSSL_AES_DIRECT
#undef HAVE_AES_ECB
//#define HAVE_AES_ECB
#undef WOLFSSL_AES_COUNTER
//#define WOLFSSL_AES_COUNTER
#undef HAVE_AESCCM
//#define HAVE_AESCCM
#else
#define NO_AES
#endif
/* DES3 */
#undef NO_DES3
#if 0
#else
#define NO_DES3
#endif
/* ChaCha20 / Poly1305 */
#undef HAVE_CHACHA
#undef HAVE_POLY1305
#if 0
#define HAVE_CHACHA
#define HAVE_POLY1305
/* Needed for Poly1305 */
#undef HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH
#endif
/* Ed25519 / Curve25519 */
#undef HAVE_CURVE25519
#undef HAVE_ED25519
#if 0
#define HAVE_CURVE25519
#define HAVE_ED25519 /* ED25519 Requires SHA512 */
/* Optionally use small math (less flash usage, but much slower) */
#if 1
#define CURVED25519_SMALL
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Hashing */
/* ------------------------------------------------------------------------- */
/* Sha */
#undef NO_SHA
#if 1
/* 1k smaller, but 25% slower */
//#define USE_SLOW_SHA
#else
#define NO_SHA
#endif
/* Sha256 */
#undef NO_SHA256
#if 1
/* not unrolled - ~2k smaller and ~25% slower */
//#define USE_SLOW_SHA256
/* Sha224 */
#if 0
#define WOLFSSL_SHA224
#endif
#else
#define NO_SHA256
#endif
/* Sha512 */
#undef WOLFSSL_SHA512
#if 0
#define WOLFSSL_SHA512
/* Sha384 */
#undef WOLFSSL_SHA384
#if 0
#define WOLFSSL_SHA384
#endif
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA512
#endif
/* Sha3 */
#undef WOLFSSL_SHA3
#if 0
#define WOLFSSL_SHA3
#endif
/* MD5 */
#undef NO_MD5
#if 0
#else
#define NO_MD5
#endif
/* HKDF */
#undef HAVE_HKDF
#if 0
#define HAVE_HKDF
#endif
/* CMAC */
#undef WOLFSSL_CMAC
#if 0
#define WOLFSSL_CMAC
#endif
/* ------------------------------------------------------------------------- */
/* Benchmark / Test */
/* ------------------------------------------------------------------------- */
/* Use reduced benchmark / test sizes */
#undef BENCH_EMBEDDED
#define BENCH_EMBEDDED
#undef USE_CERT_BUFFERS_2048
#define USE_CERT_BUFFERS_2048
//#undef USE_CERT_BUFFERS_1024
//#define USE_CERT_BUFFERS_1024
#undef USE_CERT_BUFFERS_256
#define USE_CERT_BUFFERS_256
/* ------------------------------------------------------------------------- */
/* Debugging */
/* ------------------------------------------------------------------------- */
#undef DEBUG_WOLFSSL
#undef NO_ERROR_STRINGS
#if 0
#define DEBUG_WOLFSSL
#else
#if 0
#define NO_ERROR_STRINGS
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Memory */
/* ------------------------------------------------------------------------- */
/* Override Memory API's */
#if 0
#undef XMALLOC_OVERRIDE
#define XMALLOC_OVERRIDE
/* prototypes for user heap override functions */
/* Note: Realloc only required for normal math */
#include <stddef.h> /* for size_t */
extern void *myMalloc(size_t n, void* heap, int type);
extern void myFree(void *p, void* heap, int type);
extern void *myRealloc(void *p, size_t n, void* heap, int type);
#define XMALLOC(n, h, t) myMalloc(n, h, t)
#define XFREE(p, h, t) myFree(p, h, t)
#define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
#endif
#if 0
/* Static memory requires fast math */
#define WOLFSSL_STATIC_MEMORY
/* Disable fallback malloc/free */
#define WOLFSSL_NO_MALLOC
#if 1
#define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
#endif
#endif
/* Memory callbacks */
#if 0
#undef USE_WOLFSSL_MEMORY
#define USE_WOLFSSL_MEMORY
/* Use this to measure / print heap usage */
#if 1
#undef WOLFSSL_TRACK_MEMORY
#define WOLFSSL_TRACK_MEMORY
#undef WOLFSSL_DEBUG_MEMORY
#define WOLFSSL_DEBUG_MEMORY
#endif
#else
#ifndef WOLFSSL_STATIC_MEMORY
#define NO_WOLFSSL_MEMORY
/* Otherwise we will use stdlib malloc, free and realloc */
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Port */
/* ------------------------------------------------------------------------- */
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
#define WOLFSSL_GMTIME
#define USER_TICKS
extern unsigned long my_time(unsigned long* timer);
#define XTIME my_time
/* ------------------------------------------------------------------------- */
/* RNG */
/* ------------------------------------------------------------------------- */
/* Seed Source */
/* Size of returned HW RNG value */
#define CUSTOM_RAND_TYPE unsigned int
extern unsigned int my_rng_seed_gen(void);
#undef CUSTOM_RAND_GENERATE
#define CUSTOM_RAND_GENERATE my_rng_seed_gen
/* Choose RNG method */
#if 1
/* Use built-in P-RNG (SHA256 based) with HW RNG */
/* P-RNG + HW RNG (P-RNG is ~8K) */
#undef HAVE_HASHDRBG
#define HAVE_HASHDRBG
#else
#undef WC_NO_HASHDRBG
#define WC_NO_HASHDRBG
/* Bypass P-RNG and use only HW RNG */
extern int my_rng_gen_block(unsigned char* output, unsigned int sz);
#undef CUSTOM_RAND_GENERATE_BLOCK
#define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
#endif
/* ------------------------------------------------------------------------- */
/* Custom Standard Lib */
/* ------------------------------------------------------------------------- */
/* Allows override of all standard library functions */
#undef STRING_USER
#if 0
#define STRING_USER
#include <string.h>
#undef USE_WOLF_STRSEP
#define USE_WOLF_STRSEP
#define XSTRSEP(s1,d) wc_strsep((s1),(d))
#undef USE_WOLF_STRTOK
#define USE_WOLF_STRTOK
#define XSTRTOK(s1,d,ptr) wc_strtok((s1),(d),(ptr))
#define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
#define XMEMCPY(d,s,l) memcpy((d),(s),(l))
#define XMEMSET(b,c,l) memset((b),(c),(l))
#define XMEMCMP(s1,s2,n) memcmp((s1),(s2),(n))
#define XMEMMOVE(d,s,l) memmove((d),(s),(l))
#define XSTRLEN(s1) strlen((s1))
#define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
#define XSTRSTR(s1,s2) strstr((s1),(s2))
#define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
#define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#endif
/* ------------------------------------------------------------------------- */
/* Enable Features */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_TLS13
#if 0
#define WOLFSSL_TLS13
#endif
#undef WOLFSSL_KEY_GEN
#if 0
#define WOLFSSL_KEY_GEN
#endif
#if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
#define WOLFSSL_OLD_PRIME_CHECK
#endif
#undef KEEP_PEER_CERT
//#define KEEP_PEER_CERT
#undef HAVE_COMP_KEY
//#define HAVE_COMP_KEY
#undef HAVE_TLS_EXTENSIONS
#define HAVE_TLS_EXTENSIONS
#undef HAVE_SUPPORTED_CURVES
#define HAVE_SUPPORTED_CURVES
#undef WOLFSSL_BASE64_ENCODE
#define WOLFSSL_BASE64_ENCODE
/* TLS Session Cache */
#if 0
#define SMALL_SESSION_CACHE
#else
#define NO_SESSION_CACHE
#endif
/* ------------------------------------------------------------------------- */
/* Disable Features */
/* ------------------------------------------------------------------------- */
#undef NO_WOLFSSL_SERVER
//#define NO_WOLFSSL_SERVER
#undef NO_WOLFSSL_CLIENT
//#define NO_WOLFSSL_CLIENT
#undef NO_CRYPT_TEST
//#define NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
//#define NO_CRYPT_BENCHMARK
#undef WOLFCRYPT_ONLY
//#define WOLFCRYPT_ONLY
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */
#undef NO_INLINE
//#define NO_INLINE
#undef NO_FILESYSTEM
#define NO_FILESYSTEM
#undef NO_WRITEV
#define NO_WRITEV
#undef NO_MAIN_DRIVER
#define NO_MAIN_DRIVER
#undef NO_DEV_RANDOM
#define NO_DEV_RANDOM
#undef NO_DSA
#define NO_DSA
#undef NO_RC4
#define NO_RC4
#undef NO_OLD_TLS
#define NO_OLD_TLS
#undef NO_HC128
#define NO_HC128
#undef NO_RABBIT
#define NO_RABBIT
#undef NO_PSK
#define NO_PSK
#undef NO_MD4
#define NO_MD4
#undef NO_PWDBASED
#define NO_PWDBASED
#undef NO_CODING
//#define NO_CODING
#undef NO_ASN_TIME
//#define NO_ASN_TIME
#undef NO_CERTS
//#define NO_CERTS
#undef NO_SIG_WRAPPER
//#define NO_SIG_WRAPPER
#ifdef __cplusplus
}
#endif
#endif /* WOLFSSL_USER_SETTINGS_H */

16
IDE/GCC-ARM/Makefile Normal file
View File

@ -0,0 +1,16 @@
BUILD_DIR = ./Build
all: WolfSSLStaticLib WolfCryptTest WolfCryptBench WolfSSLClient
WolfCryptTest:
$(MAKE) -f Makefile.test
WolfCryptBench:
$(MAKE) -f Makefile.bench
WolfSSLClient:
$(MAKE) -f Makefile.client
WolfSSLStaticLib:
$(MAKE) -f Makefile.static
clean:
rm -f $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.hex $(BUILD_DIR)/*.map
rm -f $(BUILD_DIR)/*.o $(BUILD_DIR)/*.a $(BUILD_DIR)/*.sym $(BUILD_DIR)/*.disasm

View File

@ -0,0 +1,7 @@
# Project name
BIN = WolfCryptBench
SRC_C = ./Source/benchmark_main.c
all: build_hex
include Makefile.common

View File

@ -0,0 +1,7 @@
# Project name
BIN = WolfSSLClient
SRC_C = ./Source/tls_client.c
all: build_hex
include Makefile.common

213
IDE/GCC-ARM/Makefile.common Normal file
View File

@ -0,0 +1,213 @@
# Set to @ if you want to suppress command echo
CMD_ECHO =
# Important directories
BUILD_DIR = ./Build
# Toolchain location and prefix
#TOOLCHAIN =
TOOLCHAIN = /opt/gcc-arm-none-eabi/bin/arm-none-eabi-
# Tools selection
CC = $(TOOLCHAIN)gcc
AS = $(TOOLCHAIN)gcc
LD = $(TOOLCHAIN)gcc
AR = $(TOOLCHAIN)ar
NM = $(TOOLCHAIN)nm
OBJCOPY = $(TOOLCHAIN)objcopy
OBJDUMP = $(TOOLCHAIN)objdump
SIZE = $(TOOLCHAIN)size
# Includes
INC = -I./Header \
-I./Source \
-I../..
# Defines
DEF = -DWOLFSSL_USER_SETTINGS
# Architecture
ARCHFLAGS = -mcpu=cortex-m0 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
#ARCHFLAGS = -mcpu=cortex-r5 -mthumb -mabi=aapcs
#ARCHFLAGS = -mcpu=cortex-a53 -mthumb -mabi=aapcs
# Compiler and linker flags
ASFLAGS = $(ARCHFLAGS)
CFLAGS = $(ARCHFLAGS) -std=gnu99 -Wall -Wno-cpp
LDFLAGS = $(ARCHFLAGS)
# LD: Link with nosys
LDFLAGS += --specs=nosys.specs
# LD: Link with nano or rdimon implementation for standard library
LDFLAGS += --specs=nano.specs
#LDFLAGS += --specs=rdimon.specs
# LD: generate map
LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(BIN).map
# LD: Entry point
LDFLAGS += -Wl,-ereset_handler
# Math lib (for DH)
LIBS = -lm
# Memory Map
SRC_LD = -T./linker.ld
# Optimization level and place functions / data into separate sections to allow dead code removal
CFLAGS += -Os -ffunction-sections -fdata-sections -fno-builtin
# Remove unused sections and link time optimizations
LDFLAGS += -Wl,--gc-sections -flto
# Debugging
#DBGFLAGS = -ggdb -g3
CFLAGS += $(DBGFLAGS)
LDFLAGS += $(DBGFLAGS)
# FILES
# Port and Test/Benchmark
SRC_C += ./Source/wolf_main.c
SRC_C += ./Source/armtarget.c
SRC_C += ../../wolfcrypt/test/test.c
SRC_C += ../../wolfcrypt/benchmark/benchmark.c
# WOLFSSL TLS FILES
SRC_C += ../../src/crl.c
SRC_C += ../../src/internal.c
SRC_C += ../../src/keys.c
SRC_C += ../../src/ocsp.c
SRC_C += ../../src/sniffer.c
SRC_C += ../../src/ssl.c
SRC_C += ../../src/tls.c
SRC_C += ../../src/tls13.c
SRC_C += ../../src/wolfio.c
# wolfCrypt Core (FIPS)
SRC_C += ../../wolfcrypt/src/wolfcrypt_first.c
SRC_C += ../../wolfcrypt/src/aes.c
SRC_C += ../../wolfcrypt/src/cmac.c
SRC_C += ../../wolfcrypt/src/des3.c
SRC_C += ../../wolfcrypt/src/dh.c
SRC_C += ../../wolfcrypt/src/ecc.c
SRC_C += ../../wolfcrypt/src/hmac.c
SRC_C += ../../wolfcrypt/src/random.c
SRC_C += ../../wolfcrypt/src/rsa.c
SRC_C += ../../wolfcrypt/src/sha.c
SRC_C += ../../wolfcrypt/src/sha256.c
SRC_C += ../../wolfcrypt/src/sha512.c
SRC_C += ../../wolfcrypt/src/sha3.c
SRC_C += ../../wolfcrypt/src/fips.c
SRC_C += ../../wolfcrypt/src/fips_test.c
SRC_C += ../../wolfcrypt/src/wolfcrypt_last.c
# wolfCrypt Additional
SRC_C += ../../wolfcrypt/src/asn.c
SRC_C += ../../wolfcrypt/src/chacha.c
SRC_C += ../../wolfcrypt/src/cmac.c
SRC_C += ../../wolfcrypt/src/coding.c
SRC_C += ../../wolfcrypt/src/compress.c
SRC_C += ../../wolfcrypt/src/cpuid.c
SRC_C += ../../wolfcrypt/src/cryptocb.c
SRC_C += ../../wolfcrypt/src/curve25519.c
SRC_C += ../../wolfcrypt/src/ed25519.c
SRC_C += ../../wolfcrypt/src/error.c
SRC_C += ../../wolfcrypt/src/fe_low_mem.c
SRC_C += ../../wolfcrypt/src/fe_operations.c
SRC_C += ../../wolfcrypt/src/ge_low_mem.c
SRC_C += ../../wolfcrypt/src/ge_operations.c
SRC_C += ../../wolfcrypt/src/hash.c
SRC_C += ../../wolfcrypt/src/integer.c
SRC_C += ../../wolfcrypt/src/logging.c
SRC_C += ../../wolfcrypt/src/md5.c
SRC_C += ../../wolfcrypt/src/memory.c
SRC_C += ../../wolfcrypt/src/misc.c
SRC_C += ../../wolfcrypt/src/pkcs12.c
SRC_C += ../../wolfcrypt/src/pkcs7.c
SRC_C += ../../wolfcrypt/src/poly1305.c
SRC_C += ../../wolfcrypt/src/pwdbased.c
SRC_C += ../../wolfcrypt/src/signature.c
SRC_C += ../../wolfcrypt/src/srp.c
SRC_C += ../../wolfcrypt/src/sp_arm32.c
SRC_C += ../../wolfcrypt/src/sp_arm64.c
SRC_C += ../../wolfcrypt/src/sp_c32.c
SRC_C += ../../wolfcrypt/src/sp_int.c
SRC_C += ../../wolfcrypt/src/tfm.c
SRC_C += ../../wolfcrypt/src/wc_encrypt.c
SRC_C += ../../wolfcrypt/src/wc_port.c
SRC_C += ../../wolfcrypt/src/wolfevent.c
SRC_C += ../../wolfcrypt/src/wolfmath.c
# wolfCrypt non-standard algorithms (disabled by default)
SRC_C += ../../wolfcrypt/src/arc4.c
SRC_C += ../../wolfcrypt/src/blake2b.c
SRC_C += ../../wolfcrypt/src/camellia.c
SRC_C += ../../wolfcrypt/src/dsa.c
SRC_C += ../../wolfcrypt/src/hc128.c
SRC_C += ../../wolfcrypt/src/idea.c
SRC_C += ../../wolfcrypt/src/md2.c
SRC_C += ../../wolfcrypt/src/md4.c
SRC_C += ../../wolfcrypt/src/rabbit.c
SRC_C += ../../wolfcrypt/src/ripemd.c
FILENAMES_C = $(notdir $(SRC_C))
FILENAMES_C := $(filter-out evp.c, $(FILENAMES_C))
OBJS_C = $(addprefix $(BUILD_DIR)/, $(FILENAMES_C:.c=.o))
vpath %.c $(dir $(SRC_C))
build_hex: $(BUILD_DIR) $(BUILD_DIR)/$(BIN).hex
@echo ""
$(CMD_ECHO) @$(SIZE) $(BUILD_DIR)/$(BIN).elf
build_static: $(BUILD_DIR) $(BUILD_DIR)/$(BIN).a
@echo ""
$(CMD_ECHO) @$(SIZE) $(BUILD_DIR)/$(BIN).a
$(BUILD_DIR):
$(CMD_ECHO) mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/$(BIN).hex: $(BUILD_DIR)/$(BIN).elf
@echo "Generating HEX binary: $(notdir $@)"
$(CMD_ECHO) $(OBJCOPY) -O ihex $< $@
$(BUILD_DIR)/%.o: %.s
@echo "Compiling ASM file: $(notdir $<)"
$(CMD_ECHO) $(AS) $(ASFLAGS) $(DEF) $(INC) -c -o $@ $<
$(BUILD_DIR)/%.o: %.c
@echo "Compiling C file: $(notdir $<)"
$(CMD_ECHO) $(CC) $(CFLAGS) $(DEF) $(INC) -c -o $@ $<
$(BUILD_DIR)/$(BIN).elf: $(OBJS_ASM) $(OBJS_C)
@echo "Linking ELF binary: $(notdir $@)"
$(CMD_ECHO) $(LD) $(LDFLAGS) $(SRC_LD) -o $@ $^ $(LIBS)
@echo "Generating name list: $(BIN).sym"
$(CMD_ECHO) $(NM) -n $@ > $(BUILD_DIR)/$(BIN).sym
@echo "Showing final size:"
$(CMD_ECHO) ls -la $@
@echo "Generating disassembly: $(BIN).disasm"
$(CMD_ECHO) $(OBJDUMP) -S $@ > $(BUILD_DIR)/$(BIN).disasm
$(BUILD_DIR)/$(BIN).a: $(OBJS_ASM) $(OBJS_C)
@echo "Building static library: $(notdir $@)"
$(CMD_ECHO) $(AR) -r $@ $^
@echo "Generating name list: $(BIN).sym"
$(CMD_ECHO) $(NM) -n $@ > $(BUILD_DIR)/$(BIN).sym
@echo "Showing final size:"
$(CMD_ECHO) ls -la $@
@echo "Generating disassembly: $(BIN).disasm"
$(CMD_ECHO) $(OBJDUMP) -S $@ > $(BUILD_DIR)/$(BIN).disasm
clean:
rm -f $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.hex $(BUILD_DIR)/*.map
rm -f $(BUILD_DIR)/*.o $(BUILD_DIR)/*.a $(BUILD_DIR)/*.sym $(BUILD_DIR)/*.disasm

View File

@ -0,0 +1,6 @@
# Project name
BIN = libwolfssl
all: build_static
include Makefile.common

View File

@ -0,0 +1,7 @@
# Project name
BIN = WolfCryptTest
SRC_C = ./Source/test_main.c
all: build_hex
include Makefile.common

125
IDE/GCC-ARM/README.md Normal file
View File

@ -0,0 +1,125 @@
# Example Project for GCC ARM
This example is for Cortex M series, but can be adopted for other architectures.
## Design
* All library options are defined in `Header/user_settings.h`.
* The memory map is located in the linker file in `linker.ld`.
* Entry point function is `reset_handler` in `armtarget.c`.
* The RTC and RNG hardware interface needs implemented for real production applications in `armtarget.c`
## Building
1. Make sure you have `gcc-arm-none-eabi` installed.
2. Modify the `Makefile.common`:
* Use correct toolchain path `TOOLCHAIN`.
* Use correct architecture 'ARCHFLAGS'. See [GCC ARM Options](https://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/ARM-Options.html) `-mcpu=name`.
* Confirm memory map in linker.ld matches your flash/ram or comment out `SRC_LD = -T./linker.ld` in Makefile.common.
3. Use `make` to build the static library (libwolfssl.a), wolfCrypt test/benchmark and wolfSSL TLS client targets as `.elf` and `.hex` in `/Build`.
## Building for Raspberry Pi
Example `Makefile.common` changes for Raspberry Pi with Cortex-A53:
1. In Makefile.common change `ARCHFLAGS` to `-mcpu=cortex-a53 -mthumb`.
2. Comment out `SRC_LD`, since custom memory map is not applicable.
3. Clear `TOOLCHAIN`, so it will use default `gcc`. Set `TOOLCHAIN = `
4. Comment out `LDFLAGS += --specs=nano.specs` and `LDFLAGS += --specs=nosys.specs` to nosys and nano.
Note: To comment out a line in a Makefile use place `#` in front of line.
## Building for FIPS
1. Request evaluation from wolfSSL by emailing fips@wolfss.com.
2. Modify user_settings.h so section for `HAVE_FIPS` is enabled.
3. Use `make`.
4. Run the wolfCrypt test `./Build/WolfCryptTest.elf` to generate the FIPS boundary HASH
Example:
```
$ Crypt Test
error test passed!
base64 test passed!
base16 test passed!
asn test passed!
in my Fips callback, ok = 0, err = -203
message = In Core Integrity check FIPS error
hash = F607C7B983D1D283590448A56381DE460F1E83CB02584F4D77B7F2C583A8F5CD
In core integrity hash check failure, copy above hash
into verifyCore[] in fips_test.c and rebuild
SHA test failed!
error = -1802
Crypt Test: Return code -1
```
5. Update the `../../wolfcrypt/src/fips_test.c` array `static const char verifyCore[] = {}` with the correct core hash check.
6. Build again using `make`.
7. Run the wolfCrypt test.
## Building with configure
The configure script in the main project directory can perform a cross-compile
build with the the gcc-arm-none-eabi tools. Assuming the tools are installed in
your executable path:
```
$ ./configure \
--host=arm-non-eabi \
CC=arm-none-eabi-gcc \
AR=arm-none-eabi-ar \
STRIP=arm-none-eabi-strip \
RANLIB=arm-none-eabi-ranlib \
--prefix=/path/to/build/wolfssl-arm \
CFLAGS="-march=armv8-a --specs=nosys.specs \
-DHAVE_PK_CALLBACKS -DWOLFSSL_USER_IO -DNO_WRITEV" \
--disable-filesystem --enable-fastmath \
--disable-shared
$ make
$ make install
```
If you are building for a 32-bit architecture, add `-DTIME_T_NOT_64BIT` to the
list of CFLAGS.
## Example Build Output
```
make clean && make
text data bss dec hex filename
50076 2508 44 52628 cd94 ./Build/WolfCryptTest.elf
text data bss dec hex filename
39155 2508 60 41723 a2fb ./Build/WolfCryptBench.elf
text data bss dec hex filename
70368 464 36 70868 114d4 ./Build/WolfSSLClient.elf
```
## Performance Tuning Options
These settings are located in `Header/user_settings.h`.
* `DEBUG_WOLFSSL`: Undefine this to disable debug logging.
* `NO_ERROR_STRINGS`: Disables error strings to save code space.
* `NO_INLINE`: Disabling inline function saves about 1KB, but is slower.
* `WOLFSSL_SMALL_STACK`: Enables stack reduction techniques to allocate stack sections over 100 bytes from heap.
* `USE_FAST_MATH`: Uses stack based math, which is faster than the heap based math.
* `ALT_ECC_SIZE`: If using fast math and RSA/DH you can define this to reduce your ECC memory consumption.
* `FP_MAX_BITS`: Is the maximum math size (key size * 2). Used only with `USE_FAST_MATH`.
* `ECC_TIMING_RESISTANT`: Enables timing resistance for ECC and uses slightly less memory.
* `ECC_SHAMIR`: Doubles heap usage, but slightly faster
* `RSA_LOW_MEM`: Half as much memory but twice as slow. Uses Non-CRT method for private key.
* AES GCM: `GCM_SMALL`, `GCM_WORD32` or `GCM_TABLE`: Tunes performance and flash/memory usage.
* `CURVED25519_SMALL`: Enables small versions of Ed/Curve (FE/GE math).
* `USE_SLOW_SHA`: Enables smaller/slower version of SHA.
* `USE_SLOW_SHA256`: About 2k smaller and about 25% slower
* `USE_SLOW_SHA512`: Over twice as small, but 50% slower
* `USE_CERT_BUFFERS_1024` or `USE_CERT_BUFFERS_2048`: Size of RSA certs / keys to test with.
* `BENCH_EMBEDDED`: Define this if using the wolfCrypt test/benchmark and using a low memory target.
* `ECC_USER_CURVES`: Allows user to define curve sizes to enable. Default is 256-bit on. To enable others use `HAVE_ECC192`, `HAVE_ECC224`, etc....
* `TFM_ARM`, `TFM_SSE2`, `TFM_AVR32`, `TFM_PPC32`, `TFM_MIPS`, `TFM_X86` or `TFM_X86_64`: These are assembly optimizations available with USE_FAST_MATH.
* Single Precision Math for ARM: See `WOLFSSL_SP`. Optimized math for ARM performance of specific RSA, DH and ECC algorithms.

View File

@ -0,0 +1,210 @@
/* armtarget.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/random.h> /* for CUSTOM_RAND_TYPE */
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#ifdef USE_WOLF_ARM_STARTUP
/* Memory initialization */
extern uint32_t __data_load_start__[];
extern uint32_t __data_start__[];
extern uint32_t __data_end__[];
extern uint32_t __bss_start__[];
extern uint32_t __bss_end__[];
extern uint32_t __stack_process_end__[];
extern uint32_t __heap_start__[];
extern uint32_t __heap_end__[];
/* Copy memory: src=Source, dst_beg=Destination Begin, dst_end=Destination End */
void memcpy32(uint32_t* src, uint32_t* dst_beg, uint32_t* dst_end)
{
while (dst_beg < dst_end) {
*dst_beg++ = *src++;
}
}
/* Zero address in range */
void meminit32(uint32_t* start, uint32_t* end)
{
while (start < end) {
*start++ = 0;
}
}
#endif /* USE_WOLF_ARM_STARTUP */
/* Entry Point */
void reset_handler(void)
{
#ifdef USE_WOLF_ARM_STARTUP
/* Init sections */
memcpy32(__data_load_start__, __data_start__, __data_end__);
meminit32(__bss_start__, __bss_end__);
/* Init heap */
__heap_start__[0] = 0;
__heap_start__[1] = ((uint32_t)__heap_end__ - (uint32_t)__heap_start__);
#endif /* USE_WOLF_ARM_STARTUP */
/* Start main */
extern int main(void);
main();
/* Application has ended, so busy wait */
while(1);
}
#ifdef USE_WOLF_ARM_STARTUP
// Vector Exception/Interrupt Handlers
static void Default_Handler(void)
{
/* If we get here then need to implement real IRQ handler */
while(1);
}
__attribute__((section(".sys"))) __attribute__ ((used))
void HardFault_HandlerC( uint32_t *hardfault_args )
{
/* These are volatile to try and prevent the compiler/linker optimizing them
away as the variables never actually get used. If the debugger won't show the
values of the variables, make them global my moving their declaration outside
of this function. */
volatile uint32_t stacked_r0;
volatile uint32_t stacked_r1;
volatile uint32_t stacked_r2;
volatile uint32_t stacked_r3;
volatile uint32_t stacked_r12;
volatile uint32_t stacked_lr;
volatile uint32_t stacked_pc;
volatile uint32_t stacked_psr;
volatile uint32_t _CFSR;
volatile uint32_t _HFSR;
volatile uint32_t _DFSR;
volatile uint32_t _AFSR;
volatile uint32_t _BFAR;
volatile uint32_t _MMAR;
stacked_r0 = ((uint32_t)hardfault_args[0]);
stacked_r1 = ((uint32_t)hardfault_args[1]);
stacked_r2 = ((uint32_t)hardfault_args[2]);
stacked_r3 = ((uint32_t)hardfault_args[3]);
stacked_r12 = ((uint32_t)hardfault_args[4]);
stacked_lr = ((uint32_t)hardfault_args[5]);
stacked_pc = ((uint32_t)hardfault_args[6]);
stacked_psr = ((uint32_t)hardfault_args[7]);
// Configurable Fault Status Register
// Consists of MMSR, BFSR and UFSR
_CFSR = (*((volatile uint32_t *)(0xE000ED28)));
// Hard Fault Status Register
_HFSR = (*((volatile uint32_t *)(0xE000ED2C)));
// Debug Fault Status Register
_DFSR = (*((volatile uint32_t *)(0xE000ED30)));
// Auxiliary Fault Status Register
_AFSR = (*((volatile uint32_t *)(0xE000ED3C)));
// Read the Fault Address Registers. These may not contain valid values.
// Check BFARVALID/MMARVALID to see if they are valid values
// MemManage Fault Address Register
_MMAR = (*((volatile uint32_t *)(0xE000ED34)));
// Bus Fault Address Register
_BFAR = (*((volatile uint32_t *)(0xE000ED38)));
printf ("\n\nHard fault handler (all numbers in hex):\n");
printf ("R0 = %lx\n", stacked_r0);
printf ("R1 = %lx\n", stacked_r1);
printf ("R2 = %lx\n", stacked_r2);
printf ("R3 = %lx\n", stacked_r3);
printf ("R12 = %lx\n", stacked_r12);
printf ("LR [R14] = %lx subroutine call return address\n", stacked_lr);
printf ("PC [R15] = %lx program counter\n", stacked_pc);
printf ("PSR = %lx\n", stacked_psr);
printf ("CFSR = %lx\n", _CFSR);
printf ("HFSR = %lx\n", _HFSR);
printf ("DFSR = %lx\n", _DFSR);
printf ("AFSR = %lx\n", _AFSR);
printf ("MMAR = %lx\n", _MMAR);
printf ("BFAR = %lx\n", _BFAR);
// Break into the debugger
__asm("BKPT #0\n");
}
__attribute__((section(".sys"))) __attribute__( ( naked ) )
void HardFault_Handler(void)
{
__asm volatile
(
" movs r0,#4 \n" /* load bit mask into R0 */
" mov r1, lr \n" /* load link register into R1 */
" tst r0, r1 \n" /* compare with bitmask */
" beq _MSP \n" /* if bitmask is set: stack pointer is in PSP. Otherwise in MSP */
" mrs r0, psp \n" /* otherwise: stack pointer is in PSP */
" b _GetPC \n" /* go to part which loads the PC */
"_MSP: \n" /* stack pointer is in MSP register */
" mrs r0, msp \n" /* load stack pointer into R0 */
"_GetPC: \n" /* find out where the hard fault happened */
" ldr r1,[r0,#20] \n" /* load program counter into R1. R1 contains address of the next instruction where the hard fault happened */
" ldr r2, =HardFault_HandlerC \n"
" bx r2 \n"
" bx lr \n" /* decode more information. R0 contains pointer to stack frame */
);
}
/* Vectors Table */
typedef void (*vector_entry)(void);
const vector_entry vectors[] __attribute__ ((section(".vectors"),used)) =
{
/* Interrupt Vector Table Function Pointers */
// Address Vector IRQ Source module Source description
(vector_entry)__stack_process_end__, // ARM core Initial Supervisor SP
reset_handler, // 0x0000_0004 1 - ARM core Initial Program Counter
Default_Handler, // 0x0000_0008 2 - ARM core Non-maskable Interrupt (NMI)
HardFault_Handler, // 0x0000_000C 3 - ARM core Hard Fault
Default_Handler, // 0x0000_0010 4 -
HardFault_Handler, // 0x0000_0014 5 - ARM core Bus Fault
HardFault_Handler, // 0x0000_0018 6 - ARM core Usage Fault
Default_Handler, // 0x0000_001C 7 -
Default_Handler, // 0x0000_0020 8 -
Default_Handler, // 0x0000_0024 9 -
Default_Handler, // 0x0000_0028 10 -
Default_Handler, // 0x0000_002C 11 - ARM core Supervisor call (SVCall)
Default_Handler, // 0x0000_0030 12 - ARM core Debug Monitor
Default_Handler, // 0x0000_0034 13 -
Default_Handler, // 0x0000_0038 14 - ARM core Pendable request for system service (PendableSrvReq)
Default_Handler, // 0x0000_003C 15 - ARM core System tick timer (SysTick)
/* remainder go below */
};
#endif /* USE_WOLF_ARM_STARTUP */

View File

@ -0,0 +1,54 @@
/* benchmark_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/logging.h>
#include <wolfcrypt/benchmark/benchmark.h>
#include <stdio.h>
#ifndef NO_CRYPT_BENCHMARK
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
static func_args args = { 0 } ;
#endif
int main(void)
{
int ret;
#ifndef NO_CRYPT_BENCHMARK
wolfCrypt_Init();
printf("\nBenchmark Test\n");
benchmark_test(&args);
ret = args.return_code;
printf("Benchmark Test: Return code %d\n", ret);
wolfCrypt_Cleanup();
#else
ret = NOT_COMPILED_IN;
#endif
return ret;
}

View File

@ -0,0 +1,55 @@
/* test_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/logging.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfcrypt/test/test.h>
#include <stdio.h>
#ifndef NO_CRYPT_TEST
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
static func_args args = { 0 } ;
#endif
int main(void)
{
int ret;
#ifndef NO_CRYPT_TEST
wolfCrypt_Init();
printf("\nCrypt Test\n");
wolfcrypt_test(&args);
ret = args.return_code;
printf("Crypt Test: Return code %d\n", ret);
wolfCrypt_Cleanup();
#else
ret = NOT_COMPILED_IN;
#endif
return ret;
}

View File

@ -0,0 +1,207 @@
/* tls_client.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#ifndef WOLFCRYPT_ONLY
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/logging.h>
#include <stdio.h>
#define MAXSZ 1024
/*------------------------------------------------------------------------*/
/* TLS CLIENT */
/*------------------------------------------------------------------------*/
static int CbIORecv(WOLFSSL *ssl, char *buf, int sz, void *ctx)
{
int ret = WOLFSSL_CBIO_ERR_GENERAL;
(void)ssl;
(void)ctx;
/* TODO: Exchange data over your own transport */
#warning TODO: Implement your own recv data transport
#if 0
ret = usart_read_buffer_wait(&cdc_uart_module, buf, sz);
if (ret == STATUS_ERR_TIMEOUT)
return WOLFSSL_CBIO_ERR_WANT_READ;
return (ret == STATUS_OK) ? sz : WOLFSSL_CBIO_ERR_GENERAL;
#else
return ret;
#endif
}
static int CbIOSend(WOLFSSL *ssl, char *buf, int sz, void *ctx)
{
int ret = WOLFSSL_CBIO_ERR_GENERAL;
(void)ssl;
(void)ctx;
/* TODO: Exchange data over your own transport */
#warning TODO: Implement your own send data transport
#if 0
ret = usart_write_buffer_wait(&cdc_uart_module, buf, sz);
if (ret == STATUS_ERR_TIMEOUT)
return WOLFSSL_CBIO_ERR_WANT_WRITE;
return (ret == STATUS_OK) ? sz : WOLFSSL_CBIO_ERR_GENERAL;
#else
return ret;
#endif
}
static int tls_client(void)
{
char msg[] = "Hello WolfSSL!\r\n";
char reply[MAXSZ];
int ret, msgSz, error;
WOLFSSL* ssl = NULL;
WOLFSSL_CTX* ctx = NULL;
if ((ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method())) == NULL) {
printf("CTXnew failed.\n");
goto fail;
}
/*------------------------------------------------------------------------*/
/* ECDHE-ECDSA */
/*------------------------------------------------------------------------*/
/*--------------------*/
/* for peer auth use: */
/*--------------------*/
// wolfSSL_CTX_load_verify_buffer(ctx, rsa_key_der_1024,
// sizeof_rsa_key_der_1024, SSL_FILETYPE_ASN1);
// wolfSSL_CTX_load_verify_buffer(ctx, server_cert_der_1024,
// sizeof_server_cert_der_1024, SSL_FILETYPE_ASN1);
/*---------------------*/
/* for no peer auth: */
/*---------------------*/
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
/*---------------------*/
/* end peer auth option*/
/*---------------------*/
if ((ret = wolfSSL_CTX_set_cipher_list(ctx, "ECDHE-ECDSA-AES128-SHA256")) != SSL_SUCCESS) {
wolfSSL_CTX_free(ctx);
printf("CTXset_cipher_list failed, error: %d\n", ret);
goto fail;
}
/*------------------------------------------------------------------------*/
/* END CIPHER SUITE OPTIONS */
/*------------------------------------------------------------------------*/
wolfSSL_CTX_SetIORecv(ctx, CbIORecv);
wolfSSL_CTX_SetIOSend(ctx, CbIOSend);
if ((ssl = wolfSSL_new(ctx)) == NULL) {
error = wolfSSL_get_error(ssl, 0);
printf("wolfSSL_new failed %d\n", error);
wolfSSL_CTX_free(ctx);
return -1;
}
/* non blocking accept and connect */
ret = SSL_FAILURE;
while (ret != SSL_SUCCESS) {
/* client connect */
ret = wolfSSL_connect(ssl);
error = wolfSSL_get_error(ssl, 0);
if (ret != SSL_SUCCESS) {
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
/* Fail */
printf("wolfSSL connect failed with return code %d\n", error);
goto fail;
}
}
/* Success */
}
/* read and write */
while (1) {
/* client send/read */
msgSz = sizeof(msg);
ret = wolfSSL_write(ssl, msg, msgSz);
error = wolfSSL_get_error(ssl, 0);
if (ret != msgSz) {
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
/* Write failed */
goto fail;
}
}
/* Write succeeded */
break;
}
while (1) {
ret = wolfSSL_read(ssl, reply, sizeof(reply) - 1);
error = wolfSSL_get_error(ssl, 0);
if (ret < 0) {
if (error != SSL_ERROR_WANT_READ && error != SSL_ERROR_WANT_WRITE) {
/* Can put print here, the server enters a loop waiting to read
* a confirmation message at this point */
// printf("client read failed\n");
goto fail;
}
continue;
}
else {
/* Can put print here, the server enters a loop waiting to read
* a confirmation message at this point */
reply[ret] = '\0';
// printf("Client Received Reply: %s\n", reply);
break;
}
}
return 0;
fail:
wolfSSL_shutdown(ssl);
wolfSSL_free(ssl);
wolfSSL_CTX_free(ctx);
return -1;
}
#endif
int main(void)
{
int ret;
#ifndef WOLFCRYPT_ONLY
wolfSSL_Init();
ret = tls_client();
wolfSSL_Cleanup();
#else
ret = NOT_COMPILED_IN;
#endif
return ret;
}

View File

@ -0,0 +1,142 @@
/* wolf_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/random.h> /* for CUSTOM_RAND_TYPE */
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
/* TIME CODE */
/* TODO: Implement real RTC */
/* Optionally you can define NO_ASN_TIME to disable all cert time checks */
static int gTimeMs;
static int hw_get_time_sec(void)
{
#warning Must implement your own time source if validating certificates
return ++gTimeMs;
}
/* This is used by wolfCrypt asn.c for cert time checking */
unsigned long my_time(unsigned long* timer)
{
(void)timer;
return hw_get_time_sec();
}
#ifndef WOLFCRYPT_ONLY
/* This is used by TLS only */
unsigned int LowResTimer(void)
{
return hw_get_time_sec();
}
#endif
#ifndef NO_CRYPT_BENCHMARK
/* This is used by wolfCrypt benchmark tool only */
double current_time(int reset)
{
double time;
int timeMs = gTimeMs;
(void)reset;
time = (timeMs / 1000); // sec
time += (double)(timeMs % 1000) / 1000; // ms
return time;
}
#endif
/* RNG CODE */
/* TODO: Implement real RNG */
static unsigned int gCounter;
unsigned int hw_rand(void)
{
#warning Must implement your own random source
return ++gCounter;
}
unsigned int my_rng_seed_gen(void)
{
return hw_rand();
}
int my_rng_gen_block(unsigned char* output, unsigned int sz)
{
uint32_t i = 0;
while (i < sz)
{
/* If not aligned or there is odd/remainder */
if( (i + sizeof(CUSTOM_RAND_TYPE)) > sz ||
((uint32_t)&output[i] % sizeof(CUSTOM_RAND_TYPE)) != 0
) {
/* Single byte at a time */
output[i++] = (unsigned char)my_rng_seed_gen();
}
else {
/* Use native 8, 16, 32 or 64 copy instruction */
*((CUSTOM_RAND_TYPE*)&output[i]) = my_rng_seed_gen();
i += sizeof(CUSTOM_RAND_TYPE);
}
}
return 0;
}
#ifdef XMALLOC_OVERRIDE
void *myMalloc(size_t n, void* heap, int type)
{
(void)n;
(void)heap;
(void)type;
#warning Must implement your own malloc
return NULL;
}
void myFree(void *p, void* heap, int type)
{
(void)p;
(void)heap;
(void)type;
#warning Must implement your own free
}
/* Required for normal math (!USE_FAST_MATH) */
void *myRealloc(void *p, size_t n, void* heap, int type)
{
(void)p;
(void)n;
(void)heap;
(void)type;
#warning Must implement your own realloc
return NULL;
}
#endif /* XMALLOC_OVERRIDE */

18
IDE/GCC-ARM/include.am Normal file
View File

@ -0,0 +1,18 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/GCC-ARM/Header/user_settings.h
EXTRA_DIST+= IDE/GCC-ARM/Source/armtarget.c
EXTRA_DIST+= IDE/GCC-ARM/Source/wolf_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/benchmark_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/test_main.c
EXTRA_DIST+= IDE/GCC-ARM/Source/tls_client.c
EXTRA_DIST+= IDE/GCC-ARM/linker.ld
EXTRA_DIST+= IDE/GCC-ARM/Makefile
EXTRA_DIST+= IDE/GCC-ARM/Makefile.bench
EXTRA_DIST+= IDE/GCC-ARM/Makefile.client
EXTRA_DIST+= IDE/GCC-ARM/Makefile.common
EXTRA_DIST+= IDE/GCC-ARM/Makefile.test
EXTRA_DIST+= IDE/GCC-ARM/Makefile.static
EXTRA_DIST+= IDE/GCC-ARM/README.md

30
IDE/GCC-ARM/linker.ld Normal file
View File

@ -0,0 +1,30 @@
MEMORY
{
FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 256K
RAM (wx) : ORIGIN = 0x20000000, LENGTH = 64K
}
SECTIONS
{
__vectors_start__ = .;
.vectors : { *(.vectors) } > FLASH
__vectors_end__ = __vectors_start__ + 0x400;
.sys : { *(.sys*) } > FLASH
.text : { *(.text*) } > FLASH
.rodata : { *(.text*) } > FLASH
__data_load_start__ = .;
__data_start__ = .;
.data : { *(.data*) } > RAM
__data_end__ = __data_start__ + SIZEOF(.data);
__bss_start__ = .;
.bss : { *(.bss*) } > RAM
__bss_end__ = __bss_start__ + SIZEOF(.bss);
__heap_start__ = .;
.heap : { *(.heap*) } > RAM
__heap_end__ = __heap_start__ + SIZEOF(.heap);
end = .;
}

View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<macros>
<stringMacro name="PROJECT_KSDK_PATH" type="VALUE_TEXT" value="~/Work/KSDK_1.3.0"/>
</macros>
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/wolfSSL_HW"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/wolfSSL_HW/Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="wolfssl_hw" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="wolfssl_hw" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="${cross_rm} -rf" description="" id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395" name="Debug" parent="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug">
<folderInfo id="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395." name="/" resourcePath="">
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug.955851768" name="Cross ARM GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.elf.debug">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.1637878147" name="Optimization Level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.level.none" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength.596937133" name="Message length (-fmessage-length=0)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.messagelength" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar.412948756" name="'char' is signed (-fsigned-char)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.signedchar" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections.1412387181" name="Function sections (-ffunction-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.functionsections" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections.1877241998" name="Data sections (-fdata-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.datasections" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.2038051180" name="Debug level" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level" value="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.level.max" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format.1062002269" name="Debug format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.format"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family.1592667634" name="ARM family" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.family" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.mcpu.cortex-m4" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.1112951710" name="Float ABI" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.abi.hard" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1079530716" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.192917244" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="GNU Tools for ARM Embedded Processors" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix.2108482930" name="Prefix" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.prefix" value="arm-none-eabi-" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.c.500222702" name="C compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.c" value="gcc" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp.175873499" name="C++ compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.cpp" value="g++" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy.1700937041" name="Hex/Bin converter" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objcopy" value="objcopy" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump.1874549763" name="Listing generator" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.objdump" value="objdump" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.size.178137928" name="Size command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.size" value="size" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.make.1274071175" name="Build command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.make" value="make" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm.655658023" name="Remove command" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.rm" value="rm" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar.1937238341" name="Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.command.ar" value="ar" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1476617138" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn.1035232247" name="Enable all common warnings (-Wall)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.allwarn" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.8601271" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto" value="false" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.817253425" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
<builder buildPath="${workspace_loc:/wolfSSL_HW}/Debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.2043375702" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1135882719" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.369489760" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.1086496768" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1696761989" name="Cross ARM GNU C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.9643995" name="Language standard" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.std.c99" valueType="enumerated"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.349147702" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}/../../../&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/devices&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/CMSIS/Include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/devices/MK64F12/startup&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/drivers/inc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/hal/inc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/osa/inc&quot;"/>
<listOptionValue builtIn="false" value="&quot;${PROJECT_KSDK_PATH}/platform/utilities/inc&quot;"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1294205548" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="&quot;CPU_MK64FN1M0VMD12&quot;"/>
<listOptionValue builtIn="false" value="WOLFSSL_USER_SETTINGS"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.817994152" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.234608726" name="Cross ARM GNU C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.1452713629" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="false"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.497680378" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="&quot;CPU_MK64FN1M0VMD12&quot;"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.909966654" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker.506002589" name="Cross ARM GNU C Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.linker">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections.1489822225" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.linker.gcsections" value="true" valueType="boolean"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.575756954" name="Cross ARM GNU C++ Linker" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections.11344634" name="Remove unused sections (-Xlinker --gc-sections)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.gcsections" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.paths.1878565771" name="Library search path (-L)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/Project_Settings/Linker_Files&quot;"/>
</option>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other.1517060693" name="Other linker flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.other" value="-specs=nosys.specs -specs=nano.specs -Xlinker -z -Xlinker muldefs" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile.468376236" name="Script files (-T)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.linker.scriptfile" valueType="stringList">
<listOptionValue builtIn="false" value="&quot;MK64FN1M0xxx12_flash.ld&quot;"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input.955790366" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver.1962941231" name="Cross ARM GNU Archiver" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.archiver"/>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash.1365673947" name="Cross ARM GNU Create Flash Image" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createflash"/>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting.790507756" name="Cross ARM GNU Create Listing" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.createlisting">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source.1929510617" name="Display source (--source|-S)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.source" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders.573901902" name="Display all headers (--all-headers|-x)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.allheaders" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle.2051558160" name="Demangle names (--demangle|-C)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.demangle" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers.851594065" name="Display line numbers (--line-numbers|-l)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.linenumbers" value="true" valueType="boolean"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide.1352373056" name="Wide lines (--wide|-w)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.createlisting.wide" value="true" valueType="boolean"/>
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize.934998862" name="Cross ARM GNU Print Size" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.printsize">
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format.1738611770" name="Size format" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.printsize.format"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="wolfcrypt/src/integer.c|wolfcrypt/src/misc.c|src/bio.c|wolfcrypt/src/evp.c|wolfcrypt/src/aes_asm.s|wolfcrypt/src/aes_asm.asm|SDK|wolfssl/wolfcrypt/port|wolfcrypt/src/port|wolfcrypt/user-crypto" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="wolfSSL_HW.ilg.gnuarmeclipse.managedbuild.cross.target.elf.1053752509" name="Executable" projectType="ilg.gnuarmeclipse.managedbuild.cross.target.elf"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.234608726;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.909966654">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395;ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.170735395.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1696761989;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.817994152">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/wolfSSL_HW"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>

View File

@ -0,0 +1,19 @@
Sources/main.c
Project_Settings/Linker_Files/MK64FN1M0xxx12_flash.ld
SDK/platform/CMSIS/Include/core_cmSimd.h
SDK/platform/devices/MK64F12/include/MK64F12.h
SDK/platform/CMSIS/Include/arm_common_tables.h
SDK/platform/CMSIS/Include/arm_const_structs.h
SDK/platform/devices/MK64F12/include/MK64F12_features.h
SDK/platform/CMSIS/Include/core_cm4.h
SDK/platform/CMSIS/Include/core_cmFunc.h
SDK/platform/CMSIS/Include/core_cmInstr.h
SDK/platform/devices/fsl_device_registers.h
SDK/platform/devices/MK64F12/include/fsl_bitaccess.h
SDK/platform/CMSIS/Include/arm_math.h
SDK/platform/devices/MK64F12/include/MK64F12_extension.h
Project_Settings/Startup_Code/startup.c
Project_Settings/Startup_Code/system_MK64F12.c
Project_Settings/Startup_Code/startup.h
Project_Settings/Startup_Code/startup_MK64F12.S
Project_Settings/Startup_Code/system_MK64F12.h

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>wolfSSL_HW</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>src</name>
<type>2</type>
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/src</locationURI>
</link>
<link>
<name>wolfcrypt</name>
<type>2</type>
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/wolfcrypt</locationURI>
</link>
<link>
<name>wolfssl</name>
<type>2</type>
<locationURI>$%7BPARENT-3-PROJECT_LOC%7D/wolfssl</locationURI>
</link>
</linkedResources>
<variableList>
<variable>
<name>PROJECT_KSDK_PATH</name>
<value>file:/.KSDK_1.3.0</value>
</variable>
</variableList>
</projectDescription>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
versionGenerated/versionGenerated=1.0.0.RT7_b1550-0615

View File

@ -0,0 +1,6 @@
#define FREESCALE_KSDK_BM
#define FREESCALE_KSDK_1_3
#define FSL_HW_CRYPTO_MANUAL_SELECTION
#define NO_MAIN_DRIVER
#define USE_CERT_BUFFERS_1024
#define ECC_USER_CURVES

View File

@ -1,8 +1,8 @@
/* benchmark-main.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,14 +16,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfcrypt/benchmark/benchmark.h>
typedef struct func_args {
int argc;
@ -34,11 +36,8 @@ typedef struct func_args {
func_args args = { 0 } ;
extern double current_time(int reset) ;
extern int benchmark_test(void *args) ;
main(void) {
benchmark_test(&args) ;
return 0;
}

View File

@ -1,8 +1,8 @@
/* current-time.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,9 +16,10 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@ -52,7 +53,7 @@ void InitTimer(void) {
static int initFlag = false ;
double current_time(int reset)
{
{
if(!initFlag)InitTimer() ;
initFlag = true ;
if(reset)ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, -1);
@ -61,6 +62,12 @@ double current_time(int reset)
#else
double current_time(int reset) { return 0.0 ; }
/* dummy */
double current_time(int reset) {
static double t;
t += 1.0; /* for avoid infinit loop of waiting time */
if(reset)t = 0.0;
return t ;
}
#endif

View File

@ -169,9 +169,7 @@
<option>
<name>CCDefines</name>
<state>ewarm</state>
<state>PART_TM4C129XNCZAD</state>
<state>WOLFSSL_USER_SETTINGS</state>
<state>TARGET_IS_SNOWFLAKE_RA0</state>
</option>
<option>
<name>CCPreprocFile</name>

View File

@ -1,8 +1,8 @@
/* minimum-startup.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,8 +16,9 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#include <stdint.h>
#pragma language=extended

View File

@ -170,8 +170,6 @@
<name>CCDefines</name>
<state>WOLFSSL_USER_SETTINGS</state>
<state>ewarm</state>
<state>PART_TM4C129XNCZAD</state>
<state>TARGET_IS_SNOWFLAKE_RA0</state>
</option>
<option>
<name>CCPreprocFile</name>
@ -939,7 +937,7 @@
</option>
<option>
<name>IarchiveOutput</name>
<state>C:\ROOT\CyaSSL-Support\TI\Staging-20150522\wolfssl\IDE\IAR-EWARM\Projects\lib\ewarm\Exe\wolfSSL-Lib.a</state>
<state>$PROJ_DIR$\..\lib\ewarm\Exe\wolfSSL-Lib.a</state>
</option>
</data>
</settings>
@ -1926,12 +1924,18 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\chacha20_poly1305.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\cmac.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\coding.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\compress.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\cpuid.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\curve25519.c</name>
</file>
@ -1977,6 +1981,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\hmac.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\idea.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\integer.c</name>
</file>
@ -1996,7 +2003,7 @@
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\memory.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\misc.c</name>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\pkcs12.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\pkcs7.c</name>
@ -2025,9 +2032,30 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sha256.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sha3.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sha512.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\signature.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sp_arm32.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sp_arm64.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sp_c32.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sp_c64.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\sp_int.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\srp.c</name>
</file>
@ -2040,6 +2068,12 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\wc_port.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\wolfevent.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\wolfmath.c</name>
</file>
</group>
<group>
<name>wolfSSL</name>
@ -2049,9 +2083,6 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\src\internal.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\src\io.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\src\keys.c</name>
</file>
@ -2067,6 +2098,12 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\src\tls.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\src\tls13.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\src\wolfio.c</name>
</file>
</group>
</project>

View File

@ -1,8 +1,8 @@
/* test-main.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
* Copyright (C) 2006-2019 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,10 +16,11 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
typedef struct func_args {
int argc;
char** argv;

Some files were not shown because too many files have changed in this diff Show More