Skip to content

Commit de04d8a

Browse files
Make trusted_ca_keys check opt-in. It is not required according to the RFC.
1 parent 6d299ea commit de04d8a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/tls.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,15 +2971,19 @@ 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 to trusted_ca_keys
2975+
is optional. Do not error out unless opted into with the define WOLFSSL_REQUIRE_TCA. */
2976+
#if !defined(NO_WOLFSSL_CLIENT) && defined(WOLFSSL_REQUIRE_TCA)
29752977
TLSX* extension = TLSX_Find(ssl->extensions, TLSX_TRUSTED_CA_KEYS);
29762978

29772979
if (extension && !extension->resp) {
29782980
SendAlert(ssl, alert_fatal, handshake_failure);
29792981
WOLFSSL_ERROR_VERBOSE(TCA_ABSENT_ERROR);
29802982
return TCA_ABSENT_ERROR;
29812983
}
2982-
#endif /* NO_WOLFSSL_CLIENT */
2984+
#else
2985+
WOLFSSL_MSG("No response received for trusted_ca_keys. Continuing.");
2986+
#endif /* !NO_WOLFSSL_CLIENT && WOLFSSL_REQUIRE_TCA */
29832987
}
29842988

29852989
return 0;

0 commit comments

Comments
 (0)