Compare commits

...

1367 Commits

Author SHA1 Message Date
0fa5af9929 Merge pull request #3224 from ejohnstown/release-update
Release v4.5.0 Supplement
2020-08-20 09:34:58 -07:00
05671d183c update README/ChangeLog 2020-08-19 10:53:26 -07:00
549c47de65 Handle when k is 1 or order + 1 for timing resistant ECC 2020-08-19 10:50:37 -07:00
362e328180 NTRU fixes
1. When configuring for NTRU, enable static RSA.
2. The echoserver should not try to use NTRU with TLSv1.3.
2020-08-19 10:46:03 -07:00
1f10e77b0f Fix for SP math with WOLFSSL_VALIDATE_ECC_KEYGEN. Fixes logic error on point x/y zero check. 2020-08-19 09:30:32 -07:00
55632a0567 Two more out of order DTLS message fixes. 2020-08-18 17:54:25 -07:00
38b717eb42 Clear MP in ECC to free allocated memory 2020-08-18 17:54:25 -07:00
113753370d Long Test Fixes
1. Sniffer was trying to log a NULL pointer as a string. Logged a string instead.
2. Few misc fixes in ECC.
2020-08-18 17:54:25 -07:00
6e49a63e50 fix call to MakeAnyCert from wc_MakeNtruCert(); it was missing the new parameter 2020-08-17 17:12:11 -07:00
c1090cff3f update rpm-spec.in 2020-08-17 14:42:20 -07:00
028bddd7ab Merge pull request #3215 from ejohnstown/release-4.5.0
Release Update
2020-08-17 13:51:23 -07:00
5c6da52ac1 Update release notes. 2020-08-17 09:20:53 -07:00
cb5d6a5c12 Check ECC scalar before multiplication
A k with more bits than in order doesn't work in ECC scalar
multiplication.
Check private key length in wc_ecc_check_key()
Check private key length in ecc_make_pub_ex()
2020-08-17 08:39:39 -07:00
3be7f3ea3a Reject DTLS application data messages in epoch 0 as out of order. 2020-08-14 17:21:39 -07:00
ef5271dd9f fips-check script shouldn't force FIPS-ready build to be v2. 2020-08-14 14:31:50 -07:00
3f6861ee82 FIPS Ready Fix with ECC Timing Resistance
Commit 6467de5 added some timing resistance to ECC shared secret
agreement. It involved adding an RNG object to the ecc keys so
a random z value can be added to the mix. The older FIPS release
has ECC outside the boundary, so it uses the new ECC code. FIPSv2
has ECC inside the boundary, but all the TLS code checks for that
version of FIPS and leaves out the calls to the new functions as
it is using an older version of ecc.c. FIPS Ready uses the latest
version of ecc.c but compiles as FIPSv2. So, the code outside of
the crypto layer is treating ECC as FIPSv2 and not calling the new
functions, but the crypto layer assumes the RNG should be present,
and errs out on testing.
1. Added a separate option for FIPS Ready to the enable-fips
   configure option. `--enable-fips=ready`. It will treat FIPS
   Ready as the next kind of FIPS release. FIPS Ready will be
   treated like FIPS v3 in the build.
2. Changed the C preprocessor checks for FIPS version 2 to be
   checks for not version 2, with respect to ECC Timing Resistance
   and FIPS builds.
2020-08-14 10:54:55 -07:00
1dc0a76436 Patch from Jacob. When parsing a certificate name, if an item is unknown, its NID is set to 0. Don't try to add NID's of 0. 2020-08-13 17:01:26 -07:00
e16496512e Merge pull request #3216 from SparkiDev/rel_fixes_1
Fixes from C++ and address access checking
2020-08-13 15:32:16 -07:00
7e6863e78b resolving build issues for FIPSv2 OE2 with --enable-opensslextra 2020-08-13 13:24:44 -07:00
64084bcba2 Add a void to the empty parameter list for the function wolfSSL_SESSION_new(). 2020-08-13 13:18:29 -07:00
bc74bfebdd Fixes from C++ and address access checking
Fix access of table for cache resistance.
Don't name variable public or private.
Cast from void*
2020-08-13 15:19:49 +10:00
ceed98b952 Modify the openssl test script to run the openssl commands in an eval. 2020-08-12 16:59:10 -07:00
3bd27f7912 fix a bad path in renewcerts 2020-08-12 15:17:21 -07:00
95337e666c Release Update
1. Update the usual versions.
2. Update README and ChangeLog.
3. Modify genecc and renewcerts to update two certificate files that had expired.
4. Update the expired certificate files.
2020-08-12 14:43:47 -07:00
e30341ea83 Merge pull request #3190 from embhorn/zd10712
Sanity check key sizes
2020-08-12 09:37:40 -07:00
21ed05b85e Merge pull request #3214 from dgarske/snifferFreeFix
Fix for SSL sniffer free to properly cleanup globals
2020-08-11 20:27:09 -07:00
fa146870bd Merge pull request #3155 from julek-wolfssl/openssh-fixes-cherry-picked
Additional OpenSSL compat stuff for OpenSSH
2020-08-11 16:32:31 -07:00
532c2f50e8 Merge pull request #3083 from julek-wolfssl/openssl-compat-X509V3_EXT_i2d
Implement more OpenSSL compatibility functions
2020-08-11 15:01:41 -07:00
65bcc03885 Fix for SSL sniffer free to properly cleanup globals (resolves issue with then calling ssl_InitSniffer -> ssl_FreeSniffer then ssl_InitSniffer again). ZD 10757. 2020-08-11 14:07:32 -07:00
1681ed1b85 Merge pull request #3211 from cconlon/jniconfig
Update "enable-jni" option for current JSSE requirements
2020-08-11 12:39:54 -07:00
5cede22d1e wait to set size till after sanity check 2020-08-11 12:59:01 -06:00
e4fe6b6573 Merge pull request #3210 from dgarske/rsa_checkkey_sp
Fix for `unit.test` error with SP and RSA 1024-bit key gen
2020-08-11 12:00:41 -05:00
87a00df2ea Merge pull request #3118 from julek-wolfssl/aead-only-fix
Check for WOLFSSL_AEAD_ONLY in wolfSSL_dtls_import_internal
2020-08-11 09:33:47 -07:00
4e6bc02257 Merge pull request #2982 from SparkiDev/ecc_sc
ECC now calls mp_submod_ct and mp_addmod_ct
2020-08-11 09:26:56 -07:00
8b7f588aaf Merge pull request #3108 from SparkiDev/openssl_interop
Update OpenSSL interopability testing
2020-08-11 09:42:43 -06:00
6e14b224da Add NULL check in wolfSSL_EC_POINT_invert 2020-08-11 10:11:48 +02:00
93cdfd7132 Update OpenSSL interopability testing
Added TLS 1.3 testing.
Added Ed25519 and Ed448 testing.
Added tesitng of OpenSSL client against wolfSSL server.
Fixed builds of Curve25519/Curve448/Ed25519/Ed448 in different
configurations.
2020-08-11 16:44:45 +10:00
6467de5a88 Randomize z ordinates in scalar mult when timing resistant
An RNG is required for shared secret calculation now.
Use wc_ecc_set_rng() to set an RNG against the ECC object.
ECC verification does not need timing resistance and does not randomize
z ordinates.
2020-08-11 16:12:47 +10:00
3ce933c90a Make fp_montgomery_reduce constant time 2020-08-11 16:12:10 +10:00
0102902445 Add and use a mp_cmp_mag that is constant time. 2020-08-11 16:12:10 +10:00
8b05160349 Reworked ECC mulmod and fix size of k
When using wc_ecc_mulmod_ex2(), the k size can be fixed to be one bit
longer than order.
2020-08-11 16:12:10 +10:00
9ef9671886 ECC uses CT vers of addmod, submod and div_2_mod
The TFM implementations of mp_submod_ct, mp_addmod_ct,
mp_div_2_mod_t are more resilient to side-channels.
2020-08-11 16:12:10 +10:00
4f30e37094 Merge pull request #3074 from julek-wolfssl/dtls-multiple-app-records
Handle 2+ dtls APP data records in one udp packet
2020-08-10 14:52:04 -07:00
242df3d11a Merge pull request #3209 from SparkiDev/jenkins_fixes_1
Fixes from Jenkins failures
2020-08-10 14:30:27 -07:00
98b4272e5b Merge pull request #3202 from ejohnstown/abi-server
ABI Update for Server
2020-08-10 14:25:05 -07:00
26aaf473db Fix for unit.test error with RSA 1024-bit key gen when using ./configure --enable-keygen --enable-sp. Issue started in PR #3119 2020-08-10 12:40:29 -07:00
a50affb408 Malloc enough space 2020-08-10 16:08:46 +02:00
50647ccdb1 Sanity check key sizes 2020-08-10 07:19:33 -05:00
ef4b29ebc7 Jenkins fixes 2020-08-10 12:49:18 +02:00
55d4817956 Jenkins fixes 2020-08-10 12:39:16 +02:00
da190b8177 Don't map back to affine in wc_ecc_mulmod. It is done in ecc_map later. 2020-08-10 12:33:18 +02:00
3444b115ba Fix valgrind check to ignore bash leak 2020-08-10 14:02:50 +10:00
0232239959 Ignore test-log-dump-to-file.txt
Sometimes left behind by unit.test
2020-08-10 12:46:53 +10:00
7bb2a69161 Fix memory leak in api.c
When testing wc_ecc_import_raw(), the mp_int's in the ecc object are
initialized.
For small math, this throws away the allocated buffer.
Must free the object before importing.
2020-08-10 12:42:46 +10:00
72d1352bd6 Fix ARM builds
Need to include options.h in assembly now.
bufPt declared in block but not outside.
poly1305_block and poly1305_blocks need prototype - declaration in
wolfcrypt/src/port/arm/armv8-poly1305.c (__arch64__ only).
2020-08-10 11:59:10 +10:00
920c97963c Fix Jenikins failure - ToTraditional not declared
./configure --disable-asn --disable-ecc -disable-rsa --enable-psk
--enable-testcert
2020-08-10 10:57:07 +10:00
19ade820b0 Merge pull request #3208 from dgarske/sp_nonblock
Fixes and improvements for SP ECC non-blocking
2020-08-10 09:59:23 +10:00
b25eccb07e Merge pull request #3203 from tmael/libwebsockets
Enable HAVE_EX_DATA for libwebsockets
2020-08-08 14:34:18 -07:00
62e78b7cf4 Fix state machine after script rebase. 2020-08-07 16:56:58 -07:00
bc03b5793c Add state for ECC verify non-blocking and mont_inv_order to reduce maximum blocking time. 2020-08-07 16:48:16 -07:00
f7fcef5f32 Fix for build error / typo for ECC 256-bit non-blocking only. 2020-08-07 16:47:08 -07:00
c0a664a8e5 Merge pull request #3200 from douzzer/20200805
Add an error-checking wc_curve25519_make_pub() routine to the API for use by Wireguard
2020-08-07 16:32:52 -07:00
1724347f7a Merge pull request #3091 from julek-wolfssl/sess-serialization
Expose session serialization outside of `OPENSSL_EXTRA`
2020-08-07 15:41:27 -07:00
89e6f3bcd5 Merge pull request #3206 from SparkiDev/ed448_oob
ED448: Fix out of bounds read in import public
2020-08-07 15:36:11 -07:00
17cc941b29 Merge pull request #3195 from SparkiDev/sp_ecc_cache
SP ECC Cache Resitance
2020-08-07 15:35:06 -07:00
dd6238fb77 Merge pull request #3174 from embhorn/zd10655
Fix CheckAltNames to handle IP type
2020-08-07 16:04:56 -06:00
0faff24a65 refactor wc_curve25519_make_key() to use wc_curve25519_make_pub() to complete the pair. also, add call to fe_init() in the non-NXP codepath of wc_curve25519_make_pub() (note fe_init() is currently a no-op). 2020-08-07 13:02:35 -05:00
cbd9b3717f Map points to Montgomery form for arithmetic. 2020-08-07 18:18:30 +02:00
ea6edb6913 Fix memory leak 2020-08-07 17:39:48 +02:00
b03e1dd2a9 Merge pull request #3197 from ethanlooney/19th_branch
Added asn.c unit tests
2020-08-07 09:25:50 -06:00
064bfa583d Fix CheckAltNames to handle IP type 2020-08-07 10:12:56 -05:00
9e1012b48a Merge pull request #3205 from SparkiDev/sp_fixes_3
SP ECC: initialize infinity in make key
2020-08-07 07:12:04 -07:00
4c00af1136 ED448: Fix out of bounds read in import public
Fix formatting
2020-08-07 14:11:11 +10:00
1ea3dc5f55 SP ECC: initialize infinity in make key 2020-08-07 12:15:31 +10:00
f6acbd5f97 test_wc_curve25519_make_pub(): fix order of args to wc_curve25519_make_pub(). 2020-08-06 18:37:00 -05:00
6379ca8e10 libwebsockets requires *CRYPTO_EX_DATA* APIs 2020-08-06 16:29:39 -07:00
c325001d0d note argument endianness and return values in intro comment for wc_curve25519_make_pub(). 2020-08-06 18:07:39 -05:00
82d927d40f Merge pull request #3199 from dgarske/openssl_sha
Fix for building openssl compat without SHA-1
2020-08-06 15:59:26 -07:00
0f59e632e1 tests/api.c: add test_wc_curve25519_make_pub(); fix some old stray tabs; remove weird extra string-terminating null in test_wolfSSL_sk_CIPHER_description(). 2020-08-06 17:52:48 -05:00
758665e347 Fix for TLS anonymous cipher and PKCS11 cast warnings. (author=dgarske) 2020-08-06 17:49:55 -05:00
132adeac14 Merge pull request #3188 from julek-wolfssl/missing-cipherExtraData
Move `cipherExtraData` so that it is available when HAVE_SESSION_TICKET
2020-08-07 08:18:57 +10:00
52a2222c79 curve25519.c: call the new API routine wc_curve25519_make_pub(), not wc_curve25519(), for clarity and consistency (hat tip to Jacob). 2020-08-06 14:48:29 -05:00
14ff41a88c ABI Update for Server
Added WOLFSSL_ABI tags to the functions wolfTLSv1_2_server(),
wolfTLSv1_3_server(), and wolfSSL_accept().
2020-08-06 11:17:25 -07:00
e121139178 Merge pull request #3179 from ejohnstown/suitesz
Suite Size Check
2020-08-06 11:05:10 -07:00
15be5476e9 Merge pull request #3185 from SparkiDev/fp_check_max
tfm: Check for overflow and return error (fixed max size)
2020-08-06 10:54:26 -07:00
4e9d49556e Merge pull request #3194 from SparkiDev/unit_fix_1
Fix unit.test to not fail randomly
2020-08-06 10:51:12 -07:00
462f4f9e45 Merge pull request #3196 from cconlon/cavpmarvell
Add fips-check.sh target for marvell-linux-selftest, selftest v2 support
2020-08-06 10:45:03 -07:00
b2e7c09b71 ksdk_port.c: third time's the charm? (typo, s/curve25529_bCurveParam/curve25519_bCurveParam) 2020-08-06 12:02:01 -05:00
7ae789dbb0 wolfcrypt/src/curve25519.c: fix typo in wc_curve25519() -- CURVE25519_KEYSIZE, not CURVE25519_KEY_SIZE; add static kCurve25519BasePoint at top level 2020-08-06 11:45:54 -05:00
5cad0b10e5 fix typo in wolfcrypt/src/port/nxp/ksdk_port.c ("curve_bCurveParam" vs correct curve25529_bCurveParam) introduced in aadec345ab. 2020-08-06 11:35:04 -05:00
77bb300409 Removed unnecessary pointers, matched Xfree arugments and checked the return values of generated keys 2020-08-06 09:21:41 -07:00
afcb40724e Added proper ifdef's to EccPrivateKeyToDer 2020-08-06 08:06:06 -07:00
435eabfb4b Fix build error with unused variables. Added compat function for X509_add_ext. 2020-08-06 07:51:04 -07:00
25619119b4 Change implicit conversions to explicit conversions 2020-08-06 15:52:11 +02:00
f1e2a3c8b9 Code review changes 2020-08-06 15:52:11 +02:00
139a192185 Implement wolfSSL_d2i_X509_NAME 2020-08-06 15:52:11 +02:00
ca3a608408 Implement functions
- `wolfSSL_d2i_ECPrivateKey`
- `wolfSSL_EC_POINT_add`
- `wolfSSL_EC_POINT_invert`
2020-08-06 15:52:11 +02:00
2529ce21b0 Implement wolfSSL_EC_GROUP_dup 2020-08-06 15:52:11 +02:00
ea8dd31de0 Implement wolfSSL_i2d_PUBKEY and refactor wolfSSL_i2d_PrivateKey 2020-08-06 15:52:11 +02:00
1f0d6d5f31 New functions implemented
- `EC_POINT_is_on_curve`
- `i2d_EC_PUBKEY`
- `i2d_ECPrivateKey`
- `wc_ecc_point_is_on_curve`
2020-08-06 15:52:11 +02:00
88b9bf3fba Fix memory leak with EncryptDerKey 2020-08-06 15:52:11 +02:00
e131d6be5b group->curve_nid is now set to the real NID of the curve 2020-08-06 15:52:11 +02:00
471a9bd9fd Handle 2+ dtls APP data records in one udp packet
Just return one message at a time if processing application data
2020-08-06 14:03:38 +02:00
c28b7b59c3 Fix jenkins leaks 2020-08-06 13:47:26 +02:00
ad2e710563 Fix missing free 2020-08-06 13:47:26 +02:00
a6651a21f8 Fix segfault 2020-08-06 13:47:26 +02:00
229c5e9563 wolfSSL_X509V3_EXT_i2d cont. 2020-08-06 13:47:26 +02:00
dfee8d0346 wolfSSL_X509V3_EXT_i2d now copies structs instead of trying to convert to DER format 2020-08-06 13:47:26 +02:00
fe1f815761 wolfSSL_X509V3_EXT_i2d: NID_ext_key_usage 2020-08-06 13:45:36 +02:00
e89015b58a WIP: wolfSSL_X509V3_EXT_i2d 2020-08-06 13:45:36 +02:00
3621af9996 Implement new OpenSSL API
- i2d_PKCS8PrivateKey_bio
- X509V3_EXT_i2d
- SSL_renegotiate_pending
2020-08-06 13:45:36 +02:00
42c8f8f9b5 Check for WOLFSSL_AEAD_ONLY in wolfSSL_dtls_import_internal 2020-08-06 13:44:09 +02:00
18178e056d add missing const qualifiers to arch variants of curve25519(), and to nxp_ltc_curve25519(). 2020-08-05 21:12:50 -05:00
4a167c0f2c Merge pull request #3119 from tmael/do178-fix
DO-178 fix
2020-08-05 16:30:00 -07:00
8afd629a30 Fix unit.test to not fail randomly
Get the serial number from the certificate to calculate the encoding size.
Fix making of the certificate to copy serial number out if not already set.
2020-08-06 08:52:21 +10:00
9671901de6 Added a free call to SetSubjectBuffer 2020-08-05 15:52:09 -07:00
83caf39caa SP ECC Cache Resitance
SP ECC improved cache attack resistant implementation.
On by defualt and turn off with WC_NO_CACHE_RESISTANT.
2020-08-06 08:21:08 +10:00
e5e87db6aa add HAVE_EX_DATA, OPENSSL_ALL, HAVE_ALPN to enable-jni configure option 2020-08-05 15:43:26 -06:00
c421445ba9 Added no SHA-1 hash support for OPENSSL compatibility. Fix for ./configure --enable-opensslextra --disable-sha. This allows using SHA2-256 for the hashing including the derived issuerHash and subjectHash. Adds issuer hash openssl compatibility function X509_issuer_name_hash. 2020-08-05 14:43:24 -07:00
ffa2cdd2d1 add public function wc_curve25519() "compute the public key from an existing private key, using bare vectors."; rename existing _LOCAL functions wc_curve25519_GetBasePoint() and wc_curve25519() to nxp_ltc_curve25519_GetBasePoint() and nxp_ltc_curve25519() respectively; add const qualifiers opportunistically to existing _LOCAL function curve25519() 2020-08-05 16:28:17 -05:00
49e5d8efea Added additional ifdef's to Ed25519 functions and cast derSz to word32 2020-08-05 12:31:50 -07:00
633e950942 Added asn.c unit tests 2020-08-05 10:57:32 -07:00
d12b80abdf Merge pull request #3192 from ethanlooney/21st_branch
Added check for wolfmath.c for digits == 0 and test for api.c
2020-08-05 09:51:51 -06:00
1034139214 Merge pull request #3081 from kaleb-himes/GH2998_REWORK_FOLLOWUP
Cleanup of example client/server buffer sizes
2020-08-05 09:31:30 -06:00
6c4bcb3b59 tfm: Check for overflow and return error (fixed max size) 2020-08-05 10:42:32 +10:00
5d7649c959 Review comment in sp_int file 2020-08-04 15:37:20 -07:00
def3192073 Merge pull request #3189 from SparkiDev/ed448_pkcb_fix
Fix calls to Ed448 sign and verify in test.h
2020-08-04 17:23:45 -05:00
0bdaa2d572 Merge pull request #3169 from dgarske/stmcube
STM Cube fixes and documentation improvements
2020-08-04 15:08:04 -07:00
42856287ee Added check for wolfmath.c for digits == 0 and test for api.c 2020-08-04 13:25:10 -07:00
8d00b015c1 Merge pull request #3182 from dgarske/configall_noold
Fix to NOT enable SSLV3 and TLS v1.0 with `--enable-all`
2020-08-04 12:25:59 -07:00
5641e2ae50 Merge pull request #3173 from ethanlooney/18th_branch
Added unit tests for wolfmath.c
2020-08-04 09:10:21 -06:00
c6f83645fe Fix calls to Ed448 sign and verify in test.h 2020-08-04 09:56:14 +10:00
0df2da47ff Merge pull request #3180 from embhorn/zd10697
Fix OOB in fp_read_radix_16
2020-08-03 16:44:01 -07:00
a536e8acd6 Merge pull request #3187 from SparkiDev/config_fix_1
Fixes for different configurations
2020-08-03 16:41:50 -07:00
48be407852 Merge pull request #3186 from SparkiDev/rsa_pss_oob
RSA PSS check input length is hash length
2020-08-03 16:41:15 -07:00
87f5dac3c4 Merge pull request #3170 from kaleb-himes/FIPS_USER_SETTINGS
Remove fixed len constraint in FIPS mode
2020-08-03 16:35:26 -07:00
bfb4b2079b Merge pull request #3163 from dgarske/nrf52
Fixes for building against latest nRF52 SDK
2020-08-03 16:33:49 -07:00
3e84f1c53f Merge pull request #2882 from dgarske/example_configs
Added area for template user_settings files in `examples/config`
2020-08-03 16:32:57 -07:00
7f381275b1 Removed comment and changed len equal to variables instead of numbers 2020-08-03 13:31:11 -07:00
6c92116124 Move cipherExtraData so that it is available when HAVE_SESSION_TICKET 2020-08-03 15:32:49 +02:00
d0969ea1ce Fixes for different configurations
Fix SkipInt() to work with DSA.
Fix protection around SetBitString16Bit() - when WOLFSSL_CERT_GEN and
WOLFSSL_CERT_EXT defined is only use.
WOLFSSL_RSA_VERIFY_ONLY and PSS means testing of PSS won't work.
Fix g++ build around ASN1_SEQUENCE - const variable required to be
initialized.
2020-08-03 14:55:09 +10:00
3ffa4350e8 RSA PSS check input length is hash length
Input is the hash of the message and the hash type is the hash used to
generate the hash/input.
2020-08-03 12:17:03 +10:00
4f91d60d22 Fixes for build issues without OPENSSL_EXTRA defined. 2020-07-31 15:25:58 -07:00
776b1a2d17 Fix for ED25519 with user_settings.h. Fixes for build warnings. Fix spelling error. Added template for wolfBoot key/sign tools. 2020-07-31 15:17:53 -07:00
197c21a508 Fix for --enable-all (also used by --enable-distro) to NOT enable SSLV3 and TLS v1.0. 2020-07-31 13:54:08 -07:00
d21d95c629 Fix OOB in fp_read_radix_16 2020-07-31 15:19:40 -05:00
3531b581b5 Added return code check wolfSSL_CryptHwMutexInit 2020-07-31 12:01:09 -07:00
904241cba4 Fix to only init the RNG once for nRF51/nRF52x. 2020-07-31 11:56:32 -07:00
fd4f8fe7a0 Suite Size Check
1. Check that the cipher suite size is even when doing the Client
   Hello message.
2. Check that the cipher suite size is a multiple of three when doing
   the Old Client Hello message.
3. Check that the hash/signature algorithm list size is even when
   processing the extensions.
