aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-gpg-context.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-06-09 20:30:44 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-06-09 20:30:44 +0800
commite1f8409ef0db5c9d54213235e088c9e6e30583a1 (patch)
treefa10d3b76b6bcca43b4ab46216a59ee19f85209e /camel/camel-gpg-context.c
parent5ce3f210b969c3e0ab6020911a6bb4b887e46d0a (diff)
downloadgsoc2013-evolution-e1f8409ef0db5c9d54213235e088c9e6e30583a1.tar.gz
gsoc2013-evolution-e1f8409ef0db5c9d54213235e088c9e6e30583a1.tar.zst
gsoc2013-evolution-e1f8409ef0db5c9d54213235e088c9e6e30583a1.zip
Don't assign trust to be UNKNOWN if gpg sent us a NODATA status.
2004-06-09 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Don't assign trust to be UNKNOWN if gpg sent us a NODATA status. svn path=/trunk/; revision=26265
Diffstat (limited to 'camel/camel-gpg-context.c')
-rw-r--r--camel/camel-gpg-context.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index b69feb9277..9623b7d347 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -208,6 +208,7 @@ struct _GpgCtx {
unsigned int bad_passwds:2;
+ unsigned int nodata:1;
unsigned int hadsig:1;
unsigned int badsig:1;
unsigned int errsig:1;
@@ -265,6 +266,7 @@ gpg_ctx_new (CamelSession *session)
gpg->need_id = NULL;
gpg->passwd = NULL;
+ gpg->nodata = FALSE;
gpg->hadsig = FALSE;
gpg->badsig = FALSE;
gpg->errsig = FALSE;
@@ -852,6 +854,8 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
gpg->hadsig = TRUE;
} else if (!strncmp (status, "NO_PUBKEY ", 10)) {
gpg->nopubkey = TRUE;
+ } else if (!strncmp (status, "NODATA", 6)) {
+ gpg->nodata = TRUE;
}
break;
case GPG_CTX_MODE_ENCRYPT:
@@ -1457,7 +1461,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e
validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_GOOD;
else
validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_BAD;
- } else if (gpg->nopubkey) {
+ } else if (!gpg->nodata && gpg->nopubkey) {
validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_UNKNOWN;
} else {
validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_BAD;