At 21:54 08.06.99 +0100, you wrote:
Hallo,

>>From time to time someone needs to pass a parameter to a passphrase
>callback. For example the prompt for the password can be set to a
>meaningful phrase or the passphrase itself could be set by this method.

>Currently this isn't directly possible and the only solutions are messy.

>2. Add a set of extra functions:
>
>EVP_PKEY *PEM_read_PrivateKey_ex(FILE *fp,EVP_PKEY **x,
>                                pem_password_cb_ex *, void *arg);
>int pem_password_cb_ex(char *buf, int size, int rwflag, void *arg);
>
>This might be considered overkill, would double the number of PEM
>functions needed and have lots of PEM 'legacy' functions using the old
>method that would have to stay. It would however retain compatability
>with existing code.

We could do domething like

#define PEM_read_PrivateKey(fp,pkeyp,callback)\
PEM_read_PrivateKey_ex(fp,pkeyp,callback,NULL)

Would be no overkill, cause we still have only one set of functions

I would prefer that...
(I myself planned to do something like that...)

>3. Do something evil with the cb parameter...
>
>EVP_PKEY *PEM_read_PrivateKey(FILE *fp,EVP_PKEY **x, void *x);#
[...}
>This needs a bit more explanation. Any function calling
>PEM_read_PrivateKey() in the "old way" will end up calling the
>default_pem_callback() which retains the old behaviour: treating 'x' as
>a passphrase callback in the "old way". Anything that wants to pass
>parameters to the callback can replace the default_pem_callback() and
>interpret the 'x' parameter in any appropriate way.
>
>This does however lose typechecking of the 'x' parameter and is a bit
>awkward to use. Interpreting a void * as a function pointer might also
>be a potential problem.

No please !

By

Goetz

-- 
Goetz Babin-Ebell                      mailto:[EMAIL PROTECTED]
TC Trust Center for Security           http://www.trustcenter.de
in Data Networks GmbH                  Tel.: +49-40-766 29 3301
Am Werder 1 / 21073 Hamburg / Germany  Fax.: +49-40-766 29 577
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to