gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r1707 - in GNUnet/src/applications: session topology_defaul


From: grothoff
Subject: [GNUnet-SVN] r1707 - in GNUnet/src/applications: session topology_default topology_f2f
Date: Tue, 16 Aug 2005 22:02:08 -0700 (PDT)

Author: grothoff
Date: 2005-08-16 22:02:06 -0700 (Tue, 16 Aug 2005)
New Revision: 1707

Modified:
   GNUnet/src/applications/session/connect.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/applications/topology_f2f/topology.c
Log:
dbg

Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c   2005-08-17 04:22:39 UTC (rev 
1706)
+++ GNUnet/src/applications/session/connect.c   2005-08-17 05:02:06 UTC (rev 
1707)
@@ -37,7 +37,7 @@
 
 #define hello_HELPER_TABLE_START_SIZE 64
 
-#define DEBUG_SESSION NO
+#define DEBUG_SESSION YES
 
 #define EXTRA_CHECKS YES
 
@@ -86,7 +86,8 @@
 
 } P2P_setkey_MESSAGE;
 
-#if 0
+
+#if DEBUG_SESSION
 /**
  * Not thread-safe, only use for debugging!
  */
@@ -255,12 +256,12 @@
 
 #if DEBUG_SESSION
   LOG(LOG_DEBUG,
-      "Sending SKEY %u with %u bytes of data (%s, %s).\n",
-      *(int*) sk,
+      "Sending setkey %s with %u bytes of data (%s, %s).\n",
+      printSKEY(sk),
       size,
       ping != NULL ? "ping":"",
       pong != NULL ? "pong":"");
-#endif
+#endif  
   if (SYSERR == encryptPrivateKey(sk,
                                  sizeof(SESSIONKEY),
                                  &foreignHelo->publicKey,
@@ -308,9 +309,9 @@
     }
 #if DEBUG_SESSION
     LOG(LOG_DEBUG,
-       "Encrypting %d bytes of PINGPONG with key %u and IV %u\n",
+       "Encrypting %d bytes of PINGPONG with key %s and IV %u\n",
        size,
-       *(int*)sk,
+       printSKEY(sk),
        *(int*)&msg->signature);
 #endif
     GNUNET_ASSERT(-1 != encryptBlock(pt,
@@ -388,8 +389,8 @@
     makeSessionkey(&sk);
 #if DEBUG_SESSION
     LOG(LOG_DEBUG,
-       "Created fresh sessionkey %u.\n",
-       *(int*) &sk);
+       "Created fresh sessionkey '%s'.\n",
+       printSKEY(&sk));
 #endif
   }
 
@@ -434,7 +435,8 @@
   FREE(skey);
 #if DEBUG_SESSION
   LOG(LOG_DEBUG,
-      "Sending session key to peer '%s'.\n",
+      "Sending session key '%s' to peer '%s'.\n",
+      printSKEY(&sk),
       &enc);
 #endif
   if (stats != NULL)
@@ -516,14 +518,15 @@
   if (size != sizeof(SESSIONKEY)) {
     LOG(LOG_WARNING,
        _("Invalid '%s' message received from peer '%s'.\n"),
-       "SKEY",
+       "setkey",
        &enc);
     return SYSERR;
   }
   if (key.crc32 !=
       htonl(crc32N(&key, SESSIONKEY_LEN))) {
     LOG(LOG_WARNING,
-       _("SKEY from '%s' fails CRC check (have: %u, want %u).\n"),
+       _("setkey '%s' from '%s' fails CRC check (have: %u, want %u).\n"),
+       printSKEY(&key),
        &enc,
        ntohl(key.crc32),
        crc32N(&key, SESSIONKEY_LEN));
@@ -534,9 +537,9 @@
 
 #if DEBUG_SESSION
   LOG(LOG_DEBUG,
-      "Received SKEY message with %u bytes of data and key %u.\n",
+      "Received setkey message with %u bytes of data and key '%s'.\n",
       ntohs(sessionkeySigned->header.size),
-      *(int*)&key);
+      printSKEY(&key));
 #endif
   if (stats != NULL)
     stats->change(stat_skeyAccepted,
@@ -556,9 +559,9 @@
     plaintext = MALLOC(size);
 #if DEBUG_SESSION
     LOG(LOG_DEBUG,
-       "Decrypting %d bytes of PINGPONG with key %u and IV %u\n",
+       "Decrypting %d bytes of PINGPONG with key '%s' and IV %u\n",
        size,
-       *(int*)&key,
+       printSKEY(&key),
        *(int*)&sessionkeySigned->signature);
 #endif
     GNUNET_ASSERT(-1 != 
@@ -675,7 +678,7 @@
 }
 
 /**
- * We have received an (encrypted) SKEY message.
+ * We have received an (encrypted) setkey message.
  * The reaction is to update our key to the new
  * value.  (Rekeying).
  */

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-08-17 04:22:39 UTC 
(rev 1706)
+++ GNUnet/src/applications/topology_default/topology.c 2005-08-17 05:02:06 UTC 
(rev 1707)
@@ -200,7 +200,7 @@
                   0,
                   0);
   identity->blacklistHost(&indexMatch.match,
-                         30 + (int) saturation * 60,
+                         300 + (int) saturation * 600,
                          NO);
 }
 

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2005-08-17 04:22:39 UTC 
(rev 1706)
+++ GNUnet/src/applications/topology_f2f/topology.c     2005-08-17 05:02:06 UTC 
(rev 1707)
@@ -195,7 +195,7 @@
       &enc);
   session->tryConnect(&indexMatch.match);
   identity->blacklistHost(&indexMatch.match,
-                         30 + (int) saturation * 60,
+                         300 + (int) saturation * 600,
                          NO);
 }
 





reply via email to

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