diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libc/crypt/crypt_checkpass.3 | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libc/crypt/crypt_checkpass.3')
-rw-r--r-- | src/lib/libc/crypt/crypt_checkpass.3 | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/src/lib/libc/crypt/crypt_checkpass.3 b/src/lib/libc/crypt/crypt_checkpass.3 deleted file mode 100644 index 07a77ae7c0..0000000000 --- a/src/lib/libc/crypt/crypt_checkpass.3 +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | .\" $OpenBSD: crypt_checkpass.3,v 1.13 2021/10/29 10:54:33 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: October 29 2021 $ | ||
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 pwd.h | ||
26 | .In unistd.h | ||
27 | .Ft int | ||
28 | .Fn crypt_checkpass "const char *password" "const char *hash" | ||
29 | .Ft int | ||
30 | .Fn crypt_newhash "const char *password" "const char *pref" "char *hash" "size_t hashsize" | ||
31 | .Sh DESCRIPTION | ||
32 | The | ||
33 | .Fn crypt_checkpass | ||
34 | function simplifies checking a user's password. | ||
35 | If both the | ||
36 | .Fa hash | ||
37 | and the | ||
38 | .Fa password | ||
39 | are the empty string, authentication | ||
40 | is a success. | ||
41 | Otherwise, the | ||
42 | .Fa password | ||
43 | is hashed and compared to the provided | ||
44 | .Fa hash . | ||
45 | If the | ||
46 | .Fa hash | ||
47 | is | ||
48 | .Dv NULL , | ||
49 | authentication will always fail, but a default | ||
50 | amount of work is performed to simulate the hashing operation. | ||
51 | A successful match will return 0. | ||
52 | A failure will return \-1 and set | ||
53 | .Xr errno 2 . | ||
54 | .Pp | ||
55 | The | ||
56 | .Fn crypt_newhash | ||
57 | function simplifies the creation of new password hashes. | ||
58 | The provided | ||
59 | .Fa password | ||
60 | is randomly salted and hashed and stored in | ||
61 | .Fa hash . | ||
62 | The size of the available space is specified by | ||
63 | .Fa hashsize , | ||
64 | which should be | ||
65 | .Dv _PASSWORD_LEN . | ||
66 | The | ||
67 | .Fa pref | ||
68 | argument identifies the preferred hashing algorithm and parameters. | ||
69 | Possible values are: | ||
70 | .Bl -tag -width Ds | ||
71 | .It Dq bcrypt,<rounds> | ||
72 | The bcrypt algorithm, where the value of rounds can be between 4 and 31 and | ||
73 | specifies the base 2 logarithm of the number of rounds. | ||
74 | If rounds is omitted or the special value | ||
75 | .Sq a , | ||
76 | an appropriate number of rounds is automatically selected based on system | ||
77 | performance. | ||
78 | .El | ||
79 | .Sh RETURN VALUES | ||
80 | .Rv -std crypt_checkpass crypt_newhash | ||
81 | .Sh ERRORS | ||
82 | The | ||
83 | .Fn crypt_checkpass | ||
84 | function sets | ||
85 | .Va errno | ||
86 | to | ||
87 | .Er EACCES | ||
88 | when authentication fails. | ||
89 | .Pp | ||
90 | The | ||
91 | .Fn crypt_newhash | ||
92 | function sets | ||
93 | .Va errno | ||
94 | to | ||
95 | .Er EINVAL | ||
96 | if | ||
97 | .Fa pref | ||
98 | is unsupported or insufficient space is provided. | ||
99 | .Sh SEE ALSO | ||
100 | .Xr crypt 3 , | ||
101 | .Xr login.conf 5 , | ||
102 | .Xr passwd 5 | ||
103 | .Sh HISTORY | ||
104 | The function | ||
105 | .Fn crypt_checkpass | ||
106 | first appeared in | ||
107 | .Ox 5.6 , | ||
108 | and | ||
109 | .Fn crypt_newhash | ||
110 | in | ||
111 | .Ox 5.7 . | ||
112 | .Sh AUTHORS | ||
113 | .An Ted Unangst Aq Mt tedu@openbsd.org | ||