gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36429 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r36429 - gnunet/src/cadet
Date: Fri, 2 Oct 2015 05:37:55 +0200

Author: bartpolot
Date: 2015-10-02 05:37:55 +0200 (Fri, 02 Oct 2015)
New Revision: 36429

Modified:
   gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
- adjust logging

Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2015-10-02 03:37:54 UTC 
(rev 36428)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2015-10-02 03:37:55 UTC 
(rev 36429)
@@ -883,6 +883,14 @@
 {
   GNUNET_free_non_null (t->ax->DHRs);
   t->ax->DHRs = GNUNET_CRYPTO_ecdhe_key_create();
+  #if DUMP_KEYS_TO_STDERR
+  {
+    struct GNUNET_CRYPTO_EcdhePublicKey pub;
+    GNUNET_CRYPTO_ecdhe_key_get_public (t->ax->DHRs, &pub);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "  new DHRs generated: pub  %s\n",
+        GNUNET_i2s ((struct GNUNET_PeerIdentity *) &pub));
+  }
+  #endif
 }
 
 
@@ -1064,7 +1072,7 @@
   GNUNET_CRYPTO_symmetric_derive_iv (&iv, &MK, NULL, 0, NULL);
 
   #if DUMP_KEYS_TO_STDERR
-  LOG (GNUNET_ERROR_TYPE_INFO, "  CKs: %s\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  CKs: %s\n",
        GNUNET_i2s ((struct GNUNET_PeerIdentity *) &ax->CKs));
   LOG (GNUNET_ERROR_TYPE_INFO, "  AX_ENC with key %u: %s\n", ax->Ns,
        GNUNET_i2s ((struct GNUNET_PeerIdentity *) &MK));
@@ -1101,12 +1109,13 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG, "  t_ax_decrypt start\n");
 
   ax = t->ax;
+  ax_debug (ax, GNUNET_ERROR_TYPE_INFO);
 
   t_hmac_derive_key (&ax->CKr, &MK, "0", 1);
   GNUNET_CRYPTO_symmetric_derive_iv (&iv, &MK, NULL, 0, NULL);
 
   #if DUMP_KEYS_TO_STDERR
-  LOG (GNUNET_ERROR_TYPE_INFO, "  CKr: %s\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "  CKr: %s\n",
        GNUNET_i2s ((struct GNUNET_PeerIdentity *) &ax->CKr));
   LOG (GNUNET_ERROR_TYPE_INFO, "  AX_DEC with key %u: %s\n", ax->Nr,
        GNUNET_i2s ((struct GNUNET_PeerIdentity *) &MK));
@@ -1423,9 +1432,9 @@
   key->HK = t->ax->HKr;
   t_hmac_derive_key (&t->ax->CKr, &key->MK, "0", 1);
   #if DUMP_KEYS_TO_STDERR
-  LOG (GNUNET_ERROR_TYPE_INFO, "    storing MK for Nr %u: %s\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "    storing MK for Nr %u: %s\n",
        key->Kn, GNUNET_i2s ((struct GNUNET_PeerIdentity *) &key->MK));
-  LOG (GNUNET_ERROR_TYPE_INFO, "    for CKr: %s\n",
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "    for CKr: %s\n",
        GNUNET_i2s ((struct GNUNET_PeerIdentity *) &t->ax->CKr));
   #endif
   t_hmac_derive_key (&t->ax->CKr, &t->ax->CKr, "1", 1);
@@ -1471,6 +1480,7 @@
 
 
   gap = Np - t->ax->Nr;
+  LOG (GNUNET_ERROR_TYPE_INFO, "Storing keys [%u, %u)\n", t->ax->Nr, Np);
   if (MAX_KEY_GAP < gap)
   {
     /* Avoid DoS (forcing peer to do 2*33 chain HMAC operations) */
@@ -1537,6 +1547,7 @@
     struct GNUNET_CRYPTO_EcdhePublicKey *DHRp;
 
     /* Try Next HK */
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "  trying next HK\n");
     t_hmac (&src->Ns, AX_HEADER_SIZE + esize, 0, &ax->NHKr, &msg_hmac);
     if (0 != memcmp (&msg_hmac, &src->hmac, sizeof (msg_hmac)))
     {




reply via email to

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