diff --git a/src/dtls.c b/src/dtls.c index 9196cea08..381372032 100644 --- a/src/dtls.c +++ b/src/dtls.c @@ -671,8 +671,8 @@ static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch, goto dtls13_cleanup; /* Push the cookie to extensions */ - ret = CreateCookieExt(ssl, cookieHash, cookieHashSz, &parsedExts, - cs.cipherSuite0, cs.cipherSuite); + ret = CreateCookieExt(ssl, cookieHash, (word16)cookieHashSz, + &parsedExts, cs.cipherSuite0, cs.cipherSuite); if (ret != 0) goto dtls13_cleanup; diff --git a/src/tls13.c b/src/tls13.c index d08951a82..96e6137b9 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -3350,7 +3350,7 @@ int CreateCookieExt(const WOLFSSL* ssl, byte* hash, word16 hashSz, word16 cookieSz = 0; /* Cookie Data = Hash Len | Hash | CS | KeyShare Group */ - cookie[cookieSz++] = hashSz; + cookie[cookieSz++] = (byte)hashSz; XMEMCPY(cookie + cookieSz, hash, hashSz); cookieSz += hashSz; cookie[cookieSz++] = cipherSuite0;