root/trunk/include/security/pam_appl.h @ 1

Revision 1, 4.4 KB (checked in by des, 9 years ago)

Import OpenPAM.

The basics (pam_start(), pam_end(), pam_strerror(), item-,
data- and environment-related functions and the six PAM
primitives) are implemented. A stub is provided for
pam_get_user(), which is not yet implemented. Stubs are also
provided for XSSO mapping and secondary authentication, though
they are not built and will probably not be implemented for
quite some time.

Sponsored by: DARPA, NAI Labs

Line 
1/*-
2 * Copyright (c) 2002 Networks Associates Technologies, 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 * $Id$
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/*
44 * XSSO 4.2.1, 6
45 */
46
47int
48pam_acct_mgmt(pam_handle_t *_pamh,
49        int _flags);
50
51int
52pam_authenticate(pam_handle_t *_pamh,
53        int _flags);
54
55int
56pam_chauthtok(pam_handle_t *_pamh,
57        int _flags);
58
59int
60pam_close_session(pam_handle_t *_pamh,
61        int _flags);
62
63int
64pam_end(pam_handle_t *_pamh,
65        int _status);
66
67int
68pam_get_data(pam_handle_t *_pamh,
69        const char *_module_data_name,
70        void **_data);
71
72int
73pam_get_item(pam_handle_t *_pamh,
74        int _item_type,
75        void **_item);
76
77int
78pam_get_user(pam_handle_t *_pamh,
79        char **_user,
80        const char *_prompt);
81
82char *
83pam_getenv(pam_handle_t *_pamh,
84        const char *_name);
85
86char **
87pam_getenvlist(pam_handle_t *_pamh);
88
89int
90pam_open_session(pam_handle_t *_pamh,
91        int _flags);
92
93int
94pam_putenv(pam_handle_t *_pamh,
95        const char *_namevalue);
96
97int
98pam_set_data(pam_handle_t *_pamh,
99        const char *_module_data_name,
100        void *_data,
101        void (*_cleanup)(pam_handle_t *_pamh,
102                void *_data,
103                int _pam_end_status));
104
105int
106pam_set_item(pam_handle_t *_pamh,
107        int _item_type,
108        const void *_item);
109
110int
111pam_setcred(pam_handle_t *_pamh,
112        int _flags);
113
114int
115pam_start(const char *_service,
116        const char *_user,
117        const struct pam_conv *_pam_conv,
118        pam_handle_t **_pamh);
119
120const char *
121pam_strerror(pam_handle_t *_pamh,
122        int _error_number);
123
124/*
125 * OpenPAM extensions
126 */
127int
128pam_setenv(pam_handle_t *_pamh,
129        const char *_name,
130        const char *_value,
131        int overwrite);
132
133/*
134 * Single Sign-On extensions
135 */
136#if 0
137int
138pam_authenticate_secondary(pam_handle_t *_pamh,
139        char *_target_username,
140        char *_target_module_type,
141        char *_target_authn_domain,
142        char *_target_supp_data,
143        char *_target_module_authtok,
144        int _flags);
145
146int
147pam_get_mapped_authtok(pam_handle_t *_pamh,
148        const char *_target_module_username,
149        const char *_target_module_type,
150        const char *_target_authn_domain,
151        size_t *_target_authtok_len,
152        unsigned char **_target_module_authtok);
153
154int
155pam_get_mapped_username(pam_handle_t *_pamh,
156        const char *_src_username,
157        const char *_src_module_type,
158        const char *_src_authn_domain,
159        const char *_target_module_type,
160        const char *_target_authn_domain,
161        char **_target_module_username);
162
163int
164pam_set_mapped_authtok(pam_handle_t *_pamh,
165        const char *_target_module_username,
166        size_t _target_authtok_len,
167        unsigned char *_target_module_authtok,
168        const char *_target_module_type,
169        const char *_target_authn_domain);
170
171int
172pam_set_mapped_username(pam_handle_t *_pamh,
173        char *_src_username,
174        char *_src_module_type,
175        char *_src_authn_domain,
176        char *_target_module_username,
177        char *_target_module_type,
178        char *_target_authn_domain);
179#endif /* 0 */
180
181#endif
Note: See TracBrowser for help on using the browser.