diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-04-03 11:45:16 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-04-03 11:45:16 +0000 |
commit | 8bc672c50f7c98af110bfbcdda2e1e7e7fd49d69 (patch) | |
tree | ecc39fcade3862f98ef268471736d06072ef8329 /src/gns/plugin_block_gns.c | |
parent | 83b8b3435ec2c06b8d4057648b077f9e8830a270 (diff) | |
download | gnunet-8bc672c50f7c98af110bfbcdda2e1e7e7fd49d69.tar.gz gnunet-8bc672c50f7c98af110bfbcdda2e1e7e7fd49d69.zip |
-array of fixes, finally finished test
Diffstat (limited to 'src/gns/plugin_block_gns.c')
-rw-r--r-- | src/gns/plugin_block_gns.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c index 46ce1249d..9d9513a09 100644 --- a/src/gns/plugin_block_gns.c +++ b/src/gns/plugin_block_gns.c | |||
@@ -215,16 +215,22 @@ block_plugin_gns_get_key (void *cls, enum GNUNET_BLOCK_Type type, | |||
215 | { | 215 | { |
216 | if (type != GNUNET_BLOCK_TYPE_GNS_NAMERECORD) | 216 | if (type != GNUNET_BLOCK_TYPE_GNS_NAMERECORD) |
217 | return GNUNET_SYSERR; | 217 | return GNUNET_SYSERR; |
218 | GNUNET_HashCode name_hash; | 218 | struct GNUNET_CRYPTO_ShortHashCode name_hash; |
219 | GNUNET_HashCode pkey_hash; | 219 | struct GNUNET_CRYPTO_ShortHashCode pkey_hash; |
220 | GNUNET_HashCode name_hash_double; | ||
221 | GNUNET_HashCode pkey_hash_double; | ||
222 | |||
220 | struct GNSNameRecordBlock *nrb = (struct GNSNameRecordBlock *)block; | 223 | struct GNSNameRecordBlock *nrb = (struct GNSNameRecordBlock *)block; |
221 | 224 | ||
222 | GNUNET_CRYPTO_hash(&nrb[1], strlen((char*)&nrb[1]), &name_hash); | 225 | GNUNET_CRYPTO_short_hash(&nrb[1], strlen((char*)&nrb[1]), &name_hash); |
223 | GNUNET_CRYPTO_hash(&nrb->public_key, | 226 | GNUNET_CRYPTO_short_hash(&nrb->public_key, |
224 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), | 227 | sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), |
225 | &pkey_hash); | 228 | &pkey_hash); |
229 | |||
230 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | ||
231 | GNUNET_CRYPTO_short_hash_double(&pkey_hash, &pkey_hash_double); | ||
226 | 232 | ||
227 | GNUNET_CRYPTO_hash_xor(&name_hash, &pkey_hash, key); | 233 | GNUNET_CRYPTO_hash_xor(&name_hash_double, &pkey_hash_double, key); |
228 | 234 | ||
229 | return GNUNET_OK; | 235 | return GNUNET_OK; |
230 | } | 236 | } |