aboutsummaryrefslogtreecommitdiff
path: root/lib/hcrypto/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hcrypto/ui.c')
-rw-r--r--lib/hcrypto/ui.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/hcrypto/ui.c b/lib/hcrypto/ui.c
index 40f47a21d0e7..0eb09e78066a 100644
--- a/lib/hcrypto/ui.c
+++ b/lib/hcrypto/ui.c
@@ -194,7 +194,7 @@ UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify)
if (ret)
return ret;
- if (verify) {
+ if (verify & UI_UTIL_FLAG_VERIFY) {
char *buf2;
buf2 = malloc(length);
if (buf2 == NULL)
@@ -205,8 +205,13 @@ UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify)
free(buf2);
return ret;
}
- if (strcmp(buf2, buf) != 0)
+ if (strcmp(buf2, buf) != 0) {
+ if (!(verify & UI_UTIL_FLAG_VERIFY_SILENT)) {
+ fprintf(stderr, "Verify failure\n");
+ fflush(stderr);
+ }
ret = 1;
+ }
free(buf2);
}
return ret;