xref: /freebsd/contrib/openpam/include/security/pam_modules.h (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1 /*-
2  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
3  * Copyright (c) 2004-2011 Dag-Erling Smørgrav
4  * All rights reserved.
5  *
6  * This software was developed for the FreeBSD Project by ThinkSec AS and
7  * Network Associates Laboratories, the Security Research Division of
8  * Network Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
9  * ("CBOSS"), as part of the DARPA CHATS research program.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. The name of the author may not be used to endorse or promote
20  *    products derived from this software without specific prior written
21  *    permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  */
35 
36 #ifndef SECURITY_PAM_MODULES_H_INCLUDED
37 #define SECURITY_PAM_MODULES_H_INCLUDED
38 
39 #include <security/pam_types.h>
40 #include <security/pam_constants.h>
41 #include <security/openpam.h>
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /*
48  * XSSO 4.2.2, 6
49  */
50 
51 #if defined(PAM_SM_ACCOUNT)
52 PAM_EXTERN int
53 pam_sm_acct_mgmt(pam_handle_t *_pamh,
54 	int _flags,
55 	int _argc,
56 	const char **_argv);
57 #endif
58 
59 #if defined(PAM_SM_AUTH)
60 PAM_EXTERN int
61 pam_sm_authenticate(pam_handle_t *_pamh,
62 	int _flags,
63 	int _argc,
64 	const char **_argv);
65 #endif
66 
67 #if defined(PAM_SM_PASSWORD)
68 PAM_EXTERN int
69 pam_sm_chauthtok(pam_handle_t *_pamh,
70 	int _flags,
71 	int _argc,
72 	const char **_argv);
73 #endif
74 
75 #if defined(PAM_SM_SESSION)
76 PAM_EXTERN int
77 pam_sm_close_session(pam_handle_t *_pamh,
78 	int _flags,
79 	int _args,
80 	const char **_argv);
81 #endif
82 
83 #if defined(PAM_SM_SESSION)
84 PAM_EXTERN int
85 pam_sm_open_session(pam_handle_t *_pamh,
86 	int _flags,
87 	int _argc,
88 	const char **_argv);
89 #endif
90 
91 #if defined(PAM_SM_AUTH)
92 PAM_EXTERN int
93 pam_sm_setcred(pam_handle_t *_pamh,
94 	int _flags,
95 	int _argc,
96 	const char **_argv);
97 #endif
98 
99 /*
100  * Single Sign-On extensions
101  */
102 #if 0
103 PAM_EXTERN int
104 pam_sm_authenticate_secondary(pam_handle_t *_pamh,
105 	char *_target_username,
106 	char *_target_module_type,
107 	char *_target_authn_domain,
108 	char *_target_supp_data,
109 	unsigned char *_target_module_authtok,
110 	int _flags,
111 	int _argc,
112 	const char **_argv);
113 
114 PAM_EXTERN int
115 pam_sm_get_mapped_authtok(pam_handle_t *_pamh,
116 	char *_target_module_username,
117 	char *_target_module_type,
118 	char *_target_authn_domain,
119 	size_t *_target_authtok_len,
120 	unsigned char **_target_module_authtok,
121 	int _argc,
122 	char *_argv);
123 
124 PAM_EXTERN int
125 pam_sm_get_mapped_username(pam_handle_t *_pamh,
126 	char *_src_username,
127 	char *_src_module_type,
128 	char *_src_authn_domain,
129 	char *_target_module_type,
130 	char *_target_authn_domain,
131 	char **_target_module_username,
132 	int _argc,
133 	const char **_argv);
134 
135 PAM_EXTERN int
136 pam_sm_set_mapped_authtok(pam_handle_t *_pamh,
137 	char *_target_module_username,
138 	size_t _target_authtok_len,
139 	unsigned char *_target_module_authtok,
140 	char *_target_module_type,
141 	char *_target_authn_domain,
142 	int _argc,
143 	const char *_argv);
144 
145 PAM_EXTERN int
146 pam_sm_set_mapped_username(pam_handle_t *_pamh,
147 	char *_target_module_username,
148 	char *_target_module_type,
149 	char *_target_authn_domain,
150 	int _argc,
151 	const char **_argv);
152 
153 #endif /* 0 */
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif /* !SECURITY_PAM_MODULES_H_INCLUDED */
160