diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-08-27 17:20:19 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-08-29 17:03:18 -0400 |
commit | bfdd9917c2e2dea22a6673d45d10882d1d567362 (patch) | |
tree | 152caeb749e0bebee61e3cbff882f77417449572 /src/mongo/client/sasl_client_authenticate_impl.cpp | |
parent | 794646c2028da8cc4ea9db1ffd22eb1f8f2cedde (diff) | |
download | mongo-bfdd9917c2e2dea22a6673d45d10882d1d567362.tar.gz |
Create place for auth functions in client code and move password hashing there
Diffstat (limited to 'src/mongo/client/sasl_client_authenticate_impl.cpp')
-rw-r--r-- | src/mongo/client/sasl_client_authenticate_impl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/client/sasl_client_authenticate_impl.cpp b/src/mongo/client/sasl_client_authenticate_impl.cpp index 7cf9b9f52b3..83e0c5ebdd0 100644 --- a/src/mongo/client/sasl_client_authenticate_impl.cpp +++ b/src/mongo/client/sasl_client_authenticate_impl.cpp @@ -27,6 +27,7 @@ #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/bson/util/bson_extract.h" +#include "mongo/client/auth_helpers.h" #include "mongo/client/sasl_client_authenticate.h" #include "mongo/client/sasl_client_session.h" #include "mongo/platform/cstdint.h" @@ -57,15 +58,14 @@ namespace { * Gets the password data from "saslParameters" and stores it to "outPassword". * * If "digestPassword" indicates that the password needs to be "digested" via - * DBClientWithCommands::createPasswordDigest(), this method takes care of that. + * auth::createPasswordDigest(), this method takes care of that. * On success, the value of "*outPassword" is always the correct value to set * as the password on the SaslClientSession. * * Returns Status::OK() on success, and ErrorCodes::NoSuchKey if the password data is not * present in "saslParameters". Other ErrorCodes returned indicate other errors. */ - Status extractPassword(DBClientWithCommands* client, - const BSONObj& saslParameters, + Status extractPassword(const BSONObj& saslParameters, bool digestPassword, std::string* outPassword) { @@ -84,7 +84,7 @@ namespace { if (!status.isOK()) return status; - *outPassword = client->createPasswordDigest(user, rawPassword); + *outPassword = auth::createPasswordDigest(user, rawPassword); } else { *outPassword = rawPassword; @@ -148,7 +148,7 @@ namespace { if (!status.isOK()) return status; - status = extractPassword(client, saslParameters, digestPassword, &value); + status = extractPassword(saslParameters, digestPassword, &value); if (status.isOK()) { session->setParameter(SaslClientSession::parameterPassword, value); } |