diff options
Diffstat (limited to 'src/transport/gnunet-communicator-tcp.c')
-rw-r--r-- | src/transport/gnunet-communicator-tcp.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index 6f7e67d7b..2a5e33e2b 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -2556,11 +2556,17 @@ handshake_monotime_cb (void *cls, | |||
2556 | 2556 | ||
2557 | handshake_monotonic_time = &queue->handshake_monotonic_time; | 2557 | handshake_monotonic_time = &queue->handshake_monotonic_time; |
2558 | pid = &queue->target; | 2558 | pid = &queue->target; |
2559 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2560 | "tcp handshake with us %s\n", | ||
2561 | GNUNET_i2s (&my_identity)); | ||
2559 | if (NULL == record) | 2562 | if (NULL == record) |
2560 | { | 2563 | { |
2561 | queue->handshake_monotime_get = NULL; | 2564 | queue->handshake_monotime_get = NULL; |
2562 | return; | 2565 | return; |
2563 | } | 2566 | } |
2567 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2568 | "tcp handshake from peer %s\n", | ||
2569 | GNUNET_i2s (pid)); | ||
2564 | if (sizeof(*mtbe) != record->value_size) | 2570 | if (sizeof(*mtbe) != record->value_size) |
2565 | { | 2571 | { |
2566 | GNUNET_break (0); | 2572 | GNUNET_break (0); |
@@ -2610,6 +2616,7 @@ decrypt_and_check_tc (struct Queue *queue, | |||
2610 | char *ibuf) | 2616 | char *ibuf) |
2611 | { | 2617 | { |
2612 | struct TcpHandshakeSignature ths; | 2618 | struct TcpHandshakeSignature ths; |
2619 | enum GNUNET_GenericReturnValue ret; | ||
2613 | 2620 | ||
2614 | GNUNET_assert ( | 2621 | GNUNET_assert ( |
2615 | 0 == | 2622 | 0 == |
@@ -2625,18 +2632,20 @@ decrypt_and_check_tc (struct Queue *queue, | |||
2625 | memcpy (&ths.ephemeral, ibuf, sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)); | 2632 | memcpy (&ths.ephemeral, ibuf, sizeof(struct GNUNET_CRYPTO_EcdhePublicKey)); |
2626 | ths.monotonic_time = tc->monotonic_time; | 2633 | ths.monotonic_time = tc->monotonic_time; |
2627 | ths.challenge = tc->challenge; | 2634 | ths.challenge = tc->challenge; |
2628 | queue->handshake_monotime_get = | 2635 | ret = GNUNET_CRYPTO_eddsa_verify ( |
2629 | GNUNET_PEERSTORE_iterate (peerstore, | ||
2630 | "transport_tcp_communicator", | ||
2631 | &queue->target, | ||
2632 | GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE, | ||
2633 | &handshake_monotime_cb, | ||
2634 | queue); | ||
2635 | return GNUNET_CRYPTO_eddsa_verify ( | ||
2636 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE, | 2636 | GNUNET_SIGNATURE_COMMUNICATOR_TCP_HANDSHAKE, |
2637 | &ths, | 2637 | &ths, |
2638 | &tc->sender_sig, | 2638 | &tc->sender_sig, |
2639 | &tc->sender.public_key); | 2639 | &tc->sender.public_key); |
2640 | if (GNUNET_YES == ret) | ||
2641 | queue->handshake_monotime_get = | ||
2642 | GNUNET_PEERSTORE_iterate (peerstore, | ||
2643 | "transport_tcp_communicator", | ||
2644 | &queue->target, | ||
2645 | GNUNET_PEERSTORE_TRANSPORT_TCP_COMMUNICATOR_HANDSHAKE, | ||
2646 | &handshake_monotime_cb, | ||
2647 | queue); | ||
2648 | return ret; | ||
2640 | } | 2649 | } |
2641 | 2650 | ||
2642 | 2651 | ||