[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-52.7.3esr-8.0-1] Bug 21537: Tests for secure .onion cookies



commit 82cd8ae9a5de7c9f9fde591c29b0ccfa8b59d42f
Author: Georg Koppen <gk@xxxxxxxxxxxxxx>
Date:   Fri Apr 13 17:00:11 2018 +0000

    Bug 21537: Tests for secure .onion cookies
---
 netwerk/test/TestCookie.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/netwerk/test/TestCookie.cpp b/netwerk/test/TestCookie.cpp
index 68c7ff1b3ef1..c382c33c7e3c 100644
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -729,8 +729,18 @@ main(int32_t argc, char *argv[])
       SetACookie(cookieService, "http://www.security.test/";, nullptr, "test=non-security2; domain=security.test", nullptr);
       GetACookieNoHttp(cookieService, "http://www.security.test/";, getter_Copies(cookie));
       rv[8] = CheckResult(cookie.get(), MUST_CONTAIN, "test=non-security2");
-
-      allTestsPassed = PrintResult(rv, 9) && allTestsPassed;
+      // .onion secure cookie tests
+      SetACookie(cookieService, "http://123456789abcdef.onion/";, nullptr, "test=onion-security; secure", nullptr);
+      GetACookieNoHttp(cookieService, "https://123456789abcdef.onion/";, getter_Copies(cookie));
+      rv[9] = CheckResult(cookie.get(), MUST_EQUAL, "test=onion-security");
+      SetACookie(cookieService, "http://123456789abcdef.onion/";, nullptr, "test=onion-security2; secure", nullptr);
+      GetACookieNoHttp(cookieService, "http://123456789abcdef.onion/";, getter_Copies(cookie));
+      rv[10] = CheckResult(cookie.get(), MUST_EQUAL, "test=onion-security2");
+      SetACookie(cookieService, "https://123456789abcdef.onion/";, nullptr, "test=onion-security3; secure", nullptr);
+      GetACookieNoHttp(cookieService, "http://123456789abcdef.onion/";, getter_Copies(cookie));
+      rv[11] = CheckResult(cookie.get(), MUST_EQUAL, "test=onion-security3");
+
+      allTestsPassed = PrintResult(rv, 12) && allTestsPassed;
 
       // *** nsICookieManager{2} interface tests
       sBuffer = PR_sprintf_append(sBuffer, "*** Beginning nsICookieManager{2} interface tests...\n");

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits