diff options
| author | Justus Winter <[email protected]> | 2015-11-30 17:39:00 +0000 |
|---|---|---|
| committer | Justus Winter <[email protected]> | 2015-12-04 11:52:40 +0000 |
| commit | 45c814f348c89acd8d21d0607ffcf68e5c5c399e (patch) | |
| tree | d1a22fe0ab0d9c5181d1b5cbae5b383cbeccdf0d /tools/gpgtar.c | |
| parent | tools/gpgtar: Use the new exectool helper. (diff) | |
| download | gnupg-45c814f348c89acd8d21d0607ffcf68e5c5c399e.tar.gz gnupg-45c814f348c89acd8d21d0607ffcf68e5c5c399e.zip | |
tools/gpgtar: Implement signing.
* tests/openpgp/gpgtar.test: Test signing.
* tools/gpgtar-create.c (gpgtar_create): Add 'sign' option, add the
appropriate gpg arguments to implement signing and selecting the local
user.
* tools/gpgtar.c (parse_options): We do handle '--local-user' now.
(main): Handle signing, encrypting, and doing both when creating an
archive.
* tools/gpgtar.h (gpgtar_create): Update prototype.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tools/gpgtar.c')
| -rw-r--r-- | tools/gpgtar.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c index 100fb160e..800165462 100644 --- a/tools/gpgtar.c +++ b/tools/gpgtar.c @@ -318,7 +318,6 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts) break; case oUser: - log_info ("note: ignoring option --user\n"); opt.user = pargs->r.ret_str; break; @@ -452,12 +451,17 @@ main (int argc, char **argv) break; case aEncrypt: + case aSign: + case aSignEncrypt: if ((!argc && !null_names) || (argc && null_names)) usage (1); if (opt.filename) log_info ("note: ignoring option --set-filename\n"); - err = gpgtar_create (null_names? NULL :argv, !skip_crypto); + err = gpgtar_create (null_names? NULL :argv, + !skip_crypto + && (cmd == aEncrypt || cmd == aSignEncrypt), + cmd == aSign || cmd == aSignEncrypt); if (err && log_get_errorcount (0) == 0) log_error ("creating archive failed: %s\n", gpg_strerror (err)); break; |
