mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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 <justus@g10code.com>
This commit is contained in:
parent
0c0dafd8e8
commit
45c814f348
4 changed files with 60 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue