diff options
Diffstat (limited to 'src/lib/libc/crypt/crypt.3')
| -rw-r--r-- | src/lib/libc/crypt/crypt.3 | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/src/lib/libc/crypt/crypt.3 b/src/lib/libc/crypt/crypt.3 index 636e49d106..f01f996445 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.40 2014/11/18 22:17:50 jmc Exp $ | 1 | .\" $OpenBSD: crypt.3,v 1.41 2014/11/20 19:18:25 tedu Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" FreeSec: libcrypt | 3 | .\" FreeSec: libcrypt |
| 4 | .\" | 4 | .\" |
| @@ -31,13 +31,11 @@ | |||
| 31 | .\" | 31 | .\" |
| 32 | .\" Manual page, using -mandoc macros | 32 | .\" Manual page, using -mandoc macros |
| 33 | .\" | 33 | .\" |
| 34 | .Dd $Mdocdate: November 18 2014 $ | 34 | .Dd $Mdocdate: November 20 2014 $ |
| 35 | .Dt CRYPT 3 | 35 | .Dt CRYPT 3 |
| 36 | .Os | 36 | .Os |
| 37 | .Sh NAME | 37 | .Sh NAME |
| 38 | .Nm crypt , | 38 | .Nm crypt , |
| 39 | .Nm crypt_checkpass , | ||
| 40 | .Nm crypt_newhash , | ||
| 41 | .Nm setkey , | 39 | .Nm setkey , |
| 42 | .Nm encrypt , | 40 | .Nm encrypt , |
| 43 | .Nm des_setkey , | 41 | .Nm des_setkey , |
| @@ -54,10 +52,6 @@ | |||
| 54 | .Ft char * | 52 | .Ft char * |
| 55 | .Fn crypt "const char *key" "const char *setting" | 53 | .Fn crypt "const char *key" "const char *setting" |
| 56 | .Ft int | 54 | .Ft int |
| 57 | .Fn crypt_checkpass "const char *password" "const char *hash" | ||
| 58 | .Ft int | ||
| 59 | .Fn crypt_newhash "const char *password" "login_cap_t *lc" "char *hash" "size_t hashsize" | ||
| 60 | .Ft int | ||
| 61 | .Fn encrypt "char *block" "int flag" | 55 | .Fn encrypt "char *block" "int flag" |
| 62 | .Ft int | 56 | .Ft int |
| 63 | .Fn des_setkey "const char *key" | 57 | .Fn des_setkey "const char *key" |
| @@ -69,6 +63,11 @@ | |||
| 69 | .Ft char * | 63 | .Ft char * |
| 70 | .Fn bcrypt "const char *key" "const char *salt" | 64 | .Fn bcrypt "const char *key" "const char *salt" |
| 71 | .Sh DESCRIPTION | 65 | .Sh DESCRIPTION |
| 66 | These functions are deprecated in favor of | ||
| 67 | .Xr crypt_checkpass 3 | ||
| 68 | and | ||
| 69 | .Xr crypt_newhash 3 . | ||
| 70 | .Pp | ||
| 72 | The | 71 | The |
| 73 | .Fn crypt | 72 | .Fn crypt |
| 74 | function performs password hashing based on the | 73 | function performs password hashing based on the |
| @@ -94,30 +93,6 @@ and a number then a different algorithm is used depending on the number. | |||
| 94 | At the moment | 93 | At the moment |
| 95 | .Ql $2 | 94 | .Ql $2 |
| 96 | chooses Blowfish hashing; see below for more information. | 95 | chooses Blowfish hashing; see below for more information. |
| 97 | .Pp | ||
| 98 | The | ||
| 99 | .Fn crypt_checkpass | ||
| 100 | function is provided to simplify checking a user's password. | ||
| 101 | If both the hash and the password are the empty string, authentication | ||
| 102 | is a success. | ||
| 103 | Otherwise, the password is hashed and compared to the provided hash. | ||
| 104 | If the hash is NULL, authentication will always fail, but a default | ||
| 105 | amount of work is performed to simulate the hashing operation. | ||
| 106 | A successful match will return 0. | ||
| 107 | A failure will return \-1 and set errno. | ||
| 108 | .Pp | ||
| 109 | The | ||
| 110 | .Fn crypt_newhash | ||
| 111 | function is provided to simplify the creation of new password hashes. | ||
| 112 | The provided | ||
| 113 | .Fa password | ||
| 114 | is randomly salted and hashed and stored in | ||
| 115 | .Fa hash . | ||
| 116 | The login class argument | ||
| 117 | .Fa lc | ||
| 118 | is used to identify the preferred hashing algorithm and parameters. | ||
| 119 | Refer to | ||
| 120 | .Xr login.conf 5 . | ||
| 121 | .Ss Extended crypt | 96 | .Ss Extended crypt |
| 122 | The | 97 | The |
| 123 | .Ar key | 98 | .Ar key |
| @@ -298,6 +273,7 @@ return 0 on success and 1 on failure. | |||
| 298 | .Xr login 1 , | 273 | .Xr login 1 , |
| 299 | .Xr passwd 1 , | 274 | .Xr passwd 1 , |
| 300 | .Xr blowfish 3 , | 275 | .Xr blowfish 3 , |
| 276 | .Xr crypt_checkpass 3 , | ||
| 301 | .Xr getpass 3 , | 277 | .Xr getpass 3 , |
| 302 | .Xr md5 3 , | 278 | .Xr md5 3 , |
| 303 | .Xr passwd 5 | 279 | .Xr passwd 5 |
