Commit Graph

3466 Commits

Author SHA1 Message Date
David Garske
023db01aca * Fixed some build configuration variations.
* Fixed `PEM_BUFSIZE` macro redefined when building with coexist.
* Updated the `user_settings_all.h` and `user_settings_wolfboot_keytools.h` to include latest options.
* Improved API unit test error case checking where `TEST_RES_CHECK` is not used.
* Changed `TEST_SKIPPED` to unique value.
* Added CI tests for enable-all, small stack, and user setting templates.
2023-01-03 10:59:59 -08:00
Jacob Barthelmeh
9dcc48c8f7 update copyright to 2023 2022-12-30 17:12:11 -07:00
David Garske
5c0abfd7ad Merge pull request #5936 from embhorn/zd15400
Fix unguarded XFPRINTF calls
2022-12-28 12:47:19 -08:00
Eric Blankenhorn
004705b38f Fix unguarded XFPRINTF calls 2022-12-28 12:23:40 -06:00
Chris Conlon
aadce3af9c Merge pull request #5930 from miyazakh/subscript_has_char 2022-12-28 10:18:43 -07:00
Anthony Hu
b3e99348cd Purge the AES variant of Dilithium 2022-12-27 14:37:47 -05:00
Hideki Miyazaki
684646c8b9 fix shadows min and subscript by i486-netbsd-gcc 2022-12-25 07:20:04 +09:00
Juliusz Sosinowicz
6a8be960ba DTLS-SRTP: use wolfSSL_export_keying_material instead of wc_PRF_TLS 2022-12-20 16:42:28 +01:00
JacobBarthelmeh
3d1775320b Merge pull request #5900 from icing/tls12-no-tickets
WOLFSSL_OP_NO_TICKET fix for TLSv1.2
2022-12-16 14:42:50 -07:00
Stefan Eissing
9d0b16097e Fix builds without session tickets. 2022-12-16 09:40:51 +01:00
Stefan Eissing
dccabc60a5 Disabling TLSv1.2 session tickets when WOLFSSL_OP_NO_TICKET is being set.
There seems to have been a misunderstanding that WOLFSSL_OP_NO_TICKET would only disable tickets
for TLS version lower than 1.2. But it includes 1.2 as well.
2022-12-16 09:29:44 +01:00
Chris Conlon
f9bd8f76de add Android system CA certs path for to wolfSSL_CTX_load_system_CA_certs() usage 2022-12-15 16:39:48 -07:00
Stefan Eissing
78fd5d7dbc Fix wolfSSL_set_SSL_CTX() to be usable during handshake.
This method requires some explanation. Its sibling is
  int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
which re-inits the WOLFSSL* with all settings in the new CTX.
That one is the right one to use *before* a handshake is started.

This method was added by OpenSSL to be used *during* the handshake, e.g.
when a server inspects the SNI in a ClientHello callback and
decides which set of certificates to use.

Since, at the time the SNI callback is run, some decisions on
Extensions or the ServerHello might already have been taken, this
method is very restricted in what it does:
 - changing the server certificate(s)
 - changing the server id for session handling
and everything else in WOLFSSL* needs to remain untouched.
2022-12-15 09:33:01 +01:00
Stefan Eissing
02094ebb2e Updates after review by JacobBarthelmeh.
- fix err/ret rename leftover for python builds
- add documenetation to thread-local functions
- move generic queue functions up
2022-12-08 09:53:05 +01:00
Stefan Eissing
45f9ef5dd9 Improvements in OpenSSL Compat ERR Queue handling.
Configuration
- thread-local storaoge is selected when available
- '--enable-error-queue-per-thread' and '--disable-error-queue-per-thread' can
  be used as before to explicitly en-/disable the feature.

Implementation:
- with thread-local-storage, error queue is realized in one struct without
  allocations. Queue size is restricted to 16 entries (per thread), which
  is the same limit in OpenSSL 1.1.x.
- without thread-local-storage, all error queue operations are mutex locked
- wc_PeekErrorNodeLineData() and wc_GetErrorNodeErr() added for use by SSL
  functions to allow locked queue iterations/manipulations.
2022-12-07 18:14:45 +01:00
Sean Parkinson
e5d03cf5ad Merge pull request #5848 from philljj/fix_mingw64_build
Fix mingw-w64 build issues on windows.
2022-12-07 08:57:07 +10:00
jordan
246ce8dbe1 Cleanup spaces. 2022-12-06 15:24:34 -06:00
David Garske
9d9549fbd3 Merge pull request #5836 from anhu/kyber_cleanup
Remove kyber-90s and route all kyber through wolfcrypt.
2022-12-05 13:18:44 -08:00
jordan
87113cc88d Fix mingw-w64 build issues on windows. 2022-12-03 17:00:44 -06:00
David Garske
8fb92a283a Merge pull request #5716 from rizlik/dtls_cookie_stateless
dtls: allow for stateless client hello parsing
2022-12-01 13:47:33 -08:00
David Garske
d1e6ce064f Merge pull request #5832 from JacobBarthelmeh/fuzzing
free signer if malloc cases fail
2022-12-01 10:35:15 -08:00
Marco Oliverio
fc4b008912 dtls: fix heap hint in XFREE 2022-12-01 16:47:37 +00:00
Marco Oliverio
af00c89f18 dtls v1.2: stateless support WOLFSSL_DTLS_NO_HVR_ON_RESUME 2022-12-01 16:30:54 +00:00
Stefan Eissing
e5cfd96609 QUIC API support in OpenSSL compat layer, as needed by HAProxy integration.
- adding patch for HAProxy, see dod/QUIC.md, based on current master.
      For documentaton purposes, since HAProxy does not accept PRs. To be
      removed once forwarded to the project.
