Skip to content

Commit f458930

Browse files
authored
Merge pull request wolfSSL#8653 from kareem-wolfssl/zd19696
Make trusted_ca_keys check opt-in.
2 parents 6bf93c9 + 4808ce1 commit f458930

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.wolfssl_known_macro_extras

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ WOLFSSL_RENESAS_RSIP
781781
WOLFSSL_RENESAS_RZN2L
782782
WOLFSSL_RENESAS_TLS
783783
WOLFSSL_RENESAS_TSIP_IAREWRX
784+
WOLFSSL_REQUIRE_TCA
784785
WOLFSSL_RSA_CHECK_D_ON_DECRYPT
785786
WOLFSSL_RSA_DECRYPT_TO_0_LEN
786787
WOLFSSL_RW_THREADED

src/tls.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,15 +2971,20 @@ static int TLSX_TCA_VerifyParse(WOLFSSL* ssl, byte isRequest)
29712971
(void)ssl;
29722972

29732973
if (!isRequest) {
2974-
#ifndef NO_WOLFSSL_CLIENT
2974+
/* RFC 6066 section 6 states that the server responding
2975+
* to trusted_ca_keys is optional. Do not error out unless
2976+
* opted into with the define WOLFSSL_REQUIRE_TCA. */
2977+
#if !defined(NO_WOLFSSL_CLIENT) && defined(WOLFSSL_REQUIRE_TCA)
29752978
TLSX* extension = TLSX_Find(ssl->extensions, TLSX_TRUSTED_CA_KEYS);
29762979

29772980
if (extension && !extension->resp) {
29782981
SendAlert(ssl, alert_fatal, handshake_failure);
29792982
WOLFSSL_ERROR_VERBOSE(TCA_ABSENT_ERROR);
29802983
return TCA_ABSENT_ERROR;
29812984
}
2982-
#endif /* NO_WOLFSSL_CLIENT */
2985+
#else
2986+
WOLFSSL_MSG("No response received for trusted_ca_keys. Continuing.");
2987+
#endif /* !NO_WOLFSSL_CLIENT && WOLFSSL_REQUIRE_TCA */
29832988
}
29842989

29852990
return 0;

0 commit comments

Comments
 (0)