diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-06-17 12:13:43 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-06-17 12:13:43 +0000 |
commit | c0f2c72aba06754c8d21517233f706130b0d6173 (patch) | |
tree | dd4d93a7b7c00dd26abe47e683ff0adb4995cb20 | |
parent | 2af3ef48e88b4c6c1d394bcf45681f94c4575a30 (diff) | |
download | gnunet-c0f2c72aba06754c8d21517233f706130b0d6173.tar.gz gnunet-c0f2c72aba06754c8d21517233f706130b0d6173.zip |
- fixes, renaming
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnel.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 227b40f8e..60c7014d9 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -39,9 +39,9 @@ | |||
39 | #define CONNECTIONS_PER_TUNNEL 3 | 39 | #define CONNECTIONS_PER_TUNNEL 3 |
40 | 40 | ||
41 | #if !defined(GNUNET_CULL_LOGGING) | 41 | #if !defined(GNUNET_CULL_LOGGING) |
42 | #define DUMP_KEYS_TO_STDIN GNUNET_YES | 42 | #define DUMP_KEYS_TO_STDERR GNUNET_YES |
43 | #else | 43 | #else |
44 | #define DUMP_KEYS_TO_STDIN GNUNET_NO | 44 | #define DUMP_KEYS_TO_STDERR GNUNET_NO |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | /******************************************************************************/ | 47 | /******************************************************************************/ |
@@ -613,6 +613,10 @@ t_hmac (const void *plaintext, size_t size, | |||
613 | struct GNUNET_CRYPTO_AuthKey auth_key; | 613 | struct GNUNET_CRYPTO_AuthKey auth_key; |
614 | struct GNUNET_HashCode hash; | 614 | struct GNUNET_HashCode hash; |
615 | 615 | ||
616 | #if DUMP_KEYS_TO_STDERR | ||
617 | LOG (GNUNET_ERROR_TYPE_DEBUG, " HMAC with key %s\n", | ||
618 | GNUNET_h2s ((struct GNUNET_HashCode *) key)); | ||
619 | #endif | ||
616 | GNUNET_CRYPTO_hmac_derive_key (&auth_key, key, | 620 | GNUNET_CRYPTO_hmac_derive_key (&auth_key, key, |
617 | &iv, sizeof (iv), | 621 | &iv, sizeof (iv), |
618 | key, sizeof (*key), | 622 | key, sizeof (*key), |
@@ -703,11 +707,11 @@ t_decrypt (struct CadetTunnel *t, void *dst, const void *src, | |||
703 | { | 707 | { |
704 | size_t out_size; | 708 | size_t out_size; |
705 | 709 | ||
706 | #if DUMP_KEYS_TO_STDIN | 710 | #if DUMP_KEYS_TO_STDERR |
707 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_decrypt with %s\n", | 711 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_decrypt with %s\n", |
708 | GNUNET_h2s ((struct GNUNET_HashCode *) &t->d_key)); | 712 | GNUNET_h2s ((struct GNUNET_HashCode *) &t->d_key)); |
709 | #endif | 713 | #endif |
710 | if (t->estate != CADET_TUNNEL3_KEY_OK && t->estate != CADET_TUNNEL3_KEY_PING) | 714 | if (t->estate == CADET_TUNNEL3_KEY_UNINITIALIZED) |
711 | { | 715 | { |
712 | GNUNET_STATISTICS_update (stats, "# non decryptable data", 1, GNUNET_NO); | 716 | GNUNET_STATISTICS_update (stats, "# non decryptable data", 1, GNUNET_NO); |
713 | LOG (GNUNET_ERROR_TYPE_WARNING, | 717 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -837,7 +841,7 @@ create_keys (struct CadetTunnel *t) | |||
837 | derive_key_material (&km, &t->peers_ephemeral_key); | 841 | derive_key_material (&km, &t->peers_ephemeral_key); |
838 | derive_symmertic (&t->e_key, &my_full_id, GCP_get_id (t->peer), &km); | 842 | derive_symmertic (&t->e_key, &my_full_id, GCP_get_id (t->peer), &km); |
839 | derive_symmertic (&t->d_key, GCP_get_id (t->peer), &my_full_id, &km); | 843 | derive_symmertic (&t->d_key, GCP_get_id (t->peer), &my_full_id, &km); |
840 | #if DUMP_KEYS_TO_STDIN | 844 | #if DUMP_KEYS_TO_STDERR |
841 | LOG (GNUNET_ERROR_TYPE_INFO, "ME: %s\n", | 845 | LOG (GNUNET_ERROR_TYPE_INFO, "ME: %s\n", |
842 | GNUNET_h2s ((struct GNUNET_HashCode *) &kx_msg.ephemeral_key)); | 846 | GNUNET_h2s ((struct GNUNET_HashCode *) &kx_msg.ephemeral_key)); |
843 | LOG (GNUNET_ERROR_TYPE_INFO, "PE: %s\n", | 847 | LOG (GNUNET_ERROR_TYPE_INFO, "PE: %s\n", |