/**
* Public key of the peer.
*/
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
+ struct GNUNET_CRYPTO_EccPublicKey public_key;
/**
* The identity of the peer. FIXME: duplicated (also in 'address')
* if we don't have an existing entry and no public key was given
*/
static struct ValidationEntry *
-find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
- *public_key, const struct GNUNET_HELLO_Address *address)
+find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKey *public_key,
+ const struct GNUNET_HELLO_Address *address)
{
struct ValidationEntryMatchContext vemc;
struct ValidationEntry *ve;
struct ValidationEntry *ve;
struct GNUNET_PeerIdentity pid;
struct GNUNET_ATS_Information ats;
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
+ struct GNUNET_CRYPTO_EccPublicKey public_key;
if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0)
return GNUNET_OK; /* expired */
*/
static void
multicast_pong (void *cls,
- const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
- *public_key, struct GNUNET_TIME_Absolute valid_until,
+ const struct GNUNET_CRYPTO_EccPublicKey *public_key,
+ struct GNUNET_TIME_Absolute valid_until,
struct GNUNET_TIME_Absolute validation_block,
const struct GNUNET_HELLO_Address *address)
{
const struct TransportPingMessage *ping;
struct TransportPongMessage *pong;
struct GNUNET_TRANSPORT_PluginFunctions *papi;
- struct GNUNET_TRANSPORT_PluginFunctions *server_papi;
struct GNUNET_CRYPTO_EccSignature *sig_cache;
struct GNUNET_TIME_Absolute *sig_cache_exp;
const char *addr;
sig_cache = NULL;
sig_cache_exp = NULL;
-
+ papi = NULL;
if (alen > 0)
{
addrend = memchr (addr, '\0', alen);
GNUNET_free (plugin_name);
if (GNUNET_OK != papi->check_address (papi->cls, addrend, alen))
{
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop
+ ("# failed address checks during validation"), 1,
+ GNUNET_NO);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Address `%s' is not one of my addresses, not confirming PING\n",
GST_plugins_a2s (&address));
return;
}
else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Address `%s' is one of my addresses, confirming PING\n",
- GST_plugins_a2s (&address)); /* DEBUGGING*/
+ {
+ GNUNET_STATISTICS_update (GST_stats,
+ gettext_noop
+ ("# successful address checks during validation"), 1,
+ GNUNET_NO);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Address `%s' is one of my addresses, confirming PING\n",
+ GST_plugins_a2s (&address));
+ }
if (GNUNET_YES != GST_hello_test_address (&address, &sig_cache, &sig_cache_exp))
{
"Creating PONG signature to indicate ownership.\n");
*sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME);
pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp);
- GNUNET_assert (GNUNET_OK ==
+ if (GNUNET_OK !=
GNUNET_CRYPTO_ecc_sign (GST_my_private_key, &pong->purpose,
- sig_cache));
+ sig_cache))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Failed to create PONG signature for peer `%s'\n"), GNUNET_i2s (sender));
+ }
}
else
{
/**
* Public key of the peer whose address is being validated.
*/
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
+ struct GNUNET_CRYPTO_EccPublicKey public_key;
};