summaryrefslogtreecommitdiff
path: root/src/mongo/crypto/mechanism_scram.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/crypto/mechanism_scram.h')
-rw-r--r--src/mongo/crypto/mechanism_scram.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/mongo/crypto/mechanism_scram.h b/src/mongo/crypto/mechanism_scram.h
index 1d3b86f2fdd..fb070e8162c 100644
--- a/src/mongo/crypto/mechanism_scram.h
+++ b/src/mongo/crypto/mechanism_scram.h
@@ -32,13 +32,11 @@
#include "mongo/base/secure_allocator.h"
#include "mongo/base/status.h"
-#include "mongo/crypto/crypto.h"
+#include "mongo/crypto/sha1_block.h"
#include "mongo/db/jsobj.h"
namespace mongo {
namespace scram {
-// Convert a SHA1Hash into a base64 encoded string.
-std::string hashToBase64(const SecureHandle<SHA1Hash>& hash);
const std::string serverKeyConst = "Server Key";
const std::string clientKeyConst = "Client Key";
@@ -74,16 +72,16 @@ inline bool operator==(const SCRAMPresecrets& lhs, const SCRAMPresecrets& rhs) {
/*
* Computes the SaltedPassword from password, salt and iterationCount.
*/
-SHA1Hash generateSaltedPassword(const SCRAMPresecrets& presecrets);
+SHA1Block generateSaltedPassword(const SCRAMPresecrets& presecrets);
/*
* Stores all of the keys, generated from a password, needed for a client or server to perform a
* SCRAM handshake. This structure will secureZeroMemory itself on destruction.
*/
struct SCRAMSecrets {
- SecureHandle<SHA1Hash> clientKey;
- SecureHandle<SHA1Hash> storedKey;
- SecureHandle<SHA1Hash> serverKey;
+ SecureHandle<SHA1Block> clientKey;
+ SecureHandle<SHA1Block> storedKey;
+ SecureHandle<SHA1Block> serverKey;
};
/*
@@ -95,7 +93,7 @@ SCRAMSecrets generateSecrets(const SCRAMPresecrets& presecrets);
/*
* Computes the ClientKey and StoredKey from SaltedPassword (client side).
*/
-SCRAMSecrets generateSecrets(const SHA1Hash& saltedPassword);
+SCRAMSecrets generateSecrets(const SHA1Block& saltedPassword);
/*
* Generates the user salt and the SCRAM secrets storedKey and serverKey as