diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-06-03 17:06:49 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-06-03 17:06:49 +0200 |
commit | 2a789993747f7c74b331e38e4562772270bde3c0 (patch) | |
tree | e6313dba52e6a3a1998cf491917620a0fb7dd7f0 | |
parent | 9b9c6dc3c055b2cda01496b22c8c41116b7ffc04 (diff) |
more crypto KX logging
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 38 |
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 cf2207e8bc..2250f59e6e 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, GNUNET_break_op (0); return; } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Core service receives EPHEMERAL_KEY request from `%s'.\n", - GNUNET_i2s (kx->peer)); + { + struct GNUNET_HashCode eh; + + GNUNET_CRYPTO_hash (¤t_ekm.ephemeral_key, + sizeof (current_ekm.ephemeral_key), + &eh); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Core service receives EPHEMERAL_KEY `%s' from `%s'.\n", + GNUNET_h2s (&eh), + GNUNET_i2s (kx->peer)); + } + if ((ntohl (m->purpose.size) != sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + @@ -1819,11 +1828,19 @@ do_rekey (void *cls) NULL); if (NULL != my_ephemeral_key) GNUNET_free (my_ephemeral_key); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Rekeying\n"); my_ephemeral_key = GNUNET_CRYPTO_ecdhe_key_create (); GNUNET_assert (NULL != my_ephemeral_key); sign_ephemeral_key (); + { + struct GNUNET_HashCode eh; + + GNUNET_CRYPTO_hash (¤t_ekm.ephemeral_key, + sizeof (current_ekm.ephemeral_key), + &eh); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Rekeying to %s\n", + GNUNET_h2s (&eh)); + } for (pos = kx_head; NULL != pos; pos = pos->next) { if (GNUNET_CORE_KX_STATE_UP == pos->status) @@ -1884,6 +1901,17 @@ GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk) return GNUNET_SYSERR; } sign_ephemeral_key (); + { + struct GNUNET_HashCode eh; + + GNUNET_CRYPTO_hash (¤t_ekm.ephemeral_key, + sizeof (current_ekm.ephemeral_key), + &eh); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Starting with ephemeral key %s\n", + GNUNET_h2s (&eh)); + } + nc = GNUNET_notification_context_create (1); rekey_task = GNUNET_SCHEDULER_add_delayed (REKEY_FREQUENCY, &do_rekey, |