Page MenuHome GnuPG

gpgtar: Does not allow decryption from stdin
Open, HighPublic

Description

I see no way to decrypt an archive passed to gpgtar via stdin.

$ gpgtar --version
gpgtar (GnuPG) 2.4.1-beta7

$ gpgtar --decrypt <~/dev/g10/testdata/decrypt-me-sym.tar.asc 
Usage: gpgtar [options] [files] [directories] (-h for help)

$ gpgtar --decrypt - <~/dev/g10/testdata/decrypt-me-sym.tar.asc 
gpg: decrypt_message failed: Unknown system error
gpgtar: error reading '[?]': premature EOF (size of last record: 0)

$ ls -lR -- -_1_
-_1_:
total 0

The following patch avoids the usage message:

diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index 8461666b9..252d80c1d 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -531,7 +531,7 @@ main (int argc, char **argv)
       break;
 
     case aDecrypt:
-      if (argc != 1)
+      if (argc > 1)
         gpgrt_usage (1);
       if (opt.outfile)
         log_info ("note: ignoring option --output\n");

Update: If I omit the --dry-run option, then passing no filename to gpgtar works. So, applying the above patch fixes the problem and matches the check for --list-archive and the behavior of gpgtar without crypto operations.

Event Timeline

ikloecker created this task.
werner moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Thu, Jan 26, 12:02 PM
werner added projects: gnupg24, gnupg22.
werner moved this task from Backlog to QA on the gnupg22 board.
werner moved this task from Backlog to QA on the gnupg24 board.