From 15498a268e2f38e590d49294a646fe1ef82f134f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 15 Jun 2018 23:10:38 +0200 Subject: support wildcard cookie domains starting with . --- src/gns/gnunet-gns-proxy.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gns/gnunet-gns-proxy.c') diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index e68d6d540..e8f0854f1 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -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); -- cgit v1.2.3