aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-08-31 18:07:56 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2022-08-31 18:07:56 +0200
commita964469a99fdcafe5d567be85a114ffc7a652d86 (patch)
tree4b99dcacc194185bad73c948ceaebef34c8e92ec /src/reclaim
parent4a2c758df3b20104580fc5ff9efc1d6cd7237bd0 (diff)
downloadgnunet-a964469a99fdcafe5d567be85a114ffc7a652d86.tar.gz
gnunet-a964469a99fdcafe5d567be85a114ffc7a652d86.zip
DID: change method name
Diffstat (limited to 'src/reclaim')
-rw-r--r--src/reclaim/did.h2
-rw-r--r--src/reclaim/did_core.c18
-rw-r--r--src/reclaim/gnunet-did.c15
3 files changed, 11 insertions, 24 deletions
diff --git a/src/reclaim/did.h b/src/reclaim/did.h
index 054bd29e4..4a3778f9d 100644
--- a/src/reclaim/did.h
+++ b/src/reclaim/did.h
@@ -21,7 +21,7 @@
21#ifndef RECLAIM_DID_H 21#ifndef RECLAIM_DID_H
22#define RECLAIM_DID_H 22#define RECLAIM_DID_H
23 23
24#define GNUNET_RECLAIM_DID_METHOD_PREFIX "did:reclaim:" 24#define GNUNET_RECLAIM_DID_METHOD_PREFIX "did:gns:"
25 25
26/** 26/**
27 * Create a DID string from an ego in the format 27 * Create a DID string from an ego in the format
diff --git a/src/reclaim/did_core.c b/src/reclaim/did_core.c
index 949ed6a69..8c5e6c812 100644
--- a/src/reclaim/did_core.c
+++ b/src/reclaim/did_core.c
@@ -65,17 +65,15 @@ DID_resolve_gns_lookup_cb (
65 void *cls_did_resolve_cb = ((struct DID_resolve_return *) cls)->cls; 65 void *cls_did_resolve_cb = ((struct DID_resolve_return *) cls)->cls;
66 free (cls); 66 free (cls);
67 67
68 if (rd_count != 1) 68 for (int i = 0; i < rd_count; i++) {
69 cb (GNUNET_NO, "An ego should only have one DID Document", 69 if (rd[i].record_type != GNUNET_GNSRECORD_TYPE_DID_DOCUMENT)
70 cls_did_resolve_cb); 70 continue;
71 71 did_document = (char *) rd[i].data;
72 if (rd[0].record_type == GNUNET_DNSPARSER_TYPE_TXT)
73 {
74 did_document = (char *) rd[0].data;
75 cb (GNUNET_OK, did_document, cls_did_resolve_cb); 72 cb (GNUNET_OK, did_document, cls_did_resolve_cb);
73 return;
76 } 74 }
77 else 75 cb (GNUNET_NO, "DID Document is not a DID_DOCUMENT record\n",
78 cb (GNUNET_NO, "DID Document is not a TXT record\n", cls_did_resolve_cb); 76 cls_did_resolve_cb);
79} 77}
80 78
81/** 79/**
@@ -109,7 +107,7 @@ DID_resolve (const char *did,
109 GNUNET_GNS_lookup (gns_handle, 107 GNUNET_GNS_lookup (gns_handle,
110 DID_DOCUMENT_LABEL, 108 DID_DOCUMENT_LABEL,
111 &pkey, 109 &pkey,
112 GNUNET_DNSPARSER_TYPE_TXT, 110 GNUNET_GNSRECORD_TYPE_DID_DOCUMENT,
113 GNUNET_GNS_LO_DEFAULT, 111 GNUNET_GNS_LO_DEFAULT,
114 &DID_resolve_gns_lookup_cb, 112 &DID_resolve_gns_lookup_cb,
115 cls_gns_lookup_cb); 113 cls_gns_lookup_cb);
diff --git a/src/reclaim/gnunet-did.c b/src/reclaim/gnunet-did.c
index 6f802aded..b2b4e9321 100644
--- a/src/reclaim/gnunet-did.c
+++ b/src/reclaim/gnunet-did.c
@@ -526,21 +526,10 @@ process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego,
526 return; 526 return;
527 } 527 }
528 528
529 // if (NULL == name)
530 // return;
531 // if ((1 == create) &&
532 // (0 == strncmp (name, egoname, strlen (egoname))) &&
533 // (1 != ego_exists))
534 // {
535 // fprintf (stderr, "%s already exists!\n", egoname);
536 // ego_exists = 1;
537 // return;
538 // }
539
540 if (1 == show_all) 529 if (1 == show_all)
541 { 530 {
542 did_str = DID_identity_to_did (ego); 531 did_str = DID_identity_to_did (ego);
543 printf ("%s\n", did_str); 532 printf ("%s:\n\t%s\n", name, did_str);
544 GNUNET_free (did_str); 533 GNUNET_free (did_str);
545 return; 534 return;
546 } 535 }
@@ -549,7 +538,7 @@ process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego,
549 if (0 == strncmp (name, egoname, strlen (egoname))) 538 if (0 == strncmp (name, egoname, strlen (egoname)))
550 { 539 {
551 did_str = DID_identity_to_did (ego); 540 did_str = DID_identity_to_did (ego);
552 printf ("%s\n", did_str); 541 printf ("%s:\n\t%s\n", name, did_str);
553 GNUNET_free (did_str); 542 GNUNET_free (did_str);
554 return; 543 return;
555 } 544 }