diff options
-rw-r--r-- | src/block/plugin_block_dns.c | 23 | ||||
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 5 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/block/plugin_block_dns.c b/src/block/plugin_block_dns.c index 4321baf34..681a659ae 100644 --- a/src/block/plugin_block_dns.c +++ b/src/block/plugin_block_dns.c | |||
@@ -67,21 +67,36 @@ block_plugin_dns_evaluate (void *cls, | |||
67 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; | 67 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; |
68 | 68 | ||
69 | if (reply_block_size != sizeof(struct GNUNET_DNS_Record)) | 69 | if (reply_block_size != sizeof(struct GNUNET_DNS_Record)) |
70 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 70 | { |
71 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DNS-Block is invalid: reply_block_size=%d != %d\n", reply_block_size, sizeof(struct GNUNET_DNS_Record)); | ||
72 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | ||
73 | } | ||
71 | 74 | ||
72 | const struct GNUNET_DNS_Record* rec = reply_block; | 75 | const struct GNUNET_DNS_Record* rec = reply_block; |
73 | 76 | ||
74 | if (ntohl(rec->purpose.size) != sizeof(struct GNUNET_DNS_Record) - sizeof(struct GNUNET_CRYPTO_RsaSignature)) | 77 | if (ntohl(rec->purpose.size) != sizeof(struct GNUNET_DNS_Record) - sizeof(struct GNUNET_CRYPTO_RsaSignature)) |
75 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 78 | { |
79 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | ||
80 | "DNS-Block is invalid: rec->purpose.size=%d != %d\n", | ||
81 | ntohl(rec->purpose.size), | ||
82 | sizeof(struct GNUNET_DNS_Record) - sizeof(struct GNUNET_CRYPTO_RsaSignature)); | ||
83 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | ||
84 | } | ||
76 | 85 | ||
77 | if (GNUNET_TIME_relative_get_zero().rel_value == GNUNET_TIME_absolute_get_remaining(rec->expiration_time).rel_value) | 86 | if (GNUNET_TIME_relative_get_zero().rel_value == GNUNET_TIME_absolute_get_remaining(rec->expiration_time).rel_value) |
78 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 87 | { |
88 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DNS-Block is invalid: Timeout\n"); | ||
89 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | ||
90 | } | ||
79 | 91 | ||
80 | if (GNUNET_OK != GNUNET_CRYPTO_rsa_verify (htonl(GNUNET_SIGNATURE_PURPOSE_DNS_RECORD), | 92 | if (GNUNET_OK != GNUNET_CRYPTO_rsa_verify (htonl(GNUNET_SIGNATURE_PURPOSE_DNS_RECORD), |
81 | &rec->purpose, | 93 | &rec->purpose, |
82 | &rec->signature, | 94 | &rec->signature, |
83 | &rec->peer)) | 95 | &rec->peer)) |
84 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 96 | { |
97 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DNS-Block is invalid: invalid signature\n"); | ||
98 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | ||
99 | } | ||
85 | 100 | ||
86 | /* How to decide whether there are no more? */ | 101 | /* How to decide whether there are no more? */ |
87 | return GNUNET_BLOCK_EVALUATION_OK_MORE; | 102 | return GNUNET_BLOCK_EVALUATION_OK_MORE; |
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index 85ec9ac82..b8488d3e1 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c | |||
@@ -552,8 +552,9 @@ publish_name (void *cls, | |||
552 | GNUNET_CRYPTO_rsa_key_free(my_private_key); | 552 | GNUNET_CRYPTO_rsa_key_free(my_private_key); |
553 | 553 | ||
554 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 554 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
555 | "Putting with key %08x\n", | 555 | "Putting with key %08x, size = %d\n", |
556 | *((unsigned int*)&data.service_descriptor)); | 556 | *((unsigned int*)&data.service_descriptor), |
557 | size); | ||
557 | 558 | ||
558 | GNUNET_DHT_put(dht, | 559 | GNUNET_DHT_put(dht, |
559 | &data.service_descriptor, | 560 | &data.service_descriptor, |