Merge from vendor branch CVS:
[dragonfly.git] / contrib / openpam / include / security / pam_appl.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_appl.h#14 $
35  */
36
37 #ifndef _PAM_APPL_H_INCLUDED
38 #define _PAM_APPL_H_INCLUDED
39
40 #include <security/pam_types.h>
41 #include <security/pam_constants.h>
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /*
48  * XSSO 4.2.1, 6
49  */
50
51 int
52 pam_acct_mgmt(pam_handle_t *_pamh,
53         int _flags);
54
55 int
56 pam_authenticate(pam_handle_t *_pamh,
57         int _flags);
58
59 int
60 pam_chauthtok(pam_handle_t *_pamh,
61         int _flags);
62
63 int
64 pam_close_session(pam_handle_t *_pamh,
65         int _flags);
66
67 int
68 pam_end(pam_handle_t *_pamh,
69         int _status);
70
71 int
72 pam_get_data(pam_handle_t *_pamh,
73         const char *_module_data_name,
74         void **_data);
75
76 int
77 pam_get_item(pam_handle_t *_pamh,
78         int _item_type,
79         const void **_item);
80
81 int
82 pam_get_user(pam_handle_t *_pamh,
83         const char **_user,
84         const char *_prompt);
85
86 const char *
87 pam_getenv(pam_handle_t *_pamh,
88         const char *_name);
89
90 char **
91 pam_getenvlist(pam_handle_t *_pamh);
92
93 int
94 pam_open_session(pam_handle_t *_pamh,
95         int _flags);
96
97 int
98 pam_putenv(pam_handle_t *_pamh,
99         const char *_namevalue);
100
101 int
102 pam_set_data(pam_handle_t *_pamh,
103         const char *_module_data_name,
104         void *_data,
105         void (*_cleanup)(pam_handle_t *_pamh,
106                 void *_data,
107                 int _pam_end_status));
108
109 int
110 pam_set_item(pam_handle_t *_pamh,
111         int _item_type,
112         const void *_item);
113
114 int
115 pam_setcred(pam_handle_t *_pamh,
116         int _flags);
117
118 int
119 pam_start(const char *_service,
120         const char *_user,
121         const struct pam_conv *_pam_conv,
122         pam_handle_t **_pamh);
123
124 const char *
125 pam_strerror(pam_handle_t *_pamh,
126         int _error_number);
127
128 /*
129  * Single Sign-On extensions
130  */
131 #if 0
132 int
133 pam_authenticate_secondary(pam_handle_t *_pamh,
134         char *_target_username,
135         char *_target_module_type,
136         char *_target_authn_domain,
137         char *_target_supp_data,
138         char *_target_module_authtok,
139         int _flags);
140
141 int
142 pam_get_mapped_authtok(pam_handle_t *_pamh,
143         const char *_target_module_username,
144         const char *_target_module_type,
145         const char *_target_authn_domain,
146         size_t *_target_authtok_len,
147         unsigned char **_target_module_authtok);
148
149 int
150 pam_get_mapped_username(pam_handle_t *_pamh,
151         const char *_src_username,
152         const char *_src_module_type,
153         const char *_src_authn_domain,
154         const char *_target_module_type,
155         const char *_target_authn_domain,
156         char **_target_module_username);
157
158 int
159 pam_set_mapped_authtok(pam_handle_t *_pamh,
160         const char *_target_module_username,
161         size_t _target_authtok_len,
162         unsigned char *_target_module_authtok,
163         const char *_target_module_type,
164         const char *_target_authn_domain);
165
166 int
167 pam_set_mapped_username(pam_handle_t *_pamh,
168         char *_src_username,
169         char *_src_module_type,
170         char *_src_authn_domain,
171         char *_target_module_username,
172         char *_target_module_type,
173         char *_target_authn_domain);
174 #endif /* 0 */
175
176 #ifdef __cplusplus
177 }
178 #endif
179
180 #endif