|
211 | 211 | #include <tests/api/test_hash.h> |
212 | 212 | #include <tests/api/test_hmac.h> |
213 | 213 | #include <tests/api/test_cmac.h> |
| 214 | +#include <tests/api/test_kdf.h> |
214 | 215 | #include <tests/api/test_she.h> |
215 | 216 | #include <tests/api/test_des3.h> |
216 | 217 | #include <tests/api/test_chacha.h> |
|
223 | 224 | #include <tests/api/test_ascon.h> |
224 | 225 | #include <tests/api/test_sm4.h> |
225 | 226 | #include <tests/api/test_wc_encrypt.h> |
| 227 | +#include <tests/api/test_coding.h> |
| 228 | +#include <tests/api/test_error.h> |
226 | 229 | #include <tests/api/test_random.h> |
| 230 | +#include <tests/api/test_wolfentropy.h> |
227 | 231 | #include <tests/api/test_wolfmath.h> |
228 | 232 | #include <tests/api/test_rsa.h> |
229 | 233 | #include <tests/api/test_dsa.h> |
@@ -7525,10 +7529,25 @@ static int test_wolfSSL_read_write_ex(void) |
7525 | 7529 | ExpectIntEQ(XSTRCMP((char*)buf, test_str), 0); |
7526 | 7530 |
|
7527 | 7531 |
|
7528 | | - ExpectIntEQ(wolfSSL_shutdown(ssl_c), WOLFSSL_SHUTDOWN_NOT_DONE); |
7529 | | - ExpectIntEQ(wolfSSL_shutdown(ssl_s), WOLFSSL_SHUTDOWN_NOT_DONE); |
7530 | | - ExpectIntEQ(wolfSSL_shutdown(ssl_c), WOLFSSL_SUCCESS); |
7531 | | - ExpectIntEQ(wolfSSL_shutdown(ssl_s), WOLFSSL_SUCCESS); |
| 7532 | + /* Drive the bidirectional close-notify exchange to completion instead of |
| 7533 | + * asserting a fixed NOT_DONE/SUCCESS sequence: the number of shutdown |
| 7534 | + * round-trips is protocol-version/config dependent, so a hard-coded |
| 7535 | + * sequence is fragile (fails e.g. under the cmake old-TLS build). */ |
| 7536 | + { |
| 7537 | + int shutC = WOLFSSL_SHUTDOWN_NOT_DONE; |
| 7538 | + int shutS = WOLFSSL_SHUTDOWN_NOT_DONE; |
| 7539 | + int shutIt; |
| 7540 | + for (shutIt = 0; shutIt < 10 && |
| 7541 | + (shutC != WOLFSSL_SUCCESS || shutS != WOLFSSL_SUCCESS); |
| 7542 | + shutIt++) { |
| 7543 | + if (shutC != WOLFSSL_SUCCESS) |
| 7544 | + shutC = wolfSSL_shutdown(ssl_c); |
| 7545 | + if (shutS != WOLFSSL_SUCCESS) |
| 7546 | + shutS = wolfSSL_shutdown(ssl_s); |
| 7547 | + } |
| 7548 | + ExpectIntEQ(shutC, WOLFSSL_SUCCESS); |
| 7549 | + ExpectIntEQ(shutS, WOLFSSL_SUCCESS); |
| 7550 | + } |
7532 | 7551 |
|
7533 | 7552 | wolfSSL_free(ssl_c); |
7534 | 7553 | wolfSSL_free(ssl_s); |
@@ -37011,6 +37030,8 @@ TEST_CASE testCases[] = { |
37011 | 37030 | TEST_HMAC_DECLS, |
37012 | 37031 | /* CMAC */ |
37013 | 37032 | TEST_CMAC_DECLS, |
| 37033 | + /* KDF */ |
| 37034 | + TEST_KDF_DECLS, |
37014 | 37035 | /* SHE */ |
37015 | 37036 | TEST_SHE_DECLS, |
37016 | 37037 | #ifdef WOLFSSL_SHE_EXTENDED |
@@ -37052,9 +37073,14 @@ TEST_CASE testCases[] = { |
37052 | 37073 | TEST_SM4_DECLS, |
37053 | 37074 | /* wc_encrypt API */ |
37054 | 37075 | TEST_WC_ENCRYPT_DECLS, |
| 37076 | + /* wolfCrypt coding (Base64/Base16) */ |
| 37077 | + TEST_CODING_DECLS, |
| 37078 | + /* wolfCrypt error strings */ |
| 37079 | + TEST_ERROR_DECLS, |
37055 | 37080 |
|
37056 | 37081 | /* RNG tests */ |
37057 | 37082 | TEST_RANDOM_DECLS, |
| 37083 | + TEST_WOLFENTROPY_DECLS, |
37058 | 37084 |
|
37059 | 37085 | /* Public key */ |
37060 | 37086 | /* wolfmath MP API tests */ |
|
0 commit comments