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