diff options
-rw-r--r-- | src/lib/libc/crypt/crypt.3 | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libc/crypt/crypt.3 b/src/lib/libc/crypt/crypt.3 index 8d5681d67a..09d1691b5a 100644 --- a/src/lib/libc/crypt/crypt.3 +++ b/src/lib/libc/crypt/crypt.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: crypt.3,v 1.36 2014/05/16 14:12:19 sthen Exp $ | 1 | .\" $OpenBSD: crypt.3,v 1.37 2014/05/16 21:34:48 tedu Exp $ |
2 | .\" | 2 | .\" |
3 | .\" FreeSec: libcrypt | 3 | .\" FreeSec: libcrypt |
4 | .\" | 4 | .\" |
@@ -52,6 +52,8 @@ | |||
52 | .Ft char * | 52 | .Ft char * |
53 | .Fn crypt "const char *key" "const char *setting" | 53 | .Fn crypt "const char *key" "const char *setting" |
54 | .Ft int | 54 | .Ft int |
55 | .Fn crypt_checkpass "const char *password" "const char *hash" | ||
56 | .Ft int | ||
55 | .Fn encrypt "char *block" "int flag" | 57 | .Fn encrypt "char *block" "int flag" |
56 | .Ft int | 58 | .Ft int |
57 | .Fn des_setkey "const char *key" | 59 | .Fn des_setkey "const char *key" |
@@ -88,6 +90,17 @@ and a number then a different algorithm is used depending on the number. | |||
88 | At the moment | 90 | At the moment |
89 | .Ql $2 | 91 | .Ql $2 |
90 | chooses Blowfish hashing; see below for more information. | 92 | chooses Blowfish hashing; see below for more information. |
93 | .Pp | ||
94 | The | ||
95 | .Fn crypt_checkpass | ||
96 | function is provided to simplify checking a user's password. | ||
97 | If both the hash and the password are the empty string, authentication | ||
98 | is a success. | ||
99 | Otherwise, the password is hashed and compared to the provided hash. | ||
100 | If the hash is NULL, authentication will always fail, but a default | ||
101 | amount of work is performed to simulate the hashing operation. | ||
102 | A successful match will return 0. | ||
103 | A failure will return -1 and set errno. | ||
91 | .Ss Extended crypt | 104 | .Ss Extended crypt |
92 | The | 105 | The |
93 | .Ar key | 106 | .Ar key |