Richard Levitte - VMS Whacker wrote:
Hello Richard,

> From: Dr Stephen Henson <[EMAIL PROTECTED]>
> drh> So, any thoughts on the matter?
Could clear up some stuff...

> Hmm, a general UI function in OpenSSL that takes the following
> parameters:

I don't think that one UI function is a good solution:
There should be more than UI function:

1.      InsertString:   ask the user for a string
1.1     InsertPass:     special case: ask for a passphrase
(1.2    InsertFile:     special case: ask for file name, could be handled with
1.)
2.      Confirm:        ask to confirm some action (eg. accept a certificate in
handshake)
3.      InsertNumber:   ask for a number
4.      Ough:           give a error message
...

>         - a command number (GIVE_PASSWD, HANDLE_CARD, ...)
+1

>         - a prompt string
should be generated in the UI
>         - a "wrong" string (eh, "That was the wrong password", f. example?)
should be handled in the UI (another call ?)
>         - a return buffer (double pointer, so we might allocate it in
>           that function)
>         - a return buffer size (pointer to int, so we might fill it in
>           ourselves)
depending on UI function.
(perhaps give a BUF_MEM ?)
>         - a pointer to user data
A Pointer to function specific data would be better...

contends should depend on 
> This function would then do a default thing or call an application-supplied
> callback that does the right thing.
perhaps a function table that normally points to some internal functions
?

To keep it localizeable we should introduce another function:

const char *UI_GetTextFor(MessageCode,SubCode);

like:

const char *ClientMsg = UI_GetTextFor(TXT_ENTER_PASSWD,TXT_SUB_CLIENT);
(returns "please enter passphrase for client key")
const char *Name      = GetSomehowTheNameForThePrivateKey();
(returns "for internal use")
const char *Prompt    = UI_GetTextFor(TXT_ENTER_PASSWD,TXT_PROMPT);
(returns "passphrase:")

would result:

please enter passphrase for client key <for internal use>:
passphrase:

> In any case, this would probably become a new directory under crypto/,
> don't you think?  crypto/ui/?
1+

> [it should be plain visible that I was a bit inspired from the
> HWCryptoHook stuff :-)]
Perhaps a list of required user interactions could help ?

By...

Goetz

-- 
Goetz Babin-Ebell, TC TrustCenter GmbH, http://www.trustcenter.de
Sonninstr. 24-28, 20097 Hamburg, Germany
Tel.: +49-(0)40 80 80 26 -0,  Fax: +49-(0)40 80 80 26 -126
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to