diff options
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_shadow_filter.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_shadow_filter.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/namestore/test_namestore_api_lookup_shadow_filter.c b/src/namestore/test_namestore_api_lookup_shadow_filter.c index 694c189e1..634a6a3c4 100644 --- a/src/namestore/test_namestore_api_lookup_shadow_filter.c +++ b/src/namestore/test_namestore_api_lookup_shadow_filter.c | |||
@@ -48,7 +48,7 @@ static struct GNUNET_SCHEDULER_Task *endbadly_task; | |||
48 | 48 | ||
49 | static struct GNUNET_SCHEDULER_Task *delayed_lookup_task; | 49 | static struct GNUNET_SCHEDULER_Task *delayed_lookup_task; |
50 | 50 | ||
51 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; | 51 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 53 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; |
54 | 54 | ||
@@ -82,11 +82,6 @@ cleanup () | |||
82 | GNUNET_NAMECACHE_disconnect (nch); | 82 | GNUNET_NAMECACHE_disconnect (nch); |
83 | nch = NULL; | 83 | nch = NULL; |
84 | } | 84 | } |
85 | if (NULL != privkey) | ||
86 | { | ||
87 | GNUNET_free (privkey); | ||
88 | privkey = NULL; | ||
89 | } | ||
90 | GNUNET_SCHEDULER_shutdown (); | 85 | GNUNET_SCHEDULER_shutdown (); |
91 | } | 86 | } |
92 | 87 | ||
@@ -272,7 +267,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
272 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); | 267 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); |
273 | 268 | ||
274 | /* Create derived hash */ | 269 | /* Create derived hash */ |
275 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); | 270 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
271 | &pubkey); | ||
276 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, TEST_NAME, &derived_hash); | 272 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, TEST_NAME, &derived_hash); |
277 | 273 | ||
278 | if (0 == GNUNET_TIME_absolute_get_remaining (record_expiration).rel_value_us) | 274 | if (0 == GNUNET_TIME_absolute_get_remaining (record_expiration).rel_value_us) |
@@ -301,9 +297,8 @@ run (void *cls, | |||
301 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 297 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
302 | &endbadly, | 298 | &endbadly, |
303 | NULL); | 299 | NULL); |
304 | privkey = GNUNET_CRYPTO_ecdsa_key_create (); | 300 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); |
305 | GNUNET_assert (privkey != NULL); | 301 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
306 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, | ||
307 | &pubkey); | 302 | &pubkey); |
308 | 303 | ||
309 | record_expiration = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), | 304 | record_expiration = GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), |
@@ -328,8 +323,13 @@ run (void *cls, | |||
328 | nch = GNUNET_NAMECACHE_connect (cfg); | 323 | nch = GNUNET_NAMECACHE_connect (cfg); |
329 | GNUNET_break (NULL != nsh); | 324 | GNUNET_break (NULL != nsh); |
330 | GNUNET_break (NULL != nch); | 325 | GNUNET_break (NULL != nch); |
331 | nsqe = GNUNET_NAMESTORE_records_store (nsh, privkey, TEST_NAME, | 326 | nsqe = GNUNET_NAMESTORE_records_store (nsh, |
332 | 2, records, &put_cont, NULL); | 327 | &privkey, |
328 | TEST_NAME, | ||
329 | 2, | ||
330 | records, | ||
331 | &put_cont, | ||
332 | NULL); | ||
333 | if (NULL == nsqe) | 333 | if (NULL == nsqe) |
334 | { | 334 | { |
335 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 335 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |