195908Sdes/*- 2115619Sdes * Copyright (c) 2002-2003 Networks Associates Technology, Inc. 3228690Sdes * Copyright (c) 2004-2011 Dag-Erling Sm��rgrav 495908Sdes * All rights reserved. 595908Sdes * 695908Sdes * This software was developed for the FreeBSD Project by ThinkSec AS and 799158Sdes * Network Associates Laboratories, the Security Research Division of 899158Sdes * Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 999158Sdes * ("CBOSS"), as part of the DARPA CHATS research program. 1095908Sdes * 1195908Sdes * Redistribution and use in source and binary forms, with or without 1295908Sdes * modification, are permitted provided that the following conditions 1395908Sdes * are met: 1495908Sdes * 1. Redistributions of source code must retain the above copyright 1595908Sdes * notice, this list of conditions and the following disclaimer. 1695908Sdes * 2. Redistributions in binary form must reproduce the above copyright 1795908Sdes * notice, this list of conditions and the following disclaimer in the 1895908Sdes * documentation and/or other materials provided with the distribution. 1995908Sdes * 3. The name of the author may not be used to endorse or promote 2095908Sdes * products derived from this software without specific prior written 2195908Sdes * permission. 2295908Sdes * 2395908Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2495908Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2595908Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2695908Sdes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2795908Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2895908Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2995908Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3095908Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3195908Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3295908Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3395908Sdes * SUCH DAMAGE. 3495908Sdes * 35255376Sdes * $Id: openpam_nullconv.c 648 2013-03-05 17:54:27Z des $ 3695908Sdes */ 3795908Sdes 38228690Sdes#ifdef HAVE_CONFIG_H 39228690Sdes# include "config.h" 40228690Sdes#endif 41228690Sdes 4295908Sdes#include <sys/types.h> 4395908Sdes 4495908Sdes#include <security/pam_appl.h> 4595908Sdes 46107937Sdes#include "openpam_impl.h" 47107937Sdes 4895908Sdes/* 4995908Sdes * OpenPAM extension 5095908Sdes * 5195908Sdes * Null conversation function 5295908Sdes */ 5395908Sdes 5495908Sdesint 5595908Sdesopenpam_nullconv(int n, 5695908Sdes const struct pam_message **msg, 5795908Sdes struct pam_response **resp, 5895908Sdes void *data) 5995908Sdes{ 6095908Sdes 61107937Sdes ENTER(); 6295908Sdes (void)n; 6395908Sdes (void)msg; 6495908Sdes (void)resp; 6595908Sdes (void)data; 66107937Sdes RETURNC(PAM_CONV_ERR); 6795908Sdes} 6895908Sdes 6995908Sdes/* 7095908Sdes * Error codes: 7195908Sdes * 7295908Sdes * PAM_CONV_ERR 7395908Sdes */ 7497241Sdes 7597241Sdes/** 7697241Sdes * The =openpam_nullconv function is a null conversation function suitable 7797241Sdes * for applications that want to use PAM but don't support interactive 78141098Sdes * dialog with the user. 79141098Sdes * Such applications should set =PAM_AUTHTOK to whatever authentication 80141098Sdes * token they've obtained on their own before calling =pam_authenticate 81141098Sdes * and / or =pam_chauthtok, and their PAM configuration should specify the 82141098Sdes * ;use_first_pass option for all modules that require access to the 83141098Sdes * authentication token, to make sure they use =PAM_AUTHTOK rather than 84141098Sdes * try to query the user. 8597241Sdes * 8697241Sdes * >openpam_ttyconv 8797241Sdes * >pam_prompt 8897241Sdes * >pam_set_item 8997241Sdes * >pam_vprompt 9097241Sdes */ 91