From 7f7f5d06fa5aa3a3c5ab8d2e59ee76207bfdeaa0 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 18 Sep 2017 12:52:20 +0200 Subject: wks: Send only the newest UID to the server. * tools/wks-util.c (list_key_status_cb): Rename to key_status_cb. (wks_filter_uid): New. (wks_list_key): Allow FPR to be NULL. Return an error if no fingerprint was found. * tools/gpg-wks-server.c (process_new_key) (check_and_publish): Remove now useless extra check for FPR. * tools/gpg-wks-client.c (command_check): Ditto. (command_send): Filter out the newest uid. -- This fixes the case of having several userids with all the the same mailbox. Now we use the latest user id created. This patch is also a prerequisite to automatically create a new user id for providers with the mailbox-only policy. Signed-off-by: Werner Koch --- tools/gpg-wks-server.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'tools/gpg-wks-server.c') diff --git a/tools/gpg-wks-server.c b/tools/gpg-wks-server.c index f7aadba3d..7e3f05017 100644 --- a/tools/gpg-wks-server.c +++ b/tools/gpg-wks-server.c @@ -1105,12 +1105,7 @@ process_new_key (server_ctx_t ctx, estream_t key) err = wks_list_key (key, &ctx->fpr, &ctx->mboxes); if (err) goto leave; - if (!ctx->fpr) - { - log_error ("error parsing key (no fingerprint)\n"); - err = gpg_error (GPG_ERR_NO_PUBKEY); - goto leave; - } + log_assert (ctx->fpr); log_info ("fingerprint: %s\n", ctx->fpr); for (sl = ctx->mboxes; sl; sl = sl->next) { @@ -1358,12 +1353,7 @@ check_and_publish (server_ctx_t ctx, const char *address, const char *nonce) err = wks_list_key (key, &ctx->fpr, &ctx->mboxes); if (err) goto leave; - if (!ctx->fpr) - { - log_error ("error parsing key (no fingerprint)\n"); - err = gpg_error (GPG_ERR_NO_PUBKEY); - goto leave; - } + log_assert (ctx->fpr); log_info ("fingerprint: %s\n", ctx->fpr); for (sl = ctx->mboxes; sl; sl = sl->next) if (sl->mbox) -- cgit v1.2.3