diff options
Diffstat (limited to 'src/lib/libc/crypt/crypt_checkpass.3')
| -rw-r--r-- | src/lib/libc/crypt/crypt_checkpass.3 | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/src/lib/libc/crypt/crypt_checkpass.3 b/src/lib/libc/crypt/crypt_checkpass.3 deleted file mode 100644 index 9e0561130a..0000000000 --- a/src/lib/libc/crypt/crypt_checkpass.3 +++ /dev/null | |||
| @@ -1,112 +0,0 @@ | |||
| 1 | .\" $OpenBSD: crypt_checkpass.3,v 1.12 2019/07/29 23:14:06 deraadt Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> | ||
| 4 | .\" | ||
| 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 | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: July 29 2019 $ | ||
| 18 | .Dt CRYPT_CHECKPASS 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm crypt_checkpass , | ||
| 22 | .Nm crypt_newhash | ||
| 23 | .Nd password hashing | ||
| 24 | .Sh SYNOPSIS | ||
| 25 | .In unistd.h | ||
| 26 | .Ft int | ||
| 27 | .Fn crypt_checkpass "const char *password" "const char *hash" | ||
| 28 | .Ft int | ||
| 29 | .Fn crypt_newhash "const char *password" "const char *pref" "char *hash" "size_t hashsize" | ||
| 30 | .Sh DESCRIPTION | ||
| 31 | The | ||
| 32 | .Fn crypt_checkpass | ||
| 33 | function simplifies checking a user's password. | ||
| 34 | If both the | ||
| 35 | .Fa hash | ||
| 36 | and the | ||
| 37 | .Fa password | ||
| 38 | are the empty string, authentication | ||
| 39 | is a success. | ||
| 40 | Otherwise, the | ||
| 41 | .Fa password | ||
| 42 | is hashed and compared to the provided | ||
| 43 | .Fa hash . | ||
| 44 | If the | ||
| 45 | .Fa hash | ||
| 46 | is | ||
| 47 | .Dv NULL , | ||
| 48 | authentication will always fail, but a default | ||
| 49 | amount of work is performed to simulate the hashing operation. | ||
| 50 | A successful match will return 0. | ||
| 51 | A failure will return \-1 and set | ||
| 52 | .Xr errno 2 . | ||
| 53 | .Pp | ||
| 54 | The | ||
| 55 | .Fn crypt_newhash | ||
| 56 | function simplifies the creation of new password hashes. | ||
| 57 | The provided | ||
| 58 | .Fa password | ||
| 59 | is randomly salted and hashed and stored in | ||
| 60 | .Fa hash . | ||
| 61 | The size of the available space is specified by | ||
| 62 | .Fa hashsize , | ||
| 63 | which should be | ||
| 64 | .Dv _PASSWORD_LEN . | ||
| 65 | The | ||
| 66 | .Fa pref | ||
| 67 | argument identifies the preferred hashing algorithm and parameters. | ||
| 68 | Possible values are: | ||
| 69 | .Bl -tag -width Ds | ||
| 70 | .It Dq bcrypt,<rounds> | ||
| 71 | The bcrypt algorithm, where the value of rounds can be between 4 and 31 and | ||
| 72 | specifies the base 2 logarithm of the number of rounds. | ||
| 73 | If rounds is omitted or the special value | ||
| 74 | .Sq a , | ||
| 75 | an appropriate number of rounds is automatically selected based on system | ||
| 76 | performance. | ||
| 77 | .El | ||
| 78 | .Sh RETURN VALUES | ||
| 79 | .Rv -std crypt_checkpass crypt_newhash | ||
| 80 | .Sh ERRORS | ||
| 81 | The | ||
| 82 | .Fn crypt_checkpass | ||
| 83 | function sets | ||
| 84 | .Va errno | ||
| 85 | to | ||
| 86 | .Er EACCES | ||
| 87 | when authentication fails. | ||
| 88 | .Pp | ||
| 89 | The | ||
| 90 | .Fn crypt_newhash | ||
| 91 | function sets | ||
| 92 | .Va errno | ||
| 93 | to | ||
| 94 | .Er EINVAL | ||
| 95 | if | ||
| 96 | .Fa pref | ||
| 97 | is unsupported or insufficient space is provided. | ||
| 98 | .Sh SEE ALSO | ||
| 99 | .Xr crypt 3 , | ||
| 100 | .Xr login.conf 5 , | ||
| 101 | .Xr passwd 5 | ||
| 102 | .Sh HISTORY | ||
| 103 | The function | ||
| 104 | .Fn crypt_checkpass | ||
| 105 | first appeared in | ||
| 106 | .Ox 5.6 , | ||
| 107 | and | ||
| 108 | .Fn crypt_newhash | ||
| 109 | in | ||
| 110 | .Ox 5.7 . | ||
| 111 | .Sh AUTHORS | ||
| 112 | .An Ted Unangst Aq Mt tedu@openbsd.org | ||
