Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -10094,6 +10094,8 @@ int TLSX_KeyShare_Parse(WOLFSSL* ssl, const byte* input, word16 length,
if (length < OPAQUE16_LEN)
return BUFFER_ERROR;

ssl->options.shSentKeyShare = 1;

/* The data is the named group the server wants to use. */
ato16(input, &group);

Expand Down
3 changes: 2 additions & 1 deletion src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -5559,7 +5559,8 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
#if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
ssl->options.pskNegotiated == 0 &&
#endif
ssl->session->namedGroup == 0) {
(ssl->session->namedGroup == 0 ||
ssl->options.shSentKeyShare == 0)) {
return EXT_MISSING;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -28906,7 +28906,7 @@ static int test_TLSX_CA_NAMES_bad_extension(void)

ExpectIntEQ(wolfSSL_connect(ssl_c), -1);
#ifndef WOLFSSL_DISABLE_EARLY_SANITY_CHECKS
ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WC_NO_ERR_TRACE(OUT_OF_ORDER_E));
ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WC_NO_ERR_TRACE(EXT_MISSING));
#else
ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WC_NO_ERR_TRACE(BUFFER_ERROR));
#endif
Expand Down
1 change: 1 addition & 0 deletions wolfssl/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5107,6 +5107,7 @@ struct Options {
word16 hrrSentCookie:1; /* HRR sent with cookie */
#endif
word16 hrrSentKeyShare:1; /* HRR sent with key share */
word16 shSentKeyShare:1; /* SH sent with key share */
#endif
word16 returnOnGoodCh:1;
word16 disableRead:1;
Expand Down