Fix type mismatch and harness bug

pull/908/head
Andrew Hutchings 2026-04-08 13:56:09 +01:00
parent a6861d993a
commit 0c5d8d31ae
2 changed files with 7 additions and 3 deletions

View File

@ -6032,7 +6032,8 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
WMEMCMP(sig + begin, expectedSigName, scratch) != 0) {
WLOG(WS_LOG_DEBUG,
"signature name %.*s did not match negotiated %s",
(int)scratch, sig + begin, expectedSigName);
(int)scratch, (const char*)(sig + begin),
expectedSigName);
ret = WS_PARSE_E;
}
}

View File

@ -323,6 +323,8 @@ static void FreeChannelOpenHarness(ChannelOpenHarness* harness)
#define REGRESS_USERNAME "jill"
#define REGRESS_PASSWORD "upthehill"
#define REGRESS_MAX_HANDSHAKE_STEPS 2048
#define REGRESS_SSH_PROTO_PREFIX "SSH-"
#define REGRESS_SSH_PROTO_PREFIX_SZ 4U
typedef struct {
byte data[REGRESS_DUPLEX_QUEUE_SZ];
@ -677,8 +679,9 @@ static int DuplexSend(WOLFSSH* ssh, void* buf, word32 sz, void* ctx)
endpoint->mutator->enabled &&
endpoint->mutator->mutatedPackets == 0 &&
outputSz >= UINT32_SZ + PAD_LENGTH_SZ + MSG_ID_SZ &&
!(outputSz >= SSH_PROTO_SZ &&
WMEMCMP(output, "SSH-", SSH_PROTO_SZ) == 0)) {
!(outputSz >= REGRESS_SSH_PROTO_PREFIX_SZ &&
WMEMCMP(output, REGRESS_SSH_PROTO_PREFIX,
REGRESS_SSH_PROTO_PREFIX_SZ) == 0)) {
word32 mutatedSz = 0;
int mutateRet;