aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-10-14 19:47:32 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-10-15 12:11:18 +0200
commit96c802b46be51e5c45f34e2de823f787d26c2929 (patch)
tree457ccfd8f9a61563af86318739c4a8f964a57025 /src/gns
parentc14e3a2769ff0f15fdbb32797e37e43ce2344fa3 (diff)
downloadgnunet-96c802b46be51e5c45f34e2de823f787d26c2929.tar.gz
gnunet-96c802b46be51e5c45f34e2de823f787d26c2929.zip
- towards crypto agility; wip
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/gns.h2
-rw-r--r--src/gns/gns_api.c4
-rw-r--r--src/gns/gns_tld_api.c17
-rw-r--r--src/gns/gnunet-service-gns.c6
-rw-r--r--src/gns/gnunet-service-gns.h3
-rw-r--r--src/gns/gnunet-service-gns_interceptor.c2
-rw-r--r--src/gns/gnunet-service-gns_resolver.c22
-rw-r--r--src/gns/gnunet-service-gns_resolver.h2
8 files changed, 29 insertions, 29 deletions
diff --git a/src/gns/gns.h b/src/gns/gns.h
index a193632b7..d824742ad 100644
--- a/src/gns/gns.h
+++ b/src/gns/gns.h
@@ -48,7 +48,7 @@ struct LookupMessage
48 /** 48 /**
49 * Zone that is to be used for lookup 49 * Zone that is to be used for lookup
50 */ 50 */
51 struct GNUNET_CRYPTO_EcdsaPublicKey zone; 51 struct GNUNET_IDENTITY_PublicKey zone;
52 52
53 /** 53 /**
54 * Local options for where to look for results 54 * Local options for where to look for results
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index bf95bf340..841a0d240 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -343,7 +343,7 @@ GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr)
343struct GNUNET_GNS_LookupRequest * 343struct GNUNET_GNS_LookupRequest *
344GNUNET_GNS_lookup_limited (struct GNUNET_GNS_Handle *handle, 344GNUNET_GNS_lookup_limited (struct GNUNET_GNS_Handle *handle,
345 const char *name, 345 const char *name,
346 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, 346 const struct GNUNET_IDENTITY_PublicKey *zone,
347 uint32_t type, 347 uint32_t type,
348 enum GNUNET_GNS_LocalOptions options, 348 enum GNUNET_GNS_LocalOptions options,
349 uint16_t recursion_depth_limit, 349 uint16_t recursion_depth_limit,
@@ -411,7 +411,7 @@ GNUNET_GNS_lookup_limited (struct GNUNET_GNS_Handle *handle,
411struct GNUNET_GNS_LookupRequest* 411struct GNUNET_GNS_LookupRequest*
412GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, 412GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
413 const char *name, 413 const char *name,
414 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, 414 const struct GNUNET_IDENTITY_PublicKey *zone,
415 uint32_t type, 415 uint32_t type,
416 enum GNUNET_GNS_LocalOptions options, 416 enum GNUNET_GNS_LocalOptions options,
417 GNUNET_GNS_LookupResultProcessor proc, 417 GNUNET_GNS_LookupResultProcessor proc,
diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c
index 3ebf07db6..3eab6c109 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,7 +261,7 @@ 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 eat_tld (ltr->name, tld); 266 eat_tld (ltr->name, tld);
267 lookup_with_public_key (ltr, &pkey); 267 lookup_with_public_key (ltr, &pkey);
@@ -281,9 +281,8 @@ GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
281 &zonestr)) 281 &zonestr))
282 { 282 {
283 if (GNUNET_OK != 283 if (GNUNET_OK !=
284 GNUNET_CRYPTO_ecdsa_public_key_from_string (zonestr, 284 GNUNET_IDENTITY_public_key_from_string (zonestr,
285 strlen (zonestr), 285 &pkey))
286 &pkey))
287 { 286 {
288 GNUNET_log_config_invalid ( 287 GNUNET_log_config_invalid (
289 GNUNET_ERROR_TYPE_ERROR, 288 GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c
index 8c5b2d6c4..52300ae3b 100644
--- a/src/gns/gnunet-service-gns.c
+++ b/src/gns/gnunet-service-gns.c
@@ -123,7 +123,7 @@ struct GNS_TopLevelDomain
123 /** 123 /**
124 * Public key associated with the @a tld. 124 * Public key associated with the @a tld.
125 */ 125 */
126 struct GNUNET_CRYPTO_EcdsaPublicKey pkey; 126 struct GNUNET_IDENTITY_PublicKey pkey;
127 127
128 /** 128 /**
129 * Top-level domain as a string, including leading ".". 129 * Top-level domain as a string, including leading ".".
@@ -177,7 +177,7 @@ static struct GNS_TopLevelDomain *tld_tail;
177 */ 177 */
178int 178int
179GNS_find_tld (const char *tld_str, 179GNS_find_tld (const char *tld_str,
180 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey) 180 struct GNUNET_IDENTITY_PublicKey *pkey)
181{ 181{
182 if ('\0' == *tld_str) 182 if ('\0' == *tld_str)
183 return GNUNET_NO; 183 return GNUNET_NO;
@@ -485,7 +485,7 @@ read_service_conf (void *cls,
485 const char *option, 485 const char *option,
486 const char *value) 486 const char *value)
487{ 487{
488 struct GNUNET_CRYPTO_EcdsaPublicKey pk; 488 struct GNUNET_IDENTITY_PublicKey pk;
489 struct GNS_TopLevelDomain *tld; 489 struct GNS_TopLevelDomain *tld;
490 490
491 (void) cls; 491 (void) cls;
diff --git a/src/gns/gnunet-service-gns.h b/src/gns/gnunet-service-gns.h
index 2a432f8aa..d4fb9ec9f 100644
--- a/src/gns/gnunet-service-gns.h
+++ b/src/gns/gnunet-service-gns.h
@@ -26,6 +26,7 @@
26#ifndef GNUNET_SERVICE_GNS_H 26#ifndef GNUNET_SERVICE_GNS_H
27#define GNUNET_SERVICE_GNS_H 27#define GNUNET_SERVICE_GNS_H
28 28
29#include "gnunet_identity_service.h"
29 30
30/** 31/**
31 * Find GNS zone belonging to TLD @a tld. 32 * Find GNS zone belonging to TLD @a tld.
@@ -36,7 +37,7 @@
36 */ 37 */
37int 38int
38GNS_find_tld (const char *tld_str, 39GNS_find_tld (const char *tld_str,
39 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); 40 struct GNUNET_IDENTITY_PublicKey *pkey);
40 41
41 42
42/** 43/**
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c
index 19416a506..b53f4af6b 100644
--- a/src/gns/gnunet-service-gns_interceptor.c
+++ b/src/gns/gnunet-service-gns_interceptor.c
@@ -314,7 +314,7 @@ handle_dns_request (void *cls,
314{ 314{
315 struct GNUNET_DNSPARSER_Packet *p; 315 struct GNUNET_DNSPARSER_Packet *p;
316 struct InterceptLookupHandle *ilh; 316 struct InterceptLookupHandle *ilh;
317 struct GNUNET_CRYPTO_EcdsaPublicKey zone; 317 struct GNUNET_IDENTITY_PublicKey zone;
318 318
319 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 319 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
320 "Hijacked a DNS request. Processing.\n"); 320 "Hijacked a DNS request. Processing.\n");
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index cb75b23c7..b34402f81 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -173,7 +173,7 @@ struct AuthorityChain
173 /** 173 /**
174 * The zone of the GNS authority 174 * The zone of the GNS authority
175 */ 175 */
176 struct GNUNET_CRYPTO_EcdsaPublicKey gns_authority; 176 struct GNUNET_IDENTITY_PublicKey gns_authority;
177 177
178 struct 178 struct
179 { 179 {
@@ -305,7 +305,7 @@ struct GNS_ResolverHandle
305 /** 305 /**
306 * The top-level GNS authoritative zone to query 306 * The top-level GNS authoritative zone to query
307 */ 307 */
308 struct GNUNET_CRYPTO_EcdsaPublicKey authority_zone; 308 struct GNUNET_IDENTITY_PublicKey authority_zone;
309 309
310 /** 310 /**
311 * called when resolution phase finishes 311 * called when resolution phase finishes
@@ -1251,7 +1251,7 @@ handle_gns_cname_result (struct GNS_ResolverHandle *rh,
1251 const char *tld; 1251 const char *tld;
1252 struct AuthorityChain *ac; 1252 struct AuthorityChain *ac;
1253 int af; 1253 int af;
1254 struct GNUNET_CRYPTO_EcdsaPublicKey zone; 1254 struct GNUNET_IDENTITY_PublicKey zone;
1255 1255
1256 nlen = strlen (cname); 1256 nlen = strlen (cname);
1257 tld = GNS_get_tld (cname); 1257 tld = GNS_get_tld (cname);
@@ -1698,7 +1698,7 @@ recursive_pkey_resolution (struct GNS_ResolverHandle *rh,
1698 struct AuthorityChain *ac; 1698 struct AuthorityChain *ac;
1699 1699
1700 /* delegation to another zone */ 1700 /* delegation to another zone */
1701 if (sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) != 1701 if (sizeof(struct GNUNET_IDENTITY_PublicKey) !=
1702 rd->data_size) 1702 rd->data_size)
1703 { 1703 {
1704 GNUNET_break_op (0); 1704 GNUNET_break_op (0);
@@ -1711,7 +1711,7 @@ recursive_pkey_resolution (struct GNS_ResolverHandle *rh,
1711 ac->gns_authority = GNUNET_YES; 1711 ac->gns_authority = GNUNET_YES;
1712 GNUNET_memcpy (&ac->authority_info.gns_authority, 1712 GNUNET_memcpy (&ac->authority_info.gns_authority,
1713 rd->data, 1713 rd->data,
1714 sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)); 1714 sizeof(struct GNUNET_IDENTITY_PublicKey));
1715 ac->label = resolver_lookup_get_next_label (rh); 1715 ac->label = resolver_lookup_get_next_label (rh);
1716 /* add AC to tail */ 1716 /* add AC to tail */
1717 GNUNET_CONTAINER_DLL_insert_tail (rh->ac_head, 1717 GNUNET_CONTAINER_DLL_insert_tail (rh->ac_head,
@@ -1754,7 +1754,7 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1754 char *n; 1754 char *n;
1755 size_t off; 1755 size_t off;
1756 struct Gns2DnsPending *gp; 1756 struct Gns2DnsPending *gp;
1757 struct GNUNET_CRYPTO_EcdsaPublicKey zone; 1757 struct GNUNET_IDENTITY_PublicKey zone;
1758 struct sockaddr_in v4; 1758 struct sockaddr_in v4;
1759 struct sockaddr_in6 v6; 1759 struct sockaddr_in6 v6;
1760 1760
@@ -2258,9 +2258,9 @@ handle_gns_resolution_result (void *cls,
2258 2258
2259 case GNUNET_GNSRECORD_TYPE_PKEY: 2259 case GNUNET_GNSRECORD_TYPE_PKEY:
2260 { 2260 {
2261 struct GNUNET_CRYPTO_EcdsaPublicKey pub; 2261 struct GNUNET_IDENTITY_PublicKey pub;
2262 2262
2263 if (rd[i].data_size != sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)) 2263 if (rd[i].data_size != sizeof(struct GNUNET_IDENTITY_PublicKey))
2264 { 2264 {
2265 GNUNET_break_op (0); 2265 GNUNET_break_op (0);
2266 break; 2266 break;
@@ -2471,7 +2471,7 @@ handle_dht_response (void *cls,
2471 block = data; 2471 block = data;
2472 if (size != 2472 if (size !=
2473 ntohl (block->purpose.size) 2473 ntohl (block->purpose.size)
2474 + sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey) 2474 + sizeof(struct GNUNET_IDENTITY_PublicKey)
2475 + sizeof(struct GNUNET_CRYPTO_EcdsaSignature)) 2475 + sizeof(struct GNUNET_CRYPTO_EcdsaSignature))
2476 { 2476 {
2477 /* how did this pass DHT block validation!? */ 2477 /* how did this pass DHT block validation!? */
@@ -2594,7 +2594,7 @@ handle_namecache_block_response (void *cls,
2594 struct GNS_ResolverHandle *rh = cls; 2594 struct GNS_ResolverHandle *rh = cls;
2595 struct AuthorityChain *ac = rh->ac_tail; 2595 struct AuthorityChain *ac = rh->ac_tail;
2596 const char *label = ac->label; 2596 const char *label = ac->label;
2597 const struct GNUNET_CRYPTO_EcdsaPublicKey *auth = 2597 const struct GNUNET_IDENTITY_PublicKey *auth =
2598 &ac->authority_info.gns_authority; 2598 &ac->authority_info.gns_authority;
2599 struct GNUNET_HashCode query; 2599 struct GNUNET_HashCode query;
2600 2600
@@ -2857,7 +2857,7 @@ start_resolver_lookup (void *cls)
2857 * @return handle to cancel operation 2857 * @return handle to cancel operation
2858 */ 2858 */
2859struct GNS_ResolverHandle * 2859struct GNS_ResolverHandle *
2860GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, 2860GNS_resolver_lookup (const struct GNUNET_IDENTITY_PublicKey *zone,
2861 uint32_t record_type, 2861 uint32_t record_type,
2862 const char *name, 2862 const char *name,
2863 enum GNUNET_GNS_LocalOptions options, 2863 enum GNUNET_GNS_LocalOptions options,
diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h
index 3dab3c91a..b099c5d65 100644
--- a/src/gns/gnunet-service-gns_resolver.h
+++ b/src/gns/gnunet-service-gns_resolver.h
@@ -86,7 +86,7 @@ typedef void
86 * @return handle to cancel operation 86 * @return handle to cancel operation
87 */ 87 */
88struct GNS_ResolverHandle * 88struct GNS_ResolverHandle *
89GNS_resolver_lookup (const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, 89GNS_resolver_lookup (const struct GNUNET_IDENTITY_PublicKey *zone,
90 uint32_t record_type, 90 uint32_t record_type,
91 const char *name, 91 const char *name,
92 enum GNUNET_GNS_LocalOptions options, 92 enum GNUNET_GNS_LocalOptions options,