[SOUP] Use new API for strict secure cookies
authorpgriffis@igalia.com <pgriffis@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Dec 2019 17:51:29 +0000 (17:51 +0000)
committerpgriffis@igalia.com <pgriffis@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Dec 2019 17:51:29 +0000 (17:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169356

Reviewed by Michael Catanzaro.

Source/WebCore:

The new soup API implements this spec:

https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-01

* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::setCookies):

Tools:

Update libsoup to fix a secure cookie test

* gtk/jhbuild.modules:
* wpe/jhbuild.modules:

LayoutTests:

Remove expected failures for secure cookie tests

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253431 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/wpe/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp
Tools/ChangeLog
Tools/gtk/jhbuild.modules
Tools/wpe/jhbuild.modules

index ad9b820..e845148 100644 (file)
@@ -1,3 +1,15 @@
+2019-12-12  Patrick Griffis  <pgriffis@igalia.com>
+
+        [SOUP] Use new API for strict secure cookies
+        https://bugs.webkit.org/show_bug.cgi?id=169356
+
+        Reviewed by Michael Catanzaro.
+
+        Remove expected failures for secure cookie tests
+
+        * platform/gtk/TestExpectations:
+        * platform/wpe/TestExpectations:
+
 2019-12-12  Truitt Savell  <tsavell@apple.com>
 
         REGRESSION: (r251677) imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-double-submit-3.html is a flakey failure
index fb9b513..e82f949 100644 (file)
@@ -3978,8 +3978,6 @@ webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscre
 webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.worker.html [ Failure ]
 webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/filter/offscreencanvas.filter.w.html [ Missing ]
 
-webkit.org/b/169356 imported/w3c/web-platform-tests/cookies/secure/set-from-dom.sub.html [ Failure ]
-
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of non-crashing, non-flaky tests failing
 #////////////////////////////////////////////////////////////////////////////////////////
index 870cca0..2f7bbc2 100644 (file)
@@ -500,8 +500,6 @@ webkit.org/b/200165 imported/w3c/web-platform-tests/websockets/cookies/002.html
 webkit.org/b/200165 imported/w3c/web-platform-tests/websockets/cookies/007.html [ Failure ]
 webkit.org/b/200165 imported/w3c/web-platform-tests/websockets/cookies/004.html [ Failure ]
 
-webkit.org/b/169356 imported/w3c/web-platform-tests/cookies/secure/set-from-dom.sub.html [ Failure ]
-
 #////////////////////////////////////////////////////////////////////////////////////////
 # 3. UNRESOLVED TESTS
 #////////////////////////////////////////////////////////////////////////////////////////
index 812dcfa..d4a7f59 100644 (file)
@@ -1,3 +1,18 @@
+2019-12-12  Patrick Griffis  <pgriffis@igalia.com>
+
+        [SOUP] Use new API for strict secure cookies
+        https://bugs.webkit.org/show_bug.cgi?id=169356
+
+        Reviewed by Michael Catanzaro.
+
+        The new soup API implements this spec:
+
+        https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-01
+
+        * platform/network/soup/NetworkStorageSessionSoup.cpp:
+        (WebCore::NetworkStorageSession::setCookiesFromDOM const):
+        (WebCore::NetworkStorageSession::setCookies):
+
 2019-12-12  Don Olmstead  <don.olmstead@sony.com>
 
         [CMake] Add LibPSL::LibPSL target
index dfc490d..3fb8892 100644 (file)
@@ -291,16 +291,28 @@ void NetworkStorageSession::setCookiesFromDOM(const URL& firstParty, const SameS
         if (httpOnlyCookieExists(existingCookies, soup_cookie_get_name(cookie.get()), soup_cookie_get_path(cookie.get())))
             continue;
 
+#if SOUP_CHECK_VERSION(2, 67, 1)
+        soup_cookie_jar_add_cookie_full(jar, cookie.release(), origin.get(), firstPartyURI.get());
+#else
         soup_cookie_jar_add_cookie_with_first_party(jar, firstPartyURI.get(), cookie.release());
+#endif
     }
 
     soup_cookies_free(existingCookies);
 }
 
