Skip to content

Commit 2010297

Browse files
only send ext info once after SSH_MSG_NEWKEYS
1 parent 8c0c7fd commit 2010297

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/internal.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4080,7 +4080,7 @@ static int DoKexInit(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
40804080
if (ret == WS_SUCCESS) {
40814081
/* Only checking for this is we are server. Our client does
40824082
* not have anything to say to a server, yet. */
4083-
if (side == WOLFSSH_ENDPOINT_SERVER) {
4083+
if (side == WOLFSSH_ENDPOINT_SERVER && !ssh->extInfoSent) {
40844084
byte extInfo;
40854085

40864086
/* Match the client accepts extInfo. */
@@ -13216,6 +13216,10 @@ int SendExtInfo(WOLFSSH* ssh)
1321613216
}
1321713217

1321813218
if (ret == WS_SUCCESS) {
13219+
ssh->sendExtInfo = 0;
13220+
ssh->extInfoSent = 1; /* RFC 8308 section 2.4 ext. info should only be
13221+
* sent after SSH_MSG_NEWKEYS or after
13222+
* SSH_MSG_USERAUTH_SUCCESS. Not on re-key */
1321913223
ret = wolfSSH_SendPacket(ssh);
1322013224
}
1322113225

wolfssh/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ struct WOLFSSH {
844844
byte sendTerminalRequest;
845845
byte userAuthPkDone;
846846
byte sendExtInfo;
847+
byte extInfoSent; /* track if the ext info has already been sent */
847848
byte* peerSigId;
848849
word32 peerSigIdSz;
849850

0 commit comments

Comments
 (0)