diff options
author | Ben Kibbey <[email protected]> | 2015-04-14 22:48:57 +0000 |
---|---|---|
committer | Ben Kibbey <[email protected]> | 2015-08-15 21:14:13 +0000 |
commit | 233b5fedabd80a34452e748132e65b5944310428 (patch) | |
tree | 7944eb7d679892da16e39ad3848e67fa6f02f11a | |
parent | Post release updates. (diff) | |
download | gnupg-233b5fedabd80a34452e748132e65b5944310428.tar.gz gnupg-233b5fedabd80a34452e748132e65b5944310428.zip |
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.
-rw-r--r-- | g10/gpg.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -3930,9 +3930,18 @@ main (int argc, char **argv) generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0); } else { - if( argc ) - wrong_args("--gen-key"); - generate_keypair (ctrl, 0, NULL, NULL, 0); + if (opt.command_fd != -1 && argc) + { + 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; |