1 (edited by j3g 2011-01-25 15:58:30)

Topic: cyassl_io.c...and...CYASSL_USER_IO defined

If i'm not mistaken, CYASSL_USER_IO needs to be defined in non-standard environment. Will you please elaborate what I need to implement when defining this flag?

Share

Re: cyassl_io.c...and...CYASSL_USER_IO defined

Basically two functions:

1) Your Network Send function.
2) Your Network Receive function.

They are prototyped by CallbackIOSend and CallbackIORecv in ssl.h.  You then have to register these functions per SSL_CTX with CyaSSL_SetIOSend() and CyaSSL_SetIORecv().  It's probably easiest to put your functions at the bottom of cyassl_io.c.

Each SSL object can then register the actual context per session with CyaSSL_SetIOWriteCtx() and CyaSSL_SetIOReadCtx().  The default case, no user overrides, registers the socket as the context. 

You can use the default Send() and Receive() functions, EmbedSend() and EmbedRecv(), as templates when writing your own.  Look at the enum IOErrors for the error cases that may need to be returned, return IO_ERR_GENERAL when in doubt.

Share

Re: cyassl_io.c...and...CYASSL_USER_IO defined

i'm finally back to this portion of your embedded SSL code (network stack calls). I thought you should know that the flag "CYASSL_USER_IO" isn't mentioned anywhere on the site or in documentation. I had stumbled on it in the code...there maybe more questions coming

Share

Re: cyassl_io.c...and...CYASSL_USER_IO defined

Ok, thanks for letting us know.  We'll add that to our documentation.

- Chris