Commit 465919ea authored by Zentaro Kavanagh's avatar Zentaro Kavanagh Committed by Commit Bot

NTLM: Always default NTLM to NTLMv2.

- This fixes that Android WebView did not default to NTLMv2
- This was changed already for all other platforms but it did not
  take effect on WebView.
- Sets the default value of ntlm_v2_enable_ to true in HttpAuthPreferences
- Previously the default was changed in flags, but it did not apply when
  a default HttpAuthPreferences was created, but no flags/features
  are overriden.

BUG=chromium:830542,chromium:22532
TEST=unittests

Change-Id: If660a9b5ab3a23735407468b30ee0f58aff5ce6c
Reviewed-on: https://chromium-review.googlesource.com/1030250
Commit-Queue: Zentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554873}
parent 800404b5
...@@ -31,6 +31,11 @@ class HttpAuthHandlerNtlmPortableTest : public PlatformTest { ...@@ -31,6 +31,11 @@ class HttpAuthHandlerNtlmPortableTest : public PlatformTest {
// Test input value defined in [MS-NLMP] Section 4.2.1. // Test input value defined in [MS-NLMP] Section 4.2.1.
HttpAuthHandlerNtlmPortableTest() { HttpAuthHandlerNtlmPortableTest() {
http_auth_preferences_.reset(new MockAllowHttpAuthPreferences()); http_auth_preferences_.reset(new MockAllowHttpAuthPreferences());
// Disable NTLMv2 for this end to end test because it's not possible
// to mock all the required dependencies for NTLMv2 from here. These
// tests are only of the overall flow, and the detailed tests of the
// contents of the protocol messages are in ntlm_client_unittest.cc
http_auth_preferences_->set_ntlm_v2_enabled(false);
factory_.reset(new HttpAuthHandlerNTLM::Factory()); factory_.reset(new HttpAuthHandlerNTLM::Factory());
factory_->set_http_auth_preferences(http_auth_preferences_.get()); factory_->set_http_auth_preferences(http_auth_preferences_.get());
creds_ = AuthCredentials( creds_ = AuthCredentials(
......
...@@ -44,7 +44,7 @@ HttpAuthPreferences::HttpAuthPreferences( ...@@ -44,7 +44,7 @@ HttpAuthPreferences::HttpAuthPreferences(
negotiate_disable_cname_lookup_(false), negotiate_disable_cname_lookup_(false),
negotiate_enable_port_(false), negotiate_enable_port_(false),
#if defined(OS_POSIX) #if defined(OS_POSIX)
ntlm_v2_enabled_(false), ntlm_v2_enabled_(true),
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
allow_gssapi_library_load_(allow_gssapi_library_load), allow_gssapi_library_load_(allow_gssapi_library_load),
......
...@@ -41,11 +41,11 @@ TEST(HttpAuthPreferencesTest, NegotiateEnablePort) { ...@@ -41,11 +41,11 @@ TEST(HttpAuthPreferencesTest, NegotiateEnablePort) {
} }
#if defined(OS_POSIX) #if defined(OS_POSIX)
TEST(HttpAuthPreferencesTest, EnableNtlmV2) { TEST(HttpAuthPreferencesTest, DisableNtlmV2) {
HttpAuthPreferences http_auth_preferences; HttpAuthPreferences http_auth_preferences;
EXPECT_FALSE(http_auth_preferences.NtlmV2Enabled());
http_auth_preferences.set_ntlm_v2_enabled(true);
EXPECT_TRUE(http_auth_preferences.NtlmV2Enabled()); EXPECT_TRUE(http_auth_preferences.NtlmV2Enabled());
http_auth_preferences.set_ntlm_v2_enabled(false);
EXPECT_FALSE(http_auth_preferences.NtlmV2Enabled());
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment