forked from wolfSSL/wolfssl
[RIOT-OS/GNRC] Renamed GNRC callback functions
This commit is contained in:
@@ -1707,8 +1707,8 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap)
|
|||||||
ctx->CBIORecv = Mynewt_Receive;
|
ctx->CBIORecv = Mynewt_Receive;
|
||||||
ctx->CBIOSend = Mynewt_Send;
|
ctx->CBIOSend = Mynewt_Send;
|
||||||
#elif defined(WOLFSSL_GNRC)
|
#elif defined(WOLFSSL_GNRC)
|
||||||
ctx->CBIORecv = GNRC_Receive;
|
ctx->CBIORecv = GNRC_ReceiveFrom;
|
||||||
ctx->CBIOSend = GNRC_Send;
|
ctx->CBIOSend = GNRC_SendTo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NTRU
|
#ifdef HAVE_NTRU
|
||||||
|
@@ -2241,11 +2241,13 @@ int uIPGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *_ctx)
|
|||||||
* return : bytes sent, or error
|
* return : bytes sent, or error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int GNRC_Send(WOLFSSL* ssl, char* buf, int sz, void* _ctx)
|
int GNRC_SendTo(WOLFSSL* ssl, char* buf, int sz, void* _ctx)
|
||||||
{
|
{
|
||||||
sock_tls_t *ctx = (sock_tls_t *)_ctx;
|
sock_tls_t *ctx = (sock_tls_t *)_ctx;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
(void)ssl;
|
(void)ssl;
|
||||||
|
if (!ctx)
|
||||||
|
return WOLFSSL_CBIO_ERR_GENERAL;
|
||||||
ret = sock_udp_send(&ctx->conn.udp, (unsigned char *)buf, sz, &ctx->peer_addr);
|
ret = sock_udp_send(&ctx->conn.udp, (unsigned char *)buf, sz, &ctx->peer_addr);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return WOLFSSL_CBIO_ERR_WANT_WRITE;
|
return WOLFSSL_CBIO_ERR_WANT_WRITE;
|
||||||
@@ -2255,7 +2257,7 @@ int GNRC_Send(WOLFSSL* ssl, char* buf, int sz, void* _ctx)
|
|||||||
/* The GNRC TCP/IP receive callback
|
/* The GNRC TCP/IP receive callback
|
||||||
* return : nb bytes read, or error
|
* return : nb bytes read, or error
|
||||||
*/
|
*/
|
||||||
int GNRC_Receive(WOLFSSL *ssl, char *buf, int sz, void *_ctx)
|
int GNRC_ReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *_ctx)
|
||||||
{
|
{
|
||||||
sock_udp_ep_t ep;
|
sock_udp_ep_t ep;
|
||||||
int ret;
|
int ret;
|
||||||
|
@@ -516,9 +516,9 @@ WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags);
|
|||||||
|
|
||||||
typedef struct gnrc_wolfssl_ctx sock_tls_t;
|
typedef struct gnrc_wolfssl_ctx sock_tls_t;
|
||||||
|
|
||||||
WOLFSSL_LOCAL int GNRC_Receive(WOLFSSL* ssl, char* buf, int sz,
|
WOLFSSL_LOCAL int GNRC_ReceiveFrom(WOLFSSL* ssl, char* buf, int sz,
|
||||||
void* ctx);
|
void* ctx);
|
||||||
WOLFSSL_LOCAL int GNRC_Send(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
WOLFSSL_LOCAL int GNRC_SendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user