diff options
| author | jsing <> | 2014-04-18 05:37:44 +0000 |
|---|---|---|
| committer | jsing <> | 2014-04-18 05:37:44 +0000 |
| commit | f843014abcc7498613638ca7bdc47b3123ea2544 (patch) | |
| tree | fc08a86c3d277a550737fd859bfcfb80547a2c6b /src/lib/libcrypto/ui/ui_util.c | |
| parent | f737947057a1a777dafba073b92264e698047b6c (diff) | |
| download | openbsd-f843014abcc7498613638ca7bdc47b3123ea2544.tar.gz openbsd-f843014abcc7498613638ca7bdc47b3123ea2544.tar.bz2 openbsd-f843014abcc7498613638ca7bdc47b3123ea2544.zip | |
More KNF.
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); |
