Commit 075bee9e authored by Not Zed's avatar Not Zed Committed by Michael Zucci
Browse files

use the article number instead of the messageid. Some servers are just

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.
parent 5a19a3a1
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.
......
......@@ -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 {
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment