b=114893 Can't send encrypted mail if encryption cert has not been imported. Smartcard issue.

r=javi sr=alecf a=asa
This commit is contained in:
kaie%netscape.com 2002-07-15 13:35:30 +00:00
parent 2c95359558
commit 5b56e1ff00
3 changed files with 18 additions and 0 deletions

View File

@ -911,6 +911,13 @@ nsresult nsMsgComposeSecure::MimeCryptoHackCerts(const char *aRecipients,
}
if (count < 0) return count;
if (aEncrypt && mSelfEncryptionCert) {
// Make sure self's configured cert is prepared for being used
// as an email recipient cert.
mSelfEncryptionCert->SaveSMimeProfile();
}
/* If the message is to be encrypted, then get the recipient certs */
if (aEncrypt) {
mailbox = mailbox_list;

View File

@ -204,6 +204,8 @@ interface nsIX509Cert : nsISupports {
[noscript] unsigned long getRawDER(out charPtr result);
PRBool isSameCert(in nsIX509Cert other);
void saveSMimeProfile();
};
%{C++

View File

@ -2724,6 +2724,15 @@ nsNSSCertificate::IsSameCert(nsIX509Cert *other, PRBool *result)
return NS_OK;
}
NS_IMETHODIMP
nsNSSCertificate::SaveSMimeProfile()
{
if (SECSuccess != CERT_SaveSMimeProfile(mCert, nsnull, nsnull))
return NS_ERROR_FAILURE;
else
return NS_OK;
}
/* nsNSSCertificateDB */