diff options
author | Richard Levitte <levitte@openssl.org> | 2001-05-13 05:34:39 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-05-13 05:34:39 +0000 |
commit | 0a647c2b8b52479867c15584d6e72cbbfcc4459d (patch) | |
tree | 9d0fe3fa95ac3a87389033aedde2b0a324f0aa19 /crypto/ui | |
parent | 429e4f0de8c4c6b74c9d9edc0b271d3d6c54008f (diff) | |
download | openssl-0a647c2b8b52479867c15584d6e72cbbfcc4459d.tar.gz |
Define `ok' and better error detection.
Diffstat (limited to 'crypto/ui')
-rw-r--r-- | crypto/ui/ui_compat.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/crypto/ui/ui_compat.c b/crypto/ui/ui_compat.c index fd8e004c10..6938d72d49 100644 --- a/crypto/ui/ui_compat.c +++ b/crypto/ui/ui_compat.c @@ -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 ok = 0; UI *ui; ui = UI_new(); - UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1); - if (verify) - UI_add_verify_string(ui,prompt,0,buff,0,BUFSIZ-1,buf); - ok=UI_process(ui); - UI_free(ui); + if (ui) + { + ok = UI_add_input_string(ui,prompt,0,buf,0,BUFSIZ-1); + if (ok == 0 && verify) + 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); } |