fix: default to NTLM v2 in the network service for POSIX platforms (#23846)
* fix: default to NTLM v2 in the network service * chore: update patch details
This commit is contained in:
parent
c36981da8b
commit
512e1541c6
7 changed files with 35 additions and 2 deletions
|
@ -576,12 +576,14 @@ v8::Local<v8::Promise> Session::ClearAuthCache() {
|
|||
}
|
||||
|
||||
void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params =
|
||||
network::mojom::HttpAuthDynamicParams::New();
|
||||
auth_dynamic_params->server_allowlist = domains;
|
||||
auth_dynamic_params->enable_negotiate_port =
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
electron::switches::kEnableAuthNegotiatePort);
|
||||
command_line->HasSwitch(electron::switches::kEnableAuthNegotiatePort);
|
||||
auth_dynamic_params->ntlm_v2_enabled =
|
||||
!command_line->HasSwitch(electron::switches::kDisableNTLMv2);
|
||||
content::GetNetworkService()->ConfigureHttpAuthPrefs(
|
||||
std::move(auth_dynamic_params));
|
||||
}
|
||||
|
|
|
@ -53,6 +53,8 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams() {
|
|||
electron::switches::kAuthNegotiateDelegateWhitelist);
|
||||
auth_dynamic_params->enable_negotiate_port =
|
||||
command_line->HasSwitch(electron::switches::kEnableAuthNegotiatePort);
|
||||
auth_dynamic_params->ntlm_v2_enabled =
|
||||
!command_line->HasSwitch(electron::switches::kDisableNTLMv2);
|
||||
|
||||
return auth_dynamic_params;
|
||||
}
|
||||
|
|
|
@ -278,6 +278,9 @@ const char kAuthNegotiateDelegateWhitelist[] =
|
|||
// If set, include the port in generated Kerberos SPNs.
|
||||
const char kEnableAuthNegotiatePort[] = "enable-auth-negotiate-port";
|
||||
|
||||
// If set, NTLM v2 is disabled for POSIX platforms.
|
||||
const char kDisableNTLMv2[] = "disable-ntlm-v2";
|
||||
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
const char kEnableSpellcheck[] = "enable-spellcheck";
|
||||
#endif
|
||||
|
|
|
@ -140,6 +140,7 @@ extern const char kIgnoreConnectionsLimit[];
|
|||
extern const char kAuthServerWhitelist[];
|
||||
extern const char kAuthNegotiateDelegateWhitelist[];
|
||||
extern const char kEnableAuthNegotiatePort[];
|
||||
extern const char kDisableNTLMv2[];
|
||||
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
extern const char kEnableSpellcheck[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue