[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: DID: change method name
From: |
gnunet |
Subject: |
[gnunet] branch master updated: DID: change method name |
Date: |
Wed, 31 Aug 2022 18:08:00 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new a964469a9 DID: change method name
a964469a9 is described below
commit a964469a99fdcafe5d567be85a114ffc7a652d86
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Aug 31 18:07:56 2022 +0200
DID: change method name
---
po/POTFILES.in | 2 ++
src/reclaim/did.h | 2 +-
src/reclaim/did_core.c | 18 ++++++++----------
src/reclaim/gnunet-did.c | 15 ++-------------
4 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 343810ec1..aed3e00fb 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -295,6 +295,8 @@ src/pq/pq_prepare.c
src/pq/pq_query_helper.c
src/pq/pq_result_helper.c
src/pt/gnunet-daemon-pt.c
+src/reclaim/did_core.c
+src/reclaim/did_helper.c
src/reclaim/did_misc.c
src/reclaim/gnunet-did.c
src/reclaim/gnunet-reclaim.c
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 @@
#ifndef RECLAIM_DID_H
#define RECLAIM_DID_H
-#define GNUNET_RECLAIM_DID_METHOD_PREFIX "did:reclaim:"
+#define GNUNET_RECLAIM_DID_METHOD_PREFIX "did:gns:"
/**
* 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 (
void *cls_did_resolve_cb = ((struct DID_resolve_return *) cls)->cls;
free (cls);
- if (rd_count != 1)
- cb (GNUNET_NO, "An ego should only have one DID Document",
- cls_did_resolve_cb);
-
- if (rd[0].record_type == GNUNET_DNSPARSER_TYPE_TXT)
- {
- did_document = (char *) rd[0].data;
+ for (int i = 0; i < rd_count; i++) {
+ if (rd[i].record_type != GNUNET_GNSRECORD_TYPE_DID_DOCUMENT)
+ continue;
+ did_document = (char *) rd[i].data;
cb (GNUNET_OK, did_document, cls_did_resolve_cb);
+ return;
}
- else
- cb (GNUNET_NO, "DID Document is not a TXT record\n", cls_did_resolve_cb);
+ cb (GNUNET_NO, "DID Document is not a DID_DOCUMENT record\n",
+ cls_did_resolve_cb);
}
/**
@@ -109,7 +107,7 @@ DID_resolve (const char *did,
GNUNET_GNS_lookup (gns_handle,
DID_DOCUMENT_LABEL,
&pkey,
- GNUNET_DNSPARSER_TYPE_TXT,
+ GNUNET_GNSRECORD_TYPE_DID_DOCUMENT,
GNUNET_GNS_LO_DEFAULT,
&DID_resolve_gns_lookup_cb,
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,
return;
}
- // if (NULL == name)
- // return;
- // if ((1 == create) &&
- // (0 == strncmp (name, egoname, strlen (egoname))) &&
- // (1 != ego_exists))
- // {
- // fprintf (stderr, "%s already exists!\n", egoname);
- // ego_exists = 1;
- // return;
- // }
-
if (1 == show_all)
{
did_str = DID_identity_to_did (ego);
- printf ("%s\n", did_str);
+ printf ("%s:\n\t%s\n", name, did_str);
GNUNET_free (did_str);
return;
}
@@ -549,7 +538,7 @@ process_dids (void *cls, struct GNUNET_IDENTITY_Ego *ego,
if (0 == strncmp (name, egoname, strlen (egoname)))
{
did_str = DID_identity_to_did (ego);
- printf ("%s\n", did_str);
+ printf ("%s:\n\t%s\n", name, did_str);
GNUNET_free (did_str);
return;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: DID: change method name,
gnunet <=