summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2002-12-18 02:01:23 +0000
committerwtc%netscape.com <devnull@localhost>2002-12-18 02:01:23 +0000
commitf2a813f279d6790514a5973b286a42762d23ada5 (patch)
tree6db4ed0350287e4d74840b2b6dffbc5e0406fbc2
parent1faa4cc5f10d7fc4054954c542e22c3da90fec06 (diff)
downloadnss-hg-f2a813f279d6790514a5973b286a42762d23ada5.tar.gz
Bug 183612: fixed the bug that 'extra' may be used uninitialized. r=javi.
Tag: NSS_3_7_BRANCH
-rw-r--r--security/nss/lib/smime/cmsrecinfo.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/security/nss/lib/smime/cmsrecinfo.c b/security/nss/lib/smime/cmsrecinfo.c
index d6270da25..fd1491219 100644
--- a/security/nss/lib/smime/cmsrecinfo.c
+++ b/security/nss/lib/smime/cmsrecinfo.c
@@ -437,15 +437,16 @@ NSS_CMSRecipientInfo_WrapBulkKey(NSSCMSRecipientInfo *ri, PK11SymKey *bulkkey,
switch (certalgtag) {
case SEC_OID_PKCS1_RSA_ENCRYPTION:
/* wrap the symkey */
- if (usesSubjKeyID) {
+ if (cert) {
+ rv = NSS_CMSUtil_EncryptSymKey_RSA(poolp, cert, bulkkey,
+ &ri->ri.keyTransRecipientInfo.encKey);
+ if (rv != SECSuccess)
+ break;
+ } else if (usesSubjKeyID) {
rv = NSS_CMSUtil_EncryptSymKey_RSAPubKey(poolp, extra->pubKey,
bulkkey, &ri->ri.keyTransRecipientInfo.encKey);
if (rv != SECSuccess)
break;
- } else if (NSS_CMSUtil_EncryptSymKey_RSA(poolp, cert, bulkkey,
- &ri->ri.keyTransRecipientInfo.encKey) != SECSuccess) {
- rv = SECFailure;
- break;
}
rv = SECOID_SetAlgorithmID(poolp, &(ri->ri.keyTransRecipientInfo.keyEncAlg), certalgtag, NULL);