gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27936 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r27936 - gnunet/src/transport
Date: Thu, 11 Jul 2013 18:03:23 +0200

Author: wachs
Date: 2013-07-11 18:03:23 +0200 (Thu, 11 Jul 2013)
New Revision: 27936

Modified:
   gnunet/src/transport/gnunet-service-transport_validation.c
   gnunet/src/transport/plugin_transport_http_server.c
Log:
enabling address check in validation


Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c  2013-07-11 
15:50:58 UTC (rev 27935)
+++ gnunet/src/transport/gnunet-service-transport_validation.c  2013-07-11 
16:03:23 UTC (rev 27936)
@@ -956,6 +956,26 @@
     address.transport_name = addr;
     address.peer = GST_my_identity;
 
+    if (NULL == address.transport_name)
+    {
+       GNUNET_break (0);
+    }
+    if (NULL == (papi = GST_plugins_find (address.transport_name)))
+    {
+      /* we don't have the plugin for this address */
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Plugin `%s' not available, cannot 
confirm having this address \n",
+               address.transport_name) ;
+      return;
+    }
+    if (GNUNET_OK != papi->check_address (papi->cls, addrend, alen))
+               {
+       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Address `%s' is not one of my 
addresses, not confirming PING\n",
+               GST_plugins_a2s (&address));
+       return;
+               }
+    else
+       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Address `%s' is one of my 
addresses, confirming PING\n",
+                       GST_plugins_a2s (&address)); /* DEBUGGING*/
 
     if (GNUNET_YES != GST_hello_test_address (&address, &sig_cache, 
&sig_cache_exp))
     {
@@ -1033,7 +1053,6 @@
 
   /* first see if the session we got this PING from can be used to transmit
    * a response reliably */
-  papi = GST_plugins_find (sender_address->transport_name);
   if (papi == NULL)
     ret = -1;
   else

Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2013-07-11 15:50:58 UTC 
(rev 27935)
+++ gnunet/src/transport/plugin_transport_http_server.c 2013-07-11 16:03:23 UTC 
(rev 27936)
@@ -657,12 +657,19 @@
   struct HTTP_Server_Plugin *plugin = cls;
   struct HttpAddressWrapper *next;
   struct HttpAddressWrapper *pos;
-
-
+       struct HttpAddress *h_addr;
+GNUNET_break (0);
+       h_addr = (struct HttpAddress *) addr;
   if ((NULL != plugin->ext_addr) &&
           GNUNET_YES == (http_common_cmp_addresses (addr, addrlen,
                                           plugin->ext_addr, 
plugin->ext_addr_len)))
+  {
+       if ((ntohl(h_addr->options) & HTTP_OPTIONS_VERIFY_CERTIFICATE) != 
HTTP_OPTIONS_VERIFY_CERTIFICATE)
+                       GNUNET_break (0);
+       else
+               GNUNET_break (0);
     return GNUNET_OK;
+  }
 
   next  = plugin->addr_head;
   while (NULL != (pos = next))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]