Hello folks, Is there a easy way to convert a passphrase callback to a UI ?
meaning:
I have a pem_password_callback (and a pointer to additional data)
But the function wants an UI (ENGINE_load_privatekey())...
BTW:
there seems to be a bug in crypto/ui/ui_util.c:
(0.9.7 stable SNAP 2002070)
Index: crypto/ui/ui_util.c
===================================================================
RCS file: /usr/cvsroot/openssl/crypto/ui/ui_util.c,v
retrieving revision 1.1
diff -u -r1.1 ui_util.c
--- crypto/ui/ui_util.c 2002/05/29 16:29:57 1.1
+++ crypto/ui/ui_util.c 2002/07/10 16:54:18
@@ -70,13 +70,14 @@
{
int ok = 0;
UI *ui;
-
+ if (size < 1)
+ return -1;
ui = UI_new();
if (ui)
{
- ok = UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1);
+ ok = UI_add_input_string(ui,prompt,0,buf,0,size-1);
if (ok == 0 && verify)
- ok = UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1,
+ ok = UI_add_verify_string(ui,prompt,0,buff,0,size-1,
buf);
if (ok == 0)
ok=UI_process(ui);
The UI_add_{input|verify}_string get as buffer length BUFFSIZ-1.
But I think they must get the param size...
Bye
Goetz
--
Goetz Babin-Ebell, TC TrustCenter AG, 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
smime.p7s
Description: S/MIME Cryptographic Signature
