Skip to content

Commit

Permalink
Merge r222706 - [SOUP] Default kerberos authentication credentials ar…
Browse files Browse the repository at this point in the history
…e used in ephemeral (private) mode

https://bugs.webkit.org/show_bug.cgi?id=177738

Reviewed by Carlos Garcia Campos.

If the session is ephemeral then don't enable the Negotiate support in
our SoupSession.

* platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the
session ID if it's known to the SoupNetworkSession.
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): If the session is
ephemeral (based on given session ID) then don't activate the
Negotiate support in SoupSession.
* platform/network/soup/SoupNetworkSession.h:
Change the constructor to accept the PAL::SessionID with the default
value set to PAL::SessionID::emptySessionID.
  • Loading branch information
tpopela authored and carlosgcampos committed Oct 17, 2017
1 parent 923a5e9 commit 2b11c91
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
22 changes: 22 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,25 @@
2017-10-02 Tomas Popela <tpopela@redhat.com>

[SOUP] Default kerberos authentication credentials are used in ephemeral (private) mode
https://bugs.webkit.org/show_bug.cgi?id=177738

Reviewed by Carlos Garcia Campos.

If the session is ephemeral then don't enable the Negotiate support in
our SoupSession.

* platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the
session ID if it's known to the SoupNetworkSession.
(WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession): If the session is
ephemeral (based on given session ID) then don't activate the
Negotiate support in SoupSession.
* platform/network/soup/SoupNetworkSession.h:
Change the constructor to accept the PAL::SessionID with the default
value set to PAL::SessionID::emptySessionID.

2017-10-02 Joanmarie Diggs <jdiggs@igalia.com>

REGRESSION(r222640) [GTK] Build broken with ATK 2.14
Expand Down
Expand Up @@ -83,7 +83,7 @@ void NetworkStorageSession::ensurePrivateBrowsingSession(SessionID sessionID, co
{
ASSERT(sessionID != SessionID::defaultSessionID());
ASSERT(!globalSessionMap().contains(sessionID));
globalSessionMap().add(sessionID, std::make_unique<NetworkStorageSession>(sessionID, std::make_unique<SoupNetworkSession>()));
globalSessionMap().add(sessionID, std::make_unique<NetworkStorageSession>(sessionID, std::make_unique<SoupNetworkSession>(sessionID)));
}

void NetworkStorageSession::ensureSession(SessionID, const String&)
Expand All @@ -99,7 +99,7 @@ void NetworkStorageSession::switchToNewTestingSession()
SoupNetworkSession& NetworkStorageSession::getOrCreateSoupNetworkSession() const
{
if (!m_session)
m_session = std::make_unique<SoupNetworkSession>(m_cookieStorage.get());
m_session = std::make_unique<SoupNetworkSession>(m_sessionID, m_cookieStorage.get());
return *m_session;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
Expand Up @@ -113,7 +113,7 @@ static void requestStartedCallback(SoupSession*, SoupMessage* soupMessage, SoupS
}
#endif

SoupNetworkSession::SoupNetworkSession(SoupCookieJar* cookieJar)
SoupNetworkSession::SoupNetworkSession(SessionID sessionID, SoupCookieJar* cookieJar)
: m_soupSession(adoptGRef(soup_session_async_new()))
{
// Values taken from http://www.browserscope.org/ following
Expand Down Expand Up @@ -147,7 +147,7 @@ SoupNetworkSession::SoupNetworkSession(SoupCookieJar* cookieJar)
setAcceptLanguages(gInitialAcceptLanguages);

#if SOUP_CHECK_VERSION(2, 53, 92)
if (soup_auth_negotiate_supported()) {
if (soup_auth_negotiate_supported() && !sessionID.isEphemeral()) {
g_object_set(m_soupSession.get(),
SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_AUTH_NEGOTIATE,
nullptr);
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/platform/network/soup/SoupNetworkSession.h
Expand Up @@ -26,6 +26,7 @@
#ifndef SoupNetworkSession_h
#define SoupNetworkSession_h

#include "SessionID.h"
#include <glib-object.h>
#include <wtf/Function.h>
#include <wtf/Noncopyable.h>
Expand All @@ -47,7 +48,7 @@ struct SoupNetworkProxySettings;
class SoupNetworkSession {
WTF_MAKE_NONCOPYABLE(SoupNetworkSession); WTF_MAKE_FAST_ALLOCATED;
public:
explicit SoupNetworkSession(SoupCookieJar* = nullptr);
explicit SoupNetworkSession(SessionID = SessionID::defaultSessionID(), SoupCookieJar* = nullptr);
~SoupNetworkSession();

SoupSession* soupSession() const { return m_soupSession.get(); }
Expand Down

0 comments on commit 2b11c91

Please sign in to comment.