mirror of
git://git.gnupg.org/gnupg.git
synced 2025-06-14 18:31:03 +02:00
* g10.c (main), passphrase.c (set_passphrase_from_string): New
--passphrase command line option. Only useful in very special circumstances.
This commit is contained in:
parent
6ce02d4eb5
commit
82bee9c68a
@ -1,3 +1,9 @@
|
|||||||
|
2005-08-05 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* g10.c (main), passphrase.c (set_passphrase_from_string): New
|
||||||
|
--passphrase command line option. Only useful in very special
|
||||||
|
circumstances.
|
||||||
|
|
||||||
2005-08-05 Werner Koch <wk@g10code.com>
|
2005-08-05 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* gpgv.c (keyserver_import_fprint): New stub.
|
* gpgv.c (keyserver_import_fprint): New stub.
|
||||||
|
@ -211,6 +211,7 @@ enum cmd_and_opt_values
|
|||||||
oCompressLevel,
|
oCompressLevel,
|
||||||
oBZ2CompressLevel,
|
oBZ2CompressLevel,
|
||||||
oBZ2DecompressLowmem,
|
oBZ2DecompressLowmem,
|
||||||
|
oPasswd,
|
||||||
oPasswdFD,
|
oPasswdFD,
|
||||||
oPasswdFile,
|
oPasswdFile,
|
||||||
oCommandFD,
|
oCommandFD,
|
||||||
@ -558,6 +559,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
/* { aListTrustPath, "list-trust-path",0, "@"}, */
|
/* { aListTrustPath, "list-trust-path",0, "@"}, */
|
||||||
{ aPipeMode, "pipemode", 0, "@" },
|
{ aPipeMode, "pipemode", 0, "@" },
|
||||||
{ oKOption, NULL, 0, "@"},
|
{ oKOption, NULL, 0, "@"},
|
||||||
|
{ oPasswd, "passphrase",2, "@" },
|
||||||
{ oPasswdFD, "passphrase-fd",1, "@" },
|
{ oPasswdFD, "passphrase-fd",1, "@" },
|
||||||
{ oPasswdFile, "passphrase-file",2, "@" },
|
{ oPasswdFile, "passphrase-file",2, "@" },
|
||||||
{ oCommandFD, "command-fd",1, "@" },
|
{ oCommandFD, "command-fd",1, "@" },
|
||||||
@ -2270,6 +2272,9 @@ main (int argc, char **argv )
|
|||||||
case oCompressLevel: opt.compress_level = pargs.r.ret_int; break;
|
case oCompressLevel: opt.compress_level = pargs.r.ret_int; break;
|
||||||
case oBZ2CompressLevel: opt.bz2_compress_level = pargs.r.ret_int; break;
|
case oBZ2CompressLevel: opt.bz2_compress_level = pargs.r.ret_int; break;
|
||||||
case oBZ2DecompressLowmem: opt.bz2_decompress_lowmem=1; break;
|
case oBZ2DecompressLowmem: opt.bz2_decompress_lowmem=1; break;
|
||||||
|
case oPasswd:
|
||||||
|
set_passphrase_from_string(pargs.r.ret_str);
|
||||||
|
break;
|
||||||
case oPasswdFD:
|
case oPasswdFD:
|
||||||
pwfd = iobuf_translate_file_handle (pargs.r.ret_int, 0);
|
pwfd = iobuf_translate_file_handle (pargs.r.ret_int, 0);
|
||||||
opt.use_agent = 0;
|
opt.use_agent = 0;
|
||||||
|
@ -115,6 +115,19 @@ get_last_passphrase()
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Here's an interesting question: since this passphrase was passed in
|
||||||
|
on the command line, is there really any point in using secure
|
||||||
|
memory for it? I'm going with 'yes', since it doesn't hurt, and
|
||||||
|
might help in some small way (swapping). */
|
||||||
|
|
||||||
|
void
|
||||||
|
set_passphrase_from_string(const char *pass)
|
||||||
|
{
|
||||||
|
xfree( fd_passwd );
|
||||||
|
fd_passwd = xmalloc_secure(strlen(pass)+1);
|
||||||
|
strcpy(fd_passwd,pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
read_passphrase_from_fd( int fd )
|
read_passphrase_from_fd( int fd )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user