diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-05-23 12:37:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-05-23 12:37:23 +0000 |
commit | 0f08bc7705282c34fc0d14a6a88d87369ecb1614 (patch) | |
tree | 7c93163819e423368c5098d4e07b61071759687b /src/transport/gnunet-service-transport_validation.c | |
parent | 35075ac62588f57a7fa3823ea4ddc0c94607b6ab (diff) | |
download | gnunet-0f08bc7705282c34fc0d14a6a88d87369ecb1614.tar.gz gnunet-0f08bc7705282c34fc0d14a6a88d87369ecb1614.zip |
remove warn message and add documentation
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 71a96de12..d80818369 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -1208,23 +1208,24 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | |||
1208 | do_verify = GNUNET_YES; | 1208 | do_verify = GNUNET_YES; |
1209 | if (0 != GNUNET_TIME_absolute_get_remaining(ve->pong_sig_valid_until).rel_value) | 1209 | if (0 != GNUNET_TIME_absolute_get_remaining(ve->pong_sig_valid_until).rel_value) |
1210 | { | 1210 | { |
1211 | /* We have a cached and valid signature for this peer, | ||
1212 | * try to compare instead of verify */ | ||
1211 | if (0 == memcmp (&ve->pong_sig_cache, &pong->signature, sizeof (struct GNUNET_CRYPTO_EccSignature))) | 1213 | if (0 == memcmp (&ve->pong_sig_cache, &pong->signature, sizeof (struct GNUNET_CRYPTO_EccSignature))) |
1212 | { | 1214 | { |
1215 | /* signatures are identical, we can skip verification */ | ||
1213 | sig_res = GNUNET_OK; | 1216 | sig_res = GNUNET_OK; |
1214 | do_verify = GNUNET_NO; | 1217 | do_verify = GNUNET_NO; |
1215 | } | 1218 | } |
1216 | else | 1219 | else |
1217 | { | 1220 | { |
1218 | sig_res = GNUNET_SYSERR; | 1221 | sig_res = GNUNET_SYSERR; |
1219 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1222 | /* signatures do not match, we have to verify */ |
1220 | "Failed to check with cached signature: different signature on address %s:%s from peer `%s'\n", | ||
1221 | tname, GST_plugins_a2s (ve->address), | ||
1222 | GNUNET_i2s (sender)); | ||
1223 | } | 1223 | } |
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | if (GNUNET_YES == do_verify) | 1226 | if (GNUNET_YES == do_verify) |
1227 | { | 1227 | { |
1228 | /* Do expensive verification */ | ||
1228 | sig_res = GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN, | 1229 | sig_res = GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN, |
1229 | &pong->purpose, &pong->signature, | 1230 | &pong->purpose, &pong->signature, |
1230 | &ve->public_key); | 1231 | &ve->public_key); |