summaryrefslogtreecommitdiff
path: root/netwerk/base
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-05-30 12:47:56 +0200
committerGitHub <noreply@github.com>2018-05-30 12:47:56 +0200
commit9f6194d00034f0bd67d2b8c97fd26586d2a7a9ed (patch)
tree7512b05f873bcfe8d0f79c34370d0bebad70a07f /netwerk/base
parent6e8846622a79549542adaca58d741d9263daf686 (diff)
parentbd851735628cd6b07285e87fa60081e9d11a3b7e (diff)
downloaduxp-9f6194d00034f0bd67d2b8c97fd26586d2a7a9ed.tar.gz
Merge pull request #412 from g4jc/hsts_priming_removal_backport
Remove support and tests for HSTS priming from the tree. Fixes #384
Diffstat (limited to 'netwerk/base')
-rw-r--r--netwerk/base/LoadInfo.cpp40
-rw-r--r--netwerk/base/LoadInfo.h7
-rw-r--r--netwerk/base/nsILoadInfo.idl26
3 files changed, 2 insertions, 71 deletions
diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp
index ede825b8f9..a8c9a5a250 100644
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -67,8 +67,6 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
, mForcePreflight(false)
, mIsPreflight(false)
, mLoadTriggeredFromExternal(false)
- , mForceHSTSPriming(false)
- , mMixedContentWouldBlock(false)
{
MOZ_ASSERT(mLoadingPrincipal);
MOZ_ASSERT(mTriggeringPrincipal);
@@ -243,8 +241,6 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow,
, mForcePreflight(false)
, mIsPreflight(false)
, mLoadTriggeredFromExternal(false)
- , mForceHSTSPriming(false)
- , mMixedContentWouldBlock(false)
{
// Top-level loads are never third-party
// Grab the information we can out of the window.
@@ -308,8 +304,6 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
, mForcePreflight(rhs.mForcePreflight)
, mIsPreflight(rhs.mIsPreflight)
, mLoadTriggeredFromExternal(rhs.mLoadTriggeredFromExternal)
- , mForceHSTSPriming(rhs.mForceHSTSPriming)
- , mMixedContentWouldBlock(rhs.mMixedContentWouldBlock)
{
}
@@ -337,9 +331,7 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
const nsTArray<nsCString>& aCorsUnsafeHeaders,
bool aForcePreflight,
bool aIsPreflight,
- bool aLoadTriggeredFromExternal,
- bool aForceHSTSPriming,
- bool aMixedContentWouldBlock)
+ bool aLoadTriggeredFromExternal)
: mLoadingPrincipal(aLoadingPrincipal)
, mTriggeringPrincipal(aTriggeringPrincipal)
, mPrincipalToInherit(aPrincipalToInherit)
@@ -363,8 +355,6 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
, mForcePreflight(aForcePreflight)
, mIsPreflight(aIsPreflight)
, mLoadTriggeredFromExternal(aLoadTriggeredFromExternal)
- , mForceHSTSPriming (aForceHSTSPriming)
- , mMixedContentWouldBlock(aMixedContentWouldBlock)
{
// Only top level TYPE_DOCUMENT loads can have a null loadingPrincipal
MOZ_ASSERT(mLoadingPrincipal || aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT);
@@ -933,34 +923,6 @@ LoadInfo::GetLoadTriggeredFromExternal(bool* aLoadTriggeredFromExternal)
}
NS_IMETHODIMP
-LoadInfo::GetForceHSTSPriming(bool* aForceHSTSPriming)
-{
- *aForceHSTSPriming = mForceHSTSPriming;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LoadInfo::GetMixedContentWouldBlock(bool *aMixedContentWouldBlock)
-{
- *aMixedContentWouldBlock = mMixedContentWouldBlock;
- return NS_OK;
-}
-
-void
-LoadInfo::SetHSTSPriming(bool aMixedContentWouldBlock)
-{
- mForceHSTSPriming = true;
- mMixedContentWouldBlock = aMixedContentWouldBlock;
-}
-
-void
-LoadInfo::ClearHSTSPriming()
-{
- mForceHSTSPriming = false;
- mMixedContentWouldBlock = false;
-}
-
-NS_IMETHODIMP
LoadInfo::GetTainting(uint32_t* aTaintingOut)
{
MOZ_ASSERT(aTaintingOut);
diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h
index 0ae6061b3e..2b1e8c9e8e 100644
--- a/netwerk/base/LoadInfo.h
+++ b/netwerk/base/LoadInfo.h
@@ -111,9 +111,7 @@ private:
const nsTArray<nsCString>& aUnsafeHeaders,
bool aForcePreflight,
bool aIsPreflight,
- bool aLoadTriggeredFromExternal,
- bool aForceHSTSPriming,
- bool aMixedContentWouldBlock);
+ bool aLoadTriggeredFromExternal);
LoadInfo(const LoadInfo& rhs);
friend nsresult
@@ -159,9 +157,6 @@ private:
bool mForcePreflight;
bool mIsPreflight;
bool mLoadTriggeredFromExternal;
-
- bool mForceHSTSPriming : 1;
- bool mMixedContentWouldBlock : 1;
};
} // namespace net
diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl
index 4ec29b9725..9a883ff989 100644
--- a/netwerk/base/nsILoadInfo.idl
+++ b/netwerk/base/nsILoadInfo.idl
@@ -671,32 +671,6 @@ interface nsILoadInfo : nsISupports
[infallible] readonly attribute boolean isPreflight;
/**
- * When this request would be mixed-content and we do not have an
- * entry in the HSTS cache, we send an HSTS priming request to
- * determine if it is ok to upgrade the request to HTTPS.
- */
- /**
- * True if this is a mixed-content load and HSTS priming request will be sent.
- */
- [noscript, infallible] readonly attribute boolean forceHSTSPriming;
- /**
- * Carry the decision whether this load would be blocked by mixed content so
- * that if HSTS priming fails, the correct decision can be made.
- */
- [noscript, infallible] readonly attribute boolean mixedContentWouldBlock;
-
- /**
- * Mark this LoadInfo as needing HSTS Priming
- *
- * @param wouldBlock Carry the decision of Mixed Content Blocking to be
- * applied when HSTS priming is complete.
- */
- [noscript, notxpcom, nostdcall]
- void setHSTSPriming(in boolean mixeContentWouldBlock);
- [noscript, notxpcom, nostdcall]
- void clearHSTSPriming();
-
- /**
* Constants reflecting the channel tainting. These are mainly defined here
* for script. Internal C++ code should use the enum defined in LoadTainting.h.
* See LoadTainting.h for documentation.