From 3f330a2b21f8093f9a54d3295531282f0f7c875c Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 10 Jan 2017 14:57:28 -0800 Subject: [PATCH] Multicast 1. Move the function `wolfSSL_mcast_read()` to follow `wolfSSL_read_internal()`. 2. Implemented `wolfSSL_mcast_read()`. --- src/ssl.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index a304a6f60..95a5553da 100755 --- a/src/ssl.c +++ b/src/ssl.c @@ -935,22 +935,6 @@ int wolfSSL_set_secret(WOLFSSL* ssl, unsigned short epoch, return ret; } - -int wolfSSL_mcast_read(WOLFSSL* ssl, unsigned char* id, void* data, int sz) -{ - int ret = 0; - - (void)ssl; - (void)data; - (void)sz; - - WOLFSSL_ENTER("wolfSSL_mcast_read()"); - if (ssl->options.dtls && id != NULL) - *id = 0; - WOLFSSL_LEAVE("wolfSSL_mcast_read()", ret); - return ret; -} - #endif /* WOLFSSL_MULTICAST */ @@ -1563,6 +1547,22 @@ int wolfSSL_read(WOLFSSL* ssl, void* data, int sz) } +#ifdef WOLFSSL_MULTICAST + +int wolfSSL_mcast_read(WOLFSSL* ssl, unsigned char* id, void* data, int sz) +{ + int ret = 0; + + WOLFSSL_ENTER("wolfSSL_mcast_read()"); + + ret = wolfSSL_read_internal(ssl, data, sz, FALSE); + if (ssl->options.dtls && ssl->options.haveMcast && id != NULL) + *id = ssl->keys.curPeerId; + return ret; +} + +#endif /* WOLFSSL_MULTICAST */ + #ifdef WOLFSSL_ASYNC_CRYPT /* let's use async hardware, SSL_SUCCESS on ok */