hcrypto: print failure on password mismatch (#469)

UI_UTIL_read_pw_string(), an interface borrowed from OpenSSL, should report
password verification failure to stderr.
This commit is contained in:
Luke Howard
2018-12-27 17:32:14 +11:00
parent 410d96f480
commit 65ed504d21

View File

@@ -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;