Skip to content

Commit 6dd22d2

Browse files
account for wolfSSH always sending carriage return and new line
1 parent 2c60365 commit 6dd22d2

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/internal.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,12 +2235,9 @@ static int DoKexInit(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
22352235
}
22362236

22372237
if (ret == WS_SUCCESS) {
2238-
byte SSH_PROTO_EOL_SZ = 1;
2238+
byte SSH_PROTO_EOL_SZ = 2;
22392239

22402240
strSz = (word32)WSTRLEN(sshProtoIdStr) - SSH_PROTO_EOL_SZ;
2241-
if (strSz > 1 && sshProtoIdStr[strSz - 1] == '\r') {
2242-
strSz--; /* subtract 1 more for CR */
2243-
}
22442241
c32toa(strSz, scratchLen);
22452242
ret = wc_HashUpdate(&ssh->handshake->hash, enmhashId,
22462243
scratchLen, LENGTH_SZ);

0 commit comments

Comments
 (0)