summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-16 21:34:49 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-16 21:34:49 +0000
commitbeb615fbee8e4e8377b7695b6cfb71275e703f42 (patch)
treecd1a4c36fa03a00691dcdb71c36ac09474962a37 /lib
parentba634de27c3550530e5c34e8bbc635d456112f65 (diff)
document crypt_checkpass
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/crypt/crypt.315
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/crypt/crypt.3 b/lib/libc/crypt/crypt.3
index 8d5681d67ae..09d1691b5a8 100644
--- a/lib/libc/crypt/crypt.3
+++ b/lib/libc/crypt/crypt.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: crypt.3,v 1.36 2014/05/16 14:12:19 sthen Exp $
+.\" $OpenBSD: crypt.3,v 1.37 2014/05/16 21:34:48 tedu Exp $
.\"
.\" FreeSec: libcrypt
.\"
@@ -52,6 +52,8 @@
.Ft char *
.Fn crypt "const char *key" "const char *setting"
.Ft int
+.Fn crypt_checkpass "const char *password" "const char *hash"
+.Ft int
.Fn encrypt "char *block" "int flag"
.Ft int
.Fn des_setkey "const char *key"
@@ -88,6 +90,17 @@ and a number then a different algorithm is used depending on the number.
At the moment
.Ql $2
chooses Blowfish hashing; see below for more information.
+.Pp
+The
+.Fn crypt_checkpass
+function is provided to simplify checking a user's password.
+If both the hash and the password are the empty string, authentication
+is a success.
+Otherwise, the password is hashed and compared to the provided hash.
+If the hash is NULL, authentication will always fail, but a default
+amount of work is performed to simulate the hashing operation.
+A successful match will return 0.
+A failure will return -1 and set errno.
.Ss Extended crypt
The
.Ar key