summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp')
-rw-r--r--security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp b/security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp
index ee59b1d97..1e50f46f4 100644
--- a/security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp
+++ b/security/nss/lib/mozpkix/test-lib/pkixtestnss.cpp
@@ -234,14 +234,14 @@ GenerateKeyPairInner()
if (!slot) {
abort();
}
+ PK11RSAGenParams params;
+ params.keySizeInBits = 2048;
+ params.pe = 65537;
// Bug 1012786: PK11_GenerateKeyPair can fail if there is insufficient
// entropy to generate a random key. Attempting to add some entropy and
// retrying appears to solve this issue.
for (uint32_t retries = 0; retries < 10; retries++) {
- PK11RSAGenParams params;
- params.keySizeInBits = 2048;
- params.pe = 3;
SECKEYPublicKey* publicKeyTemp = nullptr;
ScopedSECKEYPrivateKey
privateKey(PK11_GenerateKeyPair(slot.get(), CKM_RSA_PKCS_KEY_PAIR_GEN,
@@ -262,8 +262,9 @@ GenerateKeyPairInner()
// random keys.
// https://xkcd.com/221/
static const uint8_t RANDOM_NUMBER[] = { 4, 4, 4, 4, 4, 4, 4, 4 };
- if (PK11_RandomUpdate((void*) &RANDOM_NUMBER,
- sizeof(RANDOM_NUMBER)) != SECSuccess) {
+ if (PK11_RandomUpdate(
+ const_cast<void*>(reinterpret_cast<const void*>(RANDOM_NUMBER)),
+ sizeof(RANDOM_NUMBER)) != SECSuccess) {
break;
}
}