pam_appl.h revision 92289
1/*-
2 * Copyright (c) 2002 Networks Associates Technology, Inc.
3 * All rights reserved.
4 *
5 * This software was developed for the FreeBSD Project by ThinkSec AS and
6 * NAI Labs, the Security Research Division of Network Associates, Inc.
7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
8 * 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#9 $
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
44extern "C" {
45#endif
46
47/*
48 * XSSO 4.2.1, 6
49 */
50
51int
52pam_acct_mgmt(pam_handle_t *_pamh,
53	int _flags);
54
55int
56pam_authenticate(pam_handle_t *_pamh,
57	int _flags);
58
59int
60pam_chauthtok(pam_handle_t *_pamh,
61	int _flags);
62
63int
64pam_close_session(pam_handle_t *_pamh,
65	int _flags);
66
67int
68pam_end(pam_handle_t *_pamh,
69	int _status);
70
71int
72pam_get_data(pam_handle_t *_pamh,
73	const char *_module_data_name,
74	const void **_data);
75
76int
77pam_get_item(pam_handle_t *_pamh,
78	int _item_type,
79	const void **_item);
80
81int
82pam_get_user(pam_handle_t *_pamh,
83	const char **_user,
84	const char *_prompt);
85
86char *
87pam_getenv(pam_handle_t *_pamh,
88	const char *_name);
89
90char **
91pam_getenvlist(pam_handle_t *_pamh);
92
93int
94pam_open_session(pam_handle_t *_pamh,
95	int _flags);
96
97int
98pam_putenv(pam_handle_t *_pamh,
99	const char *_namevalue);
100
101int
102pam_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
109int
110pam_set_item(pam_handle_t *_pamh,
111	int _item_type,
112	const void *_item);
113
114int
115pam_setcred(pam_handle_t *_pamh,
116	int _flags);
117
118int
119pam_start(const char *_service,
120	const char *_user,
121	const struct pam_conv *_pam_conv,
122	pam_handle_t **_pamh);
123
124const char *
125pam_strerror(pam_handle_t *_pamh,
126	int _error_number);
127
128/*
129 * Single Sign-On extensions
130 */
131#if 0
132int
133pam_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
141int
142pam_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
149int
150pam_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
158int
159pam_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
166int
167pam_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
181