mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
Fix some small things compiling with a different compiler, and some
other options. 1. Missing prototype for the Mcast receive I/O callback. 2. When disabling SHA-1, the old DTLS cookie callback wouldn't work. Allow for SHA-256.
This commit is contained in:
8
src/io.c
8
src/io.c
@@ -417,7 +417,7 @@ int EmbedGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *ctx)
|
|||||||
int sd = ssl->wfd;
|
int sd = ssl->wfd;
|
||||||
SOCKADDR_S peer;
|
SOCKADDR_S peer;
|
||||||
XSOCKLENT peerSz = sizeof(peer);
|
XSOCKLENT peerSz = sizeof(peer);
|
||||||
byte digest[SHA_DIGEST_SIZE];
|
byte digest[SHA256_DIGEST_SIZE];
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
@@ -428,12 +428,12 @@ int EmbedGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *ctx)
|
|||||||
return GEN_COOKIE_E;
|
return GEN_COOKIE_E;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wc_ShaHash((byte*)&peer, peerSz, digest);
|
ret = wc_Sha256Hash((byte*)&peer, peerSz, digest);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (sz > SHA_DIGEST_SIZE)
|
if (sz > SHA256_DIGEST_SIZE)
|
||||||
sz = SHA_DIGEST_SIZE;
|
sz = SHA256_DIGEST_SIZE;
|
||||||
XMEMCPY(buf, digest, sz);
|
XMEMCPY(buf, digest, sz);
|
||||||
|
|
||||||
return sz;
|
return sz;
|
||||||
|
@@ -298,6 +298,10 @@ WOLFSSL_API int wolfIO_Recv(SOCKET_T sd, char *buf, int sz, int rdFlags);
|
|||||||
WOLFSSL_API int EmbedSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
WOLFSSL_API int EmbedSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||||
WOLFSSL_API int EmbedGenerateCookie(WOLFSSL* ssl, unsigned char* buf,
|
WOLFSSL_API int EmbedGenerateCookie(WOLFSSL* ssl, unsigned char* buf,
|
||||||
int sz, void*);
|
int sz, void*);
|
||||||
|
#ifdef WOLFSSL_MULTICAST
|
||||||
|
WOLFSSL_API int EmbedReceiveFromMcast(WOLFSSL* ssl,
|
||||||
|
char* buf, int sz, void*);
|
||||||
|
#endif /* WOLFSSL_MULTICAST */
|
||||||
#ifdef WOLFSSL_SESSION_EXPORT
|
#ifdef WOLFSSL_SESSION_EXPORT
|
||||||
WOLFSSL_API int EmbedGetPeer(WOLFSSL* ssl, char* ip, int* ipSz,
|
WOLFSSL_API int EmbedGetPeer(WOLFSSL* ssl, char* ip, int* ipSz,
|
||||||
unsigned short* port, int* fam);
|
unsigned short* port, int* fam);
|
||||||
|
Reference in New Issue
Block a user