From e6dde966400b9fdba1829ba6bc96ef167b86bb6f Mon Sep 17 00:00:00 2001 From: "kaie%kuix.de" Date: Sat, 1 Jul 2006 02:46:44 +0000 Subject: [PATCH] Bug 324474, Revoked S/MIME certificate difficult to detect in received messages r=rrelyea --- security/manager/ssl/src/nsCMS.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/security/manager/ssl/src/nsCMS.cpp b/security/manager/ssl/src/nsCMS.cpp index 55df54719fc6..9ab99e3f8640 100644 --- a/security/manager/ssl/src/nsCMS.cpp +++ b/security/manager/ssl/src/nsCMS.cpp @@ -287,6 +287,17 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, PRUint3 PR_ASSERT(nsigners > 0); si = NSS_CMSSignedData_GetSignerInfo(sigd, 0); + + // See bug 324474. We want to make sure the signing cert is + // still valid at the current time. + if (CERT_VerifyCertificateNow(CERT_GetDefaultCertDB(), si->cert, PR_TRUE, + certificateUsageEmailSigner, + si->cmsg->pwfn_arg, NULL) != SECSuccess) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted now\n")); + rv = NS_ERROR_CMS_VERIFY_UNTRUSTED; + goto loser; + } + // We verify the first signer info, only // if (NSS_CMSSignedData_VerifySignerInfo(sigd, 0, CERT_GetDefaultCertDB(), certUsageEmailSigner) != SECSuccess) { PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - unable to verify signature\n")); @@ -296,7 +307,7 @@ nsresult nsCMSMessage::CommonVerifySignature(unsigned char* aDigestData, PRUint3 rv = NS_ERROR_CMS_VERIFY_NOCERT; } else if(NSSCMSVS_SigningCertNotTrusted == si->verificationStatus) { - PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted\n")); + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("nsCMSMessage::CommonVerifySignature - signing cert not trusted at signing time\n")); rv = NS_ERROR_CMS_VERIFY_UNTRUSTED; } else if(NSSCMSVS_Unverified == si->verificationStatus) {