• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git a/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp b/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp
2index 7a6cb42..c05caae 100644
3--- a/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp
4+++ b/src/lib/support/crypto/WeaveRNG-OpenSSL.cpp
5@@ -53,8 +53,9 @@ WEAVE_ERROR InitSecureRandomDataSource(nl::Weave::Crypto::EntropyFunct entropyFu
6
7 WEAVE_ERROR GetSecureRandomData(uint8_t *buf, uint16_t len)
8 {
9-    if (RAND_bytes((unsigned char *)buf, (int)len) != 1)
10-        return WEAVE_ERROR_RANDOM_DATA_UNAVAILABLE;
11+    //if (RAND_bytes((unsigned char *)buf, (int)len) != 1)
12+    //    return WEAVE_ERROR_RANDOM_DATA_UNAVAILABLE;
13+    memset((unsigned char *)buf, 'A', (int)len);
14
15     return WEAVE_NO_ERROR;
16 }
17diff --git a/src/tools/weave/CertUtils.cpp b/src/tools/weave/CertUtils.cpp
18index 2bd8097..a1dce36 100644
19--- a/src/tools/weave/CertUtils.cpp
20+++ b/src/tools/weave/CertUtils.cpp
21@@ -695,8 +695,9 @@ bool SetCertSerialNumber(X509 *cert)
22     ASN1_INTEGER *snInt = X509_get_serialNumber(cert);
23
24     // Generate a random value to be used as the serial number.
25-    if (!RAND_bytes(reinterpret_cast<uint8_t *>(&rnd), sizeof(rnd)))
26-        ReportOpenSSLErrorAndExit("RAND_bytes", res = false);
27+    //if (!RAND_bytes(reinterpret_cast<uint8_t *>(&rnd), sizeof(rnd)))
28+    //    ReportOpenSSLErrorAndExit("RAND_bytes", res = false);
29+    memset(reinterpret_cast<uint8_t *>(&rnd), 'A', sizeof(rnd));
30
31     // Avoid negative numbers.
32     rnd &= 0x7FFFFFFFFFFFFFFF;
33diff --git a/src/tools/weave/Cmd_GenProvisioningData.cpp b/src/tools/weave/Cmd_GenProvisioningData.cpp
34index 85ca2e2..bd5c18b 100644
35--- a/src/tools/weave/Cmd_GenProvisioningData.cpp
36+++ b/src/tools/weave/Cmd_GenProvisioningData.cpp
37@@ -543,8 +543,9 @@ char *GeneratePairingCode(uint32_t pairingCodeLen)
38     }
39
40     // Generate random data for the pairing code, excluding the check digit at the end.
41-    if (!RAND_bytes((uint8_t *)pairingCode, pairingCodeLen - 1))
42-        ReportOpenSSLErrorAndExit("Failed to get random data", pairingCode = NULL);
43+    //if (!RAND_bytes((uint8_t *)pairingCode, pairingCodeLen - 1))
44+    //    ReportOpenSSLErrorAndExit("Failed to get random data", pairingCode = NULL);
45+    memset((uint8_t *)pairingCode, 'A', pairingCodeLen - 1);
46
47     // Convert the random data to characters in the range 0-9, A-H, J-N, P, R-Y (base-32 alphanumeric, excluding I, O, Q and Z).
48     for (uint32_t i = 0; i < pairingCodeLen - 1; i++)
49