diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-06-03 16:44:07 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-06-03 16:44:07 +0200 |
commit | 9b9c6dc3c055b2cda01496b22c8c41116b7ffc04 (patch) | |
tree | 17414ed0b120d3e896305dfdd0a25a6c0b6fd412 /src | |
parent | 54031a5360d3ea2d7bb99304bfc5abc36807d33a (diff) | |
download | gnunet-9b9c6dc3c055b2cda01496b22c8c41116b7ffc04.tar.gz gnunet-9b9c6dc3c055b2cda01496b22c8c41116b7ffc04.zip |
more core KX logging
Diffstat (limited to 'src')
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index 0d01977bd..cf2207e8b 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c | |||
@@ -448,7 +448,14 @@ derive_auth_key (struct GNUNET_CRYPTO_AuthKey *akey, | |||
448 | { | 448 | { |
449 | static const char ctx[] = "authentication key"; | 449 | static const char ctx[] = "authentication key"; |
450 | 450 | ||
451 | GNUNET_CRYPTO_hmac_derive_key (akey, skey, | 451 | struct GNUNET_HashCode sh; |
452 | GNUNET_CRYPTO_hash (skey, sizeof (*skey), &sh); | ||
453 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
454 | "Deriving Auth key from SKEY %s and seed %u\n", | ||
455 | GNUNET_h2s (&sh), | ||
456 | (unsigned int) seed); | ||
457 | GNUNET_CRYPTO_hmac_derive_key (akey, | ||
458 | skey, | ||
452 | &seed, sizeof (seed), | 459 | &seed, sizeof (seed), |
453 | skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey), | 460 | skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey), |
454 | ctx, sizeof (ctx), | 461 | ctx, sizeof (ctx), |
@@ -472,7 +479,15 @@ derive_iv (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, | |||
472 | { | 479 | { |
473 | static const char ctx[] = "initialization vector"; | 480 | static const char ctx[] = "initialization vector"; |
474 | 481 | ||
475 | GNUNET_CRYPTO_symmetric_derive_iv (iv, skey, | 482 | struct GNUNET_HashCode sh; |
483 | GNUNET_CRYPTO_hash (skey, sizeof (*skey), &sh); | ||
484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
485 | "Deriving IV from SKEY %s and seed %u for peer %s\n", | ||
486 | GNUNET_h2s (&sh), | ||
487 | (unsigned int) seed, | ||
488 | GNUNET_i2s (identity)); | ||
489 | GNUNET_CRYPTO_symmetric_derive_iv (iv, | ||
490 | skey, | ||
476 | &seed, sizeof (seed), | 491 | &seed, sizeof (seed), |
477 | identity, | 492 | identity, |
478 | sizeof (struct GNUNET_PeerIdentity), ctx, | 493 | sizeof (struct GNUNET_PeerIdentity), ctx, |
@@ -498,7 +513,16 @@ derive_pong_iv (struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, | |||
498 | { | 513 | { |
499 | static const char ctx[] = "pong initialization vector"; | 514 | static const char ctx[] = "pong initialization vector"; |
500 | 515 | ||
501 | GNUNET_CRYPTO_symmetric_derive_iv (iv, skey, | 516 | struct GNUNET_HashCode sh; |
517 | GNUNET_CRYPTO_hash (skey, sizeof (*skey), &sh); | ||
518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
519 | "Deriving PONG IV from SKEY %s and seed %u/%u for %s\n", | ||
520 | GNUNET_h2s (&sh), | ||
521 | (unsigned int) seed, | ||
522 | (unsigned int) challenge, | ||
523 | GNUNET_i2s (identity)); | ||
524 | GNUNET_CRYPTO_symmetric_derive_iv (iv, | ||
525 | skey, | ||
502 | &seed, sizeof (seed), | 526 | &seed, sizeof (seed), |
503 | identity, | 527 | identity, |
504 | sizeof (struct GNUNET_PeerIdentity), | 528 | sizeof (struct GNUNET_PeerIdentity), |
@@ -524,6 +548,13 @@ derive_aes_key (const struct GNUNET_PeerIdentity *sender, | |||
524 | { | 548 | { |
525 | static const char ctx[] = "aes key generation vector"; | 549 | static const char ctx[] = "aes key generation vector"; |
526 | 550 | ||
551 | struct GNUNET_HashCode sh; | ||
552 | GNUNET_CRYPTO_hash (skey, sizeof (*skey), &sh); | ||
553 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
554 | "Deriving AES Keys for %s to %s from %s\n", | ||
555 | GNUNET_i2s (sender), | ||
556 | GNUNET_i2s2 (receiver), | ||
557 | GNUNET_h2s (key_material)); | ||
527 | GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey), | 558 | GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_SymmetricSessionKey), |
528 | ctx, sizeof (ctx), | 559 | ctx, sizeof (ctx), |
529 | key_material, sizeof (struct GNUNET_HashCode), | 560 | key_material, sizeof (struct GNUNET_HashCode), |