MongoDB C++ Driver legacy-1.0.5
Loading...
Searching...
No Matches
sasl_scramsha1_client_conversation.h
1/*
2 * Copyright (C) 2014 MongoDB Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <string>
20#include <vector>
21
22#include "mongo/base/disallow_copying.h"
23#include "mongo/base/status.h"
24#include "mongo/base/string_data.h"
25#include "mongo/client/sasl_client_conversation.h"
26#include "mongo/crypto/mechanism_scram.h"
27
28namespace mongo {
33 MONGO_DISALLOW_COPYING(SaslSCRAMSHA1ClientConversation);
34 public:
39
41
49 virtual StatusWith<bool> step(const StringData& inputData, std::string* outputData);
50
51 private:
55 StatusWith<bool> _firstStep(std::string* outputData);
56
60 StatusWith<bool> _secondStep(const std::vector<std::string>& input, std::string* outputData);
61
65 StatusWith<bool> _thirdStep(const std::vector<std::string>& input, std::string* outputData);
66
67 int _step;
68 std::string _authMessage;
69 unsigned char _saltedPassword[scram::hashSize];
70
71 // client and server nonce concatenated
72 std::string _clientNonce;
73 };
74
75} // namespace mongo
Abstract class for implementing the clent-side of a SASL mechanism conversation.
Definition sasl_client_conversation.h:33
Base class for the client side of a SASL authentication conversation.
Definition sasl_client_session.h:42
Client side authentication session for SASL PLAIN.
Definition sasl_scramsha1_client_conversation.h:32
virtual StatusWith< bool > step(const StringData &inputData, std::string *outputData)
Takes one step in a SCRAM-SHA-1 conversation.
SaslSCRAMSHA1ClientConversation(SaslClientSession *saslClientSession)
Implements the client side of a SASL PLAIN mechanism session.
Definition sasl_client_conversation.h:27
the main MongoDB namespace
Definition bulk_operation_builder.h:24