commit f029ece5c1300c3860ea19d891eae363618ecda3 parent 232dc9ef20b4bb64df35bf701d2c84e7c692fe04 Author: Jacki <jacki@thejackimonster.de> Date: Thu, 20 Nov 2025 02:37:49 +0100 util: adjust function names of blindable public keys to be consistent with newer naming Signed-off-by: Jacki <jacki@thejackimonster.de> Diffstat:
28 files changed, 116 insertions(+), 111 deletions(-)
diff --git a/src/cli/namestore/gnunet-namestore.c b/src/cli/namestore/gnunet-namestore.c @@ -1799,7 +1799,7 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg_) } memset (&rd, 0, sizeof(rd)); rd.data = &pkey; - rd.data_size = GNUNET_CRYPTO_public_key_get_length (&pkey); + rd.data_size = GNUNET_CRYPTO_blindable_pk_get_length (&pkey); rd.record_type = ntohl (pkey.type); rd.expiration_time = etime; if (GNUNET_YES == etime_is_rel) diff --git a/src/cli/revocation/gnunet-revocation-tvg.c b/src/cli/revocation/gnunet-revocation-tvg.c @@ -114,13 +114,13 @@ run_with_key (struct GNUNET_CRYPTO_BlindablePrivateKey *id_priv) GNUNET_CRYPTO_blindable_key_get_public (id_priv, &id_pub); GNUNET_STRINGS_data_to_string (&id_pub, - GNUNET_CRYPTO_public_key_get_length ( + GNUNET_CRYPTO_blindable_pk_get_length ( &id_pub), ztld, sizeof (ztld)); fprintf (stdout, "\n"); fprintf (stdout, "Zone identifier (ztype|zkey):\n"); - key_len = GNUNET_CRYPTO_public_key_get_length (&id_pub); + key_len = GNUNET_CRYPTO_blindable_pk_get_length (&id_pub); GNUNET_assert (0 < key_len); print_bytes (&id_pub, key_len, 8); fprintf (stdout, "\n"); diff --git a/src/cli/revocation/gnunet-revocation.c b/src/cli/revocation/gnunet-revocation.c @@ -343,7 +343,7 @@ ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego) GNUNET_DISK_fn_read (filename, proof_of_work, GNUNET_MAX_POW_SIZE)))) { - ssize_t ksize = GNUNET_CRYPTO_public_key_get_length (&key); + ssize_t ksize = GNUNET_CRYPTO_blindable_pk_get_length (&key); if (0 > ksize) { fprintf (stderr, diff --git a/src/contrib/service/conversation/conversation_api.c b/src/contrib/service/conversation/conversation_api.c @@ -279,10 +279,10 @@ handle_phone_ring (void *cls, case PS_READY: if ((GNUNET_SYSERR == - GNUNET_CRYPTO_read_public_key_from_buffer (&ring[1], - key_len, - &caller_id, - &read)) || + GNUNET_CRYPTO_read_blindable_pk_from_buffer (&ring[1], + key_len, + &caller_id, + &read)) || (read != key_len)) { GNUNET_break (0); diff --git a/src/contrib/service/conversation/gnunet-service-conversation.c b/src/contrib/service/conversation/gnunet-service-conversation.c @@ -770,10 +770,10 @@ handle_cadet_ring_message (void *cls, const struct CadetPhoneRingMessage *msg) sig_len = ntohl (msg->sig_len); if ((GNUNET_SYSERR == - GNUNET_CRYPTO_read_public_key_from_buffer (&msg[1], - key_len, - &identity, - &read)) || + GNUNET_CRYPTO_read_blindable_pk_from_buffer (&msg[1], + key_len, + &identity, + &read)) || (read != key_len)) { GNUNET_break_op (0); @@ -1209,7 +1209,7 @@ handle_client_call_message (void *cls, const struct ClientCallMessage *msg) GNUNET_CRYPTO_blinded_key_sign (&caller_id, &rs, &sig); sig_len = GNUNET_CRYPTO_blinded_key_signature_get_length (&sig); GNUNET_CRYPTO_blindable_key_get_public (&caller_id, &caller_id_pub); - pkey_len = GNUNET_CRYPTO_public_key_get_length (&caller_id_pub); + pkey_len = GNUNET_CRYPTO_blindable_pk_get_length (&caller_id_pub); e = GNUNET_MQ_msg_extra (ring, pkey_len + sig_len, GNUNET_MESSAGE_TYPE_CONVERSATION_CADET_PHONE_RING); written = GNUNET_CRYPTO_write_blindable_pk_to_buffer (&caller_id_pub, diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h @@ -374,7 +374,7 @@ struct GNUNET_CRYPTO_ElligatorRepresentative }; /** - * Key type for the generic public key union + * Key type for the blindable public key union */ enum GNUNET_CRYPTO_KeyType { @@ -4550,8 +4550,8 @@ GNUNET_CRYPTO_blind_sig_verify ( * @return -1 on error, else the compacted length of the key. */ ssize_t -GNUNET_CRYPTO_public_key_get_length (const struct - GNUNET_CRYPTO_BlindablePublicKey *key); +GNUNET_CRYPTO_blindable_pk_get_length ( + const struct GNUNET_CRYPTO_BlindablePublicKey *key); /** * Reads a #GNUNET_CRYPTO_BlindablePublicKey from a compact buffer. @@ -4567,7 +4567,7 @@ GNUNET_CRYPTO_public_key_get_length (const struct * @return #GNUNET_SYSERR on error */ enum GNUNET_GenericReturnValue -GNUNET_CRYPTO_read_public_key_from_buffer ( +GNUNET_CRYPTO_read_blindable_pk_from_buffer ( const void *buffer, size_t len, struct GNUNET_CRYPTO_BlindablePublicKey *key, @@ -4601,11 +4601,10 @@ GNUNET_CRYPTO_blindable_sk_get_length ( * @return -1 or -2 on error, else the amount of bytes written to the buffer */ ssize_t -GNUNET_CRYPTO_write_blindable_pk_to_buffer (const struct - GNUNET_CRYPTO_BlindablePublicKey * - key, - void*buffer, - size_t len); +GNUNET_CRYPTO_write_blindable_pk_to_buffer ( + const struct GNUNET_CRYPTO_BlindablePublicKey *key, + void*buffer, + size_t len); /** diff --git a/src/include/gnunet_messenger_service.h b/src/include/gnunet_messenger_service.h @@ -467,7 +467,7 @@ struct GNUNET_MESSENGER_MessageJoin struct GNUNET_HashCode epoch; /** - * The senders public key to verify its signatures. + * The senders blindable public key to verify its signatures. */ struct GNUNET_CRYPTO_BlindablePublicKey key; }; @@ -509,7 +509,7 @@ struct GNUNET_MESSENGER_MessageName struct GNUNET_MESSENGER_MessageKey { /** - * The new public key which replaces the current senders public key. + * The new blindable public key which replaces the current senders public key. */ struct GNUNET_CRYPTO_BlindablePublicKey key; }; diff --git a/src/lib/gnsrecord/gnsrecord_misc.c b/src/lib/gnsrecord/gnsrecord_misc.c @@ -301,7 +301,7 @@ GNUNET_GNSRECORD_data_from_identity (const struct { char *tmp; *type = ntohl (key->type); - *data_size = GNUNET_CRYPTO_public_key_get_length (key) - sizeof (key->type); + *data_size = GNUNET_CRYPTO_blindable_pk_get_length (key) - sizeof (key->type); if (0 == *data_size) return GNUNET_SYSERR; tmp = GNUNET_malloc (*data_size); diff --git a/src/lib/gnsrecord/gnsrecord_pow.c b/src/lib/gnsrecord/gnsrecord_pow.c @@ -107,7 +107,7 @@ GNR_create_signature_message (const struct GNUNET_GNSRECORD_PowP *pow) size_t ksize; pk = (const struct GNUNET_CRYPTO_BlindablePublicKey *) &pow[1]; - ksize = GNUNET_CRYPTO_public_key_get_length (pk); + ksize = GNUNET_CRYPTO_blindable_pk_get_length (pk); spurp = GNUNET_malloc (sizeof (*spurp) + ksize); spurp->timestamp = pow->timestamp; spurp->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_GNS_REVOCATION); @@ -128,7 +128,7 @@ check_signature_identity (const struct GNUNET_GNSRECORD_PowP *pow, size_t ksize; int ret; - ksize = GNUNET_CRYPTO_public_key_get_length (key); + ksize = GNUNET_CRYPTO_blindable_pk_get_length (key); spurp = GNR_create_signature_message (pow); sig = ((unsigned char*) &pow[1] + ksize); ret = @@ -204,7 +204,7 @@ GNUNET_GNSRECORD_check_pow (const struct GNUNET_GNSRECORD_PowP *pow, GNUNET_memcpy (&buf[sizeof(uint64_t)], &pow->timestamp, sizeof (uint64_t)); - pklen = GNUNET_CRYPTO_public_key_get_length (pk); + pklen = GNUNET_CRYPTO_blindable_pk_get_length (pk); if (0 > pklen) { GNUNET_break (0); @@ -280,7 +280,7 @@ sign_pow_identity (const struct GNUNET_CRYPTO_BlindablePrivateKey *key, ts = GNUNET_TIME_absolute_subtract (ts, GNUNET_TIME_UNIT_WEEKS); pk = (const struct GNUNET_CRYPTO_BlindablePublicKey *) &pow[1]; - ksize = GNUNET_CRYPTO_public_key_get_length (pk); + ksize = GNUNET_CRYPTO_blindable_pk_get_length (pk); pow->timestamp = GNUNET_TIME_absolute_hton (ts); rp = GNR_create_signature_message (pow); sig = ((char*) &pow[1]) + ksize; @@ -394,7 +394,7 @@ GNUNET_GNSRECORD_pow_round (struct GNUNET_GNSRECORD_PowCalculationHandle *pc) GNUNET_memcpy (&buf[sizeof(uint64_t)], &pc->pow->timestamp, sizeof (uint64_t)); - ksize = GNUNET_CRYPTO_public_key_get_length (pk); + ksize = GNUNET_CRYPTO_blindable_pk_get_length (pk); GNUNET_assert (0 < ksize); GNUNET_memcpy (&buf[sizeof(uint64_t) * 2], pk, @@ -438,7 +438,7 @@ GNUNET_GNSRECORD_proof_get_size (const struct GNUNET_GNSRECORD_PowP *pow) size = sizeof (struct GNUNET_GNSRECORD_PowP); pk = (const struct GNUNET_CRYPTO_BlindablePublicKey *) &pow[1]; - ksize = GNUNET_CRYPTO_public_key_get_length (pk); + ksize = GNUNET_CRYPTO_blindable_pk_get_length (pk); size += ksize; size += GNUNET_CRYPTO_blinded_key_signature_get_length_by_type (pk->type); return size; diff --git a/src/lib/gnsrecord/gnunet-gnsrecord-tvg.c b/src/lib/gnsrecord/gnunet-gnsrecord-tvg.c @@ -168,10 +168,10 @@ run_pkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char *label) sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey), 8, 1); printf ("\n"); printf ("Zone identifier (ztype|zkey):\n"); - GNUNET_assert (0 < GNUNET_CRYPTO_public_key_get_length (&id_pub)); - print_bytes (&id_pub, GNUNET_CRYPTO_public_key_get_length (&id_pub), 8); + GNUNET_assert (0 < GNUNET_CRYPTO_blindable_pk_get_length (&id_pub)); + print_bytes (&id_pub, GNUNET_CRYPTO_blindable_pk_get_length (&id_pub), 8); GNUNET_STRINGS_data_to_string (&id_pub, - GNUNET_CRYPTO_public_key_get_length ( + GNUNET_CRYPTO_blindable_pk_get_length ( &id_pub), ztld, sizeof (ztld)); @@ -317,10 +317,10 @@ run_edkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char*label) GNUNET_CRYPTO_EddsaPrivateKey), 8); printf ("\n"); printf ("Zone identifier (ztype|zkey):\n"); - GNUNET_assert (0 < GNUNET_CRYPTO_public_key_get_length (&id_pub)); - print_bytes (&id_pub, GNUNET_CRYPTO_public_key_get_length (&id_pub), 8); + GNUNET_assert (0 < GNUNET_CRYPTO_blindable_pk_get_length (&id_pub)); + print_bytes (&id_pub, GNUNET_CRYPTO_blindable_pk_get_length (&id_pub), 8); GNUNET_STRINGS_data_to_string (&id_pub, - GNUNET_CRYPTO_public_key_get_length ( + GNUNET_CRYPTO_blindable_pk_get_length ( &id_pub), ztld, sizeof (ztld)); diff --git a/src/lib/gnsrecord/test_gnsrecord_testvectors.c b/src/lib/gnsrecord/test_gnsrecord_testvectors.c @@ -622,7 +622,7 @@ main () (GNUNET_GNSRECORD_TYPE_PKEY == ntohl (pub_parsed.type)) ? 1 : 0); priv.type = pub_parsed.type; GNUNET_CRYPTO_blindable_key_get_public (&priv, &pub); - if (0 != memcmp (&pub, &pub_parsed, GNUNET_CRYPTO_public_key_get_length ( + if (0 != memcmp (&pub, &pub_parsed, GNUNET_CRYPTO_blindable_pk_get_length ( &pub))) { printf ("Wrong pubkey.\n"); @@ -632,7 +632,7 @@ main () break; } GNUNET_STRINGS_data_to_string (&pub, - GNUNET_CRYPTO_public_key_get_length ( + GNUNET_CRYPTO_blindable_pk_get_length ( &pub), ztld, sizeof (ztld)); diff --git a/src/lib/util/crypto_pkey.c b/src/lib/util/crypto_pkey.c @@ -82,8 +82,8 @@ GNUNET_CRYPTO_blindable_sk_get_length (const struct ssize_t -GNUNET_CRYPTO_public_key_get_length (const struct - GNUNET_CRYPTO_BlindablePublicKey *key) +GNUNET_CRYPTO_blindable_pk_get_length (const struct + GNUNET_CRYPTO_BlindablePublicKey *key) { switch (ntohl (key->type)) { @@ -99,12 +99,12 @@ GNUNET_CRYPTO_public_key_get_length (const struct enum GNUNET_GenericReturnValue -GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, - size_t len, - struct - GNUNET_CRYPTO_BlindablePublicKey * - key, - size_t *kb_read) +GNUNET_CRYPTO_read_blindable_pk_from_buffer (const void *buffer, + size_t len, + struct + GNUNET_CRYPTO_BlindablePublicKey * + key, + size_t *read) { ssize_t length; if (len < sizeof (key->type)) @@ -112,7 +112,7 @@ GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, GNUNET_memcpy (&key->type, buffer, sizeof (key->type)); - length = GNUNET_CRYPTO_public_key_get_length (key); + length = GNUNET_CRYPTO_blindable_pk_get_length (key); if (len < length) return GNUNET_SYSERR; if (length < 0) @@ -120,7 +120,7 @@ GNUNET_CRYPTO_read_public_key_from_buffer (const void *buffer, GNUNET_memcpy (&key->ecdsa_key, buffer + sizeof (key->type), length - sizeof (key->type)); - *kb_read = length; + *read = length; return GNUNET_OK; } @@ -132,7 +132,7 @@ GNUNET_CRYPTO_write_blindable_pk_to_buffer (const struct void*buffer, size_t len) { - const ssize_t length = GNUNET_CRYPTO_public_key_get_length (key); + const ssize_t length = GNUNET_CRYPTO_blindable_pk_get_length (key); if (len < length) return -1; if (length < 0) @@ -395,7 +395,7 @@ GNUNET_CRYPTO_blindable_public_key_to_string (const struct GNUNET_CRYPTO_BlindablePublicKey * key) { - size_t size = GNUNET_CRYPTO_public_key_get_length (key); + size_t size = GNUNET_CRYPTO_blindable_pk_get_length (key); return GNUNET_STRINGS_data_to_string_alloc (key, size); } diff --git a/src/plugin/gns/plugin_gnsrecord_gns.c b/src/plugin/gns/plugin_gnsrecord_gns.c @@ -198,7 +198,7 @@ gns_string_to_value (void *cls, s); return GNUNET_SYSERR; } - *data_size = GNUNET_CRYPTO_public_key_get_length (&pk); + *data_size = GNUNET_CRYPTO_blindable_pk_get_length (&pk); if (GNUNET_OK != GNUNET_GNSRECORD_data_from_identity (&pk, (char **) data, diff --git a/src/plugin/revocation/plugin_block_revocation.c b/src/plugin/revocation/plugin_block_revocation.c @@ -116,10 +116,10 @@ block_plugin_revocation_check_block (void *cls, } left = block_size - sizeof (*rm) - sizeof (*pow); if (GNUNET_SYSERR == - GNUNET_CRYPTO_read_public_key_from_buffer (&pow[1], - left, - &pk, - &pklen)) + GNUNET_CRYPTO_read_blindable_pk_from_buffer (&pow[1], + left, + &pk, + &pklen)) { GNUNET_break_op (0); return GNUNET_NO; @@ -225,10 +225,10 @@ block_plugin_revocation_get_key (void *cls, return GNUNET_NO; } left = block_size - sizeof (*rm) - sizeof (*pow); - if (GNUNET_SYSERR == GNUNET_CRYPTO_read_public_key_from_buffer (&pow[1], - left, - &pk, - &pklen)) + if (GNUNET_SYSERR == GNUNET_CRYPTO_read_blindable_pk_from_buffer (&pow[1], + left, + &pk, + &pklen)) { GNUNET_break_op (0); return GNUNET_NO; diff --git a/src/service/gns/gns_api.c b/src/service/gns/gns_api.c @@ -376,7 +376,7 @@ GNUNET_GNS_lookup_limited (struct GNUNET_GNS_Handle *handle, lr->lookup_proc = proc; lr->proc_cls = proc_cls; lr->r_id = handle->r_id_gen++; - key_len = GNUNET_CRYPTO_public_key_get_length (zone); + key_len = GNUNET_CRYPTO_blindable_pk_get_length (zone); lr->env = GNUNET_MQ_msg_extra (lookup_msg, nlen + key_len, GNUNET_MESSAGE_TYPE_GNS_LOOKUP); diff --git a/src/service/gns/gnunet-service-gns.c b/src/service/gns/gnunet-service-gns.c @@ -434,10 +434,10 @@ handle_lookup (void *cls, clh->gc = gc; clh->request_id = sh_msg->id; if ((GNUNET_SYSERR == - GNUNET_CRYPTO_read_public_key_from_buffer (&sh_msg[1], - key_len, - &zone, - &read)) || + GNUNET_CRYPTO_read_blindable_pk_from_buffer (&sh_msg[1], + key_len, + &zone, + &read)) || (read != key_len)) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/service/messenger/gnunet-service-messenger.c b/src/service/messenger/gnunet-service-messenger.c @@ -94,9 +94,10 @@ check_room_initial_key (const struct GNUNET_MESSENGER_RoomMessage *msg) struct GNUNET_CRYPTO_BlindablePublicKey key; size_t key_len; - if (GNUNET_OK != GNUNET_CRYPTO_read_public_key_from_buffer (msg_buffer, - msg_length, - &key, &key_len)) + if (GNUNET_OK != GNUNET_CRYPTO_read_blindable_pk_from_buffer (msg_buffer, + msg_length, + &key, &key_len + )) return GNUNET_NO; return key_len == msg_length ? GNUNET_OK : GNUNET_NO; @@ -123,10 +124,10 @@ initialize_handle_via_key (struct GNUNET_MESSENGER_SrvHandle *handle, struct GNUNET_CRYPTO_BlindablePublicKey key; size_t key_len; - if (GNUNET_OK == GNUNET_CRYPTO_read_public_key_from_buffer (msg_buffer, - msg_length, - &key, - &key_len)) + if (GNUNET_OK == GNUNET_CRYPTO_read_blindable_pk_from_buffer (msg_buffer, + msg_length, + &key, + &key_len)) set_srv_handle_key (handle, &key); else GNUNET_log (GNUNET_ERROR_TYPE_ERROR, diff --git a/src/service/messenger/messenger_api.c b/src/service/messenger/messenger_api.c @@ -472,7 +472,7 @@ send_open_room (struct GNUNET_MESSENGER_Handle *handle, GNUNET_h2s (get_room_key (room)), GNUNET_CRYPTO_blindable_public_key_to_string (key)); - len = GNUNET_CRYPTO_public_key_get_length (key); + len = GNUNET_CRYPTO_blindable_pk_get_length (key); env = GNUNET_MQ_msg_extra (msg, len > 0 ? len : 0, GNUNET_MESSAGE_TYPE_MESSENGER_ROOM_OPEN); @@ -508,7 +508,7 @@ send_enter_room (struct GNUNET_MESSENGER_Handle *handle, GNUNET_i2s (door), GNUNET_CRYPTO_blindable_public_key_to_string (key)); - len = GNUNET_CRYPTO_public_key_get_length (key); + len = GNUNET_CRYPTO_blindable_pk_get_length (key); env = GNUNET_MQ_msg_extra (msg, len > 0 ? len : 0, GNUNET_MESSAGE_TYPE_MESSENGER_ROOM_ENTRY); @@ -1145,7 +1145,8 @@ dequeue_message_from_room (void *cls) GNUNET_memcpy (&(transcript->body.transcript.hash), &hash, sizeof(hash)); memset (&pubkey, 0, sizeof(pubkey)); - GNUNET_CRYPTO_blindable_key_get_public (&key, &pubkey); + GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_blindable_key_get_public ( + &key, &pubkey)); if (GNUNET_YES == encrypt_message (transcript, &pubkey)) { diff --git a/src/service/messenger/messenger_api_message.c b/src/service/messenger/messenger_api_message.c @@ -485,13 +485,13 @@ get_message_body_size (enum GNUNET_MESSENGER_MessageKind kind, switch (kind) { case GNUNET_MESSENGER_KIND_JOIN: - length += GNUNET_CRYPTO_public_key_get_length (&(body->join.key)); + length += GNUNET_CRYPTO_blindable_pk_get_length (&(body->join.key)); break; case GNUNET_MESSENGER_KIND_NAME: length += (body->name.name ? strlen (body->name.name) : 0); break; case GNUNET_MESSENGER_KIND_KEY: - length += GNUNET_CRYPTO_public_key_get_length (&(body->key.key)); + length += GNUNET_CRYPTO_blindable_pk_get_length (&(body->key.key)); break; case GNUNET_MESSENGER_KIND_TEXT: length += (body->text.text ? strlen (body->text.text) : 0); @@ -506,7 +506,7 @@ get_message_body_size (enum GNUNET_MESSENGER_MessageKind kind, length += (body->ticket.identifier ? strlen (body->ticket.identifier) : 0); break; case GNUNET_MESSENGER_KIND_TRANSCRIPT: - length += GNUNET_CRYPTO_public_key_get_length (&(body->transcript.key)); + length += GNUNET_CRYPTO_blindable_pk_get_length (&(body->transcript.key)); length += body->transcript.length; break; case GNUNET_MESSENGER_KIND_TAG: @@ -922,7 +922,7 @@ encode_short_message (const struct GNUNET_MESSENGER_ShortMessage *message, #define decode_step_key(src, offset, dst, length) do { \ enum GNUNET_GenericReturnValue result; \ size_t read; \ - result = GNUNET_CRYPTO_read_public_key_from_buffer ( \ + result = GNUNET_CRYPTO_read_blindable_pk_from_buffer ( \ src + offset, length - offset, dst, &read); \ if (GNUNET_SYSERR == result) \ GNUNET_break (0); \ diff --git a/src/service/messenger/messenger_api_message.h b/src/service/messenger/messenger_api_message.h @@ -266,7 +266,7 @@ verify_message_by_key (const struct GNUNET_MESSENGER_Message *message, */ enum GNUNET_GenericReturnValue encrypt_message (struct GNUNET_MESSENGER_Message *message, - const struct GNUNET_CRYPTO_BlindablePublicKey *key); + const struct GNUNET_CRYPTO_HpkePublicKey *hpke_key); /** * Decrypts a private <i>message</i> using a given private <i>key</i> and replaces its body @@ -279,7 +279,7 @@ encrypt_message (struct GNUNET_MESSENGER_Message *message, */ enum GNUNET_GenericReturnValue decrypt_message (struct GNUNET_MESSENGER_Message *message, - const struct GNUNET_CRYPTO_BlindablePrivateKey *key); + const struct GNUNET_CRYPTO_HpkePrivateKey *hpke_key); /** * Transcribes a <i>message</i> as a new transcript message using a given public diff --git a/src/service/messenger/messenger_api_message_kind.c b/src/service/messenger/messenger_api_message_kind.c @@ -44,7 +44,9 @@ create_message_join (const struct GNUNET_CRYPTO_BlindablePrivateKey *key) memset (&(message->body.leave.epoch), 0, sizeof (struct GNUNET_HashCode)); - GNUNET_CRYPTO_blindable_key_get_public (key, &(message->body.join.key)); + GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_blindable_key_get_public ( + key, &(message->body.join.key))); + return message; } @@ -97,7 +99,9 @@ create_message_key (const struct GNUNET_CRYPTO_BlindablePrivateKey *key) if (! message) return NULL; - GNUNET_CRYPTO_blindable_key_get_public (key, &(message->body.key.key)); + GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_blindable_key_get_public ( + key, &(message->body.key.key))); + return message; } diff --git a/src/service/namestore/gnunet-service-namestore.c b/src/service/namestore/gnunet-service-namestore.c @@ -2129,11 +2129,11 @@ handle_zone_to_name (void *cls, const struct ZoneToNameMessage *ztn_msg) } pkey_len = ntohs (ztn_msg->pkey_len); if ((GNUNET_SYSERR == - GNUNET_CRYPTO_read_public_key_from_buffer ((char*) &ztn_msg[1] - + key_len, - pkey_len, - &value_zone, - &kb_read)) || + GNUNET_CRYPTO_read_blindable_pk_from_buffer ((char*) &ztn_msg[1] + + key_len, + pkey_len, + &value_zone, + &kb_read)) || (kb_read != pkey_len)) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/service/namestore/namestore_api.c b/src/service/namestore/namestore_api.c @@ -1381,7 +1381,7 @@ GNUNET_NAMESTORE_zone_to_name ( GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, qe); key_len = GNUNET_CRYPTO_blindable_sk_get_length (zone); - pkey_len = GNUNET_CRYPTO_public_key_get_length (value_zone); + pkey_len = GNUNET_CRYPTO_blindable_pk_get_length (value_zone); env = GNUNET_MQ_msg_extra (msg, key_len + pkey_len, GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME); msg->gns_header.r_id = htonl (rid); diff --git a/src/service/reclaim/gnunet-service-reclaim.c b/src/service/reclaim/gnunet-service-reclaim.c @@ -946,7 +946,7 @@ consume_result_cb (void *cls, attrs_len = GNUNET_RECLAIM_attribute_list_serialize_get_size (attrs); pres_len = GNUNET_RECLAIM_presentation_list_serialize_get_size ( presentations); - key_len = GNUNET_CRYPTO_public_key_get_length (identity); + key_len = GNUNET_CRYPTO_blindable_pk_get_length (identity); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending CONSUME_TICKET_RESULT message\n"); env = GNUNET_MQ_msg_extra (crm, @@ -2059,7 +2059,7 @@ attr_iter_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n"); GNUNET_CRYPTO_blindable_key_get_public (zone, &identity); - key_len = GNUNET_CRYPTO_public_key_get_length (&identity); + key_len = GNUNET_CRYPTO_blindable_pk_get_length (&identity); env = GNUNET_MQ_msg_extra (arm, rd->data_size + key_len, GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); @@ -2290,7 +2290,7 @@ cred_iter_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending CREDENTIAL_RESULT message\n"); GNUNET_CRYPTO_blindable_key_get_public (zone, &identity); - key_len = GNUNET_CRYPTO_public_key_get_length (&identity); + key_len = GNUNET_CRYPTO_blindable_pk_get_length (&identity); env = GNUNET_MQ_msg_extra (arm, rd->data_size + key_len, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT); diff --git a/src/service/reclaim/reclaim_api.c b/src/service/reclaim/reclaim_api.c @@ -620,10 +620,10 @@ handle_consume_ticket_result (void *cls, struct GNUNET_RECLAIM_PresentationListEntry *ple; read_ptr = (char *) &msg[1]; GNUNET_assert (GNUNET_SYSERR != - GNUNET_CRYPTO_read_public_key_from_buffer (read_ptr, - key_len, - &identity, - &read)); + GNUNET_CRYPTO_read_blindable_pk_from_buffer (read_ptr, + key_len, + &identity, + &read)); read_ptr += read; attrs = GNUNET_RECLAIM_attribute_list_deserialize (read_ptr, attrs_len); @@ -765,10 +765,10 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg) { struct GNUNET_RECLAIM_Attribute *attr; GNUNET_assert (GNUNET_SYSERR != - GNUNET_CRYPTO_read_public_key_from_buffer (buf, - key_len, - &identity, - &read)); + GNUNET_CRYPTO_read_blindable_pk_from_buffer (buf, + key_len, + &identity, + &read)); buf += read; GNUNET_RECLAIM_attribute_deserialize (buf, attr_len, &attr); if (NULL != it) @@ -854,10 +854,10 @@ handle_credential_result (void *cls, const struct if (0 < key_len) { GNUNET_assert (GNUNET_SYSERR != - GNUNET_CRYPTO_read_public_key_from_buffer (buf, - key_len, - &identity, - &read)); + GNUNET_CRYPTO_read_blindable_pk_from_buffer (buf, + key_len, + &identity, + &read)); buf += read; } if (0 == key_len) diff --git a/src/service/revocation/gnunet-service-revocation.c b/src/service/revocation/gnunet-service-revocation.c @@ -258,8 +258,8 @@ handle_query_message (void *cls, key_len = ntohl (qm->key_len); if ((GNUNET_SYSERR == - GNUNET_CRYPTO_read_public_key_from_buffer (&qm[1], key_len, - &zone, &read)) || + GNUNET_CRYPTO_read_blindable_pk_from_buffer (&qm[1], key_len, + &zone, &read)) || (read != key_len)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -346,7 +346,7 @@ publicize_rm (const struct RevokeMessage *rm) = (const struct GNUNET_CRYPTO_BlindablePublicKey *) &pow[1]; /** FIXME yeah this works, but should we have a key length somewhere? */ - pklen = GNUNET_CRYPTO_public_key_get_length (pk); + pklen = GNUNET_CRYPTO_blindable_pk_get_length (pk); if (0 > pklen) { GNUNET_break_op (0); @@ -990,7 +990,7 @@ run (void *cls, } pow = (struct GNUNET_GNSRECORD_PowP *) &rm[1]; pk = (const struct GNUNET_CRYPTO_BlindablePublicKey *) &pow[1]; - ksize = GNUNET_CRYPTO_public_key_get_length (pk); + ksize = GNUNET_CRYPTO_blindable_pk_get_length (pk); if (0 > ksize) { GNUNET_break_op (0); diff --git a/src/service/revocation/revocation_api.c b/src/service/revocation/revocation_api.c @@ -135,7 +135,7 @@ GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg, } q->func = func; q->func_cls = func_cls; - key_len = GNUNET_CRYPTO_public_key_get_length (key); + key_len = GNUNET_CRYPTO_blindable_pk_get_length (key); env = GNUNET_MQ_msg_extra (qm, key_len, GNUNET_MESSAGE_TYPE_REVOCATION_QUERY); GNUNET_CRYPTO_write_blindable_pk_to_buffer (key, &qm[1], key_len); diff --git a/src/service/revocation/test_revocation_testvectors.c b/src/service/revocation/test_revocation_testvectors.c @@ -256,7 +256,7 @@ main () (GNUNET_GNSRECORD_TYPE_PKEY == ntohl (pub_parsed.type)) ? 1 : 0); priv.type = pub_parsed.type; GNUNET_CRYPTO_blindable_key_get_public (&priv, &pub); - if (0 != memcmp (&pub, &pub_parsed, GNUNET_CRYPTO_public_key_get_length ( + if (0 != memcmp (&pub, &pub_parsed, GNUNET_CRYPTO_blindable_pk_get_length ( &pub))) { printf ("Wrong pubkey.\n"); @@ -266,7 +266,7 @@ main () break; } GNUNET_STRINGS_data_to_string (&pub, - GNUNET_CRYPTO_public_key_get_length ( + GNUNET_CRYPTO_blindable_pk_get_length ( &pub), ztld, sizeof (ztld));