gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: ABD: Fix build


From: gnunet
Subject: [gnunet] branch master updated: ABD: Fix build
Date: Fri, 03 Dec 2021 22:27:53 +0100

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 f236a1f38 ABD: Fix build
f236a1f38 is described below

commit f236a1f38867f7b5530e64f52502df750630a1bb
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Dec 3 22:27:46 2021 +0100

    ABD: Fix build
---
 configure.ac                     |  1 +
 po/POTFILES.in                   |  3 +--
 src/Makefile.am                  |  4 +--
 src/abd/Makefile.am              |  4 ++-
 src/abd/abd.h                    | 33 +++++++++++------------
 src/abd/abd_api.c                |  8 +++---
 src/abd/abd_serialization.c      | 12 ++++-----
 src/abd/delegate_misc.c          | 34 +++++++++++------------
 src/abd/gnunet-abd.c             | 58 ++++++++++++++--------------------------
 src/abd/gnunet-service-abd.c     | 58 ++++++++++++++++++++--------------------
 src/abd/plugin_gnsrecord_abd.c   |  7 +++--
 src/abd/test_abd_bi_and.sh       |  8 +++---
 src/include/gnunet_abd_service.h | 28 +++++++++----------
 13 files changed, 119 insertions(+), 139 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3e8d85eed..1e5ba403f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1436,6 +1436,7 @@ src/vpn/vpn.conf
 src/zonemaster/Makefile
 src/zonemaster/zonemaster.conf
 src/rest/Makefile
+src/abd/Makefile
 src/abe/Makefile
 src/reclaim/Makefile
 src/messenger/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 469b19219..60f758590 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -437,8 +437,6 @@ src/testing/testing_api_cmd_send_peer_ready.c
 src/testing/testing_api_cmd_system_create.c
 src/testing/testing_api_cmd_system_destroy.c
 src/testing/testing_api_loop.c
-src/testing/testing_api_trait_cmd.c
-src/testing/testing_api_trait_process.c
 src/testing/testing_api_traits.c
 src/topology/friends.c
 src/topology/gnunet-daemon-topology.c
@@ -502,6 +500,7 @@ src/transport/transport_api_manipulation.c
 src/transport/transport_api_monitor_peers.c
 src/transport/transport_api_monitor_plugins.c
 src/transport/transport_api_offer_hello.c
+src/transport/transport_api_traits.c
 src/util/bandwidth.c
 src/util/benchmark.c
 src/util/bio.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 31215c6d0..4c665c3b3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,8 @@ TESTBED = testbed-logger testbed
 
 if HAVE_EXPERIMENTAL
  EXP_DIR = \
-  rps
-  #abd FTBFS
+  rps \
+  abd
 if HAVE_ABE
  EXP_DIR += \
   abe
diff --git a/src/abd/Makefile.am b/src/abd/Makefile.am
index 34a0438f5..304469e22 100644
--- a/src/abd/Makefile.am
+++ b/src/abd/Makefile.am
@@ -75,7 +75,9 @@ libgnunetabd_la_SOURCES = \
  delegate_misc.c \
  delegate_misc.h
 libgnunetabd_la_LIBADD = \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIB)
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+ $(XLIB)
 libgnunetabd_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS)
 
diff --git a/src/abd/abd.h b/src/abd/abd.h
index 0af0d43ca..296af71fe 100644
--- a/src/abd/abd.h
+++ b/src/abd/abd.h
@@ -42,12 +42,12 @@ struct CollectMessage
   /**
    * Subject public key
    */
-  struct GNUNET_CRYPTO_EcdsaPrivateKey subject_key;
+  struct GNUNET_IDENTITY_PrivateKey subject_key;
 
   /**
    * Trust anchor
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Length of the issuer attribute
@@ -81,12 +81,12 @@ struct VerifyMessage
   /**
    * Subject public key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Trust anchor
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Number of delegates
@@ -170,7 +170,7 @@ struct DelegationRecordData
   /**
    * Subject key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Subject attributes
@@ -184,12 +184,12 @@ struct ChainEntry
   /**
    * Issuer key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Subject key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Issuer attributes
@@ -209,7 +209,7 @@ struct CredentialEntry
   /**
    * The signature for this credential by the issuer
    */
-  struct GNUNET_CRYPTO_EcdsaSignature signature;
+  struct GNUNET_IDENTITY_Signature signature;
 
   /**
    * Signature meta
@@ -219,12 +219,12 @@ struct CredentialEntry
   /**
    * Public key of the issuer
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Public key of the subject this credential was issued to
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Expiration time of this credential
@@ -243,26 +243,25 @@ struct CredentialEntry
 
 struct DelegateEntry
 {
-
   /**
-   * Signature meta
+   * The signature for this credential by the issuer
    */