2020-07-31 11:44:24 -07:00
ff08a01f94 Merge pull request #3171 from SparkiDev/tls13_fin_fix
TLS 1.3: Client requires cert_vfy before finished when not PSK
2020-07-31 11:28:24 -07:00
e7fe460fac Merge pull request #2746 from dgarske/cmake
Adds CMake support to wolfSSL
2020-07-31 11:14:59 -07:00
71cc5381ad Added new examples/config area with template user_settings.h files and instructions for using. 2020-07-31 11:01:58 -07:00
b627610cde Added bad test cases for get_digit and corrected comment formatting 2020-07-31 09:44:10 -07:00
db20fb6ca1 Fixes for using CMake with Visual Studio. Improvements to documentation for portability. 2020-07-30 16:44:36 -07:00
c30ffad622 Fix for STM PKA ECC parameters. Improvements to the STM AES GCM code. Cleanup of hardware mutex code. 2020-07-30 16:00:19 -07:00
48e1dfc910 Remove the STM Cube .ioc files. These examples have been moved to the wolf Cube pack (https://www.wolfssl.com/files/ide/I-CUBE-WOLFSSL-WOLFSSL.pack) 2020-07-30 14:45:52 -07:00
c52930bb8a Added freerng to 'test_mp_rand' 2020-07-30 09:37:05 -07:00
d03971e233 Add comment to clarify errno in test 2020-07-30 09:18:45 -07:00
493510e2ea Review comments 2020-07-30 09:18:45 -07:00
4cc7f9e4a9 Check correct returned value 2020-07-30 09:18:45 -07:00
cebb283822 DO-178 changes 2020-07-30 09:18:45 -07:00
3381eb2094 Added tests for Sha512.c 2020-07-30 09:18:45 -07:00
d96f86fcd9 Merge branch 'master' into GH2998_REWORK_FOLLOWUP 2020-07-30 09:47:48 -06:00
1168bdd05b Merge pull request #3165 from ethanlooney/17th_branch
Added unit tests for wc_port.c
2020-07-30 09:08:28 -06:00
4c0105ed9d Merge pull request #3175 from ejohnstown/dtls-speed-redux
DTLS Test Speed Fix Redux
2020-07-30 22:17:40 +10:00
a38f7a4fca Added STM32F1 Cube HAL support (we had StdPeriLib, not Cube). 2020-07-29 17:22:41 -07:00
397d1ab19c DTLS Test Speed Fix Redux
1. Fix the check for XSLEEP_US in the client.
2. Added XSLEEP_MS to mirror XSLEEP_US, in terms of XSELECT().
2020-07-29 16:51:08 -07:00
64f6dc08f7 Merge pull request #3164 from SparkiDev/tls13_ocsp2
TLS 1.3 server MUST NOT use OCSP Status V2
2020-07-29 16:23:24 -07:00
46ef82e2fd For for STM32 with TLS v1.3 and AES-GCM. The IV was not being reset after using hardware causing the aes->reg to be incorrect. 2020-07-29 15:39:49 -07:00
e4650a9151 Fixes for STM32 Crypto hardware acceleration locking to work with multiple threads. Fix for api.c missing devId in new RNG test. Added STM32F207 to configuration template. 2020-07-29 14:55:35 -07:00
b4cd0886bb Changed test returns for 'get_digit' to remove implicit conversion errors 2020-07-29 14:23:03 -07:00
7861a22d28 add marvell-linux-selftest target to fips-check.sh 2020-07-29 15:10:47 -06:00
c6b4fa3be3 add selftest version for newer 4.1.0 validation 2020-07-29 15:10:47 -06:00
dafc2bf8d4 Added redirect note for OpenSTM32 to STM32Cube example. PR #3031. Updates to README.md from ST. 2020-07-29 12:04:14 -07:00
7c59c74e07 Added unit tests for wolfmath.c 2020-07-29 10:34:15 -07:00
b524926837 Deleted unneeded xfopen and xfclose 2020-07-29 09:31:37 -07:00
80678d96b6 Change to inline comment 2020-07-29 10:10:33 -06:00
af92c531bf Merge pull request #3168 from ethanlooney/16th_branch
Added semicolons to two functions to fix doxygen issues and deleted ssl param and replaced it with ctx param
2020-07-29 09:31:14 -06:00
f59a1fa295 TLS 1.3: Client requires cert_vfy before finished when not PSK 2020-07-29 10:21:34 +10:00
e618257f21 Merge pull request #3167 from dgarske/test_fixups
Fixes for `mutex_test` and API unit test `derSz`
2020-07-28 16:45:58 -07:00
4cbf3c3dcd Fixes for the STM Cube TLS in-memory example for CMSIS RTOS v2. 2020-07-28 15:52:02 -07:00
70aa11f0a9 Merge pull request #3153 from ethanlooney/15th_branch
Added unit tests for Logging.c
2020-07-28 16:35:31 -06:00
567f1b8be4 Add to settings.h w a warning directive 2020-07-28 15:52:36 -06:00
1ed66f11a9 Fixes for STM32L5 benchmarks. 2020-07-28 13:56:23 -07:00
ffdc2eddf6 Remove fixed len constraint in FIPS mode 2020-07-28 13:34:52 -06:00
223f848dae Expanded documentation for using the wolfSSL Cube pack. Added STM32 benchmarks for several boards. 2020-07-28 12:08:12 -07:00
9160a126e4 Fixes for running wolfCrypt test/benchmark with SECP256R1 disabled. Improved detection of ECC key generation size. 2020-07-28 11:43:48 -07:00
ff12da30df Merge pull request #2713 from akmcomau/16bit
Updates for 16bit processors / Disable ATECC transport key
2020-07-28 09:27:27 -07:00
5af4872bab Changed lock type to 0 2020-07-28 09:16:43 -07:00
0448004535 Added semicolons to two functions to fix doxygen issues and deleted ssl param and replaced it with ctx param 2020-07-28 08:39:23 -07:00
25fcd082d7 Improve the mutex_test test with pthreads. Fixes #3109 2020-07-28 08:19:32 -07:00
8440973d99 Fix for derSz calculation on non-const value keySz. ZD 10654 2020-07-28 08:18:42 -07:00
c67aeba806 Merge pull request #3156 from dgarske/armasm
Fixes for building with `WOLFSSL_ARMASM` when `user_settings.h` is used
2020-07-27 16:45:25 -07:00
f46e08e9ea Merge pull request #3158 from kaleb-himes/ZD10580_R2
Address buffer underflow, thanks to J.S. for the report on ZD10580
2020-07-27 16:42:42 -07:00
5ef7ff6054 Merge pull request #3149 from SparkiDev/tls13_no_cli_cert_err
TLS 1.3: Client with no certificate an error with define
2020-07-27 16:40:07 -07:00
13eab0aeab Also check for NRF52_SERIES, since NRF52 is only for NRF52832_XXAA. 2020-07-27 15:26:55 -07:00
99f72faedb Fix for nRF5x AES GCM so key is set. Fixes GMAC test. Don't force enable wolf memory and no ASN time for WOLFSSL_NRF5x. 2020-07-27 14:30:41 -07:00
8b25b48621 Improvements to CMake support based on feedback from users. 2020-07-27 12:13:08 -07:00
b273ba771e Add new file to automake. 2020-07-27 11:04:37 -07:00
9a281e5e3a Adds CMake support to wolfSSL:
* Build wolfSSL as a library and builds all examples / tests.
* Added instructions in the INSTALL file.
* Fix for evp.c when being included directly due to improperly placed `WOLFSSL_EVP_INCLUDED`.
2020-07-27 11:04:37 -07:00
e7429c8504 Added unit tests for wc_port.c 2020-07-27 09:32:25 -07:00
6b3b37604f Merge pull request #3159 from ethanlooney/16th_branch
Added doxygen comments and changed footer date to 2020
2020-07-27 09:24:59 -06:00
b0ed250f09 Merge pull request #3162 from ethanlooney/18th_branch
Changed ifndef(NO_SHA224) to ifdef(WOLFSSL_SHA224)
2020-07-27 09:21:28 -06:00
76a35f2a77 TLS 1.3: Client with no certificate an error with define
WOLFSSL_NO_CLIENT_CERT_ERROR
2020-07-27 09:54:51 +10:00
b775058f49 TLS 1.3 server MUST NOT use OCSP Status V2
Parses the extension but does not use the information.
TLSX code change to ensure that the OCSP Status V2 extension is not
written out in EncryptedExtension, CertificateRequest nor Certificate
messages.
2020-07-27 09:32:14 +10:00
7883156f49 Merge pull request #3160 from dgarske/ecc_nb_noctx
Fix for ECC non-blocking only to allow calling without context set
2020-07-27 08:53:42 +10:00
8417e0b725 Fixes for building against latest nRF52 SDK. Allow nRF5x AES GCM to be enabled (uses software, but ECB is accelerated). Fix in wolfCrypt test for building AES GSM only with NO_AES_DECRYPT. 2020-07-24 15:46:17 -07:00
b734b13120 Changed ifndef(NO_SHA224) to ifdef(WOLFSSL_SHA224) due to 'NO_SHA224' not existing 2020-07-24 14:24:50 -07:00
7b357cff39 Changed param's, examples and brief's 2020-07-24 12:54:29 -07:00
e84defb268 Merge pull request #3044 from dgarske/sniffer_tls13
TLS v1.3 sniffer support
2020-07-24 11:46:38 -07:00
6088a7bd79 Added if defined debug check to only print to file if debug is enabled 2020-07-24 10:03:49 -07:00
6324aec179 Fix for ./configure --enable-sp=yes,nonblock --enable-sp-math CFLAGS="-DWC_ECC_NONBLOCK_ONLY". 2020-07-24 09:30:45 -07:00
38cef2b3c9 Merge pull request #3151 from ejohnstown/dtls-size
DTLS Size Fix
2020-07-24 08:19:50 -07:00
8789ebb02e Merge pull request #3152 from ejohnstown/dtls-test-speedup
DTLS Test Speedup
2020-07-23 16:53:39 -07:00
1559d66261 Fix for WC_ECC_NONBLOCK_ONLY case to also check WC_ECC_NONBLOCK. 2020-07-23 15:41:09 -07:00
fd1a1bd0f7 Add some missing frees to the example client when using in the return-not-exit mode for tests. 2020-07-23 14:32:48 -07:00
20ef2daa9f Fix for ECC non-blocking to allow calling without context set and block when WC_ECC_NONBLOCK_ONLY is defined. In FIPS mode we need "blocking". 2020-07-23 14:31:41 -07:00
6bc4bfd7f2 Added doxygen comments to include all missing ABI functions and changed footer date from 2017 to 2020 2020-07-23 13:25:18 -07:00
81475fac96 Merge pull request #3154 from embhorn/zd10651
Fix build error with X509_SMALL config
2020-07-23 13:34:29 -06:00
839044d9e1 1. Remove dead assignment from client test.
2. Fix memory leak in example server test.
3. Use verify callback on certificates to allow callback to fail
   them.
4. Restore the forced failure test cases.
5. Make the verify action thread local.
2020-07-23 12:26:49 -07:00
303d0dfedb Merge pull request #3157 from embhorn/zd10631
Fix build issue with OPENSSL_EXTRA_X509_SMALL
2020-07-23 13:18:28 -06:00
3c5c0f88d4 Address buffer underflow, thanks to J.S. for the report on ZD10580 2020-07-23 12:20:41 -06:00
563806c497 Changed the log dump txt file's directory to include /tests and added it to make clean 2020-07-23 10:12:40 -07:00
1f8d4149a5 Merge in master 2020-07-23 21:39:18 +10:00
d02e52e07b More updates from code review 2020-07-23 21:28:51 +10:00
568fc8f5bd Fixes for compiling for ARM64 iOS
Fix bug in ChaCha20 assembly code (was writing one byte too many).
Fix the assembly code to have APPLE format.
Change Poly1305 inline assembly as requested by compiler.
Initialize variables that will be set anyway - compiler complaint.
Change to use the assembly code files for Curve25519 and SHA-512.
Ed25519 not suported with ARM assembly.
2020-07-23 18:08:37 +10:00
e198f6e73b Merge pull request #3141 from SparkiDev/tls_cert_alert
Send more detail alerts for bad certificates
2020-07-22 16:46:14 -07:00
ab7535c3f6 Merge pull request #3135 from SparkiDev/fp_set_bit
fp_set_bit: return error when bit offset is too large
2020-07-22 16:40:17 -07:00
d75e6d4f55 Merge pull request #3131 from JacobBarthelmeh/Testing
add sanity check on padSz
2020-07-22 16:39:27 -07:00
ea21d56463 Merge pull request #3127 from SparkiDev/mp_sub_d
mp_sub_d (integer.c): return error when digit is too big
2020-07-22 16:38:37 -07:00
f7e4c1c8ad Added SetLoggingCb check 2020-07-22 15:44:13 -07:00
9b421ce497 Fix for config failure 2020-07-22 17:22:46 -05:00
5f2de9e176 Merge pull request #3130 from TakayukiMatsuo/master
Add support for "X72N Envision Kit" evaluation board
2020-07-22 16:22:14 -06:00
98ae3a2352 Added a suite test use case to cover the new error check. Also fixed and issue with passing a couple flags to the test case runner, and some other changes to support the new test. 2020-07-22 13:20:23 -07:00
fe08f23a50 Improved test sleep. Cleanup sleep calls. 2020-07-22 13:08:57 -07:00
3a2be13043 Remove execute bit on file. 2020-07-22 12:52:53 -07:00
c5371a2dbd Fix for kResumeMsg unused if NO_SESSION_CACHE defined. 2020-07-22 12:15:14 -07:00
39271e9234 Fix build issue with OPENSSL_EXTRA_X509_SMALL 2020-07-22 14:08:57 -05:00
1af38c5c55 Fixes for building with WOLFSSL_ARMASM when user_settings.h is used. 2020-07-22 10:47:35 -07:00
5e515c12fb Removed unneeded comment 2020-07-22 08:28:43 -07:00
c8e9d058f0 DTLS Test Speedup
Change the example client to use select instead of sleep.
If building for the standalone client, it will wait 1 second.
If built for no main driver, it'll wait 10ms rather than 1 second.
2020-07-21 18:40:18 -07:00
11b0d963d3 Fix for example client to send HTTP GET on resume with "-g". Fixes issue with ./scripts/openssl.test. 2020-07-21 15:42:33 -07:00
056ee0987c Merge pull request #3146 from dgarske/sp_nonblock
ECC non-blocking support
2020-07-22 08:36:21 +10:00
953e7cf181 Changed sz type from int to long 2020-07-21 15:28:17 -07:00
89913076f1 Fix build error with X509_SMALL config 2020-07-21 16:36:30 -05:00
639f73fe1f Fix for client writes to not include the null term. 2020-07-21 13:42:01 -07:00
4e637ddf10 Cleanup on example client/server messages and sizes. Original PR #3023 caused sending extra null characters in normal (non HTTP) example cases. 2020-07-21 13:34:25 -07:00
8ead28f2f4 Merge pull request #3150 from ejohnstown/sctp-test
SCTP Test
2020-07-21 12:46:13 -07:00
b500a54fc5 Added new file to read in and dump error message and added cleanup within cleanup script 2020-07-21 12:30:43 -07:00
e8034619ba Add more if defined to ERR_print_errors_fp 2020-07-21 12:30:43 -07:00
9268ae1397 Fix line length issues. Add debug msg in test to show number of non-blocking iterations.
```
$ ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS="-DWOLFSSL_PUBLIC_MP" --enable-debug && make
$ ./wolfcrypt/test/testwolfcrypt
...
ECC non-block sign: 18063 times
ECC non-block verify: 35759 times
ECC      test passed!
```
2020-07-21 10:41:25 -07:00
c45e192581 Send more detail alerts for bad certificates 2020-07-22 00:07:23 +10:00
c204eb0fb1 commented out NO_ASM_TIME macro to enable certificate validation 2020-07-21 16:09:16 +09:00
5d5aa129ca When attempting to send a message with DTLS, if it is too large, return an error rather than splitting it across records. (ZD 10602) 2020-07-20 16:14:53 -07:00
10c293a76c SCTP Test
1. Removed test cases for DTLSv1.0 that used AEAD ciphers.
2. Cleaned up some typos in the test configs.
3. Fixed typo in a WOLFSSL_SCTP ifdef check.
2020-07-20 15:03:48 -07:00
61d81dd878 Merge pull request #3123 from SparkiDev/mp_rshb
rshb check range of n
2020-07-20 13:08:45 -07:00
29abd72c39 Merge pull request #3024 from kaleb-himes/ZD10411
Update arduino script to reflect includes of inline files
2020-07-20 11:29:49 -07:00
e6017de19d Fix in snifftest to try loading private key into static ephemeral and private key. Updated pcap files (were missing TCP packets). 2020-07-20 11:10:46 -07:00
ddb2923c19 Merge pull request #3133 from ethanlooney/13th_branch
Added unit tests for Hash.c - Fixed hash formatting errors
2020-07-20 10:03:28 -06:00
86745dd7fc Merge pull request #3134 from ethanlooney/14th_branch
Added unit tests for Random.c
2020-07-20 10:02:22 -06:00
52d363390a rshb check range of n 2020-07-20 11:12:35 +10:00
a8f121b5f8 Merge pull request #3144 from JacobBarthelmeh/examples
increase example client key share group array size
2020-07-20 08:38:20 +10:00
23a3ead758 Framework for new TLS v1.3 sniffer tests. 2020-07-17 15:56:56 -07:00
9409d8682f Fix for building without session-ticket. 2020-07-17 15:22:35 -07:00
e15e0828bf Cleanup of the SHOW_SECRET debugging. Use only latest wolf API's (not older Cyassl names). 2020-07-17 15:22:35 -07:00
3be390d50d Added TLS v1.3 session resumption support. TLS v1.3 uses session tickets and a resumption secret is derived after the "finished" message. This uses the internal static wolf session cache to retain the resumption secret between sniffer sessions. 2020-07-17 15:22:35 -07:00
1b051d9c5b TLS v1.3 sniffer support:
* Added TLS v1.3 sniffer support using static ephemeral key.
* Add support for using a static ephemeral DH and ECC keys with TLS v1.3 using `WOLFSSL_STATIC_EPHEMERAL`.
* Adds new API's `wolfSSL_CTX_set_ephemeral_key` and `wolfSSL_set_ephemeral_key`.
* Expanded TLS extension support in sniffer.
* Refactor of the handshake hashing code.
* Added parameter checking to the TLS v1.3 key derivations (protects use of "DoTls13Finished" if handshake resources have been free'd).
* Added support for loading DH keys via `wc_DhImportKeyPair` and `wc_DhExportKeyPair`, enabled with `WOLFSSL_DH_EXTRA`.
* Added sniffer documentation `sslSniffer/README.md`.
2020-07-17 15:22:35 -07:00
80f5fe1494 Added documentation for wc_ecc_set_nonblock. 2020-07-17 15:20:23 -07:00
90ee12f51a Added test case for ECC non-blocking. ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS="-DWOLFSSL_PUBLIC_MP" && make. 2020-07-17 15:13:50 -07:00
547144bc9c Adds ECC non-blocking sign/verify support when used with SP math. New --enable-sp=nonblock and --enable-ecc=nonblock options. Example ./configure --enable-ecc=nonblock --enable-sp=yes,nonblock. 2020-07-17 15:13:50 -07:00
080ccd9820 Merge pull request #3145 from JacobBarthelmeh/Compatibility-Layer
sanity check on return value for wolfSSL_X509_NAME_ENTRY_get_object
2020-07-17 15:05:25 -07:00
ef71099225 Removed duplicate semicolon and deleted unneeded initrng 2020-07-17 10:34:38 -07:00
01a01c373f sanity check on return value for wolfSSL_X509_NAME_ENTRY_get_object 2020-07-17 11:03:12 -06:00
e55ca1a8cf increase example client key share group array size 2020-07-17 10:26:34 -06:00
93c6e99aef Added a ret check 2020-07-17 08:45:39 -07:00
4ff6b6a908 Merge pull request #3142 from SparkiDev/sp_int_small
Fix SP math for small builds. Fixes #3139
2020-07-17 08:33:05 -07:00
0336fdb98d Fix SP math for small builds 2020-07-17 12:00:14 +10:00
cd025d4e03 Added RX72NEnvisionkit/include.am 2020-07-17 09:30:40 +09:00
96e59118fc Changed the if defined order and to include fips and selftest 2020-07-16 15:50:03 -07:00
2275b89654 Removed unnecessary comments and added HashInit's and checked that they returned errors when they should 2020-07-16 12:38:55 -07:00
50f228af0a Merge pull request #3125 from SparkiDev/mp_leading_bit
Change mp_leading_bit (integer.c) to not to require a copy
2020-07-16 11:05:09 -07:00
859a1eebe4 Merge pull request #3124 from SparkiDev/sp_add_d
Fix sp_add_d
2020-07-16 10:56:28 -07:00
9137794cb4 Merge pull request #3105 from embhorn/zd10457_a
Adding wolfSSL_X509_check_ip_asc
2020-07-16 10:53:27 -07:00
eb7a01342f fp_set_bit: return error when bit offset is too large
If the bit to set is beyond the predefined maximum size then return an
error.
Same for fp_is_bit_set().
2020-07-16 12:34:31 +10:00
f2b279e834 Update from review 2020-07-15 20:57:04 -05:00
fbe0c8cba7 Merge pull request #3122 from JacobBarthelmeh/Compatibility-Layer
fix X509 multiple OU's and refactor
2020-07-15 15:06:22 -07:00
925e9d9213 Merge pull request #3075 from julek-wolfssl/dtls-no-cookie
DTLS session resumption fixes
2020-07-15 14:07:34 -07:00
edf88c3da1 Merge pull request #3073 from SparkiDev/tls13_dox
Update TLS 1.3 function Doxygen documentation
2020-07-15 13:58:07 -07:00
d54a51cd20 Added if not defined wc_no_rng 2020-07-15 13:56:12 -07:00
7a642e2b78 Added unit tests for Random.c 2020-07-15 12:55:19 -07:00
6be76e84ec Fixed formatting for Shake256Hash 2020-07-15 12:52:17 -07:00
9a07df9631 Changed hash size to 144 for Shake256Hash 2020-07-15 12:52:17 -07:00
379212acec Initialized variable data 2020-07-15 12:52:17 -07:00
aaa6e892da Added unit tests for hash.c 2020-07-15 12:52:17 -07:00
525a3cb9c3 Move API out of OPENSSL_EXTRA 2020-07-15 10:48:11 -05:00
d1a82589f9 Adding wolfSSL_X509_check_ip_asc 2020-07-15 10:48:11 -05:00
12478a4534 Merge pull request #3128 from tmael/fips_ossl
Correct string truncation of XSTRNCAT
2020-07-14 17:17:27 -07:00
e754076c37 Change mp_leading_bit (integer.c) to not to require a copy 2020-07-15 09:20:15 +10:00
ddad95d52c mp_sub_d (integer.c): return error when digit is too big
Code can't handle subtracting a number (an mp_digit) larger than
DIGIT_BIT. Now returns an error rather than giving wrong result.
2020-07-15 09:18:35 +10:00
51e49dbfac Fix sp_add_d 2020-07-15 09:15:04 +10:00
a8736dd89d set heap hint for name malloc 2020-07-14 14:23:49 -06:00
1caa6f860b Merge pull request #3088 from kaleb-himes/ZD10539
Change Hash union to wc_Hmac_Hash
2020-07-14 11:23:30 -07:00
2dcf4c1696 Merge pull request #3087 from SparkiDev/sp_math_mod
Fix div implementation in SP int
2020-07-14 11:19:15 -07:00
173b9833fc fixes for edge build cases and static memory 2020-07-14 09:07:23 -06:00
20682ef0aa Add support for RX72N Envision Kit 2020-07-14 11:33:19 +09:00
aee208f1b1 Correct build 2020-07-13 17:29:12 -07:00
4938baa892 Merge pull request #3121 from ethanlooney/12th_branch
Added unit tests for Sha3.c
2020-07-13 17:29:45 -06:00
85437e4097 add sanity check on padSz 2020-07-13 17:17:57 -06:00
63c8f7d1b1 x509 small build and memory free 2020-07-13 15:51:27 -06:00
a77085960e Merge pull request #3103 from TakayukiMatsuo/master
Supprted TSIP v1.09 for target board GR-ROSE
2020-07-13 14:35:07 -06:00
c5b8181005 Added a free call for shake256_copy 2020-07-13 09:58:00 -07:00
cbfda8e596 Merge pull request #3111 from ethanlooney/tenth_branch
Changed EXTRACT_ALL from NO to YES in order to document every function using Doxygen
2020-07-13 10:05:54 -06:00
d880d59974 fix for init of renegotiation and fix for compiler warnings 2020-07-13 00:31:40 -06:00
eec5f4a109 set initial NID value and account for null character on string 2020-07-12 19:54:50 -06:00
af1b532758 Applied review comments to the code 2020-07-11 17:17:33 +09:00
ed9648770d Merge pull request #3120 from ethanlooney/11th_branch
Added unit tests for Sha512.c
2020-07-10 17:12:23 -06:00
2aaeb2a2df fix X509 multiple OU's and refactor 2020-07-10 17:12:20 -06:00
84aa7d746a Added unit tests for Sha3 2020-07-10 15:43:08 -07:00
a90d6b2a5e Merge pull request #3039 from tmael/cov-fix2
Coverity fix in wolfSSL 4.4.0 - part 2
2020-07-10 13:06:22 -07:00
b8078ab789 Merge pull request #3092 from dgarske/sniffer_loadbuf
Added sniffer API's to load buffer directly
2020-07-10 12:58:45 -07:00
7e23273d1c Changed directory for Doxygen's search to only the necessary header files 2020-07-10 12:51:21 -07:00
b931dc0d6e Merge pull request #3110 from JacobBarthelmeh/SGX
add SP build for SGX
2020-07-10 10:29:50 -07:00
295aa4ac55 Added tests for Sha512.c 2020-07-10 10:15:32 -07:00
64c0d53a2d Use portable friendly XVALIDATE_DATE in ssl.c and add wc_ to default 2020-07-10 09:43:24 -06:00
03839ea641 Changed EXTRACT_ALL from NO to YES in order to document every function 2020-07-10 08:16:15 -07:00
ed0f2bb8f5 Added sniffer API's to load buffer directly, not file. ZD 10547 2020-07-09 08:54:26 -07:00
942226dc5a Merge branch 'master' of https://github.com/wolfSSL/wolfssl to get updated ocsp tests 2020-07-09 07:47:54 +09:00
b952f18eb4 Merge pull request #3104 from JacobBarthelmeh/nginx
Nginx 1.15.7
2020-07-09 08:46:30 +10:00
3e0d0677ee Merge pull request #3116 from embhorn/zd10570
Sanity check in DoTls13HandShakeMsgType
2020-07-09 08:42:37 +10:00
e37bd2ade6 Merge pull request #3113 from guidovranken/scrypt-return-memory-e
Return MEMORY_E from wc_scrypt if allocation fails
2020-07-09 08:28:51 +10:00
890500c1b1 Fix Coverity 2020-07-08 08:20:43 -07:00
1e94f0478c Added resetting size info output-buffer before calling export APIs
Added resetting size into output-buffer before calling export APIs
2020-07-08 08:20:43 -07:00
b9855b51bf Sanity check in DoTls13HandShakeMsgType 2020-07-08 07:55:05 -05:00
5f5040686e Merge pull request #3112 from kaleb-himes/INTERNAL_OCSP_STAPLING_FIX
Put both potential roots for login.live.com into collection for stapl…
2020-07-07 20:46:09 -05:00
7f66671449 In wc_PKCS12_PBKDF_ex, break out of outer loop on error 2020-07-08 01:38:02 +02:00
43e1eee55d Return MEMORY_E from wc_scrypt if allocation fails 2020-07-08 01:04:37 +02:00
aa704420fd Fix typo in include.am 2020-07-07 16:39:39 -06:00
c8dcd59565 Merge pull request #3082 from JacobBarthelmeh/Testing
restrict the cert version allowed
2020-07-07 15:37:01 -07:00
42f3a6d7a4 Put both potential roots for login.live.com into collection for stapling test 2020-07-07 16:02:48 -06:00
6196698d8b Merge pull request #3099 from ethanlooney/eighth_branch
Added unit tests to sha256.c for sha224 and sha256.
2020-07-07 15:37:38 -05:00
333f4ccced add SP build for SGX 2020-07-07 10:43:44 -06:00
a95b31041c Added NO_ASN_TIME macro to avoid cert expiration validation 2020-07-07 18:40:41 +09:00
80246dfbc3 Merge pull request #3102 from guidovranken/free-tlsx
In TLSX_SupportedFFDHE_Set, free TLSX list if TLSX_PopulateSupportedG…
2020-07-07 08:25:13 +10:00
296b562113 Fixed formatting and forgotten curly bracket 2020-07-06 12:33:06 -07:00
1b7a96627c Changed formatting 2020-07-06 12:05:55 -07:00
301e5c03b9 Merge pull request #3097 from SparkiDev/sp_int_mul_of
Fix SP int size of result checks
2020-07-06 11:17:01 -07:00
b8314a70f9 Merge pull request #3089 from kaleb-himes/ZD10539_LICENSING
Add or later verbage to LICENSING and sync header license versions
2020-07-06 11:11:11 -07:00
514254e294 Merge pull request #3069 from SparkiDev/gnu-stack
Add section to asm files to avoid exe stack
2020-07-06 11:08:24 -07:00
e194a11cb8 add wolfSSL_SESSION_new and change to peek error 2020-07-06 10:47:46 -06:00
dfde73620c Added if defined cases for tests using hashes 2020-07-06 08:07:03 -07:00
9554e54e8f Resolved conflict 2020-07-06 10:58:58 +09:00
1af2e5cf02 Fix div implementation in SP int 2020-07-06 08:52:44 +10:00
04d063f2ba In TLSX_SupportedFFDHE_Set, free TLSX list if TLSX_PopulateSupportedGroups fails 2020-07-05 23:41:50 +02:00
464cd49e45 Supprted TSIP v1.09 for target board GR-ROSE 2020-07-04 23:40:10 +09:00
0e79943a5c Fix SP int size of result checks
sp_lshb: Only put values in extra word id necessary
2020-07-03 09:12:27 +10:00
5f3a287a6a Added tests to sha256.c for sha224 and sha256. 2020-07-02 14:30:30 -07:00
655022cfc5 Merge pull request #3095 from ethanlooney/sixth_branch
Added additional tests for curve25519 and fixed a print format error from previous tests.
2020-07-02 10:07:55 -05:00
3efd8a8576 Jenkins fixes 2020-07-02 14:59:07 +02:00
3242fa3669 Fixed formatting, redundant if's and added a comment explaining why a value was chosen. 2020-07-01 16:01:50 -07:00
df9a1a2a0e revert error peek function 2020-07-01 16:26:38 -06:00
fd79ebfe8d TLS 1.3 requires chacha and poly1305 for myTicketEncCb 2020-07-01 20:24:50 +02:00
f526a11126 Added additional tests for curve25519 and fixed a print format error from previous tests 2020-07-01 10:19:40 -07:00
a59560a1d5 Added tests to curve25519.c and fixed a print error from previous curve25519 tests 2020-07-01 09:32:03 -07:00
f89686a1ec Merge pull request #3086 from SparkiDev/sp_c_mod_fix
Fix normalization in all SP C divs
2020-07-01 09:02:29 -07:00
eb4b575b3a Merge pull request #3085 from ethanlooney/fourth_branch
API tests for Curve448
2020-06-30 17:24:07 -05:00
4ad904909c Added a return check 2020-06-30 12:40:20 -07:00
78efb48acf Added two more tests to hit xmemset lines 2020-06-30 12:40:20 -07:00
b7e682e677 Added more tests to api.c for curve448 2020-06-30 12:40:20 -07:00
94654c7a46 Merge pull request #3062 from TakayukiMatsuo/branch-2
Added testcases for wc_curve25519_export_key_xx
2020-06-30 14:27:24 -05:00
e63a80f1af Use NO_SESSION_CACHE as well in preproc checks 2020-06-30 21:21:43 +02:00
e6746639af add SSL_SESSION_up_ref and fix for get lib 2020-06-30 13:16:28 -06:00
8d37f57990 Change variable name from Hash to hashAlg 2020-06-30 12:50:26 -06:00
b57cf802eb Expose session serialization outside of OPENSSL_EXTRA
Use `./configure CFLAGS='-DHAVE_EXT_CACHE'` to enable session serialization without `OPENSSL_EXTRA`.
2020-06-30 20:17:21 +02:00
970391319b Add or later verbage to LICENSING and sync header license versions 2020-06-30 12:13:13 -06:00
55985ad1b4 Change Hash union to wc_Hmac_Hash 2020-06-30 12:01:57 -06:00
c39bd55aca Removed comment, deleted redundent WC_RNG initialization and fixed indentation 2020-06-30 09:32:10 -07:00
2c11f96c9d Merge pull request #3048 from embhorn/zd10216
Override CRL error for NO_VERIFY
2020-06-29 15:35:53 -07:00
4e584595f0 Fix normalization in all SP C divs 2020-06-30 08:32:42 +10:00
e32e206d7c Added a return check 2020-06-29 12:55:42 -07:00
7fb4a98009 Added two more tests to hit xmemset lines 2020-06-29 09:48:22 -07:00
6745733e2e Added more tests to api.c for curve448 2020-06-29 09:30:17 -07:00
b6aaedd3b4 Merge pull request #3080 from ethanlooney/second_branch
Added additional tests to curve448.c through api.c
2020-06-29 11:21:15 -05:00
7a2384deaf Merge pull request #3071 from kojo1/user-mutex
User defined mutex
2020-06-28 21:45:30 -07:00
14d0b4e7d6 adjust test case 2020-06-26 10:25:50 -06:00
7bd5da70a6 Merge pull request #3066 from kaleb-himes/DOX_UPDATES
Update v23 methods to reflect TLSv1.3
2020-06-26 10:59:04 -05:00
1c1ddaa6c2 Added checks to initial returns and free rng 2020-06-25 16:40:38 -07:00
a10500e5a7 Merge pull request #3079 from tmael/sp_mod
Correct SP mod calculation
2020-06-26 08:38:07 +10:00
f6d26b4e81 Merge pull request #3072 from kaleb-himes/SANITY_CHECKS
ed25519 and ed448 check sigLen against expected
2020-06-26 08:31:55 +10:00
0c7b851bd3 restrict the cert version allowed 2020-06-25 15:45:18 -06:00
e2afbae6aa Merge pull request #3054 from JacobBarthelmeh/CRL
fix for x509 store add crl
2020-06-25 09:52:12 -07:00
26f0a74d29 Merge pull request #3023 from kaleb-himes/GH2998-REWORK
cleanup GET messages
2020-06-25 10:22:09 -06:00
73c26c5188 Merge pull request #3078 from dgarske/dup_defines
Remove duplicate macros in VS user_settings.h files.
2020-06-25 09:09:30 -07:00
17466727b2 Implement peer review feedback 2020-06-25 09:43:22 -06:00
4dbdfdea08 Merge pull request #3077 from kaleb-himes/ZD10235_CONFIG
configure.ac change == to = when not C code
2020-06-25 08:21:01 -07:00
60d6f616c2 Fix typo 2020-06-25 08:06:14 -07:00
a8f5602e10 Correct mod calculation 2020-06-25 08:01:05 -07:00
fe7d9ea7c1 changed RNG to WC_RNG 2020-06-24 15:40:58 -07:00
79981e3cf7 Added additonal tests to curve448.c 2020-06-24 15:40:38 -07:00
86b7f18502 Added additional tests to curve448.c through api.c 2020-06-24 15:40:22 -07:00
a10ee78980 Remove duplicate macros in VS user_settings.h files. 2020-06-24 15:08:49 -07:00
07c5f36d6d Merge pull request #3068 from SparkiDev/modexp-cr
Use temp with mont mul in constant time exptmod
2020-06-24 13:19:06 -07:00
308562e853 configure.ac change == to = when not C code 2020-06-24 13:41:03 -06:00
483b970772 Merge pull request #3061 from embhorn/zd10457
Remove multiple defines of GEN_IPADD
2020-06-24 11:33:16 -06:00
fdce5152c5 Address peer feedback 2020-06-24 11:25:12 -06:00
9cd6f92d19 Merge pull request #3058 from JacobBarthelmeh/Certs
Fix and test case for malformed name constraint
2020-06-24 10:15:08 -07:00
b8b2f7ef7d vs build warning fixes 2020-06-24 10:57:31 -06:00
be5648986c Update TLS 1.3 function Doxygen documentation
Give parameters a name in function prototypes.
2020-06-24 12:35:47 +10:00
23ddc1c4c2 Merge pull request #3067 from SparkiDev/tls13-test-fix
Cleanup after TLS 1.3 tests
2020-06-23 17:35:48 -06:00
722961f55c ed25519 and ed448 check sigLen against expected 2020-06-23 17:32:00 -06:00
ec755f8dd9 Override CRL error for NO_VERIFY 2020-06-23 18:09:03 -05:00
582240a84d Merge pull request #3051 from embhorn/zd10451
Sanity check wc_ecc_import_raw x, y, and key
2020-06-24 08:52:10 +10:00
55bb95823c coding template 2020-06-24 07:31:20 +09:00
8511d07698 store chain is free'd when store is free'd 2020-06-23 15:42:32 -06:00
ae90119af4 remove double free in test case 2020-06-23 14:45:31 -06:00
7cc64377d0 Sanity check wc_ecc_import_raw x, y, and key 2020-06-23 08:54:47 -05:00
1253be0142 Remove user_setting.h and user-mutex.c example files 2020-06-23 17:30:03 +09:00
e8e455bf39 Add section to asm files to avoid exe stack
For Linux ELF need a note section for GNU to indicate stack is not
executable.
2020-06-23 11:58:46 +10:00
7c615967a9 Use temp with mont mul in constant time exptmod
For cache attack resistance.
2020-06-23 10:45:31 +10:00
392e09c474 Cleanup after TLS 1.3 tests
Make sure the server is dead after each test.
Client may not connect to server if cipher suite not supported and
return error as expected.
2020-06-23 09:14:51 +10:00
5b07905818 Merge pull request #3065 from dgarske/sp_revert
Fix SP cache resistant build (reverts part of PR 2970)
2020-06-23 08:42:00 +10:00
877b9975eb Merge pull request #3064 from dgarske/dox_sni
Fixes for dox SNI documentation / examples.
2020-06-22 13:38:41 -07:00
180439ca34 Merge pull request #3060 from dgarske/git3059_cryptocell
Fixes for CryptoCell
2020-06-22 13:37:37 -07:00
93bd0dbfe1 Merge pull request #2980 from dgarske/psoc6
Fix for `WOLFSSL_ALT_CERT_CHAINS` with long chain
2020-06-22 13:36:35 -07:00
646ecb54c2 Update v23 methods to reflect TLSv1.3 2020-06-22 12:04:16 -06:00
a29250e87d Revert SP changes in https://github.com/wolfSSL/wolfssl/pull/2970 that broke --enable-sp CFLAGS="-DWOLFSSL_SP_CACHE_RESISTANT". This was generated with latest scripts. 2020-06-22 07:56:54 -07:00
6ecb88da47 Fixes for dox SNI documentation / examples. 2020-06-22 07:37:04 -07:00
b88342eeaf memory handling fixes 2020-06-19 10:08:42 -07:00
22d6774966 Merge pull request #2909 from SKlimaRA/SKlimaRA/crl-and-pkcb
ParseCrl fix, GetPrivateKeySigSize moved from client only section and Coverity fixes.
2020-06-19 10:51:50 -06:00
771d60c085 Replaced some hard-tabs with spaces in wc_curve25519_export_key_raw_ex() 2020-06-19 13:40:16 +09:00
6b1a6309ce Fixes for CryptoCell. Fix for signature wrapper signing to allow larger signing input buffer. Cleanup of some duplicate code. Fix for bad cryptocell ECC make key result check (-9628). Fixes #3059. Thanks Sylwester. 2020-06-18 13:40:30 -07:00
a5664b5ba9 Remove multiple defines of GEN_IPADD 2020-06-18 15:40:22 -05:00
f8c6c783db Merge pull request #3047 from SparkiDev/curve448_dox
Add Doxygen documentation for Curve448/Ed448
2020-06-18 13:05:59 -07:00
352328348a For example client "-H verifyFail", which was not setting the verify callback. 2020-06-18 12:54:47 -07:00
823b3d90d8 Add braces around new debug message to avoid compiler warning. 2020-06-18 12:12:28 -07:00
248b8c9b62 Merge pull request #3057 from kaleb-himes/FIPSv2_plus_OPENSSLALL
Resolve issues with FIPSv2 when opensslall set
2020-06-18 10:12:06 -07:00
48cd6f36ff Merge pull request #2967 from dgarske/ecc_null
Fixes for ECC key import
2020-06-18 10:10:49 -07:00
1e431e1ade add test case and fixes from review 2020-06-18 10:57:25 -06:00
667d9ca896 Fix to catch the issue in this PR with alt cert chains, which only happens if the verify callback is used and the chain is long enough. Cleanup of the myVerify callback to allow specific actions. Fix the suites.c to not crash if no newline at end of file. Added helpful debug message to show that a CA was found. 2020-06-18 09:26:50 -07:00
efa169e595 Fix for invalid files in include.am. Improvement to new alt-chain tests to catch case this PR fixes. 2020-06-18 08:33:59 -07:00
d70f6b7ede Fix for tests/test-chains.conf with new intermediate CA. 2020-06-18 08:33:59 -07:00
9be61c61f5 Add alternate chain test case where peer presents chain (INT -> INT2 -> PEER) and only INT2 is loaded as trusted. Update existing alternate chain partial test cases to use INT2. Fix for test suite to allow extra newlines in .test files. 2020-06-18 08:33:59 -07:00
5a5bc34aa5 Added second intermediate CA to testing certs. This creates a chain that looks like: ROOT (www.wolfssl.com) -> INT (wolfSSL Intermediate CA) -> INT2 (wolfSSL Intermediate2 CA) -> PEER (wolfSSL Client Chain / wolfSSL Server Chain). 2020-06-18 08:33:59 -07:00
0ef5a3d00e Fix for WOLFSSL_ALT_CERT_CHAINS incorrectly failing on success case. 2020-06-18 08:33:59 -07:00
21e0f863b9 Fix for NO_WOLFSSL_SERVER typo. 2020-06-18 08:33:58 -07:00
03c5359fcd Add session resumption testing for DTLS 2020-06-18 14:18:02 +02:00
b590e06f42 DTLS fixes
- `SendFinished` resetting`dtls_expected_peer_handshake_number` should depend on side and if we are resuming a connection
- No need to do a cookie exchange on session resumption
2020-06-18 12:13:52 +02:00
28819bd45e Made two lines wrap around in test_wc_curve25519_export_key_raw_ex() 2020-06-18 12:25:21 +09:00
a855d6355e Added cleanup to test_wc_curve25519_export_key_raw_ex 2020-06-18 12:25:21 +09:00
1d98c960cf Added resetting size info output-buffer before calling export APIs
Added resetting size into output-buffer before calling export APIs
2020-06-18 12:24:03 +09:00
13753d56bb Cleanup in wc_ecc_sign_hash_ex for blinding value to not call free twice (mp_clear already does mp_free). 2020-06-17 17:11:54 -07:00
0fd5eda5af Fix for test_wolfSSL_DTLS_either_side, which was not properly free'ing in error case. Improves the test shared context logic to make it explicit. 2020-06-17 17:08:09 -07:00
220e2634af Merge pull request #3056 from dgarske/nullcipher_noaes
Fixes for a few build edge cases (async w/o DTLS, null cipher w/o AES)
2020-06-17 16:48:48 -07:00
f20a2de284 Merge pull request #3055 from dgarske/ocsp_resp
Fix for possible use of NULL in the OCSP response nonce
2020-06-17 16:45:53 -07:00
3acc31400c Merge pull request #3053 from SparkiDev/ed448_fixes
Fix ED448 calls to use context and correct variable name
2020-06-17 16:41:40 -07:00
dafd35e4c1 remove unused variable 2020-06-17 15:55:08 -06:00
f75659641a test on malformed name constraint 2020-06-17 14:33:10 -06:00
e2fb4c55b8 Resolve issues with FIPSv2 when opensslall set 2020-06-17 14:03:02 -06:00
3fb432cef8 Fix for building async without DTLS. 2020-06-17 11:20:08 -07:00
81892f4594 Fix for use of WC_MAX_SYM_KEY_SIZE in macro. Fixes build case with --enable-nullcipher --disable-aes. 2020-06-17 11:16:33 -07:00
0a38ab8ac2 Fix for possible use of NULL is the OCSP response nonce. This is optional and may not be provided in the OCSP response and should be skipped if not set in the response. ZD 10475. 2020-06-17 11:00:05 -07:00
82921f8650 fix for x509 store add crl 2020-06-17 11:30:18 -06:00
b1aa903c1b Merge pull request #3052 from julek-wolfssl/infinite-loop-fuzzer
Alert level must be cleared or ProcessReply will loop indefinitely
2020-06-16 18:55:15 -06:00
6bb73fb25d Fix ED448 calls to use context and correct variable name
Added basic test of OpenSSL compatability APIs:
  - wolfSSL_ED25519_generate_key
  - wolfSSL_ED25519_sign
  - wolfSSL_ED25519_verify
  - wolfSSL_ED2448_generate_key
  - wolfSSL_ED448_sign
  - wolfSSL_ED448_verify
2020-06-17 10:05:50 +10:00
90caeaf925 Alert level must be cleared or ProcessReply will loop indefinitely 2020-06-16 23:21:54 +02:00
7c6dccd4a0 Merge pull request #3038 from embhorn/zd10457
Unused var error
2020-06-16 14:10:54 -06:00
7a15639927 Add Doxygen documentation for Curve448/Ed448
Update Curve25519/Ed25519 Doxygen documentation too.
Make public key is a public API - check pubKey pointer is not NULL.
2020-06-16 22:16:13 +10:00
b9f13dba61 Merge pull request #3030 from TakayukiMatsuo/usertime
ASN1_TIME_new in correct macro condition
2020-06-15 17:49:44 -05:00
aa7168df0b Merge pull request #3045 from SparkiDev/aes_small_fix
AES small table fix
2020-06-15 14:19:09 -07:00
096d0073ef Merge pull request #3043 from dgarske/renesas_ra6m3
Renesas requested name change to "RA6M3"
2020-06-15 14:18:19 -07:00
9d932d09bf Merge pull request #3042 from dgarske/xcode_updates
Updates to Xcode projects to add new files / features
2020-06-15 14:16:14 -07:00
74098340ff Merge pull request #3031 from dgarske/stm32cubeide
Adding STM32CubeIDE support
2020-06-15 14:14:43 -07:00
f020b0f24a add check on decode subtree return value 2020-06-15 14:41:05 -06:00
3f344b7d89 AES small table fix
Symbol not needed when only compiling AES algorithms (AES-GCM, AES-CCM,
AES-CTR) not using AES decrypt.
Allow AES-CCM to be compiled without AES-GCM.
2020-06-15 14:46:39 +10:00
8ff1b474bc Tentative: User defined mutex 2020-06-14 07:12:13 +09:00
baaf741c79 Merge pull request #3037 from JacobBarthelmeh/CSharp
add peer certificate print to callback with C#
2020-06-12 13:32:50 -07:00
1e07563411 Merge pull request #2984 from julek-wolfssl/dtls-scr
Add secure renegotiation to DTLS 1.2
2020-06-12 11:22:55 -07:00
6166902f66 Merge pull request #2990 from julek-wolfssl/fix-leak
Fix leak in SetIndividualInternal
2020-06-12 11:17:40 -07:00
4c2dee77d8 Merge pull request #3028 from julek-wolfssl/CRYPTO_memcmp
Implement CRYPTO_memcmp
2020-06-12 11:16:18 -07:00
eea22eb65d Renesas requested name change to "RA6M3". 2020-06-12 10:58:20 -07:00
d43d75bf81 Updates to xcode projects to add new files.
Ran updated iPhone X benchmarks:

```
RNG                330 MB took 1.010 seconds,  326.879 MB/s
AES-128-CBC-enc    920 MB took 1.005 seconds,  915.507 MB/s
AES-128-CBC-dec   6095 MB took 1.000 seconds, 6092.130 MB/s
AES-192-CBC-enc    820 MB took 1.000 seconds,  819.644 MB/s
AES-192-CBC-dec   4860 MB took 1.001 seconds, 4855.794 MB/s
AES-256-CBC-enc    710 MB took 1.005 seconds,  706.419 MB/s
AES-256-CBC-dec   3935 MB took 1.001 seconds, 3930.830 MB/s
AES-128-GCM-enc   1245 MB took 1.003 seconds, 1241.589 MB/s
AES-128-GCM-dec    575 MB took 1.001 seconds,  574.547 MB/s
AES-192-GCM-enc   1235 MB took 1.001 seconds, 1234.343 MB/s
AES-192-GCM-dec    570 MB took 1.003 seconds,  568.521 MB/s
AES-256-GCM-enc   1230 MB took 1.003 seconds, 1226.034 MB/s
AES-256-GCM-dec    570 MB took 1.001 seconds,  569.199 MB/s
3DES                10 MB took 1.386 seconds,    7.213 MB/s
MD5                 95 MB took 1.037 seconds,   91.629 MB/s
SHA                 80 MB took 1.013 seconds,   78.943 MB/s
SHA-256           1625 MB took 1.000 seconds, 1624.565 MB/s
SHA3-224            60 MB took 1.010 seconds,   59.399 MB/s
SHA3-256            60 MB took 1.073 seconds,   55.921 MB/s
SHA3-384            45 MB took 1.042 seconds,   43.195 MB/s
SHA3-512            35 MB took 1.164 seconds,   30.063 MB/s
HMAC-MD5            95 MB took 1.044 seconds,   91.014 MB/s
HMAC-SHA            80 MB took 1.007 seconds,   79.480 MB/s
HMAC-SHA256       1705 MB took 1.001 seconds, 1703.126 MB/s
RSA     2048 public      32800 ops took 1.003 sec, avg 0.031 ms, 32716.405 ops/sec
RSA     2048 private      1200 ops took 1.041 sec, avg 0.868 ms, /33 ops/sec
DH      2048 key gen      2354 ops took 1.000 sec, avg 0.425 ms, 2353.254 ops/sec
DH      2048 agree        2500 ops took 1.013 sec, avg 0.405 ms, 2467.525 ops/sec
ECC      256 key gen     46503 ops took 1.000 sec, avg 0.022 ms, 46502.069 ops/sec
ECDHE    256 agree       14100 ops took 1.005 sec, avg 0.071 ms, 14034.697 ops/sec
ECDSA    256 sign        29600 ops took 1.003 sec, avg 0.034 ms, 29500.554 ops/sec
ECDSA    256 verify      11000 ops took 1.007 sec, avg 0.092 ms, 10921.516 ops/sec
```
2020-06-12 10:39:26 -07:00
f30eb0197b Merge pull request #3032 from JacobBarthelmeh/PKCS12
fix error checking when parsing a PKCS12 DER into an internal structure
2020-06-12 09:57:40 -07:00
2b5ed1564c add error function and print out 2020-06-12 09:45:23 -07:00
0f36cdf066 Unused var error 2020-06-12 10:43:01 -05:00
cab8dd3731 Ignore duplicate or out of order CCS message
Init variables since compiler complains they might be used without initialization.
2020-06-12 12:27:48 +02:00
ac028e551d Code Review 2020-06-12 11:36:43 +02:00
69802ed1a9 Missing ssl->heap in FreeBuildMsgArgs 2020-06-12 11:36:43 +02:00
3980d6117d Fix Jenkins 2020-06-12 11:36:43 +02:00
01b446f469 Fix SessionTicket length in unencrypted case 2020-06-12 11:36:43 +02:00
f2d2dadc89 ASYNC: Fix issues with TLS and DTLS 2020-06-12 11:36:43 +02:00
eb7a49a1d7 ASYNC: Working TLS SCR 2020-06-12 11:36:43 +02:00
a7c4d88876 ASYNC: Working AES128-SHA 2020-06-12 11:36:43 +02:00
7b604ad714 WIP 2020-06-12 11:36:43 +02:00
73105305cf WIP 2020-06-12 11:36:43 +02:00
a107688891 Fix asynchronous DTLS issue 2020-06-12 11:36:43 +02:00
d88f6f1156 DTLS test cases 2020-06-12 11:36:43 +02:00
4e60e4b3b7 DTLS Message Grouping
Flush output buffer when we suspect that the grouped messages may exceed MTU.
2020-06-12 11:36:43 +02:00
d2542dcf38 Restore StoreKeys functionality for TLS case 2020-06-12 11:36:43 +02:00
c2ca9f614e Jenkins tests fixes 2020-06-12 11:36:43 +02:00
eb910a64d0 Comments and formatting 2020-06-12 11:36:43 +02:00
651a7a97b9 Add secure renegotiation to DTLS 1.2
- Hash of fragmented certificate was not calculated as a single message and instead we were hashing individual fragments which produced the wrong digest, shared secret, etc...
- Reset handshake number after server Finished packet is sent or received (depending on side)
- Reserve space in buffer for cipher stuff
- Take `DTLS_RECORD_EXTRA` and  `DTLS_HANDSHAKE_EXTRA` into size and offset calculations for DTLS path
- Fix renegotiation in DTLS with AES128-SHA
- Fix renegotiation in DTLS with AES-GCM
- Support HelloVerify request during secure renegotiation
- Save renegotiation handshake messages for retransmission in timeout
- Handle cipher parameters from different epochs. DTLS may need to resend and receive messages from previous epochs so handling different sets of encryption and decryption parameters is crucial.
2020-06-12 11:36:43 +02:00
255cc016b3 Merge pull request #3034 from kaleb-himes/FORUM_DSA_ISSUE
Seperate QT and DSA dependencies
2020-06-11 15:40:12 -07:00
ad7e636e34 Adds STM32H7 support. Tested on NUCLEO-H753ZI board.
STM32H753ZI at 480MHz

```
Running wolfCrypt Benchmarks...
------------------------------------------------------------------------------
 wolfSSL version 4.4.1
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG                250 KB took 1.047 seconds,  238.777 KB/s
AES-128-CBC-enc      4 MB took 1.004 seconds,    3.623 MB/s
AES-128-CBC-dec      4 MB took 1.004 seconds,    3.623 MB/s
AES-192-CBC-enc      4 MB took 1.000 seconds,    3.613 MB/s
AES-192-CBC-dec      4 MB took 1.000 seconds,    3.613 MB/s
AES-256-CBC-enc      4 MB took 1.000 seconds,    3.613 MB/s
AES-256-CBC-dec      4 MB took 1.000 seconds,    3.613 MB/s
AES-128-GCM-enc      3 MB took 1.004 seconds,    3.380 MB/s
AES-128-GCM-dec      3 MB took 1.004 seconds,    3.356 MB/s
AES-192-GCM-enc      3 MB took 1.004 seconds,    3.380 MB/s
AES-192-GCM-dec      3 MB took 1.003 seconds,    3.359 MB/s
AES-256-GCM-enc      3 MB took 1.000 seconds,    3.369 MB/s
AES-256-GCM-dec      3 MB took 1.004 seconds,    3.356 MB/s
CHACHA             850 KB took 1.020 seconds,  833.333 KB/s
CHA-POLY           650 KB took 1.015 seconds,  640.394 KB/s
POLY1305             4 MB took 1.004 seconds,    4.037 MB/s
SHA-256              3 MB took 1.004 seconds,    3.088 MB/s
HMAC-SHA256          3 MB took 1.004 seconds,    3.015 MB/s
RSA     2048 public         78 ops took 1.023 sec, avg 13.115 ms, 76.246 ops/sec
RSA     2048 private         4 ops took 1.682 sec, avg 420.500 ms, 2.378 ops/sec
DH      2048 key gen         6 ops took 1.165 sec, avg 194.167 ms, 5.150 ops/sec
DH      2048 agree           6 ops took 1.165 sec, avg 194.167 ms, 5.150 ops/sec
ECC      256 key gen        96 ops took 1.004 sec, avg 10.458 ms, 95.618 ops/sec
ECDHE    256 agree          50 ops took 1.027 sec, avg 20.540 ms, 48.685 ops/sec
ECDSA    256 sign           64 ops took 1.000 sec, avg 15.625 ms, 64.000 ops/sec
ECDSA    256 verify         32 ops took 1.039 sec, avg 32.469 ms, 30.799 ops/sec
Benchmark complete
Benchmark Test: Return code 0
```
2020-06-11 15:17:29 -07:00
3b86a4db20 Adding STM32CubeIDE support (and deprecation of OpenSTM32).
* Updated example to add support for CMSIS v2 and static memory.
* Improved example to support more build options.
* Added support for detecting Cube HAL and including `wolfSSL.wolfSSL_conf.h`.
2020-06-11 14:45:17 -07:00
d97c23edd8 set dynamic flag 2020-06-11 12:46:21 -07:00
6af052faae add peer certificate print to callback 2020-06-11 10:57:26 -07:00
cc13c9f062 Merge pull request #3035 from ejohnstown/changelog
Fix changelog error
2020-06-11 10:19:10 -05:00
29bdc7d8b5 Merge pull request #3015 from tmael/cov-fix
Coverity fix in wolfSSL 4.4.0
2020-06-10 17:07:47 -07:00
f7c233af9c Fix error in the changelog. AES-CTR with AES-NI wasn't actually added. 2020-06-10 15:15:11 -07:00
d5577c9404 Explicit convert 2020-06-10 18:43:27 +02:00
2fe08e1951 Update comment
Thanks @dgarske, great catch!
2020-06-09 17:10:57 -06:00
80e888c1c8 Seperate QT and DSA dependencies 2020-06-09 16:47:35 -06:00
fb51a2298e Merge pull request #3019 from kaleb-himes/ZD10380
init components as best practice
2020-06-09 17:23:55 -05:00
e993cb6cc0 Merge pull request #2942 from dgarske/tls13_on
Enable TLS v1.3 by default
2020-06-09 13:30:02 -07:00
48783c1982 Merge pull request #2996 from dgarske/stm32hal
Fixes and improvements for STM32 crypto hardware
2020-06-09 13:24:27 -07:00
c023efb2aa Merge pull request #3025 from JacobBarthelmeh/Compatibility-Layer
fix macro to match *_FLAGS_*
2020-06-09 13:19:29 -07:00
7a7bfce565 Merge pull request #3026 from cconlon/selftestfixes
Fix warnings with NetBSD gcc compiler
2020-06-09 13:18:44 -07:00
ef742c4a42 Merge pull request #3027 from danielinux/psoc6_crypto
Cypress PSoC6 wolfcrypt driver
2020-06-09 13:17:37 -07:00
8fc908989a Merge pull request #3029 from SparkiDev/aes-ccm-fix
Fix optimized AES-CCM - counter
2020-06-09 13:13:42 -07:00
3a430522da fix error checking when parsing a PKCS12 DER into an internal structure 2020-06-08 14:23:40 -06:00
72360dee38 Also bring over openSSL headers 2020-06-08 11:39:06 -06:00
8b6b54603f Add STM32WB55 crypto hardware support for AES. 2020-06-08 08:48:59 -07:00
28913a276f Include GCM in latest FIPS and Windows build 2020-06-08 08:38:59 -07:00
5837c70e99 Support for STM32L5 PKA ECC sign/verify acceleration. 2020-06-08 08:37:55 -07:00
16c0160e63 Added support for STM32L5. 2020-06-08 08:37:55 -07:00
21a34bde8c Fix whitespace. 2020-06-08 08:37:55 -07:00
6f82f15d1b Performance improvements for STM32 AES CBC and GCM crypto hardware.
* AES CBC:
  - Do all blocks, not just one at a time.
* AES GCM:
  - Use local stack for authentication header if < block size.
  - Use hardware GHASH for all authentication header sizes.

Tested with STM32F437II (old/new Cube HAL/StdPeriLib), STM32F777ZI (CubeMX) and STM32L4A6ZG (CubeMX).
2020-06-08 08:37:55 -07:00
efe9da0994 Fix for STM32 crypto hash with WOLFSSL_SMALL_STACK_CACHE possible free of invalid pointer. 2020-06-08 08:37:55 -07:00
dff7c0fcfa Fix for hardware mutex protection in case where STM32 hardware acceleration is used for RNG or HASH only. 2020-06-08 08:37:55 -07:00
42ee313286 Fix for using WOLFSSL_SMALL_STACK_CACHE with STM32 SHA256 hardware acceleration. 2020-06-08 08:37:55 -07:00
8791573dfe Fix for building with NO_PUBLIC_GCM_SET_IV when ChaCha20/Poly1305 is enabled. Cleanup use of not used STD_PERI_LIB. 2020-06-08 08:37:54 -07:00
Tak
b883617c0d Moved wolfSSL_ASN1_TIME_new() to under #ifndef NO_ASN_TIME condition 2020-06-08 14:10:20 +09:00
d543e305f1 Fix optimized AES-CCM - counter
AES-NI optimized 4 block at a time was not incrementing counter
poprerly.
2020-06-08 10:48:19 +10:00
3af4316cfd Fix for session test with TLS v1.3 and session tickets not enabled. Cleanups in AddSession. 2020-06-05 13:33:03 -07:00
fb5c9e5268 Adjust static memory case with TLS v1.3 enabled. 2020-06-05 11:11:23 -07:00
3b8455fcd0 Fix for building without ECC and DH (TLS v1.3 cannot be enabled). 2020-06-05 10:26:32 -07:00
a75f83c9f2 Implement CRYPTO_memcmp 2020-06-05 16:44:12 +02:00
254dd9f823 Added new files to include.am 2020-06-05 15:28:49 +02:00
76ab8bfb6b Added psoc6 ECDSA verification support 2020-06-05 11:30:29 +02:00
b1947478bb Added support for SHA512 via psoc6 crypto 2020-06-05 11:30:29 +02:00
82520572b0 Initial support for psoc6_crypto (sha256 only) 2020-06-05 11:30:29 +02:00
dffc677561 Fix for TLS v1.3 with --enable-sniffer. 2020-06-04 16:42:40 -07:00
7879e83ae0 Fixes for building with ./configure --enable-tls13 --disable-rsa --disable-ecc --enable-psk. Fix to properly detect if missing a asymmetric key algorithm (required by TLS v1.3). 2020-06-04 16:31:19 -07:00
1d01b87741 Fix to detect if NO_CERTS / --disable-asn is used in scripts/tls13.test. 2020-06-04 16:08:08 -07:00
66fdc2c536 Disable TLS v1.3 if none of these are available "ECC, CURVE25519, CURVE448 or DH". 2020-06-04 15:31:19 -07:00
93be04f380 Can't send empty list for the client when sniffer is enabled or it will use AES128-SHA. 2020-06-04 15:31:18 -07:00
ad93813d75 Fix for expected failure case on client write. Resolves test-fails.con server TLSv1.3 fail on no client certificate test. 2020-06-04 15:31:18 -07:00
d4fdd1e590 Fix for TLS v1.3 test PSK callback to support cipher list. Add support for GetCipherSuiteFromName to accept a name ending with colon. 2020-06-04 15:31:18 -07:00
3b63e55a68 Fix for TLS v1.3 PSK tests work with additional cipher suites (not just TLS13-AES128-GCM-SHA256) and the echo server/client. 2020-06-04 15:31:18 -07:00
8823a581d0 Add PSK user context support (Fixes #2952.). 2020-06-04 15:31:18 -07:00
0228d1eeea Cleanups for the TLS v1.3 build requirements. Add check for TLS v1.3 call to EncodeSigAlg. 2020-06-04 15:31:18 -07:00
ab2afbd37b Allow the TLS 13 draft 18 build option and just use the final version. This allows the automated test scripts to pass. 2020-06-04 15:31:18 -07:00
4d8cf5b571 Fixes for building TLSv1.3 with FIPS v1 (no RSA PSS or HKDF). 2020-06-04 15:31:18 -07:00
8300754ecd Fix for "testsuite" with TLSv1.3 and --enable-sniffer. 2020-06-04 15:31:18 -07:00
ba8227bcf7 Fix for building TLS v1.3 with NO_WOLFSSL_CLIENT. 2020-06-04 15:31:18 -07:00
b417a76613 Fixes for build TLS v1.3 with NO_CERTS. 2020-06-04 15:31:18 -07:00
093d9981fb Disable fast-rsa if RSA PSS is enabled (not supported). 2020-06-04 15:31:18 -07:00
cd1c2d5fae Enable TLS v1.3 by default. Remove old TLS v1.3 draft build support. 2020-06-04 15:31:18 -07:00
ca9dc7d509 Fix for wc_ecc_import_unsigned failing if first private key byte is zero (Fixes #2950). Fix wc_ecc_is_point to return better code IS_POINT_E on failure (was returning -1). Improved ECC import API unit tests. Added WOLFSSL_VALIDATE_ECC_IMPORT and WOLFSSL_VALIDATE_ECC_KEYGEN to --enable-all. 2020-06-04 15:25:56 -07:00
3529d9a40d Merge pull request #3016 from kaleb-himes/FIPSv2-MAINTENANCE
New OpenSSL features relying on changes in module files must account for locked FIPS versions of those files
2020-06-04 15:08:17 -07:00
976db2545d Merge pull request #3007 from embhorn/zd10318
Fix OOB access in ParseCRL
2020-06-04 13:11:59 -06:00
23d1550439 Merge pull request #2989 from julek-wolfssl/openvpn
Additional OpenSSL compat layer stuff
2020-06-04 11:57:55 -07:00
b48699c1f0 Merge pull request #3022 from cconlon/jnisni
enable SNI by default for JNI/JSSE build
2020-06-04 11:07:56 -07:00
79465d70f7 Merge pull request #3020 from SparkiDev/tls13_psk_cr
TLS 1.3: Never send CertiifcateRequest when PSK
2020-06-04 11:07:22 -07:00
c8b87eab5f fix macro to match *_FLAGS_* 2020-06-04 11:53:46 -06:00
27f37df0e0 Update arduino script to reflect includes of inline files 2020-06-04 09:50:47 -06:00
2285071fbc Use old convention, consolidate assignments 2020-06-04 09:34:49 -06:00
923fc30043 Change to memcpy 2020-06-03 17:36:40 -06:00
8c3f7a77ca cleanup GET messages 2020-06-03 16:53:36 -06:00
5a4d84ecad Consolidate to one-line where possible 2020-06-03 16:19:34 -06:00
c3407e2052 Merge pull request #3004 from SparkiDev/asn1_int_lead_0_any
Define to allow badly formed ASN integers
2020-06-03 14:55:04 -07:00
4ddbe546a3 Merge pull request #2993 from dgarske/math_fixes
Improvements around the ECC max bits calculation
2020-06-03 14:53:51 -07:00
4b10f6aa03 Update from review 2020-06-03 15:56:46 -05:00
0b9d06e529 return value from FailTestCallBack to prevent NetBSD noreturn warning 2020-06-03 14:45:31 -06:00
d000ceb495 Resolve Warnings 2020-06-03 13:42:37 -07:00
cafcaa4181 enable SNI by default for JNI/JSSE build 2020-06-03 14:24:10 -06:00
504b887851 fix NetBSD warnings in ASN1_INTEGER_set() tests around int max/min 2020-06-03 14:14:43 -06:00
1c1a01fffe rename dup to resolve NetBSD global shadow warnings 2020-06-03 14:11:12 -06:00
d220168384 Merge pull request #3017 from kojo1/supplicant-error
alertWhy: unknown_ca for ASN_NO_SIGNER_E
2020-06-03 10:44:31 -05:00
6176f8537f Typecast to fix conversion loses 2020-06-02 22:06:14 -07:00
0d1ed9efc7 TLS 1.3: Never send CertiifcateRequest when PSK
Server must not send a CertificateRequest when authenticating with a
PSK.
Increase the max size of the signature algorithms as ED448 has been
added.
2020-06-03 12:48:31 +10:00
d5241bbcc6 Coverity fix 2020-06-02 15:35:27 -07:00
8cd92f68f2 init components as best practice 2020-06-02 14:28:50 -06:00
dc1472692a Merge pull request #3011 from dgarske/nomalloc
Fixes for using static memory with no malloc
2020-06-02 11:46:29 -07:00
c7331fa699 Merge pull request #3008 from embhorn/zd10320
Fix possible NULL dereference error in TLSX_SecureRenegotiation_Parse
2020-06-02 11:13:17 -07:00
6ab5f2d9d7 remove unused variables 2020-06-01 17:56:03 -06:00
0604e7d208 no priv or pub in dhKey struct in FIPS 2020-06-01 17:36:27 -06:00
bc02f2c74e Revert GCM_NONCE_MID_SZ changes 2020-06-01 17:13:23 -06:00
6217118ee4 Account for unmodifiable FIPS module files when adding new OpenSSL functionality 2020-06-01 16:28:32 -06:00
5bcd121ab5 alertWhy: unknown_ca for ASN_NO_SIGNER_E 2020-06-02 05:54:16 +09:00
b947f69f60 Fix to correct SP 4096-bit enable. Correct nonexistent WOLFSSL_SP_NO_4096, which should be WOLFSSL_SP_4096. 2020-06-01 10:49:08 -07:00
bfe1760c17 Improvements to the ECC max bits calculation used with fast math (USE_FAST_MATH and ALT_ECC_SIZE). Updated example code comments to reflect accurate calculation. 2020-06-01 10:48:52 -07:00
9c73a4bdbc Merge pull request #3009 from embhorn/zd10358
Fix OOB access in RsaUnPad
2020-06-01 09:29:10 -07:00
aeefc09579 Merge pull request #3013 from miyazakh/fix_espidf_buildfail
fix build failrue on esp-idf
2020-06-01 09:56:29 -06:00
5f783f0198 fix build failrue on esp-idf 2020-05-30 15:19:37 +09:00
63a1ccda9b Merge pull request #3012 from SparkiDev/ecc_mulmod_fix
Fix ecc mulmod to only do one more bit than modulus len
2020-05-29 13:07:18 -07:00
2ee8f335b7 Merge pull request #2992 from SparkiDev/tls13_enc_alert_2
Actually make TLS 1.3 alerts encrypted when possible
2020-05-29 13:04:49 -07:00
2eb9e05518 Fix ecc mulmod to only do one more bit than modulus len 2020-05-29 11:21:37 +10:00
e498e07390 Merge pull request #3005 from cconlon/608a
ATECC608A improvements for use with Harmony 3 and PIC32MZ
2020-05-28 16:10:39 -07:00
10a1cad2dc Fix for TFM _fp_exptmod_nct with WOLFSSL_NO_MALLOC. 2020-05-28 15:15:52 -07:00
fd51eecb4f Fix for using signature wrapper with WOLFSSL_NO_MALLOC. Improve wc_SignatureVerifyHash to use RSA verify inline. 2020-05-28 15:12:01 -07:00
7ce7d244f8 Fix for using static memory AES GCM test. 2020-05-28 15:12:01 -07:00
5962931b21 Merge pull request #2947 from SparkiDev/tls13_integ_fix
Fix TLS 1.3 integrity only for interop
2020-05-28 13:48:43 -07:00
5360783d7e Merge pull request #3003 from JacobBarthelmeh/Testing
fix for gcc 10+ error on snprintf
2020-05-28 13:28:30 -07:00
233a5ca6b8 Fix OOB access 2020-05-28 14:14:19 -05:00
4e8f5fce66 Fix NULL dereference error 2020-05-28 12:17:29 -05:00
91fb6216a9 Fix OOB access 2020-05-28 09:39:44 -05:00
99d8be4f4d Merge pull request #3002 from ejohnstown/bump-minor-ver
Bump Patch Version
2020-05-27 21:09:38 -07:00
3fec01c0aa Actually make TLS 1.3 alerts encrypted when possible
Pervious fix didn't work.
This time, if TLS 1.3 and encryption is on then it will encrypt the
alert.
2020-05-28 10:57:33 +10:00
8dee048b04 Define to allow badly formed ASN integers
Define: WOLFSSL_ASN_INT_LEAD_0_ANY
Allows positive integers to have a leading 0 byte.
DER/BER encoding specifies that leding 0 only on negative numbers
(highest bit of first octet set).
2020-05-28 08:50:21 +10:00
896fcd9aec add WOLFSSL_ATECC6088A, Trust&GO support, PIC32 HAL compatibility, 608A expansions 2020-05-27 16:49:29 -06:00
8ebd121cac add extern prototype for PIC32 pic32_time() 2020-05-27 16:46:40 -06:00
d8a6d16f72 add MICROCHIP_TCPIP_BSD_API for using Microchip TCP/IP with BSD API 2020-05-27 16:46:40 -06:00
b8e1fe666b include errno.h with MICROCHIP_PIC32 for GetLastError use 2020-05-27 16:46:40 -06:00
1cc9a8ffbf Merge pull request #3001 from DKubasekRA/DKubasekRA-fix-ctMask16LT
Reverted comparison in ctMask16LT
2020-05-28 08:24:48 +10:00
8e9f518caa fix for gcc 10+ error on snprintf 2020-05-27 16:20:39 -06:00
19fba3648c Bump Patch Version
1. Increase the patch level of the version number in configure.ac.
2. Added a template for the next version in ChangeLog.md.
3. Bumped version.h.
2020-05-27 10:11:58 -07:00
5ef738855c Reverted comparison in ctMask16LT 2020-05-27 10:43:36 +02:00
e388885407 Merge pull request #2997 from kaleb-himes/ZD10356
Fix a seg fault when cert not loaded prior to key check
2020-05-26 16:19:43 -07:00
c5ebf23c25 Merge pull request #2994 from JacobBarthelmeh/Xilinx
add additional sanity check on pointer before free
2020-05-26 16:18:58 -07:00
5179503e8f Merge pull request #2995 from julek-wolfssl/va-copy-check
Enable wolfSSL_BIO_vprintf on Windows
2020-05-26 08:58:05 -07:00
eed5943b6f Fix TLS 1.3 integrity only for interop
Make key size the size of the digest.
2020-05-25 16:02:53 +10:00
165fce7c57 Merge pull request #2988 from miyazakh/peakmem
added WOLFSSL_LEAVE for measuring peak memory script
2020-05-22 15:37:30 -06:00
53d2a17b43 Fix a seg fault when cert not loaded prior to key check 2020-05-22 15:03:11 -06:00
de61a8e5d3 Enable wolfSSL_BIO_vprintf on Windows
Enable wolfSSL_BIO_vprintf use with WOLFSSL_BIO_MEMORY and WOLFSSL_BIO_SSL on Windows with the HAVE_VA_COPY flag
2020-05-21 19:41:40 +02:00
d27c023dd9 Merge pull request #2983 from dgarske/stm_stdperilib
Fixes for building with STM32 StdPeriLib and CubeMX
2020-05-21 10:39:36 -07:00
cd1a50bfb6 add additional sanity check on pointer before free 2020-05-21 11:19:17 -06:00
a67e1fc2ad Fix implicit conversions 2020-05-21 13:20:42 +02:00
70c55ce30a Set offset in cipher struct 2020-05-21 12:51:23 +02:00
986c8f351c Fix leak in SetIndividualInternal
SetIndividualInternal should not do mp_init on mpi since it should have been zero'ed during allocation and if it isn't zero'ed then it must mean that memory has already been allocated to it
2020-05-20 20:34:45 +02:00
363b9528af Fix for STM32 AES only (L4) AES Decrypt Direct (ECB). 2020-05-20 11:23:14 -07:00
de4d2e6436 Fix for CubeMX HAL headerSize (older CubeMX HAL uses actual bytes, not multiple of 32-bit). Fix for GMAC case in STM32_CRYPTO_AES_ONLY. 2020-05-20 10:49:26 -07:00
a6f5bc84e6 Merge pull request #2987 from JacobBarthelmeh/Xilinx
Update for RSA calls to Xilsecure
2020-05-20 09:03:52 -07:00
516f329f23 Merge pull request #2975 from JacobBarthelmeh/Testing
init FP mutex on wolfCrypt init
2020-05-20 09:01:46 -07:00
19848076ec Merge pull request #2986 from kaleb-himes/ZD9610_REPORT2
Fix building with openssl extra x509 small writes to heap without alloc
2020-05-20 08:10:43 -07:00
5f7832909b BIO_new_mem_buf with negative len should take strlen of buf as len 2020-05-20 16:55:16 +02:00
4a85bf8108 Additional OpenSSL compat layer stuff
- Add X509_get0_notBefore and X509_get0_notAfter
- Implement EVP_PKEY_get0_DSA and DSA_bits
- OpenSSL_version now prints "wolfSSL $VERSION"
- Remove define guards in `wolfSSL_internal_get_version` as all protocols are defined regardless in `wolfssl/internal.h`and this function just returns the string description of the protocol
2020-05-20 16:55:16 +02:00
d09b947478 update for test case and sha3 2020-05-19 19:27:38 -06:00
03ed495f84 free temporary buffer 2020-05-19 19:27:29 -06:00
6a7a8fa5b7 updated RSA calls to Xilsecure 2020-05-19 19:27:21 -06:00
2033be9aed Fixes for building against older STM32 CubeMX HAL. 2020-05-19 17:42:36 -07:00
13e6462ea7 Fixes for build with STM32 Standard Periperal Library (StdPeriLib). 2020-05-19 17:42:36 -07:00
99ebae9f7c Merge pull request #2985 from cconlon/iarwarn
fix minor IAR warnings in test.c
2020-05-19 16:42:47 -07:00
08c02b037c Fix building with openssl extra x509 small writes to heap without alloc 2020-05-19 17:12:36 -06:00
0af4e76c40 Merge pull request #2978 from SparkiDev/curve448_cast
Curve448 - cast down
2020-05-19 15:55:32 -07:00
7901f74d0b Merge pull request #2977 from SparkiDev/tlsx_ks_ecc_fix
KeyShare ECC shift index range check
2020-05-19 15:49:41 -07:00
754c96965a Merge pull request #2974 from SparkiDev/tls13_enc_alert
If encryption setup, TLS 1.3 alerts encrypted
2020-05-19 15:48:54 -07:00
9efd9afdfb fix minor IAR warnings in test.c 2020-05-19 14:12:13 -06:00
45def39c18 Merge pull request #2972 from ejohnstown/portability
Script Portability
2020-05-18 14:53:27 -07:00
ba9fd89314 Script Portability
1. The openssl interop test script should check that it should run before
doing anything else.
2. The process to create a random port number was using a non-portable
option to the head command. Changed to use the od tool reading from
/dev/random.
3. Ran into a sed that doesn't use the -i option, so changed it to cp its
own bak file and sed from that.
2020-05-18 09:04:41 -07:00
adb3bdd26e Curve448 - cast down 2020-05-18 09:07:20 +10:00
5b918f7ace KeyShare ECC shift index range check 2020-05-18 08:49:38 +10:00
c4fee4ce38 Merge pull request #2969 from julek-wolfssl/fix-lut-cache
Fix LUT cache implementation
2020-05-15 15:15:18 -07:00
b615dbe9d5 add additional FP_ECC lock sanity check for case where wolfCrypt_Init is not called 2020-05-15 11:50:05 -06:00
684654cd25 Merge pull request #2962 from tmael/fips_solaris
FIPS on Solaris
2020-05-15 10:15:09 -07:00
bdddb00ebc Merge pull request #2973 from kaleb-himes/FIPS-OE6
for OE6 sp_arm32.c asm code is inlined in rsa.c and ecc.c
2020-05-14 10:55:54 -07:00
91bfa31f70 Merge pull request #2968 from dgarske/stm32_hal_v2
Fixes for STM32 CubeMX HAL with AES GCM
2020-05-14 10:55:04 -07:00
fbfb28d5ee Merge pull request #2926 from SparkiDev/tls13_failnocert
Fail when WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT set in TLS1.3
2020-05-14 10:53:18 -07:00
f894d4c0d2 FIPS on Solaris 2020-05-14 10:11:54 -07:00
24634a02c9 Fix comment 2020-05-14 10:54:45 +02:00
88b8ea04f6 Merge pull request #2971 from SparkiDev/sp_cortexm_comment
Fix SP Cortex-M ASM comments
2020-05-13 16:30:14 -07:00
902e3a2d97 Merge pull request #2970 from SparkiDev/sp_arm32_divw
Fix div word in SP ARM32
2020-05-13 16:29:31 -07:00
6f750c07b5 Merge pull request #2964 from SparkiDev/tls13down_tls12
Only check downgrade when TLS 1.2 and no flag set
2020-05-13 16:25:02 -07:00
1876fe1c22 init FP mutex on wolfCrypt init 2020-05-13 13:59:35 -07:00
0295b5ae3b If encryption setup, TLS 1.3 alerts encrypted 2020-05-13 16:14:47 +10:00
57756bfa8d Remove unused 4096-bit functions 2020-05-13 10:23:05 +10:00
9a8fc94181 for OE6 sp_arm32.c asm code is inlined in rsa.c and ecc.c 2020-05-12 16:28:39 -06:00
778b5dd9d5 Fixes for STM32 CubeMX HAL with AES GCM. Fix AES GCM authentication header size, which expects size as number of 32-bit values. Fix the authentication size round up logic. Fix to use software for authentication tag if authentication data size is not multiple of 4. Fix to ensure 32-bit aligned buffers are used. 2020-05-12 08:27:43 -07:00
786e21b107 Fix SP Cortex-M ASM comments 2020-05-12 23:28:39 +10:00
479b54e78e Fix div word in SP ARM32 2020-05-12 23:14:57 +10:00
3d2cbdd3e8 Fix LUT cache implementation
- Make sure that the cache is actually set (and not just depend on the LRU_count)
- test_wolfSSL_EC should also be run without ECC_SHAMIR
2020-05-12 13:48:59 +02:00
6c9a0e440e Merge pull request #2959 from dgarske/wpas_tiny
Added wpa_supplicant support with reduced code size option
2020-05-11 08:55:22 -07:00
ed4899dd91 Only check downgrade when TLS 1.2 and no flag set
The flag, SSL_OP_NO_TLSv1_2, indicates not to negotiate TLS v1.2.
2020-05-11 13:18:50 +10:00
7c98451f24 Merge pull request #2961 from kaleb-himes/WOLFSSL_EXAMPLES
Fix failing build for rsa_verify_only example
2020-05-11 09:31:31 +10:00
5dfc36d32a added WOLFSSL_LEAVE for measuring peak memory script 2020-05-09 17:03:17 +09:00
81dc0ac56f Merge pull request #2956 from tmael/hkdf
Check HKDF-Expand length of output <= 255*HashLen
2020-05-08 16:36:40 -06:00
82c86447e7 Fix failing build for rsa_verify_only example 2020-05-08 16:18:30 -06:00
51b5f84d00 Merge pull request #2938 from JacobBarthelmeh/Xilinx
add Xilinx Vitis 2019.2 example and update README
2020-05-08 15:05:19 -07:00
10aa8a4ffc Added support --enable-wpas=small for reduced code size when building against the WPA supplicant with EAP-TLS. This does not use OPENSSL_EXTRA, which helps reduce code size. 2020-05-08 13:38:26 -07:00
6b930d996c Merge pull request #2958 from julek-wolfssl/ASN_IP_TYPE-without-openssl
Support IP alternative subject name without OpenSSL
2020-05-08 13:27:27 -07:00
4a44b7b781 Merge pull request #2954 from SparkiDev/sp_rsa_pq_len
Only use SP for RSA private operations if P and Q half bits
2020-05-08 08:30:30 -07:00
b5886e0e37 Add option --enable-ip-alt-name
This commit adds the configure option `--enable-ip-alt-name` that enables support for the IP alternative subject name parsing in `wolfcrypt/src/asn.c:DecodeAltNames`.
2020-05-08 13:20:24 +02:00
b39e384cfd Review comment 2020-05-07 13:39:53 -07:00
cb0fb88e44 Merge pull request #2955 from JacobBarthelmeh/Testing
fix for scep build without aes
2020-05-07 08:44:39 -07:00
3ef7e588d2 Merge pull request #2932 from kaleb-himes/ZD10223
Fix building with one-side only tls13/dtls
2020-05-07 08:43:36 -07:00
943f6c4447 Merge pull request #2957 from SparkiDev/sp_c_cr_fix
SP C: Fix array size for cache resistant modexp
2020-05-07 06:26:39 -07:00
9e68de0fb7 Add test certs for ASN_IP_TYPE 2020-05-07 11:52:49 +02:00
b331804c27 SP C: Fix array size for cache resistant modexp 2020-05-07 10:00:14 +10:00
6619db580d fix for scep build without aes 2020-05-06 16:58:54 -06:00
2ab478f8fd Check length of output <= 255*HashLen 2020-05-06 15:47:39 -07:00
c4af5db4b9 Only use SP for RSA private operations if P and Q half bits 2020-05-07 08:46:48 +10:00
c962aa4181 add sprj file 2020-05-06 12:13:22 -07:00
be3c39ed1c Merge pull request #2948 from JacobBarthelmeh/SanityChecks
update armv8 aes gcm sanity checks
2020-05-06 10:31:09 -07:00
3b6b59cea0 add 2019.2 Xilinx example and update README
fix to remove xml extension

add missing project file

update project

update dist include

rm prj files
2020-05-06 09:54:06 -06:00
5e45767cc3 Merge pull request #2943 from JacobBarthelmeh/Testing
check on length of unwrap before memmove
2020-05-05 11:09:06 -07:00
0f6fef8384 update armv8 aes gcm sanity checks 2020-05-05 09:47:05 -06:00
74040c62af Merge pull request #2944 from dgarske/sp_cacheres
Fixes for C32/C64 SP math with `WOLFSSL_SP_CACHE_RESISTANT`
2020-05-05 10:43:00 +10:00
09bc460c2e Merge pull request #2946 from dgarske/gcc9
Fix for GCC9 warning
2020-05-05 10:29:56 +10:00
8161dfe3aa Fix for GCC9 warning.
```
src/tls.c:201:13: note: in expansion of macro 'XSTRNCMP'
  201 |         if (XSTRNCMP((const char*)sender, (const char*)client, SIZEOF_SENDER) == 0)
      |             ^~~~~~~~
In file included from src/tls.c:33:
./wolfssl/internal.h:4312:19: note: referenced argument declared here
 4312 | static const byte client[SIZEOF_SENDER] = { 0x43, 0x4C, 0x4E, 0x54 };
      |                   ^~~~~~
```
2020-05-04 15:07:28 -07:00
174b4d5159 Cleanup of SP with small stack. Expand support for WOLFSSL_SP_NO_MALLOC. Fix for evp.c when included directly. 2020-05-04 14:23:32 -07:00
df067b6781 Merge pull request #2919 from kaleb-himes/ZD10194
Fix for Freescale common examples that predated hardening warning
2020-05-04 13:43:07 -06:00
62d67c3da1 Don't need if not using TLS 1.2 2020-05-04 12:54:36 -06:00
da01961254 Merge pull request #2939 from JacobBarthelmeh/SanityChecks
sanity check on PemToDer type
2020-05-04 11:26:33 -07:00
d848495a66 Merge pull request #2937 from dgarske/wolfio_tcpcon_fd
Fix issue with failed TCP connect using invalid socket file descriptor
2020-05-04 11:22:54 -07:00
8e0f5ef8ce Fixes for WOLFSSL_SP_CACHE_RESISTANT with small stack. 2020-05-04 11:22:12 -07:00
c28ad38b16 Fix for cast issue caused by PR #2900. Applies to WOLFSSL_SP_CACHE_RESISTANT and c32/c64 versions only. 2020-05-04 10:49:59 -07:00
082e51d778 check on length of unwrap before memmove 2020-05-04 10:32:05 -06:00
9f735b4d6e sanity check on PemToDer type 2020-05-01 16:41:18 -06:00
3944c8eb73 Merge pull request #2935 from ejohnstown/hush-tfm
Hush TFM Warnings
2020-05-01 08:26:42 -07:00
31502ec3f9 Fix issue with failed TCP connect using invalid socket file descriptor on close. Fixes #2936 2020-05-01 07:32:00 -07:00
b6bd86d2b1 TFM Warnings
When building in VS, the MSC will complain about some constants getting
implicitly promoted to 64-bit. Added some type-casts to hush the warnings.
2020-04-30 19:43:18 -07:00
f772bc8d9a Merge pull request #2923 from dgarske/pic32mz
Fixes for PIC32MZ crypto hardware cache and large hash
2020-04-30 16:22:13 -07:00
df9dd3012f Merge pull request #2934 from SparkiDev/tls13_cookie_ks
TLS13: Prepend the SupportedVersions extension to list
2020-04-30 14:58:11 -07:00
a1489d981c Merge pull request #2930 from JacobBarthelmeh/SanityChecks
check on tag length for AES-CCM
2020-04-30 14:51:20 -07:00
7879d3762a TLS13: Prepend the SupportedVersions extension to list
Must have SupportedVersions at start of list for Cookie to be
constructed correctly.
Application can set the key share extension before handshake and
SupportedVersions will be added after. Extensions written in order of
adding to list.
Prepend SupportedVersions so that it will always appear in the correct
place so when reconstructing HelloRetryRequest, the extensions will
always be in the same order.
2020-04-30 08:46:23 +10:00
505fbed4df fix AES-CCM tag size check on decryption 2020-04-29 15:15:54 -06:00
7e267546cb Merge pull request #2933 from SparkiDev/tls13_rsa8192
Allow TLS 1.3 CertificateVerify to handle 8192-bit RSA
2020-04-29 11:24:44 -07:00
390f066028 Allow TLS 1.3 CertificateVerify to handle 8192-bit RSA 2020-04-29 12:37:41 +10:00
e9b433a998 Merge pull request #2928 from julek-wolfssl/evp-aes-gcm-fix
Fix AES-GCM in EVP layer to have compatiblity with OpenSSL
2020-04-29 09:00:04 +10:00
b73e52f33f move AES-CCM tag check into a local function 2020-04-28 14:46:06 -06:00
951cb4aaf4 Fix building with one-side only tls13/dtls 2020-04-28 14:33:00 -06:00
f770d28ff0 Merge pull request #2916 from dgarske/testfixes
Improvements to ECC key decode and tests
2020-04-28 09:57:44 -07:00
a585e4115e Merge pull request #2927 from SparkiDev/tls13_ccs
In TLS 1.3, don't allow multiple ChangeCipherSpecs in a row
2020-04-28 09:52:46 -07:00
cb6fc56f3b Merge pull request #2921 from dgarske/fixes_g++
Fixes for G++ and enable-all
2020-04-28 09:51:34 -07:00
c02c408409 Only 80 characters a line 2020-04-28 12:38:02 +02:00
a104caef13 Merge pull request #2929 from dgarske/sp_rsalowmem
Fix for SP math with `RSA_LOW_MEM` (ARM only)
2020-04-28 08:43:31 +10:00
c85a53c631 add macro guard for fips and selftest builds 2020-04-27 15:36:53 -06:00
6185e0f477 Remove execute bit on files. 2020-04-27 11:16:02 -07:00
327cdefc24 Fix for SP math with RSA_LOW_MEM, which was broken in PR #2892. 2020-04-27 08:59:54 -07:00
01a6dded72 Fix AES-GCM in EVP layer to have compatiblity with OpenSSL
- Tag checking in AES-GCM is done in Final call
- Reset `WOLFSSL_EVP_CIPHER_CTX` structure after Final call
- Don't zero `ctx->authTag` struct in Init call so that user can get the AES-GCM tag using `EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, AES_BLOCK_SIZE, tag)`
- `ctx->authTag` is only zeroed before authenticated, non-confidential data Update call since this means we are entering a new Udate-Final cycle. This doesn't need to be done in the decrypt case since the tag should be supplied by the user before the final call using `EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, AES_BLOCK_SIZE, tag)`
2020-04-27 15:52:01 +02:00
1e726e19a4 Fix for XMALLOC cast. 2020-04-27 06:48:41 -07:00
c153873337 Fail when WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT set in TLS1.3 2020-04-27 16:17:03 +10:00
df1b7f34f1 In TLS 1.3, don't allow multiple ChangeCipherSpecs in a row 2020-04-27 15:27:02 +10:00
3c93a7b757 Fix Value stored to 'ret' is never read. 2020-04-24 11:31:12 -07:00
a4caa42793 Improve the Base64 line size for NO_ASN case. Fix report of unread ret. 2020-04-24 11:26:55 -07:00
589712f870 PIC32MZ Fix for cache coherency to enable write-through (no write allocation) to resolve descriptor corruption. ZD 10212. 2020-04-24 09:13:28 -07:00
0f11369680 PIC32MZ Fix for WOLFSSL_PIC32MZ_LARGE_HASH: Only submit to hardware if update data provided matches expected. ZD 10211. 2020-04-24 09:01:51 -07:00
cfc0aeb857 Fix for RSA and KeyGen only in test.c. 2020-04-24 08:56:31 -07:00
41fc208195 Fixes for isHMAC checks. 2020-04-24 08:51:56 -07:00
5fa7bb5b9f Fix possible unused args. 2020-04-24 07:48:41 -07:00
6d025f8c0f Refactor of the EVP macType to use enum wc_HashType to resolve issues with invalid casting. 2020-04-24 07:43:44 -07:00
922ab1e944 Merge remote-tracking branch 'upstream/master' into branch-1 2020-04-24 18:00:29 +09:00
bcc408442b Added test cases for wc_curve25519_key_export_xx 2020-04-24 17:50:17 +09:00
28b686a8ca * Exposed useful sizes MAX_X509_HEADER_SZ and PEM_LINE_SZ
* Refactor the PEM saving code in `test.c`, so its not using large 4K buffer and calculates based on DER.
* Enable ECC key generation test even without `WOLFSSL_KEY_GEN`.
* Added `ECC_KEYGEN_SIZE` macro for ECC key generation testing.
* Refactor ECC DER key generation to use `ECC_BUFSIZE`.
2020-04-23 16:11:54 -07:00
81f959336b Added support for important private key DER using wc_EccPublicKeyDecode. Added ECC key generation and decode test case. 2020-04-23 16:07:43 -07:00
b07dfa425d Fixes for ./configure CC="g++" --enable-all && make. Resolves issues with implicit casts and use of reserved template keyword. 2020-04-23 15:26:04 -07:00
5376763638 Merge pull request #2913 from SparkiDev/sp_cortexm4_ecc
Improve performance of SP Cortex M asm
2020-04-23 09:47:05 -07:00
7318121d3a Merge pull request #2915 from dgarske/async_v4.4.0
Fixes for async release v4.4.0
2020-04-23 09:26:08 -07:00
54aa50e628 Merge pull request #2912 from SparkiDev/sp_movbe
Only use Intel instruction movbe when available
2020-04-23 09:25:02 -07:00
6132176715 Merge pull request #2917 from ejohnstown/postrelease
Minor wolfCrypt Test Fixes
2020-04-23 07:16:07 -07:00
7a0cbe084e Improve performance of SP Cortex M asm 2020-04-23 11:05:42 +10:00
a064cb3943 Fix a couple of wolfCrypt test issues found during the long release build test. 2020-04-22 11:30:57 -07:00
e116c89a58 Merge pull request #2906 from ejohnstown/release-rollup
Release Rollup
2020-04-22 10:43:44 -07:00
4592e0ec95 Fix for use of incorrect devId for wolfSSL_SHA3_256_Init. 2020-04-22 10:16:20 -07:00
88d04e5eeb Fix for NULL == NULL test case in test_wolfSSL_EC_get_builtin_curves. 2020-04-22 10:15:52 -07:00
36a556f927 Resolve issues with the openssl compatibility CRYPTO_malloc and CRYPTO_free. 2020-04-22 10:15:16 -07:00
12e4718c67 Fix for Freescale common examples that predated hardening warning 2020-04-22 11:06:36 -06:00
83152c767f touch dates 2020-04-21 10:50:59 -07:00
bf680b4a92 Fix for QAT with Shake256. Fix for XFREE missing semicolon. 2020-04-21 10:38:27 -07:00
7b6cc2056b Update release date in readme and changelog. 2020-04-21 10:21:59 -07:00
ccd096e1bb Memory Leak Fix
1. In `wolfSSL_d2i_DHparams()`, when setting the internal key on a
   WOLFSSL_KEY, set the flag inSet.
2. Not a leak, but in `wolfSSL_EVP_PKEY_set1_DH()`, only allocate one
   buffer to store the flat key. Saves an alloc, memcpy, and free.
2020-04-21 10:21:59 -07:00
61f3783111 Fixes to test.c for the following build configurations:
1. ./configure --disable-rsa --enable-certgen --enable-certreq
2. ./configure --disable-ecc --enable-pkcs7
2020-04-21 10:21:59 -07:00
c134626946 Update credit names on vuln notice in README. 2020-04-21 10:21:59 -07:00
087675e31e Update the RPM build spec. 2020-04-21 10:21:59 -07:00
4331b7df18 Update the VS library build resource. 2020-04-21 10:21:58 -07:00
bf4f50ab93 Add Azure Sphere file missing from release. 2020-04-21 10:21:58 -07:00
a29eac035b Update credit for vulnerability report. 2020-04-21 10:21:58 -07:00
836e77508d Remove notes for reverted DTLS commits. 2020-04-21 10:21:58 -07:00
7cbf496329 Encrypt key requirements check
The file wc_encrypt.c offers a function named wc_CryptKey(), which
requires PWDBASED and ASN. Added the check for ASN.
2020-04-21 10:21:58 -07:00
e84cd1a887 Updated the README file and ChangeLog for some spelling and omissions. 2020-04-21 10:21:58 -07:00
27011ff7ff Release Rollup
1. Update configure with the new version.
2. Update the ChangeLog.
3. Update the readme.
2020-04-21 10:21:53 -07:00
231c488ddf check on tag length for AES-CCM 2020-04-20 13:44:41 -06:00
0cfde0794b Merge pull request #2848 from julek-wolfssl/wpa-supplicant-openssl-compat
Added partial support for wpa_supplicant, hostapd, and cjose:
2020-04-20 12:17:55 -06:00
75c14e4c8e Only use Intel instruction movbe when available 2020-04-20 09:09:45 +10:00
f87f09fcd7 Merge pull request #2910 from embhorn/zd10169
Fix forbidden iv length 0 with AES-GCM
2020-04-16 16:01:03 -07:00
8112c81fc5 Added missing NO_CERTS check. 2020-04-16 23:30:11 +02:00
6b3642db36 Fix forbidden iv length 0 with AES-GCM 2020-04-16 13:48:56 -05:00
75deec250c Merge pull request #2908 from ejohnstown/dtls-revert
DTLS Revert
2020-04-16 09:58:48 -07:00
9918ee8b68 Merge pull request #2907 from SparkiDev/sp_arm64_reg
SP ARM64 - use fewer registers in mont_reduces
2020-04-16 09:58:07 -07:00
dd68074104 Fix merge issues 2020-04-16 10:09:15 +02:00
eab451339c Fixed dereference after null check. 2020-04-16 09:52:02 +02:00
83044d7560 Fixed dereference after null check. 2020-04-16 09:46:15 +02:00
40ea386509 Revert "DTLS Fix"
This reverts commit 04dcb8f774.
2020-04-15 21:33:33 -07:00
78a9185d0b Revert "DTLS Fuzz Fix"
This reverts commit 70d03f3ba0.
2020-04-15 21:33:27 -07:00
da5d9a923b SP ARM64 - use fewer registers in mont_reduces 2020-04-16 09:20:04 +10:00
36403c1dad Merge remote-tracking branch 'wolfSSL/master' into wpa-supplicant-openssl-compat 2020-04-15 16:55:03 +02:00
314ff1137b Fixed resource leak. 2020-04-15 16:29:11 +02:00
68a2e03bd4 Fixed resource leak. 2020-04-15 16:27:34 +02:00
1a80975d9e Fixed resource leaks. 2020-04-15 15:47:32 +02:00
e19334266e This function is required by HAVE_PK_CALLBACKS option and it's used by server as well. 2020-04-15 14:43:12 +02:00
74893edaf0 Fix of size constraint for parsing. 2020-04-15 14:36:36 +02:00
1d3fd5cd07 Code review
- make `wc_ecc_export_point_der_compressed` a local function
- use `int` for `shortKeySize` in `wc_ecc_import_point_der_ex`
- check for null return value from `wolfSSL_OBJ_nid2obj` and `wolfSSL_d2i_PUBKEY`
- add comments to `ssl.c`
- check `lnlen` in `wolfSSL_OBJ_ln2nid`
2020-04-15 12:53:38 +02:00
ebb490204a Merge pull request #2898 from embhorn/zd9856
Fix EVP API to return NID types / SHA3 for RSA sign
2020-04-14 16:09:00 -07:00
f97a56b9ce Merge pull request #2905 from ejohnstown/dtls-fuzz
DTLS Fuzz Fix
2020-04-14 14:19:09 -07:00
d9472b895f Fix conflicts after rebase 2020-04-14 15:24:52 -05:00
19ca00bcd4 Adding support for SHA3 in wolfSSL_RSA_sign_ex 2020-04-14 14:31:00 -05:00
1487917214 Fix EVP_MD_CTX_type to return NID 2020-04-14 14:27:21 -05:00
be437c0bd2 Fix EVP API to use NID instead of WC_ types 2020-04-14 12:47:10 -05:00
70d03f3ba0 DTLS Fuzz Fix
Only save a next epoch message if it is in the next epoch, not any future epoch.
2020-04-14 10:13:37 -07:00
9c1b90170a Merge pull request #2903 from SparkiDev/test_4096
Fix testing using 4096 bits keys and parameters
2020-04-14 09:25:00 -07:00
06c6e583c8 Merge pull request #2891 from julek-wolfssl/refactor-evp-functions
Move EVP functions to evp.c
2020-04-14 09:22:51 -07:00
a2892f66c0 Merge pull request #2889 from JacobBarthelmeh/SanityChecks
sanity check on input length before secure renegotiation compare
2020-04-14 09:21:29 -07:00
b6d6b1db77 Added new DH 4096-bit key to gencertbuf.pl. 2020-04-14 07:11:07 -07:00
dad0bc0159 Keep compatibility with old OPENSSL_EXTRA_X509_SMALL functions 2020-04-14 12:52:23 +02:00
0b3a331265 Revert wc_OBJ_sn2nid 2020-04-14 11:48:14 +02:00
0ded4d4ccb wolfSSL_RSA_*_PKCS1_PSS rewrite 2020-04-14 11:48:14 +02:00
89f7a51838 Add option to enable DPP support in wpa_supplicant (note DPP not yet supported as of this commit) 2020-04-14 11:48:14 +02:00
20e669a65a New API
Add `wc_ecc_import_point_der_ex` for correct importing DER ECC point and keep `wc_ecc_import_point_der` old functionality
2020-04-14 11:48:14 +02:00
dbe4e778d3 Test fixes
- Add `parameter` to `WOLFSSL_X509_ALGOR`
- Implement `wolfSSL_ASN1_TYPE_new`, `wolfSSL_ASN1_TYPE_free`, and `wolfSSL_ASN1_TYPE_set`
- Fix leak where `pval` in `wolfSSL_X509_ALGOR_set0` was lost if `aobj` was provided
2020-04-14 11:48:14 +02:00
18093a6b0b Code review changes
- Don't include `ENABLED_OPENSSLALL` with `ENABLED_WPAS`
- Return length in `wolfSSL_i2d_DHparams`
- Implement `wolfSSL_EC_POINT_mul` with independent multiplication and addition if `ECC_SHAMIR` not defined
- Implment `ASN1_SIMPLE` without `offsetof` by using a dummy struct
- Style fixes
2020-04-14 11:48:14 +02:00
9722082372 Fix nid2* and *2nid functions 2020-04-14 11:48:14 +02:00
eb549f7095 Test fixes 2020-04-14 11:45:32 +02:00
ef5eefac91 Test fixes 2020-04-14 11:45:32 +02:00
b4d9007a48 Test fixes
Config fixes
Fix windows FIPS
2020-04-14 11:45:32 +02:00
680a481e61 Test fixes
Remove redundant macros
2020-04-14 11:45:32 +02:00
9ced70edc1 Test fixes
Free `x509->key.pkey` in `FreeX509
Fix type conversions
Fix memory leaks and use of uninitialized memory
2020-04-14 11:45:32 +02:00
73b4d78d5b Added partial support for wpa_supplicant, hostapd, and cjose:
- Moved `SetECKeyInternal` and `SetECKeyExternal` to `internal.h` to allow usage outside of `ssl.c`
- Added `asn1t.h`
- Implemented the `IMPLEMENT_ASN1_FUNCTIONS` macro for a small subset of ASN1 tags
-- So far only `X509_ALGOR` and `ASN1_BIT_STRING` are supported
- Implemented `BN_mod_add` function
- Allow for setting of `EC_KEY` export form through EC_KEY_set_conv_form
- Implemented `i2o_ECPublicKey`
- Implemented `EC_POINT_copy`
- Implemented deriving DH and ECDH keys in `EVP_PKEY_CTX`. Functions added:
-- `EVP_PKEY_derive_init`
-- `EVP_PKEY_derive_set_peer`
-- `EVP_PKEY_derive`
- Implemented `EVP_PKEY_get0_DH`
- Implemented `X509_ALGOR_new`
- Implemented `X509_ALGOR_free`
- Implemented `X509_ALGOR_set0`
- Implemented `X509_PUBKEY_new`
- Implemented `X509_PUBKEY_free`
- Implemented `X509_PUBKEY_set`
- Implemented `RSA_padding_add_PKCS1_PSS`
- Implemented `RSA_verify_PKCS1_PSS`
- Changed second parameter of `wolfSSL_d2i_PUBKEY` to be constant
- Corrected long names in `asn.h`
- Added `wc_ecc_get_generator` as a way to get the generator point of a curve
- Added `wc_ecc_export_point_der_ex` to export an ECC point in compressed or uncompressed format with one API
- Added `wc_ecc_export_point_der_compressed` to export a point in an `ecc_point` structure in compressed DER format
- Added 'wc_RsaSSL_Verify_ex` which adds the option to choose a padding type
- Added `wc_RsaPad_ex` and `wc_RsaUnPad_ex` to `rsa.h` as `WOLFSSL_LOCAL` functions
- `CopyDecodedToX509` now fills `x509->key` and `x509->algor` when populating x509
- `wolfSSL_EVP_CipherInit` now uses `wc_AesGcmSetExtIV` to set the IV so that it is copied to `ctx->iv` by `wolfSSL_StoreExternalIV`
- Added error checking to `wolfSSL_EVP_PKEY_get_der`
- `wolfSSL_X509_ALGOR_get0` now attempts to return something in all parameters
- Refactored `wolfSSL_EC_KEY_new` to use `*_new` functions when available
- Added `setupPoint` to set the internal point if not yet set
- Always set external point in `wolfSSL_ECPoint_d2i`
- Added compressed point support to `wolfSSL_EC_POINT_point2oct`
- Fix `wolfSSL_EC_POINT_mul` so that it will calculate the full `generator * n + q * m` then OpenSSL does
- Added `WOLFSSL_RSA_GetRNG` helper function to get a `WC_RNG` from `WOLFSSL_RSA`
- Correct short names in `wolfssl_object_info`
- Added all currently supported curves to `wolfssl_object_info`
- Added `oidCurveType` to `oid2nid`
- Add more padding types to `wolfSSL_RSA_public_decrypt`
- Fix `keysize` in `wc_ecc_import_point_der`
- Added tests for new additions
2020-04-14 11:45:32 +02:00
ba401c9bde Fix testing using 4096 bits keys and parameters
RSA PKCS #1.5 padding for signing is not reliant on a random.
2020-04-14 12:03:51 +10:00
416f0775d3 Merge pull request #2900 from dgarske/sp_no_malloc
Added option to build SP small without malloc
2020-04-14 09:40:11 +10:00
3cb0c600ba Merge pull request #2894 from SparkiDev/ecc_cr_fix
Change constant time and cache resistant ECC mulmod
2020-04-13 16:36:22 -07:00
f309173518 Merge pull request #2899 from embhorn/zd9564
Adding check for invalid SAN ext with no entries
2020-04-13 15:31:06 -06:00
ee0289bea6 Merge pull request #2825 from julek-wolfssl/self-include-options
OpenVPN changes
2020-04-13 13:11:18 -07:00
aadec345ab Merge pull request #2871 from vaintroub/master
Fix clang warnings (issue #2870)
2020-04-13 09:02:51 -07:00
1f5a7bffaa Build fixes for WOLFSSL_NO_MALLOC in wolfCrypt test. 2020-04-13 07:39:06 -07:00
b01ce168ea Fixes for SP small with no malloc in sp_256_ecc_mulmod_10 and sp_384_ecc_mulmod_15. 2020-04-13 07:19:06 -07:00
4748254b60 Merge pull request #2896 from embhorn/zd9916
Fix wc_KeyPemToDer with PKCS1 and empty key
2020-04-10 15:38:07 -07:00
d412ccb6f8 Added new option WOLFSSL_SP_NO_MALLOC for building small SP without malloc. Added SP documentation. Added ./configure --enable-sp=yes,nomalloc supprt. https://github.com/wolfSSL/scripts/pull/79 2020-04-10 11:13:55 -07:00
8644fdca7d Update from review 2020-04-10 08:29:31 -05:00
ffd06e359f Change constant time and cache resistant ECC mulmod
Ensure points being operated on change to make constant time.
2020-04-10 09:28:20 +10:00
0a40bbe2a9 Merge pull request #2897 from ejohnstown/omit-omit
Omit -fomit-frame-pointer from CFLAGS
2020-04-09 16:01:34 -07:00
cf8459e518 Merge pull request #2892 from SparkiDev/cppcheck_fixes_4
Fixes from cppcheck
2020-04-09 16:01:11 -07:00
7d82c4e3f2 Adding check for invalid SAN ext with no entries 2020-04-09 16:49:52 -05:00
c3e0575914 Fix from review 2020-04-09 12:52:32 -05:00
f6b9b2e0eb Remove redundant guards 2020-04-09 18:26:23 +02:00
2bf9dc4037 Merge pull request #2895 from dgarske/qat_tls13
Fix for asynchronous TLS v1.3 issue
2020-04-09 09:25:36 -07:00
9cbbd164e0 Fix test errors 2020-04-09 14:54:09 +02:00
6621465433 Merge pull request #2890 from JacobBarthelmeh/Testing
set ChaCha counter state for TLS 1.3 AEAD
2020-04-09 10:28:50 +10:00
7a6de91296 Omit -fomit-frame-pointer from CFLAGS. 2020-04-08 14:06:11 -07:00
4d6e33b1dd Fix wc_KeyPemToDer with PKCS1 and empty key 2020-04-08 11:34:24 -05:00
97d798743a Merge pull request #2893 from SparkiDev/tls13_capable_fix
Another place where TLS 1.3 capable check is required
2020-04-08 09:09:19 -07:00
5e5af8e93a Fix for asynchronous TLS v1.3 issue where connect or accept state is incorrectly advanced when there is data to queued to send. 2020-04-08 07:26:21 -07:00
7001599782 Another place where TLS 1.3 capable check is required 2020-04-08 11:36:47 +10:00
411aee6e05 Fixes from cppcheck
Added PRIVATE_D version of rsa private key operation for SP
implementation for specific platforms.
WC_NO_RNG results in warnings when RNG calls don't do anything.
Added ifdef checks for variables not used otherwise.
Remove superfluous if statements like when checking ret == 0.
Change names of globals that are generic and are used locally before
global definition.
Remove definition of variable len that isn't used except as a
replacement for sz which is parameter.
Don't subtract two variables when one has just been assigned the value
of the other.
Fix shifting of signed value.
Fix parameter checking in aes.c and des3.c for platform specific code.
2020-04-08 09:46:22 +10:00
9e08efe8e0 Merge pull request #2885 from SparkiDev/sp_x64_ecc_tweak
Tweak the SP x86_64 ECC assembly
2020-04-07 14:27:12 -07:00
6e8d3f224d Merge pull request #2888 from SparkiDev/tls13_down_rand
Fix downgrade fixed random to match spec
2020-04-07 14:22:07 -07:00
690b546260 Merge pull request #2887 from dgarske/nodir
Fix for building with `NO_WOLFSSL_DIR`
2020-04-07 14:14:34 -07:00
b6f98a3cde Merge pull request #2886 from kaleb-himes/ZD10106
Avoid leak when HAVE_AESGCM and NO_AES_DECRYPT. Thanks to G.G. on ZD …
2020-04-07 14:13:43 -07:00
4c0ea10e45 Move EVP functions to evp.c 2020-04-07 22:36:50 +02:00
ebcf86070d Merge pull request #2883 from miyazakh/esp_aescounter
add aes counter on esp32
2020-04-07 13:24:53 -07:00
77b75ef3a2 Merge pull request #2881 from dgarske/ecc_asn
Fixes for building ECC without ASN
2020-04-07 13:09:37 -07:00
dec111722f Merge pull request #2880 from SparkiDev/tls_csr_ext_empty
GNU TLS server sends empty CSR extension
2020-04-07 13:08:21 -07:00
c002df4cce Merge pull request #2879 from ejohnstown/dtls-fix
DTLS Fix
2020-04-07 13:07:30 -07:00
154dd552e9 Merge pull request #2877 from SparkiDev/tls_hmac_trunc
Allow use of truncated HMAC with TLS_hmac checking
2020-04-07 13:06:36 -07:00
65cf5a0d46 Merge pull request #2802 from embhorn/zd9764
Fix for bidirectional shutdown
2020-04-07 13:03:54 -07:00
f742693062 Merge pull request #2867 from SparkiDev/aes-ccm-aesni
For CCM using AES-NI, do 4 blocks at a time if possible
2020-04-07 13:03:23 -07:00
4a4f383485 Merge pull request #2842 from julek-wolfssl/set_curve_groups_list
Check length to avoid XSTRNCMP accessing  memory after `list`
2020-04-07 13:02:18 -07:00
bf332b459b set ChaCha counter state for TLS 1.3 AEAD 2020-04-07 10:36:23 -06:00
1ce0268477 sanity check on input length before secure renegotiation compare 2020-04-07 10:10:03 -06:00
e6affa386f Fix downgrade fixed random to match spec 2020-04-07 09:42:08 +10:00
31ea4b388c Fix for building with NO_WOLFSSL_DIR when compatibility layer is enabled. ZD 10117. 2020-04-06 10:33:16 -07:00
4ec0591e45 Avoid leak when HAVE_AESGCM and NO_AES_DECRYPT. Thanks to G.G. on ZD #10106 for the report 2020-04-06 09:43:24 -06:00
06f23223e4 Allow wolfSSL to include options.h with EXTERNAL_OPTS_OPENVPN header 2020-04-06 15:06:15 +02:00
9c67bc2864 For CCM using AES-NI, do 4 blocks at a time if possible 2020-04-06 11:11:28 +10:00
7dad0d3965 Tweak the SP x86_64 ECC assembly
Put back fixes undone in previous commits:
 - Fix casting warning in SP when mp_digit < sp_digit
 - SP fix check for NULL in EC point_new
2020-04-06 11:02:30 +10:00
302e1d6818 add aes counter on esp32 2020-04-04 14:04:44 +09:00
1831193c20 * Fixes for building ECC without ASN.
* Fix to expose `wc_ecc_import_private_key_ex` and its ability to import a private key even when `NO_ASN` is defined.
* Remove execute bit on CSharp files.
2020-04-03 10:55:31 -07:00
c0dc3091e1 GNU TLS server sends empty CSR extension 2020-04-03 16:03:41 +10:00
9a1687d00e Merge pull request #2836 from dgarske/fips_ld
Example for FIPS Linker Descriptor (.ld)
2020-04-02 14:28:30 -07:00
8128a269f3 Merge pull request #2876 from SparkiDev/sp_arm64
Improve speed of AArch64 assembly
2020-04-02 14:26:48 -07:00
48e40fac2b OpenVPN changes
Include <wolfssl/options.h> in settings.h for OpenVPN
Additional API fixes
2020-04-02 20:23:13 +02:00
6126aca387 Merge pull request #2874 from SparkiDev/tls13_cert_hash
When picking hash alg for ECC certs use key size
2020-04-02 09:52:10 -07:00
86adb7f9c5 Merge pull request #2873 from SparkiDev/aes_small
Smaller table version of the AES encrypt/decrypt
2020-04-02 09:50:58 -07:00
5df5ab5931 Merge pull request #2862 from dgarske/iar_ropi
Support for IAR with position independent code (ROPI)
2020-04-02 09:49:00 -07:00
06442c410d Merge pull request #2861 from dgarske/zynqmp
Fixes for Xilinx SDK and Zynq UltraScale+ MPSoC
2020-04-02 09:46:48 -07:00
b1a80973dd size_t -> int 2020-04-02 18:45:53 +02:00
c48ea3f567 When picking hash alg for ECC certs use key size 2020-04-02 11:53:35 +10:00
04dcb8f774 DTLS Fix
If the finished message (well, next epoch handshake message) is received,
store it. Process it after a change cipher spec message.
2020-04-01 17:17:51 -07:00
e23a6b46b0 Allow use of truncated HMAC with TLS_hmac checking 2020-04-02 08:52:40 +10:00
b1ec15de3e Only try shutdown once in example 2020-04-01 17:48:17 -05:00
3f7ce61dbd Updates from review 2020-04-01 11:14:25 -05:00
df1819b79f Improve speed of AArch64 assembly
Improve point_dbl and point_dbl_n for all platforms.
2020-04-01 15:06:50 +10:00
47d1cb8415 Changes to support IAR with position independent code (ROPI). Updated example wolfSSL IAR project to use "ropi" (Position indipendance for code and read-only data). 2020-03-31 08:17:09 -07:00
568ce62b81 Updates from code review 2020-03-31 18:29:06 +10:00
3bd52b166b Merge pull request #2863 from miyazakh/dtls_benchmark
added dtls benchmark
2020-03-27 12:06:06 -07:00
9339808ea1 Smaller table version of the AES encrypt/decrypt
Use WOLFSSL_AES_SMALL_TABLES.
Much slower. Decrypt much slower then encrypt.
2020-03-27 15:53:01 +10:00
99b9f46e58 fixed not working on mac
fixed case of -s or -c
2020-03-27 12:33:51 +09:00
ddb4b5eb89 Merge pull request #2872 from SparkiDev/rsa_pub_fix
Fix performance of RSA public key ops with TFM
2020-03-26 11:56:23 -07:00
16fa1a4747 Merge pull request #2855 from JacobBarthelmeh/PKCS12
maintenance to PKCS12 create for outputting encrypted bundles
2020-03-26 10:41:04 -07:00
1bc2ecff6a Merge pull request #2849 from dgarske/csharp_wrapper
CSharp wrapper improvements
2020-03-26 09:10:24 -06:00
c82531a41a Fix performance of RSA public key ops with TFM
Have a constant and non-constant time modular exponentation available in
tfm.c.
Call the non-constant time version explicitly when performing RSA public
key mod exp.
2020-03-26 17:33:07 +10:00
a6034a38c7 Fix for building with WOLFSSL_SMALL_STACK_CACHE only (no WOLFSSL_SMALL_STACK). 2020-03-25 16:04:45 -07:00
d57d194de3 Fix clang warnings (issue #2870)
The warning was "comparison of array 'ecc_sets[i].name' not equal to a null
pointer is always true [-Wtautological-pointer-compare]"

Compiler is correct, ecc_sets[i].name  is an array of size 16, thus
can't be NULL

Also, fix build error on Windows by changing uint8_t to "unsigned char"
(alternative fix could be including stdint.h)
2020-03-25 23:07:12 +01:00
3717982d47 Fix to build wolfssl/testsuite in Any CPU case. 2020-03-25 14:53:58 -07:00
70773f3b3e Added "WOLFSSL_ARMASM" ifdef checks on ARMv8 port files. 2020-03-25 12:54:40 -07:00
93fd1b1eeb Merge pull request #2869 from JacobBarthelmeh/Testing
add single quotes around -? in test scripts
2020-03-25 11:03:19 -07:00
083b8f680f Merge pull request #2868 from JacobBarthelmeh/Certs
refactor decrypt content with PKCS12 and fix for AES-256 + HMAC SHA25…
2020-03-25 11:02:34 -07:00
2116c20f5d add test case for PKCS12 to DER and back 2020-03-25 10:38:18 -06:00
469de9a580 Fix for CSharp solution to eliminate Debug/Release. Only DLL Debug and DLL Release should be available. 2020-03-25 08:57:58 -07:00
0a6b93fda2 add single quotes around -? in test scripts 2020-03-24 22:40:48 -06:00
59ab600d76 refactor decrypt content with PKCS12 and fix for AES-256 + HMAC SHA256 case 2020-03-24 22:23:44 -06:00
9fac21f463 replace the size at bench_embedded 2020-03-25 08:09:42 +09:00
26f539400a Merge pull request #2866 from SparkiDev/curve448_gcc_bug
Curve448 - 128-bit impl workaround for compiler
2020-03-24 09:55:43 -07:00
e66334e56b Merge pull request #2865 from SparkiDev/sp_cast_fix
Fix casting warning in SP when mp_digit < sp_digit
2020-03-24 09:52:26 -07:00
b92e5d83c5 Merge pull request #2864 from JacobBarthelmeh/ARMv8
Fix for clang warning with ARM assembly build
2020-03-24 09:51:11 -07:00
75eca61b3e address review comments 2020-03-24 20:35:21 +09:00
c95e7f88aa Curve448 - 128-bit impl workaround for compiler
Old gcc compilers can keep track of the 128-bit multiplication and left
shift results' size.
Split all multiplication and left shift results into separate variables.
Add/subtract into the correct variable at end.
Don't want variable declarations after statements so reduce doesn't use
'tr' anymore.
2020-03-24 16:28:14 +10:00
a7d265bf46 Fix casting warning in SP when mp_digit < sp_digit 2020-03-24 12:41:25 +10:00
7fabd74a90 Merge pull request #2859 from SparkiDev/tfm_ec_invmod_ct
Constant time EC map to affine for private operations
2020-03-23 19:16:45 -07:00
dde1c3bc08 Fix for clang warning with ARM assembly build 2020-03-23 15:08:28 -06:00
5c424769a0 Added DH and Curve/Ed25519. 2020-03-23 09:08:45 -07:00
7d4b4e4994 added dtls benchmark 2020-03-22 17:56:28 +09:00
a8f2c97e13 Added CSharp example for multi-threaded TLS server. Refactor to separate the ssl and ctx handles. 2020-03-20 16:10:19 -07:00
97f08393e2 Added wolfCrypt Xilinx SDK project. Fix for stsafe.h inclusion of ssl.h with WOLFCRYPT_ONLY. 2020-03-20 14:40:17 -07:00
2706d6d48a Improve the benchmark to use snprintf then printf. Resolve issue showing results with xil_printf. 2020-03-20 12:34:08 -07:00
3127a7e9e5 Fixes for building with bare-metal on Xilinx SDK with zynqmp. Added Zynqmp benchmark timer support. 2020-03-20 12:22:47 -07:00
9b8752e314 Merge pull request #2858 from SparkiDev/netscape_cert_ext
Recognise Netscape Certificate Type extension
2020-03-19 16:33:25 -07:00
0c3667ba93 Merge pull request #2857 from SparkiDev/sp_null_check
SP fix check for NULL in EC point_new
2020-03-19 16:30:59 -07:00
33b95b8ad7 Merge pull request #2854 from JacobBarthelmeh/Certs
add +1 for string null terminator
2020-03-19 16:24:42 -07:00
49f01450de Merge pull request #2853 from SparkiDev/dtls_mtu
Allow setting of MTU in DTLS
2020-03-19 16:23:39 -07:00
f4a8430115 Merge pull request #2851 from JacobBarthelmeh/SanityChecks
add space for null terminator and check on header pointer
2020-03-19 16:00:57 -07:00
1de07da61f Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign.
2020-03-20 08:59:41 +10:00
ce6aeebdb4 fixes for static analysis checks 2020-03-19 16:34:02 -06:00
62a593e72e Recognise Netscape Certificate Type extension
Checks the bit string is valid but doesn't store or use value.
(Some certificates have this extension as critical)
2020-03-19 12:43:03 +10:00
c776a4219a SP fix check for NULL in EC point_new 2020-03-19 08:56:52 +10:00
a28fc5e70b Peer review feedback. Handle socket.Connect() failures. 2020-03-18 13:33:15 -07:00
09dedfbe17 maintenance to PKCS12 create for outputting encrypted bundles 2020-03-18 12:00:57 -06:00
00630baa53 Merge pull request #2826 from miyazakh/fix_csharp_dtlsexample
fix dtl server example of CSharp when freeing stuff
2020-03-18 09:26:14 -07:00
2bf39307f1 add +1 for string null terminator 2020-03-18 10:25:56 -06:00
e17e064ce2 Allow setting of MTU in DTLS 2020-03-18 12:36:11 +10:00
eb6f44e491 Merge pull request #2847 from tmael/memLeak
Fix memory leak
2020-03-17 13:31:10 -07:00
d0767164c8 Merge pull request #2846 from SparkiDev/sp_rsa_priv_fix
Fix SP RSA private op
2020-03-17 13:28:11 -07:00
aff80ab0d3 adjust test case for no ECC 2020-03-17 08:56:55 -07:00
9fc8c8e0b6 add space for null terminator and check on header pointer 2020-03-16 15:14:29 -07:00
74781a3d45 Merge pull request #2829 from cconlon/pkcs7multioctets
PKCS7/CMS EnvelopedData support for fragmented encrypted content
2020-03-16 13:12:23 -06:00
321a43edee Merge pull request #2850 from JacobBarthelmeh/SanityChecks
sanity check on IV size
2020-03-16 09:36:17 -07:00
2d950f1ab4 sanity check on IV size 2020-03-15 18:46:11 -06:00
00a49dffd0 Add new files to autoconf. 2020-03-13 20:40:18 -07:00
6498cb48bc CSharp wrapper improvements. Added TLS client example. Added TLS v1.3 methods. Added set_verify and CTX_set_verify. Added example code for CTX_set_cipher_list. 2020-03-13 14:54:57 -07:00
a6b01904d2 Release mem during failure 2020-03-13 14:22:06 -07:00
bcc720ef68 Merge pull request #2773 from SKlimaRA/master
Coverity issues fixes.
2020-03-13 10:20:45 -07:00
464631f920 Merge pull request #2841 from JacobBarthelmeh/Certs
add function wolfSSL_X509_NAME_ENTRY_create_by_txt
2020-03-13 10:17:52 -07:00
fa4ccbe728 Merge pull request #2844 from JacobBarthelmeh/SanityChecks
set inital state of TLS 1.3 peerSuites structure
2020-03-13 10:16:53 -07:00
452b4c03a6 Fix memory leak 2020-03-12 23:24:44 -07:00
6321eabf86 Fix SP RSA private op
tmpa - tmpb can be less than -p.
Need to conditionally add p twice.
C and multiple platform fix.
2020-03-12 09:33:52 +10:00
0be0cf44e4 fix for returning NULL when text not found and add test case 2020-03-10 09:54:31 -06:00
93326a7aeb Changed dst NULL check. 2020-03-10 09:55:27 +01:00
fb0ad6532f set inital state of TLS 1.3 peerSuites structure 2020-03-09 15:13:01 -06:00
3fcbcbf42a Revert "Logically dead code."
This reverts commit 2db62f744a.
2020-03-09 17:45:15 +01:00
87ff2fa47d Merge pull request #2839 from ejohnstown/hmac-init
HMAC Init
2020-03-06 11:05:30 -08:00
ab8bfc241d Merge pull request #2833 from JacobBarthelmeh/Compatibility-Layer
compile for NO_WOLFSSL_STUB
2020-03-06 11:04:36 -08:00
4ad8a2bacb store wc_PKCS7_DecodeEnvelopedData encryptedContentTotalSz in existing variable instead of adding another 2020-03-06 10:50:00 -07:00
fe9a876895 Check length to avoid XSTRNCMP accessing memory after list 2020-03-06 17:13:59 +01:00
1035d73a05 add function wolfSSL_X509_NAME_ENTRY_create_by_txt 2020-03-05 16:29:55 -07:00
9fe2ddacf4 HMAC Init
1. wc_HmacSetKey() has a check against the hmac's type that assumes one
has called wc_HmacInit() on the object first. In FIPS Ready builds we
do not have wc_HmacInit() in the boundary. This change removes that check
and action when making a FIPS build. The free called doesn't do anything
in the FIPS build case.
2. Initialize the Hmac's macType to WC_HASH_TYPE_NONE. Check the macType
against that rather than 0. There are some build configs where none isn't
0.
2020-03-05 13:38:02 -08:00
a6385a2b48 Merge pull request #2840 from SparkiDev/tls_show_fddhe
Fix to show the FFDHE group when negotiated
2020-03-05 08:33:49 -08:00
59b9483cde Merge pull request #2837 from SparkiDev/sp_x64_rsa_priv
Fix SP x64 RSA Private op
2020-03-05 08:33:11 -08:00
f24622596f Merge pull request #2827 from kaleb-himes/ZD9976
Fix infinite loop with small sha1 inputs. Thanks to Peter W. on ZD997…
2020-03-05 08:32:14 -08:00
6fcfde0651 Fix to show the FFDHE group when negotiated 2020-03-05 12:37:49 +10:00
9f6cf8a154 Merge pull request #2834 from dgarske/various_tls
Fix for TLS server with TLSv1.2 or less `wolfSSL_get_curve_name`
2020-03-04 16:24:28 -08:00
9b54af199c Merge pull request #2822 from dgarske/notime_openssl
Fixes for building NO_ASN_TIME with OPENSSL_EXTRA
2020-03-04 16:22:18 -08:00
e1215e0e1b Merge pull request #2810 from SparkiDev/tls13_mut_auth
Allow mutual authentication to be required for TLS server side
2020-03-04 16:21:03 -08:00
3707eea2f3 Fix SP x64 RSA Private op
tmpa - tmpb can be less than -p.
Need to conditionally add p twice.
2020-03-04 15:54:17 +10:00
fca5895090 Example for FIPS Linker Descriptor to explicitly set wolfCrypt FIPS boundaries. 2020-03-03 15:47:30 -08:00
c5b4fe1283 Fix for namedGroup missing. 2020-03-03 15:35:56 -08:00
bb76495233 compile for NO_WOLFSSL_STUB 2020-03-03 14:03:11 -07:00
44d2fc55e6 scan-build fixes for wc_PKCS7_DecodeEnvelopedData() 2020-03-03 10:27:22 -07:00
730c95cf38 Fix for TLS server incorrectly showing "FFDHE_2048" for "SSL curve name is" when using ECDHE and TLS v1.2 or less. The PickHashSigAlgo should be resetting ssl->namedGroup to indicate a named group was not used. 2020-03-03 09:20:58 -08:00
4895fd7b0b Added "either" side functions for SSLv3. These are only enabled with WOLFSSL_EITHER_SIDE and WOLFSSL_ALLOW_SSLV3. ZD 9984. 2020-03-03 09:18:11 -08:00
41ff54f873 Fix for typo with wc_ecc_init in documentation. 2020-03-03 09:16:48 -08:00
d8eeefb4b7 initialize explicitOctet to 0 in pwc_PKCS7_DecodeEnvelopedData() 2020-03-02 09:13:11 -07:00
127e304901 DTLS Fix
An endpoint's retransmit pool was being reset when receiving its peer's
change cipher spec message. When the finished message was lost, and
retransmits need to happen, they weren't available, so nothing happened.
Moved the reset to the finished case rather than CCS.
2020-03-01 16:43:10 -08:00
8cccb9008b Change to work for other TLS versions
Send alert when client doesn't send a certificate on request.
2020-03-02 08:50:57 +10:00
6334dd9cb0 Allow mutual authentication to be required for TLS 1.3 2020-03-02 08:50:57 +10:00
debb792690 fix PKCS7 encrypted content decoding for streaming API usage 2020-02-28 17:55:19 -07:00
92114fef75 Fixes for building NO_ASN_TIME with OPENSSL_EXTRA. Fixes #2820.
* `./configure --enable-opensslextra CFLAGS="-DNO_ASN_TIME"`
2020-02-28 09:35:17 -08:00
805034bca3 Merge pull request #2830 from SparkiDev/sp_ff_x86_64
Improve performance of RSA/DH ops on x64
2020-02-28 09:03:22 -08:00
5b58130210 Merge pull request #2806 from SparkiDev/curve448
Add Curve448, X448, Ed448 implementations
2020-02-28 08:59:08 -08:00
441027a502 Improve performance of RSA/DH ops on x64
Focus on 3072-bit ops but others improved as well.
2020-02-28 10:42:37 +10:00
2c6eb7cb39 Add Curve448, X448, Ed448 implementations 2020-02-28 09:30:45 +10:00
d21e370822 add support for PKCS7/CMS EnvelopedData with fragmented encrypted content 2020-02-27 14:42:57 -07:00
c7a2510d97 Merge pull request #2823 from SparkiDev/sp_div_fix
Fix for SP x64 div
2020-02-27 12:57:35 -08:00
a313b9d2cb Merge pull request #2821 from dgarske/crl_bitmask
Fix for CRL bit-mask enum value issue
2020-02-27 12:54:08 -08:00
b7d0b81443 Merge pull request #2818 from dgarske/rsa_sha3only
RSA with SHA-3 only and RSA 4096-bit tests
2020-02-27 12:44:29 -08:00
6dabe82c65 Merge pull request #2814 from SparkiDev/curve25519_x64_fix
Curve25519 x64 asm: Fix negate and add fe_sq_n
2020-02-27 12:21:53 -08:00
60afebdb86 Merge pull request #2811 from miyazakh/fix_espidf_buildtest_failure
fixed build failure and warnings in ESP-IDF port
2020-02-27 12:21:14 -08:00
1288c6b249 Merge pull request #2809 from dgarske/conf_usersettings
Fix to enable inclusion of all .c files when using `--enable-usersettings`
2020-02-27 12:10:07 -08:00
ed7a5b17d8 Merge pull request #2808 from dgarske/mdk5
Fix for minor typos in the MDK5 examples
2020-02-27 12:06:50 -08:00
3349dbc852 Merge pull request #2807 from dgarske/arg_checks
Added missing argument checks for public API's in `wolfio.c`
2020-02-27 12:03:32 -08:00
eddf4abf8e Merge pull request #2775 from embhorn/api_port
openSSL compatibility API for EVP, BIO, and SSL_SESSION
2020-02-27 11:51:21 -08:00
d9e221806b Fix infinite loop with small sha1 inputs. Thanks to Peter W. on ZD9976 for the report 2020-02-27 09:39:22 -07:00
2d530499e3 fix dtl server example when freeing stuff 2020-02-27 21:56:25 +09:00
f568f394b1 Merge pull request #2824 from julek-wolfssl/EVP-aesgcm
Fix AES-GCM IV length in wolfSSL_EVP_CIPHER_iv_length
2020-02-27 14:06:56 +10:00
3b822ad3d5 Fix AES-GCM IV length in wolfSSL_EVP_CIPHER_iv_length 2020-02-26 22:11:36 +01:00
2a5d7a2ac3 Fix for SP x64 div
Check the top half of number being divided to see if it is greater than
or equal.
If it is then the first div_word may crash as the result is more than
64-bits. So subtract modulus from the top to keep value small.
2020-02-26 10:53:35 +10:00
3bbd8be5c9 ATECC: Don't init transport key if not used 2020-02-25 22:03:55 +10:00
4b83b88a29 Fix for CRL bit-mask enum value issue. ZD 9948. 2020-02-24 18:52:50 -08:00
969e4dccc5 Merge pull request #2803 from julek-wolfssl/EVP-aesgcm
Evp aesgcm
2020-02-25 08:24:30 +10:00
ef2c1ae738 Fix for examples/benchmark/tls_bench.c:114:20: error: unused variable 'kShutdown' with WOLFCRYPT_ONLY. 2020-02-23 19:01:46 -08:00
7a3138f841 Merge pull request #2817 from miyazakh/rename_enum_tisp
Rename enumeration definition
2020-02-23 18:40:48 -08:00
da882f3912 Added wolfCrypt RSA 4096-bit test support using USE_CERT_BUFFERS_4096 build option (./configure CFLAGS="-DUSE_CERT_BUFFERS_4096"). 2020-02-23 18:40:13 -08:00
c8e618a817 Fix build for WOLFSSL_RSA_VERIFY_ONLY. 2020-02-23 15:58:28 -08:00
e80c696d5f Fix for RSA with SHA3 only (resolves warning with unsed RsaMGF1. 2020-02-23 13:54:48 -08:00
3187624d9e rename common naming enum 2020-02-22 11:35:02 +09:00
0f188be892 Merge pull request #2805 from ejohnstown/update-config
configure
2020-02-21 09:35:52 -08:00
c9ce065f8a Curve25519 x64 asm: Fix negate and add fe_sq_n 2020-02-21 11:37:45 +10:00
5716862a8a Merge pull request #2813 from julek-wolfssl/openssh-8.1
Remove redundant wolfSSL_EVP_CIPHER_CTX_iv_length call
2020-02-21 09:52:44 +10:00
403c263e0b Fix valgrind issue 2020-02-20 17:28:34 -06:00
b74dac6171 Fix WIN test 2020-02-20 17:28:34 -06:00
60dea0c53a Fix VS error 2020-02-20 17:28:34 -06:00
e4188d935b Fix WIN error 2020-02-20 17:28:34 -06:00
b4563e6af3 Fix CFB and OFB 2020-02-20 17:28:34 -06:00
61ebfd571c Fix new file error 2020-02-20 17:28:34 -06:00
a64e1540ba Adding EVP support for SHA3 2020-02-20 17:28:34 -06:00
6eda4e7b46 Fix in test 2020-02-20 17:28:34 -06:00
95f973a5be Adding test and dox for ERR_print_errors_cb 2020-02-20 17:28:34 -06:00
936312f77e Adding ERR_print_errors_cb 2020-02-20 17:28:33 -06:00
a0ddb05a07 change evp with cfb1 expect input size in bytes 2020-02-20 17:28:33 -06:00
1a96558b6e Adding macro and XTS support functions 2020-02-20 17:28:33 -06:00
922b308029 Fix from review 2020-02-20 17:28:33 -06:00
3eee891cf5 fix redefinition warning on older clang compiler 2020-02-20 17:28:33 -06:00
51d55ed1c8 account for different peer certificate in test case, g++ build fix, static memory size increase 2020-02-20 17:28:33 -06:00
a9accb6c39 add more macro guards for builds 2020-02-20 17:28:33 -06:00
b67ade5164 account for cavp build 2020-02-20 17:28:33 -06:00
76eec8884b clean up memory after test and don't leak x509 with get session peer 2020-02-20 17:28:33 -06:00
258382048d Fix test failures 2020-02-20 17:28:33 -06:00
018f313cca Fix clang warning 2020-02-20 17:28:33 -06:00
5a87dbe094 Adding tests for EVP_CIPHER_CTX_reset 2020-02-20 17:28:33 -06:00
64dcf5740a Fix for AES_XTS 2020-02-20 17:28:33 -06:00
e421d9f52c Fix in evp_aes_xts init 2020-02-20 17:28:33 -06:00
d7c1b9561f fix for cfb1 mode and add EVP tests 2020-02-20 17:28:33 -06:00
d6be24c4f7 add 192/256 key size tests of EVP cfb8 2020-02-20 17:28:33 -06:00
d4428ebc0c add EVP cfb1 test and update some EVP code 2020-02-20 17:28:32 -06:00
887eeb3c47 add EVP tests for cfb128 2020-02-20 17:28:32 -06:00
9d61ba6c62 initial cfb1/cfb8 support added 2020-02-20 17:28:32 -06:00
9c4e0807e2 Adding EVP_aes_###_xts tests (not complete) 2020-02-20 17:28:32 -06:00
16ce670897 Revert "Testing aes_*_xts"
This reverts commit 776eeb756c70b052849323d7645622a3f1d2b76a.
2020-02-20 17:28:32 -06:00
3197d67e62 Testing aes_*_xts 2020-02-20 17:28:32 -06:00
49def96998 add test for get0 session peer certificate 2020-02-20 17:28:32 -06:00
653235cd57 add stub implementation for SSL_MODE_AUTO_RETRY 2020-02-20 17:28:32 -06:00
b83a5840d6 add stub function for wolfSSL_EVP_mdc2 2020-02-20 17:28:32 -06:00
c2c3e0d4aa add initial implementation for wolfSSL_SESSION_get0_peer 2020-02-20 17:28:32 -06:00
ab49120652 add aesofb benchmark 2020-02-20 17:28:32 -06:00
df0d5f3b08 add EVP_aes_*_ofb implementation and tests, add support for inline with OFB 2020-02-20 17:28:32 -06:00
e837894578 add AES-OFB mode 2020-02-20 17:28:32 -06:00
65732c2269 add bio retry and set close tests 2020-02-20 17:28:32 -06:00
3137312911 update to implementation of BIO_MD type 2020-02-20 17:28:32 -06:00
62f20db48e Adding more EVP and SSL API 2020-02-20 17:28:32 -06:00
8f7af875a4 add BIO_f_md and BIO_get_md_ctx tests 2020-02-20 17:28:32 -06:00
0abc814792 EVP_MD_CTX_reset and EVP_aes fixes 2020-02-20 17:28:31 -06:00
ba25161f6c Adding BIO and EVP api 2020-02-20 17:28:31 -06:00
49a9239cf2 Merge pull request #2804 from SparkiDev/sp_cache_resist_fix
Fix cache resist compile to work with SP C code
2020-02-20 15:05:18 -08:00
da2980172b Merge pull request #2812 from kaleb-himes/FAILING_FIPS_IN_MASTER
Fix failing FIPS tests in master stemming from PR #2733
2020-02-20 14:29:16 -08:00
70ef925a48 Remove redundant wolfSSL_EVP_CIPHER_CTX_iv_length call 2020-02-20 18:32:56 +01:00
1f003967df Fix failing FIPS tests in master stemming from PR #2733 2020-02-20 09:20:59 -07:00
d4a9279a6c Revert "Resource leak." to resolve the conflict (this fix is unapplicable, because the leaking code was removed).
This reverts commit 451d0a470a.
2020-02-20 15:12:02 +01:00
f7018c4765 fixed build failure and warnings
fixed unit test app failure
2020-02-20 18:40:16 +09:00
c62f31cd27 Fix cache resist compile to work with SP C code 2020-02-20 10:10:05 +10:00
418c508eba Fixes for SCTP example to check build options. 2020-02-19 12:28:49 -08:00
6036f604a6 Added missing argument checks for public API's in wolfio.c. 2020-02-19 12:18:00 -08:00
75183262ad Minor typos and fixes to the MDK5 examples. 2020-02-19 12:03:14 -08:00
baace2c0e3 Fix to enable inclusion of all .c files when using the --enable-usersettings option. 2020-02-19 11:58:33 -08:00
e72b87f372 Merge pull request #2733 from julek-wolfssl/openssh-8.1
Openssh 8.1
2020-02-19 10:14:35 -07:00
cc597add48 Don't always include wolfssl/openssl/bn.h 2020-02-19 11:17:31 +01:00
9953f2d01d 1. Remove duplicate AM_CONDITIONAL statments from configure.ac.
2. Update copyright year in configure.ac.
2020-02-18 16:16:59 -08:00
17c3bb00d8 Merge pull request #2798 from ejohnstown/vxworks-strings
VxWorks Strings
2020-02-18 17:10:31 -07:00
26e2d6eacf Adressing Todd's comments
Check for HAVE_GETADDRINFO beside WOLF_C99
Move STR_SIZEOF to wolfssl/wolfcrypt/types.h and rename to XSTR_SIZEOF to prevent collision in client projects
Remove wolfssl/openssl/ssl.h and wolfssl/internal.h from crypto layer
2020-02-18 21:37:06 +01:00
b736a65fa8 Fix redefinition issue 2020-02-18 21:37:06 +01:00
2218f7b95d Fix merge issues 2020-02-18 21:37:06 +01:00
d6686f1320 Remove usage of res in wolfSSL_BN_clear_bit 2020-02-18 21:37:06 +01:00
5a766bd5bb Change STR_SIZEOF declaration file 2020-02-18 21:37:06 +01:00
1512485926 Fix user-rsa tests 2020-02-18 21:37:06 +01:00
5c4d3df4f3 Fix broken Windows FIPS build 2020-02-18 21:37:06 +01:00
f55cfd7ba7 Fix missing wolfSSL_i2d_RSAPrivateKey references 2020-02-18 21:37:06 +01:00
3fcec191a4 Refactor wolfSSL_RSA_To_Der 2020-02-18 21:37:06 +01:00
5ed1c233b7 Sean comments 2020-02-18 21:37:06 +01:00
dac23dfe15 Add DSA and DH free to wolfSSL_EVP_PKEY_set1_EC_KEY 2020-02-18 21:37:06 +01:00
7aaa89aedc Cleanup bn_one in wolfSSL_Cleanup 2020-02-18 21:37:06 +01:00
43ce272cb3 Variable declaration at start of scope 2020-02-18 21:37:06 +01:00
eedbce7c0a Null-check keyFormat
Zero all of WOLFSSL_DH struct
Fix macros for self-test
2020-02-18 21:37:06 +01:00
97a4889bb3 Undo some stuff 2020-02-18 21:37:06 +01:00
1df9963b80 sha3.h 2020-02-18 21:37:06 +01:00
7ce7017521 Fix memory leaks when compiling with SMALL_STACK 2020-02-18 21:37:06 +01:00
f765b711bf More macro preproc stuff 2020-02-18 21:37:06 +01:00
48b39a34c7 Properly Init mp_int number 2020-02-18 21:37:06 +01:00
b592b241c7 Fix Segfault in wolfSSL_EC_KEY_dup
Fix more header stuff
2020-02-18 21:37:06 +01:00
b58f26945d Different configuration fixes 2020-02-18 21:37:06 +01:00
480227704d Fix missing stuff in headers 2020-02-18 21:37:06 +01:00
59b001c484 Fix header definitions when running CAVP self test 2020-02-18 21:37:06 +01:00
50f8fb1475 Enable wc_RsaKeyToDer even when key generation is turned off 2020-02-18 21:37:06 +01:00
e6547c75cd Reimplement external data as it was before: a fixed size vector. This makes external data implementation easier as it doesn't require allocation or cleanup. Only zeroing the entire structure that it is in (which happens in all structures anyway) and then calling the appropriate getter and setter functions to manipulate external data. 2020-02-18 21:37:06 +01:00
9a0d3ba369 Check boundaries in B64 decode
ERR_get_error will always return a positive error code
2020-02-18 21:37:06 +01:00
58c239a49f Fix stuff after rebase 2020-02-18 21:37:06 +01:00
d6a160c637 Fix error codes for OpenSSL compatiblity 2020-02-18 21:37:06 +01:00
6e72a299d7 Don't undef HAVE_GETADDRINFO as it disables defines in projects using wolfSSL
Change test_wolfssl_EVP_aes_gcm so that changing the tag will fail the authentication check
2020-02-18 21:37:06 +01:00
ab56d078a4 keygen-moduli passed
Handle trailing newlines in wolfSSL_BN_hex2bn
2020-02-18 21:37:06 +01:00
ae948e2a07 Pass try-ciphers
define EVP_CIPHER_CTX_set_iv as wolfSSL_EVP_CIPHER_CTX_set_iv
add wolfSSL_GetLoggingCb functionality when compiling without enable-debug
fix initialization vector handling of all cipher modes when using our EVP layer. The IV was incorrectly handled in initialization as well as not being updated after processing
2020-02-18 21:37:06 +01:00
fbedabe601 OpenSSH changes
- increase FP_MAX_BITS for OpenSSH
- Add helpful loggin API (names are self-explanatory)
-- wolfSSL_GetLoggingCb
-- WOLFSSL_IS_DEBUG_ON
- Define WOLFSSL_EC_METHOD as an alias of WOLFSSL_EC_GROUP
- Add wolfSSL_EC_GROUP_method_of which really just returns the group itself
- Add wolfSSL_EC_METHOD_get_field_type which gets the curve type of the WOLFSSL_EC_GROUP(remember that WOLFSSL_EC_METHOD is an alias of WOLFSSL_EC_GROUP for now)
- Modify Base64_Decode so that it accepts arbitrary PEM line length
- Modify PemToDer so that it accepts private keys with a custom -----BEGIN * PRIVATE KEY----- header
2020-02-18 21:37:06 +01:00
84a2ca7a4e Map the Jacobian point back to affine space in wolfSSL_EC_POINT_get_affine_coordinates_GFp 2020-02-18 21:37:06 +01:00
aea95232d1 WIP
Add EC_POINT conversion to BIGNUM (EC_POINT_point2bn)
Add setting affine coordinates for EC_POINT (EC_POINT_set_affine_coordinates_GFp)
Add bit clearing for BIGNUM (BN_clear_bit)
Add supporting unit tests in api.c
2020-02-18 21:37:06 +01:00
89e35e2547 openssh 8.1 compiles 2020-02-18 21:37:06 +01:00
b5c52d7c70 openssh WIP and some light refactoring 2020-02-18 21:37:06 +01:00
41de1bb156 WIP 2020-02-18 21:36:26 +01:00
b05cfaa601 Add aes-gcm to wolfSSL_EVP_get_cipherbyname and wolfSSL_EVP_get_cipherbynid 2020-02-18 21:34:23 +01:00
6f3623f220 Moved infinite loop check to the other bad func arg check. 2020-02-18 09:59:59 +01:00
41d3ba0efa Tests and examples for bidirectional shutdown 2020-02-17 16:47:47 -06:00
59fb81c950 Add fix 2020-02-17 16:47:47 -06:00
2566986d41 Merge pull request #2632 from SparkiDev/sp_p384
Add support for P384 curve into SP
2020-02-17 11:46:09 -08:00
bf1ec3004a Merge pull request #2787 from dgarske/size_reduc
Adds options to disable the hash wrappers and base64 decode
2020-02-17 11:44:37 -08:00
651ffe2c12 Merge pull request #2789 from JacobBarthelmeh/SanityChecks
fix return with error on process peer cert
2020-02-17 11:44:02 -08:00
f2e1266f2d Merge pull request #2791 from dgarske/async_fixes
Fixes for asynchronous crypto issues
2020-02-17 11:43:13 -08:00
14b7355411 Merge pull request #2792 from SparkiDev/rsa_kg_blind_fix
Fix for rsa key gen blinding - don't call lcm
2020-02-17 11:42:25 -08:00
44c327ee14 Merge pull request #2795 from SparkiDev/tls13_secret_cb
Call secret callback when TLS 1.3 secrets generated
2020-02-17 11:41:16 -08:00
fda322829f Merge pull request #2796 from JacobBarthelmeh/Compatibility-Layer
free existing cert store when setting a new one
2020-02-17 11:37:56 -08:00
8972bf6278 Add support for P384 curve into SP 2020-02-17 15:46:34 +10:00
defa54f40d Merge pull request #2800 from tmael/trim-padding
Trim trailing padding bytes from a key
2020-02-14 16:05:44 -08:00
30936e7ad4 Merge pull request #2793 from kaleb-himes/ZD9865
Fix issue in wolfSSL_EVP_PKEY_assign_RSA when RSA key not zeroized
2020-02-14 16:40:52 -07:00
aaaa191937 Trim trailing padding byte 2020-02-14 12:54:35 -08:00
8f6a614d17 Merge pull request #2797 from kaleb-himes/JENKINS_STUFF
--disable-supportedcurves --enable-opensslextra - NIGHTLY DISABLE OPT…
2020-02-14 09:01:03 -08:00
614e675a00 Call secret callback when TLS 1.3 secrets generated 2020-02-14 08:42:47 +10:00
b62064f6a8 Merge pull request #2737 from JacobBarthelmeh/dks7g2
changes for build with s7g2
2020-02-13 14:07:44 -07:00
cabe30828c Merge pull request #2786 from cconlon/android-debug
add Android debug for logcat
2020-02-13 10:12:40 -08:00
fba40d14d4 Merge pull request #2785 from ottok/bugfix/menu-js-width
Wrap JavaScript source on multiple lines to make it readable
2020-02-13 10:07:13 -08:00
b038e2e8f0 Merge pull request #2771 from JacobBarthelmeh/Windows
change public Timeval to WOLFSSL_TIMEVAL
2020-02-13 09:38:42 -08:00
63a005d71b VxWorks Strings
When building for VxWorks, set HAVE_STRINGS_H as it uses strings.h, not string.h.
2020-02-13 09:08:54 -08:00
bb7508f570 --disable-supportedcurves --enable-opensslextra - NIGHTLY DISABLE OPTIONS TEST 2020-02-12 15:57:00 -07:00
8e1adb125c free existing cert store when setting a new one 2020-02-12 15:45:44 -07:00
0814f61b11 fix code formating and turn on HW acc. by default 2020-02-12 10:31:34 -07:00
1b13178182 Fixes possible compile error if NO_PKCS7_STREAM is defined. 2020-02-12 13:46:12 +01:00
1a38c26097 Prevent infinite loop. 2020-02-12 13:29:33 +01:00
109173d756 Fix two resource leaks. 2020-02-12 12:57:40 +01:00
5b7fc7b133 Address failure when blinding disabled and key not initialized to zero 2020-02-11 14:39:30 -07:00
d1397656ef Merge pull request #2790 from ejohnstown/abi-tweak
ABI Additions
2020-02-10 15:07:35 -08:00
61221742b7 Merge pull request #2734 from aaronjense/renesas-ra-port
Renesas RA e2studio projects for Client, Server, Test and Benchmark
2020-02-10 14:49:03 -07:00
669d9b1ae4 Fix for rsa key gen blinding - don't call lcm 2020-02-10 08:51:43 +10:00
f322b71526 wolfCrypt fixes for asynchronous (--enable-asynccrypt):
* Fix for ECC and using NULL curve->order (wasn't loaded).
* Fix for typo on heap.
* Fix for QT case where GetInt failure retry did not "init" the mp_int.
2020-02-07 13:34:43 -08:00
3c077a3cef add NO_OLD_TIMEVAL_NAME macro for backwards compatibility 2020-02-07 11:56:30 -07:00
7648997e37 ABI Additions
Added the functions wolfSSL_GetRNG(), wolfSSL_CTX_GetDevId(),
      wc_ecc_import_x963(), and wc_RNG_GenerateBlock() to the ABI
      testing.
2020-02-06 13:33:38 -08:00
17bedbac67 fix return with error on process peer cert 2020-02-06 11:53:42 -07:00
61a5fe3108 add macro for trng and gce driver names 2020-02-06 09:20:07 -08:00
17cfe2589b Merge pull request #2748 from tmael/fix_cppcheck
Fix cppcheck
2020-02-05 16:02:22 -07:00
da3df4f9c6 Changing logic to remove dead code section. 2020-02-05 19:36:37 +01:00
0964272dc6 Resource leak fix. 2020-02-05 18:28:50 +01:00
ba9dc11e62 Adds options to disable the hash wrappers (NO_HASH_WRAPPER) and base64 decode (NO_WOLFSSL_BASE64_DECODE). 2020-02-05 11:58:44 -05:00
bbfefd3cde Sanity check NULL dereference. 2020-02-05 16:59:20 +01:00
e75b1b5cb9 add suport for AES acceleration 2020-02-04 16:10:20 -08:00
b7d772700a update sha256 support for endian 2020-02-04 16:03:45 -08:00
b8b0b7da03 add Android debug for logcat 2020-02-04 10:07:26 -07:00
e664a4f206 Review comments 2020-02-04 08:55:37 -08:00
b67fd249e2 Fix for cppcheck 2020-02-04 08:55:37 -08:00
b29fe41a35 Merge pull request #2738 from SparkiDev/cppcheck_fixes_3
Changes to clear issues raised by cppcheck
2020-02-03 17:02:40 -07:00
63a73be3f0 Merge pull request #2777 from dgarske/constchar
Fixes for char strings not marked as const.
2020-02-03 11:12:55 -08:00
4ee022f788 Merge pull request #2776 from julek-wolfssl/set_curve_groups_list
Add SSL_CTX_set1_groups_list and SSL_set1_groups_list APIs
2020-02-03 11:11:59 -08:00
6f2230e459 Merge pull request #2774 from SparkiDev/sp_x86_64_asm
Improve performance of SP Intel 64-bit asm
2020-02-03 11:08:17 -08:00
61e78880a5 Merge pull request #2769 from dgarske/zd9791
Fix for `wc_EccPublicKeyDecode` to use the length from ASN sequence
2020-02-03 11:05:17 -08:00
c98876d440 Merge pull request #2768 from julek-wolfssl/openvpn-config
Add --enable-openvpn build option
2020-02-03 11:01:06 -08:00
0551b1f2de Merge pull request #2765 from SparkiDev/client_read_write
Client using common read and write func
2020-02-03 11:00:15 -08:00
967235c1f3 Wrap JavaScript source on multiple lines to make it readable
Closes: wolfSSL/wolfssl#2783
2020-02-03 20:15:18 +02:00
cc2bf03e73 Client using common read and write func 2020-02-03 09:17:27 +10:00
420e597c16 Move functions to ssl.c 2020-02-01 10:06:53 +01:00
6ec136208c add sha256 hardware acceleration 2020-01-31 14:26:04 -08:00
d63bdf257d Merge pull request #2337 from MKinclRA/fix-visual-studio-2019-build
Added stdio.h include to types.h.
2020-01-31 12:59:58 -08:00
26794e7b5e Merge pull request #2778 from ejohnstown/fix-abi
Fix ABI
2020-01-31 06:49:16 -08:00
20c0beb9e5 'WOLFSSL_USE_FLASHMEM' to store constant tables in flash memory 2020-01-31 23:43:17 +10:00
6c1e0ff049 ATECC: Option to disable I2C transport key 2020-01-31 23:32:48 +10:00
809472febc Added VERY_SMALL_SESSION_CACHE 2020-01-31 23:32:48 +10:00
14dc5fe2e3 Fixes for 16bit processors 2020-01-31 23:32:48 +10:00
e13d9f7f1b Add SSL_CTX_set1_groups_list and SSL_set1_groups_list APIs 2020-01-31 06:38:38 +01:00
3d233d624c Merge pull request #2770 from JacobBarthelmeh/Testing
fix typo in wolfSSL_sk_X509_EXTENSION_pop_free
2020-01-30 18:55:54 -08:00
aa498a7956 Merge pull request #2767 from dgarske/freertos
Fix for evp.c included and FREERTOS realloc
2020-01-30 15:53:05 -07:00
4bc0f79dd9 Fix ABI
Someone removed some of the WOLFSSL_ABI tags from the ssl.h header file. It looks like it was a bad manual merge.
2020-01-30 14:07:27 -08:00
928f641064 Fixes for char strings not marked as const. The const is an optimization to allow use from flash, which saves RAM space on embedded devices. 2020-01-30 13:53:06 -08:00
0fda8cc3b3 Merge pull request #2756 from dgarske/changelog
Template for ChangeLog.md for next release
2020-01-30 10:47:12 -07:00
ba49427cc4 Cleanup include.am whitespace. 2020-01-30 08:44:52 -08:00
32f478d335 Better fix for using the ASN.1 provided length, not provided inSz. Confirmed CheckBitString will check case where inSz < ASN.1 length. 2020-01-30 08:38:22 -08:00
75e30a33f1 Merge pull request #2764 from SparkiDev/rsa_q_modinv_p
Constant time q modinv p in RSA key gen
2020-01-30 08:08:07 -08:00
3df9ca3fae Fix to use TBD version for next release. 2020-01-30 06:26:45 -08:00
6cf63b1738 Template for ChangeLog.md for next release. New PR's should update this document if its worth mention in the change log. 2020-01-30 06:26:45 -08:00
e5426f85c9 Fix for evp.c when being included directly due to improperly placed WOLFSSL_EVP_INCLUDED. Fix for FREERTOS to expose XREALLOC for normal math. 2020-01-30 06:22:08 -08:00
9bfbdfe695 Fix for wc_EccPublicKeyDecode to use the length from ASN sequence, not the provided inSz. Also checked the case where the sequence number is larger than supplied inSz and it will properly return ASN_PARSE_E. ZD 9791 2020-01-30 06:20:29 -08:00
a90cc51a5f Merge pull request #2772 from dgarske/cert_tests
Fixes for build with opensslextra and 3072-bit cert buffers
2020-01-30 06:47:51 -07:00
55ea2facdd Changes to clear issues raised by cppcheck 2020-01-30 14:24:32 +10:00
81bebd8e5c Improve performance of SP Intel 64-bit asm
RSA: Only constant time copy out when doing private key op
Improve performance of sp_count_bits
2020-01-30 12:23:38 +10:00
c938cb35ca Logically dead code. 2020-01-29 17:35:15 +01:00
ed88e8d1c5 Logically dead code. 2020-01-29 17:34:58 +01:00
2db62f744a Logically dead code. 2020-01-29 17:34:40 +01:00
37386f5fb5 NULL dereference. 2020-01-29 17:34:19 +01:00
670ba75ea4 Missing varargs cleanup. 2020-01-29 17:33:59 +01:00
2d36624d84 NULL dereference. 2020-01-29 17:33:38 +01:00
c3fabb1da6 NULL dereference. 2020-01-29 17:33:21 +01:00
df0b0a6e91 NULL dereference. 2020-01-29 17:31:14 +01:00
70cb97c116 NULL dereference. 2020-01-29 17:30:57 +01:00
972790fb86 Resource leak. 2020-01-29 17:30:35 +01:00
451d0a470a Resource leak. 2020-01-29 17:30:14 +01:00
96d1593735 Possible use after free. 2020-01-29 17:29:52 +01:00
77b69ebf56 Logically dead code. 2020-01-29 17:29:23 +01:00
e183d95c86 Fix for moved file. 2020-01-29 07:22:07 -08:00
5677a96c80 Fixes to resolve openssl_pkey1_test with updated test buffer sizes. 2020-01-29 06:51:47 -08:00
5aabebddd8 Fix more 3072-bit cert buffer edge case builds (certext/certgen). 2020-01-29 06:43:35 -08:00
3f1c3392e5 Fixes for build with opensslextra and 3072-bit cert buffers. Adds 3072-bit RSA public key der. Eliminates duplicate 3072-bit client cert/key. 2020-01-29 06:37:06 -08:00
a9e9120fa0 change public Timeval to WOLFSSL_TIMEVAL 2020-01-28 17:11:46 -07:00
59af7a8e35 fix typo in wolfSSL_sk_X509_EXTENSION_pop_free 2020-01-28 16:50:54 -07:00
3bdb7d8188 Merge pull request #2761 from JacobBarthelmeh/Testing
add close on pre to echoserver example
2020-01-28 09:29:29 -08:00
044ad957e5 Add --enable-openvpn build option 2020-01-28 15:29:24 +01:00
1ea7755232 Merge pull request #2742 from tmael/dsa_mem_leak
Fix mem leak in DSA
2020-01-28 06:25:58 -08:00
43b7258d3b Review comments 2020-01-27 12:44:16 -08:00
91a9117e1b Renesas RA e2studio projects for Client, Server, Test and Benchmark 2020-01-27 13:22:32 -07:00
695b126a1c Merge pull request #2739 from dgarske/pkcs8_ed25519
Added PKCS8 support for ED25519
2020-01-24 10:56:40 -08:00
b9f39b7c06 Merge pull request #2759 from ejohnstown/config-maint
Deprecate some configure flags
2020-01-24 10:40:19 -08:00
126dceee1f Merge pull request #2763 from SparkiDev/sp_int_div_word
Add support to sp_int.c for platforms that do not divide an sp_int_wo…
2020-01-23 18:37:04 -08:00
b4cadae4e2 Constant time q modinv p in RSA key gen 2020-01-23 14:52:29 -08:00
ec877aa91e Add support to sp_int.c for platforms that do not divide an sp_int_word by an sp_int_digit 2020-01-23 14:39:19 -08:00
945d34533c Merge pull request #2727 from JacobBarthelmeh/Windows
update to ECC key parsing custom curves for Windows
2020-01-23 13:57:06 -08:00
d1e39668aa Merge pull request #2740 from aaronjense/compatibility-fixes
Compatibility Layer Fixes
2020-01-23 08:25:40 -08:00
c7340fd90b Merge pull request #2750 from ejohnstown/mingw
mingw update
2020-01-23 08:00:15 -08:00
1c56d62753 Merge pull request #2754 from dgarske/crypttest_3072
wolfCrypt Test 3072-bit Support
2020-01-23 07:55:19 -08:00
d9253afc04 add close on pre to echoserver example 2020-01-22 16:23:46 -08:00
f2db85c07c Deprecate some configure flags
1. Add C_EXTRA_FLAGS and C_FLAGS to CFLAGS.
2. Remove the cached copied of C_EXTRA_FLAGS and C_FLAGS.
3. The option.h is set only on CFLAGS, CPPFLAGS, and the AM_ versions.
2020-01-22 14:26:16 -08:00
06e3c90073 Merge pull request #2732 from kaleb-himes/ZD9730-spellchecker
Fixing some typos. Thanks to Fossies for the report
2020-01-22 13:52:56 -08:00
e3efdc4b5d Merge pull request #2755 from SparkiDev/rsa_enc_3072
Fix masking of 16 bits
2020-01-22 13:40:21 -08:00
55d485cc45 Fix masking of 16 bits 2020-01-22 10:39:36 -08:00
b022b651b3 wolfCrypt test fixes for hard coded "256" byte buffers to support 3072-bit RSA. Requires PR #2755 2020-01-22 10:04:53 -08:00
84a878bda2 Fix for include .am issue. 2020-01-22 09:11:00 -08:00
2a5c623c97 Fix for RSA without SHA512 build error. Fix or renew cert PEM to DER. 2020-01-22 08:15:34 -08:00
e3e862c8b6 Test case fixes for sig wrapper test and DH. 2020-01-21 22:25:11 -08:00
4d9dbc9ec3 Adds 3072-bit RSA tests using USE_CERT_BUFFERS_3072. 2020-01-21 22:16:54 -08:00
37cad6e9ba %zu, pragma: not supported, 2020-01-22 08:12:51 +09:00
aabdec214e MinGW uses the Win32 setsockopt() function which uses a char for
SO_REUSEADDR's option. Everything else uses an int.
2020-01-21 10:53:19 -08:00
2cd3474e9d Improve "keyFormat" to always set based on "algId" and let the later key parsing code produce failure. 2020-01-20 20:49:55 -08:00
0489cc97a8 Fix for ProcessBuffer with PEM private keys, where PemToDer call was only setting eccKey. Cleanup to use "keyFormat" OID sum. 2020-01-20 20:49:55 -08:00
de8e5ffd6e Cleanup asn.c use of WOLFSSL_LOCAL (only required in the header). 2020-01-20 20:49:55 -08:00
77426e78e1 Added test case for PKCS8 ED25519 encrypted private key. 2020-01-20 20:47:47 -08:00
40c8562dc2 Added PKCS8 support for ED25519. 2020-01-20 20:47:47 -08:00
7707234901 Merge pull request #2743 from JacobBarthelmeh/Compatibility-Layer
adjust set1 curves list function for TLS extension sent
2020-01-20 16:19:55 -08:00
98f14eff9f Refactor to combine duplicate ECC param parsing code. 2020-01-20 16:17:12 -08:00
23427085af 1. Add an indent to a new line in user settings.
2. Remove the execute bit from the changed files.
2020-01-20 12:30:32 -08:00
a08ab1fc7a fix mnGW error 2020-01-20 12:19:18 -08:00
c581c56999 update return value of local GetCurveByOID 2020-01-20 10:40:56 -07:00
3508579f4c add check on NETX duo build and return value of opening driver 2020-01-20 09:33:14 -07:00
a624ae14df Merge pull request #2725 from kaleb-himes/ZD9735
Remove redundant packing flag
2020-01-18 21:21:32 -08:00
66daac4c94 Merge pull request #2709 from JacobBarthelmeh/Testing
set chacha20 similar to aes-ctr when handling leftover stream and add…
2020-01-17 15:05:24 -08:00
356636e88d fix typo 2020-01-17 15:13:52 -07:00
87859f9e81 Merge pull request #2747 from dgarske/sizeof_long
Improvements for detection of 64-bit support
2020-01-17 15:10:44 -07:00
204ef9543a Merge pull request #2728 from ejohnstown/maint-x509
Maintenance: X509
2020-01-17 13:51:02 -08:00
92877a1214 Merge pull request #2730 from SparkiDev/sp_div_word_fix
Fix for div_word builds of SP C code
2020-01-17 13:15:44 -08:00
60afa72330 Merge pull request #2731 from SparkiDev/auth_key_id_set
Fix when extAuthKeyIdSet is set.
2020-01-17 13:14:22 -08:00
cca545f76c Merge pull request #2735 from dgarske/ecc_sign
Fixes for ECC sign with `WOLFSSL_ECDSA_SET_K`
2020-01-17 13:13:38 -08:00
dadcce3eb8 Merge pull request #2741 from SparkiDev/ecc_no_cache
Fix for ecc and no cache resistance - set M[2]
2020-01-17 13:09:53 -08:00
c5932a9874 account for leantls and selftest builds 2020-01-17 13:32:59 -07:00
9760ed07a9 Based on peer feedback, remove WOLFSSL_PACK from sniffer.h 2020-01-17 12:27:46 -07:00
bd4a9c69dd convert name to oidsum to curve type for setting supported curves 2020-01-17 11:56:46 -07:00
d8c5353466 adjust set1 curves list function for TLS extension sent 2020-01-16 13:21:14 -07:00
c38d5e9a29 Further improved to use HAVE_LIMITS_H and ULL instead of ui64 2020-01-16 09:06:44 -08:00
541bf3e639 Improvements for detection of 64-bit support. Adds support for IBM s390x. Improves detection on Windows. Adds new WC_USE_LIMITS_FOR_SIZEOF option to use limits.h to detect sizeof long. Fixes #2600 and Fixes #2745. 2020-01-16 07:15:18 -08:00
fbf91f7397 Fix mem leak in DSA 2020-01-15 16:03:42 -08:00
584d8498f8 Fix for ecc and no cache resistance - set M[2]
Need to have a value in order to maintain timing resistance.
Small maths fails also.
2020-01-16 09:35:34 +10:00
3db7b44be4 Compatibility Layer Fixes 2020-01-15 13:49:47 -07:00
bd44091111 refactor solution 2020-01-15 09:29:10 -07:00
c01cd808da changes for build with s7g2
add project info

add project info

adjust wolfssl library template

change TRNG collection

fix include.am

fix argument for TRNG

rename example templates

comment out DEBUG_WOLFSSL

change include.am

update license
2020-01-14 17:48:41 -07:00
989f3d3684 Fix for FREE_VAR call on sharedA. 2020-01-14 14:35:20 -08:00
e429dd8f0b Peer review feedback minor cleanup. 2020-01-14 14:33:23 -08:00
e9bbf89287 Fix for WOLFSSL_ECDSA_SET_K with normal math. The sign_k mp_int was not initialized. 2020-01-14 14:13:12 -08:00
95b6076fe1 Fixes for ECC sign with WOLFSSL_ECDSA_SET_K, which was not loading all curve params for the wc_ecc_make_pub_ex call and not correctly setting ALLOC_CURVE_SPECS for WOLFSSL_SMALL_STACK. Cleanup around the loading of curve specs. 2020-01-13 16:25:37 -08:00
22f49d8597 Fixes for building with ECC sign/verify only. 2020-01-13 15:35:08 -08:00
8974827fbe Added WOLFSSL_ECC_CURVE_STATIC build option to allow using fixed arrays for ECC parameters. This is enabled by default on Windows. Fixed several compiler warnings. Fixed build macro for key->deallocSet. 2020-01-13 07:15:17 -08:00
c69bd5169f Switch strncpy to memcpy in the altname store function. 2020-01-10 20:34:14 -08:00
8d1b20706c Maintenance: X509
1. Add a test for the new alt name handling.
2. Added an API to set altnames in a WOLFSSL_X509 struct. Just adds
DNS_entries.
3. Removed the "static" from a bunch of constant byte arrays used inside
some of the ASN.1 code.
2020-01-10 20:26:35 -08:00
5dcffa6b40 Maintenance: X509
1. Fix for issue #2724. When making a certificate out of an X.509
structure, the subject alt names weren't getting correctly copied.
2. Added a function to flatten the DNS_entries into a sequence of
GeneralNames.
3. Put the proper certificate extension wrapping around the flattened
general names.
2020-01-10 20:26:35 -08:00
7571fbdbfb Maintenance: X509
1. Fix for issue #2718. Added a flag to the X509 structure when someone
sets the issuer name.
2. When making a certificate out of the X509, if the issuer name is set
clear the self-signed flag in the cert.
3. Propigate the flat X509_NAMEs to the string the cert building code
uses.
2020-01-10 20:25:43 -08:00
6b4551c012 Merge pull request #2654 from cariepointer/qt-512-513
Add Qt 5.12 and 5.13 support
2020-01-10 17:34:23 -07:00
71f8f3031d Merge pull request #2729 from dgarske/telit_time
Fixes for the Telit time functions
2020-01-10 14:51:39 -08:00
1f104e52a3 Merge pull request #2715 from ejohnstown/maint-dtls
Maintentance: DTLS
2020-01-10 14:43:15 -08:00
9b8d4e91c2 Fixing some typos. Thanks to Fossies for the report 2020-01-10 11:45:51 -07:00
544ff3f9ac Fix length in wolfSSL_sk_CIPHER_description 2020-01-10 11:26:57 -07:00
99d657af4f adjust test cases 2020-01-10 10:31:56 -07:00
26a075cfec Merge pull request #2716 from cariepointer/apache-fixes
Fixes for Apache nightly Jenkins tests
2020-01-10 10:20:43 -07:00
ef99086aee Fix valgrind errors 2020-01-10 10:08:39 -07:00
de3536a067 More fixes from review 2020-01-09 17:28:20 -07:00
0c25588ad1 adjust TEST_SMALL_CHACHA_CHUNKS size and add more tests 2020-01-09 17:13:57 -07:00
1538e631a8 revert size of ChaCha structure and delay counter increment 2020-01-09 16:39:48 -07:00
a1944c477a set chacha20 counter in TLS AEAD use 2020-01-09 16:39:48 -07:00
8e24bf6c2c add macro guard for optimized versions 2020-01-09 16:39:48 -07:00
0ec7b311d8 set chacha20 similar to aes-ctr when handling leftover stream and add test case 2020-01-09 16:39:48 -07:00
a9cf16cc2b Merge branch 'master' into apache-fixes 2020-01-09 16:33:35 -07:00
6e8f3faedd Fix when extAuthKeyIdSet is set.
Was set when extension is seen - extension may not have hash.
But is used to indicate that the hash is set - ie look up by hash.
2020-01-10 09:28:45 +10:00
03c42423eb Fix for div_word builds of SP C code 2020-01-10 09:02:26 +10:00
f3b2815e1f Merge pull request #2708 from julek-wolfssl/nginx-fix
Nginx fix
2020-01-09 15:00:59 -08:00
3c9f7809f1 Merge pull request #2714 from JacobBarthelmeh/Docs
update linux sgx readme for wolfssl/options.h creation
2020-01-09 14:58:22 -08:00
51f44cb09b Merge pull request #2719 from dgarske/nxp_k64_mmcau
Fixes for NXP K64
2020-01-09 14:57:11 -08:00
21f82a5662 Merge pull request #2721 from SparkiDev/sp_small_stack_fixes
Fix in SP C impl for small stack
2020-01-09 14:55:44 -08:00
99045a2fea Merge pull request #2723 from SparkiDev/rsa_vfy_only_fix
Rsa vfy only fix
2020-01-09 14:55:10 -08:00
3ea69676eb Merge pull request #2726 from ejohnstown/maint-ren
Maintenance: Secure Renegotiation
2020-01-09 14:54:13 -08:00
11a0b117f8 Merge pull request #2706 from dgarske/chapoly_aead_iuf
New API's for ChaCha20/Poly1305 AEAD init/update/final
2020-01-09 14:49:26 -08:00
0938cdde52 Remove dup->dynamicName = 1 call 2020-01-09 14:09:38 -08:00
47040f1dae EC_KEY_dup fixes 2020-01-09 14:35:57 -07:00
8fb586f3ee Fixes for the Telit time functions. ZD 9733 2020-01-09 11:17:19 -08:00
41f134ae31 update to ECC key parsing custom curves for Windows 2020-01-08 14:45:59 -07:00
1f0f3eb97d Maintenance: Secure Renegotiation
Allow sending application data during the secure renegotiation.
2020-01-08 11:50:18 -08:00
b9c99709f7 Fixes from review 2020-01-08 12:48:01 -07:00
187702efb9 bring sniffer.h inline with types.h 2020-01-08 09:45:59 -07:00
bc1cb4ead8 Fix to keep existing behavior where AAD is optional for wc_ChaCha20Poly1305_Encrypt and wc_ChaCha20Poly1305_Decrypt. 2020-01-07 18:58:26 -08:00
f13cee2689 Add comments above functions 2020-01-07 17:30:25 -07:00
b27ec58d20 Fix RSA verify only build 2020-01-08 10:18:37 +10:00
28cf563c76 Fixes from PR review: styling and formatting, remove duplicate code 2020-01-07 17:01:53 -07:00
89d8a90781 Get code compiling with SP math and RSA key gen again. 2020-01-08 09:51:26 +10:00
1f1a173d56 Fix in SP C impl for small stack
Memset correct size and only when pointer is not NULL.
2020-01-08 08:57:20 +10:00
d257003341 Merge pull request #2711 from cconlon/copyright2020
update copyright to 2020
2020-01-07 08:40:15 -08:00
190623cbb2 Merge pull request #2705 from dgarske/atecc_leak
Fix for possible ECC memory leak when using ATECC and TLS
2020-01-07 08:39:39 -08:00
709d17904a Merge pull request #2693 from SparkiDev/mp_rand
Improve speed of mp_rand
2020-01-07 08:39:11 -08:00
9e4836a863 Fix for jenkins test failure 2020-01-07 08:11:05 -08:00
b7ac709617 Merge pull request #2692 from SparkiDev/rsa_gen_modinv
Add blinding of mod inverse to RSA key gen
2020-01-07 07:56:38 -08:00
56e57f3216 Refactor Poly1305 AEAD / MAC to reduce duplicate code. Tested with TLS v1.3 interop and AEAD test vectors. 2020-01-07 07:04:01 -08:00
0f0d307b76 Fix to avoid duplicate symbol for CheckRunTimeSettings when SP and TFM are built. Specifically with these build options: USE_FAST_MATH, WOLFSSL_SP and WOLFSSL_SP_MATH. 2020-01-07 05:43:59 -08:00
acfe9717f8 Fix for K64 MMCAU with WOLFSSL_SMALL_STACK_CACHE. Moved random test prior to cipher tests (was getting called first time in GMAC test). 2020-01-07 05:39:17 -08:00
914cd00e40 Merge pull request #2717 from SparkiDev/sp_cortexm_r7
Don't use r7 with Cortex-M SP assembly
2020-01-07 05:28:43 -08:00
e0ab92058b Check CRL extension errors but don't require them 2020-01-07 11:55:07 +01:00
34a462b342 Don't use r7 with Cortex-M SP assembly
r7 not available when compiling Cortex-M4 in debug.
2020-01-07 12:53:34 +10:00
d68d5229e1 Refactor wc_ChaCha20Poly1305_Encrypt and wc_ChaCha20Poly1305_Decrypt to use the new ChaChaPoly_Aead context and init/update/final functions. 2020-01-06 17:07:09 -08:00
681ecf0e58 Fixes for wolfSSL_CTX_load_verify_locations_ex 2020-01-06 14:32:32 -08:00
991ee662c0 Return 0 in ParseCRL_Extensions if there are no CRL extensions to parse 2020-01-06 08:42:37 -08:00
f593ff8776 update linux sgx readme for wolfssl/options.h creation 2020-01-06 09:27:17 -07:00
ce0475a8e0 Merge pull request #2689 from tmael/pkey_freeMutex
Free EVP ctx pkey
2020-01-06 23:15:00 +07:00
75637445ee Improve speed of mp_rand 2020-01-06 09:39:29 +10:00
26eea36d7f Fix X509_NAME issues for Apache 2020-01-03 15:40:52 -08:00
45c5a2d39c update copyright to 2020 2020-01-03 15:06:03 -08:00
443b7ed0c4 Accept newline and null teminator at end of X509 certificate 2020-01-02 10:52:02 +01:00
01c7cc6502 Fixes to avoid declaring any variables mid-function and always initializing. 2019-12-31 11:43:13 -08:00
784d95afbe Improved state handling. 2019-12-31 10:34:06 -08:00
7d2adb2fc0 Merge pull request #2707 from tmael/rsa_cc310
Cryptocell RSA improvements to sign/verify more digest types
2019-12-31 09:19:25 -08:00
bff6dcec24 Added support for AAD calc only. Allows Init, UpdateAad and Final sequence. Verfied again with customer test cases. 2019-12-31 08:25:23 -08:00
f01999b322 Peer review feedback. 2019-12-31 08:08:33 -08:00
b901a2cd35 Use byte for bit-field. Line length cleanup. 2019-12-30 18:05:25 -08:00
4f71bcfa7c Merge pull request #2704 from ejohnstown/renegotiation
Maintenance: Renegotiation
2019-12-30 16:45:31 -08:00
f58a9e81e9 Cryptocell rsa improvements to sign/verify more digest types 2019-12-30 16:31:30 -08:00
1ee9d182cf New API's for ChaCha20/Poly1305 AEAD init/update/final:
* Provides a context for AEAD to allow "chunked" updates of data then a final calculation for the authentication tag.
* New API's are on by default and can be disabled using NO_CHACHAPOLY_AEAD_IUF.
2019-12-30 15:20:55 -08:00
abc96f20fb Merge pull request #2696 from embhorn/cert_vfy_CB
CertManager verify callback
2019-12-30 11:57:44 -08:00
1bf6eb466f CRL extensions are optional so ext errors should be skipped 2019-12-30 19:08:59 +01:00
4004963c6a test pkey references count 2019-12-30 09:31:23 -08:00
f51d940e34 Fix for ECC memory leak when using ATECC and non SECP256R1 curves for sign, verify or shared secret. Fixes #2701. 2019-12-30 08:35:30 -08:00
3b7b71c9e0 Merge pull request #2700 from JacobBarthelmeh/HardwareAcc
Hardware calls for DSP use
2019-12-27 13:58:43 -08:00
deac82c8ed Merge pull request #2683 from dgarske/various_items
Various cleanups and fixes
2019-12-27 13:53:39 -08:00
95daec5326 Merge pull request #2633 from tmael/cc_310
Update Cryptocell readme
2019-12-27 12:58:19 -08:00
78fa84be00 Merge pull request #2649 from SparkiDev/rsa_pubonly
Fix RSA public key only builds
2019-12-27 12:55:34 -08:00
dd28f26c44 Merge pull request #2699 from JacobBarthelmeh/Testing
big endian changes
2019-12-27 12:52:30 -08:00
38f466bdfe Keep untrustedDepth = 0 for self signed certs 2019-12-27 17:48:34 +01:00
add7cdd4e2 Maintenance: Renegotiation
1. Found a corner case where secure renegotiation would fail trying to
inappropriately use a session ticket.
2. Explicitly split renegotiation into Rehandshake and SecureResume.
2019-12-26 16:39:44 -08:00
e8afcbf031 Merge pull request #2702 from embhorn/spelling
Correct misspellings and typos from codespell tool
2019-12-26 08:19:20 -08:00
8580bd9937 CertManager verify callback
Execute verify callback from wolfSSL_CertManagerLoadCA
2019-12-26 09:29:03 -06:00
ac0acb3c37 fix for test case with big endian 2019-12-26 05:57:26 -07:00
b83804cb9d Correct misspellings and typos from codespell tool 2019-12-24 12:29:33 -06:00
ad9011a863 initial DSP build and success with Debug mode
build dps with ARM neon 64

fix for release mode build

add in threading protection and seperate out rng

added callback function and updates to README

update default handle to lock, and add finished handle call

cleanup after veiwing diff of changes
2019-12-23 14:17:58 -07:00
5348ecb1f2 initial makefile and build with hexagon 2019-12-23 13:49:06 -07:00
ca59bc2d16 big endian changes 2019-12-23 12:33:59 -07:00
99a7aff31e Increment pkey references count 2019-12-20 22:38:54 -08:00
48e59eaeb1 Free EVP ctx pkey 2019-12-20 22:38:54 -08:00
9d94b48056 Add blinding of mod inverse to RSA key gen 2019-12-20 12:17:42 +10:00
6c7e86f366 Maintentance: DTLS
1. Client wasn't skipping a handshake state when the server sends a
hello without a hello verify. It ended up resetting the handshake hash
and resending Hello with its next messages.
2019-12-19 11:48:05 -08:00
22f0b145d3 Various cleanups and fixes:
* Fix for key gen macro name in benchmark.c
* Fix for possible RSA fall-through warning.
* Fix for building `WOLFSSL_STM32_PKA` without `HAVE_ECC`.
* Added option to build RSA keygen without the DER to PEM using `WOLFSSL_NO_DER_TO_PEM`.
* Added options.h includes for test.c and benchmark.c.
* Added printf warning on the math size mismatch in test.c.
* Added support for benchmarking larger sizes.
* TLS benchmarks for HiFive unleashed.
2019-12-18 07:09:26 -08:00
69a0c1155f Review comment 2019-12-17 17:36:38 -08:00
5711d12364 Remove SSL_library_init() calls in unit tests to fix valgrind issues 2019-12-17 15:54:10 -07:00
c66ca1b774 Remove unused dNSName malloc from wolfSSL_X509_get_ext_d2i 2019-12-10 17:00:16 -07:00
b08d180bc9 WOLFSSL_DH redefined error fix 2019-12-09 16:13:18 -07:00
4511557f01 More jenkins test fixes 2019-12-09 15:57:53 -07:00
9ad970d8a4 Fixes for jenkins test failures 2019-12-09 14:04:52 -07:00
ee13dfd878 Add Qt 5.12 and 5.13 support
Co-Authored-By: aaronjense <aaron@wolfssl.com>
Co-Authored-By: MJSPollard <mpollard@wolfssl.com>
Co-Authored-By: Quinn Miller <quinnmiller1997@users.noreply.github.com>
Co-Authored-By: Tim Parrish <timparrish@users.noreply.github.com>
2019-12-06 14:27:01 -07:00
2528121925 Fix RSA public key only builds
Client side only and no client auth
2019-12-06 20:42:27 +10:00
4f8a37ef7b Remove wc_RsaSSL_VerifyInline from Cryptocell 2019-12-05 10:40:21 -08:00
889f111454 Update CC readme 2019-12-02 14:55:21 -08:00
996cef6db2 Added stdio.h include to types.h. 2019-07-10 18:26:43 +02:00
1062 changed files with 221300 additions and 118616 deletions

1
.gitignore vendored
View File

@ -78,6 +78,7 @@ tests/unit
testsuite/testsuite.test
tests/unit.test
tests/bio_write_test.txt
tests/test-log-dump-to-file.txt
test-write-dhparams.pem
testsuite/*.der
testsuite/*.pem

150
CMakeLists.txt Normal file
View File

@ -0,0 +1,150 @@
# CMakeList.txt
#
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL. (formerly known as CyaSSL)
#
# Usage:
# $ mkdir build
# $ cd build
# $ cmake ..
# $ cmake --build .
# To build library only and not build examples and test apps use:
# $ cmake .. -DBUILD_TESTS=NO
# To build with debugging use:
# $ cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake_minimum_required (VERSION 2.6)
####################################################
# Project
####################################################
project(wolfssl)
find_package (Threads)
####################################################
# Compiler
####################################################
# Let CMake choose default compiler
# Silence ranlib warning "has no symbols"
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
####################################################
# Cross Compile Example
####################################################
#set(CMAKE_SYSTEM_NAME Linux)
#set(CMAKE_SYSTEM_PROCESSOR arm)
#set(CMAKE_C_COMPILER "/opt/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc")
#set(CMAKE_CXX_COMPILER "/opt/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-g++")
#set(CMAKE_SYSROOT "/opt/arm-linux-musleabihf-cross/arm-linux-musleabihf/")
# Example for setting CFLAGS
#set(CMAKE_C_FLAGS "-std=gnu89 ${CMAKE_C_FLAGS}")
# Example for map file and custom linker script
#set(CMAKE_EXE_LINKER_FLAGS " -Xlinker -Map=output.map -T\"${CMAKE_CURRENT_SOURCE_DIR}/linker.ld\"")
####################################################
# Build Options
####################################################
SET(BUILD_TESTS YES CACHE BOOL "Build test applications")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/options.h")
# Copy generated ./options.h
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/options.h
${CMAKE_CURRENT_BINARY_DIR}/user_settings.h)
else()
# Use template
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/options.h.in
${CMAKE_CURRENT_BINARY_DIR}/user_settings.h)
endif()
add_definitions(-DWOLFSSL_USER_SETTINGS)
add_definitions(-DWOLFSSL_IGNORE_FILE_WARN)
if(CMAKE_HAVE_PTHREAD_H)
add_definitions(-DHAVE_PTHREAD)
endif()
####################################################
# Source Files
####################################################
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/.)
file(GLOB LIB_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/*.c
${CMAKE_CURRENT_SOURCE_DIR}/wolfcrypt/src/*.c)
file(GLOB TEST_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.c
${CMAKE_CURRENT_SOURCE_DIR}/examples/server/server.c
${CMAKE_CURRENT_SOURCE_DIR}/examples/client/client.c)
####################################################
# Output Files
####################################################
# Build wolfssl library
add_library(wolfssl ${LIB_SOURCE_FILES})
if(WIN32)
# For Windows link ws2_32
target_link_libraries(wolfssl PUBLIC $<$<PLATFORM_ID:Windows>:ws2_32>)
else()
# DH requires math (m) library
target_link_libraries(wolfssl PUBLIC m)
endif()
# Optionally build example and test applications
if(BUILD_TESTS)
# Build wolfCrypt test
add_executable(wolfcrypttest
${CMAKE_CURRENT_SOURCE_DIR}/wolfcrypt/test/test.c)
target_link_libraries(wolfcrypttest wolfssl)
# Build wolfCrypt benchmark
add_executable(wolfcryptbench
${CMAKE_CURRENT_SOURCE_DIR}/wolfcrypt/benchmark/benchmark.c)
target_link_libraries(wolfcryptbench wolfssl)
# Build wolfSSL Client example
add_executable(client
${CMAKE_CURRENT_SOURCE_DIR}/examples/client/client.c)
target_link_libraries(client wolfssl)
# Build wolfSSL Server example
add_executable(server
${CMAKE_CURRENT_SOURCE_DIR}/examples/server/server.c)
target_link_libraries(server wolfssl)
# Build Echo Client Example
add_executable(echoclient
${CMAKE_CURRENT_SOURCE_DIR}/examples/echoclient/echoclient.c)
target_link_libraries(echoclient wolfssl)
# Build Echo Server Example
add_executable(echoserver
${CMAKE_CURRENT_SOURCE_DIR}/examples/echoserver/echoserver.c)
target_link_libraries(echoserver wolfssl)
# Build TLS benchmark example
add_executable(tls_bench
${CMAKE_CURRENT_SOURCE_DIR}/examples/benchmark/tls_bench.c)
target_link_libraries(tls_bench wolfssl)
target_link_libraries(tls_bench Threads::Threads)
# Build Unit Tests
add_executable(unit_test
${TEST_SOURCE_FILES})
set_target_properties( unit_test PROPERTIES COMPILE_FLAGS "-DNO_MAIN_DRIVER" )
target_link_libraries(unit_test wolfssl)
target_link_libraries(unit_test Threads::Threads)
endif()
# TODO: Add install() for library, headers and test applications

View File

@ -1,3 +1,266 @@
# wolfSSL Release 4.5.0 (August 19, 2020)
If you have questions about this release, feel free to contact us on our
info@ address.
Release 4.5.0 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* Added Xilinx Vitis 2019.2 example and README updates
* TLS v1.3 is now enabled by default
* Building FIPS 140-2 code and test on Solaris
* Secure renegotiation with DTLS 1.2
* Update RSA calls for hardware acceleration with Xilsecure
* Additional OpenSSL compatibility layer functions added
* Cypress PSoC6 wolfCrypt driver added
* Added STM32CubeIDE support
* Added certificate parsing and inspection to C# wrapper layer
* TLS v1.3 sniffer support added
* TSIP v1.09 for target board GR-ROSE support added
* Added support for the "X72N Envision Kit" evaluation board
* Support for ECC nonblocking using the configure options
"--enable-ecc=nonblock --enable-sp=yes,nonblock CFLAGS=-DWOLFSSL_PUBLIC_MP"
* Added wc_curve25519_make_pub function to generate a public key given the
private one
## Fixes
* PIC32MZ hardware cache and large hashes fix
* AES-GCM use with EVP layer in compatibility layer code
* Fix for RSA_LOW_MEM with ARM build of SP code
* Sanity check on tag length with AES-CCM to conform with RFC 3610
* Fixes for 32 and 64 bit software implementations of SP code when
WOLFSSL_SP_CACHE_RESISTANT is defined
* GCC warning fixes for GCC 9 and later
* Sanity check on HKDF expand length to conform with RFC 5869
* Fixes for STM32 CubeMX HAL with AES-GCM
* Fixed point cache look up table (LUT) implementation fixes
* Fix for ARM 32bit SP code when calling div word
* Fix for potential out of bounds read when parsing CRLs
* Fix for potential out of bounds read with RSA unpadding
* AES-CCM optimized counter fix
* Updates to Xcode projects for new files and features
* Fix for adding CRLs to a WOLFSSL_X509_STORE structure
* FIPSv2 build with opensslall build fixes
* Fixes for CryptoCell use with ECC and signature wrappers
* Fix for mod calculation with SP code dealing with 3072 bit keys
* Fix for handling certificates with multiple OUs in name
* Fix for SP math implementation of sp_add_d and add a sanity check on
rshb range
* Fix for sanity check on padding with DES3 conversion of PEM to DER
* Sanity check for potential out of bounds read with fp_read_radix_16
* Additional checking of ECC scalars.
* Fixing the FIPS Ready build w.r.t. ecc.c.
* When processing certificate names with OpenSSL compatibility layer
enabled, unknown name item types were getting handled as having NID 0,
and failing. Added a couple more items to what is handled correctly,
and ignoring anything that is an unknown type.
## Improvements/Optimizations
* TLS 1.3 certificate verify update to handle 8192 bit RSA keys
* wpa_supplicant support with reduced code size option
* TLS 1.3 alerts encrypted when possible
* Many minor coverity fixes added
* Error checking when parsing PKCS12 DER
* IAR warning in test.c resolved
* ATECC608A improvements for use with Harmony 3 and PIC32 MZ
* Support for AES-GCM and wc_SignatureVerifyHash with static memory and no
mallocs
* Enable SNI by default with JNI/JSSE builds
* NetBSD GCC compiler warnings resolved
* Additional test cases and code coverage added including curve25519 and
curve448 tests
* Option for user defined mutexes with WOLFSSL_USER_MUTEX
* Sniffer APIs for loading buffer directly
* Fixes and improvements from going through the DO-178 process were added
* Doxygen updates and fixes for auto documentation generation
* Changed the configure option for FIPS Ready builds to be
`--enable-fips=ready`.
## This release of wolfSSL includes fixes for 6 security vulnerabilities.
wolfSSL version 4.5.0 contains 6 vulnerability fixes: 2 fixes for TLS 1.3,
2 side channel attack mitigations, 1 fix for a potential private key leak
in a specific use case, 1 fix for DTLS.
* In earlier versions of wolfSSL there exists a potential man in the middle
attack on TLS 1.3 clients. Malicious attackers with a privileged network
position can impersonate TLS 1.3 servers and bypass authentication. Users
that have applications with client side code and have TLS 1.3 turned on,
should update to the latest version of wolfSSL. Users that do not have
TLS 1.3 turned on, or that are server side only, are NOT affected by this
report. Thanks to Gerald Doussot from NCC group for the report.
* Denial of service attack on TLS 1.3 servers from repetitively sending
ChangeCipherSpecs messages. This denial of service results from the
relatively low effort of sending a ChangeCipherSpecs message versus the
effort of the server to process that message. Users with TLS 1.3 servers are
recommended to update to the most recent version of wolfSSL which limits the
number of TLS 1.3 ChangeCipherSpecs that can be received in order to avoid
this DoS attack. CVE-2020-12457 was reserved for the report. Thanks to
Lenny Wang of Tencent Security Xuanwu LAB.
* Potential cache timing attacks on public key operations in builds that are
not using SP (single precision). Users that have a system where malicious
agents could execute code on the system, are not using the SP build with
wolfSSL, and are doing private key operations on the system (such as signing
with a private key) are recommended to regenerate private keys and update to
the most recent version of wolfSSL. CVE-2020-15309 is reserved for this
issue. Thanks to Ida Bruhns from Universität zu Lübeck for the report.
* When using SGX with EC scalar multiplication the possibility of side-channel
attacks are present. To mitigate the risk of side channel attacks wolfSSLs
single precision EC operations should be used instead. Release 4.5.0 turns
this on be default now with SGX builds and in previous versions of wolfSSL
this can be turned on by using the WOLFSSL_SP macros. Thank you to
Alejandro Cabrera Aldaya, Cesar Pereida García and Billy Bob Brumley from
the Network and Information Security Group (NISEC) at Tampere University for
the report.
* Leak of private key in the case that PEM format private keys are bundled in
with PEM certificates into a single file. This is due to the
misclassification of certificate type versus private key type when parsing
through the PEM file. To be affected, wolfSSL would need to have been built
with OPENSSL_EXTRA (--enable-opensslextra). Some build variants such as
--enable-all and --enable-opensslall also turn on this code path, checking
wolfssl/options.h for OPENSSL_EXTRA will show if the macro was used with the
build. If having built with the opensslextra enable option and having placed
PEM certificates with PEM private keys in the same file when loading up the
certificate file, then we recommend updating wolfSSL for this use case and
also recommend regenerating any private keys in the file.
* During the handshake, clear application_data messages in epoch 0 are
processed and returned to the application. Fixed by dropping received
application_data messages in epoch 0. Thank you to Paul Fiterau of Uppsala
University and Robert Merget of Ruhr-University Bochum for the report.
For additional vulnerability information visit the vulnerability page at
https://www.wolfssl.com/docs/security-vulnerabilities/
See INSTALL file for build instructions.
More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
# wolfSSL Release 4.4.0 (04/22/2020)
If you have questions about this release, then feel free to contact us on our
info@ address.
Release 4.4.0 of wolfSSL embedded TLS has bug fixes and new features including:
## New Feature Additions
* Hexagon support.
* DSP builds to offload ECC verify operations.
* Certificate Manager callback support.
* New APIs for running updates to ChaCha20/Poly1305 AEAD.
* Support for use with Apache.
* Add support for IBM s390x.
* PKCS8 support for ED25519.
* OpenVPN support.
* Add P384 curve support to SP.
* Add BIO and EVP API.
* Add AES-OFB mode.
* Add AES-CFB mode.
* Add Curve448, X448, and Ed448.
* Add Renesas Synergy S7G2 build and hardware acceleration.
## Fixes
* Fix for RSA public encrypt / private sign with RSA key sizes over 2048-bit.
* Correct misspellings.
* Secure renegotiation fix.
* Fix memory leak when using ATECC and non-SECP256R1 curves for sign, verify,
or shared secret.
* Fix for K64 MMCAU with `WOLFSSL_SMALL_STACK_CACHE`.
* Fix the RSA verify only build.
* Fix in SP C implementation for small stack.
* Fix using the auth key id extension is set, hash might not be present.
* Fix when flattening certificate structure to include the subject alt names.
* Fixes for building with ECC sign/verify only.
* Fix for ECC and no cache resistance.
* Fix memory leak in DSA.
* Fix build on minGW.
* Fix `PemToDer()` call in `ProcessBuffer()` to set more than ECC.
* Fix for using RSA without SHA-512.
* Add some close tags to the echoserver HTTP example output.
* Miscellaneous fixes and updates for static analysis reports.
* Fixes for time structure support.
* Fixes for VxWorks support.
* Fixes for Async crypto support.
* Fix cache resist compile to work with SP C code.
* Fixes for Curve25519 x64 asm.
* Fix for SP x64 div.
* Fix for DTLS edge case where CCS and Finished come out of order and the
retransmit pool gets flushed.
* Fix for infinite loop in SHA-1 with small inputs. Thanks to Peter W.
* Fix for FIPS Hmac where `wc_HmacInit()` isn't used. `wc_HmacSetKey()` needs
to initialize the Hmac structure. Type is set to NONE, and checked against
NONE, not 0.
* Fixes for SP RSA private operations.
* Fixes for Xilinx SDK and Zynq UltraScale+ MPSoC
* Fix leak when building with HAVE_AESGCM and NO_AES_DECRYPT. Thanks G.G.
* Fixes for building ECC without ASN.
* Fix for async TLSv1.3 issues.
* Fix `wc_KeyPemToDer()` with PKCS1 and empty key.
* Omit `-fomit-frame-pointer` from CFLAGS in configure.ac.
## Improvements/Optimizations
* Qt 5.12 and 5.13 support.
* Added more digest types to Cryptocell RSA sign/verify.
* Some memory usage improvements.
* Speed improvements for mp_rand.
* Improvements to CRL and OCSP support.
* Refactor Poly1305 AEAD/MAC to reduce duplicate code.
* Add blinding to RSA key gen.
* Improvements to blinding.
* Improvement and expansion of OpenSSL Compatibility Layer.
* Improvements to ChaCha20.
* Improvements to X.509 processing.
* Improvements to ECC support.
* Improvement in detecting 64-bit support.
* Refactor to combine duplicate ECC parameter parsing code.
* Improve keyFormat to be set by algId and let later key parsing produce fail.
* Add test cases for 3072-bit and 4096-bit RSA keys.
* Improve signature wrapper and DH test cases.
* Improvements to the configure.ac script.
* Added constant time RSA q modinv p.
* Improve performance of SP Intel 64-bit asm.
* Added a few more functions to the ABI list.
* Improve TLS bidirectional shutdown behavior.
* OpenSSH 8.1 support.
* Improve performance of RSA/DH operations on x64.
* Add support for PKCS7/CMS Enveloped data with fragmented encrypted content.
* Example linker description for FIPS builds to enforce object ordering.
* C# wrapper improvements. Added TLS client example and TLSv1.3 methods.
* Allow setting MTU in DTLS.
* Improve PKCS12 create for outputting encrypted bundles.
* Constant time EC map to affine for private operations.
* Improve performance of RSA public key ops with TFM.
* Smaller table version of AES encrypt/decrypt.
* Support IAR with position independent code (ROPI).
* Improve speed of AArch64 assembly.
* Support AES-CTR on esp32.
* Add a no malloc option for small SP math.
## This release of wolfSSL includes fixes for 2 security vulnerabilities.
* For fast math, use a constant time modular inverse when mapping to affine
when operation involves a private key - keygen, calc shared secret, sign.
Thank you to Alejandro Cabrera Aldaya, Cesar Pereida García and
Billy Bob Brumley from the Network and Information Security Group (NISEC)
at Tampere University for the report.
* Change constant time and cache resistant ECC mulmod. Ensure points being
operated on change to make constant time. Thank you to Pietro Borrello at
Sapienza University of Rome.
For additional vulnerability information visit the vulnerability page at
https://www.wolfssl.com/docs/security-vulnerabilities/
See INSTALL file for build instructions.
More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
# wolfSSL Release 4.3.0 (12/20/2019)
If you have questions about this release, then feel free to contact us on our info@ address.
@ -1020,7 +1283,7 @@ More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
- Add helper functions for static memory option to allow getting optimum buffer
sizes.
- Update DTLS behavior on bad MAC. DTLS silently drops packets with bad MACs now.
- Update fp_isprime function from libtom enchancement/cleanup repository.
- Update fp_isprime function from libtom enhancement/cleanup repository.
- Update sanity checks on inputs and return values for AES-CMAC.
- Update wolfSSL for use with MYSQL v5.6.30.
- Update LPCXpresso eclipse project to not include misc.c when not needed.
@ -1347,7 +1610,7 @@ More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html
the Prosecco team at INRIA Paris-Rocquencourt for the report.
- FIPS version submitted
- Removes SSLv2 Client Hello processing, can be enabled with OLD_HELLO_ALLOWED
- User can set mimimum downgrade version with CyaSSL_SetMinVersion()
- User can set minimum downgrade version with CyaSSL_SetMinVersion()
- Small stack improvements at TLS/SSL layer
- TLS Master Secret generation and Key Expansion are now exposed
- Adds client side Secure Renegotiation, * not recommended *
@ -2014,7 +2277,7 @@ works but seems to remove sockets from TIME_WAIT entirely?
`sudo sysctl -w net.ipv4.tcp_fin_timeout=1`
doen't control TIME_WAIT, it controls FIN_WAIT(2) contrary to some posts
doesn't control TIME_WAIT, it controls FIN_WAIT(2) contrary to some posts
# CyaSSL Release 1.4.0 (2/18/2010)

View File

@ -1,6 +1,6 @@
/* wolfssl_client.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfssl_server.ino
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -32,6 +32,14 @@ if [ "$DIR" = "ARDUINO" ]; then
mv ./wolfSSL/bio.c ./wolfSSL/wolfssl
mv ./wolfSSL/evp.c ./wolfSSL/wolfssl
# make a copy of evp.c and bio.c for ssl.c to include inline
cp ./wolfSSL/wolfssl/evp.c ./wolfSSL/wolfcrypt/src/evp.c
cp ./wolfSSL/wolfssl/bio.c ./wolfSSL/wolfcrypt/src/bio.c
# copy openssl compatibility headers to their appropriate location
mkdir ./wolfSSL/wolfssl/openssl
cp ../../wolfssl/openssl/* ./wolfSSL/wolfssl/openssl
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

View File

@ -22,13 +22,15 @@ The `IDE/CRYPTOCELL/main.c` example application provides a function to run the s
- SHA-256
- AES CBC
- CryptoCell 310 RNG
- RSA sign/verify and RSA key gen
- RSA sign/verify and RSA key gen (2048 bit in PKCSv1.5 padding mode)
- RSA encrypt/decrypt
- ECC sign/verify/shared secret
- ECC key import/export and key gen pairs
- Hardware RNG
- RTC for benchmark timing source
Note: All Cryptocell features are not supported. The wolfcrypt RSA API allows import and export of Private/Public keys in DER format. However, this is not possible with key pairs generated with Cryptocell because the importing/exporting Cryptocell keys has not been implemented yet.
## 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.

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2019 wolfSSL Inc.
* Copyright (C) 2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2019 wolfSSL Inc.
* Copyright (C) 2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* deos_malloc.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* tls_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -380,10 +380,7 @@ void wolfssl_server_test(uintData_t statusPtr)
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;
@ -572,7 +569,6 @@ int wolfsslRunTests (void)
{
thread_handle_t TCPhandle;
threadStatus ts;
int ret;
#if !defined(NO_CRYPT_TEST)
wolfcrypt_test(NULL);

View File

@ -1,6 +1,6 @@
/* tls_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* client_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* client_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* server_wolfssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* server_wolfssl.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_setting.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfsslRunTests.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* config.h - dummy
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* helper.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* client-tls-callback.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -92,7 +92,7 @@ static void tls_smp_client_init(void)
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_CLIENT_TASK_NAME);
}
}
/* event hander for wifi events */
/* event handler for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
switch (event->event_id)

View File

@ -1,6 +1,6 @@
/* wifi_connect.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* server-tls-callback.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -64,7 +64,7 @@ static void ShowCiphers(void)
#include "wolfssl/wolfcrypt/port/atmel/atmel.h"
/* when you want to use a custom slot allocation */
/* enable the difinition CUSTOM_SLOT_ALLOCATION. */
/* enable the definition CUSTOM_SLOT_ALLOCATION. */
#if defined(CUSTOM_SLOT_ALLOCATION)

View File

@ -1,6 +1,6 @@
/* wifi_connect.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -35,7 +35,7 @@ const static int CONNECTED_BIT = BIT0;
static EventGroupHandle_t wifi_event_group;
/* prefix for logging */
const static char *TAG = "tls_server";
/* proto-type difinition */
/* proto-type definition */
extern void tls_smp_server_task();
static void tls_smp_server_init();
@ -89,7 +89,7 @@ static void tls_smp_server_init(void)
ESP_LOGI(TAG, "create thread %s failed", TLS_SMP_SERVER_TASK_NAME);
}
}
/* event hander for wifi events */
/* event handler for wifi events */
static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
{
switch (event->event_id)
@ -98,8 +98,13 @@ static esp_err_t wifi_event_handler(void *ctx, system_event_t *event)
esp_wifi_connect();
break;
case SYSTEM_EVENT_STA_GOT_IP:
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
ESP_LOGI(TAG, "got ip:" IPSTR "\n",
IP2STR(&event->event_info.got_ip.ip_info.ip));
#else
ESP_LOGI(TAG, "got ip:%s",
ip4addr_ntoa(&event->event_info.got_ip.ip_info.ip));
#endif
/* http://esp32.info/docs/esp_idf/html/dd/d08/group__xEventGroupSetBits.html */
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
break;
@ -120,8 +125,11 @@ void app_main(void)
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
esp_netif_init();
#else
tcpip_adapter_init();
#endif
/* */
#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1
(void) wifi_event_handler;

View File

@ -171,7 +171,7 @@ static void tskAes256_Test(void *pvParam)
}
#endif
#if !defined(NO_RSA) || defined(HAVE_ECC)
#if (!defined(NO_RSA) || defined(HAVE_ECC)) && !defined(WC_NO_RNG)
int mp_performance_check(int mul, int mulmod, int exptmod)
{
@ -280,13 +280,13 @@ int mp_performance_check(int mul, int mulmod, int exptmod)
printf("(%d,%d) Xbits = %d, Ybits = %d Pbits = %d",
i , j, Xbits, Ybits, Pbits);
if(mul) {
printf(" mul = %llu (us)", elapsedTime1);
printf(" mul = %llu (us)", (unsigned long long)elapsedTime1);
}
if(mulmod) {
printf(" mulmod = %llu (us)\n", elapsedTime2);
printf(" mulmod = %llu (us)\n", (unsigned long long)elapsedTime2);
}
if(exptmod) {
printf(" exptmod = %llu (ms)\n", elapsedTime3);
printf(" exptmod = %llu (ms)\n", (unsigned long long)elapsedTime3);
}
}
}
@ -539,20 +539,20 @@ int mp_unitest_exptmod(const char* strZ, const char* strX, const char* strY,
TEST_CASE("wolfssl mp exptmod test" , "[wolfssl]")
{
ESP_LOGI(TAG, "mp test");
int verbose = 0;
int verbose = 1;
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("CE331E6D30A77A57", "1234", "A",
"FFFFFFFFFFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1000000", "1000", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1000000", "2", "128",
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01000000", "1000", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01000000", "2", "128",
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("14B5A90", "1234", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("1234321", "1111", "2", "FFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("014B5A90", "1234", "2", "FFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("01234321", "1111", "2", "FFFFFFFF", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("22", "55", "1", "33", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("222", "555", "1", "333", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("0222", "555", "1", "333", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("2222", "5555", "1", "3333", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("11", "5555", "1", "33", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_exptmod("55", "1111", "1", "77", verbose));
@ -564,14 +564,14 @@ TEST_CASE("wolfssl mp mulmod test" , "[wolfssl]")
ESP_LOGI(TAG, "mp test");
int verbose = 0;
/* Z X Y M */
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("2", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("1", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("2", "-64", "A", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("02", "5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("01", "-5", "1", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("02", "-64", "A", "3", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("74C3AC", "123456", "55555", "AAAAA1", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mulmod("73A068", "123456", "55555", "AAAAA3", verbose));
mp_unitest_mulmod(
"10C530243ADE5EA7C557E9A2FF5B4573195665A89CB921F573267B15CD2BCB6467E925235AA752CC2D08B07D31497B497744CA3685A46E76247439826628589DD814AC9EEE9EF8B4B44BEE2DB6065BE3C51B788E4ECFF39FB28C3D8EBE10FC9989D97CDC6624E32EBD222E222A2E93085FC2D05E4EB73375F7FC7B11E9B3024",
"010C530243ADE5EA7C557E9A2FF5B4573195665A89CB921F573267B15CD2BCB6467E925235AA752CC2D08B07D31497B497744CA3685A46E76247439826628589DD814AC9EEE9EF8B4B44BEE2DB6065BE3C51B788E4ECFF39FB28C3D8EBE10FC9989D97CDC6624E32EBD222E222A2E93085FC2D05E4EB73375F7FC7B11E9B3024",
"A4F780E83C3FAC34878787D4876BA7582E48C7637A26C6E720974FC7416150A3865D44F6D08E3DA38EB4296928C564D9A0008D8A0D63E0B8EF54D14D54FBEAB540E43D2ED6BE54806D9150C1944437CC3D8B2486A1FB932A6691B529E0E2A46524CB0825BA4F4E1B9C24554DB1913169E5373173A3B7CBBF77C3403C8C7AE86A",
"6520379E44C1A2C359342010E1038F8C3644D9A47A9346A80C92B48A6986872D74C3BDDB49B2D93C554B588D4A4448614FADBC066CC10F3EB20A2422EA857B7DD0BF60C9CB7D733B12761BD785BCD122D97ECA0A8F1D0F705BC094B66EE5C96712AE3B14B5AA6AD9E50C6A3020BA01DA4FB94E3934527ADCDB3DE51C368B37C2",
"BE7070B80418E528FE66D89088E0F1B7C3D0D23EE64B9474B0FFB0F763A5AB7EAFB62BB738161A50BFF1CA873AD5B0DAF8437A15B97EEA2A80D251B035AF07F3F25D243A4B8756481B3C249ADA7080BD3C8B034A0C8371DEE30370A2B760091B5EC73DA06460E3A9068DD3FF42BB0A94272D57420DB02DE0BA182560921192F3",
@ -604,11 +604,11 @@ TEST_CASE("wolfssl mp mul test" , "[wolfssl]")
ESP_LOGI(TAG, "mp test");
int verbose = 0;
TEST_ASSERT_EQUAL(0, mp_unitest_mul("A", "5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-A", "-5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("A", "-5", "-2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("6260060", "1234", "5678", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("38E83", "123", "321", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("0A", "5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("-0A", "-5", "2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("0A", "-5", "-2", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("06260060", "1234", "5678", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("038E83", "123", "321", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul("75CD7FCBBC", "123456", "6789A", verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul(
@ -618,7 +618,7 @@ TEST_CASE("wolfssl mp mul test" , "[wolfssl]")
verbose));
TEST_ASSERT_EQUAL(0, mp_unitest_mul(
"33676FE7B625BF0759F7E8932B6B50D5F45E16E1C670AD20F1CDA5DFFA433685937CA8422A9CB916CC8",
"033676FE7B625BF0759F7E8932B6B50D5F45E16E1C670AD20F1CDA5DFFA433685937CA8422A9CB916CC8",
"165196BA298CD54975DC483C4D21A51EA0A146783CFB41522E76E50C",
"24D9D5CA7D9CCC06F5E70F1963E6",
verbose));
@ -636,7 +636,7 @@ TEST_CASE("wolfssl mp mul performance test" , "[wolfssl]")
TEST_ASSERT_EQUAL(0, mp_performance_check(mul, mulmod, exptmod));
}
#endif/* !NO_RSA || HAVE_ECC */
#endif/* (!NO_RSA || HAVE_ECC) && !WC_NO_RNG */
TEST_CASE("wolfssl aes test" , "[wolfssl]")
{

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -43,6 +43,10 @@
#define CURVE25519_SMALL
#define HAVE_ED25519
/* when you want to use aes counter mode */
/* #define WOLFSSL_AES_DIRECT */
/* #define WOLFSSL_AES_COUNTER */
/* esp32-wroom-32se specific definition */
#if defined(WOLFSSL_ESPWROOM32SE)
#define WOLFSSL_ATECC508A

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -171,16 +171,15 @@ extern "C" {
#undef ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
/* Enable cofactor support */
#ifdef HAVE_FIPS
#undef HAVE_ECC_CDH
#define HAVE_ECC_CDH
#endif
#define HAVE_ECC_CDH /* Enable cofactor support */
#undef NO_STRICT_ECDSA_LEN
#define NO_STRICT_ECDSA_LEN /* Do not force fixed len w/ FIPS */
/* Validate import */
#ifdef HAVE_FIPS
#undef WOLFSSL_VALIDATE_ECC_IMPORT
#define WOLFSSL_VALIDATE_ECC_IMPORT
#define WOLFSSL_VALIDATE_ECC_IMPORT /* Validate import */
#endif
/* Compressed Key Support */
@ -189,14 +188,17 @@ extern "C" {
/* Use alternate ECC size for ECC math */
#ifdef USE_FAST_MATH
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
#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)
#define FP_MAX_BITS (256 * 2)
#else
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
//#undef FP_MAX_BITS_ECC
//#define FP_MAX_BITS_ECC (256 * 2)
#endif
/* Speedups specific to curve */

View File

@ -1,6 +1,6 @@
/* armtarget.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -142,20 +142,20 @@ void HardFault_HandlerC( uint32_t *hardfault_args )
_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);
printf ("R0 = %ux\n", stacked_r0);
printf ("R1 = %ux\n", stacked_r1);
printf ("R2 = %ux\n", stacked_r2);
printf ("R3 = %ux\n", stacked_r3);
printf ("R12 = %ux\n", stacked_r12);
printf ("LR [R14] = %ux subroutine call return address\n", stacked_lr);
printf ("PC [R15] = %ux program counter\n", stacked_pc);
printf ("PSR = %ux\n", stacked_psr);
printf ("CFSR = %ux\n", _CFSR);
printf ("HFSR = %ux\n", _HFSR);
printf ("DFSR = %ux\n", _DFSR);
printf ("AFSR = %ux\n", _AFSR);
printf ("MMAR = %ux\n", _MMAR);
printf ("BFAR = %ux\n", _BFAR);
// Break into the debugger
__asm("BKPT #0\n");

View File

@ -1,6 +1,6 @@
/* benchmark_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* test_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* tls_client.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolf_main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -9,6 +9,7 @@ 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/linker_fips.ld
EXTRA_DIST+= IDE/GCC-ARM/Makefile
EXTRA_DIST+= IDE/GCC-ARM/Makefile.bench
EXTRA_DIST+= IDE/GCC-ARM/Makefile.client

View File

@ -0,0 +1,92 @@
MEMORY
{
FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 256K
RAM (wx) : ORIGIN = 0x20000000, LENGTH = 64K
}
SECTIONS
{
__vectors_start__ = .;
.vectors : { *(.vectors) } > FLASH
__vectors_end__ = __vectors_start__ + 0x400;
/* Custom section for wolfCrypt FIPS module */
.wolfCryptFIPSModule_text :
{
. = ALIGN(4);
KEEP(wolfcrypt_first.o (.text .text* ))
KEEP(aes.o(.text .text* ))
KEEP(cmac.o (.text .text* ))
KEEP(des3.o (.text .text* ))
KEEP(dh.o (.text .text* ))
KEEP(ecc.o (.text .text* ))
KEEP(fips.o (.text .text* ))
KEEP(fips_test.o (.text .text* ))
KEEP(hmac.o (.text .text* ))
KEEP(random.o(.text .text* ))
KEEP(rsa.o (.text .text* ))
KEEP(sha.o (.text .text* ))
KEEP(sha256.o (.text .text* ))
KEEP(sha3.o (.text .text* ))
KEEP(sha512.o (.text .text* ))
KEEP(wolfcrypt_last.o(.text .text*))
. = ALIGN(4);
} > FLASH
.wolfCryptFIPSModule_rodata :
{
. = ALIGN(4);
KEEP(wolfcrypt_first.o (.rodata .rodata*))
KEEP(aes.o(.rodata .rodata*))
KEEP(cmac.o(.rodata .rodata*))
KEEP(des3.o(.rodata .rodata*))
KEEP(dh.o(.rodata .rodata*))
KEEP(ecc.o(.rodata .rodata*))
KEEP(fips.o(.rodata .rodata*))
KEEP(fips_test.o(.rodata .rodata*))
KEEP(hmac.o(.rodata .rodata*))
KEEP(random.o(.rodata .rodata*))
KEEP(rsa.o(.rodata .rodata*))
KEEP(sha.o(.rodata .rodata*))
KEEP(sha256.o(.rodata .rodata*))
KEEP(sha3.o(.rodata .rodata*))
KEEP(sha512.o(.rodata .rodata*))
KEEP(wolfcrypt_last.o(.rodata .rodata*))
. = ALIGN(4);
} > FLASH
/* Custom section for wolfCrypt and LibC to prevent FIPS hash from changing
when application code changes are made */
.wolfCryptNonFIPS_text :
{
. = ALIGN(4);
KEEP(*wolf*src*.o(.text .text*))
lib_a* ( .text .text*)
. = ALIGN(4);
} > FLASH
.wolfCryptNonFIPS_rodata :
{
. = ALIGN(4);
KEEP(*wolf*src*.o(.rodata .rodata*))
lib_a* (.rodata .rodata*)
. = ALIGN(4);
} > FLASH
.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 = .;
}

110
IDE/HEXAGON/DSP/Makefile Normal file
View File

@ -0,0 +1,110 @@
# Makefile
#
# Copyright (C) 2006-2020 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
ENVI=hexagon
# default to hexagon v65 Release build
ifndef V
V=hexagon_Release_dynamic_toolv83_v65
endif
SUPPORTED_VS = $(default_VS)
DEPENDENCIES = \
ATOMIC \
RPCMEM \
TEST_MAIN \
TEST_UTIL
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/common/atomic
RPCMEM_DIR = $(HEXAGON_SDK_ROOT)/libs/common/rpcmem
TEST_MAIN_DIR = $(HEXAGON_SDK_ROOT)/test/common/test_main
TEST_UTIL_DIR = $(HEXAGON_SDK_ROOT)/test/common/test_util
include $(HEXAGON_SDK_ROOT)/build/make.d/$(ENVI)_vs.min
include $(HEXAGON_SDK_ROOT)/build/defines.min
QURT = $(HEXAGON_SDK_ROOT)/libs/common/qurt
QAIC_FLAGS += -I../../../
CC_FLAGS += -I../../../
CC_FLAGS += -I $(QURT)/computev65/include/posix/
CC_FLAGS += -I $(QURT)/computev65/include/qurt/
CC_FLAGS += -I../
CC_FLAGS += -DWOLFSSL_USER_SETTINGS
CC_FLAGS += -DWOLFSSL_DSP_BUILD
CC_FLAGS += -DWC_NO_RNG
#CC_FLAGS += -O3
C_FLAGS += $(MHVX_DOUBLE_FLAG) -mllvm -hexagon-eif=0
CC_FLAGS += $(MHVX_DOUBLE_FLAG) -mllvm -hexagon-eif=0
# stub library
BUILD_LIBS += libwolfssl_dsp_skel
ifeq (1,$(V_dynamic))
BUILD_DLLS += libwolfssl_dsp_skel
endif
libwolfssl_dsp_skel_QAICIDLS += wolfssl_dsp
libwolfssl_dsp_skel_C_SRCS += $V/wolfSSL_skel
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/sp_dsp32.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/sp_int.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wc_port.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/logging.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/memory.c
libwolfssl_dsp_skel.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
#libsp_dsp_skel_DLLS += libdspCV_skel
# quality test
#BUILD_QEXES += eccverify_q
#eccverify_q_QAICIDLS = wolfssl_dsp
#eccverify_q_C_SRCS = ../ecc-verify
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_dsp.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_dsp32.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_int.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_port.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wc_encrypt.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/pwdbased.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hash.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/arc4.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/hmac.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/md5.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/coding.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/aes.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/des3.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/random.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/logging.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/ecc.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/memory.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sha256.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sha.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/asn.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/wolfmath.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_c32.c
#eccverify_q.C_SRCS += ../../../wolfcrypt/src/sp_c64.c
#eccverify_q_LIBS = rtld rpcmem test_util atomic test_main
BUILD_COPIES = \
$(DLLS) \
$(EXES) \
$(LIBS) \
$(SHIP_DIR)/ ;
include $(RULES_MIN)

View File

@ -0,0 +1,13 @@
#ifndef WOLFSSL_DSP_INC
#define WOLFSSL_DSP_INC
#include "AEEStdDef.idl"
#include "remote.idl"
interface wolfSSL: remote_handle64{
/* ecc operations */
long DSP_ECC_Verify_256(inrout sequence<int32> hash, inrout sequence<int32> pX, inrout sequence<int32> pY,
inrout sequence<int32> pZ, inrout sequence<int32> r, inrout sequence<int32> sm, inrout long res);
};
#endif

189
IDE/HEXAGON/Makefile Normal file
View File

@ -0,0 +1,189 @@
# Makefile
#
# Copyright (C) 2006-2020 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
ENVI=UbuntuARM
# default to Ubuntu Release build
ifndef V
V=UbuntuARM_Release_aarch64
endif
SUPPORTED_VS = $(default_VS)
include $(HEXAGON_SDK_ROOT)/build/make.d/$(ENVI)_vs.min
include $(HEXAGON_SDK_ROOT)/build/defines.min
ifeq ($(CDSP_FLAG), 1)
LIB_DSPRPC = libcdsprpc
else ifeq ($(MDSP_FLAG), 1)
LIB_DSPRPC = libmdsprpc
else ifeq ($(SLPI_FLAG), 1)
LIB_DSPRPC = libsdsprpc
else
LIB_DSPRPC = libadsprpc
endif
$(info ************ LIB=$(LIB_DSPRPC) ************)
# include files
CC_FLAGS += -I../../
CC_FLAGS += -I./
CC_FLAGS += -DWOLFSSL_USER_SETTINGS
CC_FLAGS += -mcpu=generic+crypto
#CC_FLAGS += -O3
DEPENDENCIES = \
ATOMIC \
RPCMEM
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/common/atomic
RPCMEM_DIR = $(HEXAGON_SDK_ROOT)/libs/common/rpcmem
# stub library
BUILD_DLLS += libwolfssl
libwolfssl_QAICIDLS += DSP/wolfssl_dsp
libwolfssl_C_SRCS += $V/wolfSSL_stub
libwolfssl_DLLS += $(LIB_DSPRPC)
libwolfssl_C_SRCS += ../../wolfcrypt/src/wc_dsp
libwolfssl_LIBS += rpcmem
libwolfssl_LD_FLAGS += -ldl
# wolfSSL crypto source files
libwolfssl_C_SRCS += \
../../wolfcrypt/src/aes \
../../wolfcrypt/src/md2 \
../../wolfcrypt/src/arc4 \
../../wolfcrypt/src/md4 \
../../wolfcrypt/src/asm \
../../wolfcrypt/src/md5 \
../../wolfcrypt/src/asn \
../../wolfcrypt/src/memory \
../../wolfcrypt/src/async \
../../wolfcrypt/src/blake2b \
../../wolfcrypt/src/pkcs12 \
../../wolfcrypt/src/blake2s \
../../wolfcrypt/src/pkcs7 \
../../wolfcrypt/src/camellia \
../../wolfcrypt/src/poly1305 \
../../wolfcrypt/src/chacha20_poly1305 \
../../wolfcrypt/src/pwdbased \
../../wolfcrypt/src/chacha \
../../wolfcrypt/src/rabbit \
../../wolfcrypt/src/cmac \
../../wolfcrypt/src/random \
../../wolfcrypt/src/coding \
../../wolfcrypt/src/ripemd \
../../wolfcrypt/src/compress \
../../wolfcrypt/src/rsa \
../../wolfcrypt/src/cpuid \
../../wolfcrypt/src/selftest \
../../wolfcrypt/src/cryptocb \
../../wolfcrypt/src/sha256 \
../../wolfcrypt/src/curve25519 \
../../wolfcrypt/src/sha3 \
../../wolfcrypt/src/des3 \
../../wolfcrypt/src/sha512 \
../../wolfcrypt/src/dh \
../../wolfcrypt/src/sha \
../../wolfcrypt/src/signature \
../../wolfcrypt/src/ecc \
../../wolfcrypt/src/ecc_fp \
../../wolfcrypt/src/ed25519 \
../../wolfcrypt/src/sp_armthumb \
../../wolfcrypt/src/error \
../../wolfcrypt/src/sp_int \
../../wolfcrypt/src/fe_low_mem \
../../wolfcrypt/src/sp_cortexm \
../../wolfcrypt/src/fe_operations \
../../wolfcrypt/src/fips \
../../wolfcrypt/src/sp_x86_64 \
../../wolfcrypt/src/fips_test \
../../wolfcrypt/src/srp \
../../wolfcrypt/src/ge_low_mem \
../../wolfcrypt/src/ge_operations \
../../wolfcrypt/src/wc_encrypt \
../../wolfcrypt/src/hash \
../../wolfcrypt/src/wc_pkcs11 \
../../wolfcrypt/src/hc128 \
../../wolfcrypt/src/wc_port \
../../wolfcrypt/src/hmac \
../../wolfcrypt/src/wolfcrypt_first \
../../wolfcrypt/src/idea \
../../wolfcrypt/src/wolfcrypt_last \
../../wolfcrypt/src/wolfevent \
../../wolfcrypt/src/logging \
../../wolfcrypt/src/sp_c32 \
../../wolfcrypt/src/sp_c64 \
../../wolfcrypt/src/sp_arm32 \
../../wolfcrypt/src/sp_arm64 \
../../wolfcrypt/src/wolfmath
# wolfSSL TLS source files
libwolfssl_C_SRCS += \
../../src/ocsp \
../../src/tls \
../../src/crl \
../../src/sniffer \
../../src/wolfio \
../../src/internal \
../../src/ssl \
../../src/keys \
../../src/tls13
# build benchmark app
BUILD_EXES += benchmark
benchmark_C_SRCS += ../../wolfcrypt/benchmark/benchmark
benchmark_LD_FLAGS += -ldl
benchmark_LD_FLAGS += -lpthread
benchmark_DLLS += libwolfssl
benchmark_LIBS += rpcmem
benchmark_DLLS += $(LIB_DSPRPC)
# build test app
BUILD_EXES += testwolfcrypt
testwolfcrypt_C_SRCS += ../../wolfcrypt/test/test
testwolfcrypt_DLLS += libwolfssl
testwolfcrypt_LD_FLAGS += -ldl
testwolfcrypt_LIBS += rpcmem
testwolfcrypt_DLLS += $(LIB_DSPRPC)
# build ecc verify test app
BUILD_EXES += eccverify
eccverify_C_SRCS += ecc-verify
eccverify_DLLS += libwolfssl
eccverify_LD_FLAGS += -ldl
eccverify_LIBS += rpcmem
eccverify_DLLS += $(LIB_DSPRPC)
# build ecc verify test app
BUILD_EXES += eccbenchmark
eccbenchmark_C_SRCS += ecc-verify-benchmark
eccbenchmark_DLLS += libwolfssl
eccbenchmark_LD_FLAGS += -lpthread
eccbenchmark_LD_FLAGS += -ldl
eccbenchmark_LIBS += rpcmem
eccbenchmark_DLLS += $(LIB_DSPRPC)
BUILD_COPIES = \
$(DLLS) \
$(EXES) \
$(LIBS) \
$(SHIP_DIR)/ ;
include $(RULES_MIN)

75
IDE/HEXAGON/README.md Normal file
View File

@ -0,0 +1,75 @@
# Building wolfSSL with DSP Use
## Intro
This directory is to help with building wolfSSL for use with DSP. It assumes that the Hexagon SDK has been setup on the machine and that the environment variables have been set by calling (source ~/Qualcomm/Hexagon_SDK/3.4.3/setup_sdk_env.source). Currently offloading ECC 256 verify operations to the DSP is supported. When WOLFSSL_DSP is defined ECC verify operations are offloaded to the aDSP by default. When not in SINGLE_THREADED mode a call back function must be set for getting the handle or a handle must be set in the ecc_key structure for the operation to make use of multiple threads when offloading to the DSP. This is because creating new handles for new threads must be done.
## Building
The directory is divided up into a build for the CPU portion in IDE/HEXAGON and a build for use on the DSP located in IDE/HEXAGON/DSP. Each section has their own Makefile. The Makefile default to an Ubuntu + hexagon v65 release build but can be changed by using V=<build type>. An example of building both would be:
```
cd IDE/HEXAGON
make V=UbuntuARM_Release_aarch64
cd DSP
make V=hexagon_Release_dynamic_toolv83_v65
```
The results from each build will be placed into the ship directories of each, for example ./UbuntuARM_Release_aarch64/ship/* and ./DSP/hexagon_Release_dynamic_toolv83_v65/ship/*.
The Makefile creates a DSP library libwolfssl_dsp_skel.so, library libwolfssl.so, executable benchmark, example ecc-verify, example ecc-verify-benchmark and executable testwolfcrypt.
These then need pushed to the device in order to run. An example of pushing the results to the device would be:
```
cd IDE/HEXAGON
adb push DSP/hexagon_Release_dynamic_toolv83_v65/ship/libwolfssl_dsp_skel.so /data/rfsa/adsp/
adb push UbuntuARM_Release_aarch64/ship/libwolfssl.so /data/
adb push UbuntuARM_Release_aarch64/ship/benchmark /data/
adb push UbuntuARM_Release_aarch64/ship/eccverify /data/
adb push UbuntuARM_Release_aarch64/ship/eccbenchmark /data/
```
To change the settings wolfSSL is built with macros can be set in IDE/HEXAGON/user_settings.h. It contains a default setting at this point that was used for collecting benchmark values. The macro necessary to turn on use of the DSP is WOLFSSL_DSP.
The script IDE/HEXAGON/build.sh was added to help speed up building and testing. An example of using the script would be:
```
cd IDE/HEXAGON
./build.sh Release
```
This will delete the previous build and rebuild for Release mode. Then it will try to push the resulting library and some of the executables to the device.
For increased performance uncomment the -O3 flag in IDE/HEXAGON/Makefile and IDE/HEXAGON/DSP/Makefile.
## Use
A default handle is created with the call to wolfCrypt_Init() and is set to use the aDSP. A default mutex is locked for each use of the handle to make the library stable when multiple threads are calling to DSP supported operations.
To use wolfSSL with a user created handle it can be done by calling wc_ecc_set_handle or by setting a callback function using wolfSSL_SetHandleCb(). This should be set in the case of multithreaded applications to account for having a handle for each thread being used.
#### wolfSSL_SetHandleCb
The API wolfSSL_SetHandleCb takes a function pointer of type "int (*wolfSSL_DSP_Handle_cb)(remote_handle64 *handle, int finished void *ctx);". This callback is executed right before the operation is handed off to the DSP (finished set to 0) and right after done with the handle (finished set to 1). With ECC this would be after the ECC verify function has been called but before the information is passed on to the DSP and once again with the finished flag set after the result is returned.
The callback set should return 0 on successfully setting the input handle. The ctx argument is for future custom context to be passed in and is currently not used.
#### Expected Performance
This is the expected results from running ./eccbenchmark using the -O3 flag
benchmarking using default (locks on handle for aDSP)
5000 verifies on 1 threads took 17.481616 seconds
10000 verifies on 2 threads took 35.324308 seconds
benchmarking using software (+NEON if built in)
5000 verifies on 1 threads took 1.398336 seconds
10000 verifies on 2 threads took 1.383992 seconds
benchmarking using threads on aDSP
5000 verifies on 1 threads took 17.616811 seconds
10000 verifies on 2 threads took 19.215413 seconds
15000 verifies on 3 threads took 20.410200 seconds
20000 verifies on 4 threads took 23.261446 seconds
benchmarking 1 thread on cDSP
5000 verifies on 1 threads took 18.560995 seconds

38
IDE/HEXAGON/build.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
if [ -z $1 ]; then
echo "./build <Debug | Release>"
exit -1
fi
printf "Erasing previous hexagon_$1_dynamic_toolv83_v65 and UbuntuARM_$1_aarch64\n"
rm -rf hexagon_$1_dynamic_toolv83_v65 &> /dev/null
rm -rf UbuntuARM_$1_aarch64 &> /dev/null
cd ./DSP &> /dev/null
rm -rf hexagon_$1_dynamic_toolv83_v65 &> /dev/null
printf "Building hexagon_$1_dynamic_toolv83_v65 ..."
make V=hexagon_$1_dynamic_toolv83_v65 &> /dev/null
if [ $? != 0 ]; then
printf "failed\n"
else
printf "done\n"
fi
cd ../ &> /dev/null
printf "Building UbuntuARM_$1_aarch64 ..."
make V=UbuntuARM_$1_aarch64 &> /dev/null
if [ $? != 0 ]; then
printf "failed\n"
else
printf "done\n"
fi
printf "Trying to push libwolfssl_Dsp_skel.so, libwolfssl.so, benchmark, eccverify, eccbenchmark\n"
adb push DSP/hexagon_$1_dynamic_toolv83_v65/ship/libwolfssl_dsp_skel.so /data/rfsa/adsp/
adb push UbuntuARM_$1_aarch64/ship/libwolfssl.so /data/
adb push UbuntuARM_$1_aarch64/ship/benchmark /data/
adb push UbuntuARM_$1_aarch64/ship/eccverify /data/
adb push UbuntuARM_$1_aarch64/ship/eccbenchmark /data/
#adb push UbuntuARM_$1_aarch64/ship/testwolfcrypt /data/wolfcrypt/test/
printf "done\n"
exit 0

View File

@ -0,0 +1,185 @@
/* ecc-verify-benchmark.c
*
* Copyright (C) 2006-2020 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/sha256.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/ecc.h>
#include <wolfssl/wolfcrypt/asn_public.h>
#include <pthread.h>
#define USE_CERT_BUFFERS_256
#include <wolfssl/certs_test.h>
#define MAX_TIMES 5000
#define MAX_BLOCK_SIZE 1024
#include <sys/time.h>
static double get_time()
{
struct timeval tv;
gettimeofday(&tv, 0);
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
}
/* software version */
void* hash_firmware_verify(void* key)
{
int ret, i;
int verify;
const byte hash[] = {
0XFB, 0XBA, 0XB2, 0X89, 0XF7, 0XF9, 0X4B, 0X25, 0X73, 0X6C, 0X58, 0XBE, 0X46, 0XA9, 0X94, 0XC4, 0X41, 0XFD, 0X02, 0X55, 0X2C, 0XC6, 0X02, 0X23, 0X52, 0XE3, 0XD8, 0X6D, 0X2F, 0XAB, 0X7C, 0X83
};
const byte sigBuf[] = {
0X30, 0X44, 0X02, 0X20, 0X05, 0X38, 0XBC, 0X16, 0XC7, 0X67, 0X18, 0XEC, 0XE6, 0X1E, 0X43, 0X7B, 0X29, 0X8F, 0X85, 0X01, 0X33, 0XA8, 0X9B, 0XDD, 0X91, 0X32, 0X1F, 0XEC, 0XF7, 0X91, 0X18, 0X72, 0X9C, 0XE2, 0X6F, 0X31, 0X02, 0X20, 0X3E, 0X31, 0XD6, 0X40, 0XF7, 0X38, 0X3C, 0X1B, 0X6D, 0XAD, 0XE3, 0X93, 0X20, 0XE8, 0XB1, 0XBD, 0X3C, 0X59, 0XF2, 0XD2, 0X7C, 0X46, 0X1B, 0XE5, 0XE1, 0XE3, 0XAB, 0X5E, 0X76, 0X73, 0X6F, 0XFB
};
word32 sigLen = (word32)sizeof(sigBuf);
word32 hashLen = (word32)sizeof(hash);
for (i = 0; i < MAX_TIMES; i++) {
ret = wc_ecc_verify_hash((byte*)sigBuf, sigLen, hash, hashLen, &verify, (ecc_key*)key);
if (ret < 0 || verify != 1) {
printf("failed on try %d\n", i);
break;
}
}
if (ret < 0 || verify != 1) {
printf("unable to verify, ret = %d verify = %d\n", ret, verify);
}
return NULL;
}
/* when flag is set then try to use software only if DSP is built in */
static int hash_firmware_verify_default(int numThreads)
{
int ret, i;
word32 idx;
double t;
pthread_t threads[numThreads];
ecc_key eccKey[numThreads];
for (i = 0; i < numThreads; i++) {
wc_ecc_init(&(eccKey[i]));
idx = 0;
ret = wc_EccPrivateKeyDecode(ecc_clikey_der_256, &idx, &(eccKey[i]), sizeof_ecc_clikey_der_256);
if (ret < 0)
return ret;
}
t = get_time();
for (i = 0; i < numThreads; i++) {
pthread_create(&threads[i], NULL, hash_firmware_verify, (void*)&(eccKey[i]));
}
for (i = 0; i < numThreads; i++) {
pthread_join(threads[i], NULL);
}
t = get_time() - t;
printf("%d verifies on %d threads took %f seconds\n", MAX_TIMES * numThreads, numThreads, t);
return 0;
}
#ifdef WOLFSSL_DSP
/* domain 0 = cDSP 1 = aDSP */
static int hash_firmware_verify_dsp(int numThreads, int domain)
{
int ret, i;
word32 idx;
double t;
remote_handle64 handle[numThreads];
char *sp_URI_value;
pthread_t threads[numThreads];
ecc_key eccKey[numThreads];
if (domain == 0) {
sp_URI_value = wolfSSL_URI "&_dom=cdsp";
}
else {
sp_URI_value = wolfSSL_URI "&_dom=adsp";
}
for (i = 0; i < numThreads; i++) {
wc_ecc_init(&(eccKey[i]));
idx = 0;
ret = wc_EccPrivateKeyDecode(ecc_clikey_der_256, &idx, &(eccKey[i]), sizeof_ecc_clikey_der_256);
if (ret < 0)
return ret;
ret = wolfSSL_open(sp_URI_value, &(handle[i]));
if (ret != 0) {
printf("unable to open CDSP? retVal = %d\n", ret);
return -1;
}
wc_ecc_set_handle(&(eccKey[i]), handle[i]);
}
t = get_time();
for (i = 0; i < numThreads; i++) {
pthread_create(&threads[i], NULL, hash_firmware_verify, (void*)&(eccKey[i]));
}
for (i = 0; i < numThreads; i++) {
pthread_join(threads[i], NULL);
wolfSSL_close(handle[i]);
}
t = get_time() - t;
printf("%d verifies on %d threads took %f seconds\n", MAX_TIMES * numThreads, numThreads, t);
return 0;
}
#endif /* WOLFSSL_DSP */
int main(int argc, char* argv[])
{
wolfCrypt_Init();
printf("benchmarking using default (locks on handle for aDSP)\n");
hash_firmware_verify_default(1);
hash_firmware_verify_default(2);
printf("\nbenchmarking using software (+NEON if built in)\n");
#ifdef WOLFSSL_DSP
wolfSSL_SetHandleCb(NULL); /* remove calls to DSP by default */
#endif
hash_firmware_verify_default(1);
hash_firmware_verify_default(2);
#ifdef WOLFSSL_DSP
printf("\nbenchmarking using threads on aDSP\n");
hash_firmware_verify_dsp(1, 1);
hash_firmware_verify_dsp(2, 1);
hash_firmware_verify_dsp(3, 1);
hash_firmware_verify_dsp(4, 1);
printf("\nbenchmarking 1 thread on cDSP\n");
hash_firmware_verify_dsp(1, 0);
#endif /* WOLFSSL_DSP */
wolfCrypt_Cleanup();
return 0;
}

91
IDE/HEXAGON/ecc-verify.c Normal file
View File

@ -0,0 +1,91 @@
/* ecc-verify.c
*
* Copyright (C) 2006-2020 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/sha256.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/ecc.h>
#include <wolfssl/wolfcrypt/asn_public.h>
#define USE_CERT_BUFFERS_256
#include <wolfssl/certs_test.h>
#define MAX_BLOCK_SIZE 1024
#ifdef WOLFSSL_DSP
static char *sp_URI_value = wolfSSL_URI "&_dom=cdsp";
int hash_firmware_verify(const byte* hash, word32 hashLen, const byte* sigBuf, word32 sigLen)
{
int ret;
ecc_key eccKey;
word32 idx;
int verify;
remote_handle64 handle = -1;
idx = 0;
ret = wc_EccPrivateKeyDecode(ecc_clikey_der_256, &idx, &eccKey, sizeof_ecc_clikey_der_256);
if (ret < 0)
goto exit;
int retVal = wolfSSL_open(sp_URI_value, &handle);
if (retVal != 0) {
printf("unable to open CDSP? retVal = %d\n", retVal);
ret = -1;
goto exit;
}
wc_ecc_set_handle(&eccKey, handle);
ret = wc_ecc_verify_hash((byte*)sigBuf, sigLen, hash, hashLen, &verify, &eccKey);
printf("verify = %d\n", verify);
if (ret < 0)
goto exit;
wolfSSL_close(handle);
exit:
return ret;
}
int main(void)
{
int ret;
const byte hash[] = {
0XFB, 0XBA, 0XB2, 0X89, 0XF7, 0XF9, 0X4B, 0X25, 0X73, 0X6C, 0X58, 0XBE, 0X46, 0XA9, 0X94, 0XC4, 0X41, 0XFD, 0X02, 0X55, 0X2C, 0XC6, 0X02, 0X23, 0X52, 0XE3, 0XD8, 0X6D, 0X2F, 0XAB, 0X7C, 0X83
};
const byte sigBuf[] = {
0X30, 0X44, 0X02, 0X20, 0X05, 0X38, 0XBC, 0X16, 0XC7, 0X67, 0X18, 0XEC, 0XE6, 0X1E, 0X43, 0X7B, 0X29, 0X8F, 0X85, 0X01, 0X33, 0XA8, 0X9B, 0XDD, 0X91, 0X32, 0X1F, 0XEC, 0XF7, 0X91, 0X18, 0X72, 0X9C, 0XE2, 0X6F, 0X31, 0X02, 0X20, 0X3E, 0X31, 0XD6, 0X40, 0XF7, 0X38, 0X3C, 0X1B, 0X6D, 0XAD, 0XE3, 0X93, 0X20, 0XE8, 0XB1, 0XBD, 0X3C, 0X59, 0XF2, 0XD2, 0X7C, 0X46, 0X1B, 0XE5, 0XE1, 0XE3, 0XAB, 0X5E, 0X76, 0X73, 0X6F, 0XFB
};
word32 sigLen = (word32)sizeof(sigBuf);
wolfCrypt_Init();
ret = hash_firmware_verify(hash, sizeof(hash), sigBuf, sigLen);
printf("hash_firmware_verify: %d\n", ret);
wolfCrypt_Cleanup();
return 0;
}
#else
int main()
{
printf("WOLFSSL_DSP expected to be defined when building\n");
return 0;
}
#endif /* WOLFSSL_DSP */

14
IDE/HEXAGON/include.am Normal file
View File

@ -0,0 +1,14 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/HEXAGON/Makefile
EXTRA_DIST+= IDE/HEXAGON/user_settings.h
EXTRA_DIST+= IDE/HEXAGON/README.md
EXTRA_DIST+= IDE/HEXAGON/build.sh
EXTRA_DIST+= IDE/HEXAGON/ecc-verify.c
EXTRA_DIST+= IDE/HEXAGON/ecc-verify-benchmark.c
EXTRA_DIST+= IDE/HEXAGON/DSP/Makefile
EXTRA_DIST+= IDE/HEXAGON/DSP/wolfssl_dsp.idl

View File

@ -0,0 +1,37 @@
#ifndef USER_SETTINGS_H
#define USER_SETTINGS_H
#define WOLFCRYPT_ONLY
#define HAVE_ECC
#define FP_ECC
//#define FP_ENTRIES 1
#define NO_DSA
#define NO_DH
#define NO_RSA
//#define DEBUG_WOLFSSL
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#ifdef HAVE_ECC
#define ECC_TIMING_RESISTANT
#endif
#ifndef NO_RSA
#define WC_RSA_BLINDING
#endif
#if 1
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_MATH
#if 1
/* ARM NEON instructions */
#define WOLFSSL_SP_ARM64_ASM
#endif
#if 1
/* Use DSP */
#define WOLFSSL_DSP
#endif
#endif
#endif

View File

@ -1,6 +1,6 @@
/* benchmark-main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* current-time.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -44,7 +44,7 @@ void InitTimer(void) {
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
printf("Clock=%dMHz\n", ui32SysClock/1000000) ;
printf("Clock=%dMHz\n", (int)(ui32SysClock/1000000));
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, -1);
@ -64,10 +64,10 @@ double current_time(int reset)
/* dummy */
double current_time(int reset) {
static double t;
t += 1.0; /* for avoid infinit loop of waiting time */
static double t;
t += 1.0; /* for avoid infinite loop of waiting time */
if(reset)t = 0.0;
return t ;
}
return t ;
}
#endif
#endif

View File

@ -1,6 +1,6 @@
/* minimum-startup.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -343,7 +343,7 @@
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>CCPosIndRwpi</name>

View File

@ -1,6 +1,6 @@
/* test-main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -34,11 +34,11 @@
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
#undef ECC_ALT_SIZE
#define ECC_ALT_SIZE
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#undef FP_MAX_BITS_ECC
#define FP_MAX_BITS_ECC 528
#define FP_MAX_BITS_ECC (256 * 2)
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

View File

@ -84,11 +84,13 @@
#define ECC_TIMING_RESISTANT
#ifdef USE_FAST_MATH
/* Max ECC bits (curve size * 8). ECC521 is (66*8) = 528. */
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#undef FP_MAX_BITS_ECC
#define FP_MAX_BITS_ECC 528
/* wolfSSL will compute the FP_MAX_BITS_ECC, but it can be overriden */
/* MAX ECC BITS = ROUND8(MAX ECC) * 2 */
//#undef FP_MAX_BITS_ECC
//#define FP_MAX_BITS_ECC (528 * 2)
/* Enable TFM optimizations for ECC */
#define TFM_ECC192

View File

@ -6,7 +6,7 @@ embOS v4.16 (for Cortex-M and IAR compiler)
wolfssl (latest version)
Required items (Hardware) for this guide:
Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board)
Atmel SAM V71 Xplained Ultra (Or equivalent Cortex-M Evaluation Board)
Note: Must have J-Trace adapter (SWD or SWD + ETM)
j-Trace for ARM Cortex-M Processors
Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html

View File

@ -6,7 +6,7 @@ embOS v4.16 (for Cortex-M and IAR compiler)
wolfssl (latest version)
Required items (Hardware) for this guide:
Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board)
Atmel SAM V71 Xplained Ultra (Or equivalent Cortex-M Evaluation Board)
Note: Must have J-Trace adapter (SWD or SWD + ETM)
j-Trace for ARM Cortex-M Processors
Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html

View File

@ -6,7 +6,7 @@ embOS v4.16 (for Cortex-M and IAR compiler)
wolfssl (latest version)
Required items (Hardware) for this guide:
Atmel SAM V71 Xplained Ultra (Or equivelent Cortex-M Evaluation Board)
Atmel SAM V71 Xplained Ultra (Or equivalent Cortex-M Evaluation Board)
Note: Must have J-Trace adapter (SWD or SWD + ETM)
j-Trace for ARM Cortex-M Processors
Note: You can see here: https://www.segger.com/j-trace-for-cortex-m.html

View File

@ -109,7 +109,7 @@ We are now set to link to this library in the evaluation project
#---------------------------------------------
5. Go to Project -> Options -> Linker -> Library (Tab)
Add to the field "Additonal libraries:"
Add to the field "Additional libraries:"
$PROJ_DIR$\..\embOS_wolfcrypt_lib_SAMV71_XULT\Debug\Exe\wolfcrypt_lib.a
$PROJ_DIR$\..\..\extract_trial_here\Start\Lib\os7m_tlv_dp.a

View File

@ -31,11 +31,11 @@
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
#undef ECC_ALT_SIZE
#define ECC_ALT_SIZE
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
#undef FP_MAX_BITS_ECC
#define FP_MAX_BITS_ECC 528
#define FP_MAX_BITS_ECC (256 * 2)
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

View File

@ -55,7 +55,7 @@ int wolfExample_TLSClient(const char* ip, int port)
int ret = 0;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL; /* create WOLFSSL object */
int sockFd = -1; /* socket file descriptor */
int sockFd; /* socket file descriptor */
struct sockaddr_in servAddr; /* struct for server address */
char sendBuff[TLS_MAXDATASIZE], rcvBuff[TLS_MAXDATASIZE];
@ -144,13 +144,13 @@ int wolfExample_TLSServer(int port)
int ret = 0;
WOLFSSL_CTX* ctx = NULL;
WOLFSSL* ssl = NULL;
int sockFd = -1, clientFd = -1;
int sockFd, clientFd = -1;
struct sockaddr_in serverAddr = {0}, clientAddr = {0};
const char reply[] = "I hear ya fa shizzle!\n";
int addrSize = sizeof(clientAddr);
char buff[256];
sockFd = socket(AF_INET, SOCK_STREAM, 0);
sockFd = socket(AF_INET, SOCK_STREAM, 0);
if (sockFd < 0) {
printf("Failed to create socket. Error: %d\n", errno);
return errno;

View File

@ -1,10 +1,14 @@
# Static Library: Building libwolfssl.sgx.static.lib.a for use with SGX Enclaves
### Requirements:
This code was created to use Intel's SGX hardware. It is expected that the user has gone through the steps of both turning on the hardware in bios if needed and has installed the necesary software from Intel to make use of the hardware. (https://software.intel.com/en-us/sgx) If these steps have not been done then it is expected that the user is familure with simulation software being used in place of hardware.
This code was created to use Intel's SGX hardware. It is expected that the user has gone through the steps of both turning on the hardware in bios if needed and has installed the necessary software from Intel to make use of the hardware. (https://software.intel.com/en-us/sgx) If these steps have not been done then it is expected that the user is familiar with simulation software being used in place of hardware.
### Security:
If not already in use, it is recommended that SP (single precision) RSA and ECC code is used. This will help mitigate potential side channel attacks. To use SP code check that wolfcrypt/src/sp_c32.c and wolfcrypt/src/sp_c64.c are compiled and add HAVE_WOLFSSL_SP=1 to the build command to define the necessary macros.
### Overview and Build:
This project creates a static library to then link with Enclaves. A simple example of an Enclave linking to the created wolfSSL library can be found in wolfssl-examples on github. This project has been tested with gcc 5.4.0 on Ubuntu 16.04.
When building with tests the file wolfssl/options.h is expected, in downloaded bundles from wolfssl.com this file exists but when building from a cloned version of wolfSSL from GitHub then the file needs created. This is done either through cd wolfssl && ./autogen.sh && ./configure && ./config.status or by cd wolfssl && touch wolfssl/options.h.
To create the static library, simply call make:
@ -20,9 +24,10 @@ This will create a local static library, libwolfssl.sgx.static.lib.a, that can b
To enable wolfssl debug, add CFLAGS=-DDEBUG_WOLFSSL.
To enable wolfssl benchmark tests with enclave, specify: HAVE_WOLFSSL_BENCHMARK at build
To enable wolfcrypt testsuite with enclave, specify: HAVE_WOLFSSL_TEST at build
To enable SP code, specify: HAVE_WOLFSSL_SP at build
For example, to enable all three:
`make -f sgx_t_static.mk CFLAGS=-DDEBUG_WOLFSSL HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1`
For example:
`make -f sgx_t_static.mk CFLAGS=-DDEBUG_WOLFSSL HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1 HAVE_WOLFSSL_SP=1`
NOTE: This more customized step has been provided for easier execution in the
script `build.sh`

View File

@ -5,5 +5,5 @@ CFLAGS_NEW="-DDEBUG_WOLFSSL"
export CFLAGS="${CFLAGS} ${CFLAGS_NEW}"
echo ${CFLAGS}
make -f sgx_t_static.mk HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1
make -f sgx_t_static.mk HAVE_WOLFSSL_BENCHMARK=1 HAVE_WOLFSSL_TEST=1 HAVE_WOLFSSL_SP=1

View File

@ -45,6 +45,7 @@ endif
Crypto_Library_Name := sgx_tcrypto
Wolfssl_C_Extra_Flags := -DWOLFSSL_SGX
Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/arc4.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/asn.c\
@ -86,6 +87,8 @@ Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sha256.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sha512.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/signature.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_c32.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/sp_c64.c\
$(WOLFSSL_ROOT)/src/ssl.c\
$(WOLFSSL_ROOT)/src/tls.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/wc_encrypt.c\
@ -105,6 +108,11 @@ ifeq ($(HAVE_WOLFSSL_BENCHMARK), 1)
Wolfssl_Include_Paths += -I$(WOLFSSL_ROOT)/wolfcrypt/benchmark/
endif
ifeq ($(HAVE_WOLFSSL_SP), 1)
Wolfssl_C_Extra_Flags += -DWOLFSSL_HAVE_SP_RSA \
-DWOLFSSL_HAVE_SP_DH \
-DWOLFSSL_HAVE_SP_ECC
endif
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11

View File

@ -1,6 +1,6 @@
/* lpc_18xx_port.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -22,7 +22,8 @@
#define FP_LUT 4
#define FP_MAX_BITS 2048 /* 4096 */
#define FP_MAX_BITS_ECC 512
#define ECC_USER_CURVES /* Disables P-112, P-128, P-160, P-192, P-224, P-384, P-521 but leaves P-256 enabled */
#define FP_MAX_BITS_ECC (256 * 2)
#define ALT_ECC_SIZE
#define USE_FAST_MATH
#define SMALL_SESSION_CACHE
@ -52,7 +53,6 @@
#define NO_64BIT
#define NO_WOLFSSL_SERVER
#define NO_OLD_TLS
#define ECC_USER_CURVES /* Disables P-112, P-128, P-160, P-192, P-224, P-384, P-521 but leaves P-256 enabled */
#define NO_DES3
#define NO_MD5
#define NO_RC4

View File

@ -1,6 +1,6 @@
/* lpc_18xx_startup.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -3,7 +3,7 @@ toolchain and example benchmark/testwolfcrypt application linking to it. The
examples and default builds where made to support a MCF5441X board.
Macros to define for use:
WOLFSSL_MCF5441X /* arch settings i.e. sizeof long and endianess */
WOLFSSL_MCF5441X /* arch settings i.e. sizeof long and endianness */
WOLFSSL_NETBURNER /* for use of NetBurner headers and RNG seed */
@ -17,7 +17,7 @@ wolfssl-root/wolfssl/wolfcrypt/settings.h sets the sizeof long and long long
along with big endian macro.
The configuration for the build is located in wolfssl-root/IDE/M68K/user_settings.h
Along with the defualt build there is 2 others BUILD_B (smaller resource use),
Along with the default build there is 2 others BUILD_B (smaller resource use),
and BUILD_C (faster runtime with more resource use).
RSA speeds of the builds

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* time.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* certs_test.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* config-BEREFOOT.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* config-FS.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* config-RTX-TCP-FS.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* config.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/*shell.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -214,7 +214,7 @@ static struct {
"stack", stack_comm, /* On/Off check stack size */
"for", for_command, /* iterate next command X times */
"debug", dbg_comm, /* On/Off debug message */
"help", help_comm, /* Breif description about the commands */
"help", help_comm, /* Brief description about the commands */
/** short name **/
"ec", echoclient_test,
@ -436,7 +436,7 @@ static void for_command(void *args)
{
if( args == NULL || ((func_args *)args)->argc == 1) {
printf("For %d times\n", for_iteration) ;
} else if( args == NULL || ((func_args *)args)->argc == 2) {
} else if(((func_args *)args)->argc == 2) {
for_iteration = atoi(((func_args *)args)->argv[1]) ;
} else printf("Invalid argument\n") ;
}
@ -483,7 +483,7 @@ static char command_stack[COMMAND_STACK_SIZE] ;
static wolfSSL_Mutex command_mutex ;
#endif
/*********** Invoke Forground Command *********************/
/*********** Invoke Foreground Command *********************/
static void command_invoke(void *args)
{
void (*func)(void * ) ;

View File

@ -1,6 +1,6 @@
/* time-STM32F2.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* time-dummy.c.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* wolfssl_KEIL_RL.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -69,7 +69,7 @@ char *inet_ntoa(struct in_addr in)
unsigned long inet_addr(const char *cp)
{
unsigned int a[4] ; unsigned long ret ;
sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) ;
sscanf(cp, "%u.%u.%u.%u", &a[0], &a[1], &a[2], &a[3]) ;
ret = ((a[3]<<24) + (a[2]<<16) + (a[1]<<8) + a[0]) ;
return(ret) ;
}

View File

@ -1,6 +1,6 @@
/* wolfssl_KEIL_RL.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* time-STM32F2xx.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* wolfssl_KEIL_ARM.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,10 +55,10 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS<4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 14
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -245,7 +245,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -514,4 +514,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 14
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -209,7 +209,7 @@ int main (void) {
snprintf(ver, VERSIZE, "%d", TLS_VER);
argv[6] = ver;
printf("SSL/TLS Client(%d)\n ", sizeof(argv)/sizeof(argv[0])) ;
printf("SSL/TLS Client(%d)\n ", (int)(sizeof(argv)/sizeof(argv[0]))) ;
printf(" Remote IP: %s, Port: %s\n Version: %s\n", argv[2], argv[4], verStr[TLS_VER]) ;
printf(" Other options: %s\n", OTHER_OPTIONS);
setTime((time_t)((RTC_YEAR-1970)*365*24*60*60) + RTC_MONTH*30*24*60*60 + RTC_DAY*24*60*60);

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* main.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/*shell.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -221,7 +221,7 @@ static struct {
"stack", stack_comm, /* On/Off check stack size */
"for", for_command, /* iterate next command X times */
"debug", dbg_comm, /* On/Off debug message */
"help", help_comm, /* Breif description about the commands */
"help", help_comm, /* Brief description about the commands */
/** short name **/
"ec", echoclient_test,
@ -477,7 +477,7 @@ static void for_command(void *args)
{
if( args == NULL || ((func_args *)args)->argc == 1) {
printf("For %d times\n", for_iteration) ;
} else if( args == NULL || ((func_args *)args)->argc == 2) {
} else if(((func_args *)args)->argc == 2) {
for_iteration = atoi(((func_args *)args)->argv[1]) ;
} else printf("Invalid argument\n") ;
}
@ -554,7 +554,7 @@ void exit_command(void) {
}
/*********** Invoke Forground Command *********************/
/*********** Invoke Foreground Command *********************/
static void command_invoke(void const *args)
{
void (*func)(void const * ) ;
@ -630,7 +630,9 @@ void shell_main(void *arg) {
int i ;
func_args args ;
int bf_flg ;
#if defined(WOLFSSL_CMSIS_RTOS)
osThreadId cmd ;
#endif
i = BackGround ;
/* Dummy for avoiding warning: BackGround is defined but not used. */

View File

@ -1,6 +1,6 @@
/* time-STM32F2.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@ -1,6 +1,6 @@
/* user_settings.h
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@ -55,11 +55,11 @@
#define STM32F7xx
#endif
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows
// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX
// <7=>Micrium <8=>EBSnet<9=>MQX
// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others
// <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows
// <5=>PThread <6=>ThreadX
// <7=>Micrium <8=>EBSnet <9=>MQX
// <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2
// <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others
#define MDK_CONF_THREAD 15
#if MDK_CONF_THREAD== 0
#define SINGLE_THREADED
@ -247,7 +247,7 @@
// <e>HC128
#define MDK_CONF_HC128 1
#if MDK_CONF_AESGCM == 0
#if MDK_CONF_HC128 == 0
#define NO_HC128
#endif
// </e>
@ -516,4 +516,3 @@
// </e>
//</h>

View File

@ -1,6 +1,6 @@
/* ssl-dummy.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

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