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
This commit is contained in:
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user