-  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+  struct GNUNET_IDENTITY_Signature signature;
 
   /**
-   * The signature for this credential by the issuer
+   * Signature meta
    */
-  struct GNUNET_CRYPTO_EcdsaSignature signature;
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
 
   /**
    * Public key of the issuer
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Public key of the subject this credential was issued to
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Expiration time of this credential
diff --git a/src/abd/abd_api.c b/src/abd/abd_api.c
index cc25d06da..57f831e85 100644
--- a/src/abd/abd_api.c
+++ b/src/abd/abd_api.c
@@ -423,9 +423,9 @@ GNUNET_ABD_request_cancel (struct GNUNET_ABD_Request *lr)
 struct GNUNET_ABD_Request *
 GNUNET_ABD_collect (
   struct GNUNET_ABD_Handle *handle,
-  const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+  const struct GNUNET_IDENTITY_PublicKey *issuer_key,
   const char *issuer_attribute,
-  const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
+  const struct GNUNET_IDENTITY_PrivateKey *subject_key,
   enum GNUNET_ABD_AlgoDirectionFlags direction,
   GNUNET_ABD_CredentialResultProcessor proc,
   void *proc_cls,
@@ -497,9 +497,9 @@ GNUNET_ABD_collect (
 struct GNUNET_ABD_Request *
 GNUNET_ABD_verify (
   struct GNUNET_ABD_Handle *handle,
-  const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+  const struct GNUNET_IDENTITY_PublicKey *issuer_key,
   const char *issuer_attribute,
-  const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
+  const struct GNUNET_IDENTITY_PublicKey *subject_key,
   uint32_t delegate_count,
   const struct GNUNET_ABD_Delegate *delegates,
   enum GNUNET_ABD_AlgoDirectionFlags direction,
diff --git a/src/abd/abd_serialization.c b/src/abd/abd_serialization.c
index c03fab7dc..4c219d791 100644
--- a/src/abd/abd_serialization.c
+++ b/src/abd/abd_serialization.c
@@ -199,7 +199,7 @@ GNUNET_ABD_delegates_serialize (
     c_rec.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE);
     c_rec.purpose.size =
       htonl ((sizeof (struct DelegateEntry) + cd[i].issuer_attribute_len)
-             - sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
+             - sizeof (struct GNUNET_IDENTITY_Signature));
     c_rec.expiration = GNUNET_htonll (cd[i].expiration.abs_value_us);
     if (off + sizeof (c_rec) > dest_size)
       return -1;
@@ -445,13 +445,13 @@ GNUNET_ABD_delegate_serialize (struct GNUNET_ABD_Delegate 
*dele,
   }
   cdata->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE);
   cdata->purpose.size =
-    htonl (size - sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
+    htonl (size - sizeof (struct GNUNET_IDENTITY_Signature));
 
   GNUNET_memcpy (&cdata[1], tmp_str, attr_len);
 
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_DELEGATE,
-                                  cdata,
+      GNUNET_IDENTITY_signature_verify_ (GNUNET_SIGNATURE_PURPOSE_DELEGATE,
+                                  &cdata->purpose,
                                   &cdata->signature,
                                   &cdata->issuer_key))
   {
@@ -473,8 +473,8 @@ GNUNET_ABD_delegate_deserialize (const char *data, size_t 
data_size)
     return NULL;
   cdata = (struct DelegateEntry *) data;
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecdsa_verify (GNUNET_SIGNATURE_PURPOSE_DELEGATE,
-                                  cdata,
+      GNUNET_IDENTITY_signature_verify_ (GNUNET_SIGNATURE_PURPOSE_DELEGATE,
+                                  &cdata->purpose,
                                   &cdata->signature,
                                   &cdata->issuer_key))
   {
diff --git a/src/abd/delegate_misc.c b/src/abd/delegate_misc.c
index 4740a3e30..d67b40088 100644
--- a/src/abd/delegate_misc.c
+++ b/src/abd/delegate_misc.c
@@ -42,10 +42,10 @@ GNUNET_ABD_delegate_to_string (
   char *issuer_pkey;
   char *signature;
 
-  subject_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred->subject_key);
-  issuer_pkey = GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred->issuer_key);
+  subject_pkey = GNUNET_IDENTITY_public_key_to_string (&cred->subject_key);
+  issuer_pkey = GNUNET_IDENTITY_public_key_to_string (&cred->issuer_key);
   GNUNET_STRINGS_base64_encode ((char *) &cred->signature,
-                                sizeof (struct GNUNET_CRYPTO_EcdsaSignature),
+                                sizeof (struct GNUNET_IDENTITY_Signature),
                                 &signature);
   if (0 == cred->subject_attribute_len)
   {
@@ -80,7 +80,7 @@ struct GNUNET_ABD_Delegate *
 GNUNET_ABD_delegate_from_string (const char *s)
 {
   struct GNUNET_ABD_Delegate *dele;
-  size_t enclen = (sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)) * 8;
+  size_t enclen = (sizeof (struct GNUNET_IDENTITY_PublicKey)) * 8;
   if (enclen % 5 > 0)
     enclen += 5 - enclen % 5;
   enclen /= 5; /* 260/5 = 52 */
