Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / contrib / libpam / doc / man / pam_fail_delay.3
CommitLineData
984263bc
MD
1.\" Hey Emacs! This file is -*- nroff -*- source.
2.\" $Id: pam_fail_delay.3,v 1.2 1997/02/15 18:47:46 morgan Exp morgan $
3.\" $FreeBSD: src/contrib/libpam/doc/man/pam_fail_delay.3,v 1.2.6.2 2001/06/11 15:28:11 markm Exp $
1de703da 4.\" $DragonFly: src/contrib/libpam/doc/man/Attic/pam_fail_delay.3,v 1.2 2003/06/17 04:24:02 dillon Exp $
984263bc
MD
5.\" Copyright (c) Andrew G. Morgan 1997 <morgan@parc.power.net>
6.TH PAM_FAIL_DELAY 3 "1997 Jan 12" "PAM 0.56" "Programmers' Manual"
7.SH NAME
8
9pam_fail_delay \- request a delay on failure
10
11.SH SYNOPSIS
12.B #include <security/pam_appl.h>
13.br
14or,
15.br
16.B #include <security/pam_modules.h>
17.sp
18.BI "int pam_fail_delay(pam_handle_t " "*pamh" ", unsigned int " "usec" ");"
19.sp 2
20.SH DESCRIPTION
21.br
22It is often possible to attack an authentication scheme by exploiting
23the time it takes the scheme to deny access to an applicant user. In
24cases of
25.I short
26timeouts, it may prove possible to attempt a
27.I brute force
28dictionary attack -- with an automated process, the attacker tries all
29possible passwords to gain access to the system. In other cases,
30where individual failures can take measurable amounts of time
31(indicating the nature of the failure), an attacker can obtain useful
32information about the authentication process. These latter attacks
33make use of procedural delays that constitute a
34.I covert channel
35of useful information.
36
37.br
38To minimize the effectiveness of such attacks, it is desirable to
39introduce a random delay in a failed authentication process.
40.B PAM
41provides such a facility. The delay occurs upon failure of the
42.BR pam_authenticate "(3) "
43and
44.BR pam_chauthtok "(3) "
45functions. It occurs
46.I after
47all authentication modules have been called, but
48.I before
49control is returned to the service application.
50
51.br
52The function,
53.BR pam_fail_delay "(3),"
54is used to specify a required minimum for the length of the
55failure-delay; the
56.I usec
57argument. This function can be called by the service application
58and/or the authentication modules, both may have an interest in
59delaying a reapplication for service by the user. The length of the
60delay is computed at the time it is required. Its length is
61pseudo-gausianly distributed about the
62.I maximum
63requested value; the resultant delay will differ by as much as 25% of
64this maximum requested value (both up and down).
65
66.br
67On return from
68.BR pam_authenticate "(3) or " pam_chauthtok "(3),"
69independent of success or failure, the new requested delay is reset to
70its default value: zero.
71
72.SH EXAMPLE
73.br
74For example, a
75.B login
76application may require a failure delay of roughly 3 seconds. It will
77contain the following code:
78.sp
79.br
80.B " pam_fail_delay(pamh, 3000000 /* micro-seconds */ );"
81.br
82.B " pam_authenticate(pamh, 0);"
83.sp
84.br
85if the modules do not request a delay, the failure delay will be
86between 2.25 and 3.75 seconds.
87
88.br
89However, the modules, invoked in the authentication process, may
90also request delays:
91.sp
92.br
93.RB " (module #1) " "pam_fail_delay(pamh, 2000000);"
94.sp
95.br
96.RB " (module #2) " "pam_fail_delay(pamh, 4000000);"
97.sp
98.br
99in this case, it is the largest requested value that is used to
100compute the actual failed delay: here between 3 and 5 seconds.
101
102.SH "RETURN VALUE"
103Following a successful call to
104.BR pam_fail_delay "(3), " PAM_SUCCESS
105is returned. All other returns should be considered serious failures.
106
107.SH ERRORS
108May be translated to text with
109.BR pam_strerror "(3). "
110
111.SH "CONFORMING TO"
112Under consideration by the X/Open group for future inclusion in the
113PAM RFC. 1996/1/10
114
115.SH BUGS
116.sp 2
117none known.
118
119.SH "SEE ALSO"
120
121.BR pam_start "(3), "
122.BR pam_get_item "(3) "
123and
124.BR pam_strerror "(3). "
125
126Also, see the three
127.BR Linux-PAM
128Guides, for
129.BR "System administrators" ", "
130.BR "module developers" ", "
131and
132.BR "application developers" ". "