diff options
author | wtc%netscape.com <devnull@localhost> | 2002-12-18 02:01:23 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2002-12-18 02:01:23 +0000 |
commit | f2a813f279d6790514a5973b286a42762d23ada5 (patch) | |
tree | 6db4ed0350287e4d74840b2b6dffbc5e0406fbc2 | |
parent | 1faa4cc5f10d7fc4054954c542e22c3da90fec06 (diff) | |
download | nss-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.c | 11 |
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); |