summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-11-21 12:32:39 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-11-21 12:32:39 +0000
commit6cc065d274e99955bd4e95a86a84c8d8e78faaed (patch)
treedca248a9a687e07741f57273d2c36d262a589a3b
parent43d98b39f9b21ca5476b5d2b64c06463348a3915 (diff)
Let crypt_checkpass() set EACCES after bcrypt_checkpass() failure;
ok tedu@
-rw-r--r--lib/libc/crypt/cryptutil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/crypt/cryptutil.c b/lib/libc/crypt/cryptutil.c
index f9045ed601d..cadc67af81f 100644
--- a/lib/libc/crypt/cryptutil.c
+++ b/lib/libc/crypt/cryptutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptutil.c,v 1.3 2014/11/21 05:13:44 tedu Exp $ */
+/* $OpenBSD: cryptutil.c,v 1.4 2014/11/21 12:32:38 schwarze Exp $ */
/*
* Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
*
@@ -38,7 +38,9 @@ crypt_checkpass(const char *pass, const char *goodhash)
return 0;
if (goodhash[0] == '$' && goodhash[1] == '2') {
- return bcrypt_checkpass(pass, goodhash);
+ if (bcrypt_checkpass(pass, goodhash))
+ goto fail;
+ return 0;
}
/* have to do it the hard way */