mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
Allow --gen-key to inquire a passphrase.
* g10/gpg.c (main): test for --command-fd during --gen-key parse. When --command-fd is set then imply --batch to let gpg inquire a passphrase rather than requiring a pinentry.
This commit is contained in:
parent
0675a3bd45
commit
233b5fedab
15
g10/gpg.c
15
g10/gpg.c
@ -3930,9 +3930,18 @@ main (int argc, char **argv)
|
|||||||
generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
|
generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( argc )
|
if (opt.command_fd != -1 && argc)
|
||||||
wrong_args("--gen-key");
|
{
|
||||||
generate_keypair (ctrl, 0, NULL, NULL, 0);
|
if( argc > 1 )
|
||||||
|
wrong_args("--gen-key [parameterfile]");
|
||||||
|
|
||||||
|
opt.batch = 1;
|
||||||
|
generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
|
||||||
|
}
|
||||||
|
else if (argc)
|
||||||
|
wrong_args ("--gen-key");
|
||||||
|
else
|
||||||
|
generate_keypair (ctrl, 0, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user