1139749Simp/*-
237785Smsmith * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
337785Smsmith * Copyright (c) 2004-2011 Dag-Erling Sm��rgrav
437785Smsmith * All rights reserved.
537785Smsmith *
637785Smsmith * This software was developed for the FreeBSD Project by ThinkSec AS and
737785Smsmith * Network Associates Laboratories, the Security Research Division of
837785Smsmith * Network Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
937785Smsmith * ("CBOSS"), as part of the DARPA CHATS research program.
1037785Smsmith *
1137785Smsmith * Redistribution and use in source and binary forms, with or without
1237785Smsmith * modification, are permitted provided that the following conditions
1337785Smsmith * are met:
1437785Smsmith * 1. Redistributions of source code must retain the above copyright
1537785Smsmith *    notice, this list of conditions and the following disclaimer.
1637785Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1737785Smsmith *    notice, this list of conditions and the following disclaimer in the
1837785Smsmith *    documentation and/or other materials provided with the distribution.
1937785Smsmith * 3. The name of the author may not be used to endorse or promote
2037785Smsmith *    products derived from this software without specific prior written
2137785Smsmith *    permission.
2237785Smsmith *
2337785Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2437785Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2537785Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2637785Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2737785Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2837785Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29119418Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30119418Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31119418Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3237785Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3337785Smsmith * SUCH DAMAGE.
3437785Smsmith *
3537785Smsmith * $Id: pam_appl.h 648 2013-03-05 17:54:27Z des $
3637785Smsmith */
3737785Smsmith
3858816Simp#ifndef SECURITY_PAM_APPL_H_INCLUDED
3958816Simp#define SECURITY_PAM_APPL_H_INCLUDED
4058816Simp
4137785Smsmith#include <security/pam_types.h>
4237785Smsmith#include <security/pam_constants.h>
4337785Smsmith#include <security/openpam_attr.h>
4437785Smsmith
4558816Simp#ifdef __cplusplus
4658816Simpextern "C" {
4737785Smsmith#endif
4837785Smsmith
4938592Smsmith/*
5037785Smsmith * XSSO 4.2.1, 6
5137785Smsmith */
5258816Simp
5358816Simpint
5458816Simppam_acct_mgmt(pam_handle_t *_pamh,
5558816Simp	int _flags)
5658816Simp	OPENPAM_NONNULL((1));
5758816Simp
5837785Smsmithint
5937785Smsmithpam_authenticate(pam_handle_t *_pamh,
60156559Sphilip	int _flags)
6137785Smsmith	OPENPAM_NONNULL((1));
62147256Sbrooks
6337785Smsmithint
6437785Smsmithpam_chauthtok(pam_handle_t *_pamh,
6537785Smsmith	int _flags)
6672940Simp	OPENPAM_NONNULL((1));
6758816Simp
6837785Smsmithint
6937785Smsmithpam_close_session(pam_handle_t *_pamh,
7037785Smsmith	int _flags)
7137785Smsmith	OPENPAM_NONNULL((1));
7237785Smsmith
7337785Smsmithint
7437785Smsmithpam_end(pam_handle_t *_pamh,
75122024Simp	int _status);
76179560Sjhb
77122024Simpint
78122024Simppam_get_data(const pam_handle_t *_pamh,
79179560Sjhb	const char *_module_data_name,
80122024Simp	const void **_data)
81122024Simp	OPENPAM_NONNULL((1,2,3));
82179560Sjhb
8338592Smsmithint
84122024Simppam_get_item(const pam_handle_t *_pamh,
85122024Simp	int _item_type,
86122024Simp	const void **_item)
8758816Simp	OPENPAM_NONNULL((1,3));
8837785Smsmith
8937785Smsmithint
9037785Smsmithpam_get_user(pam_handle_t *_pamh,
9137785Smsmith	const char **_user,
9237785Smsmith	const char *_prompt)
93122024Simp	OPENPAM_NONNULL((1,2));
94122024Simp
9537785Smsmithconst char *
9637785Smsmithpam_getenv(pam_handle_t *_pamh,
9737785Smsmith	const char *_name)
9837785Smsmith	OPENPAM_NONNULL((1,2));
9937785Smsmith
10037785Smsmithchar **
10137785Smsmithpam_getenvlist(pam_handle_t *_pamh)
10271316Simp	OPENPAM_NONNULL((1));
103179597Simp
10437785Smsmithint
105122024Simppam_open_session(pam_handle_t *_pamh,
106122024Simp	int _flags)
107122024Simp	OPENPAM_NONNULL((1));
108122024Simp
109122024Simpint
110122024Simppam_putenv(pam_handle_t *_pamh,
111122024Simp	const char *_namevalue)
112122024Simp	OPENPAM_NONNULL((1,2));
113122024Simp
114122024Simpint
115122024Simppam_set_data(pam_handle_t *_pamh,
116122024Simp	const char *_module_data_name,
117122024Simp	void *_data,
118122024Simp	void (*_cleanup)(pam_handle_t *_pamh,
119122024Simp		void *_data,
120122024Simp		int _pam_end_status))
121140925Simp	OPENPAM_NONNULL((1,2));
122122024Simp
123122024Simpint
124179532Simppam_set_item(pam_handle_t *_pamh,
125179532Simp	int _item_type,
126179532Simp	const void *_item)
127179532Simp	OPENPAM_NONNULL((1));
128179532Simp
129179532Simpint
130179532Simppam_setcred(pam_handle_t *_pamh,
131179532Simp	int _flags)
132179532Simp	OPENPAM_NONNULL((1));
133179532Simp
13437785Smsmithint
135122024Simppam_start(const char *_service,
13637785Smsmith	const char *_user,
13737785Smsmith	const struct pam_conv *_pam_conv,
13837785Smsmith	pam_handle_t **_pamh)
13937785Smsmith	OPENPAM_NONNULL((4));
140179591Simp
14137785Smsmithconst char *
14237785Smsmithpam_strerror(const pam_handle_t *_pamh,
143122024Simp	int _error_number);
144122024Simp
145122024Simp/*
14637785Smsmith * Single Sign-On extensions
14772940Simp */
148122024Simp#if 0
14972940Simpint
15072940Simppam_authenticate_secondary(pam_handle_t *_pamh,
15137785Smsmith	char *_target_username,
15237785Smsmith	char *_target_module_type,
153179591Simp	char *_target_authn_domain,
15437785Smsmith	char *_target_supp_data,
15537785Smsmith	char *_target_module_authtok,
15637785Smsmith	int _flags);
15737785Smsmith
15837785Smsmithint
15937785Smsmithpam_get_mapped_authtok(pam_handle_t *_pamh,
16072940Simp	const char *_target_module_username,
16137785Smsmith	const char *_target_module_type,
16237785Smsmith	const char *_target_authn_domain,
16337785Smsmith	size_t *_target_authtok_len,
164122024Simp	unsigned char **_target_module_authtok);
16537785Smsmith
166122024Simpint
167122024Simppam_get_mapped_username(pam_handle_t *_pamh,
16837785Smsmith	const char *_src_username,
169122024Simp	const char *_src_module_type,
170122024Simp	const char *_src_authn_domain,
17137785Smsmith	const char *_target_module_type,
172179591Simp	const char *_target_authn_domain,
173122024Simp	char **_target_module_username);
174122024Simp
17537785Smsmithint
17637785Smsmithpam_set_mapped_authtok(pam_handle_t *_pamh,
17737785Smsmith	const char *_target_module_username,
17837785Smsmith	size_t _target_authtok_len,
17937785Smsmith	unsigned char *_target_module_authtok,
180122024Simp	const char *_target_module_type,
181140928Simp	const char *_target_authn_domain);
18237785Smsmith
18337785Smsmithint
18437785Smsmithpam_set_mapped_username(pam_handle_t *_pamh,
18537785Smsmith	char *_src_username,
18637785Smsmith	char *_src_module_type,
18737785Smsmith	char *_src_authn_domain,
18837785Smsmith	char *_target_module_username,
18937785Smsmith	char *_target_module_type,
19037785Smsmith	char *_target_authn_domain);
19137785Smsmith#endif /* 0 */
19237785Smsmith
19372940Simp#ifdef __cplusplus
194122024Simp}
19537785Smsmith#endif
19637785Smsmith
19737785Smsmith#endif /* !SECURITY_PAM_APPL_H_INCLUDED */
19837785Smsmith