From 73405f6116dc5ad8cc1da6bc3414d3069c259047 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 25 Feb 2002 19:08:51 +0000 Subject: [PATCH] 2002-02-25 Marcus Brinkmann * verify.c (_gpgme_verify_status_handler): Parse the args line to see if the problem is due to a missing key, and report that back to the user. --- trunk/gpgme/ChangeLog | 6 ++++++ trunk/gpgme/verify.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 16b9188..ebecd26 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,9 @@ +2002-02-25 Marcus Brinkmann + + * verify.c (_gpgme_verify_status_handler): Parse the args line to + see if the problem is due to a missing key, and report that back + to the user. + 2002-02-25 Marcus Brinkmann * context.h (struct gpgme_context_s): New member include_certs. diff --git a/trunk/gpgme/verify.c b/trunk/gpgme/verify.c index 768a674..ae63579 100644 --- a/trunk/gpgme/verify.c +++ b/trunk/gpgme/verify.c @@ -191,9 +191,14 @@ _gpgme_verify_status_handler (GpgmeCtx ctx, GpgStatusCode code, char *args) break; case STATUS_ERRSIG: - ctx->result.verify->status = GPGME_SIG_STAT_ERROR; - /* FIXME: Distinguish between a regular error and a missing key. - This is encoded in the args. */ + /* The return code is the 6th argument, if it is 9, the problem + is a missing key. */ + for (p = args, i = 0; p && i < 5; i++) + p = strchr (p, ' '); + if (p && *(++p) == '9' && *(++p) == '\0') + ctx->result.verify->status = GPGME_SIG_STAT_NOKEY; + else + ctx->result.verify->status = GPGME_SIG_STAT_ERROR; /* Store the keyID in the fpr field. */ p = ctx->result.verify->fpr; for (i = 0; i < DIM(ctx->result.verify->fpr) -- 2.26.2