summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-07-19 10:17:15 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2019-07-19 10:17:15 +0200
commitfcd766719a6e8f18f4be4c0f91e12aa157ca5506 (patch)
treefcb67f06c12eec33ef26cfd2d6385b5a79b37c6c
parentcard: Fix showing KDF object attribute. (diff)
downloadgnupg2-fcd766719a6e8f18f4be4c0f91e12aa157ca5506.tar.xz
gnupg2-fcd766719a6e8f18f4be4c0f91e12aa157ca5506.zip
gpg: The option --passphrase= can be empty.
* g10/gpg.c (opts): Use ARGPARSE_o_s for oPassphrase to allow empty string. GnuPG-bug-id: 4633 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--g10/gpg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 0bbe72394..4a94bffc8 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -711,7 +711,7 @@ static ARGPARSE_OPTS opts[] = {
"delete-secret-and-public-keys", "@"),
ARGPARSE_c (aRebuildKeydbCaches, "rebuild-keydb-caches", "@"),
- ARGPARSE_s_s (oPassphrase, "passphrase", "@"),
+ ARGPARSE_o_s (oPassphrase, "passphrase", "@"),
ARGPARSE_s_i (oPassphraseFD, "passphrase-fd", "@"),
ARGPARSE_s_s (oPassphraseFile, "passphrase-file", "@"),
ARGPARSE_s_i (oPassphraseRepeat,"passphrase-repeat", "@"),
@@ -3164,7 +3164,7 @@ main (int argc, char **argv)
case oBZ2CompressLevel: opt.bz2_compress_level = pargs.r.ret_int; break;
case oBZ2DecompressLowmem: opt.bz2_decompress_lowmem=1; break;
case oPassphrase:
- set_passphrase_from_string(pargs.r.ret_str);
+ set_passphrase_from_string (pargs.r_type ? pargs.r.ret_str : "");
break;
case oPassphraseFD:
pwfd = translate_sys2libc_fd_int (pargs.r.ret_int, 0);