Add user-defined argument in TLS 1.3 External PSK callback

Matt Caswell matt at openssl.org
Thu Apr 16 08:34:54 UTC 2020



On 16/04/2020 00:12, brandon.murphy1996 via openssl-users wrote:
> Currently, the psk_use_session_cb_func() contains a hardcoded PSK and
> identity value. However, I want to send an extra argument (preferably
> a custom struct) to this callback that will contain the pre-shared
> key and identity (ideally read from a config file). Is there any way
> this can be achieved?

You could store "ex_data" on the SSL object using SSL_set_ex_data():

https://www.openssl.org/docs/man1.1.1/man3/SSL_set_ex_data.html


Matt


More information about the openssl-users mailing list