diff options
Diffstat (limited to 'src/lib/libcrypto/ui/ui_util.c')
-rw-r--r-- | src/lib/libcrypto/ui/ui_util.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ui/ui_util.c b/src/lib/libcrypto/ui/ui_util.c index af50451403..81c5a079a6 100644 --- a/src/lib/libcrypto/ui/ui_util.c +++ b/src/lib/libcrypto/ui/ui_util.c | |||
@@ -56,18 +56,19 @@ | |||
56 | #include <string.h> | 56 | #include <string.h> |
57 | #include "ui_locl.h" | 57 | #include "ui_locl.h" |
58 | 58 | ||
59 | int | 59 | int |
60 | UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify) | 60 | UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify) |
61 | { | 61 | { |
62 | char buff[BUFSIZ]; | 62 | char buff[BUFSIZ]; |
63 | int ret; | 63 | int ret; |
64 | 64 | ||
65 | ret = UI_UTIL_read_pw(buf, buff, (length > BUFSIZ) ? BUFSIZ : length, prompt, verify); | 65 | ret = UI_UTIL_read_pw(buf, buff, (length > BUFSIZ) ? BUFSIZ : length, |
66 | prompt, verify); | ||
66 | OPENSSL_cleanse(buff, BUFSIZ); | 67 | OPENSSL_cleanse(buff, BUFSIZ); |
67 | return (ret); | 68 | return (ret); |
68 | } | 69 | } |
69 | 70 | ||
70 | int | 71 | int |
71 | UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify) | 72 | UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify) |
72 | { | 73 | { |
73 | int ok = 0; | 74 | int ok = 0; |
@@ -80,8 +81,8 @@ UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify) | |||
80 | if (ui) { | 81 | if (ui) { |
81 | ok = UI_add_input_string(ui, prompt, 0, buf, 0, size - 1); | 82 | ok = UI_add_input_string(ui, prompt, 0, buf, 0, size - 1); |
82 | if (ok >= 0 && verify) | 83 | if (ok >= 0 && verify) |
83 | ok = UI_add_verify_string(ui, prompt, 0, buff, 0, size - 1, | 84 | ok = UI_add_verify_string(ui, prompt, 0, buff, 0, |
84 | buf); | 85 | size - 1, buf); |
85 | if (ok >= 0) | 86 | if (ok >= 0) |
86 | ok = UI_process(ui); | 87 | ok = UI_process(ui); |
87 | UI_free(ui); | 88 | UI_free(ui); |