Skip to content

Commit

Permalink
fixup! Bug 13670.2: Isolate OCSP requests by first party domain
Browse files Browse the repository at this point in the history
  • Loading branch information
arthuredelstein committed Jun 25, 2015
1 parent 5602274 commit c95f25a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
9 changes: 9 additions & 0 deletions dom/base/ThirdPartyUtil.cpp
Expand Up @@ -171,7 +171,16 @@ ThirdPartyUtil::GetOriginatingURI(nsIChannel *aChannel, nsIURI **aURI)

// case 3)
if (!topWin)
{
if (httpChannelInternal)
{
httpChannelInternal->GetDocumentURI(aURI);
if (*aURI) {
return NS_OK;
}
}
return NS_ERROR_INVALID_ARG;
}

// case 4)
if (ourWin == topWin) {
Expand Down
2 changes: 1 addition & 1 deletion netwerk/base/nsISocketTransport.idl
Expand Up @@ -28,7 +28,7 @@ native NetAddr(mozilla::net::NetAddr);
* NOTE: This is a free-threaded interface, meaning that the methods on
* this interface may be called from any thread.
*/
[scriptable, uuid(a0b3b547-d6f0-4b65-a3de-a99ffa368840)]
[scriptable, uuid(4e2dc9d0-125e-4f8e-8c93-845f3de5cd8a)]
interface nsISocketTransport : nsITransport
{
/**
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/http/nsHttpConnectionMgr.cpp
Expand Up @@ -1327,7 +1327,7 @@ nsHttpConnectionMgr::PipelineFeedbackInfo(nsHttpConnectionInfo *ci,
}

void
nsHttpConnectionMgr::ReportFailedToProcess(nsIURI *uri, const nsACString& isolationDomain)
nsHttpConnectionMgr::ReportFailedToProcess(nsIURI *uri)
{
MOZ_ASSERT(uri);

Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/http/nsHttpConnectionMgr.h
Expand Up @@ -220,7 +220,7 @@ class nsHttpConnectionMgr : public nsIObserver
nsHttpConnection *,
uint32_t);

void ReportFailedToProcess(nsIURI *uri, const nsACString& isolationDomain);
void ReportFailedToProcess(nsIURI *uri);

// Causes a large amount of connection diagnostic information to be
// printed to the javascript console
Expand Down
2 changes: 1 addition & 1 deletion netwerk/protocol/http/nsHttpHandler.cpp
Expand Up @@ -1952,7 +1952,7 @@ nsHttpHandler::Observe(nsISupports *subject,
nsCOMPtr<nsIURI> uri = do_QueryInterface(subject);
// Ignore possibility of an isolation key:
if (uri && mConnMgr) {
mConnMgr->ReportFailedToProcess(uri, EmptyCString());
mConnMgr->ReportFailedToProcess(uri);
}
} else if (!strcmp(topic, "last-pb-context-exited")) {
mPrivateAuthCache.ClearAll();
Expand Down
2 changes: 1 addition & 1 deletion security/manager/ssl/src/SSLServerCertVerification.cpp
Expand Up @@ -1146,7 +1146,7 @@ AuthCertificate(CertVerifier& certVerifier,
rv = certVerifier.VerifySSLServerCert(cert, stapledOCSPResponse,
time, infoObject,
infoObject->GetHostNameRaw(),
infoObject->GetIsolationKey(),
infoObject->GetIsolationKeyRaw(),
saveIntermediates, 0, &certList,
&evOidPolicy, &ocspStaplingStatus,
&keySizeStatus);
Expand Down
7 changes: 0 additions & 7 deletions security/manager/ssl/src/TransportSecurityInfo.cpp
Expand Up @@ -107,13 +107,6 @@ TransportSecurityInfo::SetIsolationKey(const char* isolationKey)
return NS_OK;
}

nsresult
TransportSecurityInfo::GetIsolationKey(char** isolationKey)
{
*isolationKey = (mIsolationKey) ? NS_strdup(mIsolationKey) : nullptr;
return NS_OK;
}

PRErrorCode
TransportSecurityInfo::GetErrorCode() const
{
Expand Down
3 changes: 1 addition & 2 deletions security/manager/ssl/src/TransportSecurityInfo.h
Expand Up @@ -62,8 +62,7 @@ class TransportSecurityInfo : public nsITransportSecurityInfo,
nsresult GetPort(int32_t *aPort);
nsresult SetPort(int32_t aPort);

nsresult GetIsolationKey(char **aIsolationKey);
const char* GetIsolationKey() const { return mIsolationKey.get(); }
const char* GetIsolationKeyRaw() const { return mIsolationKey.get(); }
nsresult SetIsolationKey(const char *aIsolationKey);

PRErrorCode GetErrorCode() const;
Expand Down
10 changes: 6 additions & 4 deletions security/manager/ssl/src/nsNSSCallbacks.cpp
Expand Up @@ -106,13 +106,15 @@ nsHTTPDownloadEvent::Run()

chan->SetLoadFlags(nsIRequest::LOAD_ANONYMOUS);

// If we have an isolation key, use it as the isolation key for this channel.
// If we have an isolation key, use it as the URI for this channel.
if (!mRequestSession->mIsolationKey.IsEmpty()) {
nsCOMPtr<nsIHttpChannelInternal> channelInternal(do_QueryInterface(chan));
if (channelInternal) {
nsCOMPtr<nsIURI> pageURI;
nsresult rv = NS_NewURI(getter_AddRefs(pageURI), mRequestSession->mIsolationKey.get());
channelInternal->SetDocumentURI(pageURI);
nsCString documentURISpec("https://");
documentURISpec.Append(mRequestSession->mIsolationKey);
nsCOMPtr<nsIURI> documentURI;
/* nsresult rv = */ NS_NewURI(getter_AddRefs(documentURI), documentURISpec);
channelInternal->SetDocumentURI(documentURI);
}
}

Expand Down

0 comments on commit c95f25a

Please sign in to comment.