private ISaslStep Transition( SaslConversation conversation, ISaslStep currentStep, BsonDocument result, out BsonDocument command) { // we might be done here if the client is not expecting a reply from the server if (result.GetValue("done", false).ToBoolean() && currentStep.IsComplete) { command = null; return(null); } currentStep = currentStep.Transition(conversation, result["payload"].AsByteArray); // we might be done here if the client had some final verification it needed to do if (result.GetValue("done", false).ToBoolean() && currentStep.IsComplete) { command = null; return(null); } command = CreateContinueCommand(currentStep, result); return(currentStep); }
private protected override BsonDocument CreateStartCommand(ISaslStep currentStep) { var startCommand = base.CreateStartCommand(currentStep); startCommand.Add("options", new BsonDocument("skipEmptyExchange", true)); return(startCommand); }
private BsonDocument CreateContinueCommand(ISaslStep currentStep, BsonDocument result) { return(new BsonDocument { { "saslContinue", 1 }, { "conversationId", result["conversationId"].AsInt32 }, { "payload", currentStep.BytesToSendToServer } }); }
private BsonDocument CreateStartCommand(ISaslStep currentStep) { return(new BsonDocument { { "saslStart", 1 }, { "mechanism", _mechanism.Name }, { "payload", currentStep.BytesToSendToServer } }); }
private protected virtual BsonDocument CreateStartCommand(ISaslStep currentStep) { var startCommand = new BsonDocument { { "saslStart", 1 }, { "mechanism", _mechanism.Name }, { "payload", currentStep.BytesToSendToServer } }; return(startCommand); }
public AuthenticationState GenericTest(ISaslStep clientStep, ISaslStep serverStep) { if (clientStep.BytesToSend != null) serverStep = serverStep.Next(clientStep.BytesToSend); while (clientStep.State == AuthenticationState.Pending && serverStep.State == AuthenticationState.Pending) { clientStep = clientStep.Next(serverStep.BytesToSend); serverStep = serverStep.Next(clientStep.BytesToSend); } return serverStep.State; }
public AuthenticationState GenericTest(ISaslStep clientStep, ISaslStep serverStep) { if (clientStep.BytesToSend != null) { serverStep = serverStep.Next(clientStep.BytesToSend); } while (clientStep.State == AuthenticationState.Pending && serverStep.State == AuthenticationState.Pending) { clientStep = clientStep.Next(serverStep.BytesToSend); serverStep = serverStep.Next(clientStep.BytesToSend); } return(serverStep.State); }
private BsonDocument CreateStartCommand(ISaslStep currentStep) { var startCommand = new BsonDocument { { "saslStart", 1 }, { "mechanism", _mechanism.Name }, { "payload", currentStep.BytesToSendToServer } }; if (_mechanism.Name.StartsWith("SCRAM", StringComparison.OrdinalIgnoreCase)) { startCommand.Add("options", new BsonDocument("skipEmptyExchange", true)); } return(startCommand); }
protected CramMd5(ISaslStep initialStep) { InitialStep = initialStep; }
protected ScramSha1(ISaslStep initialStep) { InitialStep = initialStep; }
private BsonDocument CreateStartCommand(ISaslStep currentStep) { return new BsonDocument { { "saslStart", 1 }, { "mechanism", _mechanism.Name }, { "payload", currentStep.BytesToSendToServer } }; }
private BsonDocument CreateContinueCommand(ISaslStep currentStep, BsonDocument result) { return new BsonDocument { { "saslContinue", 1 }, { "conversationId", result["conversationId"].AsInt32 }, { "payload", currentStep.BytesToSendToServer } }; }
protected Plain(ISaslStep initialStep) { InitialStep = initialStep; }
private ISaslStep Transition(SaslConversation conversation, ISaslStep currentStep, BsonDocument result) { // we might be done here if the client is not expecting a reply from the server if (result.GetValue("done", false).ToBoolean() && currentStep.IsComplete) { return null; } currentStep = currentStep.Transition(conversation, result["payload"].AsByteArray); // we might be done here if the client had some final verification it needed to do if (result.GetValue("done", false).ToBoolean() && currentStep.IsComplete) { return null; } return currentStep; }
protected Login(ISaslStep initialStep) { InitialStep = initialStep; }