From 9e55ed8c3fac87a040f9ebc38885632cabc0a516 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 17 Feb 2004 19:45:48 +0000 Subject: Set the trust. 2004-02-17 Jeffrey Stedfast * camel-gpg-context.c (gpg_verify): Set the trust. * camel-cipher-context.h: Add a trust metric to signatures. svn path=/trunk/; revision=24763 --- camel/ChangeLog | 6 ++++++ camel/camel-cipher-context.h | 10 ++++++++++ camel/camel-gpg-context.c | 8 ++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index b4028f9a76..ba595e60b0 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2004-02-17 Jeffrey Stedfast + + * camel-gpg-context.c (gpg_verify): Set the trust. + + * camel-cipher-context.h: Add a trust metric to signatures. + 2004-02-17 Not Zed * camel-vee-store.c (vee_sync): implment, make sync a noop on vee diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h index 4b5dbaed42..6aef6ab13b 100644 --- a/camel/camel-cipher-context.h +++ b/camel/camel-cipher-context.h @@ -62,6 +62,15 @@ enum _camel_cipher_validity_sign_t { CAMEL_CIPHER_VALIDITY_SIGN_UNKNOWN, }; +enum _camel_cipher_validity_trust_t { + CAMEL_CIPHER_VALIDITY_TRUST_NONE, + CAMEL_CIPHER_VALIDITY_TRUST_NEVER, + CAMEL_CIPHER_VALIDITY_TRUST_UNDEFINED, + CAMEL_CIPHER_VALIDITY_TRUST_MARGINAL, + CAMEL_CIPHER_VALIDITY_TRUST_FULLY, + CAMEL_CIPHER_VALIDITY_TRUST_ULTIMATE +}; + enum _camel_cipher_validity_encrypt_t { CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE, CAMEL_CIPHER_VALIDITY_ENCRYPT_WEAK, @@ -89,6 +98,7 @@ struct _CamelCipherValidity { struct { enum _camel_cipher_validity_sign_t status; + enum _camel_cipher_validity_trust_t trust; char *description; EDList signers; /* CamelCipherCertInfo's */ } sign; diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c index 4a0e1151c9..ca235bd0d1 100644 --- a/camel/camel-gpg-context.c +++ b/camel/camel-gpg-context.c @@ -156,8 +156,9 @@ enum _GpgCtxMode { }; enum _GpgTrustMetric { - GPG_TRUST_UNKNOWN, + GPG_TRUST_NONE, GPG_TRUST_NEVER, + GPG_TRUST_UNDEFINED, GPG_TRUST_MARGINAL, GPG_TRUST_FULLY, GPG_TRUST_ULTIMATE @@ -260,7 +261,7 @@ gpg_ctx_new (CamelSession *session) gpg->passwd = NULL; gpg->validsig = FALSE; - gpg->trust = GPG_TRUST_UNKNOWN; + gpg->trust = GPG_TRUST_NONE; gpg->istream = NULL; gpg->ostream = NULL; @@ -832,6 +833,8 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex) gpg->trust = GPG_TRUST_FULLY; } else if (!strncmp (status, "ULTIMATE", 8)) { gpg->trust = GPG_TRUST_ULTIMATE; + } else if (!strncmp (status, "UNDEFINED", 9)) { + gpg->trust = GPG_TRUST_UNDEFINED; } } else if (!strncmp (status, "VALIDSIG", 8)) { gpg->validsig = TRUE; @@ -1440,6 +1443,7 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e diagnostics = gpg_ctx_get_diagnostics (gpg); camel_cipher_validity_set_valid (validity, valid); camel_cipher_validity_set_description (validity, diagnostics); + validity->sign.trust = gpg->trust; gpg_ctx_free (gpg); if (sigfile) { -- cgit