2022-12-01 10:12:35 +01:00
Anthony Hu
a2fb4c0788 Remove kyber-90s and route all kyber through wolfcrypt. 2022-11-30 17:17:28 -05:00
JacobBarthelmeh
01833a369e free signer if malloc cases fail 2022-11-30 10:02:33 -08:00
Anthony Hu
7c576de914 Fixes from testing 2022-11-25 16:00:09 -05:00
Anthony Hu
0bfa5c9836 Purge NTRU and SABER. Not going to be standardized. 2022-11-25 14:54:08 -05:00
David Garske
0a38553909 Merge pull request #5798 from JacobBarthelmeh/python
account for 'pulled' error nodes
2022-11-23 14:57:03 -08:00
Anthony Hu
6190666108 Support for Analog Devices MAXQ1080 and MAXQ1065 2022-11-23 11:57:31 -05:00
Jacob Barthelmeh
b6ae17804a update comments and check error case 2022-11-22 11:22:38 -07:00
jordan
153ab82ad8 Fix leak in wolfSSL_X509_NAME_ENTRY_get_object. 2022-11-18 11:23:15 -06:00
JacobBarthelmeh
143dac64a3 account for 'pulled' error nodes 2022-11-17 14:51:37 -08:00
David Garske
887b4bd9f0 Merge pull request #5767 from haydenroche5/load_system_root_certs
Improve logic for enabling system CA certs on Apple devices.
2022-11-07 15:15:13 -08:00
David Garske
59774ae576 Fixes for building with use of heap hint and compatibility layer. Fix for invalid OSSL callback function errors. 2022-11-07 11:33:39 -08:00
Hayden Roche
d7cbd8cd17 Improve logic for enabling system CA certs on Apple devices.
In configure.ac and CMakeLists.txt, check for the header
Security/SecTrustSettings.h. If this header is found, enable the feature. If
it isn't, disable it. For non-configure/non-CMake builds, require the user to
explicitly define HAVE_SECURITY_SECTRUSTSETTINGS_H if they want to use system
CA certs (handled in settings.h).
2022-11-04 13:52:45 -07:00
Hayden Roche
4a917219f7 Merge pull request #5608 from SparkiDev/pk_c_rework_2 2022-11-04 13:32:36 -07:00
Daniel Pouzzner
dfa603e502 fixes for warnings and defects around QUIC and ALPN -- fixes for clang-diagnostic-gnu-zero-variadic-macro-arguments, clang-analyzer-deadcode.DeadStores, clang-analyzer-core.UndefinedBinaryOperatorResult, clang-analyzer-security.insecureAPI.strcpy, and an overrun prevention assert in wolfSSL_ALPN_GetPeerProtocol(). 2022-10-26 11:32:06 -05:00
Sean Parkinson
5db2d53d54 Fixes from review part 2 2022-10-26 16:04:05 +10:00
Sean Parkinson
e68c7bb74d Move file and BIO reading out to ssl_misc.c 2022-10-26 10:28:20 +10:00
Sean Parkinson
dad62fc182 pk.c: rework DH API and improve PEM read/write
Reorganized the DH APIs into groups.
Reworked all DH APIs.
Improved testing of DH API.

Implemented wolfSSL_PEM_read_RSAPublicKey() and
wolfSSL_PEM_write_RSA_PUBKEY().
Fix public key PEM write implementations to use the correct
header/footer names.
Added support for "RSA PUBLIC KEY" in header and footer in DerToPemEx().

Reworked PEM read/write APIs to be independent. No longer create an EVP
to use common function - common functionality refectored out.
Similarly file APIs don't create a BIO and call the partner APIs.

Improved testing of PEM read/write APIs.

Generic read BIO from memory BIO now returns the buffer instead of
allocating memory and reading.
No longer reading chunks when a file BIO.

Added wolfssl_make_rng() to create or get get global random. All RSA and
DH APIs now use this. DH_generate_parameters() creates a random object
and use global on error rather than just using global random.

Changed implementations to use BIO_new_fp() instead of create a new BIO
and setting file pointer.
2022-10-26 10:28:20 +10:00
Sean Parkinson
8d8371ac5a Merge pull request #5717 from icing/sni-alpn-order
Changing ALPN selection to a deterministic point in the handshake.
2022-10-26 09:47:23 +10:00
JacobBarthelmeh
0f9279ce52 Merge pull request #5684 from SparkiDev/ssl_sess_version_check
SSL session retrieval: check protocol version
2022-10-25 17:29:54 -06:00
Stefan Eissing
a1203917c5 Update after review by haydenroche5. 2022-10-24 10:17:29 +02:00
Hayden Roche
fdffdd241f Merge pull request #5711 from philljj/add_SSL_set1_host 2022-10-20 15:02:24 -07:00
Stefan Eissing
f1cf96846a Changing ALPN selection to a deterministic point in the handshake. 2022-10-19 15:25:52 +02:00
Daniel Pouzzner
895a2e1ac5 WOLFSSL_CALLBACKS codepaths: fixes for bugprone-unused-return-value, bugprone-macro-parentheses, readability-named-parameter, and clang-analyzer-deadcode.DeadStores 2022-10-18 13:34:42 -05:00
jordan
7e35919cc0 Add SSL_set1_host 2022-10-17 16:23:38 -05:00
John Safranek
b838d65a72 wincrypt.h requires windows.h, which isn't included in internal.h when WOLFCRYPT_ONLY set 2022-10-12 15:33:23 -07:00
David Garske
3b33c962c4 Merge pull request #5660 from haydenroche5/load_system_root_certs
Add support for wolfSSL_CTX_load_system_CA_certs on Windows and Mac.
2022-10-11 08:38:57 -07:00