On Tue, Feb 27, 2007 at 01:49:13AM -0800, Anita Kumar wrote:
> static int password_callback(char *buf, int size, int rwflag, void *userdata)
> {
> printf("*** Callback function called\n");
> strcpy(buf, "ibmdw");
> return 1;
> }
>
> SSL_CTX_set_default_passwd_cb(ctx, &password_callback);
>From the manpage for SSL_CTX_set_default_passwd_cb:
The pem_passwd_cb(), which must be provided by the application, hands
back the password to be used during decryption. On invocation a pointer
to userdata is provided. The pem_passwd_cb must write the password into
the provided buffer buf which is of size size. The actual length of the
password must be returned to the calling function. rwflag indicates
whether the callback is used for reading/decryption (rwflag=0) or writ-
ing/encryption (rwflag=1).
Read the second-last sentence carefully.
--
Viktor.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]