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 $
4 .\" $DragonFly: src/contrib/libpam/doc/man/Attic/pam_fail_delay.3,v 1.2 2003/06/17 04:24:02 dillon Exp $
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"
9 pam_fail_delay \- request a delay on failure
12 .B #include <security/pam_appl.h>
16 .B #include <security/pam_modules.h>
18 .BI "int pam_fail_delay(pam_handle_t " "*pamh" ", unsigned int " "usec" ");"
22 It is often possible to attack an authentication scheme by exploiting
23 the time it takes the scheme to deny access to an applicant user. In
26 timeouts, it may prove possible to attempt a
28 dictionary attack -- with an automated process, the attacker tries all
29 possible passwords to gain access to the system. In other cases,
30 where individual failures can take measurable amounts of time
31 (indicating the nature of the failure), an attacker can obtain useful
32 information about the authentication process. These latter attacks
33 make use of procedural delays that constitute a
35 of useful information.
38 To minimize the effectiveness of such attacks, it is desirable to
39 introduce a random delay in a failed authentication process.
41 provides such a facility. The delay occurs upon failure of the
42 .BR pam_authenticate "(3) "
44 .BR pam_chauthtok "(3) "
47 all authentication modules have been called, but
49 control is returned to the service application.
53 .BR pam_fail_delay "(3),"
54 is used to specify a required minimum for the length of the
57 argument. This function can be called by the service application
58 and/or the authentication modules, both may have an interest in
59 delaying a reapplication for service by the user. The length of the
60 delay is computed at the time it is required. Its length is
61 pseudo-gausianly distributed about the
63 requested value; the resultant delay will differ by as much as 25% of
64 this maximum requested value (both up and down).
68 .BR pam_authenticate "(3) or " pam_chauthtok "(3),"
69 independent of success or failure, the new requested delay is reset to
70 its default value: zero.
76 application may require a failure delay of roughly 3 seconds. It will
77 contain the following code:
80 .B " pam_fail_delay(pamh, 3000000 /* micro-seconds */ );"
82 .B " pam_authenticate(pamh, 0);"
85 if the modules do not request a delay, the failure delay will be
86 between 2.25 and 3.75 seconds.
89 However, the modules, invoked in the authentication process, may
93 .RB " (module #1) " "pam_fail_delay(pamh, 2000000);"
96 .RB " (module #2) " "pam_fail_delay(pamh, 4000000);"
99 in this case, it is the largest requested value that is used to
100 compute the actual failed delay: here between 3 and 5 seconds.
103 Following a successful call to
104 .BR pam_fail_delay "(3), " PAM_SUCCESS
105 is returned. All other returns should be considered serious failures.
108 May be translated to text with
109 .BR pam_strerror "(3). "
112 Under consideration by the X/Open group for future inclusion in the
121 .BR pam_start "(3), "
122 .BR pam_get_item "(3) "
124 .BR pam_strerror "(3). "
129 .BR "System administrators" ", "
130 .BR "module developers" ", "
132 .BR "application developers" ". "