Commit Graph

1854 Commits

Author SHA1 Message Date
Daniel Pouzzner
e162d0f889 add wolfSSL_get_ocsp_producedDate(). 2020-10-08 22:47:16 -05:00
toddouska
4d11e3c83b Merge pull request #3365 from SparkiDev/ticket_align
SSL session ticket: decrypted ticket access aligned
2020-10-08 15:01:41 -07:00
Sean Parkinson
8d82fb2add SSL session ticket: decrypted ticket access aligned
Decrypted session ticket using encrypted ticket buffer.
Alignment not correct on platforms requiring 32-bit aligned access.
Copy the decrypted data into temporary for access.
Also zeroize the unencrypted tickets after use.
2020-10-08 08:56:49 +10:00
Daniel Pouzzner
1c492dc0b6 cosmetic cleanups. 2020-10-06 22:14:08 -05:00
Daniel Pouzzner
a522207b14 fix memory leaks in src/internal.c:DoSessionTicket() and testsuite/testsuite.c:file_test(). 2020-10-01 14:38:26 -05:00
Daniel Pouzzner
2ed8f93592 src/internal.c: fix memory leaks in ProcessPeerCerts() and GetDhPublicKey(). 2020-10-01 14:38:26 -05:00
toddouska
20d28e1b65 Merge pull request #3221 from julek-wolfssl/wolfSSL_dtls_import-const-buf
Change buffer in wolfSSL_dtls_import to be const
2020-09-30 10:45:25 -07:00
David Garske
7d33312f4b Merge pull request #3339 from ejohnstown/dtls-flag
DTLS Flag
2020-09-25 17:05:22 -07:00
John Safranek
b36877c20b DTLS Flag
Fix an ifdef flag that should have been WOLFSSL_DTLS, not HAVE_DTLS.
2020-09-25 10:49:34 -07:00
Daniel Pouzzner
87b2384cac linuxkm settings.h: define NO_STDIO_FILESYSTEM 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
0e480d1a14 Linux KM compilability cont'd: conform to C89isms (declarations before statements); iffdef WOLFSSL_LINUXKM use do_div() for long long division rather than C operator (avoids unresolvable compile-time callouts to libgcc function); misc gating and relocations for includes. 2020-09-23 18:32:15 -05:00
Daniel Pouzzner
3c2155f4a9 linuxkm WIP -- update for kernels 4.9.x (LTS representative) and 5.8.x (latest). 2020-09-23 18:32:15 -05:00
David Garske
6425ebb60e Linux Kernel Module support using "--enable-linuxkm". 2020-09-23 18:32:15 -05:00
toddouska
1c07de883c Merge pull request #3306 from SparkiDev/tls13_pha_psk
TLS 1.3: Post-handshake Authentication and resumption secret
2020-09-23 16:06:55 -07:00
Sean Parkinson
4ed3438be0 TLS 1.3: Post-handshake Authentication and resumption secret
The master secret in arrays is not available post-handshake.
Use the master secret in the session when calculating resumption secret.
2020-09-23 17:09:06 +10:00
toddouska
0e66f9d835 Merge pull request #3299 from dgarske/ocsp_certchain
Fix for possible NULL use if certChain not loaded and OCSP cert request called
2020-09-21 13:40:21 -07:00
toddouska
0f6d391ea1 Merge pull request #3295 from SparkiDev/tls13_p521
TLS 1.3: Fix P-521 algorithm matching
2020-09-21 13:36:48 -07:00
David Garske
b4c964f729 Fix for possible NULL buffer use if certChain not loaded and OCSP cert request called. 2020-09-18 09:15:44 -07:00
Sean Parkinson
d63ff07edc TLS 1.3: Fix P-521 algorithm matching
Digest size compared to key size - P521 has large key size.
Fixed to round down.
Added P-521 keys and certificates.
Added testing of P-521 keys and certificcates to unittest.
2020-09-18 10:51:55 +10:00
toddouska
85da1a1d0a Merge pull request #3271 from SparkiDev/tls13_peek
TLS 1.3: allow wolfSSL_peek() to return WANT_READ
2020-09-16 15:02:42 -07:00
Juliusz Sosinowicz
b9527600f4 Return size of consumed buffer 2020-09-14 09:22:47 +02:00
Juliusz Sosinowicz
e34ccaf481 Fix window check
If `curLT` then diff needs to be decremented. For example: `diff` = 1 represents last packet so it would be the `window[idx] & (1 << 0)` bit of the window variable.
2020-09-09 23:27:49 +02:00
Juliusz Sosinowicz
234705a80c Change buffer in wolfSSL_dtls_import to be const 2020-09-08 09:25:34 +02:00
Sean Parkinson
93bb12ce86 TLS 1.3: allow wolfSSL_peek() to return WANT_READ
When handshake message is processed in wolfSSL_peek() then return
WANT_READ from peek instead of blocking waiting for application data.

