*/
int in_use;
+ /**
+ * Are we expecting a PONG message for this validation entry?
+ */
+ int expecting_pong;
};
gettext_noop
("# PING without HELLO messages sent"), 1,
GNUNET_NO);
+ ve->expecting_pong = GNUNET_YES;
}
}
&timeout_hello_validation, ve);
GNUNET_CONTAINER_multihashmap_put (validation_map, &address->peer.hashPubKey, ve,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
+ ve->expecting_pong = GNUNET_NO;
return ve;
}
address.address_length = addrlen;
address.transport_name = tname;
ve = find_validation_entry (NULL, &address);
- if (NULL == ve)
+ if ((NULL == ve) || (ve->expecting_pong == GNUNET_NO))
{
GNUNET_STATISTICS_update (GST_stats,
gettext_noop
return;
}
+ if (GNUNET_OK !=
+ GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
+ &pong->purpose, &pong->signature,
+ &ve->public_key))
+ {
+ GNUNET_break_op (0);
+ return;
+ }
+
+ ve->expecting_pong = GNUNET_NO;
if (GNUNET_TIME_absolute_get_remaining
(GNUNET_TIME_absolute_ntoh (pong->expiration)).rel_value == 0)
{
GNUNET_NO);
return;
}
- if (GNUNET_OK !=
- GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
- &pong->purpose, &pong->signature,
- &ve->public_key))
- {
- GNUNET_break_op (0);
- return;
- }
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Address validated for peer `%s' with plugin `%s': `%s'\n",