aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_lookup_private.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_private.c')
-rw-r--r--src/namestore/test_namestore_api_lookup_private.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c
index e2600855c..98fdb1b43 100644
--- a/src/namestore/test_namestore_api_lookup_private.c
+++ b/src/namestore/test_namestore_api_lookup_private.c
@@ -38,7 +38,7 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
38 38
39static struct GNUNET_SCHEDULER_Task *endbadly_task; 39static struct GNUNET_SCHEDULER_Task *endbadly_task;
40 40
41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 41static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey;
42 42
43static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; 43static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
44 44
@@ -58,11 +58,6 @@ cleanup ()
58 GNUNET_NAMESTORE_disconnect (nsh); 58 GNUNET_NAMESTORE_disconnect (nsh);
59 nsh = NULL; 59 nsh = NULL;
60 } 60 }
61 if (NULL != privkey)
62 {
63 GNUNET_free (privkey);
64 privkey = NULL;
65 }
66 GNUNET_SCHEDULER_shutdown (); 61 GNUNET_SCHEDULER_shutdown ();
67} 62}
68 63
@@ -103,7 +98,7 @@ lookup_it (void *cls,
103{ 98{
104 nsqe = NULL; 99 nsqe = NULL;
105 100
106 if (0 != GNUNET_memcmp (privkey, 101 if (0 != GNUNET_memcmp (&privkey,
107 zone)) 102 zone))
108 { 103 {
109 GNUNET_break (0); 104 GNUNET_break (0);
@@ -173,7 +168,7 @@ put_cont (void *cls,
173 } 168 }
174 /* Lookup */ 169 /* Lookup */
175 nsqe = GNUNET_NAMESTORE_records_lookup (nsh, 170 nsqe = GNUNET_NAMESTORE_records_lookup (nsh,
176 privkey, 171 &privkey,
177 name, 172 name,
178 &fail_cb, 173 &fail_cb,
179 NULL, 174 NULL,
@@ -192,9 +187,8 @@ run (void *cls,
192 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 187 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
193 &endbadly, 188 &endbadly,
194 NULL); 189 NULL);
195 privkey = GNUNET_CRYPTO_ecdsa_key_create (); 190 GNUNET_CRYPTO_ecdsa_key_create (&privkey);
196 GNUNET_assert (privkey != NULL); 191 GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, &pubkey);
197 GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey);
198 192
199 rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; 193 rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us;
200 rd.record_type = TEST_RECORD_TYPE; 194 rd.record_type = TEST_RECORD_TYPE;
@@ -206,7 +200,7 @@ run (void *cls,
206 nsh = GNUNET_NAMESTORE_connect (cfg); 200 nsh = GNUNET_NAMESTORE_connect (cfg);
207 GNUNET_break (NULL != nsh); 201 GNUNET_break (NULL != nsh);
208 nsqe = GNUNET_NAMESTORE_records_store (nsh, 202 nsqe = GNUNET_NAMESTORE_records_store (nsh,
209 privkey, 203 &privkey,
210 name, 204 name,
211 1, 205 1,
212 &rd, 206 &rd,