diff options
author | 2014-08-06 04:28:21 +0000 | |
---|---|---|
committer | 2014-08-06 04:28:21 +0000 | |
commit | b60d353a6574f98e3f5a376ed21afd96d064e654 (patch) | |
tree | 61145d70aa4321f07f2b43c3d1cefd181a809da0 /lib | |
parent | Add signify instructions plus miniroot and install56.fs for amd64/i386 (diff) | |
download | wireguard-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')
-rw-r--r-- | lib/libcrypto/evp/evp_key.c | 6 | ||||
-rw-r--r-- | lib/libssl/src/crypto/evp/evp_key.c | 6 |
2 files changed, 6 insertions, 6 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); diff --git a/lib/libssl/src/crypto/evp/evp_key.c b/lib/libssl/src/crypto/evp/evp_key.c index 2873a888bd2..1493ca91036 100644 --- a/lib/libssl/src/crypto/evp/evp_key.c +++ b/lib/libssl/src/crypto/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); |