summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-08-06 04:28:21 +0000
committerguenther <guenther@openbsd.org>2014-08-06 04:28:21 +0000
commitb60d353a6574f98e3f5a376ed21afd96d064e654 (patch)
tree61145d70aa4321f07f2b43c3d1cefd181a809da0 /lib/libcrypto
parentAdd signify instructions plus miniroot and install56.fs for amd64/i386 (diff)
downloadwireguard-openbsd-b60d353a6574f98e3f5a376ed21afd96d064e654.tar.xz
wireguard-openbsd-b60d353a6574f98e3f5a376ed21afd96d064e654.zip
Correct error checks in EVP_read_pw_string_min(): UI_add_input_string()
and UI_add_verify_string() return -1 (and maybe -2?) on failure and >=0 on success, instead of always zero on success problem reported by Mark Patruck (mark (at) wrapped.cx) ok miod@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/evp/evp_key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/evp/evp_key.c b/lib/libcrypto/evp/evp_key.c
index 2873a888bd2..1493ca91036 100644
--- a/lib/libcrypto/evp/evp_key.c
+++ b/lib/libcrypto/evp/evp_key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: evp_key.c,v 1.19 2014/07/23 04:44:56 miod Exp $ */
+/* $OpenBSD: evp_key.c,v 1.20 2014/08/06 04:28:21 guenther Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -106,11 +106,11 @@ EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt,
if (ui == NULL)
return -1;
if (UI_add_input_string(ui, prompt, 0, buf, min,
- (len >= BUFSIZ) ? BUFSIZ - 1 : len) != 0)
+ (len >= BUFSIZ) ? BUFSIZ - 1 : len) < 0)
return -1;
if (verify) {
if (UI_add_verify_string(ui, prompt, 0, buff, min,
- (len >= BUFSIZ) ? BUFSIZ - 1 : len, buf) != 0)
+ (len >= BUFSIZ) ? BUFSIZ - 1 : len, buf) < 0)
return -1;
}
ret = UI_process(ui);