Topic: Understanding wolfSSL library

Hello All:

I'm trying to understand wolfSSL library and after reading user manual where it explains how to change an application to use it, and basically says the application should replace the read() and write() functions with wolfSSL_read() and wolfSSL_write() ; I'm wondering how those new functions are reaching the read() and write() functions that ultimately transmit/receive the data....  I mean, is there any callback that sets in initialization or how does it work?

Thanks
Gus

Share

Re: Understanding wolfSSL library

Hi gussabina,

Thanks for using the wolfSSL forums. You are correct there is a callback set in the WOLFSSL_CTX by default.

ctx->CBIORecv = EmbedReceive;
ctx->CBIOSend = EmbedSend;

You can find the Embed(Receive/Send) implementations in <wolf-root>/src/io.c

These will call wolfIO_Recv or wolfIO_Send which used the defined SEND_FUNCTION or RECEIVE_FUNCTION respectively. The (SEND/RECEIVE)_FUNCTION defines are in <wolf-root>/wolfssl/io.h

Let us know if you have any other questions.


Warm Regards,

Kaleb