diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-02-19 00:20:19 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-02-19 00:20:19 +0800 |
commit | b85cbb139e63d97b646aca22866aa1e440b386c8 (patch) | |
tree | bcc31a01759e6a1b71fd941a5c40197fc41de706 /camel | |
parent | 8d4f642268967bcf14edf6d070ffdda19be4cb9f (diff) | |
download | gsoc2013-evolution-b85cbb139e63d97b646aca22866aa1e440b386c8.tar.gz gsoc2013-evolution-b85cbb139e63d97b646aca22866aa1e440b386c8.tar.zst gsoc2013-evolution-b85cbb139e63d97b646aca22866aa1e440b386c8.zip |
Use the trust to decide the validity signature status. (Better way of
2004-02-18 Jeffrey Stedfast <fejj@ximian.com>
* camel-gpg-context.c (gpg_verify): Use the trust to decide the
validity signature status. (Better way of solving yesterday's
problem)
* camel-cipher-context.h: Revert change from yesterday.
svn path=/trunk/; revision=24779
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel-cipher-context.h | 10 | ||||
-rw-r--r-- | camel/camel-gpg-context.c | 9 |
3 files changed, 15 insertions, 12 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index ba595e60b0..766aa70734 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2004-02-18 Jeffrey Stedfast <fejj@ximian.com> + + * camel-gpg-context.c (gpg_verify): Use the trust to decide the + validity signature status. (Better way of solving yesterday's + problem) + + * camel-cipher-context.h: Revert change from yesterday. + 2004-02-17 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Set the trust. diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h index 6aef6ab13b..4b5dbaed42 100644 --- a/camel/camel-cipher-context.h +++ b/camel/camel-cipher-context.h @@ -62,15 +62,6 @@ 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, @@ -98,7 +89,6 @@ 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 ca235bd0d1..306211ab99 100644 --- a/camel/camel-gpg-context.c +++ b/camel/camel-gpg-context.c @@ -1441,9 +1441,14 @@ gpg_verify (CamelCipherContext *context, CamelMimePart *ipart, CamelException *e valid = gpg_ctx_op_wait (gpg) == 0; validity = camel_cipher_validity_new (); 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; + if (valid && gpg->trust > GPG_TRUST_NEVER) { + if (gpg->trust == GPG_TRUST_UNDEFINED) + validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_UNKNOWN; + else + validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_GOOD; + } else + validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_BAD; gpg_ctx_free (gpg); if (sigfile) { |