aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-11-13 11:52:12 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-11-13 11:52:12 +0800
commit61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef (patch)
tree3986ab833d78b4785c3c69f3496645ed10787980
parentea99b0cfb4bdac855bb36961b3c2d9fe36ecf041 (diff)
downloadgsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.tar
gsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.tar.gz
gsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.tar.bz2
gsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.tar.lz
gsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.tar.xz
gsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.tar.zst
gsoc2013-evolution-61b1ec94bae6c13d7d1f6dade48a51bfc40f04ef.zip
look at the content object's mime type, not the container's type.
2003-11-13 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (sm_verify): look at the content object's mime type, not the container's type. 2003-11-11 Not Zed <NotZed@Ximian.com> * camel-cipher-context.c (camel_cipher_validity_set_valid): take into account the @valid argument and set validity properly. (camel_cipher_validity_clone): new method to copy validities. * camel-smime-context.c (sm_signing_cmsmessage): removed a todo. svn path=/trunk/; revision=23311
-rw-r--r--camel/ChangeLog13
-rw-r--r--camel/camel-cipher-context.c16
-rw-r--r--camel/camel-cipher-context.h1
-rw-r--r--camel/camel-smime-context.c13
4 files changed, 37 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index a61c63cbcb..e9d9132bfe 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,16 @@
+2003-11-13 Not Zed <NotZed@Ximian.com>
+
+ * camel-smime-context.c (sm_verify): look at the content object's
+ mime type, not the container's type.
+
+2003-11-11 Not Zed <NotZed@Ximian.com>
+
+ * camel-cipher-context.c (camel_cipher_validity_set_valid): take
+ into account the @valid argument and set validity properly.
+ (camel_cipher_validity_clone): new method to copy validities.
+
+ * camel-smime-context.c (sm_signing_cmsmessage): removed a todo.
+
2003-11-10 Not Zed <NotZed@Ximian.com>
* camel-smime-context.c (sm_verify_cmsg): split out the CMSMessage
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index 9e741e4531..40f8d152eb 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -371,7 +371,7 @@ camel_cipher_validity_set_valid (CamelCipherValidity *validity, gboolean valid)
{
g_assert (validity != NULL);
- validity->sign.status = CAMEL_CIPHER_VALIDITY_SIGN_GOOD;
+ validity->sign.status = valid?CAMEL_CIPHER_VALIDITY_SIGN_GOOD:CAMEL_CIPHER_VALIDITY_SIGN_BAD;
}
gchar *
@@ -402,6 +402,20 @@ camel_cipher_validity_clear (CamelCipherValidity *validity)
camel_cipher_validity_init(validity);
}
+CamelCipherValidity *
+camel_cipher_validity_clone(CamelCipherValidity *vin)
+{
+ CamelCipherValidity *vo;
+
+ vo = g_malloc0(sizeof(*vo));
+ vo->sign.status = vin->sign.status;
+ vo->sign.description = g_strdup(vin->sign.description);
+ vo->encrypt.status = vin->encrypt.status;
+ vo->encrypt.description = g_strdup(vin->encrypt.description);
+
+ return vo;
+}
+
/**
* camel_cipher_validity_envelope:
* @validity:
diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h
index d3aea4c6b0..a3edab6a5e 100644
--- a/camel/camel-cipher-context.h
+++ b/camel/camel-cipher-context.h
@@ -153,6 +153,7 @@ void camel_cipher_validity_set_valid (CamelCipherValidity *valid
char *camel_cipher_validity_get_description (CamelCipherValidity *validity);
void camel_cipher_validity_set_description (CamelCipherValidity *validity, const char *description);
void camel_cipher_validity_clear (CamelCipherValidity *validity);
+CamelCipherValidity *camel_cipher_validity_clone(CamelCipherValidity *vin);
void camel_cipher_validity_envelope(CamelCipherValidity *valid, CamelCipherValidity *outer);
void camel_cipher_validity_free (CamelCipherValidity *validity);
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index e2af550db8..c3beab2c54 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -90,6 +90,8 @@ sm_get_passwd(PK11SlotInfo *info, PRBool retry, void *arg)
char *prompt;
CamelException *ex;
+ printf("get passwd called '%s'\n", PK11_GetTokenName(info));
+
ex = camel_exception_new();
prompt = g_strdup_printf(_("Enter security pass-phrase for `%s'"), PK11_GetTokenName(info));
pass = camel_session_get_password(((CamelCipherContext *)context)->session, prompt, FALSE, TRUE, NULL, PK11_GetTokenName(info), ex);
@@ -238,14 +240,12 @@ sm_signing_cmsmessage(CamelSMIMEContext *context, const char *nick, SECOidTag ha
NSSCMSSignerInfo *signerinfo;
CERTCertificate *cert= NULL, *ekpcert = NULL;
- /* TODO: usage should be hardcoded to usageSigner? */
-
if ((cert = CERT_FindUserCertByUsage(p->certdb,
(char *)nick,
certUsageEmailSigner,
PR_FALSE,
NULL)) == NULL) {
- camel_exception_setv(ex, 1, "Cann't find certificate for '%s'", nick);
+ camel_exception_setv(ex, 1, "Can't find certificate for '%s'", nick);
return NULL;
}
@@ -681,10 +681,13 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
CamelContentType *ct;
const char *tmp;
CamelMimePart *extpart, *sigpart;
+ CamelDataWrapper *dw;
+
+ dw = camel_medium_get_content_object((CamelMedium *)ipart);
+ ct = dw->mime_type;
- ct = camel_mime_part_get_content_type(ipart);
if (camel_content_type_is(ct, "multipart", "signed")) {
- CamelMultipart *mps = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)ipart);
+ CamelMultipart *mps = (CamelMultipart *)dw;
tmp = camel_content_type_param(ct, "protocol");
extpart = camel_multipart_get_part(mps, CAMEL_MULTIPART_SIGNED_CONTENT);