3 * $Id: passphrase.h,v 1.1 1999/12/22 15:58:20 mdw Exp $
7 * (c) 1999 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Catacomb.
14 * Catacomb is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU Library General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
19 * Catacomb is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with Catacomb; if not, write to the Free
26 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 /*----- Revision history --------------------------------------------------*
32 * $Log: passphrase.h,v $
33 * Revision 1.1 1999/12/22 15:58:20 mdw
34 * Portable interface to reading passphrases.
38 #ifndef CATACOMB_PASSPHRASE_H
39 #define CATACOMB_PASSPHRASE_H
45 /*----- Header files ------------------------------------------------------*/
49 /*----- Data structures ---------------------------------------------------*/
51 /* --- Passphrase modes --- *
53 * @PMODE_VERIFY@ requests that the passphrase be repeated to make sure it's
62 /*----- Functions provided ------------------------------------------------*/
64 /* --- @passphrase_read@ --- *
66 * Arguments: @const char *tag@ = pointer to passphrase tag string
67 * @unsigned mode@ = reading mode
68 * @char *buf@ = pointer to destination buffer
69 * @size_t sz@ = size of destination buffer
71 * Returns: Zero if successful, nonzero on failure.
73 * Use: Reads a passphrase from the user, using some system-specific
74 * secure mechanism. The mechanism may keep a cache of
75 * passphrases, so the user may not necessarily be prompted.
78 extern int passphrase_read(const char */
*tag*/
, unsigned /*mode*/,
79 char */
*buf*/
, size_t /*sz*/);
81 /* --- @passphrase_cancel@ --- *
83 * Arguments: @const char *tag@ = pointer to passphrase tag string
87 * Use: Attempts to make the passphrase cache forget about a
88 * particular passphrase. This may be useful if the passphrase
89 * turns out to be wrong, or if the user is attempting to change
93 extern void passphrase_cancel(const char */
*tag*/
);
95 /*----- That's all, folks -------------------------------------------------*/