xref: /netbsd-src/external/bsd/openpam/dist/include/security/pam_modules.h (revision a536ee5124e62c9a0051a252f7833dc8f50f44c9)
1 /*	$NetBSD: pam_modules.h,v 1.2 2011/12/25 22:27:55 christos Exp $	*/
2 
3 /*-
4  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
5  * Copyright (c) 2004-2011 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  * Id: pam_modules.h 437 2011-09-13 12:00:13Z des
38  */
39 
40 #ifndef SECURITY_PAM_MODULES_H_INCLUDED
41 #define SECURITY_PAM_MODULES_H_INCLUDED
42 
43 #include <security/pam_types.h>
44 #include <security/pam_constants.h>
45 #include <security/openpam.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /*
52  * XSSO 4.2.2, 6
53  */
54 
55 #if defined(PAM_SM_ACCOUNT)
56 PAM_EXTERN int
57 pam_sm_acct_mgmt(pam_handle_t *_pamh,
58 	int _flags,
59 	int _argc,
60 	const char **_argv);
61 #endif
62 
63 #if defined(PAM_SM_AUTH)
64 PAM_EXTERN int
65 pam_sm_authenticate(pam_handle_t *_pamh,
66 	int _flags,
67 	int _argc,
68 	const char **_argv);
69 #endif
70 
71 #if defined(PAM_SM_PASSWORD)
72 PAM_EXTERN int
73 pam_sm_chauthtok(pam_handle_t *_pamh,
74 	int _flags,
75 	int _argc,
76 	const char **_argv);
77 #endif
78 
79 #if defined(PAM_SM_SESSION)
80 PAM_EXTERN int
81 pam_sm_close_session(pam_handle_t *_pamh,
82 	int _flags,
83 	int _args,
84 	const char **_argv);
85 #endif
86 
87 #if defined(PAM_SM_SESSION)
88 PAM_EXTERN int
89 pam_sm_open_session(pam_handle_t *_pamh,
90 	int _flags,
91 	int _argc,
92 	const char **_argv);
93 #endif
94 
95 #if defined(PAM_SM_AUTH)
96 PAM_EXTERN int
97 pam_sm_setcred(pam_handle_t *_pamh,
98 	int _flags,
99 	int _argc,
100 	const char **_argv);
101 #endif
102 
103 /*
104  * Single Sign-On extensions
105  */
106 #if 0
107 PAM_EXTERN int
108 pam_sm_authenticate_secondary(pam_handle_t *_pamh,
109 	char *_target_username,
110 	char *_target_module_type,
111 	char *_target_authn_domain,
112 	char *_target_supp_data,
113 	unsigned char *_target_module_authtok,
114 	int _flags,
115 	int _argc,
116 	const char **_argv);
117 
118 PAM_EXTERN int
119 pam_sm_get_mapped_authtok(pam_handle_t *_pamh,
120 	char *_target_module_username,
121 	char *_target_module_type,
122 	char *_target_authn_domain,
123 	size_t *_target_authtok_len,
124 	unsigned char **_target_module_authtok,
125 	int _argc,
126 	char *_argv);
127 
128 PAM_EXTERN int
129 pam_sm_get_mapped_username(pam_handle_t *_pamh,
130 	char *_src_username,
131 	char *_src_module_type,
132 	char *_src_authn_domain,
133 	char *_target_module_type,
134 	char *_target_authn_domain,
135 	char **_target_module_username,
136 	int _argc,
137 	const char **_argv);
138 
139 PAM_EXTERN int
140 pam_sm_set_mapped_authtok(pam_handle_t *_pamh,
141 	char *_target_module_username,
142 	size_t _target_authtok_len,
143 	unsigned char *_target_module_authtok,
144 	char *_target_module_type,
145 	char *_target_authn_domain,
146 	int _argc,
147 	const char *_argv);
148 
149 PAM_EXTERN int
150 pam_sm_set_mapped_username(pam_handle_t *_pamh,
151 	char *_target_module_username,
152 	char *_target_module_type,
153 	char *_target_authn_domain,
154 	int _argc,
155 	const char **_argv);
156 
157 #endif /* 0 */
158 
159 #ifdef __cplusplus
160 }
161 #endif
162 
163 #endif /* !SECURITY_PAM_MODULES_H_INCLUDED */
164