diff options
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index f0cc835e7..07f51cb49 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c | |||
@@ -743,6 +743,18 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, | |||
743 | return; | 743 | return; |
744 | } | 744 | } |
745 | m = (const struct EphemeralKeyMessage *) msg; | 745 | m = (const struct EphemeralKeyMessage *) msg; |
746 | end_t = GNUNET_TIME_absolute_ntoh (m->expiration_time); | ||
747 | if ( ( (KX_STATE_KEY_RECEIVED == kx->status) || | ||
748 | (KX_STATE_UP == kx->status) || | ||
749 | (KX_STATE_REKEY_SENT == kx->status) ) && | ||
750 | (end_t.abs_value <= kx->foreign_key_expires.abs_value) ) | ||
751 | { | ||
752 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# old ephemeral keys ignored"), | ||
753 | 1, GNUNET_NO); | ||
754 | return; | ||
755 | } | ||
756 | start_t = GNUNET_TIME_absolute_ntoh (m->creation_time); | ||
757 | |||
746 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# ephemeral keys received"), | 758 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# ephemeral keys received"), |
747 | 1, GNUNET_NO); | 759 | 1, GNUNET_NO); |
748 | 760 | ||
@@ -774,8 +786,6 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, | |||
774 | GNUNET_break_op (0); | 786 | GNUNET_break_op (0); |
775 | return; | 787 | return; |
776 | } | 788 | } |
777 | start_t = GNUNET_TIME_absolute_ntoh (m->creation_time); | ||
778 | end_t = GNUNET_TIME_absolute_ntoh (m->expiration_time); | ||
779 | now = GNUNET_TIME_absolute_get (); | 789 | now = GNUNET_TIME_absolute_get (); |
780 | if ( (end_t.abs_value < GNUNET_TIME_absolute_subtract (now, REKEY_TOLERANCE).abs_value) || | 790 | if ( (end_t.abs_value < GNUNET_TIME_absolute_subtract (now, REKEY_TOLERANCE).abs_value) || |
781 | (start_t.abs_value > GNUNET_TIME_absolute_add (now, REKEY_TOLERANCE).abs_value) ) | 791 | (start_t.abs_value > GNUNET_TIME_absolute_add (now, REKEY_TOLERANCE).abs_value) ) |