summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2009-03-30 19:31:04 +0000
committerwtc%google.com <devnull@localhost>2009-03-30 19:31:04 +0000
commit48f054bd276c0d8ceaf64b777be14d759d2ce2f7 (patch)
tree5f37aa415714f945163f26c4168efef39eac0cf0
parent74fb9d5c4174c8b636b80fdc7a735df4678b4833 (diff)
downloadnss-hg-48f054bd276c0d8ceaf64b777be14d759d2ce2f7.tar.gz
Bug 457045: In rng_init, removed an unnecessary
"globalrng->isValid = PR_FALSE" statement because we haven't reached the only statement that sets globalrng->isValid to PR_TRUE yet. prng_freeRNGContext doesn't need to set globalrng to NULL; its caller does that. prng_freeRNGContext should clear inputhash because that buffer contains a copy of the C & V in the RNG context. r=rrelyea.
-rw-r--r--security/nss/lib/freebl/drbg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/nss/lib/freebl/drbg.c b/security/nss/lib/freebl/drbg.c
index 64c531d70..3e9831a01 100644
--- a/security/nss/lib/freebl/drbg.c
+++ b/security/nss/lib/freebl/drbg.c
@@ -409,7 +409,6 @@ static PRStatus rng_init(void)
} else {
PZ_DestroyLock(globalrng->lock);
globalrng->lock = NULL;
- globalrng->isValid = PR_FALSE;
globalrng = NULL;
return PR_FAILURE;
}
@@ -441,7 +440,7 @@ prng_freeRNGContext(RNGContext *rng)
memcpy(rng->C, inputhash, sizeof rng->C);
memcpy(V(rng), &inputhash[sizeof rng->C], VSize(rng));
- globalrng = NULL;
+ memset(inputhash, 0, sizeof inputhash);
}
/*