Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4161,6 +4161,7 @@ if(WOLFSSL_EXAMPLES)
tests/api/test_hash.c
tests/api/test_hmac.c
tests/api/test_cmac.c
tests/api/test_kdf.c
tests/api/test_she.c
tests/api/test_des3.c
tests/api/test_chacha.c
Expand All @@ -4173,7 +4174,10 @@ if(WOLFSSL_EXAMPLES)
tests/api/test_ascon.c
tests/api/test_sm4.c
tests/api/test_wc_encrypt.c
tests/api/test_coding.c
tests/api/test_error.c
tests/api/test_random.c
tests/api/test_wolfentropy.c
tests/api/test_wolfmath.c
tests/api/test_rsa.c
tests/api/test_dsa.c
Expand Down
34 changes: 30 additions & 4 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
#include <tests/api/test_hash.h>
#include <tests/api/test_hmac.h>
#include <tests/api/test_cmac.h>
#include <tests/api/test_kdf.h>
#include <tests/api/test_she.h>
#include <tests/api/test_des3.h>
#include <tests/api/test_chacha.h>
Expand All @@ -223,7 +224,10 @@
#include <tests/api/test_ascon.h>
#include <tests/api/test_sm4.h>
#include <tests/api/test_wc_encrypt.h>
#include <tests/api/test_coding.h>
#include <tests/api/test_error.h>
#include <tests/api/test_random.h>
#include <tests/api/test_wolfentropy.h>
#include <tests/api/test_wolfmath.h>
#include <tests/api/test_rsa.h>
#include <tests/api/test_dsa.h>
Expand Down Expand Up @@ -7524,10 +7528,25 @@ static int test_wolfSSL_read_write_ex(void)
ExpectIntEQ(XSTRCMP((char*)buf, test_str), 0);


ExpectIntEQ(wolfSSL_shutdown(ssl_c), WOLFSSL_SHUTDOWN_NOT_DONE);
ExpectIntEQ(wolfSSL_shutdown(ssl_s), WOLFSSL_SHUTDOWN_NOT_DONE);
ExpectIntEQ(wolfSSL_shutdown(ssl_c), WOLFSSL_SUCCESS);
ExpectIntEQ(wolfSSL_shutdown(ssl_s), WOLFSSL_SUCCESS);
/* Drive the bidirectional close-notify exchange to completion instead of
* asserting a fixed NOT_DONE/SUCCESS sequence: the number of shutdown
* round-trips is protocol-version/config dependent, so a hard-coded
* sequence is fragile (fails e.g. under the cmake old-TLS build). */
{
int shutC = WOLFSSL_SHUTDOWN_NOT_DONE;
int shutS = WOLFSSL_SHUTDOWN_NOT_DONE;
int shutIt;
for (shutIt = 0; shutIt < 10 &&
(shutC != WOLFSSL_SUCCESS || shutS != WOLFSSL_SUCCESS);
shutIt++) {
if (shutC != WOLFSSL_SUCCESS)
shutC = wolfSSL_shutdown(ssl_c);
if (shutS != WOLFSSL_SUCCESS)
shutS = wolfSSL_shutdown(ssl_s);
}
ExpectIntEQ(shutC, WOLFSSL_SUCCESS);
ExpectIntEQ(shutS, WOLFSSL_SUCCESS);
}

wolfSSL_free(ssl_c);
wolfSSL_free(ssl_s);
Expand Down Expand Up @@ -36911,6 +36930,8 @@ TEST_CASE testCases[] = {
TEST_HMAC_DECLS,
/* CMAC */
TEST_CMAC_DECLS,
/* KDF */
TEST_KDF_DECLS,
/* SHE */
TEST_SHE_DECLS,
#ifdef WOLFSSL_SHE_EXTENDED
Expand Down Expand Up @@ -36952,9 +36973,14 @@ TEST_CASE testCases[] = {
TEST_SM4_DECLS,
/* wc_encrypt API */
TEST_WC_ENCRYPT_DECLS,
/* wolfCrypt coding (Base64/Base16) */
TEST_CODING_DECLS,
/* wolfCrypt error strings */
TEST_ERROR_DECLS,

/* RNG tests */
TEST_RANDOM_DECLS,
TEST_WOLFENTROPY_DECLS,

/* Public key */
/* wolfmath MP API tests */
Expand Down
8 changes: 8 additions & 0 deletions tests/api/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tests_unit_test_SOURCES += tests/api/test_hash.c
# MAC
tests_unit_test_SOURCES += tests/api/test_hmac.c
tests_unit_test_SOURCES += tests/api/test_cmac.c
tests_unit_test_SOURCES += tests/api/test_kdf.c
# SHE
tests_unit_test_SOURCES += tests/api/test_she.c
# Cipher
Expand All @@ -32,8 +33,11 @@ tests_unit_test_SOURCES += tests/api/test_aes.c
tests_unit_test_SOURCES += tests/api/test_ascon.c
tests_unit_test_SOURCES += tests/api/test_sm4.c
tests_unit_test_SOURCES += tests/api/test_wc_encrypt.c
tests_unit_test_SOURCES += tests/api/test_coding.c
tests_unit_test_SOURCES += tests/api/test_error.c
# Random
tests_unit_test_SOURCES += tests/api/test_random.c
tests_unit_test_SOURCES += tests/api/test_wolfentropy.c
# MP
tests_unit_test_SOURCES += tests/api/test_wolfmath.c
# Public Key Algorithm
Expand Down Expand Up @@ -138,6 +142,7 @@ EXTRA_DIST += tests/api/test_digest.h
EXTRA_DIST += tests/api/test_hash.h
EXTRA_DIST += tests/api/test_hmac.h
EXTRA_DIST += tests/api/test_cmac.h
EXTRA_DIST += tests/api/test_kdf.h
EXTRA_DIST += tests/api/test_she.h
EXTRA_DIST += tests/api/test_des3.h
EXTRA_DIST += tests/api/test_chacha.h
Expand All @@ -151,7 +156,10 @@ EXTRA_DIST += tests/api/test_ascon.h
EXTRA_DIST += tests/api/test_sm4.h
EXTRA_DIST += tests/api/test_ascon_kats.h
EXTRA_DIST += tests/api/test_wc_encrypt.h
EXTRA_DIST += tests/api/test_coding.h
EXTRA_DIST += tests/api/test_error.h
EXTRA_DIST += tests/api/test_random.h
EXTRA_DIST += tests/api/test_wolfentropy.h
EXTRA_DIST += tests/api/test_wolfmath.h
EXTRA_DIST += tests/api/test_rsa.h
EXTRA_DIST += tests/api/test_dsa.h
Expand Down
Loading
Loading