Commit Graph

15134 Commits

Author SHA1 Message Date
David Garske
668f8700a4 Fix to not try OCSP or CRL checks if there is already an error. This fix prevents an error code from being overwritten if there is already a failure. ZD13032 2021-10-07 15:30:16 -07:00
David Garske
725e503c57 Merge pull request #4451 from SparkiDev/asn_templ_fix_1
ASN template: replicate AddAltName change in template code
2021-10-07 09:23:37 -07:00
elms
8c178118a4 Configure: add option to enable alternate certificate chains (#4455) 2021-10-07 11:14:51 +10:00
David Garske
9d2082f7e1 Fixes and improvements for crypto callbacks with TLS (mutual auth) (#4437)
* This PR resolves issues with using TLS client authentication (mutual auth) with crypto callbacks. The TLS client auth will not be sent without a private key being set. The solution is to allow setting a public key only if crypto callbacks is enabled and a devId is set.

* Fix to allow using crypto callbacks with TLS mutual authentication where a private key is not available.
* Fix for ED25519 sign when only a private key is loaded.
* Fix to enable crypto callbacks for ED25519 and Curve25519 in TLS by using the _ex init functions.
* Fix for wc_PemToDer return code where a PKCS8 header does not exist.
* Remove duplicate logs in DoCertificateVerify.
* Doxygen API updates: Added crypto callback help and updated use_PrivateKey with info about public key use.

* * Added crypto callback tests for TLS client and server with mutual auth for RSA, ECC and ED25519.
* Enhanced the API unit test TLS code to allow setting CA, cert and key.

* Revert ED25519 changes. Opt to calculate public key directly when required for signing in the TLS crypto callback test. Build configuration fixes.

* Fix to use proper devId in `ProcessBufferTryDecode`.

* Various build fixes due to changes in PR. G++ issue with `missing-field-initializers`. Unused api.c func with DTLS and session export. Duplicate `eccKeyPubFile` def.

* Added crypto callback TLS tests at WOLFSSL object level. Fix for ED25519/ED448 with client mutual auth where the private key is not set till WOLFSSL object. Fix issues with  `wolfSSL_CTX_GetDevId` where devId is set on WOLFSSL object. Enable the `_id` API's for crypto callbacks.

* Proper fix for `eccKeyPubFile` name conflict. Was causing RSA test to fail (expected DER, not PEM).
2021-10-07 11:12:06 +10:00
Sean Parkinson
dfbdcf9400 ASN template: replicate AddAltName change in template code 2021-10-07 09:51:56 +10:00
David Garske
928f4ad430 Merge pull request #4452 from LinuxJedi/stm32-readme-fix
Fixes to STM32 README
2021-10-06 10:07:41 -07:00
David Garske
da15356c2a Merge pull request #4444 from anhu/pq_bench
Benchmarking the supported groups.
2021-10-05 09:52:51 -07:00
JacobBarthelmeh
43ffe26133 Merge pull request #4430 from embhorn/zd12976
Add support for X9.42 header
2021-10-05 23:47:42 +07:00
Andrew Hutchings
fd54dc4838 Fixes to STM32 README
* Reordered things so that the installation of the Cube Pack comes
  before the Cube Pack usage.
* Added another way to find the pack installation menu (because I'm
  blind to the box on the screen apparently).
* Two extra steps in the Cube Pack Usage that were missing (6 & 8)
* Added syntax highlighting to the markdown.
2021-10-05 14:19:35 +01:00
David Garske
310a75ff43 Merge pull request #4449 from SparkiDev/fix_1
X509 name: remove unused variable
2021-10-04 20:01:04 -07:00
David Garske
024c59a04c Merge pull request #4439 from SparkiDev/tls13_min_down_no_ext
TLS 1.3: Check min downgrade when no extensions in ServerHello
2021-10-04 16:39:29 -07:00
Sean Parkinson
152da35ca4 X509 name: remove unused variable 2021-10-05 09:06:10 +10:00
Anthony Hu
41b9b14cfb whitespace 2021-10-04 18:35:09 -04:00
Anthony Hu
f77a5e26b5 semi-colon --> colon and use wolfTLSv1_3_server_method when NO_WOLFSSL_CLIENT. 2021-10-04 18:31:28 -04:00
Anthony Hu
310ab6692a Drop a function brace and WOLFSSL_TLS13. 2021-10-04 13:56:01 -04:00
Anthony Hu
0bee624ee5 Merge pull request #4447 from lealem47/oqs-doc 2021-10-04 13:03:46 -04:00
Eric Blankenhorn
1440b8966d Add test for X9.42 parsing 2021-10-04 11:05:58 -05:00
Lealem Amedie
4084928d93 Slight changes to liboqs documentation in INSTALL and example client/server 2021-10-02 13:14:32 -06:00
David Garske
0abbd9b1ec Merge pull request #4438 from ejohnstown/dtls-big
DTLS Related Fixes
2021-10-01 13:04:20 -07:00
Anthony Hu
2fa0114d54 Benchmarking the supported groups. 2021-10-01 15:38:07 -04:00
David Garske
97d96c6cf8 Merge pull request #4422 from haydenroche5/cmake
Add a CMake option to build wolfcrypt test and bench code as libraries.
2021-10-01 12:32:50 -07:00
John Safranek
774bc36603 Merge pull request #4061 from JacobBarthelmeh/sessionExport 2021-10-01 10:21:42 -07:00
John Safranek
cd2bd0b7a3 Enable All Disable DTLS fixes
1. Remove mcast and jni from enable-all.
2. Add comment to DTLS section.

Testing `./configure --enable-all --disable-dtls` would leave DTLS still
enabled. enable-all was also enabling mcast, which it doesn't need to
do, that would force DTLS back on. JNI also forces DTLS on. The other
language wrappers are not included in enable-all, so leave JNI out.
2021-10-01 09:56:58 -07:00
John Safranek
faca24c00d Merge pull request #4434 from SparkiDev/armv8_nighlty_1 2021-10-01 09:06:33 -07:00
David Garske
d48dc55611 Merge pull request #4440 from SparkiDev/jenkins_powerpc_fix_1
ASN: tidy up SetAsymKeyDerPublic()
2021-10-01 08:17:12 -07:00
David Garske
a575595e5f Merge pull request #4256 from SparkiDev/arm_keil_fix
SP ARM Thumb support for Keil and performance improvements
2021-10-01 07:10:41 -07:00
Sean Parkinson
4473e9335e TLS 1.3: Check min downgrade when no extensions in ServerHello
TLS 1.3 ServerHello must have extensions, so server attempting to
downgrade, but min downgrade was not checked in that case.
2021-10-01 12:51:10 +10:00
David Garske
66a6153456 Merge pull request #4436 from elms/makefile/add_ed448
GCC makefile: Add sources files
2021-09-30 18:44:36 -07:00
Sean Parkinson
ca002b5ee9 ASN: tidy up SetAsymKeyDerPublic()
Also, nighlty PowerPC Jenkins test complained of use of uninitialized in
function. Ensure vars initialized despite not needing it.
2021-10-01 10:44:07 +10:00
Sean Parkinson
6300989937 SP: Thumb assembly for older Keil compilers and optimize
Improve the generated instructions for multiplying 32 bits by 32 bits
and squaring 32 bits with 64 bit results.
Minimize loads in montgomery reduction, mul and sqr.
Pull conditional subtract into montgomery reduction assembly code.
Added unrolled square and multiply
Define WOLFSSL_SP_LARGE_CODE to use the unrolled versions.
2021-10-01 09:52:29 +10:00
John Safranek
98b1e93429 Merge pull request #4402 from JacobBarthelmeh/Compatibility-Layer 2021-09-30 15:53:58 -07:00
elms
f1a0d00f4e GCC Makefile: wrap async and selftest 2021-09-30 15:51:19 -07:00
Jacob Barthelmeh
ed8b87306d account for test case where psk and anon is off 2021-09-30 15:48:55 -06:00
John Safranek
b0de40d10a Forgive a DTLS session trying to send too much at once. (ZD12921) 2021-09-30 14:27:21 -07:00
elms
2dfc3f308b GCC makefile: Add other missing source files 2021-09-30 14:25:15 -07:00
John Safranek
998c7a9cb9 Merge pull request #4435 from anhu/docfix 2021-09-30 09:50:38 -07:00
Jacob Barthelmeh
cb4b57c5c7 add tls 1.3 test case 2021-09-30 10:08:47 -06:00
Anthony Hu
833c9d3f71 Fix INSTALL file to specify levels. 2021-09-30 09:43:32 -04:00
Sean Parkinson
38cfec89e8 ARMv8: fix configurations
Poly1305: poly1305_block() is void for ARMv8 ASM
SHA512: explicitly include cryptocb.h.
AES: set keylen for EVP API
AES: Implement streaming AES-GCM.
2021-09-30 10:33:08 +10:00
Chris Conlon
cf1ce3f073 Add get_default_cert_file/env() stubs, SSL_get/set_read_ahead(), SSL_SESSION_has_ticket/lifetime_hint() (#4349)
* add wolfSSL_X509_get_default_cert_file/file_env/dir/dir_env() stubs

* add SSL_get_read_ahead/SSL_set_read_ahead()

* add SSL_SESSION_has_ticket()

* add SSL_SESSION_get_ticket_lifetime_hint()

* address review feedback - comments, return values

* make SSL_get_read_ahead() arg const

* add unit tests for SESSION_has_ticket/get_ticket_lifetime_hint

* test for SESSION_TICKET_HINT_DEFAULT in api.c for wolfSSL_SESSION_get_ticket_lifetime_hint()

* fix variable shadow warning in api.c
2021-09-30 08:35:23 +10:00
Chris Conlon
bcd6930581 Various OpenSSL compatibility expansion items, for Python 3.8.5 (#4347)
* make ASN1_OBJECT arg const in OBJ_obj2txt

* add ERR_LIB values to openssl/ssl.h

* add missing alert type definitions in openssl/ssl.h

* add definition for X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS, no support

* define value for X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT

* use correct CRYPTO_THREADID arg type for wolfSSL_THREADID_set_callback callback

* add handshake type defines for compat layer message callback types

* define ASN1_R_HEADER_TOO_LONG for compatibility builds

* use correct return type for wolfSSL_THREADID_set_callback, remove Qt code no longer needed
2021-09-30 08:32:49 +10:00
Chris Conlon
95b9fae605 Add DIST_POINT compatibility functions (#4351)
* add DIST_POINT compatibility functions

* switch X509_LU_* from enum to define, prevent compiler type warnings

* refactoring, adding in comments, and formating

* refactoring and a memory leak fix

* cast return value for g++ warning

* refactor wolfSSL_sk_DIST_POINT_pop_free and remove NULL assign after free

* fix get next DIST_POINT node for free function

Co-authored-by: Jacob Barthelmeh <jacob@wolfssl.com>
2021-09-30 08:27:39 +10:00
Jacob Barthelmeh
707385724e adjust macro guard around test cases 2021-09-29 13:28:20 -06:00
Jacob Barthelmeh
5f9f6fd9fa add some test cases and use allocator 2021-09-29 12:02:26 -06:00
David Garske
ecf7dea6a1 Merge pull request #4433 from anhu/unit_tests
Unit tests for post-quantum groups.
2021-09-29 10:31:00 -07:00
Jacob Barthelmeh
dd7b62d067 fix for use with idea enabled 2021-09-29 11:15:51 -06:00
elms
f46f69c1dc GCC makefile: Add ed448 files 2021-09-29 08:17:44 -07:00
Jacob Barthelmeh
ae47cb3bcd update check on is TLS, update macro guard for test case 2021-09-28 16:57:30 -06:00
Anthony Hu
a55cedd357 Fixup in response to dgarske comments 2021-09-28 18:36:18 -04:00
Anthony Hu
0e80923fb3 Unit tests for post-quantum groups.
Also, fixes for the things they caught such as:

- ssl->arrays->preMasterSecret is pre-allocated so copy into it instead of
  moving ownership of buffer.
- server does not need to save the public key.
- in TLSX_KeyShare_Parse() don't call TLSX_KeyShare_Use() because its done in
  TLSX_PopulateExtensions().
- in TLSX_KeyShare_Use(), the server generates the ciphertext while the client
  generates the public key.
- in TLSX_PopulateExtensions(), prevent client from calling TLSX_KeyShare_Use()
  because its already been done.
- Support longer curve/group names.
2021-09-28 17:16:44 -04:00