support wildcard cookie domains starting with .
authorChristian Grothoff <christian@grothoff.org>
Fri, 15 Jun 2018 21:10:38 +0000 (23:10 +0200)
committerChristian Grothoff <christian@grothoff.org>
Fri, 15 Jun 2018 21:14:12 +0000 (23:14 +0200)
src/gns/gnunet-gns-proxy.c

index e68d6d54025ef76b6a4ce9bab201818639abc554..e8f0854f1d0545bd668020907fb86104ae763fd7 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2012-2014 GNUnet e.V.
+     Copyright (C) 2012-2018 GNUnet e.V.
 
      GNUnet is free software: you can redistribute it and/or modify it
      under the terms of the GNU Affero General Public License as published
@@ -1178,7 +1178,6 @@ curl_check_hdr (void *buffer,
                                s5r->domain);
             continue;
           }
-        }
         else if (0 == strcmp (cookie_domain,
                              s5r->leho))
         {
@@ -1187,6 +1186,15 @@ curl_check_hdr (void *buffer,
                              s5r->domain);
           continue;
         }
+        else if ( ('.' == cookie_domain[0]) &&
+                 (0 == strcmp (&cookie_domain[1],
+                               s5r->leho)) )
+        {
+          offset += sprintf (new_cookie_hdr + offset,
+                             " domain=.%s;",
+                             s5r->domain);
+          continue;
+        }
         GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                     _("Cookie domain `%s' supplied by server is invalid\n"),
                     tok);