aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_zone_to_name.c
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2020-10-01 21:13:43 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2020-11-12 16:57:45 +0100
commit8bf864c25bda97c1448b709a76a168834753ff86 (patch)
tree6ffccc18a3c112e035235c596006f8b13aca1be7 /src/namestore/test_namestore_api_zone_to_name.c
parent8fd7531e5841c9d9f80f821a3490a05934fee933 (diff)
downloadgnunet-8bf864c25bda97c1448b709a76a168834753ff86.tar.gz
gnunet-8bf864c25bda97c1448b709a76a168834753ff86.zip
adding the messenger service and its client-side library
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/namestore/test_namestore_api_zone_to_name.c')
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 94cc5c285..3fd10e4a1 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -42,11 +42,11 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
42 42
43static struct GNUNET_SCHEDULER_Task *endbadly_task; 43static struct GNUNET_SCHEDULER_Task *endbadly_task;
44 44
45static struct GNUNET_CRYPTO_EcdsaPrivateKey privkey; 45static struct GNUNET_IDENTITY_PrivateKey privkey;
46 46
47static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; 47static struct GNUNET_IDENTITY_PublicKey pubkey;
48 48
49static struct GNUNET_CRYPTO_EcdsaPublicKey s_zone_value; 49static struct GNUNET_IDENTITY_PublicKey s_zone_value;
50 50
51static char *s_name; 51static char *s_name;
52 52
@@ -92,7 +92,7 @@ end (void *cls)
92 92
93static void 93static void
94zone_to_name_proc (void *cls, 94zone_to_name_proc (void *cls,
95 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, 95 const struct GNUNET_IDENTITY_PrivateKey *zone_key,
96 const char *n, 96 const char *n,
97 unsigned int rd_count, 97 unsigned int rd_count,
98 const struct GNUNET_GNSRECORD_Data *rd) 98 const struct GNUNET_GNSRECORD_Data *rd)
@@ -203,20 +203,22 @@ run (void *cls,
203 GNUNET_SCHEDULER_add_shutdown (&end, 203 GNUNET_SCHEDULER_add_shutdown (&end,
204 NULL); 204 NULL);
205 GNUNET_asprintf (&s_name, "dummy"); 205 GNUNET_asprintf (&s_name, "dummy");
206 GNUNET_CRYPTO_ecdsa_key_create (&privkey); 206 privkey.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY);
207 GNUNET_CRYPTO_ecdsa_key_create (&privkey.ecdsa_key);
207 /* get public key */ 208 /* get public key */
208 GNUNET_CRYPTO_ecdsa_key_get_public (&privkey, 209 GNUNET_IDENTITY_key_get_public (&privkey,
209 &pubkey); 210 &pubkey);
210 211
211 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, 212 GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
212 &s_zone_value, 213 &s_zone_value,
213 sizeof(s_zone_value)); 214 sizeof(s_zone_value));
215 s_zone_value.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY);
214 { 216 {
215 struct GNUNET_GNSRECORD_Data rd; 217 struct GNUNET_GNSRECORD_Data rd;
216 218
217 rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; 219 rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us;
218 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; 220 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
219 rd.data_size = sizeof(s_zone_value); 221 rd.data_size = GNUNET_IDENTITY_key_get_length (&s_zone_value);
220 rd.data = &s_zone_value; 222 rd.data = &s_zone_value;
221 rd.flags = 0; 223 rd.flags = 0;
222 224