@@ -91,12 +91,12 @@ GNUNET_ABD_delegate_from_string (const char *s)
   char sub_attr[253 + 1] = "";
   char signature[256]; // TODO max payload size
 
-  struct GNUNET_CRYPTO_EcdsaSignature *sig;
+  struct GNUNET_IDENTITY_Signature *sig;
   struct GNUNET_TIME_Absolute etime_abs;
 
   // If it's A.a <- B.b...
   if (6 != sscanf (s,
-                   "%52s.%253s -> %52s.%253s | %s | %" SCNu64,
+                   "%58s.%253s -> %58s.%253s | %s | %" SCNu64,
                    issuer_pkey,
                    iss_attr,
                    subject_pkey,
@@ -106,7 +106,7 @@ GNUNET_ABD_delegate_from_string (const char *s)
   {
     // Try if it's A.a <- B
     if (5 != sscanf (s,
-                     "%52s.%253s -> %52s | %s | %" SCNu64,
+                     "%58s.%253s -> %58s | %s | %" SCNu64,
                      issuer_pkey,
                      iss_attr,
                      subject_pkey,
@@ -143,13 +143,11 @@ GNUNET_ABD_delegate_from_string (const char *s)
   }
   tmp_str[attr_len - 1] = '\0';
 
-  GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pkey,
-                                              strlen (subject_pkey),
+  GNUNET_IDENTITY_public_key_from_string (subject_pkey,
                                               &dele->subject_key);
-  GNUNET_CRYPTO_ecdsa_public_key_from_string (issuer_pkey,
-                                              strlen (issuer_pkey),
+  GNUNET_IDENTITY_public_key_from_string (issuer_pkey,
                                               &dele->issuer_key);
-  GNUNET_assert (sizeof (struct GNUNET_CRYPTO_EcdsaSignature) ==
+  GNUNET_assert (sizeof (struct GNUNET_IDENTITY_Signature) ==
                  GNUNET_STRINGS_base64_decode (signature,
                                                strlen (signature),
                                                (void **) &sig));
@@ -187,8 +185,8 @@ GNUNET_ABD_delegate_from_string (const char *s)
 
 struct GNUNET_ABD_Delegate *
 GNUNET_ABD_delegate_issue (
-  const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
-  struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
+  const struct GNUNET_IDENTITY_PrivateKey *issuer,
+  struct GNUNET_IDENTITY_PublicKey *subject,
   const char *iss_attr,
   const char *sub_attr,
   struct GNUNET_TIME_Absolute *expiration)
@@ -223,9 +221,9 @@ GNUNET_ABD_delegate_issue (
 
   del = GNUNET_malloc (size);
   del->purpose.size =
-    htonl (size - sizeof (struct GNUNET_CRYPTO_EcdsaSignature));
+    htonl (size - sizeof (struct GNUNET_IDENTITY_Signature));
   del->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE);
-  GNUNET_CRYPTO_ecdsa_key_get_public (issuer, &del->issuer_key);
+  GNUNET_IDENTITY_key_get_public (issuer, &del->issuer_key);
   del->subject_key = *subject;
   del->expiration = GNUNET_htonll (expiration->abs_value_us);
   del->issuer_attribute_len = htonl (strlen (iss_attr) + 1);
@@ -240,12 +238,12 @@ GNUNET_ABD_delegate_issue (
 
   GNUNET_memcpy (&del[1], tmp_str, attr_len);
 
-  GNUNET_CRYPTO_ecdsa_sign (issuer, del, &del->signature);
+  GNUNET_IDENTITY_sign_ (issuer, &del->purpose, &del->signature);
 
   dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len);
   dele->signature = del->signature;
   dele->expiration = *expiration;
-  GNUNET_CRYPTO_ecdsa_key_get_public (issuer, &dele->issuer_key);
+  GNUNET_IDENTITY_key_get_public (issuer, &dele->issuer_key);
 
   dele->subject_key = *subject;
 
diff --git a/src/abd/gnunet-abd.c b/src/abd/gnunet-abd.c
index b1fb767e3..17671273c 100644
--- a/src/abd/gnunet-abd.c
+++ b/src/abd/gnunet-abd.c
@@ -43,7 +43,7 @@ static struct GNUNET_NAMESTORE_Handle *ns;
 /**
  * Private key for the our zone.
  */
-static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey;
+static struct GNUNET_IDENTITY_PrivateKey zone_pkey;
 
 /**
  * EgoLookup
@@ -98,12 +98,12 @@ static char *expiration;
 /**
  * Subject key
  */
-struct GNUNET_CRYPTO_EcdsaPublicKey subject_pkey;
+struct GNUNET_IDENTITY_PublicKey subject_pkey;
 
 /**
  * Issuer key
  */
-struct GNUNET_CRYPTO_EcdsaPublicKey issuer_pkey;
+struct GNUNET_IDENTITY_PublicKey issuer_pkey;
 
 
 /**
@@ -205,11 +205,6 @@ static uint64_t etime;
  */
 static int etime_is_rel = GNUNET_SYSERR;
 
-/**
- * Fixed size of the public/private keys
- */
-static const int key_length = 52;
-
 /**
  * Record label for storing delegations
  */
@@ -282,9 +277,9 @@ handle_intermediate_result (void *cls,
 
   printf ("%s Intermediate result: %s.%s <- %s.%s\n",
           prefix,
-          GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key),
+          GNUNET_IDENTITY_public_key_to_string (&dd->issuer_key),
           dd->issuer_attribute,
-          GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->subject_key),
+          GNUNET_IDENTITY_public_key_to_string (&dd->subject_key),
           dd->subject_attribute);
 }
 
@@ -337,8 +332,8 @@ handle_verify_result (void *cls,
     printf ("Delegation Chain:\n");
     for (i = 0; i < d_count; i++)
     {
-      iss_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dc[i].issuer_key);
-      sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dc[i].subject_key);
+      iss_key = GNUNET_IDENTITY_public_key_to_string (&dc[i].issuer_key);
+      sub_key = GNUNET_IDENTITY_public_key_to_string (&dc[i].subject_key);
 
       if (0 != dc[i].subject_attribute_len)
       {
@@ -363,8 +358,8 @@ handle_verify_result (void *cls,
     printf ("\nDelegate(s):\n");
     for (i = 0; i < c_count; i++)
     {
-      iss_key = GNUNET_CRYPTO_ecdsa_public_key_to_string (&dele[i].issuer_key);
-      sub_key = GNUNET_CRYPTO_ecdsa_public_key_to_string 
(&dele[i].subject_key);
+      iss_key = GNUNET_IDENTITY_public_key_to_string (&dele[i].issuer_key);
+      sub_key = GNUNET_IDENTITY_public_key_to_string (&dele[i].subject_key);
       printf ("%s.%s <- %s\n", iss_key, dele[i].issuer_attribute, sub_key);
       GNUNET_free (iss_key);
       GNUNET_free (sub_key);
@@ -386,7 +381,7 @@ handle_verify_result (void *cls,
 static void
 identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 {
-  const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
+  const struct GNUNET_IDENTITY_PrivateKey *privkey;
 
   el = NULL;
   if (NULL == ego)
@@ -405,8 +400,7 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
   {
 
     if (GNUNET_OK !=
-        GNUNET_CRYPTO_ecdsa_public_key_from_string (issuer_key,
-                                                    strlen (issuer_key),
+        GNUNET_IDENTITY_public_key_from_string (issuer_key,
                                                     &issuer_pkey))
     {
       fprintf (stderr,
@@ -507,7 +501,7 @@ add_continuation (void *cls, int32_t success, const char 
*emsg)
 
 static void
 get_existing_record (void *cls,
-                     const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
+                     const struct GNUNET_IDENTITY_PrivateKey *zone_key,
                      const char *rec_name,
                      unsigned int rd_count,
                      const struct GNUNET_GNSRECORD_Data *rd)
@@ -573,13 +567,13 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 
     // Get import subject public key string
     char *subject_pubkey_str =
-      GNUNET_CRYPTO_ecdsa_public_key_to_string (&cred->subject_key);
+      GNUNET_IDENTITY_public_key_to_string (&cred->subject_key);
 
     // Get zone public key string
-    struct GNUNET_CRYPTO_EcdsaPublicKey zone_pubkey;
+    struct GNUNET_IDENTITY_PublicKey zone_pubkey;
     GNUNET_IDENTITY_ego_get_public_key (ego, &zone_pubkey);
     char *zone_pubkey_str =
-      GNUNET_CRYPTO_ecdsa_public_key_to_string (&zone_pubkey);
+      GNUNET_IDENTITY_public_key_to_string (&zone_pubkey);
 
     // Check if the subject key in the signed import matches the zone's key it 
is issued to
     if (strcmp (zone_pubkey_str, subject_pubkey_str) != 0)
@@ -655,7 +649,7 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 static void
 sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 {
-  const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
+  const struct GNUNET_IDENTITY_PrivateKey *privkey;
   struct GNUNET_ABD_Delegate *dele;
   struct GNUNET_TIME_Absolute etime_abs;
   char *res;
@@ -686,16 +680,7 @@ sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
 
   // Subject Public Key
   token = strtok (subject, " ");
-  if (key_length == strlen (token))
-  {
-    subject_pubkey_str = token;
-  }
-  else
-  {
-    fprintf (stderr, "Key error, wrong length: %ld!\n", strlen (token));
-    GNUNET_SCHEDULER_shutdown ();
-    return;
-  }
+  subject_pubkey_str = token;
   // Subject Attribute(s)
   token = strtok (NULL, " ");
   if (NULL != token)
@@ -707,8 +692,7 @@ sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
   privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
 
   if (GNUNET_OK !=
-      GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pubkey_str,
-                                                  strlen (subject_pubkey_str),
+      GNUNET_IDENTITY_public_key_from_string (subject_pubkey_str,
                                                   &subject_pkey))
   {
     fprintf (stderr,
@@ -873,8 +857,7 @@ run (void *cls,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  if (GNUNET_OK != GNUNET_CRYPTO_ecdsa_public_key_from_string (subject,
-                                                               strlen 
(subject),
+  if (GNUNET_OK != GNUNET_IDENTITY_public_key_from_string (subject,
                                                                &subject_pkey))
   {
     fprintf (stderr,
@@ -893,8 +876,7 @@ run (void *cls,
       return;
     }
     if (GNUNET_OK !=
-        GNUNET_CRYPTO_ecdsa_public_key_from_string (issuer_key,
-                                                    strlen (issuer_key),
+        GNUNET_IDENTITY_public_key_from_string (issuer_key,
                                                     &issuer_pkey))
     {
       fprintf (stderr,
diff --git a/src/abd/gnunet-service-abd.c b/src/abd/gnunet-service-abd.c
index 93368da45..3f9f2f924 100644
--- a/src/abd/gnunet-service-abd.c
+++ b/src/abd/gnunet-service-abd.c
@@ -61,12 +61,12 @@ struct DelegationChainEntry
   /**
    * The issuer
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * The subject
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * The issued attribute
@@ -166,7 +166,7 @@ struct DelegationSetQueueEntry
   /**
    * Issuer key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key;
+  struct GNUNET_IDENTITY_PublicKey *issuer_key;
 
   /**
    * Queue entries of this set
@@ -267,7 +267,7 @@ struct VerifyRequestHandle
   /**
    * Issuer public key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Issuer attribute
@@ -277,7 +277,7 @@ struct VerifyRequestHandle
   /**
    * Subject public key
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Delegate DLL
@@ -352,10 +352,10 @@ print_deleset (struct DelegationSetQueueEntry *dsentry, 
char *text)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "%s %s.%s <- %s.%s\n",
               text,
-              GNUNET_CRYPTO_ecdsa_public_key_to_string (
+              GNUNET_IDENTITY_public_key_to_string (
                 &dsentry->delegation_chain_entry->issuer_key),
               dsentry->delegation_chain_entry->issuer_attribute,
-              GNUNET_CRYPTO_ecdsa_public_key_to_string (
+              GNUNET_IDENTITY_public_key_to_string (
                 &dsentry->delegation_chain_entry->subject_key),
               dsentry->delegation_chain_entry->subject_attribute);
 }
@@ -697,7 +697,7 @@ handle_bidirectional_match (struct DelegationSetQueueEntry 
*actual_entry,
   {
     if (0 != memcmp (&last_entry->delegation_chain_entry->subject_key,
                      &del_entry->delegate->issuer_key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                     sizeof (struct GNUNET_IDENTITY_PublicKey)))
       continue;
     if (0 != strcmp (last_entry->delegation_chain_entry->subject_attribute,
                      del_entry->delegate->issuer_attribute))
@@ -828,10 +828,10 @@ forward_resolution (void *cls,
         {
           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                       "Entry not relevant, discarding: %s.%s <- %s.%s\n",
-                      GNUNET_CRYPTO_ecdsa_public_key_to_string (
+                      GNUNET_IDENTITY_public_key_to_string (
                         &del->issuer_key),
                       del->issuer_attribute,
-                      GNUNET_CRYPTO_ecdsa_public_key_to_string (
+                      GNUNET_IDENTITY_public_key_to_string (
                         &del->subject_key),
                       del->subject_attribute);
           continue;
@@ -844,10 +844,10 @@ forward_resolution (void *cls,
 
     // Start: Credential Chain Entry
     // issuer key is subject key, who needs to be contacted to resolve this 
(forward, therefore subject)
-    ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
+    ds_entry->issuer_key = GNUNET_new (struct GNUNET_IDENTITY_PublicKey);
     GNUNET_memcpy (ds_entry->issuer_key,
                    &del->subject_key,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+                   sizeof (struct GNUNET_IDENTITY_PublicKey));
 
     ds_entry->delegation_chain_entry = GNUNET_new (struct 
DelegationChainEntry);
     ds_entry->delegation_chain_entry->subject_key = del->subject_key;
@@ -868,7 +868,7 @@ forward_resolution (void *cls,
     // if: issuer key we looking for
     if (0 == memcmp (&del->issuer_key,
                      &vrh->issuer_key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                     sizeof (struct GNUNET_IDENTITY_PublicKey)))
     {
       // if: issuer attr we looking for
       if (0 == strcmp (del->issuer_attribute, vrh->issuer_attribute))
@@ -899,7 +899,7 @@ forward_resolution (void *cls,
           {
             if (0 == memcmp (&del_entry->delegate->issuer_key,
                              &vrh->delegation_chain_head->subject_key,
-                             sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                             sizeof (struct GNUNET_IDENTITY_PublicKey)))
             {
               if (0 == strcmp (del_entry->delegate->issuer_attribute,
                                vrh->delegation_chain_head->subject_attribute))
@@ -926,7 +926,7 @@ forward_resolution (void *cls,
         // key of list entry matches actual key
         if (0 == memcmp (&del_entry->delegation_chain_entry->subject_key,
                          &ds_entry->delegation_chain_entry->issuer_key,
-                         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                         sizeof (struct GNUNET_IDENTITY_PublicKey)))
         {
           // compare entry subject attributes to this trailer (iss attr + old 
trailer)
           if (0 == strcmp (del_entry->unresolved_attribute_delegation,
@@ -955,7 +955,7 @@ forward_resolution (void *cls,
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Starting to look up trailer %s in zone %s\n",
                 ds_entry->attr_trailer,
-                GNUNET_CRYPTO_ecdsa_public_key_to_string (&del->issuer_key));
+                GNUNET_IDENTITY_public_key_to_string (&del->issuer_key));
 
     ds_entry->lookup_request =
       GNUNET_GNS_lookup (gns,
@@ -1064,10 +1064,10 @@ backward_resolution (void *cls,
       ds_entry->delegation_chain_entry =
         GNUNET_new (struct DelegationChainEntry);
       ds_entry->delegation_chain_entry->subject_key = set[j].subject_key;
-      ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
+      ds_entry->issuer_key = GNUNET_new (struct GNUNET_IDENTITY_PublicKey);
       GNUNET_memcpy (ds_entry->issuer_key,
                      &set[j].subject_key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+                     sizeof (struct GNUNET_IDENTITY_PublicKey));
       if (0 < set[j].subject_attribute_len)
         ds_entry->delegation_chain_entry->subject_attribute =
           GNUNET_strdup (set[j].subject_attribute);
@@ -1091,7 +1091,7 @@ backward_resolution (void *cls,
         // If key and attribute match credential: continue and backtrack
         if (0 != memcmp (&set[j].subject_key,
                          &del_pointer->delegate->issuer_key,
-                         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                         sizeof (struct GNUNET_IDENTITY_PublicKey)))
           continue;
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                     "Checking if %s matches %s\n",
@@ -1173,7 +1173,7 @@ backward_resolution (void *cls,
           // key of list entry matches actual key
           if (0 == memcmp (&del_entry->delegation_chain_entry->issuer_key,
                            &ds_entry->delegation_chain_entry->subject_key,
-                           sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                           sizeof (struct GNUNET_IDENTITY_PublicKey)))
           {
             // compare entry subject attributes to this trailer (iss attr + 
old trailer)
             if (0 == strcmp (del_entry->attr_trailer,
@@ -1262,7 +1262,7 @@ delegation_chain_bw_resolution_start (void *cls)
   {
     if (0 != memcmp (&del_entry->delegate->issuer_key,
                      &vrh->issuer_key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                     sizeof (struct GNUNET_IDENTITY_PublicKey)))
       continue;
     if (0 !=
         strcmp (del_entry->delegate->issuer_attribute, vrh->issuer_attribute))
@@ -1284,10 +1284,10 @@ delegation_chain_bw_resolution_start (void *cls)
   ds_entry = GNUNET_new (struct DelegationSetQueueEntry);
   GNUNET_CONTAINER_DLL_insert (vrh->dsq_head, vrh->dsq_tail, ds_entry);
   ds_entry->from_bw = true;
-  ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
+  ds_entry->issuer_key = GNUNET_new (struct GNUNET_IDENTITY_PublicKey);
   GNUNET_memcpy (ds_entry->issuer_key,
                  &vrh->issuer_key,
-                 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+                 sizeof (struct GNUNET_IDENTITY_PublicKey));
   ds_entry->issuer_attribute = GNUNET_strdup (vrh->issuer_attribute);
 
   ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry);
@@ -1344,7 +1344,7 @@ delegation_chain_fw_resolution_start (void *cls)
   {
     if (0 != memcmp (&del_entry->delegate->issuer_key,
                      &vrh->issuer_key,
-                     sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+                     sizeof (struct GNUNET_IDENTITY_PublicKey)))
       continue;
     if (0 !=
         strcmp (del_entry->delegate->issuer_attribute, vrh->issuer_attribute))
@@ -1366,17 +1366,17 @@ delegation_chain_fw_resolution_start (void *cls)
 
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Looking for %s.%s\n",
-                GNUNET_CRYPTO_ecdsa_public_key_to_string (
+                GNUNET_IDENTITY_public_key_to_string (
                   &del_entry->delegate->issuer_key),
                 del_entry->delegate->issuer_attribute);
 
     ds_entry = GNUNET_new (struct DelegationSetQueueEntry);
     GNUNET_CONTAINER_DLL_insert (vrh->dsq_head, vrh->dsq_tail, ds_entry);
     ds_entry->from_bw = false;
-    ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPublicKey);
+    ds_entry->issuer_key = GNUNET_new (struct GNUNET_IDENTITY_PublicKey);
     GNUNET_memcpy (ds_entry->issuer_key,
                    &del_entry->delegate->subject_key,
-                   sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
+                   sizeof (struct GNUNET_IDENTITY_PublicKey));
 
     ds_entry->delegation_chain_entry = GNUNET_new (struct 
DelegationChainEntry);
     ds_entry->delegation_chain_entry->subject_key =
@@ -1580,7 +1580,7 @@ delegate_collection_finished (void *cls)
 
 static void
 handle_delegate_collection_cb (void *cls,
-                               const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
+                               const struct GNUNET_IDENTITY_PrivateKey *key,
                                const char *label,
                                unsigned int rd_count,
                                const struct GNUNET_GNSRECORD_Data *rd)
@@ -1643,7 +1643,7 @@ handle_collect (void *cls, const struct CollectMessage 
*c_msg)
   vrh->client = client;
   vrh->request_id = c_msg->id;
   vrh->issuer_key = c_msg->issuer_key;
-  GNUNET_CRYPTO_ecdsa_key_get_public (&c_msg->subject_key, &vrh->subject_key);
+  GNUNET_IDENTITY_key_get_public (&c_msg->subject_key, &vrh->subject_key);
   vrh->issuer_attribute = GNUNET_strdup (issuer_attribute);
   vrh->resolution_algo = ntohs (c_msg->resolution_algo);
 
diff --git a/src/abd/plugin_gnsrecord_abd.c b/src/abd/plugin_gnsrecord_abd.c
index 25dc20152..24cf6a3aa 100644
--- a/src/abd/plugin_gnsrecord_abd.c
+++ b/src/abd/plugin_gnsrecord_abd.c
@@ -77,7 +77,7 @@ abd_value_to_string (void *cls,
       for (i = 0; i < ntohl (sets.set_count); i++)
       {
         subject_pkey =
-          GNUNET_CRYPTO_ecdsa_public_key_to_string (&set[i].subject_key);
+          GNUNET_IDENTITY_public_key_to_string (&set[i].subject_key);
 
         if (0 == set[i].subject_attribute_len)
         {
@@ -158,7 +158,7 @@ abd_string_to_value (void *cls,
     {
       struct GNUNET_ABD_DelegationRecord *sets;
       char attr_str[253 + 1];
-      char subject_pkey[52 + 1];
+      char subject_pkey[58 + 1];
       char *token;
       char *tmp_str;
       int matches = 0;
@@ -207,8 +207,7 @@ abd_string_to_value (void *cls,
         matches = sscanf (token, "%s %s", subject_pkey, attr_str);
 
         // sets the public key for the set entry
-        GNUNET_CRYPTO_ecdsa_public_key_from_string (subject_pkey,
-                                                    strlen (subject_pkey),
+        GNUNET_IDENTITY_public_key_from_string (subject_pkey,
                                                     &set[i].subject_key);
 
         // If not just key, also set subject attribute (Not A.a <- B but A.a 
<- B.b)
diff --git a/src/abd/test_abd_bi_and.sh b/src/abd/test_abd_bi_and.sh
index b32313636..99c89a344 100755
--- a/src/abd/test_abd_bi_and.sh
+++ b/src/abd/test_abd_bi_and.sh
@@ -55,16 +55,16 @@ gnunet-namestore -D -z b
 gnunet-abd --createIssuerSide --ego=g --attribute="g" --subject="$HKEY h" 
--ttl=5m -c test_abd_lookup.conf
 gnunet-namestore -D -z b
 
-SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" 
--subject="$DKEY d" --ttl="2019-12-12 10:00:00"`
+SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=c --attribute="c" 
--subject="$DKEY d" --ttl="2049-12-12 10:00:00"`
 gnunet-abd --createSubjectSide --ego=d --import="$SIGNED"
 gnunet-namestore -D -z d
-SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" 
--subject="$EKEY e" --ttl="2019-12-12 10:00:00"`
+SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=d --attribute="d" 
--subject="$EKEY e" --ttl="2049-12-12 10:00:00"`
 gnunet-abd --createSubjectSide --ego=e --import="$SIGNED"
 gnunet-namestore -D -z e
-SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" 
--subject="$FKEY" --ttl="2019-12-12 10:00:00"`
+SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=e --attribute="e" 
--subject="$FKEY" --ttl="2049-12-12 10:00:00"`
 gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
 gnunet-namestore -D -z f
-SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=h --attribute="h" 
--subject="$FKEY" --ttl="2019-12-12 10:00:00"`
+SIGNED=`$DO_TIMEOUT gnunet-abd --signSubjectSide --ego=h --attribute="h" 
--subject="$FKEY" --ttl="2049-12-12 10:00:00"`
 gnunet-abd --createSubjectSide --ego=f --import="$SIGNED" --private
 gnunet-namestore -D -z h
 
diff --git a/src/include/gnunet_abd_service.h b/src/include/gnunet_abd_service.h
index afec880f1..21f668a8d 100644
--- a/src/include/gnunet_abd_service.h
+++ b/src/include/gnunet_abd_service.h
@@ -103,7 +103,7 @@ struct GNUNET_ABD_DelegationRecordSet
   /**
    * Public key of the subject this attribute was delegated to
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Length of attribute, may be 0
@@ -123,7 +123,7 @@ struct GNUNET_ABD_DelegationSet
   /**
    * Public key of the subject this attribute was delegated to
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   uint32_t subject_attribute_len;
 
@@ -143,12 +143,12 @@ struct GNUNET_ABD_Delegation
   /**
    * The issuer of the delegation
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Public key of the subject this attribute was delegated to
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Length of the attribute
@@ -181,17 +181,17 @@ struct GNUNET_ABD_Delegate
   /**
    * The issuer of the credential
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
+  struct GNUNET_IDENTITY_PublicKey issuer_key;
 
   /**
    * Public key of the subject this credential was issued to
    */
-  struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
+  struct GNUNET_IDENTITY_PublicKey subject_key;
 
   /**
    * Signature of this credential
    */
-  struct GNUNET_CRYPTO_EcdsaSignature signature;
+  struct GNUNET_IDENTITY_Signature signature;
 
   /**
    * Expiration of this credential
@@ -318,9 +318,9 @@ typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) 
(void *cls,
  */
 struct GNUNET_ABD_Request*
   GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle,
-                     const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+                     const struct GNUNET_IDENTITY_PublicKey *issuer_key,
                      const char *issuer_attribute,
-                     const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
+                     const struct GNUNET_IDENTITY_PublicKey *subject_key,
                      uint32_t delegate_count,
                      const struct GNUNET_ABD_Delegate *delegates,
                      enum GNUNET_ABD_AlgoDirectionFlags direction,
@@ -331,9 +331,9 @@ struct GNUNET_ABD_Request*
 
 struct GNUNET_ABD_Request*
   GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
-                      const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+                      const struct GNUNET_IDENTITY_PublicKey *issuer_key,
                       const char *issuer_attribute,
-                      const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
+                      const struct GNUNET_IDENTITY_PrivateKey *subject_key,
                       enum GNUNET_ABD_AlgoDirectionFlags direction,
                       GNUNET_ABD_CredentialResultProcessor proc,
                       void *proc_cls,
@@ -356,7 +356,7 @@ struct GNUNET_ABD_Request *
 GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
                            struct GNUNET_IDENTITY_Ego *issuer,
                            const char *attribute,
-                           struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
+                           struct GNUNET_IDENTITY_PublicKey *subject,
                            const char *delegated_attribute,
                            GNUNET_ABD_DelegateResultProcessor proc,
                            void *proc_cls);
@@ -389,8 +389,8 @@ GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle 
*handle,
  * @return handle to the queued request
  */
 struct GNUNET_ABD_Delegate*
-GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
-                           struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
+GNUNET_ABD_delegate_issue (const struct GNUNET_IDENTITY_PrivateKey *issuer,
+                           struct GNUNET_IDENTITY_PublicKey *subject,
                            const char *iss_attr,
                            const char *sub_attr,
                            struct GNUNET_TIME_Absolute *expiration);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]