diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 15:43:51 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 15:43:51 -0500 |
commit | b0e23e79e72b7892b826fabea4f9e02c421d2861 (patch) | |
tree | 26f20aea660514c213a3ae942eab222e5ccebde3 /netwerk | |
parent | 03590a6711d601ef3ddb48787e9f3f556705b5db (diff) | |
parent | b00601953bade944cd6df9cde6fcdd1f10d76feb (diff) | |
download | UXP-b0e23e79e72b7892b826fabea4f9e02c421d2861.tar UXP-b0e23e79e72b7892b826fabea4f9e02c421d2861.tar.gz UXP-b0e23e79e72b7892b826fabea4f9e02c421d2861.tar.lz UXP-b0e23e79e72b7892b826fabea4f9e02c421d2861.tar.xz UXP-b0e23e79e72b7892b826fabea4f9e02c421d2861.zip |
Merge branch 'master' into mailnews-work
Diffstat (limited to 'netwerk')
-rw-r--r-- | netwerk/protocol/http/nsHttpChannelAuthProvider.cpp | 15 | ||||
-rw-r--r-- | netwerk/protocol/http/nsHttpChannelAuthProvider.h | 3 |
2 files changed, 15 insertions, 3 deletions
diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index a6681cfc6..1b25afe64 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -96,6 +96,7 @@ uint32_t nsHttpChannelAuthProvider::sAuthAllowPref = SUBRESOURCE_AUTH_DIALOG_ALLOW_ALL; bool nsHttpChannelAuthProvider::sImgCrossOriginAuthAllowPref = false; +bool nsHttpChannelAuthProvider::sConfirmAuthPref = false; void nsHttpChannelAuthProvider::InitializePrefs() @@ -107,6 +108,9 @@ nsHttpChannelAuthProvider::InitializePrefs() mozilla::Preferences::AddBoolVarCache(&sImgCrossOriginAuthAllowPref, "network.auth.subresource-http-img-XO-auth", false); + mozilla::Preferences::AddBoolVarCache(&sConfirmAuthPref, + "network.auth.confirmAuth.enabled", + false); } NS_IMETHODIMP @@ -1450,10 +1454,15 @@ nsHttpChannelAuthProvider::ConfirmAuth(const nsString &bundleKey, bool doYesNoPrompt) { // skip prompting the user if - // 1) we've already prompted the user - // 2) we're not a toplevel channel - // 3) the userpass length is less than the "phishy" threshold + // 1) prompts are disabled by preference + // 2) we've already prompted the user + // 3) we're not a toplevel channel + // 4) the userpass length is less than the "phishy" threshold + if (!sConfirmAuthPref) { + return true; + } + uint32_t loadFlags; nsresult rv = mAuthChannel->GetLoadFlags(&loadFlags); if (NS_FAILED(rv)) diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.h b/netwerk/protocol/http/nsHttpChannelAuthProvider.h index 0d6045875..18172e60f 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.h +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.h @@ -185,6 +185,9 @@ private: static uint32_t sAuthAllowPref; static bool sImgCrossOriginAuthAllowPref; nsCOMPtr<nsICancelable> mGenerateCredentialsCancelable; + + // Variable holding the preference for anti-spoof auth confirmation prompts. + static bool sConfirmAuthPref; }; } // namespace net |