Roger Bodén wrote:
>
> I have registered a certificate validation function in my SSL_CTX struct
> using SSL_CTX_set_verify method. The callback function takes an int and
> an X509_STORE_CTX as input. Somehow I would like to pass some
> application data to this function. The ex_data field of X509_STORE_CTX
> seems to be place to put it, but how do I put it?
>
This is a bit tricky. You basically create a new ID and pass various
function pointers that can create, free and dup it when the parent
structure is cleaned up.
You can then use this ID to pass and retrieve the information.
This is one area where there are still (char *) stuff from the non ANSI
days and no function pointer prototypes.
There is an example in ssl/ssl_cert.c which uses the X509_STORE_CTX
structure to store a pointer to the parent SSL structure. This example
has no new/free/dup function pointers.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]