From a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 13 Sep 2013 12:00:01 +0000 Subject: splitting 'struct GNUNET_CRYPTO_EccPublicKey' into one struct for signing and another for encryption --- src/core/gnunet-service-core_kx.c | 20 ++-- .../gnunet-daemon-experimentation_experiments.c | 6 +- src/fs/fs_api.h | 6 +- src/fs/fs_namespace.c | 6 +- src/fs/fs_publish_ublock.c | 10 +- src/fs/fs_publish_ublock.h | 2 +- src/fs/fs_search.c | 16 +-- src/fs/fs_unindex.c | 6 +- src/fs/fs_uri.c | 26 ++--- src/fs/test_fs_namespace.c | 4 +- src/fs/test_fs_uri.c | 4 +- src/gns/gns.h | 2 +- src/gns/gns_api.c | 2 +- src/gns/gnunet-dns2gns.c | 4 +- src/gns/gnunet-gns-helper-service-w32.c | 8 +- src/gns/gnunet-gns-proxy.c | 14 +-- src/gns/gnunet-gns.c | 20 ++-- src/gns/gnunet-service-gns.c | 6 +- src/gns/gnunet-service-gns_interceptor.c | 4 +- src/gns/gnunet-service-gns_interceptor.h | 2 +- src/gns/gnunet-service-gns_resolver.c | 20 ++-- src/gns/gnunet-service-gns_resolver.h | 2 +- src/gns/gnunet-service-gns_shorten.c | 16 +-- src/gns/gnunet-service-gns_shorten.h | 2 +- src/gns/plugin_block_gns.c | 2 +- src/gns/test_gns_cname_lookup.c | 4 +- src/gns/test_gns_dht_delegated_lookup.c | 10 +- src/gns/test_gns_dht_three_peers.c | 8 +- src/gns/test_gns_max_queries.c | 8 +- src/gns/test_gns_ns_lookup.c | 4 +- src/gns/test_gns_pseu_shorten.c | 26 ++--- src/gns/test_gns_revocation.c | 8 +- src/gns/test_gns_simple_delegated_lookup.c | 8 +- src/gns/test_gns_simple_lookup.c | 4 +- src/gns/test_gns_simple_mx_lookup.c | 8 +- src/gns/test_gns_simple_shorten.c | 20 ++-- src/gns/test_gns_simple_srv_lookup.c | 8 +- src/gns/test_gns_simple_zkey_lookup.c | 8 +- src/hello/gnunet-hello.c | 2 +- src/hello/hello.c | 16 +-- src/hello/test_friend_hello.c | 4 +- src/hello/test_hello.c | 4 +- src/identity/gnunet-identity.c | 2 +- src/identity/identity_api.c | 14 +-- src/include/block_dns.h | 2 +- src/include/block_fs.h | 2 +- src/include/block_regex.h | 2 +- src/include/gnunet_crypto_lib.h | 111 ++++++++++++++++----- src/include/gnunet_fs_service.h | 6 +- src/include/gnunet_gns_service.h | 2 +- src/include/gnunet_hello_lib.h | 6 +- src/include/gnunet_identity_service.h | 2 +- src/include/gnunet_multicast_service.h | 12 +-- src/include/gnunet_namestore_plugin.h | 2 +- src/include/gnunet_namestore_service.h | 14 +-- src/include/gnunet_psyc_service.h | 10 +- src/include/gnunet_psycstore_plugin.h | 36 +++---- src/include/gnunet_psycstore_service.h | 30 +++--- src/include/gnunet_social_service.h | 4 +- src/mesh/gnunet-service-mesh-enc.c | 8 +- src/mesh/gnunet-service-mesh.c | 4 +- src/multicast/multicast_api.c | 8 +- src/namestore/gnunet-namestore-fcfsd.c | 14 +-- src/namestore/gnunet-namestore.c | 10 +- src/namestore/gnunet-service-namestore.c | 4 +- src/namestore/namestore.h | 6 +- src/namestore/namestore_api.c | 2 +- src/namestore/namestore_api_common.c | 44 ++++---- src/namestore/plugin_namestore_postgres.c | 14 +-- src/namestore/plugin_namestore_sqlite.c | 12 +-- src/namestore/test_namestore_api_blocks.c | 4 +- src/namestore/test_namestore_api_put.c | 4 +- src/namestore/test_namestore_api_remove.c | 4 +- ...test_namestore_api_remove_not_existing_record.c | 4 +- src/namestore/test_namestore_api_store.c | 4 +- src/namestore/test_namestore_api_store_update.c | 4 +- src/namestore/test_namestore_api_zone_to_name.c | 10 +- src/nse/gnunet-service-nse.c | 18 ++-- src/peerinfo-tool/gnunet-peerinfo.c | 4 +- src/peerinfo/gnunet-service-peerinfo.c | 2 +- src/peerinfo/perf_peerinfo_api.c | 2 +- src/peerinfo/test_peerinfo_api.c | 2 +- src/peerinfo/test_peerinfo_api_friend_only.c | 2 +- .../test_peerinfo_api_notify_friend_only.c | 2 +- src/psycstore/plugin_psycstore_sqlite.c | 38 +++---- src/psycstore/psycstore.h | 8 +- src/psycstore/psycstore_api.c | 8 +- src/psycstore/test_plugin_psycstore.c | 8 +- src/psycstore/test_psycstore.c | 8 +- src/regex/regex_internal_dht.c | 4 +- src/testing/testing.c | 6 +- src/transport/gnunet-service-transport.c | 4 +- src/transport/gnunet-service-transport.h | 2 +- .../gnunet-service-transport_neighbours.c | 8 +- .../gnunet-service-transport_validation.c | 10 +- .../gnunet-service-transport_validation.h | 2 +- src/transport/test_plugin_transport.c | 4 +- src/util/crypto_ecc.c | 102 +++++++++++++------ src/util/gnunet-ecc.c | 6 +- src/util/test_crypto_ecc.c | 32 +++--- 100 files changed, 581 insertions(+), 478 deletions(-) (limited to 'src') diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index 9f904742d..6c6b8f07a 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c @@ -111,12 +111,12 @@ struct EphemeralKeyMessage * Ephemeral public ECC key (always for NIST P-521) encoded in a format suitable * for network transmission as created using 'gcry_sexp_sprint'. */ - struct GNUNET_CRYPTO_EccPublicKey ephemeral_key; + struct GNUNET_CRYPTO_EccPublicSignKey ephemeral_key; /** * Public key of the signing peer (persistent version, not the ephemeral public key). */ - struct GNUNET_CRYPTO_EccPublicKey origin_public_key; + struct GNUNET_CRYPTO_EccPublicSignKey origin_public_key; }; @@ -392,7 +392,7 @@ static struct EphemeralKeyMessage current_ekm; /** * Our public key. */ -static struct GNUNET_CRYPTO_EccPublicKey my_public_key; +static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; /** * Our message stream tokenizer (for encrypted payload). @@ -771,7 +771,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, "Core service receives `%s' request from `%4s'.\n", "EPHEMERAL_KEY", GNUNET_i2s (&kx->peer)); GNUNET_CRYPTO_hash (&m->origin_public_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &signer_id.hashPubKey); if (0 != memcmp (&signer_id, &kx->peer, @@ -784,8 +784,8 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey)) || + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) || (GNUNET_OK != GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY, &m->purpose, @@ -1477,8 +1477,8 @@ sign_ephemeral_key () current_ekm.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey)); + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); current_ekm.creation_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (GSC_cfg, @@ -1492,7 +1492,7 @@ sign_ephemeral_key () { current_ekm.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_UNIT_FOREVER_ABS); } - GNUNET_CRYPTO_ecc_key_get_public (my_ephemeral_key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_ephemeral_key, ¤t_ekm.ephemeral_key); current_ekm.origin_public_key = my_public_key; GNUNET_assert (GNUNET_OK == @@ -1541,7 +1541,7 @@ GSC_KX_init (struct GNUNET_CRYPTO_EccPrivateKey *pk) { GNUNET_assert (NULL != pk); my_private_key = pk; - GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &GSC_my_identity.hashPubKey); if (GNUNET_YES == diff --git a/src/experimentation/gnunet-daemon-experimentation_experiments.c b/src/experimentation/gnunet-daemon-experimentation_experiments.c index 01d8fa816..c787c3416 100644 --- a/src/experimentation/gnunet-daemon-experimentation_experiments.c +++ b/src/experimentation/gnunet-daemon-experimentation_experiments.c @@ -38,7 +38,7 @@ */ struct Issuer { - struct GNUNET_CRYPTO_EccPublicKey pubkey; + struct GNUNET_CRYPTO_EccPublicSignKey pubkey; }; @@ -409,7 +409,7 @@ GED_experiments_start () char *pubkey; char *pos; struct GNUNET_PeerIdentity issuer_ID; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_HashCode hash; /* Load valid issuer */ @@ -448,7 +448,7 @@ GED_experiments_start () if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (GED_cfg, "EXPERIMENTATION", "PUBKEY", &pubkey)) { - if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_key_from_string(pubkey, strlen (pubkey), &pub)) + if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_sign_key_from_string(pubkey, strlen (pubkey), &pub)) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Invalid public key `%s'\n"), pubkey); else { diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index 441e4fa9b..1700b469b 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h @@ -120,7 +120,7 @@ struct Location /** * Identity of the peer sharing the file. */ - struct GNUNET_CRYPTO_EccPublicKey peer; + struct GNUNET_CRYPTO_EccPublicSignKey peer; /** * Time when this location URI expires. @@ -198,7 +198,7 @@ struct GNUNET_FS_Uri /** * Identifier of the namespace. */ - struct GNUNET_CRYPTO_EccPublicKey ns; + struct GNUNET_CRYPTO_EccPublicSignKey ns; /** * Human-readable identifier chosen for this entry in the @@ -1461,7 +1461,7 @@ struct SearchRequestEntry /** * Derived public key, hashes to 'uquery'. */ - struct GNUNET_CRYPTO_EccPublicKey dpub; + struct GNUNET_CRYPTO_EccPublicSignKey dpub; /** * The original keyword, used to derive the diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index 526ebbdfc..2fe1de7e2 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c @@ -131,7 +131,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h, { char *dn; char *ret; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_HashCode hc; struct GNUNET_CRYPTO_HashAsciiEncoded enc; @@ -143,7 +143,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h, "fs", "UPDATE_DIR"); return NULL; } - GNUNET_CRYPTO_ecc_key_get_public (ns, &pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &pub); GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); GNUNET_CRYPTO_hash_to_enc (&hc, &enc); @@ -448,7 +448,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, sks_uri = GNUNET_new (struct GNUNET_FS_Uri); sks_uri->type = GNUNET_FS_URI_SKS; sks_uri->data.sks.identifier = GNUNET_strdup (identifier); - GNUNET_CRYPTO_ecc_key_get_public (ns, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &sks_uri->data.sks.ns); psc = GNUNET_new (struct GNUNET_FS_PublishSksContext); diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c index e45808793..252268e24 100644 --- a/src/fs/fs_publish_ublock.c +++ b/src/fs/fs_publish_ublock.c @@ -46,7 +46,7 @@ static void derive_ublock_encryption_key (struct GNUNET_CRYPTO_AesSessionKey *skey, struct GNUNET_CRYPTO_AesInitializationVector *iv, const char *label, - const struct GNUNET_CRYPTO_EccPublicKey *pub) + const struct GNUNET_CRYPTO_EccPublicSignKey *pub) { struct GNUNET_HashCode key; @@ -73,7 +73,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_AesSessionKey *skey, void GNUNET_FS_ublock_decrypt_ (const void *input, size_t input_len, - const struct GNUNET_CRYPTO_EccPublicKey *ns, + const struct GNUNET_CRYPTO_EccPublicSignKey *ns, const char *label, void *output) { @@ -170,7 +170,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, struct GNUNET_CRYPTO_AesInitializationVector iv; struct GNUNET_CRYPTO_AesSessionKey skey; struct GNUNET_CRYPTO_EccPrivateKey *nsd; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; char *uris; size_t size; char *kbe; @@ -225,7 +225,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, "Publishing under identifier `%s'\n", label); /* get public key of the namespace */ - GNUNET_CRYPTO_ecc_key_get_public (ns, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &pub); derive_ublock_encryption_key (&skey, &iv, label, &pub); @@ -243,7 +243,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, /* derive signing-key from 'label' and public key of the namespace */ nsd = GNUNET_CRYPTO_ecc_key_derive (ns, label, "fs-ublock"); - GNUNET_CRYPTO_ecc_key_get_public (nsd, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (nsd, &ub_enc->verification_key); GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecc_sign (nsd, diff --git a/src/fs/fs_publish_ublock.h b/src/fs/fs_publish_ublock.h index 9a2db54ac..1a7d338d2 100644 --- a/src/fs/fs_publish_ublock.h +++ b/src/fs/fs_publish_ublock.h @@ -46,7 +46,7 @@ void GNUNET_FS_ublock_decrypt_ (const void *input, size_t input_len, - const struct GNUNET_CRYPTO_EccPublicKey *ns, + const struct GNUNET_CRYPTO_EccPublicSignKey *ns, const char *label, void *output); diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 38bd55caa..09c260000 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -679,20 +679,20 @@ process_sks_result (struct GNUNET_FS_SearchContext *sc, const char *id_update, */ static int decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, - const struct GNUNET_CRYPTO_EccPublicKey *dpub, + const struct GNUNET_CRYPTO_EccPublicSignKey *dpub, const void *edata, size_t edata_size, char *data) { const struct GNUNET_CRYPTO_EccPrivateKey *anon; - struct GNUNET_CRYPTO_EccPublicKey anon_pub; + struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; unsigned int i; /* find key */ for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) if (0 == memcmp (dpub, &sc->requests[i].dpub, - sizeof (struct GNUNET_CRYPTO_EccPublicKey))) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) break; if (i == sc->uri->data.ksk.keywordCount) { @@ -702,7 +702,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, } /* decrypt */ anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); - GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); GNUNET_FS_ublock_decrypt_ (edata, edata_size, &anon_pub, sc->requests[i].keyword, @@ -1035,7 +1035,7 @@ transmit_search_request (void *cls, size_t size, void *buf) struct MessageBuilderContext mbc; size_t msize; struct SearchMessage *sm; - struct GNUNET_CRYPTO_EccPublicKey dpub; + struct GNUNET_CRYPTO_EccPublicSignKey dpub; unsigned int sqms; uint32_t options; @@ -1272,7 +1272,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) unsigned int i; const char *keyword; const struct GNUNET_CRYPTO_EccPrivateKey *anon; - struct GNUNET_CRYPTO_EccPublicKey anon_pub; + struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; struct SearchRequestEntry *sre; GNUNET_assert (NULL == sc->client); @@ -1280,7 +1280,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) { GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); - GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); sc->requests = GNUNET_malloc (sizeof (struct SearchRequestEntry) * sc->uri->data.ksk.keywordCount); @@ -1294,7 +1294,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) "fs-ublock", &sre->dpub); GNUNET_CRYPTO_hash (&sre->dpub, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &sre->uquery); sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); if (sre->mandatory) diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index 5a956b0b5..6c4ee6696 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c @@ -554,8 +554,8 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) { const char *keyword; const struct GNUNET_CRYPTO_EccPrivateKey *anon; - struct GNUNET_CRYPTO_EccPublicKey anon_pub; - struct GNUNET_CRYPTO_EccPublicKey dpub; + struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; + struct GNUNET_CRYPTO_EccPublicSignKey dpub; if (NULL == uc->dsh) uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); @@ -574,7 +574,7 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) return; } anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); - GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub, keyword, diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 23a368261..67ce6d530 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -118,7 +118,7 @@ GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, case GNUNET_FS_URI_LOC: GNUNET_CRYPTO_hash (&uri->data.loc.fi, sizeof (struct FileIdentifier) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), key); break; default: @@ -357,7 +357,7 @@ static struct GNUNET_FS_Uri * uri_sks_parse (const char *s, char **emsg) { struct GNUNET_FS_Uri *ret; - struct GNUNET_CRYPTO_EccPublicKey ns; + struct GNUNET_CRYPTO_EccPublicSignKey ns; size_t pos; char *end; @@ -532,7 +532,7 @@ struct LocUriAssembly /** * Peer offering the file. */ - struct GNUNET_CRYPTO_EccPublicKey peer; + struct GNUNET_CRYPTO_EccPublicSignKey peer; }; GNUNET_NETWORK_STRUCT_END @@ -604,7 +604,7 @@ uri_loc_parse (const char *s, char **emsg) npos++; ret = enc2bin (&s[npos], &ass.peer, - sizeof (struct GNUNET_CRYPTO_EccPublicKey)); + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); if (ret == -1) { *emsg = @@ -841,7 +841,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, if (uri->type != GNUNET_FS_URI_LOC) return GNUNET_SYSERR; GNUNET_CRYPTO_hash (&uri->data.loc.peer, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &peer->hashPubKey); return GNUNET_OK; } @@ -897,7 +897,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, { struct GNUNET_FS_Uri *uri; struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; - struct GNUNET_CRYPTO_EccPublicKey my_public_key; + struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; char *keyfile; struct LocUriAssembly ass; struct GNUNET_TIME_Absolute et; @@ -922,7 +922,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, GNUNET_free (keyfile); /* we round expiration time to full seconds for SKS URIs */ et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL; - GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); ass.exptime = GNUNET_TIME_absolute_hton (et); @@ -949,7 +949,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, * @return an FS URI for the given namespace and identifier */ struct GNUNET_FS_Uri * -GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, +GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, const char *id) { struct GNUNET_FS_Uri *ns_uri; @@ -1260,7 +1260,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, case GNUNET_FS_URI_SKS: if ((0 == memcmp (&u1->data.sks.ns, &u2->data.sks.ns, - sizeof (struct GNUNET_CRYPTO_EccPublicKey))) && + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) && (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) return GNUNET_YES; @@ -1287,7 +1287,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, if (memcmp (&u1->data.loc, &u2->data.loc, sizeof (struct FileIdentifier) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + sizeof (unsigned short)) != 0) return GNUNET_NO; @@ -1321,7 +1321,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri) */ int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, - struct GNUNET_CRYPTO_EccPublicKey *pseudonym) + struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym) { if (!GNUNET_FS_uri_test_sks (uri)) { @@ -1896,7 +1896,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri) if (GNUNET_FS_URI_SKS != uri->type) return NULL; ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), buf, sizeof (buf)); GNUNET_assert (NULL != ret); @@ -2001,7 +2001,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); peerId = bin2enc (&uri->data.loc.peer, - sizeof (struct GNUNET_CRYPTO_EccPublicKey)); + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); peerSig = bin2enc (&uri->data.loc.contentSignature, sizeof (struct GNUNET_CRYPTO_EccSignature)); diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 680d1b61b..11c611e04 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c @@ -29,7 +29,7 @@ #include "gnunet_fs_service.h" -static struct GNUNET_CRYPTO_EccPublicKey nsid; +static struct GNUNET_CRYPTO_EccPublicSignKey nsid; static struct GNUNET_FS_Uri *sks_expect_uri; @@ -255,7 +255,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) bo.replication_level = 0; bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); - GNUNET_CRYPTO_ecc_key_get_public (ns, &nsid); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &nsid); GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri, &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL); GNUNET_CONTAINER_meta_data_destroy (meta); diff --git a/src/fs/test_fs_uri.c b/src/fs/test_fs_uri.c index 0d3aeaf41..1e1bd8fb8 100644 --- a/src/fs/test_fs_uri.c +++ b/src/fs/test_fs_uri.c @@ -164,7 +164,7 @@ testNamespace (int i) struct GNUNET_FS_Uri *ret; char *emsg; struct GNUNET_CRYPTO_EccPrivateKey *ph; - struct GNUNET_CRYPTO_EccPublicKey id; + struct GNUNET_CRYPTO_EccPublicSignKey id; char buf[1024]; char ubuf[1024]; char *sret; @@ -194,7 +194,7 @@ testNamespace (int i) } GNUNET_free (emsg); ph = GNUNET_CRYPTO_ecc_key_create (); - GNUNET_CRYPTO_ecc_key_get_public (ph, &id); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (ph, &id); sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), ubuf, sizeof (ubuf) - 1); GNUNET_assert (NULL != sret); diff --git a/src/gns/gns.h b/src/gns/gns.h index d72c1f03d..9e7a15575 100644 --- a/src/gns/gns.h +++ b/src/gns/gns.h @@ -63,7 +63,7 @@ struct GNUNET_GNS_ClientLookupMessage /** * Zone that is to be used for lookup */ - struct GNUNET_CRYPTO_EccPublicKey zone; + struct GNUNET_CRYPTO_EccPublicSignKey zone; /** * Only check cached results diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 63d42ffee..de5c6062a 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c @@ -521,7 +521,7 @@ GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr) struct GNUNET_GNS_LookupRequest* GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, const char *name, - const struct GNUNET_CRYPTO_EccPublicKey *zone, + const struct GNUNET_CRYPTO_EccPublicSignKey *zone, int type, int only_cached, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index b65e45757..70c791de4 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c @@ -143,7 +143,7 @@ static unsigned int listen_port = 53; /** * Which GNS zone do we translate incoming DNS requests to? */ -static struct GNUNET_CRYPTO_EccPublicKey my_zone; +static struct GNUNET_CRYPTO_EccPublicSignKey my_zone; /** * '-z' option with the main zone to use. @@ -744,7 +744,7 @@ run (void *cls, char *const *args, const char *cfgfile, } if ( (NULL == gns_zone_str) || (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (gns_zone_str, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (gns_zone_str, strlen (gns_zone_str), &my_zone)) ) { diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c index 2c4f0e20a..4e5aeffc5 100644 --- a/src/gns/gnunet-gns-helper-service-w32.c +++ b/src/gns/gnunet-gns-helper-service-w32.c @@ -61,7 +61,7 @@ struct request */ static struct GNUNET_GNS_Handle *gns; -static struct GNUNET_CRYPTO_EccPublicKey *zone = NULL; +static struct GNUNET_CRYPTO_EccPublicSignKey *zone = NULL; static struct GNUNET_HashCode user_zone; struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL; @@ -663,7 +663,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, char* keyfile; struct GNUNET_CRYPTO_EccPrivateKey *key = NULL; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_CRYPTO_HashAsciiEncoded zonename; if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", @@ -678,8 +678,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) { key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); - GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicKey), + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); + GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), &user_zone); GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 3a3678df1..7ccd14470 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -3189,7 +3189,7 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) { char *keyfile; struct GNUNET_CRYPTO_EccPrivateKey *key; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_CRYPTO_ShortHashCode *zone; struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; @@ -3210,10 +3210,10 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) } key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); local_gns_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); GNUNET_CRYPTO_short_hash (&pkey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), local_gns_zone); zone = local_gns_zone; GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); @@ -3239,10 +3239,10 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) else { key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); local_private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); GNUNET_CRYPTO_short_hash (&pkey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), local_private_zone); GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -3268,10 +3268,10 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) else { key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); local_shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); GNUNET_CRYPTO_short_hash (&pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicKey), + sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), local_shorten_zone); GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index 4472c764e..0a6bcf66b 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c @@ -180,7 +180,7 @@ process_lookup_result (void *cls, uint32_t rd_count, * @param shorten_key private key used for shortening, can be NULL */ static void -lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicKey *pkey, +lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key) { if (NULL != lookup_type) @@ -227,7 +227,7 @@ identity_shorten_cb (void *cls, void **ctx, const char *name) { - struct GNUNET_CRYPTO_EccPublicKey *pkeym = cls; + struct GNUNET_CRYPTO_EccPublicSignKey *pkeym = cls; id_op = NULL; if (NULL == ego) @@ -246,12 +246,12 @@ identity_shorten_cb (void *cls, * @param pkey public key to use for the zone */ static void -lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pkey) +lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey) { - struct GNUNET_CRYPTO_EccPublicKey *pkeym; + struct GNUNET_CRYPTO_EccPublicSignKey *pkeym; GNUNET_assert (NULL != pkey); - pkeym = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey); + pkeym = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey); *pkeym = *pkey; id_op = GNUNET_IDENTITY_get (identity, "shorten-zone", @@ -276,7 +276,7 @@ static void identity_zone_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; el = NULL; if (NULL == ego) @@ -314,7 +314,7 @@ identity_master_cb (void *cls, void **ctx, const char *name) { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; id_op = NULL; if (NULL == ego) @@ -341,7 +341,7 @@ static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; cfg = c; gns = GNUNET_GNS_connect (cfg); @@ -357,7 +357,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL != public_key) { if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (public_key, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (public_key, strlen (public_key), &pkey)) { @@ -384,7 +384,7 @@ run (void *cls, char *const *args, const char *cfgfile, &lookup_name[strlen (lookup_name) - 4])) ) { /* no zone required, use 'anonymous' zone */ - GNUNET_CRYPTO_ecc_key_get_public (GNUNET_CRYPTO_ecc_key_get_anonymous (), + GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (), &pkey); lookup_with_public_key (&pkey); } diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 726a8c571..b7eb1f809 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -419,7 +419,7 @@ put_gns_record (void *cls, rd_public_count); block_size = ntohl (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) - + sizeof (struct GNUNET_CRYPTO_EccPublicKey); + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); GNUNET_NAMESTORE_query_from_private_key (key, name, &query); @@ -635,7 +635,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, { &handle_lookup, NULL, GNUNET_MESSAGE_TYPE_GNS_LOOKUP, 0}, {NULL, NULL, 0, 0} }; - struct GNUNET_CRYPTO_EccPublicKey dns_root; + struct GNUNET_CRYPTO_EccPublicSignKey dns_root; unsigned long long max_parallel_bg_queries = 0; char *dns_root_name; @@ -699,7 +699,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, &dns_root_name)) { if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (dns_root_name, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (dns_root_name, strlen (dns_root_name), &dns_root)) { diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c index 2cb1030cd..33c05f743 100644 --- a/src/gns/gnunet-service-gns_interceptor.c +++ b/src/gns/gnunet-service-gns_interceptor.c @@ -75,7 +75,7 @@ static struct GNUNET_DNS_Handle *dns_handle; /** * Key of the zone we start lookups in. */ -static struct GNUNET_CRYPTO_EccPublicKey zone; +static struct GNUNET_CRYPTO_EccPublicSignKey zone; /** * Head of the DLL. @@ -291,7 +291,7 @@ handle_dns_request (void *cls, * @return GNUNET_OK on success */ int -GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicKey *gnu_zone, +GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone, const struct GNUNET_CONFIGURATION_Handle *c) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, diff --git a/src/gns/gnunet-service-gns_interceptor.h b/src/gns/gnunet-service-gns_interceptor.h index 92a154e2c..509875645 100644 --- a/src/gns/gnunet-service-gns_interceptor.h +++ b/src/gns/gnunet-service-gns_interceptor.h @@ -36,7 +36,7 @@ * @return GNUNET_YES on success GNUNET_SYSERR on error */ int -GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicKey *gnu_zone, +GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone, const struct GNUNET_CONFIGURATION_Handle *c); /** diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 676efafe5..a857be559 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -112,7 +112,7 @@ struct AuthorityChain /** * The zone of the GNS authority */ - struct GNUNET_CRYPTO_EccPublicKey gns_authority; + struct GNUNET_CRYPTO_EccPublicSignKey gns_authority; struct { @@ -230,7 +230,7 @@ struct GNS_ResolverHandle /** * The top-level GNS authoritative zone to query */ - struct GNUNET_CRYPTO_EccPublicKey authority_zone; + struct GNUNET_CRYPTO_EccPublicSignKey authority_zone; /** * called when resolution phase finishes @@ -1317,9 +1317,9 @@ handle_gns_resolution_result (void *cls, /* tigger shortening */ if (NULL != rh->shorten_key) { - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; - if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EccPublicKey)) + if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) { GNUNET_break_op (0); break; @@ -1346,7 +1346,7 @@ handle_gns_resolution_result (void *cls, { case GNUNET_NAMESTORE_TYPE_PKEY: /* delegation to another zone */ - if (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != + if (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != rd[i].data_size) { GNUNET_break_op (0); @@ -1360,7 +1360,7 @@ handle_gns_resolution_result (void *cls, ac->gns_authority = GNUNET_YES; memcpy (&ac->authority_info.gns_authority, rd[i].data, - sizeof (struct GNUNET_CRYPTO_EccPublicKey)); + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); ac->label = resolver_lookup_get_next_label (rh); /* tigger shortening */ if (NULL != rh->shorten_key) @@ -1572,7 +1572,7 @@ handle_dht_response (void *cls, block = data; if (size != ntohs (block->purpose.size) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_CRYPTO_EccSignature)) { /* how did this pass DHT block validation!? */ @@ -1615,7 +1615,7 @@ handle_namestore_block_response (void *cls, struct GNS_ResolverHandle *rx; struct AuthorityChain *ac = rh->ac_tail; const char *label = ac->label; - const struct GNUNET_CRYPTO_EccPublicKey *auth = &ac->authority_info.gns_authority; + const struct GNUNET_CRYPTO_EccPublicSignKey *auth = &ac->authority_info.gns_authority; struct GNUNET_HashCode query; GNUNET_NAMESTORE_query_from_public_key (auth, @@ -1774,7 +1774,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) if ( (NULL == x) || (NULL == y) || (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (pkey, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (pkey, strlen (pkey), &rh->authority_zone)) ) { @@ -1822,7 +1822,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) * @return handle to cancel operation */ struct GNS_ResolverHandle * -GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicKey *zone, +GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, uint32_t record_type, const char *name, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, diff --git a/src/gns/gnunet-service-gns_resolver.h b/src/gns/gnunet-service-gns_resolver.h index 877c7ecd0..84d4c2bd7 100644 --- a/src/gns/gnunet-service-gns_resolver.h +++ b/src/gns/gnunet-service-gns_resolver.h @@ -83,7 +83,7 @@ typedef void (*GNS_ResultProcessor)(void *cls, * @return handle to cancel operation */ struct GNS_ResolverHandle * -GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicKey *zone, +GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, uint32_t record_type, const char *name, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, diff --git a/src/gns/gnunet-service-gns_shorten.c b/src/gns/gnunet-service-gns_shorten.c index b0a1b6fbc..49089f542 100644 --- a/src/gns/gnunet-service-gns_shorten.c +++ b/src/gns/gnunet-service-gns_shorten.c @@ -80,7 +80,7 @@ struct GetPseuAuthorityHandle /** * The zone for which we are trying to find the PSEU record. */ - struct GNUNET_CRYPTO_EccPublicKey target_zone; + struct GNUNET_CRYPTO_EccPublicSignKey target_zone; /** * Handle for DHT lookups. Should be NULL if no lookups are in progress @@ -195,7 +195,7 @@ process_pseu_block_ns (void *cls, const struct GNUNET_NAMESTORE_Block *block) { struct GetPseuAuthorityHandle *gph = cls; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; gph->namestore_task = NULL; if (NULL == block) @@ -203,7 +203,7 @@ process_pseu_block_ns (void *cls, process_pseu_lookup_ns (gph, 0, NULL); return; } - GNUNET_CRYPTO_ecc_key_get_public (&gph->shorten_zone_key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, &pub); if (GNUNET_OK != GNUNET_NAMESTORE_block_decrypt (block, @@ -229,10 +229,10 @@ static void perform_pseu_lookup (struct GetPseuAuthorityHandle *gph, const char *label) { - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_HashCode query; - GNUNET_CRYPTO_ecc_key_get_public (&gph->shorten_zone_key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, &pub); GNUNET_free_non_null (gph->current_label); gph->current_label = GNUNET_strdup (label); @@ -287,7 +287,7 @@ process_pseu_lookup_ns (void *cls, GNUNET_NAMESTORE_z2s (&gph->target_zone), gph->current_label); new_pkey.expiration_time = UINT64_MAX; - new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey); + new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); new_pkey.data = &gph->target_zone; new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY; new_pkey.flags = GNUNET_NAMESTORE_RF_NONE @@ -431,7 +431,7 @@ process_auth_discovery_dht_result (void* cls, block = data; if (size != ntohs (block->purpose.size) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_CRYPTO_EccSignature)) { /* how did this pass DHT block validation!? */ @@ -513,7 +513,7 @@ process_zone_to_name_discover (void *cls, */ void GNS_shorten_start (const char *original_label, - const struct GNUNET_CRYPTO_EccPublicKey *pub, + const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone) { struct GetPseuAuthorityHandle *gph; diff --git a/src/gns/gnunet-service-gns_shorten.h b/src/gns/gnunet-service-gns_shorten.h index d71100a88..ed3bdf11f 100644 --- a/src/gns/gnunet-service-gns_shorten.h +++ b/src/gns/gnunet-service-gns_shorten.h @@ -59,7 +59,7 @@ GNS_shorten_done (void); */ void GNS_shorten_start (const char *original_label, - const struct GNUNET_CRYPTO_EccPublicKey *pub, + const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone); diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c index c6fcd3df3..ba2885028 100644 --- a/src/gns/plugin_block_gns.c +++ b/src/gns/plugin_block_gns.c @@ -85,7 +85,7 @@ block_plugin_gns_evaluate (void *cls, enum GNUNET_BLOCK_Type type, return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; } block = reply_block; - if (ntohs (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) + sizeof (struct GNUNET_CRYPTO_EccPublicKey) != + if (ntohs (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != reply_block_size) { GNUNET_break_op (0); diff --git a/src/gns/test_gns_cname_lookup.c b/src/gns/test_gns_cname_lookup.c index e49a17f22..ee51d4aa5 100644 --- a/src/gns/test_gns_cname_lookup.c +++ b/src/gns/test_gns_cname_lookup.c @@ -334,7 +334,7 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; char* alice_keyfile; @@ -366,7 +366,7 @@ do_check (void *cls, } alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); GNUNET_free(alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); diff --git a/src/gns/test_gns_dht_delegated_lookup.c b/src/gns/test_gns_dht_delegated_lookup.c index 7379a8f20..2950f896a 100644 --- a/src/gns/test_gns_dht_delegated_lookup.c +++ b/src/gns/test_gns_dht_delegated_lookup.c @@ -65,8 +65,8 @@ static struct GNUNET_DHT_Handle *dht_handle; static const struct GNUNET_CONFIGURATION_Handle *cfg; -static struct GNUNET_CRYPTO_EccPublicKey alice_pkey; -static struct GNUNET_CRYPTO_EccPublicKey bob_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; @@ -262,7 +262,7 @@ put_dht(void *cls, int32_t success, const char *emsg) } GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); GNUNET_CRYPTO_short_hash(&bob_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicKey), + sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -335,8 +335,8 @@ do_check (void *cls, GNUNET_free(alice_keyfile); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); struct GNUNET_NAMESTORE_RecordData rd; diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index dd83d52f6..688e355ed 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c @@ -312,7 +312,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) { char* keyfile; struct GNUNET_CRYPTO_EccPrivateKey *key; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct in_addr *web; struct GNUNET_NAMESTORE_RecordData rd; @@ -344,7 +344,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) return GNUNET_SYSERR; } - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &dave_hash); rd.expiration_time = UINT64_MAX; @@ -383,7 +383,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) { char* keyfile; struct GNUNET_CRYPTO_EccPrivateKey *key; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_NAMESTORE_RecordData rd; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n"); @@ -415,7 +415,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) return GNUNET_SYSERR; } - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &bob_hash); rd.expiration_time = UINT64_MAX; diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c index 5df715b78..304066017 100644 --- a/src/gns/test_gns_max_queries.c +++ b/src/gns/test_gns_max_queries.c @@ -252,8 +252,8 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; char* alice_keyfile; @@ -295,8 +295,8 @@ do_check (void *cls, alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); GNUNET_free(alice_keyfile); diff --git a/src/gns/test_gns_ns_lookup.c b/src/gns/test_gns_ns_lookup.c index 3bdfd24a2..dbeef3f65 100644 --- a/src/gns/test_gns_ns_lookup.c +++ b/src/gns/test_gns_ns_lookup.c @@ -563,7 +563,7 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; char* alice_keyfile; struct GNUNET_NAMESTORE_RecordData rd[2]; struct in_addr ns; @@ -593,7 +593,7 @@ do_check (void *cls, } alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); GNUNET_free (alice_keyfile); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/gns/test_gns_pseu_shorten.c b/src/gns/test_gns_pseu_shorten.c index 518edac6b..8610179b2 100644 --- a/src/gns/test_gns_pseu_shorten.c +++ b/src/gns/test_gns_pseu_shorten.c @@ -69,11 +69,11 @@ static struct GNUNET_DHT_Handle *dht_handle; static const struct GNUNET_CONFIGURATION_Handle *cfg; -static struct GNUNET_CRYPTO_EccPublicKey alice_pkey; -static struct GNUNET_CRYPTO_EccPublicKey bob_pkey; -static struct GNUNET_CRYPTO_EccPublicKey our_pkey; -static struct GNUNET_CRYPTO_EccPublicKey priv_pkey; -static struct GNUNET_CRYPTO_EccPublicKey short_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey our_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey; +static struct GNUNET_CRYPTO_EccPublicSignKey short_pkey; static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; static struct GNUNET_CRYPTO_EccPrivateKey *our_key; @@ -316,7 +316,7 @@ put_pseu_dht (void *cls, int success) } GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash); GNUNET_CRYPTO_short_hash(&alice_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicKey), + sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -405,7 +405,7 @@ put_www_dht (void *cls, int success) } GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); GNUNET_CRYPTO_short_hash(&alice_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicKey), + sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -488,7 +488,7 @@ put_pkey_dht (void *cls, int32_t success, const char *emsg) GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE, strlen (TEST_AUTHORITY_ALICE), &name_hash); GNUNET_CRYPTO_short_hash (&bob_pkey, - sizeof(struct GNUNET_CRYPTO_EccPublicKey), + sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), &zone_hash); GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); @@ -626,11 +626,11 @@ do_check (void *cls, GNUNET_free (shorten_keyfile); GNUNET_free (private_keyfile); - GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); - GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey); - GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); GNUNET_CRYPTO_short_hash (&alice_pkey, sizeof(alice_pkey), &alice_hash); GNUNET_CRYPTO_short_hash (&our_pkey, sizeof(our_pkey), &our_zone); diff --git a/src/gns/test_gns_revocation.c b/src/gns/test_gns_revocation.c index 9e630740d..459a40c97 100644 --- a/src/gns/test_gns_revocation.c +++ b/src/gns/test_gns_revocation.c @@ -181,8 +181,8 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; @@ -213,8 +213,8 @@ do_check (void *cls, alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; diff --git a/src/gns/test_gns_simple_delegated_lookup.c b/src/gns/test_gns_simple_delegated_lookup.c index ebbc09740..937049dbe 100644 --- a/src/gns/test_gns_simple_delegated_lookup.c +++ b/src/gns/test_gns_simple_delegated_lookup.c @@ -189,8 +189,8 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; @@ -225,8 +225,8 @@ do_check (void *cls, } alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); rd.expiration_time = UINT64_MAX; GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); diff --git a/src/gns/test_gns_simple_lookup.c b/src/gns/test_gns_simple_lookup.c index 73e479464..cc2abeff7 100644 --- a/src/gns/test_gns_simple_lookup.c +++ b/src/gns/test_gns_simple_lookup.c @@ -221,7 +221,7 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_NAMESTORE_RecordData rd; char* alice_keyfile; @@ -252,7 +252,7 @@ do_check (void *cls, } alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); GNUNET_free (alice_keyfile); rd.expiration_time = UINT64_MAX; GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); diff --git a/src/gns/test_gns_simple_mx_lookup.c b/src/gns/test_gns_simple_mx_lookup.c index 2fb05503e..a7eec0a64 100644 --- a/src/gns/test_gns_simple_mx_lookup.c +++ b/src/gns/test_gns_simple_mx_lookup.c @@ -180,8 +180,8 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; @@ -213,8 +213,8 @@ do_check (void *cls, alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; diff --git a/src/gns/test_gns_simple_shorten.c b/src/gns/test_gns_simple_shorten.c index 3a684dbaa..8cab0dbb2 100644 --- a/src/gns/test_gns_simple_shorten.c +++ b/src/gns/test_gns_simple_shorten.c @@ -61,8 +61,8 @@ static struct GNUNET_GNS_Handle *gns_handle; const struct GNUNET_CONFIGURATION_Handle *cfg; -struct GNUNET_CRYPTO_EccPublicKey priv_pkey; -struct GNUNET_CRYPTO_EccPublicKey short_pkey; +struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey; +struct GNUNET_CRYPTO_EccPublicSignKey short_pkey; struct GNUNET_CRYPTO_EccPrivateKey *priv_key; struct GNUNET_CRYPTO_EccPrivateKey *short_key; @@ -170,9 +170,9 @@ void do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey our_pkey; - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey our_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *our_key; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; @@ -237,11 +237,11 @@ void do_check (void *cls, GNUNET_free(shorten_keyfile); GNUNET_free(private_keyfile); - GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); - GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey); - GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey); GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone); GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone); diff --git a/src/gns/test_gns_simple_srv_lookup.c b/src/gns/test_gns_simple_srv_lookup.c index 9e0b89555..7efa57803 100644 --- a/src/gns/test_gns_simple_srv_lookup.c +++ b/src/gns/test_gns_simple_srv_lookup.c @@ -182,8 +182,8 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; struct GNUNET_CRYPTO_ShortHashCode bob_hash; @@ -216,8 +216,8 @@ do_check (void *cls, alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; diff --git a/src/gns/test_gns_simple_zkey_lookup.c b/src/gns/test_gns_simple_zkey_lookup.c index 8a4a4a59c..798fa5b5d 100644 --- a/src/gns/test_gns_simple_zkey_lookup.c +++ b/src/gns/test_gns_simple_zkey_lookup.c @@ -199,8 +199,8 @@ do_check (void *cls, const struct GNUNET_CONFIGURATION_Handle *ccfg, struct GNUNET_TESTING_Peer *peer) { - struct GNUNET_CRYPTO_EccPublicKey alice_pkey; - struct GNUNET_CRYPTO_EccPublicKey bob_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; + struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; struct GNUNET_CRYPTO_EccPrivateKey *alice_key; struct GNUNET_CRYPTO_EccPrivateKey *bob_key; struct GNUNET_CRYPTO_EccSignature *sig; @@ -230,8 +230,8 @@ do_check (void *cls, alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); - GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); - GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); struct GNUNET_NAMESTORE_RecordData rd; char* ip = TEST_IP; diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c index f73d3245a..f96a999b8 100644 --- a/src/hello/gnunet-hello.c +++ b/src/hello/gnunet-hello.c @@ -111,7 +111,7 @@ main (int argc, char *argv[]) struct GNUNET_DISK_FileHandle *fh; struct GNUNET_HELLO_Message *orig; struct GNUNET_HELLO_Message *result; - struct GNUNET_CRYPTO_EccPublicKey pk; + struct GNUNET_CRYPTO_EccPublicSignKey pk; uint64_t fsize; address_count = 0; diff --git a/src/hello/hello.c b/src/hello/hello.c index a6fe6102f..780c1f127 100644 --- a/src/hello/hello.c +++ b/src/hello/hello.c @@ -59,7 +59,7 @@ struct GNUNET_HELLO_Message /** * The public key of the peer. */ - struct GNUNET_CRYPTO_EccPublicKey publicKey; + struct GNUNET_CRYPTO_EccPublicSignKey publicKey; }; GNUNET_NETWORK_STRUCT_END @@ -216,7 +216,7 @@ get_hello_address_size (const char *buf, size_t max, uint16_t * ralen) * @return the hello message */ struct GNUNET_HELLO_Message * -GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, +GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey, GNUNET_HELLO_GenerateAddressListCallback addrgen, void *addrgen_cls, int friend_only) @@ -247,7 +247,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, hello->friend_only = htonl (friend_only); memcpy (&hello->publicKey, publicKey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey)); + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); memcpy (&hello[1], buffer, used); return hello; } @@ -295,7 +295,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, wpos = 0; woff = (ret != NULL) ? (char *) &ret[1] : NULL; GNUNET_CRYPTO_hash (&msg->publicKey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &address.peer.hashPubKey); while (insize > 0) { @@ -530,7 +530,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello) */ int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, - struct GNUNET_CRYPTO_EccPublicKey *publicKey) + struct GNUNET_CRYPTO_EccPublicSignKey *publicKey) { uint16_t ret = ntohs (hello->header.size); @@ -559,7 +559,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) return GNUNET_SYSERR; GNUNET_CRYPTO_hash (&hello->publicKey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &peer->hashPubKey); return GNUNET_OK; } @@ -671,7 +671,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, if (0 != memcmp (&h1->publicKey, &h2->publicKey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey))) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) return GNUNET_TIME_UNIT_ZERO_ABS; ec.expiration_limit = now; ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; @@ -1046,7 +1046,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer) */ int GNUNET_HELLO_parse_uri (const char *uri, - struct GNUNET_CRYPTO_EccPublicKey *pubkey, + struct GNUNET_CRYPTO_EccPublicSignKey *pubkey, struct GNUNET_HELLO_Message **hello, GNUNET_HELLO_TransportPluginsFind plugins_find) { diff --git a/src/hello/test_friend_hello.c b/src/hello/test_friend_hello.c index 7d0348339..d5f75c824 100644 --- a/src/hello/test_friend_hello.c +++ b/src/hello/test_friend_hello.c @@ -93,8 +93,8 @@ main (int argc, char *argv[]) struct GNUNET_HELLO_Message *msg1; struct GNUNET_HELLO_Message *msg2; struct GNUNET_HELLO_Message *msg3; - struct GNUNET_CRYPTO_EccPublicKey publicKey; - struct GNUNET_CRYPTO_EccPublicKey pk; + struct GNUNET_CRYPTO_EccPublicSignKey publicKey; + struct GNUNET_CRYPTO_EccPublicSignKey pk; struct GNUNET_TIME_Absolute startup_time; unsigned int i; diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c index 67f7318b2..f1fa8234a 100644 --- a/src/hello/test_hello.c +++ b/src/hello/test_hello.c @@ -93,8 +93,8 @@ main (int argc, char *argv[]) struct GNUNET_HELLO_Message *msg1; struct GNUNET_HELLO_Message *msg2; struct GNUNET_HELLO_Message *msg3; - struct GNUNET_CRYPTO_EccPublicKey publicKey; - struct GNUNET_CRYPTO_EccPublicKey pk; + struct GNUNET_CRYPTO_EccPublicSignKey publicKey; + struct GNUNET_CRYPTO_EccPublicSignKey pk; struct GNUNET_TIME_Absolute startup_time; unsigned int i; diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index 8ed1263a9..66dc1909e 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c @@ -226,7 +226,7 @@ print_ego (void *cls, void **ctx, const char *identifier) { - struct GNUNET_CRYPTO_EccPublicKey pk; + struct GNUNET_CRYPTO_EccPublicSignKey pk; char *s; if ( (NULL != set_ego) && diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 17e3cff92..157fa6e4f 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c @@ -179,12 +179,12 @@ const struct GNUNET_IDENTITY_Ego * GNUNET_IDENTITY_ego_get_anonymous () { static struct GNUNET_IDENTITY_Ego anon; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; if (NULL != anon.pk) return &anon; anon.pk = (struct GNUNET_CRYPTO_EccPrivateKey *) GNUNET_CRYPTO_ecc_key_get_anonymous (); - GNUNET_CRYPTO_ecc_key_get_public (anon.pk, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon.pk, &pub); GNUNET_CRYPTO_hash (&pub, sizeof (pub), &anon.id); return &anon; @@ -249,7 +249,7 @@ message_handler (void *cls, const struct GNUNET_IDENTITY_ResultCodeMessage *rcm; const struct GNUNET_IDENTITY_UpdateMessage *um; const struct GNUNET_IDENTITY_SetDefaultMessage *sdm; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_HashCode id; const char *str; uint16_t size; @@ -326,7 +326,7 @@ message_handler (void *cls, h->cb (h->cb_cls, NULL, NULL, NULL); break; } - GNUNET_CRYPTO_ecc_key_get_public (&um->private_key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&um->private_key, &pub); GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id); if (0 == name_len) @@ -406,7 +406,7 @@ message_handler (void *cls, } /* Note: we know which service this should be for, so we're not really using 'str' henceforth */ - GNUNET_CRYPTO_ecc_key_get_public (&sdm->private_key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&sdm->private_key, &pub); GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id); ego = GNUNET_CONTAINER_multihashmap_get (h->egos, @@ -602,9 +602,9 @@ GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego) */ void GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, - struct GNUNET_CRYPTO_EccPublicKey *pk) + struct GNUNET_CRYPTO_EccPublicSignKey *pk) { - GNUNET_CRYPTO_ecc_key_get_public (ego->pk, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (ego->pk, pk); } diff --git a/src/include/block_dns.h b/src/include/block_dns.h index 198bba2c0..1af28af36 100644 --- a/src/include/block_dns.h +++ b/src/include/block_dns.h @@ -58,7 +58,7 @@ struct GNUNET_DNS_Record /** * The peer providing this service */ - struct GNUNET_CRYPTO_EccPublicKey peer; + struct GNUNET_CRYPTO_EccPublicSignKey peer; /** * The descriptor for the service diff --git a/src/include/block_fs.h b/src/include/block_fs.h index 772180fc8..3a0afba14 100644 --- a/src/include/block_fs.h +++ b/src/include/block_fs.h @@ -58,7 +58,7 @@ struct UBlock /** * Public key used to sign this block. */ - struct GNUNET_CRYPTO_EccPublicKey verification_key; + struct GNUNET_CRYPTO_EccPublicSignKey verification_key; /* rest of the data is encrypted */ diff --git a/src/include/block_regex.h b/src/include/block_regex.h index 5995f70a2..85d450212 100644 --- a/src/include/block_regex.h +++ b/src/include/block_regex.h @@ -67,7 +67,7 @@ struct RegexAcceptBlock /** * Public key of the peer signing. */ - struct GNUNET_CRYPTO_EccPublicKey public_key; + struct GNUNET_CRYPTO_EccPublicSignKey public_key; /** * The signature. diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 033803978..6c4a65543 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -149,13 +149,15 @@ struct GNUNET_CRYPTO_EccSignature /** * Public ECC key (always for NIST P-521) encoded in a format suitable - * for network transmission. + * for network transmission and signatures (ECDSA/EdDSA). */ -struct GNUNET_CRYPTO_EccPublicKey +struct GNUNET_CRYPTO_EccPublicSignKey { /** * Q consists of an x- and a y-value, each mod p (256 bits), * given here in affine coordinates. + * + * FIXME: this coordinate will be removed in the future (compressed point!). */ unsigned char q_x[256 / 8]; @@ -168,6 +170,29 @@ struct GNUNET_CRYPTO_EccPublicKey }; +/** + * Public ECC key (always for NIST P-521) encoded in a format suitable + * for network transmission and encryption (ECDH). + */ +struct GNUNET_CRYPTO_EccPublicEncryptKey +{ + /** + * Q consists of an x- and a y-value, each mod p (256 bits), + * given here in affine coordinates. + */ + unsigned char q_x[256 / 8]; + + /** + * Q consists of an x- and a y-value, each mod p (256 bits), + * given here in affine coordinates. + * + * FIXME: this coordinate will be removed in the future (compressed point!). + */ + unsigned char q_y[256 / 8]; + +}; + + /** * Private ECC key encoded for transmission. */ @@ -415,11 +440,11 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, /** * @ingroup hash - * Convert ASCII encoding back to struct GNUNET_HashCode + * Convert ASCII encoding back to `struct GNUNET_HashCode` * * @param enc the encoding * @param result where to store the hash code - * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding + * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding */ #define GNUNET_CRYPTO_hash_from_string(enc, result) \ GNUNET_CRYPTO_hash_from_string2 (enc, strlen(enc), result) @@ -495,7 +520,7 @@ struct GNUNET_CRYPTO_FileHashContext; * @param filename name of file to hash * @param blocksize number of bytes to process in one task * @param callback function to call upon completion - * @param callback_cls closure for callback + * @param callback_cls closure for @a callback * @return NULL on (immediate) errror */ struct GNUNET_CRYPTO_FileHashContext * @@ -586,12 +611,13 @@ GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc, * @ingroup hash * Obtain a bit from a hashcode. * - * @param code the GNUNET_CRYPTO_hash to index bit-wise + * @param code the `struct GNUNET_HashCode` to index bit-wise * @param bit index into the hashcode, [0...159] * @return Bit \a bit from hashcode \a code, -1 for invalid index */ int -GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode * code, unsigned int bit); +GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, + unsigned int bit); /** @@ -738,7 +764,7 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, * @param skm source key material * @param skm_len length of skm * @param ... void * & size_t pairs for context chunks - * @return GNUNET_YES on success + * @return #GNUNET_YES on success */ int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, @@ -765,32 +791,70 @@ typedef void (*GNUNET_CRYPTO_EccKeyCallback)(void *cls, * @param pub where to write the public key */ void -GNUNET_CRYPTO_ecc_key_get_public (const struct GNUNET_CRYPTO_EccPrivateKey *priv, - struct GNUNET_CRYPTO_EccPublicKey *pub); +GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPrivateKey *priv, + struct GNUNET_CRYPTO_EccPublicSignKey *pub); + + + +/** + * @ingroup crypto + * Extract the public key for the given private key. + * + * @param priv the private key + * @param pub where to write the public key + */ +void +GNUNET_CRYPTO_ecc_key_get_public_for_encryption (const struct GNUNET_CRYPTO_EccPrivateKey *priv, + struct GNUNET_CRYPTO_EccPublicEncryptKey *pub); /** * Convert a public key to a string. * * @param pub key to convert - * @return string representing 'pub' + * @return string representing @a pub */ char * -GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey *pub); +GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPublicSignKey *pub); /** * Convert a string representing a public key to a public key. * * @param enc encoded public key - * @param enclen number of bytes in enc (without 0-terminator) + * @param enclen number of bytes in @a enc (without 0-terminator) * @param pub where to store the public key - * @return GNUNET_OK on success + * @return #GNUNET_OK on success */ int -GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, - size_t enclen, - struct GNUNET_CRYPTO_EccPublicKey *pub); +GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc, + size_t enclen, + struct GNUNET_CRYPTO_EccPublicSignKey *pub); + + + +/** + * Convert a public key to a string. + * + * @param pub key to convert + * @return string representing @a pub + */ +char * +GNUNET_CRYPTO_ecc_public_encrypt_key_to_string (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub); + + +/** + * Convert a string representing a public key to a public key. + * + * @param enc encoded public key + * @param enclen number of bytes in @a enc (without 0-terminator) + * @param pub where to store the public key + * @return #GNUNET_OK on success + */ +int +GNUNET_CRYPTO_ecc_public_encrypt_key_from_string (const char *enc, + size_t enclen, + struct GNUNET_CRYPTO_EccPublicEncryptKey *pub); /** @@ -817,6 +881,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename); * Create a new private key by reading our peer's key from * the file specified in the configuration. * + * @param cfg the configuration to use * @return new private key, NULL on error (for example, * permission denied); free using #GNUNET_free */ @@ -830,8 +895,8 @@ GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATI * * @return fresh private key; free using #GNUNET_free */ -struct GNUNET_CRYPTO_EccPrivateKey * -GNUNET_CRYPTO_ecc_key_create (void); +struct GNUNET_CRYPTO_EccPrivateEncryptKey * +GNUNET_CRYPTO_ecc_key_encrypt_create (void); /** @@ -882,7 +947,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, */ int GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, - const struct GNUNET_CRYPTO_EccPublicKey *pub, + const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub, struct GNUNET_HashCode *key_material); @@ -916,7 +981,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EccSignature *sig, - const struct GNUNET_CRYPTO_EccPublicKey *pub); + const struct GNUNET_CRYPTO_EccPublicSignKey *pub); /** @@ -950,10 +1015,10 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, * @param result where to write the derived public key */ void -GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicKey *pub, +GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const char *label, const char *context, - struct GNUNET_CRYPTO_EccPublicKey *result); + struct GNUNET_CRYPTO_EccPublicSignKey *result); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 2987302a3..0f4b5ae25 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -336,7 +336,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); * @return an FS URI for the given namespace and identifier */ struct GNUNET_FS_Uri * -GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, +GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, const char *id); @@ -350,7 +350,7 @@ GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, */ int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, - struct GNUNET_CRYPTO_EccPublicKey *pseudonym); + struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym); /** @@ -1376,7 +1376,7 @@ struct GNUNET_FS_ProgressInfo /** * Public key of the namespace. */ - struct GNUNET_CRYPTO_EccPublicKey pseudonym; + struct GNUNET_CRYPTO_EccPublicSignKey pseudonym; } ns; diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h index 7f2bd790d..f16494c61 100644 --- a/src/include/gnunet_gns_service.h +++ b/src/include/gnunet_gns_service.h @@ -107,7 +107,7 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (void *cls, struct GNUNET_GNS_LookupRequest * GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, const char *name, - const struct GNUNET_CRYPTO_EccPublicKey *zone, + const struct GNUNET_CRYPTO_EccPublicSignKey *zone, int type, int only_cached, const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 583a33f7d..6ecf8754a 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h @@ -199,7 +199,7 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, * @return the hello message */ struct GNUNET_HELLO_Message * -GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, +GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey, GNUNET_HELLO_GenerateAddressListCallback addrgen, void *addrgen_cls, int friend_only); @@ -326,7 +326,7 @@ GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message */ int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, - struct GNUNET_CRYPTO_EccPublicKey *publicKey); + struct GNUNET_CRYPTO_EccPublicSignKey *publicKey); /** @@ -379,7 +379,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, */ int GNUNET_HELLO_parse_uri (const char *uri, - struct GNUNET_CRYPTO_EccPublicKey *pubkey, + struct GNUNET_CRYPTO_EccPublicSignKey *pubkey, struct GNUNET_HELLO_Message **hello, GNUNET_HELLO_TransportPluginsFind plugins_find); diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index 5cbe376f2..6c572e737 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h @@ -97,7 +97,7 @@ GNUNET_IDENTITY_ego_get_anonymous (void); */ void GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, - struct GNUNET_CRYPTO_EccPublicKey *pk); + struct GNUNET_CRYPTO_EccPublicSignKey *pk); /** diff --git a/src/include/gnunet_multicast_service.h b/src/include/gnunet_multicast_service.h index 140e05e71..c25d15dc9 100644 --- a/src/include/gnunet_multicast_service.h +++ b/src/include/gnunet_multicast_service.h @@ -210,7 +210,7 @@ GNUNET_MULTICAST_join_decision (struct GNUNET_MULTICAST_JoinHandle *jh, */ typedef void (*GNUNET_MULTICAST_JoinCallback) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *member_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, const struct GNUNET_MessageHeader *join_req, struct GNUNET_MULTICAST_JoinHandle *jh); @@ -249,7 +249,7 @@ GNUNET_MULTICAST_membership_test_result (struct GNUNET_MULTICAST_MembershipTestH */ typedef void (*GNUNET_MULTICAST_MembershipTestCallback) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *member_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, uint64_t message_id, uint64_t group_generation, struct GNUNET_MULTICAST_MembershipTestHandle *mth); @@ -266,7 +266,7 @@ typedef void */ typedef void (*GNUNET_MULTICAST_RequestCallback) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *member_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, const struct GNUNET_MessageHeader *req, enum GNUNET_MULTICAST_MessageFlags flags); @@ -324,7 +324,7 @@ struct GNUNET_MULTICAST_ReplayHandle; */ typedef void (*GNUNET_MULTICAST_ReplayFragmentCallback) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *member_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, uint64_t fragment_id, uint64_t flags, struct GNUNET_MULTICAST_ReplayHandle *rh); @@ -347,7 +347,7 @@ typedef void */ typedef void (*GNUNET_MULTICAST_ReplayMessageCallback) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *member_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, uint64_t message_id, uint64_t fragment_offset, uint64_t flags, @@ -586,7 +586,7 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin); */ struct GNUNET_MULTICAST_Member * GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, - const struct GNUNET_CRYPTO_EccPublicKey *group_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *group_key, const struct GNUNET_CRYPTO_EccPrivateKey *member_key, const struct GNUNET_PeerIdentity *origin, size_t relay_count, diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 8ea1a9d73..512e463a8 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h @@ -152,7 +152,7 @@ struct GNUNET_NAMESTORE_PluginFunctions */ int (*zone_to_name) (void *cls, const struct GNUNET_CRYPTO_EccPrivateKey *zone, - const struct GNUNET_CRYPTO_EccPublicKey *value_zone, + const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 4cad3ae62..ab539bb35 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h @@ -237,7 +237,7 @@ struct GNUNET_NAMESTORE_Block /** * Derived key used for signing; hash of this is the query. */ - struct GNUNET_CRYPTO_EccPublicKey derived_key; + struct GNUNET_CRYPTO_EccPublicSignKey derived_key; /** * Number of bytes signed; also specifies the number of bytes @@ -355,7 +355,7 @@ typedef void (*GNUNET_NAMESTORE_RecordMonitor) (void *cls, struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EccPrivateKey *zone, - const struct GNUNET_CRYPTO_EccPublicKey *value_zone, + const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls); @@ -604,7 +604,7 @@ GNUNET_NAMESTORE_normalize_string (const char *src); * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s. */ const char * -GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicKey *z); +GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z); /** @@ -618,7 +618,7 @@ GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicKey *z); * key in an encoding suitable for DNS labels. */ const char * -GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey); +GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey); /** @@ -632,7 +632,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey); */ int GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, - struct GNUNET_CRYPTO_EccPublicKey *pkey); + struct GNUNET_CRYPTO_EccPublicSignKey *pkey); /** @@ -656,7 +656,7 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe * @param query hash to use for the query */ void -GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pub, +GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const char *label, struct GNUNET_HashCode *query); @@ -702,7 +702,7 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block); */ int GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, - const struct GNUNET_CRYPTO_EccPublicKey *zone_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, const char *label, GNUNET_NAMESTORE_RecordCallback proc, void *proc_cls); diff --git a/src/include/gnunet_psyc_service.h b/src/include/gnunet_psyc_service.h index df7a6b4d9..c86e5048b 100644 --- a/src/include/gnunet_psyc_service.h +++ b/src/include/gnunet_psyc_service.h @@ -215,7 +215,7 @@ struct GNUNET_PSYC_JoinHandle; */ typedef int (*GNUNET_PSYC_Method) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t message_id, const char *method_name, size_t modifier_count, @@ -241,7 +241,7 @@ typedef int */ typedef int (*GNUNET_PSYC_JoinCallback) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, const char *method_name, size_t variable_count, const struct GNUNET_ENV_Modifier *variables, @@ -456,7 +456,7 @@ struct GNUNET_PSYC_Slave; */ struct GNUNET_PSYC_Slave * GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const struct GNUNET_CRYPTO_EccPrivateKey *slave_key, const struct GNUNET_PeerIdentity *origin, size_t relay_count, @@ -593,7 +593,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave); */ void GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t announced_at, uint64_t effective_since); @@ -621,7 +621,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, */ void GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t announced_at); diff --git a/src/include/gnunet_psycstore_plugin.h b/src/include/gnunet_psycstore_plugin.h index 00928d2b7..6852a6dd5 100644 --- a/src/include/gnunet_psycstore_plugin.h +++ b/src/include/gnunet_psycstore_plugin.h @@ -60,8 +60,8 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*membership_store) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, int did_join, uint64_t announced_at, uint64_t effective_since, @@ -77,8 +77,8 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*membership_test) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t message_id); /** @@ -90,7 +90,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*fragment_store) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const struct GNUNET_MULTICAST_MessageHeader *message, uint32_t psycstore_flags); @@ -108,7 +108,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*message_add_flags) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, uint64_t psycstore_flags); @@ -121,7 +121,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*fragment_get) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t fragment_id, GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls); @@ -135,7 +135,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*message_get) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls); @@ -150,7 +150,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*message_get_fragment) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, uint64_t fragment_offset, GNUNET_PSYCSTORE_FragmentCallback cb, @@ -165,7 +165,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*counters_get_master) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t *fragment_id, uint64_t *message_id, uint64_t *group_generation); @@ -179,7 +179,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*counters_get_slave) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t *max_state_msg_id); /** @@ -191,7 +191,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_set) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, const void *value, size_t value_size); @@ -208,7 +208,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_reset) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key); + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key); /** * Update signed state values from the current ones. @@ -217,7 +217,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_update_signed) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key); + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key); /** * Update signed values of state variables in the state store. @@ -233,7 +233,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_hash_update) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, const struct GNUNET_HashCode *hash, GNUNET_PSYCSTORE_ResultCallback rcb, @@ -246,7 +246,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_get) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls); @@ -260,7 +260,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_get_all) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls); @@ -273,7 +273,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions */ int (*state_get_signed) (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls); diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index fab2594df..4f8c6c6c0 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h @@ -133,8 +133,8 @@ typedef void */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, int did_join, uint64_t announced_at, uint64_t effective_since, @@ -165,8 +165,8 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t message_id, uint64_t group_generation, GNUNET_PSYCSTORE_ResultCallback rcb, @@ -188,7 +188,7 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const struct GNUNET_MULTICAST_MessageHeader *message, uint32_t psycstore_flags, GNUNET_PSYCSTORE_ResultCallback rcb, @@ -226,7 +226,7 @@ typedef int */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t fragment_id, GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls); @@ -245,7 +245,7 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls); @@ -266,7 +266,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, uint64_t fragment_offset, GNUNET_PSYCSTORE_FragmentCallback cb, @@ -319,7 +319,7 @@ typedef void */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_counters_get_master (struct GNUNET_PSYCSTORE_Handle *h, - struct GNUNET_CRYPTO_EccPublicKey *channel_key, + struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, GNUNET_PSYCSTORE_MasterCountersCallback *cb, void *cb_cls); @@ -339,7 +339,7 @@ GNUNET_PSYCSTORE_counters_get_master (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h, - struct GNUNET_CRYPTO_EccPublicKey *channel_key, + struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, GNUNET_PSYCSTORE_SlaveCountersCallback *cb, void *cb_cls); @@ -363,7 +363,7 @@ GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, uint64_t state_delta, size_t modifier_count, @@ -386,7 +386,7 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_Handle * GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, GNUNET_PSYCSTORE_ResultCallback rcb, void *rcb_cls); @@ -405,7 +405,7 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, const struct GNUNET_HashCode *hash, GNUNET_PSYCSTORE_ResultCallback rcb, @@ -444,7 +444,7 @@ typedef int */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls); @@ -463,7 +463,7 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, */ struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name_prefix, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls); diff --git a/src/include/gnunet_social_service.h b/src/include/gnunet_social_service.h index 62a221de2..f53a2c28b 100644 --- a/src/include/gnunet_social_service.h +++ b/src/include/gnunet_social_service.h @@ -283,7 +283,7 @@ GNUNET_SOCIAL_home_reject_entry (struct GNUNET_SOCIAL_Home *home, */ void GNUNET_SOCIAL_nym_get_key (struct GNUNET_SOCIAL_Nym *nym, - struct GNUNET_CRYPTO_EccPublicKey *nym_key); + struct GNUNET_CRYPTO_EccPublicSignKey *nym_key); /** @@ -440,7 +440,7 @@ GNUNET_SOCIAL_place_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SOCIAL_Place * GNUNET_SOCIAL_place_enter2 (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_IDENTITY_Ego *ego, - struct GNUNET_CRYPTO_EccPublicKey *crypto_address, + struct GNUNET_CRYPTO_EccPublicSignKey *crypto_address, struct GNUNET_PeerIdentity *origin, size_t relay_count, struct GNUNET_PeerIdentity *relays, diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c index 758725877..e682f5b60 100644 --- a/src/mesh/gnunet-service-mesh-enc.c +++ b/src/mesh/gnunet-service-mesh-enc.c @@ -675,12 +675,12 @@ struct MeshTunnel2 /** * Local peer ephemeral public key */ - struct GNUNET_CRYPTO_EccPublicKey *my_eph; + struct GNUNET_CRYPTO_EccPublicSignKey *my_eph; /** * Remote peer's public key. */ - struct GNUNET_CRYPTO_EccPublicKey *peers_eph; + struct GNUNET_CRYPTO_EccPublicSignKey *peers_eph; /** * Encryption ("our") key. @@ -934,7 +934,7 @@ static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; /** * Own public key. */ -static struct GNUNET_CRYPTO_EccPublicKey my_public_key; +static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; /** * All ports clients of this peer have opened. @@ -7273,7 +7273,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (c); GNUNET_assert (NULL != pk); my_private_key = pk; - GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_full_id.hashPubKey); myid = GNUNET_PEER_intern (&my_full_id); diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 130c7df14..786730668 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -722,7 +722,7 @@ static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; /** * Own public key. */ -static struct GNUNET_CRYPTO_EccPublicKey my_public_key; +static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; /** * Tunnel ID for the next created tunnel (global tunnel number). @@ -5902,7 +5902,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, GNUNET_free (keyfile); GNUNET_assert (NULL != pk); my_private_key = pk; - GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_full_id.hashPubKey); myid = GNUNET_PEER_intern (&my_full_id); diff --git a/src/multicast/multicast_api.c b/src/multicast/multicast_api.c index 513d4c8c9..b05d2d99c 100644 --- a/src/multicast/multicast_api.c +++ b/src/multicast/multicast_api.c @@ -58,7 +58,7 @@ struct GNUNET_MULTICAST_RequestHeader /** * Public key of the sending member. */ - struct GNUNET_CRYPTO_EccPublicKey member_key; + struct GNUNET_CRYPTO_EccPublicSignKey member_key; /** * ECC signature of the request fragment. @@ -122,12 +122,12 @@ struct GNUNET_MULTICAST_JoinRequest /** * Public key of the target group. */ - struct GNUNET_CRYPTO_EccPublicKey group_key; + struct GNUNET_CRYPTO_EccPublicSignKey group_key; /** * Public key of the joining member. */ - struct GNUNET_CRYPTO_EccPublicKey member_key; + struct GNUNET_CRYPTO_EccPublicSignKey member_key; /** * Peer identity of the joining member. @@ -402,7 +402,7 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin) */ struct GNUNET_MULTICAST_Member * GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, - const struct GNUNET_CRYPTO_EccPublicKey *group_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *group_key, const struct GNUNET_CRYPTO_EccPrivateKey *member_key, const struct GNUNET_PeerIdentity *origin, size_t relay_count, diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index 041b046ba..527e46eb9 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c @@ -552,7 +552,7 @@ lookup_result_processor (void *cls, const struct GNUNET_NAMESTORE_RecordData *rd) { struct Request *request = cls; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; if (0 != rd_count) { @@ -565,7 +565,7 @@ lookup_result_processor (void *cls, return; } if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (request->public_key, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (request->public_key, strlen (request->public_key), &pub)) { @@ -594,7 +594,7 @@ lookup_block_processor (void *cls, const struct GNUNET_NAMESTORE_Block *block) { struct Request *request = cls; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; request->qe = NULL; if (NULL == block) @@ -602,7 +602,7 @@ lookup_block_processor (void *cls, lookup_result_processor (request, 0, NULL); return; } - GNUNET_CRYPTO_ecc_key_get_public (&fcfs_zone_pkey, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey, &pub); if (GNUNET_OK != GNUNET_NAMESTORE_block_decrypt (block, @@ -655,7 +655,7 @@ create_response (void *cls, struct MHD_Response *response; struct Request *request; int ret; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_HashCode query; if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) || @@ -705,7 +705,7 @@ create_response (void *cls, request->pp = NULL; } if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (request->public_key, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (request->public_key, strlen (request->public_key), &pub)) { @@ -733,7 +733,7 @@ create_response (void *cls, request, connection); } request->phase = RP_LOOKUP; - GNUNET_CRYPTO_ecc_key_get_public (&fcfs_zone_pkey, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey, &pub); GNUNET_NAMESTORE_query_from_public_key (&pub, request->domain_name, diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index aadf741ad..fb9b017b1 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c @@ -430,7 +430,7 @@ testservice_task (void *cls, int result) { const struct GNUNET_CONFIGURATION_Handle *cfg = cls; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_NAMESTORE_RecordData rd; if (GNUNET_YES != result) @@ -446,7 +446,7 @@ testservice_task (void *cls, _("No options given\n")); return; } - GNUNET_CRYPTO_ecc_key_get_public (&zone_pkey, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&zone_pkey, &pub); ns = GNUNET_NAMESTORE_connect (cfg); @@ -575,14 +575,14 @@ testservice_task (void *cls, { char sh[105]; char sname[64]; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; if ( (2 != (sscanf (uri, "gnunet://gns/%104s/%63s", sh, sname)) ) || (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (sh, strlen (sh), &pkey)) ) + GNUNET_CRYPTO_ecc_public_sign_key_from_string (sh, strlen (sh), &pkey)) ) { fprintf (stderr, _("Invalid URI `%s'\n"), @@ -593,7 +593,7 @@ testservice_task (void *cls, } memset (&rd, 0, sizeof (rd)); rd.data = &pkey; - rd.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey); + rd.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; if (GNUNET_YES == etime_is_rel) { diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index fda19cacf..f113040b5 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -573,7 +573,7 @@ handle_record_store (void *cls, const char *rd_ser; unsigned int rd_count; int res; - struct GNUNET_CRYPTO_EccPublicKey pubkey; + struct GNUNET_CRYPTO_EccPublicSignKey pubkey; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", @@ -624,7 +624,7 @@ handle_record_store (void *cls, } /* Extracting and converting private key */ - GNUNET_CRYPTO_ecc_key_get_public (&rp_msg->private_key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (&rp_msg->private_key, &pubkey); conv_name = GNUNET_NAMESTORE_normalize_string (name_tmp); if (NULL == conv_name) diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index 7d406df61..61691b95e 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h @@ -93,7 +93,7 @@ struct LookupBlockResponseMessage /** * Derived public key. */ - struct GNUNET_CRYPTO_EccPublicKey derived_key; + struct GNUNET_CRYPTO_EccPublicSignKey derived_key; /* follwed by encrypted block data */ }; @@ -122,7 +122,7 @@ struct BlockCacheMessage /** * Derived public key. */ - struct GNUNET_CRYPTO_EccPublicKey derived_key; + struct GNUNET_CRYPTO_EccPublicSignKey derived_key; /* follwed by encrypted block data */ }; @@ -228,7 +228,7 @@ struct ZoneToNameMessage /** * The public key of the target zone */ - struct GNUNET_CRYPTO_EccPublicKey value_zone; + struct GNUNET_CRYPTO_EccPublicSignKey value_zone; }; diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index a57aa2967..acb658665 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -1146,7 +1146,7 @@ GNUNET_NAMESTORE_lookup_block (struct GNUNET_NAMESTORE_Handle *h, struct GNUNET_NAMESTORE_QueueEntry * GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, const struct GNUNET_CRYPTO_EccPrivateKey *zone, - const struct GNUNET_CRYPTO_EccPublicKey *value_zone, + const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls) { struct GNUNET_NAMESTORE_QueueEntry *qe; diff --git a/src/namestore/namestore_api_common.c b/src/namestore/namestore_api_common.c index dec6acafe..f752b18c3 100644 --- a/src/namestore/namestore_api_common.c +++ b/src/namestore/namestore_api_common.c @@ -97,13 +97,13 @@ GNUNET_NAMESTORE_normalize_string (const char *src) * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s */ const char * -GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicKey *z) +GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z) { - static char buf[sizeof (struct GNUNET_CRYPTO_EccPublicKey) * 8]; + static char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) * 8]; char *end; end = GNUNET_STRINGS_data_to_string ((const unsigned char *) z, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), buf, sizeof (buf)); if (NULL == end) { @@ -324,18 +324,18 @@ static void derive_block_aes_key (struct GNUNET_CRYPTO_AesInitializationVector *iv, struct GNUNET_CRYPTO_AesSessionKey *skey, const char *label, - const struct GNUNET_CRYPTO_EccPublicKey *pub) + const struct GNUNET_CRYPTO_EccPublicSignKey *pub) { static const char ctx_key[] = "gns-aes-ctx-key"; static const char ctx_iv[] = "gns-aes-ctx-iv"; GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_AesSessionKey), - pub, sizeof (struct GNUNET_CRYPTO_EccPublicKey), + pub, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), label, strlen (label), ctx_key, strlen (ctx_key), NULL, 0); GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_AesInitializationVector), - pub, sizeof (struct GNUNET_CRYPTO_EccPublicKey), + pub, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), label, strlen (label), ctx_iv, strlen (ctx_iv), NULL, 0); @@ -362,7 +362,7 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key, size_t payload_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); char payload[sizeof (uint32_t) + payload_len]; struct GNUNET_NAMESTORE_Block *block; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_CRYPTO_EccPrivateKey *dkey; struct GNUNET_CRYPTO_AesInitializationVector iv; struct GNUNET_CRYPTO_AesSessionKey skey; @@ -385,9 +385,9 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key, dkey = GNUNET_CRYPTO_ecc_key_derive (key, label, "gns"); - GNUNET_CRYPTO_ecc_key_get_public (dkey, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (dkey, &block->derived_key); - GNUNET_CRYPTO_ecc_key_get_public (key, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); derive_block_aes_key (&iv, &skey, label, &pkey); GNUNET_break (payload_len + sizeof (uint32_t) == @@ -439,7 +439,7 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block) */ int GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, - const struct GNUNET_CRYPTO_EccPublicKey *zone_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, const char *label, GNUNET_NAMESTORE_RecordCallback proc, void *proc_cls) @@ -580,7 +580,7 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, return NULL; return GNUNET_strdup (tmp); case GNUNET_NAMESTORE_TYPE_PKEY: - if (data_size != sizeof (struct GNUNET_CRYPTO_EccPublicKey)) + if (data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) return NULL; return GNUNET_CRYPTO_ecc_public_key_to_string (data); case GNUNET_NAMESTORE_TYPE_PSEU: @@ -664,7 +664,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, { struct in_addr value_a; struct in6_addr value_aaaa; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_TUN_DnsSoaRecord *soa; struct GNUNET_TUN_GnsVpnRecord *vpn; struct GNUNET_TUN_DnsTlsaRecord *tlsa; @@ -769,16 +769,16 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, return GNUNET_OK; case GNUNET_NAMESTORE_TYPE_PKEY: if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (s, strlen (s), &pkey)) + GNUNET_CRYPTO_ecc_public_sign_key_from_string (s, strlen (s), &pkey)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Unable to parse PKEY record `%s'\n"), s); return GNUNET_SYSERR; } - *data = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey); + *data = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey); memcpy (*data, &pkey, sizeof (pkey)); - *data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey); + *data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); return GNUNET_OK; case GNUNET_NAMESTORE_TYPE_PSEU: *data = GNUNET_strdup (s); @@ -928,9 +928,9 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe const char *label, struct GNUNET_HashCode *query) { - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; - GNUNET_CRYPTO_ecc_key_get_public (zone, &pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (zone, &pub); GNUNET_NAMESTORE_query_from_public_key (&pub, label, query); } @@ -943,11 +943,11 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe * @param query hash to use for the query */ void -GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pub, +GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const char *label, struct GNUNET_HashCode *query) { - struct GNUNET_CRYPTO_EccPublicKey pd; + struct GNUNET_CRYPTO_EccPublicSignKey pd; GNUNET_CRYPTO_ecc_public_key_derive (pub, label, "gns", &pd); GNUNET_CRYPTO_hash (&pd, sizeof (pd), query); @@ -965,7 +965,7 @@ GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicKey * key in an encoding suitable for DNS labels. */ const char * -GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey) +GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey) { static char ret[128]; char *pkeys; @@ -991,7 +991,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey) */ int GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, - struct GNUNET_CRYPTO_EccPublicKey *pkey) + struct GNUNET_CRYPTO_EccPublicSignKey *pkey) { char *cpy; char *dot; @@ -1007,7 +1007,7 @@ GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, goto error; if (GNUNET_OK != - GNUNET_CRYPTO_ecc_public_key_from_string (x, + GNUNET_CRYPTO_ecc_public_sign_key_from_string (x, strlen (x), pkey)) goto error; diff --git a/src/namestore/plugin_namestore_postgres.c b/src/namestore/plugin_namestore_postgres.c index 546653d90..fba2b47b4 100644 --- a/src/namestore/plugin_namestore_postgres.c +++ b/src/namestore/plugin_namestore_postgres.c @@ -273,7 +273,7 @@ namestore_postgres_remove_records (void *cls, */ static int namestore_postgres_put_records (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *zone_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, struct GNUNET_TIME_Absolute expire, const char *name, unsigned int rd_count, @@ -291,7 +291,7 @@ namestore_postgres_put_records (void *cls, unsigned int i; GNUNET_CRYPTO_short_hash (zone_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &zone); (void) namestore_postgres_remove_records (plugin, &zone, name); name_len = strlen (name); @@ -331,7 +331,7 @@ namestore_postgres_put_records (void *cls, (const char *) &rvalue_be }; int paramLengths[] = { - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), name_len, sizeof (uint32_t), data_size, @@ -383,7 +383,7 @@ get_record_and_call_iterator (struct Plugin *plugin, { unsigned int record_count; size_t data_size; - /* const struct GNUNET_CRYPTO_EccPublicKey *zone_key; */ + /* const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key; */ const struct GNUNET_CRYPTO_EccPrivateKey *zone_key; /* const struct GNUNET_CRYPTO_EccSignature *sig; */ /* struct GNUNET_TIME_Absolute expiration; */ @@ -413,7 +413,7 @@ get_record_and_call_iterator (struct Plugin *plugin, } GNUNET_assert (1 == cnt); if ((6 != PQnfields (res)) || - (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != PQgetlength (res, 0, 0)) || + (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != PQgetlength (res, 0, 0)) || (sizeof (uint32_t) != PQfsize (res, 2)) || (sizeof (uint64_t) != PQfsize (res, 4)) || (sizeof (struct GNUNET_CRYPTO_EccSignature) != PQgetlength (res, 0, 5))) @@ -423,7 +423,7 @@ get_record_and_call_iterator (struct Plugin *plugin, return GNUNET_SYSERR; } zone_key = (const struct GNUNET_CRYPTO_EccPrivateKey *) PQgetvalue (res, 0, 0); - /* zone_key = (const struct GNUNET_CRYPTO_EccPublicKey *) PQgetvalue (res, 0, 0); */ + /* zone_key = (const struct GNUNET_CRYPTO_EccPublicSignKey *) PQgetvalue (res, 0, 0); */ name = PQgetvalue (res, 0, 1); name_len = PQgetlength (res, 0, 1); record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); @@ -563,7 +563,7 @@ namestore_postgres_iterate_records (void *cls, static int namestore_postgres_zone_to_name (void *cls, const struct GNUNET_CRYPTO_EccPrivateKey *zone, - const struct GNUNET_CRYPTO_EccPublicKey *value_zone, + const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls) { #if 0 diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index d062c81a1..6551dd4a2 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c @@ -455,11 +455,11 @@ namestore_sqlite_cache_block (void *cls, namestore_sqlite_expire_blocks (plugin); GNUNET_CRYPTO_hash (&block->derived_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &query); expiration = GNUNET_TIME_absolute_ntoh (block->expiration_time); block_size = ntohl (block->purpose.size) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_CRYPTO_EccSignature); if (block_size > 64 * 65536) { @@ -542,7 +542,7 @@ namestore_sqlite_lookup_block (void *cls, block_size = sqlite3_column_bytes (plugin->lookup_block, 0); if ( (block_size < sizeof (struct GNUNET_NAMESTORE_Block)) || (ntohl (block->purpose.size) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_CRYPTO_EccSignature) != block_size) ) { GNUNET_break (0); @@ -599,7 +599,7 @@ namestore_sqlite_store_records (void *cls, for (i=0;i= nse_work_required) ? GNUNET_YES : GNUNET_NO; @@ -893,14 +893,14 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { #define ROUND_SIZE 10 uint64_t counter; - char buf[sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (uint64_t)] GNUNET_ALIGN; struct GNUNET_HashCode result; unsigned int i; proof_task = GNUNET_SCHEDULER_NO_TASK; memcpy (&buf[sizeof (uint64_t)], &my_public_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey)); + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); i = 0; counter = my_proof; while ((counter != UINT64_MAX) && (i < ROUND_SIZE)) @@ -1053,7 +1053,7 @@ handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_PeerIdentity os; GNUNET_CRYPTO_hash (&incoming_flood->pkey, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &os.hashPubKey); GNUNET_snprintf (origin, sizeof (origin), "%s", GNUNET_i2s (&os)); GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer)); @@ -1461,7 +1461,7 @@ run (void *cls, GNUNET_free (keyfile); GNUNET_assert (NULL != pk); my_private_key = pk; - GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_identity.hashPubKey); if (GNUNET_OK != diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 3d96f1043..8963637c9 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -192,7 +192,7 @@ static struct GNUNET_PeerIdentity my_peer_identity; /** * My public key. */ -static struct GNUNET_CRYPTO_EccPublicKey my_public_key; +static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; /** * Head of list of print contexts. @@ -677,7 +677,7 @@ run (void *cls, char *const *args, const char *cfgfile, return; } GNUNET_free (fn); - GNUNET_CRYPTO_ecc_key_get_public (priv, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &my_public_key); GNUNET_free (priv); GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_peer_identity.hashPubKey); } diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index b1197dc7e..f0e298cf5 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c @@ -653,7 +653,7 @@ update_friend_hello (const struct GNUNET_HELLO_Message *hello, { struct GNUNET_HELLO_Message * res; struct GNUNET_HELLO_Message * tmp; - struct GNUNET_CRYPTO_EccPublicKey pk; + struct GNUNET_CRYPTO_EccPublicSignKey pk; if (NULL != friend_hello) { diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c index 7a1266b62..01d87b48b 100755 --- a/src/peerinfo/perf_peerinfo_api.c +++ b/src/peerinfo/perf_peerinfo_api.c @@ -82,7 +82,7 @@ address_generator (void *cls, size_t max, void *buf) static void add_peer (size_t i) { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_HELLO_Message *h2; memset (&pkey, i, sizeof (pkey)); diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c index 202ebf13a..51c4ec13a 100644 --- a/src/peerinfo/test_peerinfo_api.c +++ b/src/peerinfo/test_peerinfo_api.c @@ -86,7 +86,7 @@ struct GNUNET_PeerIdentity pid; static void add_peer () { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_HELLO_Message *h2; size_t agc; diff --git a/src/peerinfo/test_peerinfo_api_friend_only.c b/src/peerinfo/test_peerinfo_api_friend_only.c index 6b91757e5..d4480165d 100644 --- a/src/peerinfo/test_peerinfo_api_friend_only.c +++ b/src/peerinfo/test_peerinfo_api_friend_only.c @@ -68,7 +68,7 @@ struct GNUNET_PeerIdentity pid; static void add_peer () { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_HELLO_Message *h2; size_t agc; diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c index ae2ac5190..a2774b8dd 100644 --- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c +++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c @@ -227,7 +227,7 @@ add_peer_done (void *cls, const char *emsg) static void add_peer () { - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; struct GNUNET_HELLO_Message *h2; size_t agc; diff --git a/src/psycstore/plugin_psycstore_sqlite.c b/src/psycstore/plugin_psycstore_sqlite.c index 750fdce16..d8006c4fc 100644 --- a/src/psycstore/plugin_psycstore_sqlite.c +++ b/src/psycstore/plugin_psycstore_sqlite.c @@ -609,7 +609,7 @@ database_shutdown (struct Plugin *plugin) static int channel_key_store (struct Plugin *plugin, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key) + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key) { sqlite3_stmt *stmt = plugin->insert_channel_key; @@ -638,7 +638,7 @@ channel_key_store (struct Plugin *plugin, static int slave_key_store (struct Plugin *plugin, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key) + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key) { sqlite3_stmt *stmt = plugin->insert_slave_key; @@ -676,8 +676,8 @@ slave_key_store (struct Plugin *plugin, */ static int membership_store (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, int did_join, uint64_t announced_at, uint64_t effective_since, @@ -736,8 +736,8 @@ membership_store (void *cls, */ static int membership_test (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t message_id) { struct Plugin *plugin = cls; @@ -783,7 +783,7 @@ membership_test (void *cls, */ static int fragment_store (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const struct GNUNET_MULTICAST_MessageHeader *msg, uint32_t psycstore_flags) { @@ -847,7 +847,7 @@ fragment_store (void *cls, */ static int message_add_flags (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, uint64_t psycstore_flags) { @@ -923,7 +923,7 @@ fragment_row (sqlite3_stmt *stmt, GNUNET_PSYCSTORE_FragmentCallback cb, static int fragment_get (void *cls, const struct - GNUNET_CRYPTO_EccPublicKey *channel_key, + GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t fragment_id, GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls) @@ -974,7 +974,7 @@ fragment_get (void *cls, */ static int message_get (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls) @@ -1035,7 +1035,7 @@ message_get (void *cls, */ static int message_get_fragment (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t message_id, uint64_t fragment_offset, GNUNET_PSYCSTORE_FragmentCallback cb, @@ -1089,7 +1089,7 @@ message_get_fragment (void *cls, */ static int counters_get_master (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t *fragment_id, uint64_t *message_id, uint64_t *group_generation) @@ -1142,7 +1142,7 @@ counters_get_master (void *cls, */ static int counters_get_slave (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, uint64_t *max_state_msg_id) { struct Plugin *plugin = cls; @@ -1193,7 +1193,7 @@ counters_get_slave (void *cls, */ static int state_set (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, const void *value, size_t value_size) { struct Plugin *plugin = cls; @@ -1242,7 +1242,7 @@ state_set (void *cls, * @return #GNUNET_OK on success, else #GNUNET_SYSERR */ static int -state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key) +state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key) { struct Plugin *plugin = cls; sqlite3_stmt *stmt = plugin->delete_state; @@ -1279,7 +1279,7 @@ state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key) */ static int state_update_signed (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key) + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key) { struct Plugin *plugin = cls; sqlite3_stmt *stmt = plugin->update_state_signed; @@ -1315,7 +1315,7 @@ state_update_signed (void *cls, * @return #GNUNET_OK on success, else #GNUNET_SYSERR */ static int -state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, +state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) { struct Plugin *plugin = cls; @@ -1367,7 +1367,7 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, * @return #GNUNET_OK on success, else #GNUNET_SYSERR */ static int -state_get_all (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, +state_get_all (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) { @@ -1435,7 +1435,7 @@ state_get_all (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, */ static int state_get_signed (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) { struct Plugin *plugin = cls; diff --git a/src/psycstore/psycstore.h b/src/psycstore/psycstore.h index 2e3d66ec5..d2c25e791 100644 --- a/src/psycstore/psycstore.h +++ b/src/psycstore/psycstore.h @@ -58,8 +58,8 @@ struct ResultCodeMessage */ struct MembershipStoreMessage { - const struct GNUNET_CRYPTO_EccPublicKey *channel_key; - const struct GNUNET_CRYPTO_EccPublicKey *slave_key; + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key; + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key; int did_join; uint64_t announced_at; uint64_t effective_since; @@ -72,8 +72,8 @@ struct MembershipStoreMessage */ struct MembershipTestMessage { - const struct GNUNET_CRYPTO_EccPublicKey *channel_key; - const struct GNUNET_CRYPTO_EccPublicKey *slave_key; + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key; + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key; uint64_t message_id; uint64_t group_generation; }; diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c index 194dcc79e..5847fc852 100644 --- a/src/psycstore/psycstore_api.c +++ b/src/psycstore/psycstore_api.c @@ -437,8 +437,8 @@ GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op) struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_membership_store ( struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, int did_join, uint64_t announced_at, uint64_t effective_since, @@ -453,8 +453,8 @@ GNUNET_PSYCSTORE_membership_store ( struct GNUNET_PSYCSTORE_OperationHandle * GNUNET_PSYCSTORE_membership_test ( struct GNUNET_PSYCSTORE_Handle *h, - const struct GNUNET_CRYPTO_EccPublicKey *channel_key, - const struct GNUNET_CRYPTO_EccPublicKey *slave_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, uint64_t message_id, uint64_t group_generation, GNUNET_PSYCSTORE_ResultCallback rcb, diff --git a/src/psycstore/test_plugin_psycstore.c b/src/psycstore/test_plugin_psycstore.c index 52a306f07..b584ed51d 100644 --- a/src/psycstore/test_plugin_psycstore.c +++ b/src/psycstore/test_plugin_psycstore.c @@ -53,8 +53,8 @@ static const char *plugin_name; static struct GNUNET_CRYPTO_EccPrivateKey *channel_key; static struct GNUNET_CRYPTO_EccPrivateKey *slave_key; -static struct GNUNET_CRYPTO_EccPublicKey channel_pub_key; -static struct GNUNET_CRYPTO_EccPublicKey slave_pub_key; +static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key; +static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key; /** * Function called when the service shuts down. Unloads our psycstore @@ -174,8 +174,8 @@ run (void *cls, char *const *args, const char *cfgfile, channel_key = GNUNET_CRYPTO_ecc_key_create (); slave_key = GNUNET_CRYPTO_ecc_key_create (); - GNUNET_CRYPTO_ecc_key_get_public (channel_key, &channel_pub_key); - GNUNET_CRYPTO_ecc_key_get_public (slave_key, &slave_pub_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key, &channel_pub_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key); ASSERT (GNUNET_OK == db->membership_store(db->cls, &channel_pub_key, &slave_pub_key, GNUNET_YES, diff --git a/src/psycstore/test_psycstore.c b/src/psycstore/test_psycstore.c index 6b9e77180..db4cfb0eb 100644 --- a/src/psycstore/test_psycstore.c +++ b/src/psycstore/test_psycstore.c @@ -58,8 +58,8 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; static struct GNUNET_CRYPTO_EccPrivateKey *channel_key; static struct GNUNET_CRYPTO_EccPrivateKey *slave_key; -static struct GNUNET_CRYPTO_EccPublicKey channel_pub_key; -static struct GNUNET_CRYPTO_EccPublicKey slave_pub_key; +static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key; +static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key; /** * Clean up all resources used. @@ -160,8 +160,8 @@ run (void *cls, channel_key = GNUNET_CRYPTO_ecc_key_create (); slave_key = GNUNET_CRYPTO_ecc_key_create (); - GNUNET_CRYPTO_ecc_key_get_public (channel_key, &channel_pub_key); - GNUNET_CRYPTO_ecc_key_get_public (slave_key, &slave_pub_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key, &channel_pub_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key); op = GNUNET_PSYCSTORE_membership_store (h, &channel_pub_key, &slave_pub_key, GNUNET_YES, 2, 2, 1, diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c index 4f7b16705..554d4320b 100644 --- a/src/regex/regex_internal_dht.c +++ b/src/regex/regex_internal_dht.c @@ -112,7 +112,7 @@ regex_iterator (void *cls, ab.purpose.purpose = ntohl (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT); ab.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_DHT_MAX_EXPIRATION)); ab.key = *key; - GNUNET_CRYPTO_ecc_key_get_public (h->priv, + GNUNET_CRYPTO_ecc_key_get_public_for_signature (h->priv, &ab.public_key); GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_ecc_sign (h->priv, @@ -381,7 +381,7 @@ dht_get_string_accept_handler (void *cls, struct GNUNET_TIME_Absolute exp, "# regex accepting block bytes found", size, GNUNET_NO); GNUNET_CRYPTO_hash (&block->public_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &pid.hashPubKey); info->callback (info->callback_cls, &pid, diff --git a/src/testing/testing.c b/src/testing/testing.c index 66fcf11da..8f32d2409 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -701,7 +701,7 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, struct GNUNET_PeerIdentity *id) { struct GNUNET_CRYPTO_EccPrivateKey *private_key; - struct GNUNET_CRYPTO_EccPublicKey public_key; + struct GNUNET_CRYPTO_EccPublicSignKey public_key; if ((NULL == id) || (NULL == system->hostkeys_data)) return NULL; @@ -722,9 +722,9 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, _("Error while decoding key %u\n"), key_number); return NULL; } - GNUNET_CRYPTO_ecc_key_get_public (private_key, &public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key, &public_key); GNUNET_CRYPTO_hash (&public_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &(id->hashPubKey)); return private_key; } diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 50cd367d5..6291266f6 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -70,7 +70,7 @@ static struct GNUNET_SERVER_Handle *GST_server; /** * Our public key. */ -struct GNUNET_CRYPTO_EccPublicKey GST_my_public_key; +struct GNUNET_CRYPTO_EccPublicSignKey GST_my_public_key; /** * Our private key. @@ -769,7 +769,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg); GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg); - GNUNET_CRYPTO_ecc_key_get_public (GST_my_private_key, &GST_my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (GST_my_private_key, &GST_my_public_key); GNUNET_CRYPTO_hash (&GST_my_public_key, sizeof (GST_my_public_key), &GST_my_identity.hashPubKey); GNUNET_assert (NULL != GST_my_private_key); diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h index a9f455b6a..44b375dd8 100644 --- a/src/transport/gnunet-service-transport.h +++ b/src/transport/gnunet-service-transport.h @@ -55,7 +55,7 @@ extern struct GNUNET_PEERINFO_Handle *GST_peerinfo; /** * Our public key. */ -extern struct GNUNET_CRYPTO_EccPublicKey GST_my_public_key; +extern struct GNUNET_CRYPTO_EccPublicSignKey GST_my_public_key; /** * Our private key. diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index e04407f02..8e5dd15c5 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c @@ -329,7 +329,7 @@ struct SessionDisconnectMessage /** * Public key of the sender. */ - struct GNUNET_CRYPTO_EccPublicKey public_key; + struct GNUNET_CRYPTO_EccPublicSignKey public_key; /** * Signature of the peer that sends us the disconnect. Only @@ -1195,7 +1195,7 @@ send_disconnect (struct NeighbourMapEntry *n) disconnect_msg.reserved = htonl (0); disconnect_msg.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_TIME_AbsoluteNBO)); disconnect_msg.purpose.purpose = htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); @@ -3155,7 +3155,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity return; } GNUNET_CRYPTO_hash (&sdm->public_key, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &hc); if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) { @@ -3164,7 +3164,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity } if (ntohl (sdm->purpose.size) != sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + - sizeof (struct GNUNET_CRYPTO_EccPublicKey) + + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + sizeof (struct GNUNET_TIME_AbsoluteNBO)) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 95a7eb04a..fe493f822 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -189,7 +189,7 @@ struct ValidationEntry /** * Public key of the peer. */ - struct GNUNET_CRYPTO_EccPublicKey public_key; + struct GNUNET_CRYPTO_EccPublicSignKey public_key; /** * The identity of the peer. FIXME: duplicated (also in 'address') @@ -678,7 +678,7 @@ revalidate_address (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * if we don't have an existing entry and no public key was given */ static struct ValidationEntry * -find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKey *public_key, +find_validation_entry (const struct GNUNET_CRYPTO_EccPublicSignKey *public_key, const struct GNUNET_HELLO_Address *address) { struct ValidationEntryMatchContext vemc; @@ -733,7 +733,7 @@ add_valid_address (void *cls, const struct GNUNET_HELLO_Address *address, struct ValidationEntry *ve; struct GNUNET_PeerIdentity pid; struct GNUNET_ATS_Information ats; - struct GNUNET_CRYPTO_EccPublicKey public_key; + struct GNUNET_CRYPTO_EccPublicSignKey public_key; if (0 == GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us) return GNUNET_OK; /* expired */ @@ -855,7 +855,7 @@ GST_validation_stop () */ static void multicast_pong (void *cls, - const struct GNUNET_CRYPTO_EccPublicKey *public_key, + const struct GNUNET_CRYPTO_EccPublicSignKey *public_key, struct GNUNET_TIME_Absolute valid_until, struct GNUNET_TIME_Absolute validation_block, const struct GNUNET_HELLO_Address *address) @@ -1141,7 +1141,7 @@ struct ValidateAddressContext /** * Public key of the peer whose address is being validated. */ - struct GNUNET_CRYPTO_EccPublicKey public_key; + struct GNUNET_CRYPTO_EccPublicSignKey public_key; }; diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index 46d3162c4..c935b97cf 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h @@ -134,7 +134,7 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); */ typedef void (*GST_ValidationAddressCallback) (void *cls, const struct - GNUNET_CRYPTO_EccPublicKey *public_key, + GNUNET_CRYPTO_EccPublicSignKey *public_key, struct GNUNET_TIME_Absolute valid_until, struct GNUNET_TIME_Absolute diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c index 97a88beb5..eecb30605 100644 --- a/src/transport/test_plugin_transport.c +++ b/src/transport/test_plugin_transport.c @@ -48,7 +48,7 @@ /** * Our public key. */ -static struct GNUNET_CRYPTO_EccPublicKey my_public_key; +static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; /** * Our identity. @@ -634,7 +634,7 @@ run (void *cls, char *const *args, const char *cfgfile, end_badly_now (); return; } - GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_identity.hashPubKey); diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index 755db9bdd..0d90edd51 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c @@ -35,6 +35,8 @@ * structs that use 256 bits, so using a bigger curve will require * changes that break stuff badly. The name of the curve given here * must be agreed by all peers and be supported by libgcrypt. + * + * NOTE: this will change to Curve25519 before GNUnet 0.10.0. */ #define CURVE "NIST P-256" @@ -113,11 +115,11 @@ key_from_sexp (gcry_mpi_t * array, gcry_sexp_t sexp, const char *topname, /** - * If target != size, move target bytes to the end of the size-sized - * buffer and zero out the first target-size bytes. + * If target != size, move @a target bytes to the end of the size-sized + * buffer and zero out the first @a target - @a size bytes. * * @param buf original buffer - * @param size number of bytes in the buffer + * @param size number of bytes in @a buf * @param target target size of the buffer */ static void @@ -137,8 +139,8 @@ adjust (unsigned char *buf, * Output the given MPI value to the given buffer. * * @param buf where to output to - * @param size number of bytes in buf - * @param val value to write to buf + * @param size number of bytes in @a buf + * @param val value to write to @a buf */ static void mpi_print (unsigned char *buf, @@ -227,7 +229,7 @@ decode_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *priv) static void point_to_public_key (gcry_mpi_point_t q, gcry_ctx_t ctx, - struct GNUNET_CRYPTO_EccPublicKey *pub) + struct GNUNET_CRYPTO_EccPublicSignKey *pub) { gcry_mpi_t q_x; gcry_mpi_t q_y; @@ -254,8 +256,8 @@ point_to_public_key (gcry_mpi_point_t q, * @param pub where to write the public key */ void -GNUNET_CRYPTO_ecc_key_get_public (const struct GNUNET_CRYPTO_EccPrivateKey *priv, - struct GNUNET_CRYPTO_EccPublicKey *pub) +GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPrivateKey *priv, + struct GNUNET_CRYPTO_EccPublicSignKey *pub) { gcry_sexp_t sexp; gcry_ctx_t ctx; @@ -276,13 +278,13 @@ GNUNET_CRYPTO_ecc_key_get_public (const struct GNUNET_CRYPTO_EccPrivateKey *priv * Convert a public key to a string. * * @param pub key to convert - * @return string representing 'pub' + * @return string representing @a pub */ char * -GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey *pub) +GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicSignKey *pub) { char *pubkeybuf; - size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicKey)) * 8; + size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8; char *end; if (keylen % 5 > 0) @@ -290,7 +292,7 @@ GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey keylen /= 5; pubkeybuf = GNUNET_malloc (keylen + 1); end = GNUNET_STRINGS_data_to_string ((unsigned char *) pub, - sizeof (struct GNUNET_CRYPTO_EccPublicKey), + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), pubkeybuf, keylen); if (NULL == end) @@ -307,16 +309,16 @@ GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey * Convert a string representing a public key to a public key. * * @param enc encoded public key - * @param enclen number of bytes in enc (without 0-terminator) + * @param enclen number of bytes in @a enc (without 0-terminator) * @param pub where to store the public key * @return #GNUNET_OK on success */ int -GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, +GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc, size_t enclen, - struct GNUNET_CRYPTO_EccPublicKey *pub) + struct GNUNET_CRYPTO_EccPublicSignKey *pub) { - size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicKey)) * 8; + size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8; if (keylen % 5 > 0) keylen += 5 - keylen % 5; @@ -326,7 +328,7 @@ GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen, pub, - sizeof (struct GNUNET_CRYPTO_EccPublicKey))) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) return GNUNET_SYSERR; return GNUNET_OK; } @@ -340,7 +342,7 @@ GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, * @return NULL on error */ static gcry_sexp_t -decode_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pub) +decode_public_sign_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub) { gcry_sexp_t pub_sexp; gcry_mpi_t q_x; @@ -620,6 +622,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename) * Create a new private key by reading our peer's key from * the file specified in the configuration. * + * @param cfg the configuration to use * @return new private key, NULL on error (for example, * permission denied) */ @@ -666,7 +669,7 @@ GNUNET_CRYPTO_ecc_setup_key (const char *cfg_name) * * @param cfg configuration to use * @param dst pointer to where to write the peer identity - * @return GNUNET_OK on success, GNUNET_SYSERR if the identity + * @return #GNUNET_OK on success, #GNUNET_SYSERR if the identity * could not be retrieved */ int @@ -674,7 +677,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst) { struct GNUNET_CRYPTO_EccPrivateKey *priv; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg))) { @@ -682,7 +685,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, _("Could not load peer's private key\n")); return GNUNET_SYSERR; } - GNUNET_CRYPTO_ecc_key_get_public (priv, &pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &pub); GNUNET_free (priv); GNUNET_CRYPTO_hash (&pub, sizeof (pub), &dst->hashPubKey); return GNUNET_OK; @@ -723,7 +726,7 @@ data_to_pkcs1 (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose) * @param priv private key to use for the signing * @param purpose what to sign (size, purpose) * @param sig where to write the signature - * @return GNUNET_SYSERR on error, GNUNET_OK on success + * @return #GNUNET_SYSERR on error, #GNUNET_OK on success */ int GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv, @@ -774,14 +777,14 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv, * @param validate block to validate (size, purpose, data) * @param sig signature that is being validated * @param pub public key of the signer - * @returns GNUNET_OK if ok, GNUNET_SYSERR if invalid + * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid */ int GNUNET_CRYPTO_ecc_verify (uint32_t purpose, const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, const struct GNUNET_CRYPTO_EccSignature *sig, - const struct GNUNET_CRYPTO_EccPublicKey *pub) + const struct GNUNET_CRYPTO_EccPublicSignKey *pub) { gcry_sexp_t data; gcry_sexp_t sig_sexpr; @@ -808,7 +811,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, gcry_mpi_release (r); gcry_mpi_release (s); data = data_to_pkcs1 (validate); - if (! (pub_sexpr = decode_public_key (pub))) + if (! (pub_sexpr = decode_public_sign_key (pub))) { gcry_sexp_release (data); gcry_sexp_release (sig_sexpr); @@ -829,6 +832,41 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, } +/** + * Convert the given public key from the network format to the + * S-expression that can be used by libgcrypt. + * + * @param pub public key to decode + * @return NULL on error + */ +static gcry_sexp_t +decode_public_encrypt_key (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub) +{ + gcry_sexp_t pub_sexp; + gcry_mpi_t q_x; + gcry_mpi_t q_y; + gcry_mpi_point_t q; + gcry_ctx_t ctx; + + mpi_scan (&q_x, pub->q_x, sizeof (pub->q_x)); + mpi_scan (&q_y, pub->q_y, sizeof (pub->q_y)); + q = gcry_mpi_point_new (256); + gcry_mpi_point_set (q, q_x, q_y, GCRYMPI_CONST_ONE); + gcry_mpi_release (q_x); + gcry_mpi_release (q_y); + + /* initialize 'ctx' with 'q' */ + GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); + gcry_mpi_ec_set_point ("q", q, ctx); + gcry_mpi_point_release (q); + + /* convert 'ctx' to 'sexp' */ + GNUNET_assert (0 == gcry_pubkey_get_sexp (&pub_sexp, GCRY_PK_GET_PUBKEY, ctx)); + gcry_ctx_release (ctx); + return pub_sexp; +} + + /** * Derive key material from a public and a private ECC key. * @@ -839,7 +877,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, */ int GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, - const struct GNUNET_CRYPTO_EccPublicKey *pub, + const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub, struct GNUNET_HashCode *key_material) { gcry_mpi_point_t result; @@ -852,7 +890,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, unsigned char xbuf[256 / 8]; /* first, extract the q = dP value from the public key */ - if (! (pub_sexpr = decode_public_key (pub))) + if (! (pub_sexpr = decode_public_encrypt_key (pub))) return GNUNET_SYSERR; GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, pub_sexpr, NULL)); gcry_sexp_release (pub_sexpr); @@ -899,7 +937,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, * @return h value */ static gcry_mpi_t -derive_h (const struct GNUNET_CRYPTO_EccPublicKey *pub, +derive_h (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const char *label, const char *context) { @@ -934,7 +972,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, const char *label, const char *context) { - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_CRYPTO_EccPrivateKey *ret; gcry_mpi_t h; gcry_mpi_t x; @@ -944,7 +982,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); n = gcry_mpi_ec_get_mpi ("n", ctx, 1); - GNUNET_CRYPTO_ecc_key_get_public (priv, &pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &pub); h = derive_h (&pub, label, context); mpi_scan (&x, priv->d, sizeof (priv->d)); d = gcry_mpi_new (256); @@ -971,10 +1009,10 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, * @param result where to write the derived public key */ void -GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicKey *pub, +GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, const char *label, const char *context, - struct GNUNET_CRYPTO_EccPublicKey *result) + struct GNUNET_CRYPTO_EccPublicSignKey *result) { gcry_ctx_t ctx; gcry_mpi_t h; diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c index 4f20d3208..6d9e78443 100644 --- a/src/util/gnunet-ecc.c +++ b/src/util/gnunet-ecc.c @@ -110,7 +110,7 @@ run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct GNUNET_CRYPTO_EccPrivateKey *pk; - struct GNUNET_CRYPTO_EccPublicKey pub; + struct GNUNET_CRYPTO_EccPublicSignKey pub; struct GNUNET_PeerIdentity pid; if (NULL == args[0]) @@ -130,7 +130,7 @@ run (void *cls, char *const *args, const char *cfgfile, { char *s; - GNUNET_CRYPTO_ecc_key_get_public (pk, &pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub); s = GNUNET_CRYPTO_ecc_public_key_to_string (&pub); fprintf (stdout, "%s\n", s); GNUNET_free (s); @@ -139,7 +139,7 @@ run (void *cls, char *const *args, const char *cfgfile, { struct GNUNET_CRYPTO_HashAsciiEncoded enc; - GNUNET_CRYPTO_ecc_key_get_public (pk, &pub); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub); GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey); GNUNET_CRYPTO_hash_to_enc (&pid.hashPubKey, &enc); fprintf (stdout, "%s\n", enc.encoding); diff --git a/src/util/test_crypto_ecc.c b/src/util/test_crypto_ecc.c index 58a9816a2..9a70eb055 100644 --- a/src/util/test_crypto_ecc.c +++ b/src/util/test_crypto_ecc.c @@ -43,13 +43,13 @@ testSignVerify () { struct GNUNET_CRYPTO_EccSignature sig; struct GNUNET_CRYPTO_EccSignaturePurpose purp; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; int i; struct GNUNET_TIME_Absolute start; int ok = GNUNET_OK; FPRINTF (stderr, "%s", "W"); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); start = GNUNET_TIME_absolute_get (); purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); @@ -92,11 +92,11 @@ testDeriveSignVerify () struct GNUNET_CRYPTO_EccSignature sig; struct GNUNET_CRYPTO_EccSignaturePurpose purp; struct GNUNET_CRYPTO_EccPrivateKey *dpriv; - struct GNUNET_CRYPTO_EccPublicKey pkey; - struct GNUNET_CRYPTO_EccPublicKey dpub; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey dpub; dpriv = GNUNET_CRYPTO_ecc_key_derive (key, "test-derive", "test-CTX"); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); GNUNET_CRYPTO_ecc_public_key_derive (&pkey, "test-derive", "test-CTX", &dpub); purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); @@ -146,7 +146,7 @@ testSignPerformance () { struct GNUNET_CRYPTO_EccSignaturePurpose purp; struct GNUNET_CRYPTO_EccSignature sig; - struct GNUNET_CRYPTO_EccPublicKey pkey; + struct GNUNET_CRYPTO_EccPublicSignKey pkey; int i; struct GNUNET_TIME_Absolute start; int ok = GNUNET_OK; @@ -154,7 +154,7 @@ testSignPerformance () purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); FPRINTF (stderr, "%s", "W"); - GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); start = GNUNET_TIME_absolute_get (); for (i = 0; i < ITER; i++) { @@ -177,22 +177,22 @@ testSignPerformance () static int testCreateFromFile () { - struct GNUNET_CRYPTO_EccPublicKey p1; - struct GNUNET_CRYPTO_EccPublicKey p2; + struct GNUNET_CRYPTO_EccPublicSignKey p1; + struct GNUNET_CRYPTO_EccPublicSignKey p2; key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); GNUNET_assert (NULL != key); - GNUNET_CRYPTO_ecc_key_get_public (key, &p1); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &p1); GNUNET_free (key); key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); GNUNET_assert (NULL != key); - GNUNET_CRYPTO_ecc_key_get_public (key, &p2); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &p2); GNUNET_assert (0 == memcmp (&p1, &p2, sizeof (p1))); GNUNET_free (key); GNUNET_assert (0 == UNLINK (KEYFILE)); key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); GNUNET_assert (NULL != key); - GNUNET_CRYPTO_ecc_key_get_public (key, &p2); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &p2); GNUNET_assert (0 != memcmp (&p1, &p2, sizeof (p1))); GNUNET_free (key); return GNUNET_OK; @@ -204,15 +204,15 @@ test_ecdh () { struct GNUNET_CRYPTO_EccPrivateKey *priv1; struct GNUNET_CRYPTO_EccPrivateKey *priv2; - struct GNUNET_CRYPTO_EccPublicKey pub1; - struct GNUNET_CRYPTO_EccPublicKey pub2; + struct GNUNET_CRYPTO_EccPublicSignKey pub1; + struct GNUNET_CRYPTO_EccPublicSignKey pub2; struct GNUNET_HashCode ecdh1; struct GNUNET_HashCode ecdh2; priv1 = GNUNET_CRYPTO_ecc_key_create (); priv2 = GNUNET_CRYPTO_ecc_key_create (); - GNUNET_CRYPTO_ecc_key_get_public (priv1, &pub1); - GNUNET_CRYPTO_ecc_key_get_public (priv2, &pub2); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv1, &pub1); + GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv2, &pub2); GNUNET_CRYPTO_ecc_ecdh (priv1, &pub2, &ecdh1); GNUNET_CRYPTO_ecc_ecdh (priv2, &pub1, &ecdh2); GNUNET_assert (0 == memcmp (&ecdh1, &ecdh2, -- cgit v1.2.3