private bool AuthenticateContinue()
{
for (;;)
{
// We don't need credential on the continued auth assuming they were captured on the first call.
// That should always work, otherwise what if a new credential has been returned?
Authorization auth = _connection._authenticationModules[_currentModule].Authenticate(_authResponse, null, _connection, _connection._client.TargetName, _connection._channelBindingToken);
if (auth == null)
{
throw new SmtpException(SR.Format(SR.SmtpAuthenticationFailed));
}
IAsyncResult result = AuthCommand.BeginSend(_connection, auth.Message, s_authenticateContinueCallback, this);
if (!result.CompletedSynchronously)
{
return false;
}
LineInfo info = AuthCommand.EndSend(result);
if ((int)info.StatusCode == 235)
{
_connection._authenticationModules[_currentModule].CloseContext(_connection);
_connection._isConnected = true;
InvokeCallback();
return false;
}
else if ((int)info.StatusCode != 334)
{
return true;
}
_authResponse = info.Line;
}
}