summaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_zone_iteration.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/test_namestore_api_zone_iteration.c')
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index d69b7cc62..a363ee28d 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -37,9 +37,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
static struct GNUNET_SCHEDULER_Task *endbadly_task;
-static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey;
-static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey2;
+static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey2;
static struct GNUNET_NAMESTORE_ZoneIterator *zi;
@@ -88,32 +88,22 @@ end (void *cls)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = NULL;
}
- if (NULL != privkey)
- {
- GNUNET_free (privkey);
- privkey = NULL;
- }
- if (NULL != privkey2)
- {
- GNUNET_free (privkey2);
- privkey2 = NULL;
- }
GNUNET_free_non_null (s_name_1);
GNUNET_free_non_null (s_name_2);
GNUNET_free_non_null (s_name_3);
if (NULL != s_rd_1)
{
- GNUNET_free ((void *) s_rd_1->data);
+ GNUNET_free_nz ((void *) s_rd_1->data);
GNUNET_free (s_rd_1);
}
if (NULL != s_rd_2)
{
- GNUNET_free ((void *) s_rd_2->data);
+ GNUNET_free_nz ((void *) s_rd_2->data);
GNUNET_free (s_rd_2);
}
if (NULL != s_rd_3)
{
- GNUNET_free ((void *) s_rd_3->data);
+ GNUNET_free_nz ((void *) s_rd_3->data);
GNUNET_free (s_rd_3);
}
if (NULL != nsh)
@@ -161,7 +151,7 @@ zone_proc (void *cls,
GNUNET_assert (NULL != zone);
if (0 == GNUNET_memcmp (zone,
- privkey))
+ &privkey))
{
if (0 == strcmp (label, s_name_1))
{
@@ -207,7 +197,7 @@ zone_proc (void *cls,
}
}
else if (0 == GNUNET_memcmp (zone,
- privkey2))
+ &privkey2))
{
if (0 == strcmp (label, s_name_3))
{
@@ -382,9 +372,11 @@ empty_zone_end (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Using zonekey file `%s' \n",
hostkey_file);
- privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
+ GNUNET_assert (GNUNET_SYSERR !=
+ GNUNET_CRYPTO_ecdsa_key_from_file (hostkey_file,
+ GNUNET_YES,
+ &privkey));
GNUNET_free (hostkey_file);
- GNUNET_assert (privkey != NULL);
GNUNET_asprintf (&hostkey_file,
"zonefiles%s%s",
@@ -393,16 +385,18 @@ empty_zone_end (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Using zonekey file `%s' \n",
hostkey_file);
- privkey2 = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file);
+ GNUNET_assert (GNUNET_SYSERR !=
+ GNUNET_CRYPTO_ecdsa_key_from_file (hostkey_file,
+ GNUNET_YES,
+ &privkey2));
GNUNET_free (hostkey_file);
- GNUNET_assert (privkey2 != NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n");
GNUNET_asprintf (&s_name_1, "dummy1");
s_rd_1 = create_record (1);
GNUNET_NAMESTORE_records_store (nsh,
- privkey,
+ &privkey,
s_name_1,
1, s_rd_1,
&put_cont,
@@ -412,7 +406,7 @@ empty_zone_end (void *cls)
GNUNET_asprintf (&s_name_2, "dummy2");
s_rd_2 = create_record (1);
GNUNET_NAMESTORE_records_store (nsh,
- privkey,
+ &privkey,
s_name_2,
1, s_rd_2,
&put_cont,
@@ -423,7 +417,7 @@ empty_zone_end (void *cls)
GNUNET_asprintf (&s_name_3, "dummy3");
s_rd_3 = create_record (1);
GNUNET_NAMESTORE_records_store (nsh,
- privkey2,
+ &privkey2,
s_name_3,
1,
s_rd_3,