1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

wkd: Support option --output for command --check.

* tools/wks-util.c (write_to_file): Rename to ...
(wks_write_to_file): this, make global, and support NULL for fname.
* tools/gpg-wks-client.c (command_check): Write to key.
This commit is contained in:
Werner Koch 2023-01-20 09:00:31 +01:00
parent e28b6c301d
commit 33b6ee5047
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 39 additions and 11 deletions

View file

@ -1126,6 +1126,19 @@ command_check (char *userid)
addrspec);
err = gpg_error (GPG_ERR_CERT_REVOKED);
}
else if (opt.output)
{
/* Save to file. */
const char *fname = opt.output;
if (*fname == '-' && !fname[1])
fname = NULL;
es_rewind (key);
err = wks_write_to_file (key, fname);
if (err)
log_error ("writing key to '%s' failed: %s\n",
fname? fname : "[stdout]", gpg_strerror (err));
}
leave:
xfree (fpr);