1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Implemented the --gen-key command as we can't use the gpgsm-gencert.sh under Windows.

This commit is contained in:
Werner Koch 2007-06-21 18:44:48 +00:00
parent 09cc0ee7be
commit 0b66f30d66
33 changed files with 714 additions and 317 deletions

View file

@ -50,6 +50,7 @@
#include "util.h"
#include "ttyio.h"
#include "estream-printf.h"
#include "common-defs.h"
#define CONTROL_D ('D' - 'A' + 1)
@ -243,7 +244,7 @@ tty_printf( const char *fmt, ... )
}
/* Same as tty_printf but if FP is not NULL, behave like a regualr
/* Same as tty_printf but if FP is not NULL, behave like a regular
fprintf. */
void
tty_fprintf (FILE *fp, const char *fmt, ... )
@ -563,6 +564,26 @@ tty_get( const char *prompt )
return do_get ( prompt, 0 );
}
/* Variable argument version of tty_get. The prompt is is actually a
format string with arguments. */
char *
tty_getf (const char *promptfmt, ... )
{
va_list arg_ptr;
char *prompt;
char *answer;
va_start (arg_ptr, promptfmt);
if (estream_vasprintf (&prompt, promptfmt, arg_ptr) < 0)
log_fatal ("estream_vasprintf failed: %s\n", strerror (errno));
va_end (arg_ptr);
answer = tty_get (prompt);
xfree (prompt);
return answer;
}
char *
tty_get_hidden( const char *prompt )
{