diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-09 14:14:01 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-09 14:14:01 +0000 |
commit | 5e828dc0248330d772913795257b3fda14fe9552 (patch) | |
tree | 362ecdb95dcb89c56a7f20d31b06efa7351fe8ba /src/namestore/test_namestore_api_zone_iteration_stop.c | |
parent | 780fdda9a42441ecf36482461ebd35e4ec5c7510 (diff) | |
download | gnunet-5e828dc0248330d772913795257b3fda14fe9552.tar.gz gnunet-5e828dc0248330d772913795257b3fda14fe9552.zip |
- changes to signing verfifying: includes block expiration
Diffstat (limited to 'src/namestore/test_namestore_api_zone_iteration_stop.c')
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration_stop.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index 419a058fa..47b09a00c 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c | |||
@@ -226,7 +226,7 @@ void zone_proc (void *cls, | |||
226 | { | 226 | { |
227 | 227 | ||
228 | /* verify signature returned from name store */ | 228 | /* verify signature returned from name store */ |
229 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(zone_key, name, rd_count, rd, signature)) | 229 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(zone_key, expire, name, rd_count, rd, signature)) |
230 | { | 230 | { |
231 | failed = GNUNET_YES; | 231 | failed = GNUNET_YES; |
232 | GNUNET_break (0); | 232 | GNUNET_break (0); |
@@ -249,7 +249,7 @@ void zone_proc (void *cls, | |||
249 | failed = GNUNET_YES; | 249 | failed = GNUNET_YES; |
250 | GNUNET_break (0); | 250 | GNUNET_break (0); |
251 | } | 251 | } |
252 | if (0 != memcmp (signature, sig_1, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 252 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey, expire, s_name_1, 1, s_rd_1, signature)) |
253 | { | 253 | { |
254 | failed = GNUNET_YES; | 254 | failed = GNUNET_YES; |
255 | GNUNET_break (0); | 255 | GNUNET_break (0); |
@@ -271,7 +271,7 @@ void zone_proc (void *cls, | |||
271 | GNUNET_break (0); | 271 | GNUNET_break (0); |
272 | } | 272 | } |
273 | 273 | ||
274 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey2, s_name_2, 1, s_rd_2, signature)) | 274 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey, expire, s_name_2, 1, s_rd_2, signature)) |
275 | { | 275 | { |
276 | failed = GNUNET_YES; | 276 | failed = GNUNET_YES; |
277 | GNUNET_break (0); | 277 | GNUNET_break (0); |
@@ -292,7 +292,7 @@ void zone_proc (void *cls, | |||
292 | failed = GNUNET_YES; | 292 | failed = GNUNET_YES; |
293 | GNUNET_break (0); | 293 | GNUNET_break (0); |
294 | } | 294 | } |
295 | if (0 != memcmp (signature, sig_3, sizeof (struct GNUNET_CRYPTO_RsaSignature))) | 295 | if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey2, expire, s_name_3, 1, s_rd_3, signature)) |
296 | { | 296 | { |
297 | failed = GNUNET_YES; | 297 | failed = GNUNET_YES; |
298 | GNUNET_break (0); | 298 | GNUNET_break (0); |
@@ -446,7 +446,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
446 | 446 | ||
447 | GNUNET_asprintf(&s_name_1, "dummy1"); | 447 | GNUNET_asprintf(&s_name_1, "dummy1"); |
448 | s_rd_1 = create_record(1); | 448 | s_rd_1 = create_record(1); |
449 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_name_1, s_rd_1, 1); | 449 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1[0].expiration, s_name_1, s_rd_1, 1); |
450 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); | 450 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); |
451 | 451 | ||
452 | 452 | ||
@@ -454,14 +454,14 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
454 | GNUNET_asprintf(&s_name_2, "dummy2"); | 454 | GNUNET_asprintf(&s_name_2, "dummy2"); |
455 | s_rd_2 = create_record(1); | 455 | s_rd_2 = create_record(1); |
456 | 456 | ||
457 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_name_2, s_rd_2, 1); | 457 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2[0].expiration, s_name_2, s_rd_2, 1); |
458 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); | 458 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); |
459 | 459 | ||
460 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); | 460 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); |
461 | /* name in different zone */ | 461 | /* name in different zone */ |
462 | GNUNET_asprintf(&s_name_3, "dummy3"); | 462 | GNUNET_asprintf(&s_name_3, "dummy3"); |
463 | s_rd_3 = create_record(1); | 463 | s_rd_3 = create_record(1); |
464 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_name_3, s_rd_3, 1); | 464 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3[0].expiration, s_name_3, s_rd_3, 1); |
465 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL); | 465 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL); |
466 | } | 466 | } |
467 | 467 | ||