diff options
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_public.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_public.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c index 6640f47ed..83a5a78f6 100644 --- a/src/namestore/test_namestore_api_lookup_public.c +++ b/src/namestore/test_namestore_api_lookup_public.c | |||
@@ -42,7 +42,7 @@ static struct GNUNET_NAMECACHE_Handle *nch; | |||
42 | 42 | ||
43 | static struct GNUNET_SCHEDULER_Task *endbadly_task; | 43 | static struct GNUNET_SCHEDULER_Task *endbadly_task; |
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; | 45 | static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | 47 | static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; |
48 | 48 | ||
@@ -66,11 +66,6 @@ cleanup () | |||
66 | GNUNET_NAMECACHE_disconnect (nch); | 66 | GNUNET_NAMECACHE_disconnect (nch); |
67 | nch = NULL; | 67 | nch = NULL; |
68 | } | 68 | } |
69 | if (NULL != privkey) | ||
70 | { | ||
71 | GNUNET_free (privkey); | ||
72 | privkey = NULL; | ||
73 | } | ||
74 | GNUNET_SCHEDULER_shutdown (); | 69 | GNUNET_SCHEDULER_shutdown (); |
75 | } | 70 | } |
76 | 71 | ||
@@ -178,7 +173,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
178 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); | 173 | (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); |
179 | 174 | ||
180 | /* Create derived hash */ | 175 | /* Create derived hash */ |
181 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); | 176 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
177 | &pubkey); | ||
182 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, name, &derived_hash); | 178 | GNUNET_GNSRECORD_query_from_public_key (&pubkey, name, &derived_hash); |
183 | 179 | ||
184 | ncqe = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash, | 180 | ncqe = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash, |
@@ -197,9 +193,8 @@ run (void *cls, | |||
197 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 193 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
198 | &endbadly, | 194 | &endbadly, |
199 | NULL); | 195 | NULL); |
200 | privkey = GNUNET_CRYPTO_ecdsa_key_create (); | 196 | GNUNET_CRYPTO_ecdsa_key_create (&privkey); |
201 | GNUNET_assert (privkey != NULL); | 197 | GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, |
202 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, | ||
203 | &pubkey); | 198 | &pubkey); |
204 | 199 | ||
205 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; | 200 | rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us + 1000000000; |
@@ -213,8 +208,13 @@ run (void *cls, | |||
213 | nch = GNUNET_NAMECACHE_connect (cfg); | 208 | nch = GNUNET_NAMECACHE_connect (cfg); |
214 | GNUNET_break (NULL != nsh); | 209 | GNUNET_break (NULL != nsh); |
215 | GNUNET_break (NULL != nch); | 210 | GNUNET_break (NULL != nch); |
216 | nsqe = GNUNET_NAMESTORE_records_store (nsh, privkey, name, | 211 | nsqe = GNUNET_NAMESTORE_records_store (nsh, |
217 | 1, &rd, &put_cont, (void *) name); | 212 | &privkey, |
213 | name, | ||
214 | 1, | ||
215 | &rd, | ||
216 | &put_cont, | ||
217 | (void *) name); | ||
218 | if (NULL == nsqe) | 218 | if (NULL == nsqe) |
219 | { | 219 | { |
220 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 220 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |