Skip to content

Commit 0c5d8d3

Browse files
committed
Fix type mismatch and harness bug
1 parent a6861d9 commit 0c5d8d3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/internal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6032,7 +6032,8 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
60326032
WMEMCMP(sig + begin, expectedSigName, scratch) != 0) {
60336033
WLOG(WS_LOG_DEBUG,
60346034
"signature name %.*s did not match negotiated %s",
6035-
(int)scratch, sig + begin, expectedSigName);
6035+
(int)scratch, (const char*)(sig + begin),
6036+
expectedSigName);
60366037
ret = WS_PARSE_E;
60376038
}
60386039
}

tests/regress.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ static void FreeChannelOpenHarness(ChannelOpenHarness* harness)
323323
#define REGRESS_USERNAME "jill"
324324
#define REGRESS_PASSWORD "upthehill"
325325
#define REGRESS_MAX_HANDSHAKE_STEPS 2048
326+
#define REGRESS_SSH_PROTO_PREFIX "SSH-"
327+
#define REGRESS_SSH_PROTO_PREFIX_SZ 4U
326328

327329
typedef struct {
328330
byte data[REGRESS_DUPLEX_QUEUE_SZ];
@@ -677,8 +679,9 @@ static int DuplexSend(WOLFSSH* ssh, void* buf, word32 sz, void* ctx)
677679
endpoint->mutator->enabled &&
678680
endpoint->mutator->mutatedPackets == 0 &&
679681
outputSz >= UINT32_SZ + PAD_LENGTH_SZ + MSG_ID_SZ &&
680-
!(outputSz >= SSH_PROTO_SZ &&
681-
WMEMCMP(output, "SSH-", SSH_PROTO_SZ) == 0)) {
682+
!(outputSz >= REGRESS_SSH_PROTO_PREFIX_SZ &&
683+
WMEMCMP(output, REGRESS_SSH_PROTO_PREFIX,
684+
REGRESS_SSH_PROTO_PREFIX_SZ) == 0)) {
682685
word32 mutatedSz = 0;
683686
int mutateRet;
684687

0 commit comments

Comments
 (0)