Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: nss/lib/softoken/pkcs11.c

Issue 329663003: Apply the fix for NSS bug 1021102 from the NSS upstream. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: RSA_PrivateKeyCheck should require p > q. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nss/lib/freebl/rsa.c ('k') | patches/nss-rsa-key-check.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nss/lib/softoken/pkcs11.c
diff --git a/nss/lib/softoken/pkcs11.c b/nss/lib/softoken/pkcs11.c
index a4e769e086128ca75551cdb9f77d6b649e326d42..c54194662803a105c1e1c0b1ad4a621193d58545 100644
--- a/nss/lib/softoken/pkcs11.c
+++ b/nss/lib/softoken/pkcs11.c
@@ -2057,12 +2057,12 @@ sftk_verifyRSAPrivateKey(SFTKObject *object, PRBool fillIfNeeded)
sftk_item_expand(&tmpKey.exponent1));
if (crv != CKR_OK) goto loser;
}
- if (!exponent1 || exponent1->attrib.pValue != tmpKey.exponent1.data) {
+ if (!exponent2 || exponent2->attrib.pValue != tmpKey.exponent2.data) {
crv = sftk_forceAttribute(object, CKA_EXPONENT_2,
sftk_item_expand(&tmpKey.exponent2));
if (crv != CKR_OK) goto loser;
}
- if (!exponent1 || exponent1->attrib.pValue != tmpKey.exponent1.data) {
+ if (!coefficient || coefficient->attrib.pValue != tmpKey.coefficient.data) {
crv = sftk_forceAttribute(object, CKA_COEFFICIENT,
sftk_item_expand(&tmpKey.coefficient));
if (crv != CKR_OK) goto loser;
@@ -2089,6 +2089,15 @@ loser:
if (publicExponent) {
sftk_FreeAttribute(publicExponent);
}
+ if (exponent1) {
+ sftk_FreeAttribute(exponent1);
+ }
+ if (exponent2) {
+ sftk_FreeAttribute(exponent2);
+ }
+ if (coefficient) {
+ sftk_FreeAttribute(coefficient);
+ }
return rv;
}
« no previous file with comments | « nss/lib/freebl/rsa.c ('k') | patches/nss-rsa-key-check.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698