mirror of
https://github.com/openssl/openssl.git
synced 2024-12-22 16:33:51 +08:00
Define `ok' and better error detection.
This commit is contained in:
parent
429e4f0de8
commit
0a647c2b8b
@ -98,13 +98,19 @@ int des_read_pw_string(char *buf,int length,const char *prompt,int verify)
|
|||||||
|
|
||||||
int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify)
|
int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify)
|
||||||
{
|
{
|
||||||
|
int ok = 0;
|
||||||
UI *ui;
|
UI *ui;
|
||||||
|
|
||||||
ui = UI_new();
|
ui = UI_new();
|
||||||
UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1);
|
if (ui)
|
||||||
if (verify)
|
{
|
||||||
UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1,buf);
|
ok = UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1);
|
||||||
ok=UI_process(ui);
|
if (ok == 0 && verify)
|
||||||
UI_free(ui);
|
ok = UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1,
|
||||||
|
buf);
|
||||||
|
if (ok == 0)
|
||||||
|
ok=UI_process(ui);
|
||||||
|
UI_free(ui);
|
||||||
|
}
|
||||||
return(ok);
|
return(ok);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user