| 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 | |
|---|
| 47 | int |
|---|
| 48 | pam_acct_mgmt(pam_handle_t *_pamh, |
|---|
| 49 | int _flags); |
|---|
| 50 | |
|---|
| 51 | int |
|---|
| 52 | pam_authenticate(pam_handle_t *_pamh, |
|---|
| 53 | int _flags); |
|---|
| 54 | |
|---|
| 55 | int |
|---|
| 56 | pam_chauthtok(pam_handle_t *_pamh, |
|---|
| 57 | int _flags); |
|---|
| 58 | |
|---|
| 59 | int |
|---|
| 60 | pam_close_session(pam_handle_t *_pamh, |
|---|
| 61 | int _flags); |
|---|
| 62 | |
|---|
| 63 | int |
|---|
| 64 | pam_end(pam_handle_t *_pamh, |
|---|
| 65 | int _status); |
|---|
| 66 | |
|---|
| 67 | int |
|---|
| 68 | pam_get_data(pam_handle_t *_pamh, |
|---|
| 69 | const char *_module_data_name, |
|---|
| 70 | void **_data); |
|---|
| 71 | |
|---|
| 72 | int |
|---|
| 73 | pam_get_item(pam_handle_t *_pamh, |
|---|
| 74 | int _item_type, |
|---|
| 75 | void **_item); |
|---|
| 76 | |
|---|
| 77 | int |
|---|
| 78 | pam_get_user(pam_handle_t *_pamh, |
|---|
| 79 | char **_user, |
|---|
| 80 | const char *_prompt); |
|---|
| 81 | |
|---|
| 82 | char * |
|---|
| 83 | pam_getenv(pam_handle_t *_pamh, |
|---|
| 84 | const char *_name); |
|---|
| 85 | |
|---|
| 86 | char ** |
|---|
| 87 | pam_getenvlist(pam_handle_t *_pamh); |
|---|
| 88 | |
|---|
| 89 | int |
|---|
| 90 | pam_open_session(pam_handle_t *_pamh, |
|---|
| 91 | int _flags); |
|---|
| 92 | |
|---|
| 93 | int |
|---|
| 94 | pam_putenv(pam_handle_t *_pamh, |
|---|
| 95 | const char *_namevalue); |
|---|
| 96 | |
|---|
| 97 | int |
|---|
| 98 | pam_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 | |
|---|
| 105 | int |
|---|
| 106 | pam_set_item(pam_handle_t *_pamh, |
|---|
| 107 | int _item_type, |
|---|
| 108 | const void *_item); |
|---|
| 109 | |
|---|
| 110 | int |
|---|
| 111 | pam_setcred(pam_handle_t *_pamh, |
|---|
| 112 | int _flags); |
|---|
| 113 | |
|---|
| 114 | int |
|---|
| 115 | pam_start(const char *_service, |
|---|
| 116 | const char *_user, |
|---|
| 117 | const struct pam_conv *_pam_conv, |
|---|
| 118 | pam_handle_t **_pamh); |
|---|
| 119 | |
|---|
| 120 | const char * |
|---|
| 121 | pam_strerror(pam_handle_t *_pamh, |
|---|
| 122 | int _error_number); |
|---|
| 123 | |
|---|
| 124 | /* |
|---|
| 125 | * OpenPAM extensions |
|---|
| 126 | */ |
|---|
| 127 | int |
|---|
| 128 | pam_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 |
|---|
| 137 | int |
|---|
| 138 | pam_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 | |
|---|
| 146 | int |
|---|
| 147 | pam_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 | |
|---|
| 154 | int |
|---|
| 155 | pam_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 | |
|---|
| 163 | int |
|---|
| 164 | pam_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 | |
|---|
| 171 | int |
|---|
| 172 | pam_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 |
|---|