diff options
| author | schwarze <> | 2014-11-21 12:44:18 +0000 |
|---|---|---|
| committer | schwarze <> | 2014-11-21 12:44:18 +0000 |
| commit | 83663ef2514824954d6efab2bc434f7fa7c30f69 (patch) | |
| tree | 561849d03243ae56444657cddd767dba0e206fe7 /src/lib/libc | |
| parent | d27b04843e857fcb0847d621fdf3f72096d8e552 (diff) | |
| download | openbsd-83663ef2514824954d6efab2bc434f7fa7c30f69.tar.gz openbsd-83663ef2514824954d6efab2bc434f7fa7c30f69.tar.bz2 openbsd-83663ef2514824954d6efab2bc434f7fa7c30f69.zip | |
add ERRORS, HISTORY, AUTHORS, Copyright year, and some missing macros;
ok tedu@ on a previous version
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/crypt/crypt_checkpass.3 | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/src/lib/libc/crypt/crypt_checkpass.3 b/src/lib/libc/crypt/crypt_checkpass.3 index 479a78647b..0c9b673fba 100644 --- a/src/lib/libc/crypt/crypt_checkpass.3 +++ b/src/lib/libc/crypt/crypt_checkpass.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: crypt_checkpass.3,v 1.2 2014/11/21 05:13:44 tedu Exp $ | 1 | .\" $OpenBSD: crypt_checkpass.3,v 1.3 2014/11/21 12:44:18 schwarze Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) Ted Unangst <tedu@openbsd.org> | 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> |
| 4 | .\" | 4 | .\" |
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | 5 | .\" Permission to use, copy, modify, and distribute this software for any |
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | 6 | .\" purpose with or without fee is hereby granted, provided that the above |
| @@ -34,10 +34,13 @@ function is provided to simplify checking a user's password. | |||
| 34 | If both the hash and the password are the empty string, authentication | 34 | If both the hash and the password are the empty string, authentication |
| 35 | is a success. | 35 | is a success. |
| 36 | Otherwise, the password is hashed and compared to the provided hash. | 36 | Otherwise, the password is hashed and compared to the provided hash. |
| 37 | If the hash is NULL, authentication will always fail, but a default | 37 | If the hash is |
| 38 | .Dv NULL, | ||
| 39 | authentication will always fail, but a default | ||
| 38 | amount of work is performed to simulate the hashing operation. | 40 | amount of work is performed to simulate the hashing operation. |
| 39 | A successful match will return 0. | 41 | A successful match will return 0. |
| 40 | A failure will return \-1 and set errno. | 42 | A failure will return \-1 and set |
| 43 | .Xr errno 2 . | ||
| 41 | .Pp | 44 | .Pp |
| 42 | The | 45 | The |
| 43 | .Fn crypt_newhash | 46 | .Fn crypt_newhash |
| @@ -52,9 +55,39 @@ argument identifies the preferred hashing algorithm and parameters. | |||
| 52 | Refer to | 55 | Refer to |
| 53 | .Xr login.conf 5 . | 56 | .Xr login.conf 5 . |
| 54 | .Sh RETURN VALUES | 57 | .Sh RETURN VALUES |
| 55 | These functions | 58 | .Rv -std crypt_checkpass crypt_newhash |
| 56 | return 0 on success and -1 on failure. | 59 | .Sh ERRORS |
| 60 | The | ||
| 61 | .Fn crypt_checkpass | ||
| 62 | function sets | ||
| 63 | .Va errno | ||
| 64 | to | ||
| 65 | .Er EACCESS | ||
| 66 | when authentication fails. | ||
| 67 | .Pp | ||
| 68 | The | ||
| 69 | .Fn crypt_newhash | ||
| 70 | function sets | ||
| 71 | .Va errno | ||
| 72 | to | ||
| 73 | .Er EINVAL | ||
| 74 | or any of the errors specified for | ||
| 75 | .Xr strtonum 3 | ||
| 76 | if | ||
| 77 | .Fa pref | ||
| 78 | is unsupported. | ||
| 57 | .Sh SEE ALSO | 79 | .Sh SEE ALSO |
| 58 | .Xr crypt 3 , | 80 | .Xr crypt 3 , |
| 59 | .Xr login.conf 5 , | 81 | .Xr login.conf 5 , |
| 60 | .Xr passwd 5 | 82 | .Xr passwd 5 |
| 83 | .Sh HISTORY | ||
| 84 | The function | ||
| 85 | .Fn crypt_checkpass | ||
| 86 | first appeared in | ||
| 87 | .Ox 5.6 , | ||
| 88 | and | ||
| 89 | .Fn crypt_newhash | ||
| 90 | in | ||
| 91 | .Ox 5.7 . | ||
| 92 | .Sh AUTHORS | ||
| 93 | .An Ted Unangst Aq Mt tedu@openbsd.org | ||
