[Help-gnutls] BIO_s_mem Replacement in GnuTLS

Sam Varshavchik mrsam at courier-mta.com
Sat May 16 01:43:54 CEST 2009


Carolin Latze writes:

>  BIO_s_mem() return the memory BIO method function.
> 
>        A memory BIO is a source/sink BIO which uses memory for its I/O. 
> Data written to a memory BIO is stored in a BUF_MEM
>        structure which is extended as appropriate to accommodate the 
> stored data.
> 
> Is there anything like that in GnuTLS? Or should I rewrite it to use 
> normal fds? (Or did I just misunderstand something? ;-))

gnutls_transport_set_pull_function() and 
gnutls_transport_set_push_function() install a "pull" and a "push" function 
for a gnutls_session_t. Basically you'd instantiate a gnutls_session_t, and 
attach a pull and a push function that reads and writes from a memory 
buffer.

It's a little bit more work, but it's a far more generic abstraction that 
can be used to encapsulate any kind of a source/sink encryption channel.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: </pipermail/attachments/20090515/8c851558/attachment.pgp>


More information about the Gnutls-help mailing list