summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-19 07:06:10 +0000
committerMichael Zucci <zucchi@src.gnome.org>2004-05-19 07:06:10 +0000
commit075bee9eea500bdcf919d248f529e1fac690e393 (patch)
tree30c9315b3dcf4cae7b3c8ab391808a15ba4c203c
parent5a19a3a167942195174bd8d09e24d4424456dd8d (diff)
downloadevolution-data-server-evolution-1-5-8.tar.gz
use the article number instead of the messageid. Some servers are justEVOLUTION_1_5_8evolution-1-5-8
2004-05-19 Not Zed <NotZed@Ximian.com> * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message): use the article number instead of the messageid. Some servers are just broken. (nntp_folder_cache_message): same. See #58655. * camel-smime-context.c (sm_verify_cmsg): import the certs as UsageEmailRecipient as well as signer, and also save the certs always.
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/camel-smime-context.c12
-rw-r--r--camel/providers/nntp/camel-nntp-folder.c27
3 files changed, 33 insertions, 15 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 2aacd3d40..d2af64319 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,14 @@
2004-05-19 Not Zed <NotZed@Ximian.com>
+ * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message):
+ use the article number instead of the messageid. Some servers are
+ just broken.
+ (nntp_folder_cache_message): same. See #58655.
+
+ * camel-smime-context.c (sm_verify_cmsg): import the certs as
+ UsageEmailRecipient as well as signer, and also save the certs
+ always.
+
** See #58641.
* camel-vee-folder.c (vee_sync): don't rebuild auto-type vfolders.
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index f18fa4fd2..f087ccdb0 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -609,8 +609,13 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
poolp = NULL;
}
- /* import the certificates */
- if (NSS_CMSSignedData_ImportCerts(sigd, p->certdb, certUsageEmailSigner, PR_FALSE) != SECSuccess) {
+ /* import all certificates present */
+ if (NSS_CMSSignedData_ImportCerts(sigd, p->certdb, certUsageEmailSigner, PR_TRUE) != SECSuccess) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Certificate import failed"));
+ goto fail;
+ }
+
+ if (NSS_CMSSignedData_ImportCerts(sigd, p->certdb, certUsageEmailRecipient, PR_TRUE) != SECSuccess) {
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Certificate import failed"));
goto fail;
}
@@ -618,8 +623,7 @@ sm_verify_cmsg(CamelCipherContext *context, NSSCMSMessage *cmsg, CamelStream *ex
/* check for certs-only message */
nsigners = NSS_CMSSignedData_SignerInfoCount(sigd);
if (nsigners == 0) {
- /* ?? Should we check other usages? */
- NSS_CMSSignedData_ImportCerts(sigd, p->certdb, certUsageEmailSigner, PR_TRUE);
+ /* already imported certs above, not sure what usage we should use here or if this isn't handled above */
if (NSS_CMSSignedData_VerifyCertsOnly(sigd, p->certdb, certUsageEmailSigner) != SECSuccess) {
g_string_printf(description, _("Certificate only message, cannot verify certificates"));
} else {
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 4762cf974..3c8b248a7 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -178,18 +178,21 @@ nntp_folder_cache_message (CamelDiscoFolder *disco_folder, const char *uid, Came
{
CamelNNTPStore *nntp_store = (CamelNNTPStore *)((CamelFolder *) disco_folder)->parent_store;
CamelStream *stream;
- const char *msgid;
-
- if (!(msgid = strchr (uid, ','))) {
+ char *article, *msgid;
+
+ article = alloca(strlen(uid)+1);
+ strcpy(article, uid);
+ msgid = strchr(uid, ',');
+ if (!msgid) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Internal error: uid in invalid format: %s"), uid);
return;
}
- msgid++;
+ *msgid++ = 0;
CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
- stream = nntp_folder_download_message ((CamelNNTPFolder *) disco_folder, msgid, ex);
+ stream = nntp_folder_download_message ((CamelNNTPFolder *) disco_folder, article, ex);
if (stream) {
camel_object_unref (stream);
} else {
@@ -210,20 +213,22 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
CamelNNTPFolder *nntp_folder;
CamelStream *stream = NULL;
char *line = NULL;
- const char *msgid;
-
+ char *article, *msgid;
+
nntp_store = (CamelNNTPStore *) folder->parent_store;
nntp_folder = (CamelNNTPFolder *) folder;
CAMEL_NNTP_STORE_LOCK(nntp_store, command_lock);
-
+
+ article = alloca(strlen(uid)+1);
+ strcpy(article, uid);
msgid = strchr (uid, ',');
if (msgid == NULL) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Internal error: uid in invalid format: %s"), uid);
goto fail;
}
- msgid++;
+ *msgid++ = 0;
/* Lookup in cache, NEWS is global messageid's so use a global cache path */
stream = camel_data_cache_get (nntp_store->cache, "cache", msgid, NULL);
@@ -233,8 +238,8 @@ nntp_folder_get_message (CamelFolder *folder, const char *uid, CamelException *e
_("This message is not currently available"));
goto fail;
}
-
- stream = nntp_folder_download_message (nntp_folder, msgid, ex);
+
+ stream = nntp_folder_download_message (nntp_folder, article, ex);
if (stream == NULL)
goto fail;
}