Server may send an alert if the client certificate is invalid.
The server also may send NewSesionTicket after client has sent finished
message.
To detect alert before handling application data, then the socket needs
to be checked for data. If the data is an alert then wolfSSL_peek() will
handle the alert, but if it is a NewSessionTicket then wolfSSL_peek()
will process it and block waiting for application data - so return
WANT_READ if no application data seen after processing handshake
message.
2020-09-07 08:30:24 +10:00
toddouska
7fd51cf9d9 Merge pull request #3267 from SparkiDev/no_client_auth
Get builds with WOLFSSL_NO_CLIENT_AUTH compiling and testing
2020-09-03 15:55:38 -07:00
toddouska
9901eb9272 Merge pull request #3249 from SparkiDev/tls13_early_data_fix
TLS 1.3 Early Data: fix
2020-09-03 14:49:39 -07:00
toddouska
b3acd57de5 Merge pull request #3254 from dgarske/leaks
Fixes valgrind leak reports (related to small stack cache)
2020-09-02 10:44:49 -07:00
JacobBarthelmeh
914905f1bc Merge pull request #3193 from embhorn/zd10457_b
Fix CheckHostName matching
2020-09-02 10:36:02 -06:00
Sean Parkinson
89b9a77eca Get builds with WOLFSSL_NO_CLIENT_AUTH compiling and testing
Fix build for no client or server and no client auth.
Fix tests to detect when no client auth compiled and test is trying to
do client auth.
2020-09-01 15:27:46 +10:00
Sean Parkinson
db864be6a4 TLS 1.3 Early Data: fix
Will process early data packets now.
Added test to check output of server for early data being received.
2020-08-31 09:03:05 +10:00
Juliusz Sosinowicz
c6d1d524fc HAVE_SESSION_TICKET can also be defined without TLS 1.2 2020-08-28 16:05:28 +02:00
David Garske
3e685fdb5b Fix for DTLS DoClientHello HMAC free (function has another exit point). 2020-08-27 10:02:15 -07:00
Eric Blankenhorn
ea5c290d60 Fix CheckHostName matching 2020-08-26 14:03:17 -05:00
David Garske
61545df606 Fix to make sure DTLS cookie HMAC free gets called. Note: This does not cover the many error case paths. 2020-08-26 09:41:26 -07:00
David Garske
5f059306fd Fix for case with ssl->error not being set. 2020-08-21 15:47:02 -07:00
John Safranek
55632a0567 Two more out of order DTLS message fixes. 2020-08-18 17:54:25 -07:00
John Safranek
3be7f3ea3a Reject DTLS application data messages in epoch 0 as out of order. 2020-08-14 17:21:39 -07:00
John Safranek
3f6861ee82 FIPS Ready Fix with ECC Timing Resistance
Commit 6467de5 added some timing resistance to ECC shared secret
agreement. It involved adding an RNG object to the ecc keys so
a random z value can be added to the mix. The older FIPS release
has ECC outside the boundary, so it uses the new ECC code. FIPSv2
has ECC inside the boundary, but all the TLS code checks for that
version of FIPS and leaves out the calls to the new functions as
it is using an older version of ecc.c. FIPS Ready uses the latest
version of ecc.c but compiles as FIPSv2. So, the code outside of
the crypto layer is treating ECC as FIPSv2 and not calling the new
functions, but the crypto layer assumes the RNG should be present,
and errs out on testing.
1. Added a separate option for FIPS Ready to the enable-fips
   configure option. `--enable-fips=ready`. It will treat FIPS
   Ready as the next kind of FIPS release. FIPS Ready will be
   treated like FIPS v3 in the build.
2. Changed the C preprocessor checks for FIPS version 2 to be
   checks for not version 2, with respect to ECC Timing Resistance
   and FIPS builds.
2020-08-14 10:54:55 -07:00
toddouska
532c2f50e8 Merge pull request #3083 from julek-wolfssl/openssl-compat-X509V3_EXT_i2d
Implement more OpenSSL compatibility functions
2020-08-11 15:01:41 -07:00
toddouska
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
toddouska
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
JacobBarthelmeh
8b7f588aaf Merge pull request #3108 from SparkiDev/openssl_interop
Update OpenSSL interopability testing
2020-08-11 09:42:43 -06:00
Sean Parkinson
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
Sean Parkinson
6467de5a88 Randomize z ordinates in scalar mult when timing resistant
An RNG is required for shared secret calculation now.
Use wc_ecc_set_rng() to set an RNG against the ECC object.
ECC verification does not need timing resistance and does not randomize
z ordinates.
2020-08-11 16:12:47 +10:00
toddouska
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
David Garske
c0a664a8e5 Merge pull request #3200 from douzzer/20200805
Add an error-checking wc_curve25519_make_pub() routine to the API for use by Wireguard
2020-08-07 16:32:52 -07:00
Eric Blankenhorn
064bfa583d Fix CheckAltNames to handle IP type 2020-08-07 10:12:56 -05:00
Daniel Pouzzner
758665e347 Fix for TLS anonymous cipher and PKCS11 cast warnings. (author=dgarske) 2020-08-06 17:49:55 -05:00
Sean Parkinson
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
toddouska
e121139178 Merge pull request #3179 from ejohnstown/suitesz
Suite Size Check
2020-08-06 11:05:10 -07:00