Re: Preferred way of passing user context void* inside SSL*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 23, 2019 at 01:21:54PM +0000, Salz, Rich via openssl-users wrote:

> >    Is there a way for me to piggyback a void* inside the SSL structure so
>     that I can access it from within the callback?
>   
> Yes, you can use SSL_set_app_data and SSL_get_app_data which are documented
> in https://github.com/openssl/openssl/pull/10216 (and due to be merged to
> master soon)

If the data is needed by a *library* and not "the application",
then it is not appropriate to use index 0, which is reserved for
"the application".  In that case, the library needs to register its
own "ex data index".  Examples can be seen at:

1-time init:  https://github.com/vdukhovni/postfix/blob/master/postfix/src/tls/tls_client.c#L353
Setter usage: https://github.com/vdukhovni/postfix/blob/master/postfix/src/tls/tls_client.c#L977
Getter usage: https://github.com/vdukhovni/postfix/blob/master/postfix/src/tls/tls_client.c#L255

-- 
	Viktor.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux