Commit Graph

2514 Commits

Author SHA1 Message Date
Sean Parkinson
e4e53ab7ca Unit test: rework to be able to run API tests individually
Change API test cases to return a result.
Test success is now TEST_SUCCESS (1).
Test result can be returned with use of macro TEST_RES_CHECK().
Always print the id, name of the test and the result (skipped or
otherwise) before and after running the test case.

Changed test case output to go to stderr.
Fixed some formatting.

Add option to take index and/or name of test case to run.
Added option to list all API tests.
Added option to only run API tests.
Added options to show usage.
2022-11-29 12:37:20 +10: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
JacobBarthelmeh
143dac64a3 account for 'pulled' error nodes 2022-11-17 14:51:37 -08:00
jordan
17105606b1 Cleanup format and typos, and use WOLFSSL_FILETYPE. 2022-11-15 11:45:11 -06:00
jordan
81ed2a60b4 Support ASN1/DER CRLs in LoadCertByIssuer.
This fixes hash based dir lookup of ASN1/DER CRLs in OpenSSL
compatible API. The function wolfSSL_X509_load_crl_file is
called with entry->dir_type, rather than hardcoded filetype.

A new test crl was added, and existing crl 0fdb2da4.r0 was
reorganized to a new dir.

Also, completes the stub wolfSSL_X509_LOOKUP_add_dir. A new
test function test_X509_LOOKUP_add_dir was added to tests/api.c
2022-11-11 15:13:00 -06:00
tim-weller-wolfssl
3bc3ec25b8 Add link of newly created x509 store's certificate manager to self by default 2022-11-09 17:17:30 -06:00
David Garske
eac3b4e189 Merge pull request #5752 from julek-wolfssl/alt-name-str-type
Set alt name type to V_ASN1_IA5STRING
2022-11-08 15:42:39 -08:00
Daniel Pouzzner
48ba365fd6 fixes for defects:
clang-analyzer-deadcode.DeadStores in examples/server/server.c;

-Werror=use-after-free and LeakSanitizer Direct leak in tests/api.c;

nullPointerRedundantCheck in src/pk.c which identified a semantically consequential flub.
2022-11-08 14:04:16 -06:00
Sean Parkinson
bd83345c02 Merge pull request #5773 from dgarske/async_v5.5.3
Fixes for various tests that do not properly handle `WC_PENDING_E`
2022-11-08 14:47:23 +10:00
David Garske
1ee3a78e4a Fixes for various tests that do not properly handle WC_PENDING_E. 2022-11-04 14:56:40 -07:00
Hayden Roche
5d70f3efce Merge pull request #5730 from philljj/zd15040 2022-11-04 13:32:48 -07:00
Hayden Roche
4a917219f7 Merge pull request #5608 from SparkiDev/pk_c_rework_2 2022-11-04 13:32:36 -07:00
JacobBarthelmeh
8225d3642b save next status with OCSP response verify 2022-11-03 22:39:47 -07:00
Juliusz Sosinowicz
8bbbdfa3f9 Set alt name type to V_ASN1_IA5STRING 2022-10-28 19:58:01 +02:00
JacobBarthelmeh
7366a9edbd Merge pull request #5744 from SparkiDev/regression_fixes_4
Regresssion testing fixes
2022-10-27 11:49:52 -06:00
Sean Parkinson
fd7544ca19 Regresssion testing fixes
Ed25519 and Ed448 need to enable certs.

If no system CA certs can't be parsed,
wolfSSL_CTX_load_system_CA_certs() will fail. Don't try test if RSA and
ECC are not enabled.

Fix benchmark.c so that e is defined when WOLFSSL_BENCHMARK_ALL defined.

