Skip to content

Commit 7bd6f5c

Browse files
committed
Add check for KeyShare in ServerHello
1 parent ca5b484 commit 7bd6f5c

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/tls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10094,6 +10094,8 @@ int TLSX_KeyShare_Parse(WOLFSSL* ssl, const byte* input, word16 length,
1009410094
if (length < OPAQUE16_LEN)
1009510095
return BUFFER_ERROR;
1009610096

10097+
ssl->options.shSentKeyShare = 1;
10098+
1009710099
/* The data is the named group the server wants to use. */
1009810100
ato16(input, &group);
1009910101

src/tls13.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5559,7 +5559,8 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
55595559
#if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
55605560
ssl->options.pskNegotiated == 0 &&
55615561
#endif
5562-
ssl->session->namedGroup == 0) {
5562+
(ssl->session->namedGroup == 0 ||
5563+
ssl->options.shSentKeyShare == 0)) {
55635564
return EXT_MISSING;
55645565
}
55655566

wolfssl/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5107,6 +5107,7 @@ struct Options {
51075107
word16 hrrSentCookie:1; /* HRR sent with cookie */
51085108
#endif
51095109
word16 hrrSentKeyShare:1; /* HRR sent with key share */
5110+
word16 shSentKeyShare:1; /* SH sent with key share */
51105111
#endif
51115112
word16 returnOnGoodCh:1;
51125113
word16 disableRead:1;

0 commit comments

Comments
 (0)