Skip to content

Commit 9dccd66

Browse files
committed
address review: better guarding in test
1 parent cf96ab2 commit 9dccd66

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/api.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94147,8 +94147,9 @@ static int test_dtls12_basic_connection_id(void)
9414794147
unsigned char server_cid[] = { 0, 1, 2, 3, 4, 5 };
9414894148
unsigned char readBuf[40];
9414994149
const char* params[] = {
94150+
#ifndef NO_RSA
9415094151
#ifndef NO_SHA256
94151-
#ifdef WOLFSSL_AES_128
94152+
#if defined(WOLFSSL_AES_128) && defined(WOLFSSL_STATIC_RSA)
9415294153
"AES128-SHA256",
9415394154
#ifdef HAVE_AESCCM
9415494155
"AES128-CCM8",
@@ -94159,8 +94160,9 @@ static int test_dtls12_basic_connection_id(void)
9415994160
"DHE-RSA-AES128-GCM-SHA256",
9416094161
"ECDHE-RSA-AES128-GCM-SHA256",
9416194162
#endif
94162-
#endif
94163-
#endif
94163+
#endif /* WOLFSSL_AES_128 && WOLFSSL_STATIC_RSA */
94164+
#endif /* NO_SHA256 */
94165+
#endif /* NO_RSA */
9416494166
#if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
9416594167
"DHE-RSA-CHACHA20-POLY1305",
9416694168
"DHE-RSA-CHACHA20-POLY1305-OLD",
@@ -94225,8 +94227,10 @@ static int test_dtls12_basic_connection_id(void)
9422594227
}
9422694228
#endif
9422794229

94230+
#ifdef HAVE_SECURE_RENEGOTIATION
9422894231
ExpectIntEQ(wolfSSL_UseSecureRenegotiation(ssl_c), 1);
9422994232
ExpectIntEQ(wolfSSL_UseSecureRenegotiation(ssl_s), 1);
94233+
#endif
9423094234

9423194235
/* CH1 */
9423294236
wolfSSL_SetLoggingPrefix("client");
@@ -94325,6 +94329,7 @@ static int test_dtls12_basic_connection_id(void)
9432594329
ExpectIntEQ(wolfSSL_read(ssl_s, readBuf, sizeof(readBuf)), 1);
9432694330
ExpectIntEQ(readBuf[0], params[i][0]);
9432794331

94332+
#ifdef HAVE_SECURE_RENEGOTIATION
9432894333
/* do two SCR's */
9432994334
wolfSSL_SetLoggingPrefix("client");
9433094335
ExpectIntEQ(wolfSSL_Rehandshake(ssl_c), -1);
@@ -94442,7 +94447,7 @@ static int test_dtls12_basic_connection_id(void)
9444294447
ExpectNull(CLIENT_CID());
9444394448
ExpectIntEQ(wolfSSL_SSL_renegotiate_pending(ssl_c), 0);
9444494449
ExpectIntEQ(wolfSSL_SSL_renegotiate_pending(ssl_s), 0);
94445-
94450+
#endif
9444694451
/* Close connection */
9444794452
wolfSSL_SetLoggingPrefix("client");
9444894453
ExpectIntEQ(wolfSSL_shutdown(ssl_c), WOLFSSL_SHUTDOWN_NOT_DONE);
@@ -94455,7 +94460,9 @@ static int test_dtls12_basic_connection_id(void)
9445594460
wolfSSL_SetLoggingPrefix("server");
9445694461
ExpectIntEQ(wolfSSL_shutdown(ssl_s), 1);
9445794462

94463+
#ifdef HAVE_SECURE_RENEGOTIATION
9445894464
loop_exit:
94465+
#endif
9445994466
wolfSSL_SetLoggingPrefix(NULL);
9446094467
wolfSSL_free(ssl_c);
9446194468
wolfSSL_CTX_free(ctx_c);

0 commit comments

Comments
 (0)