~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to Linux-PAM/doc/man/pam_fail_delay.3

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

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