1*7c478bd9Sstevel@tonic-gate /* $OpenBSD: readpassphrase.h,v 1.3 2002/06/28 12:32:22 millert Exp $ */ 2*7c478bd9Sstevel@tonic-gate 3*7c478bd9Sstevel@tonic-gate #ifndef _READPASSPHRASE_H 4*7c478bd9Sstevel@tonic-gate #define _READPASSPHRASE_H 5*7c478bd9Sstevel@tonic-gate 6*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 7*7c478bd9Sstevel@tonic-gate 8*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 9*7c478bd9Sstevel@tonic-gate extern "C" { 10*7c478bd9Sstevel@tonic-gate #endif 11*7c478bd9Sstevel@tonic-gate 12*7c478bd9Sstevel@tonic-gate 13*7c478bd9Sstevel@tonic-gate /* 14*7c478bd9Sstevel@tonic-gate * Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com> 15*7c478bd9Sstevel@tonic-gate * All rights reserved. 16*7c478bd9Sstevel@tonic-gate * 17*7c478bd9Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without 18*7c478bd9Sstevel@tonic-gate * modification, are permitted provided that the following conditions 19*7c478bd9Sstevel@tonic-gate * are met: 20*7c478bd9Sstevel@tonic-gate * 1. Redistributions of source code must retain the above copyright 21*7c478bd9Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer. 22*7c478bd9Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright 23*7c478bd9Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in the 24*7c478bd9Sstevel@tonic-gate * documentation and/or other materials provided with the distribution. 25*7c478bd9Sstevel@tonic-gate * 3. The name of the author may not be used to endorse or promote products 26*7c478bd9Sstevel@tonic-gate * derived from this software without specific prior written permission. 27*7c478bd9Sstevel@tonic-gate * 28*7c478bd9Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 29*7c478bd9Sstevel@tonic-gate * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 30*7c478bd9Sstevel@tonic-gate * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 31*7c478bd9Sstevel@tonic-gate * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 32*7c478bd9Sstevel@tonic-gate * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 33*7c478bd9Sstevel@tonic-gate * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 34*7c478bd9Sstevel@tonic-gate * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35*7c478bd9Sstevel@tonic-gate * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 36*7c478bd9Sstevel@tonic-gate * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 37*7c478bd9Sstevel@tonic-gate * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38*7c478bd9Sstevel@tonic-gate */ 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate #include "includes.h" 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate #ifndef HAVE_READPASSPHRASE 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate #define RPP_ECHO_OFF 0x00 /* Turn off echo (default). */ 45*7c478bd9Sstevel@tonic-gate #define RPP_ECHO_ON 0x01 /* Leave echo on. */ 46*7c478bd9Sstevel@tonic-gate #define RPP_REQUIRE_TTY 0x02 /* Fail if there is no tty. */ 47*7c478bd9Sstevel@tonic-gate #define RPP_FORCELOWER 0x04 /* Force input to lower case. */ 48*7c478bd9Sstevel@tonic-gate #define RPP_FORCEUPPER 0x08 /* Force input to upper case. */ 49*7c478bd9Sstevel@tonic-gate #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ 50*7c478bd9Sstevel@tonic-gate #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate char * readpassphrase(const char *, char *, size_t, int); 53*7c478bd9Sstevel@tonic-gate 54*7c478bd9Sstevel@tonic-gate #endif /* HAVE_READPASSPHRASE */ 55*7c478bd9Sstevel@tonic-gate 56*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 57*7c478bd9Sstevel@tonic-gate } 58*7c478bd9Sstevel@tonic-gate #endif 59*7c478bd9Sstevel@tonic-gate 60*7c478bd9Sstevel@tonic-gate #endif /* _READPASSPHRASE_H */ 61