diff options
author | wtchang%redhat.com <devnull@localhost> | 2006-09-23 19:40:21 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2006-09-23 19:40:21 +0000 |
commit | b07c7b9406392ce71b747ea1037c898c2ff4b6fe (patch) | |
tree | c9c3b8449ad54b5439b15cff818e1a859c8b2cf3 | |
parent | 500ab3e3546fd0247a185b78d8c6f900df264ce9 (diff) | |
download | nss-hg-b07c7b9406392ce71b747ea1037c898c2ff4b6fe.tar.gz |
Bug 352754: Backported the fix for bug 351872 to the MOZILLA_1_8_BRANCH.
a=mtschrep for Mozilla 1.8 RC2.
-rw-r--r-- | security/nss/lib/softoken/fipstest.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/security/nss/lib/softoken/fipstest.c b/security/nss/lib/softoken/fipstest.c index 250c018fa..325bb2073 100644 --- a/security/nss/lib/softoken/fipstest.c +++ b/security/nss/lib/softoken/fipstest.c @@ -1547,9 +1547,14 @@ sftk_fips_ECDSA_PowerUpSelfTest() { * performing a scalar point multiplication of that value with * the curve's base point. */ - if (EC_NewKeyFromSeed(ecparams, &ecdsa_private_key, ecdsa_Known_Seed, - sizeof(ecdsa_Known_Seed)) != SECSuccess) { - return( CKR_DEVICE_ERROR ); + ecdsaStatus = EC_NewKeyFromSeed(ecparams, &ecdsa_private_key, + ecdsa_Known_Seed, + sizeof(ecdsa_Known_Seed)); + /* free the ecparams they are no longer needed */ + PORT_FreeArena(ecparams->arena, PR_FALSE); + ecparams = NULL; + if (ecdsaStatus != SECSuccess) { + return ( CKR_DEVICE_ERROR ); } /* construct public key from private key. */ @@ -1614,7 +1619,7 @@ sftk_fips_ECDSA_PowerUpSelfTest() { loser: /* free the memory for the private key arena*/ - if (ecdsa_private_key->ecParams.arena != NULL) { + if (ecdsa_private_key != NULL) { PORT_FreeArena(ecdsa_private_key->ecParams.arena, PR_FALSE); } |