summaryrefslogtreecommitdiff
path: root/src/mongo/crypto
diff options
context:
space:
mode:
authorAmalia Hawkins <amalia.hawkins@10gen.com>2014-10-03 14:10:58 -0400
committerAmalia Hawkins <amalia.hawkins@10gen.com>2014-10-10 15:07:27 -0400
commitbf48f38d12d8f9c28e91f78c9830371a50650f43 (patch)
tree57daf952e2f437e3ae881ed68309365508639ab4 /src/mongo/crypto
parent8239bdb62f317260ac993665a4a681d95124a91e (diff)
downloadmongo-bf48f38d12d8f9c28e91f78c9830371a50650f43.tar.gz
SERVER-15198 Make scramIterationCount user configurable
Diffstat (limited to 'src/mongo/crypto')
-rw-r--r--src/mongo/crypto/mechanism_scram.cpp4
-rw-r--r--src/mongo/crypto/mechanism_scram.h2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/crypto/mechanism_scram.cpp b/src/mongo/crypto/mechanism_scram.cpp
index 1b6eaf88ea9..d77a0c72b85 100644
--- a/src/mongo/crypto/mechanism_scram.cpp
+++ b/src/mongo/crypto/mechanism_scram.cpp
@@ -139,10 +139,8 @@ namespace scram {
&hashLen));
}
- BSONObj generateCredentials(const std::string& hashedPassword) {
+ BSONObj generateCredentials(const std::string& hashedPassword, int iterationCount) {
- // TODO: configure the default iteration count via setParameter
- const int iterationCount = 10;
const int saltLenQWords = 2;
// Generate salt
diff --git a/src/mongo/crypto/mechanism_scram.h b/src/mongo/crypto/mechanism_scram.h
index fc6da4aea9c..19d7e2b1c8b 100644
--- a/src/mongo/crypto/mechanism_scram.h
+++ b/src/mongo/crypto/mechanism_scram.h
@@ -69,7 +69,7 @@ namespace scram {
* Generates the user salt and the SCRAM secrets storedKey and serverKey as
* defined in RFC5802 (server side).
*/
- BSONObj generateCredentials(const std::string& hashedPassword);
+ BSONObj generateCredentials(const std::string& hashedPassword, int iterationCount);
/*
* Computes the ClientProof from SaltedPassword and authMessage (client side).