summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt
diff options
context:
space:
mode:
authorschwarze <>2014-11-21 12:44:18 +0000
committerschwarze <>2014-11-21 12:44:18 +0000
commit83663ef2514824954d6efab2bc434f7fa7c30f69 (patch)
tree561849d03243ae56444657cddd767dba0e206fe7 /src/lib/libc/crypt
parentd27b04843e857fcb0847d621fdf3f72096d8e552 (diff)
downloadopenbsd-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/crypt')
-rw-r--r--src/lib/libc/crypt/crypt_checkpass.345
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.
34If both the hash and the password are the empty string, authentication 34If both the hash and the password are the empty string, authentication
35is a success. 35is a success.
36Otherwise, the password is hashed and compared to the provided hash. 36Otherwise, the password is hashed and compared to the provided hash.
37If the hash is NULL, authentication will always fail, but a default 37If the hash is
38.Dv NULL,
39authentication will always fail, but a default
38amount of work is performed to simulate the hashing operation. 40amount of work is performed to simulate the hashing operation.
39A successful match will return 0. 41A successful match will return 0.
40A failure will return \-1 and set errno. 42A failure will return \-1 and set
43.Xr errno 2 .
41.Pp 44.Pp
42The 45The
43.Fn crypt_newhash 46.Fn crypt_newhash
@@ -52,9 +55,39 @@ argument identifies the preferred hashing algorithm and parameters.
52Refer to 55Refer to
53.Xr login.conf 5 . 56.Xr login.conf 5 .
54.Sh RETURN VALUES 57.Sh RETURN VALUES
55These functions 58.Rv -std crypt_checkpass crypt_newhash
56return 0 on success and -1 on failure. 59.Sh ERRORS
60The
61.Fn crypt_checkpass
62function sets
63.Va errno
64to
65.Er EACCESS
66when authentication fails.
67.Pp
68The
69.Fn crypt_newhash
70function sets
71.Va errno
72to
73.Er EINVAL
74or any of the errors specified for
75.Xr strtonum 3
76if
77.Fa pref
78is 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
84The function
85.Fn crypt_checkpass
86first appeared in
87.Ox 5.6 ,
88and
89.Fn crypt_newhash
90in
91.Ox 5.7 .
92.Sh AUTHORS
93.An Ted Unangst Aq Mt tedu@openbsd.org