xref: /netbsd-src/external/bsd/openpam/dist/include/security/pam_constants.h (revision 82d56013d7b633d116a93943de88e08335357a7c)
1 /*	$NetBSD: pam_constants.h,v 1.7 2021/03/08 19:38:10 christos Exp $	*/
2 
3 /*-
4  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
5  * Copyright (c) 2004-2017 Dag-Erling Smørgrav
6  * All rights reserved.
7  *
8  * This software was developed for the FreeBSD Project by ThinkSec AS and
9  * Network Associates Laboratories, the Security Research Division of
10  * Network Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
11  * ("CBOSS"), as part of the DARPA CHATS research program.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. The name of the author may not be used to endorse or promote
22  *    products derived from this software without specific prior written
23  *    permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  *
37  * $OpenPAM: pam_constants.h 938 2017-04-30 21:34:42Z des $
38  */
39 
40 #ifndef SECURITY_PAM_CONSTANTS_H_INCLUDED
41 #define SECURITY_PAM_CONSTANTS_H_INCLUDED
42 
43 #include <security/openpam_version.h>
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * XSSO 5.2
51  */
52 enum {
53 	PAM_SUCCESS			=   0,
54 	PAM_OPEN_ERR			=   1,
55 	PAM_SYMBOL_ERR			=   2,
56 	PAM_SERVICE_ERR			=   3,
57 	PAM_SYSTEM_ERR			=   4,
58 	PAM_BUF_ERR			=   5,
59 	PAM_CONV_ERR			=   6,
60 	PAM_PERM_DENIED			=   7,
61 	PAM_MAXTRIES			=   8,
62 	PAM_AUTH_ERR			=   9,
63 	PAM_NEW_AUTHTOK_REQD		=  10,
64 	PAM_CRED_INSUFFICIENT		=  11,
65 	PAM_AUTHINFO_UNAVAIL		=  12,
66 	PAM_USER_UNKNOWN		=  13,
67 	PAM_CRED_UNAVAIL		=  14,
68 	PAM_CRED_EXPIRED		=  15,
69 	PAM_CRED_ERR			=  16,
70 	PAM_ACCT_EXPIRED		=  17,
71 	PAM_AUTHTOK_EXPIRED		=  18,
72 	PAM_SESSION_ERR			=  19,
73 	PAM_AUTHTOK_ERR			=  20,
74 	PAM_AUTHTOK_RECOVERY_ERR	=  21,
75 	PAM_AUTHTOK_LOCK_BUSY		=  22,
76 	PAM_AUTHTOK_DISABLE_AGING	=  23,
77 	PAM_NO_MODULE_DATA		=  24,
78 	PAM_IGNORE			=  25,
79 	PAM_ABORT			=  26,
80 	PAM_TRY_AGAIN			=  27,
81 	PAM_MODULE_UNKNOWN		=  28,
82 	PAM_DOMAIN_UNKNOWN		=  29,
83 	PAM_BAD_HANDLE			=  30,		/* OpenPAM extension */
84 	PAM_BAD_ITEM			=  31,		/* OpenPAM extension */
85 	PAM_BAD_FEATURE			=  32,		/* OpenPAM extension */
86 	PAM_BAD_CONSTANT		=  33,		/* OpenPAM extension */
87 	PAM_NUM_ERRORS					/* OpenPAM extension */
88 };
89 
90 /*
91  * XSSO 5.3
92  */
93 enum openpam_message_items {
94 	PAM_PROMPT_ECHO_OFF		=   1,
95 	PAM_PROMPT_ECHO_ON		=   2,
96 	PAM_ERROR_MSG			=   3,
97 	PAM_TEXT_INFO			=   4,
98 	PAM_MAX_NUM_MSG			=  32,
99 	PAM_MAX_MSG_SIZE		= 512,
100 	PAM_MAX_RESP_SIZE		= 512
101 };
102 
103 /*
104  * XSSO 5.4
105  */
106 enum {
107 	/* some compilers promote 0x8000000 to long */
108 	PAM_SILENT			= (-0x7fffffff - 1),
109 	PAM_DISALLOW_NULL_AUTHTOK	= 0x1,
110 	PAM_ESTABLISH_CRED		= 0x1,
111 	PAM_DELETE_CRED			= 0x2,
112 	PAM_REINITIALIZE_CRED		= 0x4,
113 	PAM_REFRESH_CRED		= 0x8,
114 	PAM_PRELIM_CHECK		= 0x1,
115 	PAM_UPDATE_AUTHTOK		= 0x2,
116 	PAM_CHANGE_EXPIRED_AUTHTOK	= 0x4
117 };
118 
119 /*
120  * XSSO 5.5
121  */
122 enum openpam_item_primitives {
123 	PAM_SERVICE			=   1,
124 	PAM_USER			=   2,
125 	PAM_TTY				=   3,
126 	PAM_RHOST			=   4,
127 	PAM_CONV			=   5,
128 	PAM_AUTHTOK			=   6,
129 	PAM_OLDAUTHTOK			=   7,
130 	PAM_RUSER			=   8,
131 	PAM_USER_PROMPT			=   9,
132 	PAM_REPOSITORY			=  10,
133 	PAM_AUTHTOK_PROMPT		=  11,		/* OpenPAM extension */
134 	PAM_OLDAUTHTOK_PROMPT		=  12,		/* OpenPAM extension */
135 	PAM_HOST			=  13,		/* OpenPAM extension */
136 	PAM_SOCKADDR			=  14,		/* NetBSD extension */
137 	PAM_NUSER			=  15,		/* NetBSD extension */
138 	PAM_NUM_ITEMS					/* OpenPAM extension */
139 };
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif /* !SECURITY_PAM_CONSTANTS_H_INCLUDED */
146