-void NetworkStorageSession::setCookies(const Vector<Cookie>& cookies, const URL&, const URL&)
+void NetworkStorageSession::setCookies(const Vector<Cookie>& cookies, const URL& url, const URL& firstParty)
 {
-    for (auto cookie : cookies)
+    for (auto cookie : cookies) {
+#if SOUP_CHECK_VERSION(2, 67, 1)
+        GUniquePtr<SoupURI> origin = urlToSoupURI(url);
+        GUniquePtr<SoupURI> firstPartyURI = urlToSoupURI(firstParty);
+
+        soup_cookie_jar_add_cookie_full(cookieStorage(), cookie.toSoupCookie(), origin.get(), firstPartyURI.get());
+#else
         soup_cookie_jar_add_cookie(cookieStorage(), cookie.toSoupCookie());
+#endif
+    }
 }
 
 void NetworkStorageSession::setCookie(const Cookie& cookie)
index d1f5b2f..891f7f0 100644 (file)
@@ -1,3 +1,15 @@
+2019-12-12  Patrick Griffis  <pgriffis@igalia.com>
+
+        [SOUP] Use new API for strict secure cookies
+        https://bugs.webkit.org/show_bug.cgi?id=169356
+
+        Reviewed by Michael Catanzaro.
+
+        Update libsoup to fix a secure cookie test
+
+        * gtk/jhbuild.modules:
+        * wpe/jhbuild.modules:
+
 2019-12-11  Jonathan Bedard  <jbedard@apple.com>
 
         Python 3: Support serial ServerProcess tests
index 3e4e775..8f5076c 100644 (file)
             hash="sha256:f8fd0aeb66252dfcc638f14d9be1e2362fdaf2ca86bde0444ff4d5cc961b560f"/>
   </autotools>
 
-  <meson id="libsoup" mesonargs="-Dintrospection=false -Dgssapi=false -Dvapi=false">
+  <meson id="libsoup" mesonargs="-Dintrospection=disabled -Dgssapi=disabled -Dvapi=disabled">
     <if condition-set="macos">
       <mesonargs value="-Dtls_check=false"/>
     </if>
       <dep package="glib-networking"/>
       <dep package="libpsl"/>
     </dependencies>
-    <branch module="/pub/GNOME/sources/libsoup/2.67/libsoup-${version}.tar.xz" version="2.67.91"
+    <branch module="/pub/GNOME/sources/libsoup/2.68/libsoup-${version}.tar.xz" version="2.68.3"
             repo="ftp.gnome.org"
-            hash="sha256:390b5b28263d3bdf9866fa694346caa5e4bcb986e014e3383e9b6130b706f3da">
+            hash="sha256:534bb08e35b0ff3702f3adfde87d3441e27c12f9f5ec351f056fe04cba02bafb">
     </branch>
   </meson>
 
index 705e5a0..b82cb81 100644 (file)
             hash="sha256:f8fd0aeb66252dfcc638f14d9be1e2362fdaf2ca86bde0444ff4d5cc961b560f"/>
   </autotools>
 
-  <meson id="libsoup" mesonargs="-Dintrospection=false -Dgssapi=false -Dvapi=false">
+  <meson id="libsoup" mesonargs="-Dintrospection=disabled -Dgssapi=disabled -Dvapi=disabled">
     <dependencies>
       <dep package="glib-networking"/>
       <dep package="libpsl"/>
     </dependencies>
-    <branch module="/pub/GNOME/sources/libsoup/2.67/libsoup-${version}.tar.xz" version="2.67.91"
+    <branch module="/pub/GNOME/sources/libsoup/2.68/libsoup-${version}.tar.xz" version="2.68.3"
             repo="ftp.gnome.org"
-            hash="sha256:390b5b28263d3bdf9866fa694346caa5e4bcb986e014e3383e9b6130b706f3da">
+            hash="sha256:534bb08e35b0ff3702f3adfde87d3441e27c12f9f5ec351f056fe04cba02bafb">
     </branch>
   </meson>