From 65ed504d212490356f9670fff87a08a959b50e64 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Thu, 27 Dec 2018 17:32:14 +1100 Subject: [PATCH] hcrypto: print failure on password mismatch (#469) UI_UTIL_read_pw_string(), an interface borrowed from OpenSSL, should report password verification failure to stderr. --- lib/hcrypto/ui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/hcrypto/ui.c b/lib/hcrypto/ui.c index 40f47a21d..ff0f7ec21 100644 --- a/lib/hcrypto/ui.c +++ b/lib/hcrypto/ui.c @@ -205,8 +205,11 @@ 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) { + fprintf(stderr, "Verify failure\n"); + fflush(stderr); ret = 1; + } free(buf2); } return ret;