mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
wks: Add command --read to gpg-wks-client.
* tools/gpg-wks-client.c (aRead): New. (opts): Add command "--read". (main): Implement that. -- This command allows to process alread decrypted Web Key Service messages. It can for example be used in /etc/mailcap --8<---------------cut here---------------start------------->8--- application/vnd.gnupg.wks; gpg-wks-client -v --read --send;\ needsterminal; description=Web Key Service message --8<---------------cut here---------------end--------------->8--- to allow Mutt to process confirmation requests. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
27d158ead4
commit
8c8ae043b8
@ -51,6 +51,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
aCreate,
|
aCreate,
|
||||||
aReceive,
|
aReceive,
|
||||||
|
aRead,
|
||||||
|
|
||||||
oGpgProgram,
|
oGpgProgram,
|
||||||
oSend,
|
oSend,
|
||||||
@ -66,7 +67,9 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
ARGPARSE_c (aCreate, "create",
|
ARGPARSE_c (aCreate, "create",
|
||||||
("create a publication request")),
|
("create a publication request")),
|
||||||
ARGPARSE_c (aReceive, "receive",
|
ARGPARSE_c (aReceive, "receive",
|
||||||
("receive a confirmation request")),
|
("receive a MIME confirmation request")),
|
||||||
|
ARGPARSE_c (aRead, "read",
|
||||||
|
("receive a plain text confirmation request")),
|
||||||
|
|
||||||
ARGPARSE_group (301, ("@\nOptions:\n ")),
|
ARGPARSE_group (301, ("@\nOptions:\n ")),
|
||||||
|
|
||||||
@ -96,6 +99,7 @@ static struct debug_flags_s debug_flags [] =
|
|||||||
|
|
||||||
static void wrong_args (const char *text) GPGRT_ATTR_NORETURN;
|
static void wrong_args (const char *text) GPGRT_ATTR_NORETURN;
|
||||||
static gpg_error_t command_send (const char *fingerprint, char *userid);
|
static gpg_error_t command_send (const char *fingerprint, char *userid);
|
||||||
|
static gpg_error_t process_confirmation_request (estream_t msg);
|
||||||
static gpg_error_t command_receive_cb (void *opaque,
|
static gpg_error_t command_receive_cb (void *opaque,
|
||||||
const char *mediatype, estream_t fp);
|
const char *mediatype, estream_t fp);
|
||||||
|
|
||||||
@ -172,6 +176,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
|||||||
|
|
||||||
case aCreate:
|
case aCreate:
|
||||||
case aReceive:
|
case aReceive:
|
||||||
|
case aRead:
|
||||||
cmd = pargs->r_opt;
|
cmd = pargs->r_opt;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -242,12 +247,20 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
case aReceive:
|
case aReceive:
|
||||||
if (argc)
|
if (argc)
|
||||||
wrong_args ("--receive");
|
wrong_args ("--receive < MIME-DATA");
|
||||||
err = wks_receive (es_stdin, command_receive_cb, NULL);
|
err = wks_receive (es_stdin, command_receive_cb, NULL);
|
||||||
if (err)
|
if (err)
|
||||||
log_error ("processing mail failed: %s\n", gpg_strerror (err));
|
log_error ("processing mail failed: %s\n", gpg_strerror (err));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case aRead:
|
||||||
|
if (argc)
|
||||||
|
wrong_args ("--read < WKS-DATA");
|
||||||
|
err = process_confirmation_request (es_stdin);
|
||||||
|
if (err)
|
||||||
|
log_error ("processing mail failed: %s\n", gpg_strerror (err));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
usage (1);
|
usage (1);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user