wks: Add stubs for new gpg-wks-server commands.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-07-26 17:49:39 +02:00
parent 4f569c6907
commit b428dd495a
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 60 additions and 0 deletions

View File

@ -63,6 +63,9 @@ enum cmd_and_opt_values
aReceive,
aCron,
aListDomains,
aInstallKey,
aRevokeKey,
aRemoveKey,
oGpgProgram,
oSend,
@ -83,6 +86,12 @@ static ARGPARSE_OPTS opts[] = {
("run regular jobs")),
ARGPARSE_c (aListDomains, "list-domains",
("list configured domains")),
ARGPARSE_c (aInstallKey, "install-key",
"|FILE|install a key from FILE into the WKD"),
ARGPARSE_c (aRemoveKey, "remove-key",
"|ADDR|remove the key ADDR from the WKD"),
ARGPARSE_c (aRevokeKey, "revoke-key",
"|ADDR|mark the key ADDR in the WKD as revoked"),
ARGPARSE_group (301, ("@\nOptions:\n ")),
@ -130,6 +139,9 @@ static gpg_error_t command_receive_cb (void *opaque,
const char *mediatype, estream_t fp,
unsigned int flags);
static gpg_error_t command_list_domains (void);
static gpg_error_t command_install_key (const char *fname);
static gpg_error_t command_remove_key (const char *mailaddr);
static gpg_error_t command_revoke_key (const char *mailaddr);
static gpg_error_t command_cron (void);
@ -212,6 +224,9 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
case aReceive:
case aCron:
case aListDomains:
case aInstallKey:
case aRemoveKey:
case aRevokeKey:
cmd = pargs->r_opt;
break;
@ -337,6 +352,24 @@ main (int argc, char **argv)
err = command_list_domains ();
break;
case aInstallKey:
if (argc != 1)
wrong_args ("--install-key FILE");
err = command_install_key (*argv);
break;
case aRemoveKey:
if (argc != 1)
wrong_args ("--remove-key MAILADDR");
err = command_remove_key (*argv);
break;
case aRevokeKey:
if (argc != 1)
wrong_args ("--revoke-key MAILADDR");
err = command_revoke_key (*argv);
break;
default:
usage (1);
err = gpg_error (GPG_ERR_BUG);
@ -1862,3 +1895,30 @@ command_cron (void)
free_strlist (domaindirs);
return err;
}
/* Install a single key into the WKD by reading FNAME. */
static gpg_error_t
command_install_key (const char *fname)
{
(void)fname;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
/* Remove the key with mail address MAILADDR. */
static gpg_error_t
command_remove_key (const char *mailaddr)
{
(void)mailaddr;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}
/* Revoke the key with mail address MAILADDR. */
static gpg_error_t
command_revoke_key (const char *mailaddr)
{
(void)mailaddr;
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
}