pam_appl.h revision 99158
191094Sdes/*-
292289Sdes * Copyright (c) 2002 Networks Associates Technology, Inc.
391094Sdes * All rights reserved.
491094Sdes *
591094Sdes * This software was developed for the FreeBSD Project by ThinkSec AS and
699158Sdes * Network Associates Laboratories, the Security Research Division of
799158Sdes * Network Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
899158Sdes * ("CBOSS"), as part of the DARPA CHATS research program.
991094Sdes *
1091094Sdes * Redistribution and use in source and binary forms, with or without
1191094Sdes * modification, are permitted provided that the following conditions
1291094Sdes * are met:
1391094Sdes * 1. Redistributions of source code must retain the above copyright
1491094Sdes *    notice, this list of conditions and the following disclaimer.
1591094Sdes * 2. Redistributions in binary form must reproduce the above copyright
1691094Sdes *    notice, this list of conditions and the following disclaimer in the
1791094Sdes *    documentation and/or other materials provided with the distribution.
1891094Sdes * 3. The name of the author may not be used to endorse or promote
1991094Sdes *    products derived from this software without specific prior written
2091094Sdes *    permission.
2191094Sdes *
2291094Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2391094Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2491094Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2591094Sdes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2691094Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2791094Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2891094Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2991094Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3091094Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3191094Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3291094Sdes * SUCH DAMAGE.
3391094Sdes *
3499158Sdes * $P4: //depot/projects/openpam/include/security/pam_appl.h#10 $
3591094Sdes */
3691094Sdes
3791094Sdes#ifndef _PAM_APPL_H_INCLUDED
3891094Sdes#define _PAM_APPL_H_INCLUDED
3991094Sdes
4091094Sdes#include <security/pam_types.h>
4191094Sdes#include <security/pam_constants.h>
4291094Sdes
4391094Sdes#ifdef __cplusplus
4491094Sdesextern "C" {
4591094Sdes#endif
4691094Sdes
4791094Sdes/*
4891094Sdes * XSSO 4.2.1, 6
4991094Sdes */
5091094Sdes
5191094Sdesint
5291094Sdespam_acct_mgmt(pam_handle_t *_pamh,
5391094Sdes	int _flags);
5491094Sdes
5591094Sdesint
5691094Sdespam_authenticate(pam_handle_t *_pamh,
5791094Sdes	int _flags);
5891094Sdes
5991094Sdesint
6091094Sdespam_chauthtok(pam_handle_t *_pamh,
6191094Sdes	int _flags);
6291094Sdes
6391094Sdesint
6491094Sdespam_close_session(pam_handle_t *_pamh,
6591094Sdes	int _flags);
6691094Sdes
6791094Sdesint
6891094Sdespam_end(pam_handle_t *_pamh,
6991094Sdes	int _status);
7091094Sdes
7191094Sdesint
7291094Sdespam_get_data(pam_handle_t *_pamh,
7391094Sdes	const char *_module_data_name,
7491097Sdes	const void **_data);
7591094Sdes
7691094Sdesint
7791094Sdespam_get_item(pam_handle_t *_pamh,
7891094Sdes	int _item_type,
7991094Sdes	const void **_item);
8091094Sdes
8191094Sdesint
8291094Sdespam_get_user(pam_handle_t *_pamh,
8391094Sdes	const char **_user,
8491094Sdes	const char *_prompt);
8591094Sdes
8691094Sdeschar *
8791094Sdespam_getenv(pam_handle_t *_pamh,
8891094Sdes	const char *_name);
8991094Sdes
9091094Sdeschar **
9191094Sdespam_getenvlist(pam_handle_t *_pamh);
9291094Sdes
9391094Sdesint
9491094Sdespam_open_session(pam_handle_t *_pamh,
9591094Sdes	int _flags);
9691094Sdes
9791094Sdesint
9891094Sdespam_putenv(pam_handle_t *_pamh,
9991094Sdes	const char *_namevalue);
10091094Sdes
10191094Sdesint
10291094Sdespam_set_data(pam_handle_t *_pamh,
10391094Sdes	const char *_module_data_name,
10491094Sdes	void *_data,
10591094Sdes	void (*_cleanup)(pam_handle_t *_pamh,
10691094Sdes		void *_data,
10791094Sdes		int _pam_end_status));
10891094Sdes
10991094Sdesint
11091094Sdespam_set_item(pam_handle_t *_pamh,
11191094Sdes	int _item_type,
11291094Sdes	const void *_item);
11391094Sdes
11491094Sdesint
11591094Sdespam_setcred(pam_handle_t *_pamh,
11691094Sdes	int _flags);
11791094Sdes
11891094Sdesint
11991094Sdespam_start(const char *_service,
12091094Sdes	const char *_user,
12191094Sdes	const struct pam_conv *_pam_conv,
12291094Sdes	pam_handle_t **_pamh);
12391094Sdes
12491094Sdesconst char *
12591094Sdespam_strerror(pam_handle_t *_pamh,
12691094Sdes	int _error_number);
12791094Sdes
12891094Sdes/*
12991094Sdes * Single Sign-On extensions
13091094Sdes */
13191094Sdes#if 0
13291094Sdesint
13391094Sdespam_authenticate_secondary(pam_handle_t *_pamh,
13491094Sdes	char *_target_username,
13591094Sdes	char *_target_module_type,
13691094Sdes	char *_target_authn_domain,
13791094Sdes	char *_target_supp_data,
13891094Sdes	char *_target_module_authtok,
13991094Sdes	int _flags);
14091094Sdes
14191094Sdesint
14291094Sdespam_get_mapped_authtok(pam_handle_t *_pamh,
14391094Sdes	const char *_target_module_username,
14491094Sdes	const char *_target_module_type,
14591094Sdes	const char *_target_authn_domain,
14691094Sdes	size_t *_target_authtok_len,
14791094Sdes	unsigned char **_target_module_authtok);
14891094Sdes
14991094Sdesint
15091094Sdespam_get_mapped_username(pam_handle_t *_pamh,
15191094Sdes	const char *_src_username,
15291094Sdes	const char *_src_module_type,
15391094Sdes	const char *_src_authn_domain,
15491094Sdes	const char *_target_module_type,
15591094Sdes	const char *_target_authn_domain,
15691094Sdes	char **_target_module_username);
15791094Sdes
15891094Sdesint
15991094Sdespam_set_mapped_authtok(pam_handle_t *_pamh,
16091094Sdes	const char *_target_module_username,
16191094Sdes	size_t _target_authtok_len,
16291094Sdes	unsigned char *_target_module_authtok,
16391094Sdes	const char *_target_module_type,
16491094Sdes	const char *_target_authn_domain);
16591094Sdes
16691094Sdesint
16791094Sdespam_set_mapped_username(pam_handle_t *_pamh,
16891094Sdes	char *_src_username,
16991094Sdes	char *_src_module_type,
17091094Sdes	char *_src_authn_domain,
17191094Sdes	char *_target_module_username,
17291094Sdes	char *_target_module_type,
17391094Sdes	char *_target_authn_domain);
17491094Sdes#endif /* 0 */
17591094Sdes
17691094Sdes#ifdef __cplusplus
17791094Sdes}
17891094Sdes#endif
17991094Sdes
18091094Sdes#endif
181