diff options
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_shadow.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_shadow.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c index 7daa6987c..08c428731 100644 --- a/src/namestore/test_namestore_api_lookup_shadow.c +++ b/src/namestore/test_namestore_api_lookup_shadow.c | |||
@@ -44,7 +44,7 @@ static struct GNUNET_NAMECACHE_Handle *nch; | |||
44 | 44 | ||
45 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 45 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; | 47 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; |
48 | 48 | ||
49 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 49 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; |
50 | 50 | ||
@@ -68,11 +68,6 @@ cleanup () | |||
68 | GNUNET_NAMECACHE_disconnect (nch); | 68 | GNUNET_NAMECACHE_disconnect (nch); |
69 | nch = NULL; | 69 | nch = NULL; |
70 | } | 70 | } |
71 | if (NULL != privkey) | ||
72 | { | ||
73 | GNUNET_free (privkey); | ||
74 | privkey = NULL; | ||
75 | } | ||
76 | GNUNET_SCHEDULER_shutdown (); | 71 | GNUNET_SCHEDULER_shutdown (); |
77 | } | 72 | } |
78 | 73 | ||
@@ -210,10 +205,14 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
210 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); | 205 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); |
211 | 206 | ||
212 | /* Create derived hash */ | 207 | /* Create derived hash */ |
213 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); | 208 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
214 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, name, &derived_hash); | 209 | &pubkey); |
210 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, | ||
211 | name, | ||
212 | &derived_hash); | ||
215 | 213 | ||
216 | ncqe = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash, | 214 | ncqe = GNUNET_NAMECACHE_lookup_block (nch, |
215 | &derived_hash, | ||
217 | &name_lookup_proc, (void *) name); | 216 | &name_lookup_proc, (void *) name); |
218 | } | 217 | } |
219 | 218 | ||
@@ -229,9 +228,8 @@ run (void *cls, | |||
229 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 228 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
230 | &endbadly, | 229 | &endbadly, |
231 | NULL); | 230 | NULL); |
232 | privkey = GNUNET_CRYPTO_ecdsa_key_create (); | 231 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); |
233 | GNUNET_assert (privkey != NULL); | 232 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
234 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, | ||
235 | &pubkey); | 233 | &pubkey); |
236 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; | 234 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; |
237 | rd.record_type = TEST_RECORD_TYPE; | 235 | rd.record_type = TEST_RECORD_TYPE; |
@@ -245,7 +243,7 @@ run (void *cls, | |||
245 | GNUNET_break (NULL != nsh); | 243 | GNUNET_break (NULL != nsh); |
246 | GNUNET_break (NULL != nch); | 244 | GNUNET_break (NULL != nch); |
247 | nsqe = GNUNET_NAMESTORE_records_store (nsh, | 245 | nsqe = GNUNET_NAMESTORE_records_store (nsh, |
248 | privkey, | 246 | &privkey, |
249 | name, | 247 | name, |
250 | 1, | 248 | 1, |
251 | &rd, | 249 | &rd, |