summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/security_key.cpp
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2017-12-08 19:00:43 -0500
committerSara Golemon <sara.golemon@mongodb.com>2017-12-19 00:31:11 -0500
commit5a781806537d7710c3b895e450df2307b8861b69 (patch)
tree5d61ce68b1b869b460e426aa7ca1b16620bc514c /src/mongo/db/auth/security_key.cpp
parenta5463eebace42e0970cdb28507d6b00d1c982f18 (diff)
downloadmongo-5a781806537d7710c3b895e450df2307b8861b69.tar.gz
SERVER-32231 Remove MONGODB-CR
Diffstat (limited to 'src/mongo/db/auth/security_key.cpp')
-rw-r--r--src/mongo/db/auth/security_key.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/auth/security_key.cpp b/src/mongo/db/auth/security_key.cpp
index 8e1dfe46e00..f9d0445e65f 100644
--- a/src/mongo/db/auth/security_key.cpp
+++ b/src/mongo/db/auth/security_key.cpp
@@ -70,14 +70,14 @@ bool setUpSecurityKey(const string& filename) {
return false;
}
- // Generate MONGODB-CR and SCRAM credentials for the internal user based on
+ // Generate SCRAM-SHA-1 credentials for the internal user based on
// the keyfile.
User::CredentialData credentials;
- credentials.password =
+ const auto password =
mongo::createPasswordDigest(internalSecurity.user->getName().getUser().toString(), str);
- BSONObj creds = scram::generateCredentials(credentials.password,
- saslGlobalParams.scramIterationCount.load());
+ BSONObj creds =
+ scram::generateCredentials(password, saslGlobalParams.scramIterationCount.load());
credentials.scram.iterationCount = creds[scram::iterationCountFieldName].Int();
credentials.scram.salt = creds[scram::saltFieldName].String();
credentials.scram.storedKey = creds[scram::storedKeyFieldName].String();
@@ -94,7 +94,7 @@ bool setUpSecurityKey(const string& filename) {
<< saslCommandUserFieldName
<< internalSecurity.user->getName().getUser()
<< saslCommandPasswordFieldName
- << credentials.password
+ << password
<< saslCommandDigestPasswordFieldName
<< false));
}