From aa5d074d239c75a16c7586153cd30c4eaecec731 Mon Sep 17 00:00:00 2001 From: Marco Oliverio Date: Wed, 28 Sep 2022 18:36:35 +0200 Subject: [PATCH] dtls13: abide g++ compiler errors ``` src/tls13.c:5330:72: error: invalid conversion from 'void*' to 'const byte*' {aka 'const unsigned char*'} [-fpermissive] 5330 | ret = wc_HmacUpdate(&cookieHmac, ssl->buffers.dtlsCtx.peer.sa, | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | void* ./wolfssl/wolfcrypt/hmac.h:191:55: note: initializing argument 2 of 'int wc_HmacUpdate(Hmac*, const byte*, word32)' 191 | WOLFSSL_API int wc_HmacUpdate(Hmac* hmac, const byte* in, word32 sz); ``` --- src/tls13.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tls13.c b/src/tls13.c index 3c1bdd780..405760a87 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -3156,8 +3156,9 @@ static int CreateCookie(WOLFSSL* ssl, byte* hash, byte hashSz) /* Tie cookie to peer address */ if (ret == 0) { if (ssl->options.dtls && ssl->buffers.dtlsCtx.peer.sz > 0) { - ret = wc_HmacUpdate(&cookieHmac, ssl->buffers.dtlsCtx.peer.sa, - ssl->buffers.dtlsCtx.peer.sz); + ret = wc_HmacUpdate(&cookieHmac, + (byte*)ssl->buffers.dtlsCtx.peer.sa, + ssl->buffers.dtlsCtx.peer.sz); } } #endif @@ -5327,8 +5328,9 @@ static int CheckCookie(WOLFSSL* ssl, byte* cookie, byte cookieSz) /* Tie cookie to peer address */ if (ret == 0) { if (ssl->options.dtls && ssl->buffers.dtlsCtx.peer.sz > 0) { - ret = wc_HmacUpdate(&cookieHmac, ssl->buffers.dtlsCtx.peer.sa, - ssl->buffers.dtlsCtx.peer.sz); + ret = wc_HmacUpdate(&cookieHmac, + (byte*)ssl->buffers.dtlsCtx.peer.sa, + ssl->buffers.dtlsCtx.peer.sz); } } #endif