Verified Commit 8864d886 authored by valenting's avatar valenting Committed by ma1
Browse files

Bug 2070633 - Only allow setting nsIHttpChannel.allowSTS in parent process a=diannaS DONTBUILD

Removes the flag from IPC arguments.
It is now only honored in the parent process. Currently used by
captive portal service and OCSP checks.

Original Revision: https://phabricator.services.mozilla.com/D326843

Differential Revision: https://phabricator.services.mozilla.com/D328422
parent 3dfae51e
Loading
Loading
Loading
Loading
+0 −1
Changes for netwerk/ipc/NeckoChannelParams.ipdlh: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -383,7 +383,6 @@ struct HttpChannelOpenArgs
  uint32_t                    redirectMode;
  int16_t                     priority;
  bool                        uploadStreamHasHeaders;
  bool                        allowSTS;
  bool                        resumeAt;
  bool                        allowSpdy;
  bool                        allowHttp3;
+6 −1
Changes for netwerk/protocol/http/HttpBaseChannel.cpp: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2143,6 +2143,12 @@ HttpBaseChannel::GetAllowSTS(bool* value) {

NS_IMETHODIMP
HttpBaseChannel::SetAllowSTS(bool value) {
  // This controls whether the parent process honors HSTS for this channel, so
  // it must not be settable from a content process.
  if (!XRE_IsParentProcess()) {
    MOZ_ASSERT(value == true, "allowSTS = false is parent process only");
    return NS_OK;
  }
  ENSURE_CALLED_BEFORE_CONNECT();
  StoreAllowSTS(value);
  return NS_OK;
@@ -5144,7 +5150,6 @@ nsresult HttpBaseChannel::SetupReplacementChannel(nsIURI* newURI,
    }
  }

  // convey the LoadAllowSTS() flags
  rv = httpChannel->SetAllowSTS(LoadAllowSTS());
  MOZ_ASSERT(NS_SUCCEEDED(rv));

+0 −1
Changes for netwerk/protocol/http/HttpChannelChild.cpp: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2422,7 +2422,6 @@ nsresult HttpChannelChild::ContinueAsyncOpen() {
  openArgs.priority() = mPriority;
  openArgs.classOfService() = mClassOfService;
  openArgs.redirectionLimit() = mRedirectionLimit;
  openArgs.allowSTS() = LoadAllowSTS();
  openArgs.thirdPartyFlags() = LoadThirdPartyFlags();
  openArgs.resumeAt() = mSendResumeAt;
  openArgs.startPos() = mStartPos;
+7 −9
Changes for netwerk/protocol/http/HttpChannelParent.cpp: 7 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ bool HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs) {
          a.uri(), a.original(), a.doc(), a.referrerInfo(), a.apiRedirectTo(),
          a.topWindowURI(), a.loadFlags(), a.requestHeaders(),
          a.requestMethod(), a.uploadStream(), a.uploadStreamHasHeaders(),
          a.priority(), a.classOfService(), a.redirectionLimit(), a.allowSTS(),
          a.priority(), a.classOfService(), a.redirectionLimit(),
          a.thirdPartyFlags(), a.resumeAt(), a.startPos(), a.entityID(),
          a.allowSpdy(), a.allowHttp3(), a.allowAltSvc(), a.beConservative(),
          a.bypassProxy(), a.tlsFlags(), a.loadInfo(), a.cacheKey(),
@@ -428,13 +428,12 @@ bool HttpChannelParent::DoAsyncOpen(
    const RequestHeaderTuples& requestHeaders, const nsCString& requestMethod,
    const Maybe<IPCStream>& uploadStream, const bool& uploadStreamHasHeaders,
    const int16_t& priority, const ClassOfService& classOfService,
    const uint8_t& redirectionLimit, const bool& allowSTS,
    const uint32_t& thirdPartyFlags, const bool& doResumeAt,
    const uint64_t& startPos, const nsCString& entityID, const bool& allowSpdy,
    const bool& allowHttp3, const bool& allowAltSvc, const bool& beConservative,
    const bool& bypassProxy, const uint32_t& tlsFlags,
    const LoadInfoArgs& aLoadInfoArgs, const uint32_t& aCacheKey,
    const uint64_t& aRequestContextID,
    const uint8_t& redirectionLimit, const uint32_t& thirdPartyFlags,
    const bool& doResumeAt, const uint64_t& startPos, const nsCString& entityID,
    const bool& allowSpdy, const bool& allowHttp3, const bool& allowAltSvc,
    const bool& beConservative, const bool& bypassProxy,
    const uint32_t& tlsFlags, const LoadInfoArgs& aLoadInfoArgs,
    const uint32_t& aCacheKey, const uint64_t& aRequestContextID,
    const Maybe<CorsPreflightArgs>& aCorsPreflightArgs,
    const uint32_t& aInitialRwin, const bool& aBlockAuthPrompt,
    const bool& aAllowStaleCacheContent, const bool& aPreferCacheLoadOverBypass,
@@ -638,7 +637,6 @@ bool HttpChannelParent::DoAsyncOpen(
    httpChannel->SetClassOfService(classOfService);
  }
  httpChannel->SetRedirectionLimit(redirectionLimit);
  httpChannel->SetAllowSTS(allowSTS);
  httpChannel->SetThirdPartyFlags(thirdPartyFlags);
  httpChannel->SetAllowSpdy(allowSpdy);
  httpChannel->SetAllowHttp3(allowHttp3);
+7 −7
Changes for netwerk/protocol/http/HttpChannelParent.h: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -146,13 +146,13 @@ class HttpChannelParent final : public nsIInterfaceRequestor,
      const RequestHeaderTuples& requestHeaders, const nsCString& requestMethod,
      const Maybe<IPCStream>& uploadStream, const bool& uploadStreamHasHeaders,
      const int16_t& priority, const ClassOfService& classOfService,
      const uint8_t& redirectionLimit, const bool& allowSTS,
      const uint32_t& thirdPartyFlags, const bool& doResumeAt,
      const uint64_t& startPos, const nsCString& entityID,
      const bool& allowSpdy, const bool& allowHttp3, const bool& allowAltSvc,
      const bool& beConservative, const bool& bypassProxy,
      const uint32_t& tlsFlags, const LoadInfoArgs& aLoadInfoArgs,
      const uint32_t& aCacheKey, const uint64_t& aRequestContextID,
      const uint8_t& redirectionLimit, const uint32_t& thirdPartyFlags,
      const bool& doResumeAt, const uint64_t& startPos,
      const nsCString& entityID, const bool& allowSpdy, const bool& allowHttp3,
      const bool& allowAltSvc, const bool& beConservative,
      const bool& bypassProxy, const uint32_t& tlsFlags,
      const LoadInfoArgs& aLoadInfoArgs, const uint32_t& aCacheKey,
      const uint64_t& aRequestContextID,
      const Maybe<CorsPreflightArgs>& aCorsPreflightArgs,
      const uint32_t& aInitialRwin, const bool& aBlockAuthPrompt,
      const bool& aAllowStaleCacheContent,
Loading