From 9ef4abad615bea12d13be542b8ae5fbeb2dfee32 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Wed, 18 Oct 2023 13:37:38 +0200 Subject: NEWS: Refactoring components under src/ into lib/, plugin/, cli/ and service/ This also includes a necessary API refactoring of crypto from IDENTITY to UTIL. --- src/abd/Makefile.am | 10 ++++---- src/abd/abd.h | 20 +++++++-------- src/abd/abd_api.c | 8 +++--- src/abd/abd_serialization.c | 8 +++--- src/abd/delegate_misc.c | 28 ++++++++++---------- src/abd/gnunet-abd.c | 38 +++++++++++++-------------- src/abd/gnunet-service-abd.c | 58 +++++++++++++++++++++--------------------- src/abd/plugin_gnsrecord_abd.c | 4 +-- 8 files changed, 87 insertions(+), 87 deletions(-) (limited to 'src/abd') diff --git a/src/abd/Makefile.am b/src/abd/Makefile.am index 69809291a..6fa2dc848 100644 --- a/src/abd/Makefile.am +++ b/src/abd/Makefile.am @@ -41,8 +41,8 @@ gnunet_abd_SOURCES = \ gnunet-abd.c gnunet_abd_LDADD = \ libgnunetabd.la \ - $(top_builddir)/src/util/libgnunetutil.la \ - $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ + $(top_builddir)/src/lib/util/libgnunetutil.la \ + $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \ $(top_builddir)/src/identity/libgnunetidentity.la \ $(top_builddir)/src/namestore/libgnunetnamestore.la \ $(GN_LIBINTL) @@ -52,7 +52,7 @@ libgnunet_plugin_gnsrecord_abd_la_SOURCES = \ plugin_gnsrecord_abd.c libgnunet_plugin_gnsrecord_abd_la_LIBADD = \ libgnunetabd.la \ - $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/lib/util/libgnunetutil.la \ $(top_builddir)/src/identity/libgnunetidentity.la \ $(LTLIBINTL) libgnunet_plugin_gnsrecord_abd_la_LDFLAGS = \ @@ -64,7 +64,7 @@ gnunet_service_abd_SOURCES = \ gnunet-service-abd.c gnunet_service_abd_LDADD = \ libgnunetabd.la \ - $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/lib/util/libgnunetutil.la \ $(top_builddir)/src/gns/libgnunetgns.la \ $(top_builddir)/src/namestore/libgnunetnamestore.la \ $(top_builddir)/src/identity/libgnunetidentity.la \ @@ -79,7 +79,7 @@ libgnunetabd_la_SOURCES = \ delegate_misc.c \ delegate_misc.h libgnunetabd_la_LIBADD = \ - $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/lib/util/libgnunetutil.la \ $(top_builddir)/src/identity/libgnunetidentity.la \ $(XLIB) libgnunetabd_la_LDFLAGS = \ diff --git a/src/abd/abd.h b/src/abd/abd.h index 61210b3f7..26b8e222e 100644 --- a/src/abd/abd.h +++ b/src/abd/abd.h @@ -42,12 +42,12 @@ struct CollectMessage /** * Subject public key */ - struct GNUNET_IDENTITY_PrivateKey subject_key; + struct GNUNET_CRYPTO_PrivateKey subject_key; /** * Trust anchor */ - struct GNUNET_IDENTITY_PublicKey issuer_key; + struct GNUNET_CRYPTO_PublicKey issuer_key; /** * Length of the issuer attribute @@ -81,12 +81,12 @@ struct VerifyMessage /** * Subject public key */ - struct GNUNET_IDENTITY_PublicKey subject_key; + struct GNUNET_CRYPTO_PublicKey subject_key; /** * Trust anchor */ - struct GNUNET_IDENTITY_PublicKey issuer_key; + struct GNUNET_CRYPTO_PublicKey issuer_key; /** * Number of delegates @@ -170,7 +170,7 @@ struct DelegationRecordData /** * Subject key */ - struct GNUNET_IDENTITY_PublicKey subject_key; + struct GNUNET_CRYPTO_PublicKey subject_key; /** * Subject attributes @@ -184,12 +184,12 @@ struct ChainEntry /** * Issuer key */ - struct GNUNET_IDENTITY_PublicKey issuer_key; + struct GNUNET_CRYPTO_PublicKey issuer_key; /** * Subject key */ - struct GNUNET_IDENTITY_PublicKey subject_key; + struct GNUNET_CRYPTO_PublicKey subject_key; /** * Issuer attributes @@ -208,7 +208,7 @@ struct DelegateEntry /** * The signature for this credential by the issuer */ - struct GNUNET_IDENTITY_Signature signature; + struct GNUNET_CRYPTO_Signature signature; /** * Signature meta @@ -218,12 +218,12 @@ struct DelegateEntry /** * Public key of the issuer */ - struct GNUNET_IDENTITY_PublicKey issuer_key; + struct GNUNET_CRYPTO_PublicKey issuer_key; /** * Public key of the subject this credential was issued to */ - struct GNUNET_IDENTITY_PublicKey subject_key; + struct GNUNET_CRYPTO_PublicKey subject_key; /** * Expiration time of this credential diff --git a/src/abd/abd_api.c b/src/abd/abd_api.c index 0b3b4f61f..3682f41ba 100644 --- a/src/abd/abd_api.c +++ b/src/abd/abd_api.c @@ -422,9 +422,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_IDENTITY_PublicKey *issuer_key, + const struct GNUNET_CRYPTO_PublicKey *issuer_key, const char *issuer_attribute, - const struct GNUNET_IDENTITY_PrivateKey *subject_key, + const struct GNUNET_CRYPTO_PrivateKey *subject_key, enum GNUNET_ABD_AlgoDirectionFlags direction, GNUNET_ABD_CredentialResultProcessor proc, void *proc_cls, @@ -496,9 +496,9 @@ GNUNET_ABD_collect ( struct GNUNET_ABD_Request * GNUNET_ABD_verify ( struct GNUNET_ABD_Handle *handle, - const struct GNUNET_IDENTITY_PublicKey *issuer_key, + const struct GNUNET_CRYPTO_PublicKey *issuer_key, const char *issuer_attribute, - const struct GNUNET_IDENTITY_PublicKey *subject_key, + const struct GNUNET_CRYPTO_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 2ed24ff2f..14960e804 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_IDENTITY_Signature)); + - sizeof (struct GNUNET_CRYPTO_Signature)); c_rec.expiration = GNUNET_htonll (cd[i].expiration.abs_value_us); if (off + sizeof (c_rec) > dest_size) return -1; @@ -445,12 +445,12 @@ 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_IDENTITY_Signature)); + htonl (size - sizeof (struct GNUNET_CRYPTO_Signature)); GNUNET_memcpy (&cdata[1], tmp_str, attr_len); if (GNUNET_OK != - GNUNET_IDENTITY_signature_verify_ (GNUNET_SIGNATURE_PURPOSE_DELEGATE, + GNUNET_CRYPTO_signature_verify_ (GNUNET_SIGNATURE_PURPOSE_DELEGATE, &cdata->purpose, &cdata->signature, &cdata->issuer_key)) @@ -473,7 +473,7 @@ GNUNET_ABD_delegate_deserialize (const char *data, size_t data_size) return NULL; cdata = (struct DelegateEntry *) data; if (GNUNET_OK != - GNUNET_IDENTITY_signature_verify_ (GNUNET_SIGNATURE_PURPOSE_DELEGATE, + GNUNET_CRYPTO_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 cc45cde04..446c0b8d2 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_IDENTITY_public_key_to_string (&cred->subject_key); - issuer_pkey = GNUNET_IDENTITY_public_key_to_string (&cred->issuer_key); + subject_pkey = GNUNET_CRYPTO_public_key_to_string (&cred->subject_key); + issuer_pkey = GNUNET_CRYPTO_public_key_to_string (&cred->issuer_key); GNUNET_STRINGS_base64_encode ((char *) &cred->signature, - sizeof (struct GNUNET_IDENTITY_Signature), + sizeof (struct GNUNET_CRYPTO_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_IDENTITY_PublicKey)) * 8; + size_t enclen = (sizeof (struct GNUNET_CRYPTO_PublicKey)) * 8; if (enclen % 5 > 0) enclen += 5 - enclen % 5; enclen /= 5; /* 260/5 = 52 */ @@ -91,7 +91,7 @@ GNUNET_ABD_delegate_from_string (const char *s) char sub_attr[253 + 1] = ""; char signature[256]; // TODO max payload size - struct GNUNET_IDENTITY_Signature *sig; + struct GNUNET_CRYPTO_Signature *sig; struct GNUNET_TIME_Absolute etime_abs; // If it's A.a <- B.b... @@ -144,20 +144,20 @@ GNUNET_ABD_delegate_from_string (const char *s) tmp_str[attr_len - 1] = '\0'; if (GNUNET_SYSERR == - GNUNET_IDENTITY_public_key_from_string (subject_pkey, + GNUNET_CRYPTO_public_key_from_string (subject_pkey, &dele->subject_key)) { GNUNET_free (dele); return NULL; } if (GNUNET_SYSERR == - GNUNET_IDENTITY_public_key_from_string (issuer_pkey, + GNUNET_CRYPTO_public_key_from_string (issuer_pkey, &dele->issuer_key)) { GNUNET_free (dele); return NULL; } - GNUNET_assert (sizeof (struct GNUNET_IDENTITY_Signature) == + GNUNET_assert (sizeof (struct GNUNET_CRYPTO_Signature) == GNUNET_STRINGS_base64_decode (signature, strlen (signature), (void **) &sig)); @@ -196,8 +196,8 @@ GNUNET_ABD_delegate_from_string (const char *s) struct GNUNET_ABD_Delegate * GNUNET_ABD_delegate_issue ( - const struct GNUNET_IDENTITY_PrivateKey *issuer, - struct GNUNET_IDENTITY_PublicKey *subject, + const struct GNUNET_CRYPTO_PrivateKey *issuer, + struct GNUNET_CRYPTO_PublicKey *subject, const char *iss_attr, const char *sub_attr, struct GNUNET_TIME_Absolute *expiration) @@ -232,9 +232,9 @@ GNUNET_ABD_delegate_issue ( del = GNUNET_malloc (size); del->purpose.size = - htonl (size - sizeof (struct GNUNET_IDENTITY_Signature)); + htonl (size - sizeof (struct GNUNET_CRYPTO_Signature)); del->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_DELEGATE); - GNUNET_IDENTITY_key_get_public (issuer, &del->issuer_key); + GNUNET_CRYPTO_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); @@ -249,12 +249,12 @@ GNUNET_ABD_delegate_issue ( GNUNET_memcpy (&del[1], tmp_str, attr_len); - GNUNET_IDENTITY_sign_ (issuer, &del->purpose, &del->signature); + GNUNET_CRYPTO_sign_ (issuer, &del->purpose, &del->signature); dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len); dele->signature = del->signature; dele->expiration = *expiration; - GNUNET_IDENTITY_key_get_public (issuer, &dele->issuer_key); + GNUNET_CRYPTO_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 6f6521d98..1ed1adbe7 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_IDENTITY_PrivateKey zone_pkey; +static struct GNUNET_CRYPTO_PrivateKey zone_pkey; /** * EgoLookup @@ -98,12 +98,12 @@ static char *expiration; /** * Subject key */ -struct GNUNET_IDENTITY_PublicKey subject_pkey; +struct GNUNET_CRYPTO_PublicKey subject_pkey; /** * Issuer key */ -struct GNUNET_IDENTITY_PublicKey issuer_pkey; +struct GNUNET_CRYPTO_PublicKey issuer_pkey; /** @@ -277,9 +277,9 @@ handle_intermediate_result (void *cls, printf ("%s Intermediate result: %s.%s <- %s.%s\n", prefix, - GNUNET_IDENTITY_public_key_to_string (&dd->issuer_key), + GNUNET_CRYPTO_public_key_to_string (&dd->issuer_key), dd->issuer_attribute, - GNUNET_IDENTITY_public_key_to_string (&dd->subject_key), + GNUNET_CRYPTO_public_key_to_string (&dd->subject_key), dd->subject_attribute); } @@ -332,8 +332,8 @@ handle_verify_result (void *cls, printf ("Delegation Chain:\n"); for (i = 0; i < d_count; i++) { - iss_key = GNUNET_IDENTITY_public_key_to_string (&dc[i].issuer_key); - sub_key = GNUNET_IDENTITY_public_key_to_string (&dc[i].subject_key); + iss_key = GNUNET_CRYPTO_public_key_to_string (&dc[i].issuer_key); + sub_key = GNUNET_CRYPTO_public_key_to_string (&dc[i].subject_key); if (0 != dc[i].subject_attribute_len) { @@ -358,8 +358,8 @@ handle_verify_result (void *cls, printf ("\nDelegate(s):\n"); for (i = 0; i < c_count; i++) { - iss_key = GNUNET_IDENTITY_public_key_to_string (&dele[i].issuer_key); - sub_key = GNUNET_IDENTITY_public_key_to_string (&dele[i].subject_key); + iss_key = GNUNET_CRYPTO_public_key_to_string (&dele[i].issuer_key); + sub_key = GNUNET_CRYPTO_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); @@ -381,7 +381,7 @@ handle_verify_result (void *cls, static void identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) { - const struct GNUNET_IDENTITY_PrivateKey *privkey; + const struct GNUNET_CRYPTO_PrivateKey *privkey; el = NULL; if (NULL == ego) @@ -400,7 +400,7 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) { if (GNUNET_OK != - GNUNET_IDENTITY_public_key_from_string (issuer_key, + GNUNET_CRYPTO_public_key_from_string (issuer_key, &issuer_pkey)) { fprintf (stderr, @@ -501,7 +501,7 @@ add_continuation (void *cls, int32_t success, const char *emsg) static void get_existing_record (void *cls, - const struct GNUNET_IDENTITY_PrivateKey *zone_key, + const struct GNUNET_CRYPTO_PrivateKey *zone_key, const char *rec_name, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) @@ -545,7 +545,7 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) { const struct GNUNET_CONFIGURATION_Handle *cfg = cls; struct GNUNET_ABD_Delegate *cred; - struct GNUNET_IDENTITY_PublicKey zone_pubkey; + struct GNUNET_CRYPTO_PublicKey zone_pubkey; char *subject_pubkey_str; char *zone_pubkey_str; @@ -586,12 +586,12 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) // Get import subject public key string subject_pubkey_str = - GNUNET_IDENTITY_public_key_to_string (&cred->subject_key); + GNUNET_CRYPTO_public_key_to_string (&cred->subject_key); // Get zone public key string GNUNET_IDENTITY_ego_get_public_key (ego, &zone_pubkey); zone_pubkey_str = - GNUNET_IDENTITY_public_key_to_string (&zone_pubkey); + GNUNET_CRYPTO_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) @@ -668,7 +668,7 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) static void sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) { - const struct GNUNET_IDENTITY_PrivateKey *privkey; + const struct GNUNET_CRYPTO_PrivateKey *privkey; struct GNUNET_ABD_Delegate *dele; struct GNUNET_TIME_Absolute etime_abs; char *res; @@ -718,7 +718,7 @@ sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) return; } if (GNUNET_OK != - GNUNET_IDENTITY_public_key_from_string (subject_pubkey_str, + GNUNET_CRYPTO_public_key_from_string (subject_pubkey_str, &subject_pkey)) { fprintf (stderr, @@ -883,7 +883,7 @@ run (void *cls, GNUNET_SCHEDULER_shutdown (); return; } - if (GNUNET_OK != GNUNET_IDENTITY_public_key_from_string (subject, + if (GNUNET_OK != GNUNET_CRYPTO_public_key_from_string (subject, &subject_pkey)) { fprintf (stderr, @@ -902,7 +902,7 @@ run (void *cls, return; } if (GNUNET_OK != - GNUNET_IDENTITY_public_key_from_string (issuer_key, + GNUNET_CRYPTO_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 42b26eb9b..5cbc105f6 100644 --- a/src/abd/gnunet-service-abd.c +++ b/src/abd/gnunet-service-abd.c @@ -60,12 +60,12 @@ struct DelegationChainEntry /** * The issuer */ - struct GNUNET_IDENTITY_PublicKey issuer_key; + struct GNUNET_CRYPTO_PublicKey issuer_key; /** * The subject */ - struct GNUNET_IDENTITY_PublicKey subject_key; + struct GNUNET_CRYPTO_PublicKey subject_key; /** * The issued attribute @@ -165,7 +165,7 @@ struct DelegationSetQueueEntry /** * Issuer key */ - struct GNUNET_IDENTITY_PublicKey *issuer_key; + struct GNUNET_CRYPTO_PublicKey *issuer_key; /** * Queue entries of this set @@ -266,7 +266,7 @@ struct VerifyRequestHandle /** * Issuer public key */ - struct GNUNET_IDENTITY_PublicKey issuer_key; + struct GNUNET_CRYPTO_PublicKey issuer_key; /** * Issuer attribute @@ -276,7 +276,7 @@ struct VerifyRequestHandle /** * Subject public key */ - struct GNUNET_IDENTITY_PublicKey subject_key; + struct GNUNET_CRYPTO_PublicKey subject_key; /** * Delegate DLL @@ -351,10 +351,10 @@ print_deleset (struct DelegationSetQueueEntry *dsentry, char *text) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s %s.%s <- %s.%s\n", text, - GNUNET_IDENTITY_public_key_to_string ( + GNUNET_CRYPTO_public_key_to_string ( &dsentry->delegation_chain_entry->issuer_key), dsentry->delegation_chain_entry->issuer_attribute, - GNUNET_IDENTITY_public_key_to_string ( + GNUNET_CRYPTO_public_key_to_string ( &dsentry->delegation_chain_entry->subject_key), dsentry->delegation_chain_entry->subject_attribute); } @@ -698,7 +698,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_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) continue; if (0 != strcmp (last_entry->delegation_chain_entry->subject_attribute, del_entry->delegate->issuer_attribute)) @@ -832,10 +832,10 @@ forward_resolution (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Entry not relevant, discarding: %s.%s <- %s.%s\n", - GNUNET_IDENTITY_public_key_to_string ( + GNUNET_CRYPTO_public_key_to_string ( &del->issuer_key), del->issuer_attribute, - GNUNET_IDENTITY_public_key_to_string ( + GNUNET_CRYPTO_public_key_to_string ( &del->subject_key), del->subject_attribute); GNUNET_free (del); @@ -849,10 +849,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_IDENTITY_PublicKey); + ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_PublicKey); GNUNET_memcpy (ds_entry->issuer_key, &del->subject_key, - sizeof (struct GNUNET_IDENTITY_PublicKey)); + sizeof (struct GNUNET_CRYPTO_PublicKey)); ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry); ds_entry->delegation_chain_entry->subject_key = del->subject_key; @@ -873,7 +873,7 @@ forward_resolution (void *cls, // if: issuer key we looking for if (0 == memcmp (&del->issuer_key, &vrh->issuer_key, - sizeof (struct GNUNET_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) { // if: issuer attr we looking for if (0 == strcmp (del->issuer_attribute, vrh->issuer_attribute)) @@ -904,7 +904,7 @@ forward_resolution (void *cls, { if (0 == memcmp (&del_entry->delegate->issuer_key, &vrh->delegation_chain_head->subject_key, - sizeof (struct GNUNET_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) { if (0 == strcmp (del_entry->delegate->issuer_attribute, vrh->delegation_chain_head->subject_attribute)) @@ -932,7 +932,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_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) { // compare entry subject attributes to this trailer (iss attr + old trailer) if (0 == strcmp (del_entry->unresolved_attribute_delegation, @@ -962,7 +962,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_IDENTITY_public_key_to_string (&del->issuer_key)); + GNUNET_CRYPTO_public_key_to_string (&del->issuer_key)); ds_entry->lookup_request = GNUNET_GNS_lookup (gns, @@ -1072,10 +1072,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_IDENTITY_PublicKey); + ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_PublicKey); GNUNET_memcpy (ds_entry->issuer_key, &set[j].subject_key, - sizeof (struct GNUNET_IDENTITY_PublicKey)); + sizeof (struct GNUNET_CRYPTO_PublicKey)); if (0 < set[j].subject_attribute_len) ds_entry->delegation_chain_entry->subject_attribute = GNUNET_strdup (set[j].subject_attribute); @@ -1099,7 +1099,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_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) continue; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking if %s matches %s\n", @@ -1181,7 +1181,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_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) { // compare entry subject attributes to this trailer (iss attr + old trailer) if (0 == strcmp (del_entry->attr_trailer, @@ -1270,7 +1270,7 @@ delegation_chain_bw_resolution_start (void *cls) { if (0 != memcmp (&del_entry->delegate->issuer_key, &vrh->issuer_key, - sizeof (struct GNUNET_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) continue; if (0 != strcmp (del_entry->delegate->issuer_attribute, vrh->issuer_attribute)) @@ -1292,10 +1292,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_IDENTITY_PublicKey); + ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_PublicKey); GNUNET_memcpy (ds_entry->issuer_key, &vrh->issuer_key, - sizeof (struct GNUNET_IDENTITY_PublicKey)); + sizeof (struct GNUNET_CRYPTO_PublicKey)); ds_entry->issuer_attribute = GNUNET_strdup (vrh->issuer_attribute); ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry); @@ -1352,7 +1352,7 @@ delegation_chain_fw_resolution_start (void *cls) { if (0 != memcmp (&del_entry->delegate->issuer_key, &vrh->issuer_key, - sizeof (struct GNUNET_IDENTITY_PublicKey))) + sizeof (struct GNUNET_CRYPTO_PublicKey))) continue; if (0 != strcmp (del_entry->delegate->issuer_attribute, vrh->issuer_attribute)) @@ -1374,17 +1374,17 @@ delegation_chain_fw_resolution_start (void *cls) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Looking for %s.%s\n", - GNUNET_IDENTITY_public_key_to_string ( + GNUNET_CRYPTO_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_IDENTITY_PublicKey); + ds_entry->issuer_key = GNUNET_new (struct GNUNET_CRYPTO_PublicKey); GNUNET_memcpy (ds_entry->issuer_key, &del_entry->delegate->subject_key, - sizeof (struct GNUNET_IDENTITY_PublicKey)); + sizeof (struct GNUNET_CRYPTO_PublicKey)); ds_entry->delegation_chain_entry = GNUNET_new (struct DelegationChainEntry); ds_entry->delegation_chain_entry->subject_key = @@ -1588,7 +1588,7 @@ delegate_collection_finished (void *cls) static void handle_delegate_collection_cb (void *cls, - const struct GNUNET_IDENTITY_PrivateKey *key, + const struct GNUNET_CRYPTO_PrivateKey *key, const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd) @@ -1646,7 +1646,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_IDENTITY_key_get_public (&c_msg->subject_key, &vrh->subject_key); + GNUNET_CRYPTO_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 7b2f4af5b..43abe578f 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_IDENTITY_public_key_to_string (&set[i].subject_key); + GNUNET_CRYPTO_public_key_to_string (&set[i].subject_key); if (0 == set[i].subject_attribute_len) { @@ -208,7 +208,7 @@ abd_string_to_value (void *cls, // sets the public key for the set entry if (GNUNET_SYSERR == - GNUNET_IDENTITY_public_key_from_string (subject_pkey, + GNUNET_CRYPTO_public_key_from_string (subject_pkey, &set[i].subject_key)) { GNUNET_free (tmp_str); -- cgit v1.2.3