From defe6ca74853b18bfe38d379859811b39edc75a0 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 9 Mar 2012 12:04:06 +0000 Subject: [PATCH] - mod test_case --- src/namestore/test_namestore_api_zone_iteration.c | 15 ++++++++++++++- .../test_namestore_api_zone_iteration_stop.c | 13 +++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index f06411061..ffc482e0d 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c @@ -219,6 +219,13 @@ void zone_proc (void *cls, } else { + /* verify signature returned from name store */ + if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(zone_key, name, rd_count, rd, signature)) + { + failed = GNUNET_YES; + GNUNET_break (0); + } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Comparing results name %s \n", name); if (0 == strcmp (name, s_name_1)) { @@ -277,6 +284,12 @@ void zone_proc (void *cls, failed = GNUNET_YES; GNUNET_break (0); } + if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(zone_key, name, rd_count, rd, signature)) + { + failed = GNUNET_YES; + GNUNET_break (0); + } + if (0 != memcmp (signature, sig_3, sizeof (struct GNUNET_CRYPTO_RsaSignature))) { failed = GNUNET_YES; @@ -432,7 +445,7 @@ run (void *cls, char *const *args, const char *cfgfile, /* name in different zone */ GNUNET_asprintf(&s_name_3, "dummy3"); s_rd_3 = create_record(1); - sig_3 = GNUNET_NAMESTORE_create_signature(privkey, s_name_3, s_rd_3, 1); + sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_name_3, s_rd_3, 1); GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_absolute_get_forever(), 1, s_rd_3, sig_3, &put_cont, NULL); } diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index ef55df62f..c99d91b63 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c @@ -224,6 +224,15 @@ void zone_proc (void *cls, } else { + + /* verify signature returned from name store */ + if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(zone_key, name, rd_count, rd, signature)) + { + failed = GNUNET_YES; + GNUNET_break (0); + } + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Comparing results name %s \n", name); if (0 == strcmp (name, s_name_1)) { /* name_1 */ @@ -261,8 +270,8 @@ void zone_proc (void *cls, failed = GNUNET_YES; GNUNET_break (0); } - GNUNET_assert (GNUNET_OK == GNUNET_NAMESTORE_verify_signature(&pubkey2, s_name_2, rd_count, rd, sig_2)); - if (0 != memcmp (signature, sig_2, sizeof (struct GNUNET_CRYPTO_RsaSignature))) + + if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature(&pubkey2, s_name_2, 1, s_rd_2, signature)) { failed = GNUNET_YES; GNUNET_break (0); -- 2.25.1