From 2972c44bd7e97b2169dea9c4a49d9754afdae3f0 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 23 Aug 2016 15:55:55 +0200 Subject: [PATCH] core: Put the protocol into a TOFU created key object. * src/verify.c (parse_tofu_user): Add arg 'protocol' and store it in the KEY. (_gpgme_verify_status_handler): Pass protocol. Signed-off-by: Werner Koch --- src/verify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/verify.c b/src/verify.c index 173d1cb7..075f1d68 100644 --- a/src/verify.c +++ b/src/verify.c @@ -671,7 +671,7 @@ parse_trust (gpgme_signature_t sig, gpgme_status_code_t code, char *args) /* Parse a TOFU_USER line and put the info into SIG. */ static gpgme_error_t -parse_tofu_user (gpgme_signature_t sig, char *args) +parse_tofu_user (gpgme_signature_t sig, char *args, gpgme_protocol_t protocol) { gpg_error_t err; char *tail; @@ -715,6 +715,7 @@ parse_tofu_user (gpgme_signature_t sig, char *args) if (err) goto leave; sig->key->fpr = fpr; + sig->key->protocol = protocol; fpr = NULL; } else if (!sig->key->fpr) @@ -993,7 +994,7 @@ _gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args) case GPGME_STATUS_TOFU_USER: opd->only_newsig_seen = 0; - return sig ? parse_tofu_user (sig, args) + return sig ? parse_tofu_user (sig, args, ctx->protocol) /* */ : trace_gpg_error (GPG_ERR_INV_ENGINE); case GPGME_STATUS_TOFU_STATS: