aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-06-03 17:06:49 +0200
committerChristian Grothoff <christian@grothoff.org>2018-06-03 17:06:49 +0200
commit2a789993747f7c74b331e38e4562772270bde3c0 (patch)
treee6313dba52e6a3a1998cf491917620a0fb7dd7f0
parent9b9c6dc3c055b2cda01496b22c8c41116b7ffc04 (diff)
downloadgnunet-2a789993747f7c74b331e38e4562772270bde3c0.tar.gz
gnunet-2a789993747f7c74b331e38e4562772270bde3c0.zip
more crypto KX logging
-rw-r--r--src/core/gnunet-service-core_kx.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index cf2207e8b..2250f59e6 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -991,9 +991,18 @@ handle_ephemeral_key (void *cls,
991 GNUNET_break_op (0); 991 GNUNET_break_op (0);
992 return; 992 return;
993 } 993 }
994 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 994 {
995 "Core service receives EPHEMERAL_KEY request from `%s'.\n", 995 struct GNUNET_HashCode eh;
996 GNUNET_i2s (kx->peer)); 996
997 GNUNET_CRYPTO_hash (&current_ekm.ephemeral_key,
998 sizeof (current_ekm.ephemeral_key),
999 &eh);
1000 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1001 "Core service receives EPHEMERAL_KEY `%s' from `%s'.\n",
1002 GNUNET_h2s (&eh),
1003 GNUNET_i2s (kx->peer));
1004 }
1005
997 if ((ntohl (m->purpose.size) != 1006 if ((ntohl (m->purpose.size) !=
998 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + 1007 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
999 sizeof (struct GNUNET_TIME_AbsoluteNBO) + 1008 sizeof (struct GNUNET_TIME_AbsoluteNBO) +
@@ -1819,11 +1828,19 @@ do_rekey (void *cls)
1819 NULL); 1828 NULL);
1820 if (NULL != my_ephemeral_key) 1829 if (NULL != my_ephemeral_key)
1821 GNUNET_free (my_ephemeral_key); 1830 GNUNET_free (my_ephemeral_key);
1822 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1823 "Rekeying\n");
1824 my_ephemeral_key = GNUNET_CRYPTO_ecdhe_key_create (); 1831 my_ephemeral_key = GNUNET_CRYPTO_ecdhe_key_create ();
1825 GNUNET_assert (NULL != my_ephemeral_key); 1832 GNUNET_assert (NULL != my_ephemeral_key);
1826 sign_ephemeral_key (); 1833 sign_ephemeral_key ();
1834 {
1835 struct GNUNET_HashCode eh;
1836
1837 GNUNET_CRYPTO_hash (&current_ekm.ephemeral_key,
1838 sizeof (current_ekm.ephemeral_key),
1839 &eh);
1840 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1841 "Rekeying to %s\n",
1842 GNUNET_h2s (&eh));
1843 }
1827 for (pos = kx_head; NULL != pos; pos = pos->next) 1844 for (pos = kx_head; NULL != pos; pos = pos->next)
1828 { 1845 {
1829 if (GNUNET_CORE_KX_STATE_UP == pos->status) 1846 if (GNUNET_CORE_KX_STATE_UP == pos->status)
@@ -1884,6 +1901,17 @@ GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
1884 return GNUNET_SYSERR; 1901 return GNUNET_SYSERR;
1885 } 1902 }
1886 sign_ephemeral_key (); 1903 sign_ephemeral_key ();
1904 {
1905 struct GNUNET_HashCode eh;
1906
1907 GNUNET_CRYPTO_hash (&current_ekm.ephemeral_key,
1908 sizeof (current_ekm.ephemeral_key),
1909 &eh);
1910 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1911 "Starting with ephemeral key %s\n",
1912 GNUNET_h2s (&eh));
1913 }
1914
1887 nc = GNUNET_notification_context_create (1); 1915 nc = GNUNET_notification_context_create (1);
1888 rekey_task = GNUNET_SCHEDULER_add_delayed (REKEY_FREQUENCY, 1916 rekey_task = GNUNET_SCHEDULER_add_delayed (REKEY_FREQUENCY,
1889 &do_rekey, 1917 &do_rekey,