diff options
author | James Wahlin <james.wahlin@mongodb.com> | 2019-10-02 14:48:40 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-02 14:48:40 +0000 |
commit | a40b196bd3cecd0b66a6323f57e6f08efe0af392 (patch) | |
tree | 32ffa94f852e91e2b5d4cac3ea8728998b3837e0 /src/mongo/db/auth/sasl_scram_server_conversation.cpp | |
parent | 3175a30264d26b31309e9a4abfb69d9f14136702 (diff) | |
download | mongo-a40b196bd3cecd0b66a6323f57e6f08efe0af392.tar.gz |
Revert "SERVER-43641 upgrade random.h"
This reverts commit 96da177c6ae7b7ed0f29983ad033d8a59524b0b2.
Diffstat (limited to 'src/mongo/db/auth/sasl_scram_server_conversation.cpp')
-rw-r--r-- | src/mongo/db/auth/sasl_scram_server_conversation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/auth/sasl_scram_server_conversation.cpp b/src/mongo/db/auth/sasl_scram_server_conversation.cpp index 897d502533a..fc223097b4f 100644 --- a/src/mongo/db/auth/sasl_scram_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_scram_server_conversation.cpp @@ -235,7 +235,11 @@ StatusWith<std::tuple<bool, std::string>> SaslSCRAMServerMechanism<Policy>::_fir const int nonceLenQWords = 3; uint64_t binaryNonce[nonceLenQWords]; - SecureRandom().fill(binaryNonce, sizeof(binaryNonce)); + std::unique_ptr<SecureRandom> sr(SecureRandom::create()); + + binaryNonce[0] = sr->nextInt64(); + binaryNonce[1] = sr->nextInt64(); + binaryNonce[2] = sr->nextInt64(); _nonce = clientNonce + base64::encode(reinterpret_cast<char*>(binaryNonce), sizeof(binaryNonce)); |