MAX_LENGTH_SZ is 4 and supports lengths up to 2^24 - one byte for length
and 3 bytes of length.
(new gcc compiler fix)
2022-10-27 17:47:48 +10:00
Hayden Roche
294a26ba0c Merge pull request #5708 from JacobBarthelmeh/OCSP 2022-10-26 15:43:15 -07:00
JacobBarthelmeh
8f2d35bb84 Merge pull request #5741 from douzzer/20221026-fixes-QUIC-and-ALPN
20221026-fixes-QUIC-and-ALPN
2022-10-26 15:03:28 -06:00
Jacob Barthelmeh
8d6ee0b26a minor warning fixes 2022-10-26 10:48:51 -06: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
JacobBarthelmeh
a26b89f66b fix leak with multiple entries 2022-10-26 09:29:06 -07:00
Sean Parkinson
5db2d53d54 Fixes from review part 2 2022-10-26 16:04:05 +10:00
Sean Parkinson
2d19f00dd5 Merge pull request #5736 from douzzer/20221025-fixes-wolfsentry-and-armv7a
20221025-fixes-wolfsentry-and-armv7a
2022-10-26 12:38:01 +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
Daniel Pouzzner
baa19c1092 tests/api.c: fix 3 clang-analyzer-deadcode.DeadStores. 2022-10-25 18:17:22 -05:00
JacobBarthelmeh
29a5c04c2e add test case 2022-10-25 15:35:37 -07:00
Hayden Roche
5c3b3e6ede Merge pull request #5733 from ejohnstown/assert-whitespace 2022-10-25 13:45:54 -07:00
John Safranek
e803e5916c Assert Consistency
1. Make whitespace in asserts consistent.
2. Added typecasting of the string inputs for AssertStr.
2022-10-25 11:42:51 -07:00
jordan
8b7668f771 Fix X509 subject and issuer name_hash mismatch
Fix api test and cleanup.
2022-10-25 13:00:22 -05:00
Hayden Roche
e7a121325b Merge pull request #5720 from julek-wolfssl/nid-defines 2022-10-25 10:34:59 -07:00
Hayden Roche
2b72a50688 Merge pull request #5662 from Uriah-wolfSSL/haproxy-update-2.6.0 2022-10-25 07:47:54 -07:00
Juliusz Sosinowicz
55091c6464 Add small test 2022-10-25 13:13:14 +02:00
jordan
e3153f3997 Fix X509 subject and issuer name_hash mismatch 2022-10-24 18:09:44 -05:00
Uriah Pollock
19e30b081f Resolved sanitizer issue. 2022-10-24 16:27:18 -05:00
Hayden Roche
a60a15d544 Merge pull request #5721 from philljj/zd15011 2022-10-21 12:32:03 -07:00
Uriah Pollock
6aff27c5c8 Resolved valgrind issue. Updated ASN1_TIME usage per feedback.
Refactored wolfSSL_d2i_OCSP_CERTID per feedback.
2022-10-21 13:16:32 -05:00
Hayden Roche
fdffdd241f Merge pull request #5711 from philljj/add_SSL_set1_host 2022-10-20 15:02:24 -07:00
jordan
bfe8b9b76c correct DIST_POINT_NAME type value 2022-10-20 15:10:36 -05:00
Stefan Eissing
057fdd30d3 Properly check the defined() combinations that make ALPN and SNI available for testing. 2022-10-20 09:21:36 +02:00
Stefan Eissing
f1cf96846a Changing ALPN selection to a deterministic point in the handshake. 2022-10-19 15:25:52 +02:00
jordan
90eefc2824 fix unit test when RSA disabled 2022-10-18 21:03:41 -05:00
Hayden Roche
b7c4ddba72 Merge pull request #5663 from lealem47/scan_build 2022-10-18 08:10:33 -07:00
Stefan Eissing
9726d1f6eb Allowing use of SSL/CTX_set_max_early_data() for client side.
- updating english doc and test cases
2022-10-18 10:40:18 +02:00
Lealem Amedie
327b66d3ed Miscellaneous fixes from scan-build and KDF refactor & small build fixes 2022-10-17 14:34:08 -07:00
jordan
7e35919cc0 Add SSL_set1_host 2022-10-17 16:23:38 -05:00
JacobBarthelmeh
bc1c087701 free PKCS7 in test case 2022-10-17 08:24:38 -07:00
JacobBarthelmeh
6f1db6c03a Merge pull request #5697 from cconlon/pkcs7SignedCertSet
PKCS#7: Fix SignedData verification when signer cert is not first in SET
2022-10-14 16:05:40 -06:00
Hayden Roche
6829c956b7 Merge pull request #5701 from dgarske/20221013_fixes 2022-10-13 14:59:41 -07:00