1*0d9d0fd8Schristos /* $NetBSD: pam_modules.h,v 1.7 2023/06/30 21:46:20 christos Exp $ */ 244269bb5Schristos 344269bb5Schristos /*- 444269bb5Schristos * Copyright (c) 2002-2003 Networks Associates Technology, Inc. 544269bb5Schristos * Copyright (c) 2004-2011 Dag-Erling Smørgrav 644269bb5Schristos * All rights reserved. 744269bb5Schristos * 844269bb5Schristos * This software was developed for the FreeBSD Project by ThinkSec AS and 944269bb5Schristos * Network Associates Laboratories, the Security Research Division of 1044269bb5Schristos * Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 1144269bb5Schristos * ("CBOSS"), as part of the DARPA CHATS research program. 1244269bb5Schristos * 1344269bb5Schristos * Redistribution and use in source and binary forms, with or without 1444269bb5Schristos * modification, are permitted provided that the following conditions 1544269bb5Schristos * are met: 1644269bb5Schristos * 1. Redistributions of source code must retain the above copyright 1744269bb5Schristos * notice, this list of conditions and the following disclaimer. 1844269bb5Schristos * 2. Redistributions in binary form must reproduce the above copyright 1944269bb5Schristos * notice, this list of conditions and the following disclaimer in the 2044269bb5Schristos * documentation and/or other materials provided with the distribution. 2144269bb5Schristos * 3. The name of the author may not be used to endorse or promote 2244269bb5Schristos * products derived from this software without specific prior written 2344269bb5Schristos * permission. 2444269bb5Schristos * 2544269bb5Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2644269bb5Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2744269bb5Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2844269bb5Schristos * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2944269bb5Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3044269bb5Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3144269bb5Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3244269bb5Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3344269bb5Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3444269bb5Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3544269bb5Schristos * SUCH DAMAGE. 3644269bb5Schristos */ 3744269bb5Schristos 3844269bb5Schristos #ifndef SECURITY_PAM_MODULES_H_INCLUDED 3944269bb5Schristos #define SECURITY_PAM_MODULES_H_INCLUDED 4044269bb5Schristos 4144269bb5Schristos #include <security/pam_types.h> 4244269bb5Schristos #include <security/pam_constants.h> 4344269bb5Schristos #include <security/openpam.h> 4444269bb5Schristos 4544269bb5Schristos #ifdef __cplusplus 4644269bb5Schristos extern "C" { 4744269bb5Schristos #endif 4844269bb5Schristos 4944269bb5Schristos /* 5044269bb5Schristos * XSSO 4.2.2, 6 5144269bb5Schristos */ 5244269bb5Schristos 5344269bb5Schristos #if defined(PAM_SM_ACCOUNT) 5444269bb5Schristos PAM_EXTERN int 5544269bb5Schristos pam_sm_acct_mgmt(pam_handle_t *_pamh, 5644269bb5Schristos int _flags, 5744269bb5Schristos int _argc, 5844269bb5Schristos const char **_argv); 5944269bb5Schristos #endif 6044269bb5Schristos 6144269bb5Schristos #if defined(PAM_SM_AUTH) 6244269bb5Schristos PAM_EXTERN int 6344269bb5Schristos pam_sm_authenticate(pam_handle_t *_pamh, 6444269bb5Schristos int _flags, 6544269bb5Schristos int _argc, 6644269bb5Schristos const char **_argv); 6744269bb5Schristos #endif 6844269bb5Schristos 6944269bb5Schristos #if defined(PAM_SM_PASSWORD) 7044269bb5Schristos PAM_EXTERN int 7144269bb5Schristos pam_sm_chauthtok(pam_handle_t *_pamh, 7244269bb5Schristos int _flags, 7344269bb5Schristos int _argc, 7444269bb5Schristos const char **_argv); 7544269bb5Schristos #endif 7644269bb5Schristos 7744269bb5Schristos #if defined(PAM_SM_SESSION) 7844269bb5Schristos PAM_EXTERN int 7944269bb5Schristos pam_sm_close_session(pam_handle_t *_pamh, 8044269bb5Schristos int _flags, 8144269bb5Schristos int _args, 8244269bb5Schristos const char **_argv); 8344269bb5Schristos #endif 8444269bb5Schristos 8544269bb5Schristos #if defined(PAM_SM_SESSION) 8644269bb5Schristos PAM_EXTERN int 8744269bb5Schristos pam_sm_open_session(pam_handle_t *_pamh, 8844269bb5Schristos int _flags, 8944269bb5Schristos int _argc, 9044269bb5Schristos const char **_argv); 9144269bb5Schristos #endif 9244269bb5Schristos 9344269bb5Schristos #if defined(PAM_SM_AUTH) 9444269bb5Schristos PAM_EXTERN int 9544269bb5Schristos pam_sm_setcred(pam_handle_t *_pamh, 9644269bb5Schristos int _flags, 9744269bb5Schristos int _argc, 9844269bb5Schristos const char **_argv); 9944269bb5Schristos #endif 10044269bb5Schristos 10144269bb5Schristos /* 10244269bb5Schristos * Single Sign-On extensions 10344269bb5Schristos */ 10444269bb5Schristos #if 0 10544269bb5Schristos PAM_EXTERN int 10644269bb5Schristos pam_sm_authenticate_secondary(pam_handle_t *_pamh, 10744269bb5Schristos char *_target_username, 10844269bb5Schristos char *_target_module_type, 10944269bb5Schristos char *_target_authn_domain, 11044269bb5Schristos char *_target_supp_data, 11144269bb5Schristos unsigned char *_target_module_authtok, 11244269bb5Schristos int _flags, 11344269bb5Schristos int _argc, 11444269bb5Schristos const char **_argv); 11544269bb5Schristos 11644269bb5Schristos PAM_EXTERN int 11744269bb5Schristos pam_sm_get_mapped_authtok(pam_handle_t *_pamh, 11844269bb5Schristos char *_target_module_username, 11944269bb5Schristos char *_target_module_type, 12044269bb5Schristos char *_target_authn_domain, 12144269bb5Schristos size_t *_target_authtok_len, 12244269bb5Schristos unsigned char **_target_module_authtok, 12344269bb5Schristos int _argc, 12444269bb5Schristos char *_argv); 12544269bb5Schristos 12644269bb5Schristos PAM_EXTERN int 12744269bb5Schristos pam_sm_get_mapped_username(pam_handle_t *_pamh, 12844269bb5Schristos char *_src_username, 12944269bb5Schristos char *_src_module_type, 13044269bb5Schristos char *_src_authn_domain, 13144269bb5Schristos char *_target_module_type, 13244269bb5Schristos char *_target_authn_domain, 13344269bb5Schristos char **_target_module_username, 13444269bb5Schristos int _argc, 13544269bb5Schristos const char **_argv); 13644269bb5Schristos 13744269bb5Schristos PAM_EXTERN int 13844269bb5Schristos pam_sm_set_mapped_authtok(pam_handle_t *_pamh, 13944269bb5Schristos char *_target_module_username, 14044269bb5Schristos size_t _target_authtok_len, 14144269bb5Schristos unsigned char *_target_module_authtok, 14244269bb5Schristos char *_target_module_type, 14344269bb5Schristos char *_target_authn_domain, 14444269bb5Schristos int _argc, 14544269bb5Schristos const char *_argv); 14644269bb5Schristos 14744269bb5Schristos PAM_EXTERN int 14844269bb5Schristos pam_sm_set_mapped_username(pam_handle_t *_pamh, 14944269bb5Schristos char *_target_module_username, 15044269bb5Schristos char *_target_module_type, 15144269bb5Schristos char *_target_authn_domain, 15244269bb5Schristos int _argc, 15344269bb5Schristos const char **_argv); 15444269bb5Schristos 15544269bb5Schristos #endif /* 0 */ 15644269bb5Schristos 15744269bb5Schristos #ifdef __cplusplus 15844269bb5Schristos } 15944269bb5Schristos #endif 16044269bb5Schristos 16144269bb5Schristos #endif /* !SECURITY_PAM_MODULES_H_INCLUDED */ 162