diff options
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_specific_type.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_specific_type.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/namestore/test_namestore_api_lookup_specific_type.c b/src/namestore/test_namestore_api_lookup_specific_type.c index 4d2aa1cfe..49988ed3f 100644 --- a/src/namestore/test_namestore_api_lookup_specific_type.c +++ b/src/namestore/test_namestore_api_lookup_specific_type.c | |||
@@ -48,11 +48,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
48 | 48 | ||
49 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 49 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
50 | 50 | ||
51 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 51 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
52 | 52 | ||
53 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 53 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
54 | 54 | ||
55 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 55 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
56 | 56 | ||
57 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; | 57 | static struct GNUNET_CRYPTO_ShortHashCode s_zone; |
58 | 58 | ||
@@ -76,7 +76,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
76 | GNUNET_NAMESTORE_disconnect (nsh); | 76 | GNUNET_NAMESTORE_disconnect (nsh); |
77 | nsh = NULL; | 77 | nsh = NULL; |
78 | if (privkey != NULL) | 78 | if (privkey != NULL) |
79 | GNUNET_CRYPTO_rsa_key_free (privkey); | 79 | GNUNET_CRYPTO_ecc_key_free (privkey); |
80 | privkey = NULL; | 80 | privkey = NULL; |
81 | GNUNET_free_non_null (s_name); | 81 | GNUNET_free_non_null (s_name); |
82 | res = 1; | 82 | res = 1; |
@@ -100,7 +100,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
100 | GNUNET_free (s_rd); | 100 | GNUNET_free (s_rd); |
101 | GNUNET_free_non_null (s_name); | 101 | GNUNET_free_non_null (s_name); |
102 | if (privkey != NULL) | 102 | if (privkey != NULL) |
103 | GNUNET_CRYPTO_rsa_key_free (privkey); | 103 | GNUNET_CRYPTO_ecc_key_free (privkey); |
104 | privkey = NULL; | 104 | privkey = NULL; |
105 | if (nsh != NULL) | 105 | if (nsh != NULL) |
106 | GNUNET_NAMESTORE_disconnect (nsh); | 106 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -110,18 +110,18 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
110 | 110 | ||
111 | static void | 111 | static void |
112 | name_lookup_existing_record_type (void *cls, | 112 | name_lookup_existing_record_type (void *cls, |
113 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 113 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
114 | struct GNUNET_TIME_Absolute expire, | 114 | struct GNUNET_TIME_Absolute expire, |
115 | const char *n, | 115 | const char *n, |
116 | unsigned int rd_count, | 116 | unsigned int rd_count, |
117 | const struct GNUNET_NAMESTORE_RecordData *rd, | 117 | const struct GNUNET_NAMESTORE_RecordData *rd, |
118 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 118 | const struct GNUNET_CRYPTO_EccSignature *signature) |
119 | { | 119 | { |
120 | int failed = GNUNET_NO; | 120 | int failed = GNUNET_NO; |
121 | 121 | ||
122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore returned %u records\n", rd_count); | 122 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore returned %u records\n", rd_count); |
123 | 123 | ||
124 | if ((NULL == n) || (0 != memcmp(zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))) | 124 | if ((NULL == n) || (0 != memcmp(zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded)))) |
125 | { | 125 | { |
126 | GNUNET_break(0); | 126 | GNUNET_break(0); |
127 | failed = GNUNET_YES; | 127 | failed = GNUNET_YES; |
@@ -156,12 +156,12 @@ name_lookup_existing_record_type (void *cls, | |||
156 | 156 | ||
157 | static void | 157 | static void |
158 | name_lookup_non_existing_record_type (void *cls, | 158 | name_lookup_non_existing_record_type (void *cls, |
159 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 159 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
160 | struct GNUNET_TIME_Absolute expire, | 160 | struct GNUNET_TIME_Absolute expire, |
161 | const char *n, | 161 | const char *n, |
162 | unsigned int rd_count, | 162 | unsigned int rd_count, |
163 | const struct GNUNET_NAMESTORE_RecordData *rd, | 163 | const struct GNUNET_NAMESTORE_RecordData *rd, |
164 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 164 | const struct GNUNET_CRYPTO_EccSignature *signature) |
165 | { | 165 | { |
166 | int failed = GNUNET_NO; | 166 | int failed = GNUNET_NO; |
167 | /* We expect zone key != NULL, name != NULL, rd_count 0, rd NULL, signature NULL */ | 167 | /* We expect zone key != NULL, name != NULL, rd_count 0, rd NULL, signature NULL */ |
@@ -280,11 +280,11 @@ run (void *cls, | |||
280 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 280 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
281 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 281 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
282 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 282 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
283 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 283 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
284 | GNUNET_free (hostkey_file); | 284 | GNUNET_free (hostkey_file); |
285 | GNUNET_assert (privkey != NULL); | 285 | GNUNET_assert (privkey != NULL); |
286 | /* get public key */ | 286 | /* get public key */ |
287 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 287 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
288 | 288 | ||
289 | /* create record */ | 289 | /* create record */ |
290 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 290 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -300,7 +300,7 @@ run (void *cls, | |||
300 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 300 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
301 | 301 | ||
302 | /* create random zone hash */ | 302 | /* create random zone hash */ |
303 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 303 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
304 | nsh = GNUNET_NAMESTORE_connect (cfg); | 304 | nsh = GNUNET_NAMESTORE_connect (cfg); |
305 | GNUNET_break (NULL != nsh); | 305 | GNUNET_break (NULL != nsh); |
306 | GNUNET_break (s_rd != NULL); | 306 | GNUNET_break (s_rd != NULL); |