Skip to content

Commit 447024f

Browse files
authored
Merge pull request #819 from JacobBarthelmeh/ext_info
only send ext info once after SSH_MSG_NEWKEYS
2 parents 69b2fee + 2010297 commit 447024f

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. */
@@ -13219,6 +13219,10 @@ int SendExtInfo(WOLFSSH* ssh)
1321913219
}
1322013220

1322113221
if (ret == WS_SUCCESS) {
13222+
ssh->sendExtInfo = 0;
13223+
ssh->extInfoSent = 1; /* RFC 8308 section 2.4 ext. info should only be
13224+
* sent after SSH_MSG_NEWKEYS or after
13225+
* SSH_MSG_USERAUTH_SUCCESS. Not on re-key */
1322213226
ret = wolfSSH_SendPacket(ssh);
1322313227
}
1322413228

wolfssh/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ struct WOLFSSH {
841841
byte sendTerminalRequest;
842842
byte userAuthPkDone;
843843
byte sendExtInfo;
844+
byte extInfoSent; /* track if the ext info has already been sent */
844845
byte* peerSigId;
845846
word32 peerSigIdSz;
846847

0 commit comments

Comments
 (0)