Re: Query related to SSL_CTX_set_msg_callback_arg

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

 



On 10/06/2019 11:05, Jeremy Harris wrote:
On 10/06/2019 09:32, Viktor Dukhovni wrote:
On Mon, Jun 10, 2019 at 07:16:26AM +0000, shalu dhamija via openssl-users wrote:

Actually while setting the callback, we can not pass the user-defined/application data.
You can however attach it to the SSL connection handle as "ex_data":
I fail to see the point.  You don't need to pass the data, only a
pointer to the data.

Well ... obviously ...

Any time you set the callback, you can set the callback-arg.

How? As Shalu quoted, the prototype of the call to set the callback is

void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx,
                              int (*new_session_cb)(SSL *, SSL_SESSION *));

How do we specify a user-defined callback data pointer in that call?

When the callback is called it is given the arg;

Where? According to the prototype which Shalu quoted the callback gets just a pointer to an SSL and a pointer to an SSL_SESSION; neither of those is a user-defined data pointer.

if the arg was a pointer you can deref to get the data... which could
have been manipulated as needed in the interim.

Using the ex_data facility is not needed.

I may be missing something, but I can't see any other way to do it.
-- 
J. J. Farrell
Not speaking for Oracle

[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