aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gns_tld_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gns_tld_api.c')
-rw-r--r--src/gns/gns_tld_api.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c
index 3ebf07db6..b883662ad 100644
--- a/src/gns/gns_tld_api.c
+++ b/src/gns/gns_tld_api.c
@@ -167,7 +167,7 @@ process_lookup_result (void *cls,
167 */ 167 */
168static void 168static void
169lookup_with_public_key (struct GNUNET_GNS_LookupWithTldRequest *ltr, 169lookup_with_public_key (struct GNUNET_GNS_LookupWithTldRequest *ltr,
170 const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) 170 const struct GNUNET_IDENTITY_PublicKey *pkey)
171{ 171{
172 ltr->lr = GNUNET_GNS_lookup (ltr->gns_handle, 172 ltr->lr = GNUNET_GNS_lookup (ltr->gns_handle,
173 ltr->name, 173 ltr->name,
@@ -190,11 +190,11 @@ lookup_with_public_key (struct GNUNET_GNS_LookupWithTldRequest *ltr,
190 */ 190 */
191static void 191static void
192identity_zone_cb (void *cls, 192identity_zone_cb (void *cls,
193 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, 193 const struct GNUNET_IDENTITY_PrivateKey *priv,
194 const char *ego_name) 194 const char *ego_name)
195{ 195{
196 struct GNUNET_GNS_LookupWithTldRequest *ltr = cls; 196 struct GNUNET_GNS_LookupWithTldRequest *ltr = cls;
197 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 197 struct GNUNET_IDENTITY_PublicKey pkey;
198 198
199 ltr->id_co = NULL; 199 ltr->id_co = NULL;
200 if (NULL == priv) 200 if (NULL == priv)
@@ -219,7 +219,7 @@ identity_zone_cb (void *cls,
219 ltr->options = GNUNET_GNS_LO_NO_DHT; 219 ltr->options = GNUNET_GNS_LO_NO_DHT;
220 else 220 else
221 ltr->options = GNUNET_GNS_LO_LOCAL_MASTER; 221 ltr->options = GNUNET_GNS_LO_LOCAL_MASTER;
222 GNUNET_CRYPTO_ecdsa_key_get_public (priv, &pkey); 222 GNUNET_IDENTITY_key_get_public (priv, &pkey);
223 lookup_with_public_key (ltr, &pkey); 223 lookup_with_public_key (ltr, &pkey);
224} 224}
225 225
@@ -249,7 +249,7 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
249 const char *tld; 249 const char *tld;
250 char *dot_tld; 250 char *dot_tld;
251 char *zonestr; 251 char *zonestr;
252 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 252 struct GNUNET_IDENTITY_PublicKey pkey;
253 253
254 ltr = GNUNET_new (struct GNUNET_GNS_LookupWithTldRequest); 254 ltr = GNUNET_new (struct GNUNET_GNS_LookupWithTldRequest);
255 ltr->gns_handle = handle; 255 ltr->gns_handle = handle;
@@ -261,8 +261,10 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
261 /* start with trivial case: TLD is zkey */ 261 /* start with trivial case: TLD is zkey */
262 tld = get_tld (ltr->name); 262 tld = get_tld (ltr->name);
263 if (GNUNET_OK == 263 if (GNUNET_OK ==
264 GNUNET_CRYPTO_ecdsa_public_key_from_string (tld, strlen (tld), &pkey)) 264 GNUNET_IDENTITY_public_key_from_string (tld, &pkey))
265 { 265 {
266 LOG (GNUNET_ERROR_TYPE_DEBUG,
267 "`%s' seems to be a valid zone key\n", tld);
266 eat_tld (ltr->name, tld); 268 eat_tld (ltr->name, tld);
267 lookup_with_public_key (ltr, &pkey); 269 lookup_with_public_key (ltr, &pkey);
268 return ltr; 270 return ltr;
@@ -281,9 +283,8 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
281 &zonestr)) 283 &zonestr))
282 { 284 {
283 if (GNUNET_OK != 285 if (GNUNET_OK !=
284 GNUNET_CRYPTO_ecdsa_public_key_from_string (zonestr, 286 GNUNET_IDENTITY_public_key_from_string (zonestr,
285 strlen (zonestr), 287 &pkey))
286 &pkey))
287 { 288 {
288 GNUNET_log_config_invalid ( 289 GNUNET_log_config_invalid (
289 GNUNET_ERROR_TYPE_ERROR, 290 GNUNET_ERROR_TYPE_ERROR,
@@ -304,6 +305,8 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
304 } 305 }
305 GNUNET_free (dot_tld); 306 GNUNET_free (dot_tld);
306 } 307 }
308 LOG (GNUNET_ERROR_TYPE_DEBUG,
309 "`%s' should be a valid ego\n", ltr->name);
307 ltr->id_co = 310 ltr->id_co =
308 GNUNET_IDENTITY_ego_lookup_by_suffix (ltr->gns_handle->cfg, 311 GNUNET_IDENTITY_ego_lookup_by_suffix (ltr->gns_handle->cfg,
309 ltr->name, 312 ltr->name,