diff options
100 files changed, 581 insertions, 478 deletions
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 | |||
111 | * Ephemeral public ECC key (always for NIST P-521) encoded in a format suitable | 111 | * Ephemeral public ECC key (always for NIST P-521) encoded in a format suitable |
112 | * for network transmission as created using 'gcry_sexp_sprint'. | 112 | * for network transmission as created using 'gcry_sexp_sprint'. |
113 | */ | 113 | */ |
114 | struct GNUNET_CRYPTO_EccPublicKey ephemeral_key; | 114 | struct GNUNET_CRYPTO_EccPublicSignKey ephemeral_key; |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * Public key of the signing peer (persistent version, not the ephemeral public key). | 117 | * Public key of the signing peer (persistent version, not the ephemeral public key). |
118 | */ | 118 | */ |
119 | struct GNUNET_CRYPTO_EccPublicKey origin_public_key; | 119 | struct GNUNET_CRYPTO_EccPublicSignKey origin_public_key; |
120 | 120 | ||
121 | }; | 121 | }; |
122 | 122 | ||
@@ -392,7 +392,7 @@ static struct EphemeralKeyMessage current_ekm; | |||
392 | /** | 392 | /** |
393 | * Our public key. | 393 | * Our public key. |
394 | */ | 394 | */ |
395 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 395 | static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
396 | 396 | ||
397 | /** | 397 | /** |
398 | * Our message stream tokenizer (for encrypted payload). | 398 | * Our message stream tokenizer (for encrypted payload). |
@@ -771,7 +771,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, | |||
771 | "Core service receives `%s' request from `%4s'.\n", "EPHEMERAL_KEY", | 771 | "Core service receives `%s' request from `%4s'.\n", "EPHEMERAL_KEY", |
772 | GNUNET_i2s (&kx->peer)); | 772 | GNUNET_i2s (&kx->peer)); |
773 | GNUNET_CRYPTO_hash (&m->origin_public_key, | 773 | GNUNET_CRYPTO_hash (&m->origin_public_key, |
774 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 774 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
775 | &signer_id.hashPubKey); | 775 | &signer_id.hashPubKey); |
776 | if (0 != | 776 | if (0 != |
777 | memcmp (&signer_id, &kx->peer, | 777 | memcmp (&signer_id, &kx->peer, |
@@ -784,8 +784,8 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx, | |||
784 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 784 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
785 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 785 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
786 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 786 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
787 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 787 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
788 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)) || | 788 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) || |
789 | (GNUNET_OK != | 789 | (GNUNET_OK != |
790 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY, | 790 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_SET_ECC_KEY, |
791 | &m->purpose, | 791 | &m->purpose, |
@@ -1477,8 +1477,8 @@ sign_ephemeral_key () | |||
1477 | current_ekm.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 1477 | current_ekm.purpose.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
1478 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 1478 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
1479 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 1479 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
1480 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 1480 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
1481 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 1481 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
1482 | current_ekm.creation_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); | 1482 | current_ekm.creation_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); |
1483 | if (GNUNET_YES == | 1483 | if (GNUNET_YES == |
1484 | GNUNET_CONFIGURATION_get_value_yesno (GSC_cfg, | 1484 | GNUNET_CONFIGURATION_get_value_yesno (GSC_cfg, |
@@ -1492,7 +1492,7 @@ sign_ephemeral_key () | |||
1492 | { | 1492 | { |
1493 | current_ekm.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_UNIT_FOREVER_ABS); | 1493 | current_ekm.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_UNIT_FOREVER_ABS); |
1494 | } | 1494 | } |
1495 | GNUNET_CRYPTO_ecc_key_get_public (my_ephemeral_key, | 1495 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_ephemeral_key, |
1496 | ¤t_ekm.ephemeral_key); | 1496 | ¤t_ekm.ephemeral_key); |
1497 | current_ekm.origin_public_key = my_public_key; | 1497 | current_ekm.origin_public_key = my_public_key; |
1498 | GNUNET_assert (GNUNET_OK == | 1498 | GNUNET_assert (GNUNET_OK == |
@@ -1541,7 +1541,7 @@ GSC_KX_init (struct GNUNET_CRYPTO_EccPrivateKey *pk) | |||
1541 | { | 1541 | { |
1542 | GNUNET_assert (NULL != pk); | 1542 | GNUNET_assert (NULL != pk); |
1543 | my_private_key = pk; | 1543 | my_private_key = pk; |
1544 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); | 1544 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); |
1545 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), | 1545 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
1546 | &GSC_my_identity.hashPubKey); | 1546 | &GSC_my_identity.hashPubKey); |
1547 | if (GNUNET_YES == | 1547 | 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 @@ | |||
38 | */ | 38 | */ |
39 | struct Issuer | 39 | struct Issuer |
40 | { | 40 | { |
41 | struct GNUNET_CRYPTO_EccPublicKey pubkey; | 41 | struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | 44 | ||
@@ -409,7 +409,7 @@ GED_experiments_start () | |||
409 | char *pubkey; | 409 | char *pubkey; |
410 | char *pos; | 410 | char *pos; |
411 | struct GNUNET_PeerIdentity issuer_ID; | 411 | struct GNUNET_PeerIdentity issuer_ID; |
412 | struct GNUNET_CRYPTO_EccPublicKey pub; | 412 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
413 | struct GNUNET_HashCode hash; | 413 | struct GNUNET_HashCode hash; |
414 | 414 | ||
415 | /* Load valid issuer */ | 415 | /* Load valid issuer */ |
@@ -448,7 +448,7 @@ GED_experiments_start () | |||
448 | 448 | ||
449 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (GED_cfg, "EXPERIMENTATION", "PUBKEY", &pubkey)) | 449 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (GED_cfg, "EXPERIMENTATION", "PUBKEY", &pubkey)) |
450 | { | 450 | { |
451 | if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_key_from_string(pubkey, strlen (pubkey), &pub)) | 451 | if (GNUNET_OK != GNUNET_CRYPTO_ecc_public_sign_key_from_string(pubkey, strlen (pubkey), &pub)) |
452 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Invalid public key `%s'\n"), pubkey); | 452 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Invalid public key `%s'\n"), pubkey); |
453 | else | 453 | else |
454 | { | 454 | { |
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 | |||
120 | /** | 120 | /** |
121 | * Identity of the peer sharing the file. | 121 | * Identity of the peer sharing the file. |
122 | */ | 122 | */ |
123 | struct GNUNET_CRYPTO_EccPublicKey peer; | 123 | struct GNUNET_CRYPTO_EccPublicSignKey peer; |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * Time when this location URI expires. | 126 | * Time when this location URI expires. |
@@ -198,7 +198,7 @@ struct GNUNET_FS_Uri | |||
198 | /** | 198 | /** |
199 | * Identifier of the namespace. | 199 | * Identifier of the namespace. |
200 | */ | 200 | */ |
201 | struct GNUNET_CRYPTO_EccPublicKey ns; | 201 | struct GNUNET_CRYPTO_EccPublicSignKey ns; |
202 | 202 | ||
203 | /** | 203 | /** |
204 | * Human-readable identifier chosen for this entry in the | 204 | * Human-readable identifier chosen for this entry in the |
@@ -1461,7 +1461,7 @@ struct SearchRequestEntry | |||
1461 | /** | 1461 | /** |
1462 | * Derived public key, hashes to 'uquery'. | 1462 | * Derived public key, hashes to 'uquery'. |
1463 | */ | 1463 | */ |
1464 | struct GNUNET_CRYPTO_EccPublicKey dpub; | 1464 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; |
1465 | 1465 | ||
1466 | /** | 1466 | /** |
1467 | * The original keyword, used to derive the | 1467 | * 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, | |||
131 | { | 131 | { |
132 | char *dn; | 132 | char *dn; |
133 | char *ret; | 133 | char *ret; |
134 | struct GNUNET_CRYPTO_EccPublicKey pub; | 134 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
135 | struct GNUNET_HashCode hc; | 135 | struct GNUNET_HashCode hc; |
136 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; | 136 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; |
137 | 137 | ||
@@ -143,7 +143,7 @@ get_update_information_directory (struct GNUNET_FS_Handle *h, | |||
143 | "fs", "UPDATE_DIR"); | 143 | "fs", "UPDATE_DIR"); |
144 | return NULL; | 144 | return NULL; |
145 | } | 145 | } |
146 | GNUNET_CRYPTO_ecc_key_get_public (ns, &pub); | 146 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &pub); |
147 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); | 147 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &hc); |
148 | GNUNET_CRYPTO_hash_to_enc (&hc, | 148 | GNUNET_CRYPTO_hash_to_enc (&hc, |
149 | &enc); | 149 | &enc); |
@@ -448,7 +448,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
448 | sks_uri = GNUNET_new (struct GNUNET_FS_Uri); | 448 | sks_uri = GNUNET_new (struct GNUNET_FS_Uri); |
449 | sks_uri->type = GNUNET_FS_URI_SKS; | 449 | sks_uri->type = GNUNET_FS_URI_SKS; |
450 | sks_uri->data.sks.identifier = GNUNET_strdup (identifier); | 450 | sks_uri->data.sks.identifier = GNUNET_strdup (identifier); |
451 | GNUNET_CRYPTO_ecc_key_get_public (ns, | 451 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, |
452 | &sks_uri->data.sks.ns); | 452 | &sks_uri->data.sks.ns); |
453 | 453 | ||
454 | psc = GNUNET_new (struct GNUNET_FS_PublishSksContext); | 454 | 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 | |||
46 | derive_ublock_encryption_key (struct GNUNET_CRYPTO_AesSessionKey *skey, | 46 | derive_ublock_encryption_key (struct GNUNET_CRYPTO_AesSessionKey *skey, |
47 | struct GNUNET_CRYPTO_AesInitializationVector *iv, | 47 | struct GNUNET_CRYPTO_AesInitializationVector *iv, |
48 | const char *label, | 48 | const char *label, |
49 | const struct GNUNET_CRYPTO_EccPublicKey *pub) | 49 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
50 | { | 50 | { |
51 | struct GNUNET_HashCode key; | 51 | struct GNUNET_HashCode key; |
52 | 52 | ||
@@ -73,7 +73,7 @@ derive_ublock_encryption_key (struct GNUNET_CRYPTO_AesSessionKey *skey, | |||
73 | void | 73 | void |
74 | GNUNET_FS_ublock_decrypt_ (const void *input, | 74 | GNUNET_FS_ublock_decrypt_ (const void *input, |
75 | size_t input_len, | 75 | size_t input_len, |
76 | const struct GNUNET_CRYPTO_EccPublicKey *ns, | 76 | const struct GNUNET_CRYPTO_EccPublicSignKey *ns, |
77 | const char *label, | 77 | const char *label, |
78 | void *output) | 78 | void *output) |
79 | { | 79 | { |
@@ -170,7 +170,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
170 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 170 | struct GNUNET_CRYPTO_AesInitializationVector iv; |
171 | struct GNUNET_CRYPTO_AesSessionKey skey; | 171 | struct GNUNET_CRYPTO_AesSessionKey skey; |
172 | struct GNUNET_CRYPTO_EccPrivateKey *nsd; | 172 | struct GNUNET_CRYPTO_EccPrivateKey *nsd; |
173 | struct GNUNET_CRYPTO_EccPublicKey pub; | 173 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
174 | char *uris; | 174 | char *uris; |
175 | size_t size; | 175 | size_t size; |
176 | char *kbe; | 176 | char *kbe; |
@@ -225,7 +225,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
225 | "Publishing under identifier `%s'\n", | 225 | "Publishing under identifier `%s'\n", |
226 | label); | 226 | label); |
227 | /* get public key of the namespace */ | 227 | /* get public key of the namespace */ |
228 | GNUNET_CRYPTO_ecc_key_get_public (ns, | 228 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, |
229 | &pub); | 229 | &pub); |
230 | derive_ublock_encryption_key (&skey, &iv, | 230 | derive_ublock_encryption_key (&skey, &iv, |
231 | label, &pub); | 231 | label, &pub); |
@@ -243,7 +243,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h, | |||
243 | 243 | ||
244 | /* derive signing-key from 'label' and public key of the namespace */ | 244 | /* derive signing-key from 'label' and public key of the namespace */ |
245 | nsd = GNUNET_CRYPTO_ecc_key_derive (ns, label, "fs-ublock"); | 245 | nsd = GNUNET_CRYPTO_ecc_key_derive (ns, label, "fs-ublock"); |
246 | GNUNET_CRYPTO_ecc_key_get_public (nsd, | 246 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (nsd, |
247 | &ub_enc->verification_key); | 247 | &ub_enc->verification_key); |
248 | GNUNET_assert (GNUNET_OK == | 248 | GNUNET_assert (GNUNET_OK == |
249 | GNUNET_CRYPTO_ecc_sign (nsd, | 249 | 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 @@ | |||
46 | void | 46 | void |
47 | GNUNET_FS_ublock_decrypt_ (const void *input, | 47 | GNUNET_FS_ublock_decrypt_ (const void *input, |
48 | size_t input_len, | 48 | size_t input_len, |
49 | const struct GNUNET_CRYPTO_EccPublicKey *ns, | 49 | const struct GNUNET_CRYPTO_EccPublicSignKey *ns, |
50 | const char *label, | 50 | const char *label, |
51 | void *output); | 51 | void *output); |
52 | 52 | ||
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, | |||
679 | */ | 679 | */ |
680 | static int | 680 | static int |
681 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | 681 | decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, |
682 | const struct GNUNET_CRYPTO_EccPublicKey *dpub, | 682 | const struct GNUNET_CRYPTO_EccPublicSignKey *dpub, |
683 | const void *edata, | 683 | const void *edata, |
684 | size_t edata_size, | 684 | size_t edata_size, |
685 | char *data) | 685 | char *data) |
686 | { | 686 | { |
687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 687 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; |
688 | struct GNUNET_CRYPTO_EccPublicKey anon_pub; | 688 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; |
689 | unsigned int i; | 689 | unsigned int i; |
690 | 690 | ||
691 | /* find key */ | 691 | /* find key */ |
692 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) | 692 | for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) |
693 | if (0 == memcmp (dpub, | 693 | if (0 == memcmp (dpub, |
694 | &sc->requests[i].dpub, | 694 | &sc->requests[i].dpub, |
695 | sizeof (struct GNUNET_CRYPTO_EccPublicKey))) | 695 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) |
696 | break; | 696 | break; |
697 | if (i == sc->uri->data.ksk.keywordCount) | 697 | if (i == sc->uri->data.ksk.keywordCount) |
698 | { | 698 | { |
@@ -702,7 +702,7 @@ decrypt_block_with_keyword (const struct GNUNET_FS_SearchContext *sc, | |||
702 | } | 702 | } |
703 | /* decrypt */ | 703 | /* decrypt */ |
704 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 704 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); |
705 | GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); | 705 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); |
706 | GNUNET_FS_ublock_decrypt_ (edata, edata_size, | 706 | GNUNET_FS_ublock_decrypt_ (edata, edata_size, |
707 | &anon_pub, | 707 | &anon_pub, |
708 | sc->requests[i].keyword, | 708 | sc->requests[i].keyword, |
@@ -1035,7 +1035,7 @@ transmit_search_request (void *cls, size_t size, void *buf) | |||
1035 | struct MessageBuilderContext mbc; | 1035 | struct MessageBuilderContext mbc; |
1036 | size_t msize; | 1036 | size_t msize; |
1037 | struct SearchMessage *sm; | 1037 | struct SearchMessage *sm; |
1038 | struct GNUNET_CRYPTO_EccPublicKey dpub; | 1038 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; |
1039 | unsigned int sqms; | 1039 | unsigned int sqms; |
1040 | uint32_t options; | 1040 | uint32_t options; |
1041 | 1041 | ||
@@ -1272,7 +1272,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1272 | unsigned int i; | 1272 | unsigned int i; |
1273 | const char *keyword; | 1273 | const char *keyword; |
1274 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 1274 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; |
1275 | struct GNUNET_CRYPTO_EccPublicKey anon_pub; | 1275 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; |
1276 | struct SearchRequestEntry *sre; | 1276 | struct SearchRequestEntry *sre; |
1277 | 1277 | ||
1278 | GNUNET_assert (NULL == sc->client); | 1278 | GNUNET_assert (NULL == sc->client); |
@@ -1280,7 +1280,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1280 | { | 1280 | { |
1281 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); | 1281 | GNUNET_assert (0 != sc->uri->data.ksk.keywordCount); |
1282 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 1282 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); |
1283 | GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); | 1283 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); |
1284 | sc->requests = | 1284 | sc->requests = |
1285 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * | 1285 | GNUNET_malloc (sizeof (struct SearchRequestEntry) * |
1286 | sc->uri->data.ksk.keywordCount); | 1286 | sc->uri->data.ksk.keywordCount); |
@@ -1294,7 +1294,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1294 | "fs-ublock", | 1294 | "fs-ublock", |
1295 | &sre->dpub); | 1295 | &sre->dpub); |
1296 | GNUNET_CRYPTO_hash (&sre->dpub, | 1296 | GNUNET_CRYPTO_hash (&sre->dpub, |
1297 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 1297 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
1298 | &sre->uquery); | 1298 | &sre->uquery); |
1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); | 1299 | sre->mandatory = (sc->uri->data.ksk.keywords[i][0] == '+'); |
1300 | if (sre->mandatory) | 1300 | 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) | |||
554 | { | 554 | { |
555 | const char *keyword; | 555 | const char *keyword; |
556 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; | 556 | const struct GNUNET_CRYPTO_EccPrivateKey *anon; |
557 | struct GNUNET_CRYPTO_EccPublicKey anon_pub; | 557 | struct GNUNET_CRYPTO_EccPublicSignKey anon_pub; |
558 | struct GNUNET_CRYPTO_EccPublicKey dpub; | 558 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; |
559 | 559 | ||
560 | if (NULL == uc->dsh) | 560 | if (NULL == uc->dsh) |
561 | uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); | 561 | uc->dsh = GNUNET_DATASTORE_connect (uc->h->cfg); |
@@ -574,7 +574,7 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc) | |||
574 | return; | 574 | return; |
575 | } | 575 | } |
576 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); | 576 | anon = GNUNET_CRYPTO_ecc_key_get_anonymous (); |
577 | GNUNET_CRYPTO_ecc_key_get_public (anon, &anon_pub); | 577 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon, &anon_pub); |
578 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; | 578 | keyword = &uc->ksk_uri->data.ksk.keywords[uc->ksk_offset][1]; |
579 | GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub, | 579 | GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub, |
580 | keyword, | 580 | 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, | |||
118 | case GNUNET_FS_URI_LOC: | 118 | case GNUNET_FS_URI_LOC: |
119 | GNUNET_CRYPTO_hash (&uri->data.loc.fi, | 119 | GNUNET_CRYPTO_hash (&uri->data.loc.fi, |
120 | sizeof (struct FileIdentifier) + | 120 | sizeof (struct FileIdentifier) + |
121 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 121 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
122 | key); | 122 | key); |
123 | break; | 123 | break; |
124 | default: | 124 | default: |
@@ -357,7 +357,7 @@ static struct GNUNET_FS_Uri * | |||
357 | uri_sks_parse (const char *s, char **emsg) | 357 | uri_sks_parse (const char *s, char **emsg) |
358 | { | 358 | { |
359 | struct GNUNET_FS_Uri *ret; | 359 | struct GNUNET_FS_Uri *ret; |
360 | struct GNUNET_CRYPTO_EccPublicKey ns; | 360 | struct GNUNET_CRYPTO_EccPublicSignKey ns; |
361 | size_t pos; | 361 | size_t pos; |
362 | char *end; | 362 | char *end; |
363 | 363 | ||
@@ -532,7 +532,7 @@ struct LocUriAssembly | |||
532 | /** | 532 | /** |
533 | * Peer offering the file. | 533 | * Peer offering the file. |
534 | */ | 534 | */ |
535 | struct GNUNET_CRYPTO_EccPublicKey peer; | 535 | struct GNUNET_CRYPTO_EccPublicSignKey peer; |
536 | 536 | ||
537 | }; | 537 | }; |
538 | GNUNET_NETWORK_STRUCT_END | 538 | GNUNET_NETWORK_STRUCT_END |
@@ -604,7 +604,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
604 | npos++; | 604 | npos++; |
605 | ret = | 605 | ret = |
606 | enc2bin (&s[npos], &ass.peer, | 606 | enc2bin (&s[npos], &ass.peer, |
607 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 607 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
608 | if (ret == -1) | 608 | if (ret == -1) |
609 | { | 609 | { |
610 | *emsg = | 610 | *emsg = |
@@ -841,7 +841,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | |||
841 | if (uri->type != GNUNET_FS_URI_LOC) | 841 | if (uri->type != GNUNET_FS_URI_LOC) |
842 | return GNUNET_SYSERR; | 842 | return GNUNET_SYSERR; |
843 | GNUNET_CRYPTO_hash (&uri->data.loc.peer, | 843 | GNUNET_CRYPTO_hash (&uri->data.loc.peer, |
844 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 844 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
845 | &peer->hashPubKey); | 845 | &peer->hashPubKey); |
846 | return GNUNET_OK; | 846 | return GNUNET_OK; |
847 | } | 847 | } |
@@ -897,7 +897,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
897 | { | 897 | { |
898 | struct GNUNET_FS_Uri *uri; | 898 | struct GNUNET_FS_Uri *uri; |
899 | struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; | 899 | struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; |
900 | struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 900 | struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
901 | char *keyfile; | 901 | char *keyfile; |
902 | struct LocUriAssembly ass; | 902 | struct LocUriAssembly ass; |
903 | struct GNUNET_TIME_Absolute et; | 903 | struct GNUNET_TIME_Absolute et; |
@@ -922,7 +922,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
922 | GNUNET_free (keyfile); | 922 | GNUNET_free (keyfile); |
923 | /* we round expiration time to full seconds for SKS URIs */ | 923 | /* we round expiration time to full seconds for SKS URIs */ |
924 | et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL; | 924 | et.abs_value_us = (expiration_time.abs_value_us / 1000000LL) * 1000000LL; |
925 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); | 925 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); |
926 | ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); | 926 | ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); |
927 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); | 927 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); |
928 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 928 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
@@ -949,7 +949,7 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
949 | * @return an FS URI for the given namespace and identifier | 949 | * @return an FS URI for the given namespace and identifier |
950 | */ | 950 | */ |
951 | struct GNUNET_FS_Uri * | 951 | struct GNUNET_FS_Uri * |
952 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, | 952 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, |
953 | const char *id) | 953 | const char *id) |
954 | { | 954 | { |
955 | struct GNUNET_FS_Uri *ns_uri; | 955 | struct GNUNET_FS_Uri *ns_uri; |
@@ -1260,7 +1260,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
1260 | case GNUNET_FS_URI_SKS: | 1260 | case GNUNET_FS_URI_SKS: |
1261 | if ((0 == | 1261 | if ((0 == |
1262 | memcmp (&u1->data.sks.ns, &u2->data.sks.ns, | 1262 | memcmp (&u1->data.sks.ns, &u2->data.sks.ns, |
1263 | sizeof (struct GNUNET_CRYPTO_EccPublicKey))) && | 1263 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) && |
1264 | (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) | 1264 | (0 == strcmp (u1->data.sks.identifier, u2->data.sks.identifier))) |
1265 | 1265 | ||
1266 | return GNUNET_YES; | 1266 | return GNUNET_YES; |
@@ -1287,7 +1287,7 @@ GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
1287 | if (memcmp | 1287 | if (memcmp |
1288 | (&u1->data.loc, &u2->data.loc, | 1288 | (&u1->data.loc, &u2->data.loc, |
1289 | sizeof (struct FileIdentifier) + | 1289 | sizeof (struct FileIdentifier) + |
1290 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 1290 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
1291 | sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + | 1291 | sizeof (struct GNUNET_TIME_Absolute) + sizeof (unsigned short) + |
1292 | sizeof (unsigned short)) != 0) | 1292 | sizeof (unsigned short)) != 0) |
1293 | return GNUNET_NO; | 1293 | return GNUNET_NO; |
@@ -1321,7 +1321,7 @@ GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri) | |||
1321 | */ | 1321 | */ |
1322 | int | 1322 | int |
1323 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 1323 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
1324 | struct GNUNET_CRYPTO_EccPublicKey *pseudonym) | 1324 | struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym) |
1325 | { | 1325 | { |
1326 | if (!GNUNET_FS_uri_test_sks (uri)) | 1326 | if (!GNUNET_FS_uri_test_sks (uri)) |
1327 | { | 1327 | { |
@@ -1896,7 +1896,7 @@ uri_sks_to_string (const struct GNUNET_FS_Uri *uri) | |||
1896 | if (GNUNET_FS_URI_SKS != uri->type) | 1896 | if (GNUNET_FS_URI_SKS != uri->type) |
1897 | return NULL; | 1897 | return NULL; |
1898 | ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, | 1898 | ret = GNUNET_STRINGS_data_to_string (&uri->data.sks.ns, |
1899 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 1899 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
1900 | buf, | 1900 | buf, |
1901 | sizeof (buf)); | 1901 | sizeof (buf)); |
1902 | GNUNET_assert (NULL != ret); | 1902 | GNUNET_assert (NULL != ret); |
@@ -2001,7 +2001,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) | |||
2001 | GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); | 2001 | GNUNET_CRYPTO_hash_to_enc (&uri->data.loc.fi.chk.query, &queryhash); |
2002 | peerId = | 2002 | peerId = |
2003 | bin2enc (&uri->data.loc.peer, | 2003 | bin2enc (&uri->data.loc.peer, |
2004 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 2004 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
2005 | peerSig = | 2005 | peerSig = |
2006 | bin2enc (&uri->data.loc.contentSignature, | 2006 | bin2enc (&uri->data.loc.contentSignature, |
2007 | sizeof (struct GNUNET_CRYPTO_EccSignature)); | 2007 | 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 @@ | |||
29 | #include "gnunet_fs_service.h" | 29 | #include "gnunet_fs_service.h" |
30 | 30 | ||
31 | 31 | ||
32 | static struct GNUNET_CRYPTO_EccPublicKey nsid; | 32 | static struct GNUNET_CRYPTO_EccPublicSignKey nsid; |
33 | 33 | ||
34 | static struct GNUNET_FS_Uri *sks_expect_uri; | 34 | static struct GNUNET_FS_Uri *sks_expect_uri; |
35 | 35 | ||
@@ -255,7 +255,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) | |||
255 | bo.replication_level = 0; | 255 | bo.replication_level = 0; |
256 | bo.expiration_time = | 256 | bo.expiration_time = |
257 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); | 257 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); |
258 | GNUNET_CRYPTO_ecc_key_get_public (ns, &nsid); | 258 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ns, &nsid); |
259 | GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri, | 259 | GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, uri, |
260 | &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL); | 260 | &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &sks_cont, NULL); |
261 | GNUNET_CONTAINER_meta_data_destroy (meta); | 261 | 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) | |||
164 | struct GNUNET_FS_Uri *ret; | 164 | struct GNUNET_FS_Uri *ret; |
165 | char *emsg; | 165 | char *emsg; |
166 | struct GNUNET_CRYPTO_EccPrivateKey *ph; | 166 | struct GNUNET_CRYPTO_EccPrivateKey *ph; |
167 | struct GNUNET_CRYPTO_EccPublicKey id; | 167 | struct GNUNET_CRYPTO_EccPublicSignKey id; |
168 | char buf[1024]; | 168 | char buf[1024]; |
169 | char ubuf[1024]; | 169 | char ubuf[1024]; |
170 | char *sret; | 170 | char *sret; |
@@ -194,7 +194,7 @@ testNamespace (int i) | |||
194 | } | 194 | } |
195 | GNUNET_free (emsg); | 195 | GNUNET_free (emsg); |
196 | ph = GNUNET_CRYPTO_ecc_key_create (); | 196 | ph = GNUNET_CRYPTO_ecc_key_create (); |
197 | GNUNET_CRYPTO_ecc_key_get_public (ph, &id); | 197 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ph, &id); |
198 | sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), | 198 | sret = GNUNET_STRINGS_data_to_string (&id, sizeof (id), |
199 | ubuf, sizeof (ubuf) - 1); | 199 | ubuf, sizeof (ubuf) - 1); |
200 | GNUNET_assert (NULL != sret); | 200 | 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 | |||
63 | /** | 63 | /** |
64 | * Zone that is to be used for lookup | 64 | * Zone that is to be used for lookup |
65 | */ | 65 | */ |
66 | struct GNUNET_CRYPTO_EccPublicKey zone; | 66 | struct GNUNET_CRYPTO_EccPublicSignKey zone; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Only check cached results | 69 | * 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) | |||
521 | struct GNUNET_GNS_LookupRequest* | 521 | struct GNUNET_GNS_LookupRequest* |
522 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 522 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, |
523 | const char *name, | 523 | const char *name, |
524 | const struct GNUNET_CRYPTO_EccPublicKey *zone, | 524 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone, |
525 | int type, | 525 | int type, |
526 | int only_cached, | 526 | int only_cached, |
527 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, | 527 | 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; | |||
143 | /** | 143 | /** |
144 | * Which GNS zone do we translate incoming DNS requests to? | 144 | * Which GNS zone do we translate incoming DNS requests to? |
145 | */ | 145 | */ |
146 | static struct GNUNET_CRYPTO_EccPublicKey my_zone; | 146 | static struct GNUNET_CRYPTO_EccPublicSignKey my_zone; |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * '-z' option with the main zone to use. | 149 | * '-z' option with the main zone to use. |
@@ -744,7 +744,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
744 | } | 744 | } |
745 | if ( (NULL == gns_zone_str) || | 745 | if ( (NULL == gns_zone_str) || |
746 | (GNUNET_OK != | 746 | (GNUNET_OK != |
747 | GNUNET_CRYPTO_ecc_public_key_from_string (gns_zone_str, | 747 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (gns_zone_str, |
748 | strlen (gns_zone_str), | 748 | strlen (gns_zone_str), |
749 | &my_zone)) ) | 749 | &my_zone)) ) |
750 | { | 750 | { |
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 | |||
61 | */ | 61 | */ |
62 | static struct GNUNET_GNS_Handle *gns; | 62 | static struct GNUNET_GNS_Handle *gns; |
63 | 63 | ||
64 | static struct GNUNET_CRYPTO_EccPublicKey *zone = NULL; | 64 | static struct GNUNET_CRYPTO_EccPublicSignKey *zone = NULL; |
65 | static struct GNUNET_HashCode user_zone; | 65 | static struct GNUNET_HashCode user_zone; |
66 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL; | 66 | struct GNUNET_CRYPTO_EccPrivateKey *shorten_key = NULL; |
67 | 67 | ||
@@ -663,7 +663,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
663 | 663 | ||
664 | char* keyfile; | 664 | char* keyfile; |
665 | struct GNUNET_CRYPTO_EccPrivateKey *key = NULL; | 665 | struct GNUNET_CRYPTO_EccPrivateKey *key = NULL; |
666 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 666 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
667 | struct GNUNET_CRYPTO_HashAsciiEncoded zonename; | 667 | struct GNUNET_CRYPTO_HashAsciiEncoded zonename; |
668 | 668 | ||
669 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", | 669 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns", |
@@ -678,8 +678,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
678 | if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) | 678 | if (GNUNET_YES == GNUNET_DISK_file_test (keyfile)) |
679 | { | 679 | { |
680 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); | 680 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
681 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 681 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
682 | GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicKey), | 682 | GNUNET_CRYPTO_hash (&pkey, sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), |
683 | &user_zone); | 683 | &user_zone); |
684 | GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename); | 684 | GNUNET_CRYPTO_hash_to_enc (&user_zone, &zonename); |
685 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 685 | 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) | |||
3189 | { | 3189 | { |
3190 | char *keyfile; | 3190 | char *keyfile; |
3191 | struct GNUNET_CRYPTO_EccPrivateKey *key; | 3191 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
3192 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 3192 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
3193 | struct GNUNET_CRYPTO_ShortHashCode *zone; | 3193 | struct GNUNET_CRYPTO_ShortHashCode *zone; |
3194 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; | 3194 | struct GNUNET_CRYPTO_ShortHashAsciiEncoded zonename; |
3195 | 3195 | ||
@@ -3210,10 +3210,10 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
3210 | } | 3210 | } |
3211 | 3211 | ||
3212 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); | 3212 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
3213 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 3213 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
3214 | local_gns_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 3214 | local_gns_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
3215 | GNUNET_CRYPTO_short_hash (&pkey, | 3215 | GNUNET_CRYPTO_short_hash (&pkey, |
3216 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 3216 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
3217 | local_gns_zone); | 3217 | local_gns_zone); |
3218 | zone = local_gns_zone; | 3218 | zone = local_gns_zone; |
3219 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 3219 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
@@ -3239,10 +3239,10 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
3239 | else | 3239 | else |
3240 | { | 3240 | { |
3241 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); | 3241 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
3242 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 3242 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
3243 | local_private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 3243 | local_private_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
3244 | GNUNET_CRYPTO_short_hash (&pkey, | 3244 | GNUNET_CRYPTO_short_hash (&pkey, |
3245 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 3245 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
3246 | local_private_zone); | 3246 | local_private_zone); |
3247 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 3247 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
3248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -3268,10 +3268,10 @@ load_local_zone_key (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
3268 | else | 3268 | else |
3269 | { | 3269 | { |
3270 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); | 3270 | key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile); |
3271 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 3271 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
3272 | local_shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 3272 | local_shorten_zone = GNUNET_malloc (sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
3273 | GNUNET_CRYPTO_short_hash (&pkey, | 3273 | GNUNET_CRYPTO_short_hash (&pkey, |
3274 | sizeof(struct GNUNET_CRYPTO_EccPublicKey), | 3274 | sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), |
3275 | local_shorten_zone); | 3275 | local_shorten_zone); |
3276 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); | 3276 | GNUNET_CRYPTO_short_hash_to_enc (zone, &zonename); |
3277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3277 | 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, | |||
180 | * @param shorten_key private key used for shortening, can be NULL | 180 | * @param shorten_key private key used for shortening, can be NULL |
181 | */ | 181 | */ |
182 | static void | 182 | static void |
183 | lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicKey *pkey, | 183 | lookup_with_keys (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey, |
184 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key) | 184 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key) |
185 | { | 185 | { |
186 | if (NULL != lookup_type) | 186 | if (NULL != lookup_type) |
@@ -227,7 +227,7 @@ identity_shorten_cb (void *cls, | |||
227 | void **ctx, | 227 | void **ctx, |
228 | const char *name) | 228 | const char *name) |
229 | { | 229 | { |
230 | struct GNUNET_CRYPTO_EccPublicKey *pkeym = cls; | 230 | struct GNUNET_CRYPTO_EccPublicSignKey *pkeym = cls; |
231 | 231 | ||
232 | id_op = NULL; | 232 | id_op = NULL; |
233 | if (NULL == ego) | 233 | if (NULL == ego) |
@@ -246,12 +246,12 @@ identity_shorten_cb (void *cls, | |||
246 | * @param pkey public key to use for the zone | 246 | * @param pkey public key to use for the zone |
247 | */ | 247 | */ |
248 | static void | 248 | static void |
249 | lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pkey) | 249 | lookup_with_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey) |
250 | { | 250 | { |
251 | struct GNUNET_CRYPTO_EccPublicKey *pkeym; | 251 | struct GNUNET_CRYPTO_EccPublicSignKey *pkeym; |
252 | 252 | ||
253 | GNUNET_assert (NULL != pkey); | 253 | GNUNET_assert (NULL != pkey); |
254 | pkeym = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey); | 254 | pkeym = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey); |
255 | *pkeym = *pkey; | 255 | *pkeym = *pkey; |
256 | id_op = GNUNET_IDENTITY_get (identity, | 256 | id_op = GNUNET_IDENTITY_get (identity, |
257 | "shorten-zone", | 257 | "shorten-zone", |
@@ -276,7 +276,7 @@ static void | |||
276 | identity_zone_cb (void *cls, | 276 | identity_zone_cb (void *cls, |
277 | const struct GNUNET_IDENTITY_Ego *ego) | 277 | const struct GNUNET_IDENTITY_Ego *ego) |
278 | { | 278 | { |
279 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 279 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
280 | 280 | ||
281 | el = NULL; | 281 | el = NULL; |
282 | if (NULL == ego) | 282 | if (NULL == ego) |
@@ -314,7 +314,7 @@ identity_master_cb (void *cls, | |||
314 | void **ctx, | 314 | void **ctx, |
315 | const char *name) | 315 | const char *name) |
316 | { | 316 | { |
317 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 317 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
318 | 318 | ||
319 | id_op = NULL; | 319 | id_op = NULL; |
320 | if (NULL == ego) | 320 | if (NULL == ego) |
@@ -341,7 +341,7 @@ static void | |||
341 | run (void *cls, char *const *args, const char *cfgfile, | 341 | run (void *cls, char *const *args, const char *cfgfile, |
342 | const struct GNUNET_CONFIGURATION_Handle *c) | 342 | const struct GNUNET_CONFIGURATION_Handle *c) |
343 | { | 343 | { |
344 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 344 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
345 | 345 | ||
346 | cfg = c; | 346 | cfg = c; |
347 | gns = GNUNET_GNS_connect (cfg); | 347 | gns = GNUNET_GNS_connect (cfg); |
@@ -357,7 +357,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
357 | if (NULL != public_key) | 357 | if (NULL != public_key) |
358 | { | 358 | { |
359 | if (GNUNET_OK != | 359 | if (GNUNET_OK != |
360 | GNUNET_CRYPTO_ecc_public_key_from_string (public_key, | 360 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (public_key, |
361 | strlen (public_key), | 361 | strlen (public_key), |
362 | &pkey)) | 362 | &pkey)) |
363 | { | 363 | { |
@@ -384,7 +384,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
384 | &lookup_name[strlen (lookup_name) - 4])) ) | 384 | &lookup_name[strlen (lookup_name) - 4])) ) |
385 | { | 385 | { |
386 | /* no zone required, use 'anonymous' zone */ | 386 | /* no zone required, use 'anonymous' zone */ |
387 | GNUNET_CRYPTO_ecc_key_get_public (GNUNET_CRYPTO_ecc_key_get_anonymous (), | 387 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (GNUNET_CRYPTO_ecc_key_get_anonymous (), |
388 | &pkey); | 388 | &pkey); |
389 | lookup_with_public_key (&pkey); | 389 | lookup_with_public_key (&pkey); |
390 | } | 390 | } |
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, | |||
419 | rd_public_count); | 419 | rd_public_count); |
420 | block_size = ntohl (block->purpose.size) | 420 | block_size = ntohl (block->purpose.size) |
421 | + sizeof (struct GNUNET_CRYPTO_EccSignature) | 421 | + sizeof (struct GNUNET_CRYPTO_EccSignature) |
422 | + sizeof (struct GNUNET_CRYPTO_EccPublicKey); | 422 | + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); |
423 | GNUNET_NAMESTORE_query_from_private_key (key, | 423 | GNUNET_NAMESTORE_query_from_private_key (key, |
424 | name, | 424 | name, |
425 | &query); | 425 | &query); |
@@ -635,7 +635,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
635 | { &handle_lookup, NULL, GNUNET_MESSAGE_TYPE_GNS_LOOKUP, 0}, | 635 | { &handle_lookup, NULL, GNUNET_MESSAGE_TYPE_GNS_LOOKUP, 0}, |
636 | {NULL, NULL, 0, 0} | 636 | {NULL, NULL, 0, 0} |
637 | }; | 637 | }; |
638 | struct GNUNET_CRYPTO_EccPublicKey dns_root; | 638 | struct GNUNET_CRYPTO_EccPublicSignKey dns_root; |
639 | unsigned long long max_parallel_bg_queries = 0; | 639 | unsigned long long max_parallel_bg_queries = 0; |
640 | char *dns_root_name; | 640 | char *dns_root_name; |
641 | 641 | ||
@@ -699,7 +699,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
699 | &dns_root_name)) | 699 | &dns_root_name)) |
700 | { | 700 | { |
701 | if (GNUNET_OK != | 701 | if (GNUNET_OK != |
702 | GNUNET_CRYPTO_ecc_public_key_from_string (dns_root_name, | 702 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (dns_root_name, |
703 | strlen (dns_root_name), | 703 | strlen (dns_root_name), |
704 | &dns_root)) | 704 | &dns_root)) |
705 | { | 705 | { |
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; | |||
75 | /** | 75 | /** |
76 | * Key of the zone we start lookups in. | 76 | * Key of the zone we start lookups in. |
77 | */ | 77 | */ |
78 | static struct GNUNET_CRYPTO_EccPublicKey zone; | 78 | static struct GNUNET_CRYPTO_EccPublicSignKey zone; |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Head of the DLL. | 81 | * Head of the DLL. |
@@ -291,7 +291,7 @@ handle_dns_request (void *cls, | |||
291 | * @return GNUNET_OK on success | 291 | * @return GNUNET_OK on success |
292 | */ | 292 | */ |
293 | int | 293 | int |
294 | GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicKey *gnu_zone, | 294 | GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone, |
295 | const struct GNUNET_CONFIGURATION_Handle *c) | 295 | const struct GNUNET_CONFIGURATION_Handle *c) |
296 | { | 296 | { |
297 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 297 | 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 @@ | |||
36 | * @return GNUNET_YES on success GNUNET_SYSERR on error | 36 | * @return GNUNET_YES on success GNUNET_SYSERR on error |
37 | */ | 37 | */ |
38 | int | 38 | int |
39 | GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicKey *gnu_zone, | 39 | GNS_interceptor_init (const struct GNUNET_CRYPTO_EccPublicSignKey *gnu_zone, |
40 | const struct GNUNET_CONFIGURATION_Handle *c); | 40 | const struct GNUNET_CONFIGURATION_Handle *c); |
41 | 41 | ||
42 | /** | 42 | /** |
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 | |||
112 | /** | 112 | /** |
113 | * The zone of the GNS authority | 113 | * The zone of the GNS authority |
114 | */ | 114 | */ |
115 | struct GNUNET_CRYPTO_EccPublicKey gns_authority; | 115 | struct GNUNET_CRYPTO_EccPublicSignKey gns_authority; |
116 | 116 | ||
117 | struct | 117 | struct |
118 | { | 118 | { |
@@ -230,7 +230,7 @@ struct GNS_ResolverHandle | |||
230 | /** | 230 | /** |
231 | * The top-level GNS authoritative zone to query | 231 | * The top-level GNS authoritative zone to query |
232 | */ | 232 | */ |
233 | struct GNUNET_CRYPTO_EccPublicKey authority_zone; | 233 | struct GNUNET_CRYPTO_EccPublicSignKey authority_zone; |
234 | 234 | ||
235 | /** | 235 | /** |
236 | * called when resolution phase finishes | 236 | * called when resolution phase finishes |
@@ -1317,9 +1317,9 @@ handle_gns_resolution_result (void *cls, | |||
1317 | /* tigger shortening */ | 1317 | /* tigger shortening */ |
1318 | if (NULL != rh->shorten_key) | 1318 | if (NULL != rh->shorten_key) |
1319 | { | 1319 | { |
1320 | struct GNUNET_CRYPTO_EccPublicKey pub; | 1320 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
1321 | 1321 | ||
1322 | if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EccPublicKey)) | 1322 | if (rd[i].data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) |
1323 | { | 1323 | { |
1324 | GNUNET_break_op (0); | 1324 | GNUNET_break_op (0); |
1325 | break; | 1325 | break; |
@@ -1346,7 +1346,7 @@ handle_gns_resolution_result (void *cls, | |||
1346 | { | 1346 | { |
1347 | case GNUNET_NAMESTORE_TYPE_PKEY: | 1347 | case GNUNET_NAMESTORE_TYPE_PKEY: |
1348 | /* delegation to another zone */ | 1348 | /* delegation to another zone */ |
1349 | if (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != | 1349 | if (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != |
1350 | rd[i].data_size) | 1350 | rd[i].data_size) |
1351 | { | 1351 | { |
1352 | GNUNET_break_op (0); | 1352 | GNUNET_break_op (0); |
@@ -1360,7 +1360,7 @@ handle_gns_resolution_result (void *cls, | |||
1360 | ac->gns_authority = GNUNET_YES; | 1360 | ac->gns_authority = GNUNET_YES; |
1361 | memcpy (&ac->authority_info.gns_authority, | 1361 | memcpy (&ac->authority_info.gns_authority, |
1362 | rd[i].data, | 1362 | rd[i].data, |
1363 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 1363 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
1364 | ac->label = resolver_lookup_get_next_label (rh); | 1364 | ac->label = resolver_lookup_get_next_label (rh); |
1365 | /* tigger shortening */ | 1365 | /* tigger shortening */ |
1366 | if (NULL != rh->shorten_key) | 1366 | if (NULL != rh->shorten_key) |
@@ -1572,7 +1572,7 @@ handle_dht_response (void *cls, | |||
1572 | block = data; | 1572 | block = data; |
1573 | if (size != | 1573 | if (size != |
1574 | ntohs (block->purpose.size) + | 1574 | ntohs (block->purpose.size) + |
1575 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 1575 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
1576 | sizeof (struct GNUNET_CRYPTO_EccSignature)) | 1576 | sizeof (struct GNUNET_CRYPTO_EccSignature)) |
1577 | { | 1577 | { |
1578 | /* how did this pass DHT block validation!? */ | 1578 | /* how did this pass DHT block validation!? */ |
@@ -1615,7 +1615,7 @@ handle_namestore_block_response (void *cls, | |||
1615 | struct GNS_ResolverHandle *rx; | 1615 | struct GNS_ResolverHandle *rx; |
1616 | struct AuthorityChain *ac = rh->ac_tail; | 1616 | struct AuthorityChain *ac = rh->ac_tail; |
1617 | const char *label = ac->label; | 1617 | const char *label = ac->label; |
1618 | const struct GNUNET_CRYPTO_EccPublicKey *auth = &ac->authority_info.gns_authority; | 1618 | const struct GNUNET_CRYPTO_EccPublicSignKey *auth = &ac->authority_info.gns_authority; |
1619 | struct GNUNET_HashCode query; | 1619 | struct GNUNET_HashCode query; |
1620 | 1620 | ||
1621 | GNUNET_NAMESTORE_query_from_public_key (auth, | 1621 | GNUNET_NAMESTORE_query_from_public_key (auth, |
@@ -1774,7 +1774,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) | |||
1774 | if ( (NULL == x) || | 1774 | if ( (NULL == x) || |
1775 | (NULL == y) || | 1775 | (NULL == y) || |
1776 | (GNUNET_OK != | 1776 | (GNUNET_OK != |
1777 | GNUNET_CRYPTO_ecc_public_key_from_string (pkey, | 1777 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (pkey, |
1778 | strlen (pkey), | 1778 | strlen (pkey), |
1779 | &rh->authority_zone)) ) | 1779 | &rh->authority_zone)) ) |
1780 | { | 1780 | { |
@@ -1822,7 +1822,7 @@ start_resolver_lookup (struct GNS_ResolverHandle *rh) | |||
1822 | * @return handle to cancel operation | 1822 | * @return handle to cancel operation |
1823 | */ | 1823 | */ |
1824 | struct GNS_ResolverHandle * | 1824 | struct GNS_ResolverHandle * |
1825 | GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicKey *zone, | 1825 | GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, |
1826 | uint32_t record_type, | 1826 | uint32_t record_type, |
1827 | const char *name, | 1827 | const char *name, |
1828 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, | 1828 | 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, | |||
83 | * @return handle to cancel operation | 83 | * @return handle to cancel operation |
84 | */ | 84 | */ |
85 | struct GNS_ResolverHandle * | 85 | struct GNS_ResolverHandle * |
86 | GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicKey *zone, | 86 | GNS_resolver_lookup (const struct GNUNET_CRYPTO_EccPublicSignKey *zone, |
87 | uint32_t record_type, | 87 | uint32_t record_type, |
88 | const char *name, | 88 | const char *name, |
89 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_key, | 89 | 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 | |||
80 | /** | 80 | /** |
81 | * The zone for which we are trying to find the PSEU record. | 81 | * The zone for which we are trying to find the PSEU record. |
82 | */ | 82 | */ |
83 | struct GNUNET_CRYPTO_EccPublicKey target_zone; | 83 | struct GNUNET_CRYPTO_EccPublicSignKey target_zone; |
84 | 84 | ||
85 | /** | 85 | /** |
86 | * Handle for DHT lookups. Should be NULL if no lookups are in progress | 86 | * Handle for DHT lookups. Should be NULL if no lookups are in progress |
@@ -195,7 +195,7 @@ process_pseu_block_ns (void *cls, | |||
195 | const struct GNUNET_NAMESTORE_Block *block) | 195 | const struct GNUNET_NAMESTORE_Block *block) |
196 | { | 196 | { |
197 | struct GetPseuAuthorityHandle *gph = cls; | 197 | struct GetPseuAuthorityHandle *gph = cls; |
198 | struct GNUNET_CRYPTO_EccPublicKey pub; | 198 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
199 | 199 | ||
200 | gph->namestore_task = NULL; | 200 | gph->namestore_task = NULL; |
201 | if (NULL == block) | 201 | if (NULL == block) |
@@ -203,7 +203,7 @@ process_pseu_block_ns (void *cls, | |||
203 | process_pseu_lookup_ns (gph, 0, NULL); | 203 | process_pseu_lookup_ns (gph, 0, NULL); |
204 | return; | 204 | return; |
205 | } | 205 | } |
206 | GNUNET_CRYPTO_ecc_key_get_public (&gph->shorten_zone_key, | 206 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, |
207 | &pub); | 207 | &pub); |
208 | if (GNUNET_OK != | 208 | if (GNUNET_OK != |
209 | GNUNET_NAMESTORE_block_decrypt (block, | 209 | GNUNET_NAMESTORE_block_decrypt (block, |
@@ -229,10 +229,10 @@ static void | |||
229 | perform_pseu_lookup (struct GetPseuAuthorityHandle *gph, | 229 | perform_pseu_lookup (struct GetPseuAuthorityHandle *gph, |
230 | const char *label) | 230 | const char *label) |
231 | { | 231 | { |
232 | struct GNUNET_CRYPTO_EccPublicKey pub; | 232 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
233 | struct GNUNET_HashCode query; | 233 | struct GNUNET_HashCode query; |
234 | 234 | ||
235 | GNUNET_CRYPTO_ecc_key_get_public (&gph->shorten_zone_key, | 235 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, |
236 | &pub); | 236 | &pub); |
237 | GNUNET_free_non_null (gph->current_label); | 237 | GNUNET_free_non_null (gph->current_label); |
238 | gph->current_label = GNUNET_strdup (label); | 238 | gph->current_label = GNUNET_strdup (label); |
@@ -287,7 +287,7 @@ process_pseu_lookup_ns (void *cls, | |||
287 | GNUNET_NAMESTORE_z2s (&gph->target_zone), | 287 | GNUNET_NAMESTORE_z2s (&gph->target_zone), |
288 | gph->current_label); | 288 | gph->current_label); |
289 | new_pkey.expiration_time = UINT64_MAX; | 289 | new_pkey.expiration_time = UINT64_MAX; |
290 | new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey); | 290 | new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); |
291 | new_pkey.data = &gph->target_zone; | 291 | new_pkey.data = &gph->target_zone; |
292 | new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY; | 292 | new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
293 | new_pkey.flags = GNUNET_NAMESTORE_RF_NONE | 293 | new_pkey.flags = GNUNET_NAMESTORE_RF_NONE |
@@ -431,7 +431,7 @@ process_auth_discovery_dht_result (void* cls, | |||
431 | block = data; | 431 | block = data; |
432 | if (size != | 432 | if (size != |
433 | ntohs (block->purpose.size) + | 433 | ntohs (block->purpose.size) + |
434 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 434 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
435 | sizeof (struct GNUNET_CRYPTO_EccSignature)) | 435 | sizeof (struct GNUNET_CRYPTO_EccSignature)) |
436 | { | 436 | { |
437 | /* how did this pass DHT block validation!? */ | 437 | /* how did this pass DHT block validation!? */ |
@@ -513,7 +513,7 @@ process_zone_to_name_discover (void *cls, | |||
513 | */ | 513 | */ |
514 | void | 514 | void |
515 | GNS_shorten_start (const char *original_label, | 515 | GNS_shorten_start (const char *original_label, |
516 | const struct GNUNET_CRYPTO_EccPublicKey *pub, | 516 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
517 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone) | 517 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone) |
518 | { | 518 | { |
519 | struct GetPseuAuthorityHandle *gph; | 519 | 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); | |||
59 | */ | 59 | */ |
60 | void | 60 | void |
61 | GNS_shorten_start (const char *original_label, | 61 | GNS_shorten_start (const char *original_label, |
62 | const struct GNUNET_CRYPTO_EccPublicKey *pub, | 62 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
63 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone); | 63 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone); |
64 | 64 | ||
65 | 65 | ||
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, | |||
85 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 85 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
86 | } | 86 | } |
87 | block = reply_block; | 87 | block = reply_block; |
88 | if (ntohs (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) + sizeof (struct GNUNET_CRYPTO_EccPublicKey) != | 88 | if (ntohs (block->purpose.size) + sizeof (struct GNUNET_CRYPTO_EccSignature) + sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != |
89 | reply_block_size) | 89 | reply_block_size) |
90 | { | 90 | { |
91 | GNUNET_break_op (0); | 91 | 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, | |||
334 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 334 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
335 | struct GNUNET_TESTING_Peer *peer) | 335 | struct GNUNET_TESTING_Peer *peer) |
336 | { | 336 | { |
337 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 337 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
338 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 338 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
339 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 339 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
340 | char* alice_keyfile; | 340 | char* alice_keyfile; |
@@ -366,7 +366,7 @@ do_check (void *cls, | |||
366 | } | 366 | } |
367 | 367 | ||
368 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 368 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
369 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 369 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
370 | GNUNET_free(alice_keyfile); | 370 | GNUNET_free(alice_keyfile); |
371 | 371 | ||
372 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 372 | 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; | |||
65 | 65 | ||
66 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 66 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
67 | 67 | ||
68 | static struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 68 | static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
69 | static struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 69 | static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
70 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 70 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
71 | static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 71 | static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
72 | 72 | ||
@@ -262,7 +262,7 @@ put_dht(void *cls, int32_t success, const char *emsg) | |||
262 | } | 262 | } |
263 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); | 263 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); |
264 | GNUNET_CRYPTO_short_hash(&bob_pkey, | 264 | GNUNET_CRYPTO_short_hash(&bob_pkey, |
265 | sizeof(struct GNUNET_CRYPTO_EccPublicKey), | 265 | sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), |
266 | &zone_hash); | 266 | &zone_hash); |
267 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); | 267 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); |
268 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 268 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -335,8 +335,8 @@ do_check (void *cls, | |||
335 | 335 | ||
336 | GNUNET_free(alice_keyfile); | 336 | GNUNET_free(alice_keyfile); |
337 | 337 | ||
338 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 338 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
339 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 339 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
340 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); | 340 | GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash); |
341 | 341 | ||
342 | struct GNUNET_NAMESTORE_RecordData rd; | 342 | 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) | |||
312 | { | 312 | { |
313 | char* keyfile; | 313 | char* keyfile; |
314 | struct GNUNET_CRYPTO_EccPrivateKey *key; | 314 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
315 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 315 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
316 | struct in_addr *web; | 316 | struct in_addr *web; |
317 | struct GNUNET_NAMESTORE_RecordData rd; | 317 | struct GNUNET_NAMESTORE_RecordData rd; |
318 | 318 | ||
@@ -344,7 +344,7 @@ setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
344 | return GNUNET_SYSERR; | 344 | return GNUNET_SYSERR; |
345 | } | 345 | } |
346 | 346 | ||
347 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 347 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
348 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &dave_hash); | 348 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &dave_hash); |
349 | 349 | ||
350 | rd.expiration_time = UINT64_MAX; | 350 | rd.expiration_time = UINT64_MAX; |
@@ -383,7 +383,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
383 | { | 383 | { |
384 | char* keyfile; | 384 | char* keyfile; |
385 | struct GNUNET_CRYPTO_EccPrivateKey *key; | 385 | struct GNUNET_CRYPTO_EccPrivateKey *key; |
386 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 386 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
387 | struct GNUNET_NAMESTORE_RecordData rd; | 387 | struct GNUNET_NAMESTORE_RecordData rd; |
388 | 388 | ||
389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n"); | 389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n"); |
@@ -415,7 +415,7 @@ setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg) | |||
415 | return GNUNET_SYSERR; | 415 | return GNUNET_SYSERR; |
416 | } | 416 | } |
417 | 417 | ||
418 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 418 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
419 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &bob_hash); | 419 | GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &bob_hash); |
420 | 420 | ||
421 | rd.expiration_time = UINT64_MAX; | 421 | 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, | |||
252 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 252 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
253 | struct GNUNET_TESTING_Peer *peer) | 253 | struct GNUNET_TESTING_Peer *peer) |
254 | { | 254 | { |
255 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 255 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
256 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 256 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
257 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 257 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
258 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 258 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
259 | char* alice_keyfile; | 259 | char* alice_keyfile; |
@@ -295,8 +295,8 @@ do_check (void *cls, | |||
295 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 295 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
296 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 296 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
297 | 297 | ||
298 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 298 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
299 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 299 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
300 | 300 | ||
301 | GNUNET_free(alice_keyfile); | 301 | GNUNET_free(alice_keyfile); |
302 | 302 | ||
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, | |||
563 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 563 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
564 | struct GNUNET_TESTING_Peer *peer) | 564 | struct GNUNET_TESTING_Peer *peer) |
565 | { | 565 | { |
566 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 566 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
567 | char* alice_keyfile; | 567 | char* alice_keyfile; |
568 | struct GNUNET_NAMESTORE_RecordData rd[2]; | 568 | struct GNUNET_NAMESTORE_RecordData rd[2]; |
569 | struct in_addr ns; | 569 | struct in_addr ns; |
@@ -593,7 +593,7 @@ do_check (void *cls, | |||
593 | } | 593 | } |
594 | 594 | ||
595 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 595 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
596 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 596 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
597 | GNUNET_free (alice_keyfile); | 597 | GNUNET_free (alice_keyfile); |
598 | 598 | ||
599 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 599 | 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; | |||
69 | 69 | ||
70 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 70 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
71 | 71 | ||
72 | static struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 72 | static struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
73 | static struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 73 | static struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
74 | static struct GNUNET_CRYPTO_EccPublicKey our_pkey; | 74 | static struct GNUNET_CRYPTO_EccPublicSignKey our_pkey; |
75 | static struct GNUNET_CRYPTO_EccPublicKey priv_pkey; | 75 | static struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey; |
76 | static struct GNUNET_CRYPTO_EccPublicKey short_pkey; | 76 | static struct GNUNET_CRYPTO_EccPublicSignKey short_pkey; |
77 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 77 | static struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
78 | static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 78 | static struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
79 | static struct GNUNET_CRYPTO_EccPrivateKey *our_key; | 79 | static struct GNUNET_CRYPTO_EccPrivateKey *our_key; |
@@ -316,7 +316,7 @@ put_pseu_dht (void *cls, int success) | |||
316 | } | 316 | } |
317 | GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash); | 317 | GNUNET_CRYPTO_short_hash(GNUNET_GNS_MASTERZONE_STR, strlen(GNUNET_GNS_MASTERZONE_STR), &name_hash); |
318 | GNUNET_CRYPTO_short_hash(&alice_pkey, | 318 | GNUNET_CRYPTO_short_hash(&alice_pkey, |
319 | sizeof(struct GNUNET_CRYPTO_EccPublicKey), | 319 | sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), |
320 | &zone_hash); | 320 | &zone_hash); |
321 | 321 | ||
322 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 322 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -405,7 +405,7 @@ put_www_dht (void *cls, int success) | |||
405 | } | 405 | } |
406 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); | 406 | GNUNET_CRYPTO_short_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash); |
407 | GNUNET_CRYPTO_short_hash(&alice_pkey, | 407 | GNUNET_CRYPTO_short_hash(&alice_pkey, |
408 | sizeof(struct GNUNET_CRYPTO_EccPublicKey), | 408 | sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), |
409 | &zone_hash); | 409 | &zone_hash); |
410 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); | 410 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); |
411 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 411 | 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) | |||
488 | GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE, | 488 | GNUNET_CRYPTO_short_hash (TEST_AUTHORITY_ALICE, |
489 | strlen (TEST_AUTHORITY_ALICE), &name_hash); | 489 | strlen (TEST_AUTHORITY_ALICE), &name_hash); |
490 | GNUNET_CRYPTO_short_hash (&bob_pkey, | 490 | GNUNET_CRYPTO_short_hash (&bob_pkey, |
491 | sizeof(struct GNUNET_CRYPTO_EccPublicKey), | 491 | sizeof(struct GNUNET_CRYPTO_EccPublicSignKey), |
492 | &zone_hash); | 492 | &zone_hash); |
493 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); | 493 | GNUNET_CRYPTO_short_hash_double(&zone_hash, &zone_hash_double); |
494 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); | 494 | GNUNET_CRYPTO_short_hash_double(&name_hash, &name_hash_double); |
@@ -626,11 +626,11 @@ do_check (void *cls, | |||
626 | GNUNET_free (shorten_keyfile); | 626 | GNUNET_free (shorten_keyfile); |
627 | GNUNET_free (private_keyfile); | 627 | GNUNET_free (private_keyfile); |
628 | 628 | ||
629 | GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); | 629 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey); |
630 | GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey); | 630 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey); |
631 | GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey); | 631 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey); |
632 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 632 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
633 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 633 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
634 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); | 634 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); |
635 | GNUNET_CRYPTO_short_hash (&alice_pkey, sizeof(alice_pkey), &alice_hash); | 635 | GNUNET_CRYPTO_short_hash (&alice_pkey, sizeof(alice_pkey), &alice_hash); |
636 | GNUNET_CRYPTO_short_hash (&our_pkey, sizeof(our_pkey), &our_zone); | 636 | 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, | |||
181 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 181 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
182 | struct GNUNET_TESTING_Peer *peer) | 182 | struct GNUNET_TESTING_Peer *peer) |
183 | { | 183 | { |
184 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 184 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
185 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 185 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
186 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 186 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
187 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 187 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
188 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 188 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
@@ -213,8 +213,8 @@ do_check (void *cls, | |||
213 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 213 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
214 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 214 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
215 | 215 | ||
216 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 216 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
217 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 217 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
218 | 218 | ||
219 | struct GNUNET_NAMESTORE_RecordData rd; | 219 | struct GNUNET_NAMESTORE_RecordData rd; |
220 | char* ip = TEST_IP; | 220 | 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, | |||
189 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 189 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
190 | struct GNUNET_TESTING_Peer *peer) | 190 | struct GNUNET_TESTING_Peer *peer) |
191 | { | 191 | { |
192 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 192 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
193 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 193 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
194 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 194 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
195 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 195 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
196 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 196 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
@@ -225,8 +225,8 @@ do_check (void *cls, | |||
225 | } | 225 | } |
226 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 226 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
227 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 227 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
228 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 228 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
229 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 229 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
230 | rd.expiration_time = UINT64_MAX; | 230 | rd.expiration_time = UINT64_MAX; |
231 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); | 231 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); |
232 | GNUNET_CRYPTO_short_hash (&bob_pkey, sizeof(bob_pkey), &bob_hash); | 232 | 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, | |||
221 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 221 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
222 | struct GNUNET_TESTING_Peer *peer) | 222 | struct GNUNET_TESTING_Peer *peer) |
223 | { | 223 | { |
224 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 224 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
225 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 225 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
226 | struct GNUNET_NAMESTORE_RecordData rd; | 226 | struct GNUNET_NAMESTORE_RecordData rd; |
227 | char* alice_keyfile; | 227 | char* alice_keyfile; |
@@ -252,7 +252,7 @@ do_check (void *cls, | |||
252 | } | 252 | } |
253 | 253 | ||
254 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 254 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
255 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 255 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
256 | GNUNET_free (alice_keyfile); | 256 | GNUNET_free (alice_keyfile); |
257 | rd.expiration_time = UINT64_MAX; | 257 | rd.expiration_time = UINT64_MAX; |
258 | GNUNET_assert (1 == inet_pton (AF_INET, ip, &web)); | 258 | 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, | |||
180 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 180 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
181 | struct GNUNET_TESTING_Peer *peer) | 181 | struct GNUNET_TESTING_Peer *peer) |
182 | { | 182 | { |
183 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 183 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
184 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 184 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
185 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 185 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
186 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 186 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 187 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
@@ -213,8 +213,8 @@ do_check (void *cls, | |||
213 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 213 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
214 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 214 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
215 | 215 | ||
216 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 216 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
217 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 217 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
218 | 218 | ||
219 | struct GNUNET_NAMESTORE_RecordData rd; | 219 | struct GNUNET_NAMESTORE_RecordData rd; |
220 | char* ip = TEST_IP; | 220 | 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; | |||
61 | 61 | ||
62 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 62 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
63 | 63 | ||
64 | struct GNUNET_CRYPTO_EccPublicKey priv_pkey; | 64 | struct GNUNET_CRYPTO_EccPublicSignKey priv_pkey; |
65 | struct GNUNET_CRYPTO_EccPublicKey short_pkey; | 65 | struct GNUNET_CRYPTO_EccPublicSignKey short_pkey; |
66 | struct GNUNET_CRYPTO_EccPrivateKey *priv_key; | 66 | struct GNUNET_CRYPTO_EccPrivateKey *priv_key; |
67 | struct GNUNET_CRYPTO_EccPrivateKey *short_key; | 67 | struct GNUNET_CRYPTO_EccPrivateKey *short_key; |
68 | 68 | ||
@@ -170,9 +170,9 @@ void do_check (void *cls, | |||
170 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 170 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
171 | struct GNUNET_TESTING_Peer *peer) | 171 | struct GNUNET_TESTING_Peer *peer) |
172 | { | 172 | { |
173 | struct GNUNET_CRYPTO_EccPublicKey our_pkey; | 173 | struct GNUNET_CRYPTO_EccPublicSignKey our_pkey; |
174 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 174 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
175 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 175 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
176 | struct GNUNET_CRYPTO_EccPrivateKey *our_key; | 176 | struct GNUNET_CRYPTO_EccPrivateKey *our_key; |
177 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 177 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
178 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 178 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
@@ -237,11 +237,11 @@ void do_check (void *cls, | |||
237 | GNUNET_free(shorten_keyfile); | 237 | GNUNET_free(shorten_keyfile); |
238 | GNUNET_free(private_keyfile); | 238 | GNUNET_free(private_keyfile); |
239 | 239 | ||
240 | GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey); | 240 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (our_key, &our_pkey); |
241 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 241 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
242 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 242 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
243 | GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey); | 243 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv_key, &priv_pkey); |
244 | GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey); | 244 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (short_key, &short_pkey); |
245 | 245 | ||
246 | GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone); | 246 | GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone); |
247 | GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone); | 247 | 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, | |||
182 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 182 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
183 | struct GNUNET_TESTING_Peer *peer) | 183 | struct GNUNET_TESTING_Peer *peer) |
184 | { | 184 | { |
185 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 185 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
186 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 186 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
187 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 187 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
188 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 188 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
189 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; | 189 | struct GNUNET_CRYPTO_ShortHashCode bob_hash; |
@@ -216,8 +216,8 @@ do_check (void *cls, | |||
216 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 216 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
217 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 217 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
218 | 218 | ||
219 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 219 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
220 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 220 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
221 | 221 | ||
222 | struct GNUNET_NAMESTORE_RecordData rd; | 222 | struct GNUNET_NAMESTORE_RecordData rd; |
223 | char* ip = TEST_IP; | 223 | 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, | |||
199 | const struct GNUNET_CONFIGURATION_Handle *ccfg, | 199 | const struct GNUNET_CONFIGURATION_Handle *ccfg, |
200 | struct GNUNET_TESTING_Peer *peer) | 200 | struct GNUNET_TESTING_Peer *peer) |
201 | { | 201 | { |
202 | struct GNUNET_CRYPTO_EccPublicKey alice_pkey; | 202 | struct GNUNET_CRYPTO_EccPublicSignKey alice_pkey; |
203 | struct GNUNET_CRYPTO_EccPublicKey bob_pkey; | 203 | struct GNUNET_CRYPTO_EccPublicSignKey bob_pkey; |
204 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; | 204 | struct GNUNET_CRYPTO_EccPrivateKey *alice_key; |
205 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; | 205 | struct GNUNET_CRYPTO_EccPrivateKey *bob_key; |
206 | struct GNUNET_CRYPTO_EccSignature *sig; | 206 | struct GNUNET_CRYPTO_EccSignature *sig; |
@@ -230,8 +230,8 @@ do_check (void *cls, | |||
230 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); | 230 | alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (alice_keyfile); |
231 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); | 231 | bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB); |
232 | 232 | ||
233 | GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey); | 233 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (alice_key, &alice_pkey); |
234 | GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey); | 234 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (bob_key, &bob_pkey); |
235 | 235 | ||
236 | struct GNUNET_NAMESTORE_RecordData rd; | 236 | struct GNUNET_NAMESTORE_RecordData rd; |
237 | char* ip = TEST_IP; | 237 | 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[]) | |||
111 | struct GNUNET_DISK_FileHandle *fh; | 111 | struct GNUNET_DISK_FileHandle *fh; |
112 | struct GNUNET_HELLO_Message *orig; | 112 | struct GNUNET_HELLO_Message *orig; |
113 | struct GNUNET_HELLO_Message *result; | 113 | struct GNUNET_HELLO_Message *result; |
114 | struct GNUNET_CRYPTO_EccPublicKey pk; | 114 | struct GNUNET_CRYPTO_EccPublicSignKey pk; |
115 | uint64_t fsize; | 115 | uint64_t fsize; |
116 | address_count = 0; | 116 | address_count = 0; |
117 | 117 | ||
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 | |||
59 | /** | 59 | /** |
60 | * The public key of the peer. | 60 | * The public key of the peer. |
61 | */ | 61 | */ |
62 | struct GNUNET_CRYPTO_EccPublicKey publicKey; | 62 | struct GNUNET_CRYPTO_EccPublicSignKey publicKey; |
63 | 63 | ||
64 | }; | 64 | }; |
65 | GNUNET_NETWORK_STRUCT_END | 65 | GNUNET_NETWORK_STRUCT_END |
@@ -216,7 +216,7 @@ get_hello_address_size (const char *buf, size_t max, uint16_t * ralen) | |||
216 | * @return the hello message | 216 | * @return the hello message |
217 | */ | 217 | */ |
218 | struct GNUNET_HELLO_Message * | 218 | struct GNUNET_HELLO_Message * |
219 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, | 219 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey, |
220 | GNUNET_HELLO_GenerateAddressListCallback addrgen, | 220 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
221 | void *addrgen_cls, | 221 | void *addrgen_cls, |
222 | int friend_only) | 222 | int friend_only) |
@@ -247,7 +247,7 @@ GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, | |||
247 | hello->friend_only = htonl (friend_only); | 247 | hello->friend_only = htonl (friend_only); |
248 | 248 | ||
249 | memcpy (&hello->publicKey, publicKey, | 249 | memcpy (&hello->publicKey, publicKey, |
250 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 250 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
251 | memcpy (&hello[1], buffer, used); | 251 | memcpy (&hello[1], buffer, used); |
252 | return hello; | 252 | return hello; |
253 | } | 253 | } |
@@ -295,7 +295,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, | |||
295 | wpos = 0; | 295 | wpos = 0; |
296 | woff = (ret != NULL) ? (char *) &ret[1] : NULL; | 296 | woff = (ret != NULL) ? (char *) &ret[1] : NULL; |
297 | GNUNET_CRYPTO_hash (&msg->publicKey, | 297 | GNUNET_CRYPTO_hash (&msg->publicKey, |
298 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 298 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
299 | &address.peer.hashPubKey); | 299 | &address.peer.hashPubKey); |
300 | while (insize > 0) | 300 | while (insize > 0) |
301 | { | 301 | { |
@@ -530,7 +530,7 @@ GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello) | |||
530 | */ | 530 | */ |
531 | int | 531 | int |
532 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 532 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
533 | struct GNUNET_CRYPTO_EccPublicKey *publicKey) | 533 | struct GNUNET_CRYPTO_EccPublicSignKey *publicKey) |
534 | { | 534 | { |
535 | uint16_t ret = ntohs (hello->header.size); | 535 | uint16_t ret = ntohs (hello->header.size); |
536 | 536 | ||
@@ -559,7 +559,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | |||
559 | (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) | 559 | (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) |
560 | return GNUNET_SYSERR; | 560 | return GNUNET_SYSERR; |
561 | GNUNET_CRYPTO_hash (&hello->publicKey, | 561 | GNUNET_CRYPTO_hash (&hello->publicKey, |
562 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 562 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
563 | &peer->hashPubKey); | 563 | &peer->hashPubKey); |
564 | return GNUNET_OK; | 564 | return GNUNET_OK; |
565 | } | 565 | } |
@@ -671,7 +671,7 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, | |||
671 | 671 | ||
672 | if (0 != | 672 | if (0 != |
673 | memcmp (&h1->publicKey, &h2->publicKey, | 673 | memcmp (&h1->publicKey, &h2->publicKey, |
674 | sizeof (struct GNUNET_CRYPTO_EccPublicKey))) | 674 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) |
675 | return GNUNET_TIME_UNIT_ZERO_ABS; | 675 | return GNUNET_TIME_UNIT_ZERO_ABS; |
676 | ec.expiration_limit = now; | 676 | ec.expiration_limit = now; |
677 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; | 677 | ec.result = GNUNET_TIME_UNIT_FOREVER_ABS; |
@@ -1046,7 +1046,7 @@ add_address_to_hello (void *cls, size_t max, void *buffer) | |||
1046 | */ | 1046 | */ |
1047 | int | 1047 | int |
1048 | GNUNET_HELLO_parse_uri (const char *uri, | 1048 | GNUNET_HELLO_parse_uri (const char *uri, |
1049 | struct GNUNET_CRYPTO_EccPublicKey *pubkey, | 1049 | struct GNUNET_CRYPTO_EccPublicSignKey *pubkey, |
1050 | struct GNUNET_HELLO_Message **hello, | 1050 | struct GNUNET_HELLO_Message **hello, |
1051 | GNUNET_HELLO_TransportPluginsFind plugins_find) | 1051 | GNUNET_HELLO_TransportPluginsFind plugins_find) |
1052 | { | 1052 | { |
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[]) | |||
93 | struct GNUNET_HELLO_Message *msg1; | 93 | struct GNUNET_HELLO_Message *msg1; |
94 | struct GNUNET_HELLO_Message *msg2; | 94 | struct GNUNET_HELLO_Message *msg2; |
95 | struct GNUNET_HELLO_Message *msg3; | 95 | struct GNUNET_HELLO_Message *msg3; |
96 | struct GNUNET_CRYPTO_EccPublicKey publicKey; | 96 | struct GNUNET_CRYPTO_EccPublicSignKey publicKey; |
97 | struct GNUNET_CRYPTO_EccPublicKey pk; | 97 | struct GNUNET_CRYPTO_EccPublicSignKey pk; |
98 | struct GNUNET_TIME_Absolute startup_time; | 98 | struct GNUNET_TIME_Absolute startup_time; |
99 | unsigned int i; | 99 | unsigned int i; |
100 | 100 | ||
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[]) | |||
93 | struct GNUNET_HELLO_Message *msg1; | 93 | struct GNUNET_HELLO_Message *msg1; |
94 | struct GNUNET_HELLO_Message *msg2; | 94 | struct GNUNET_HELLO_Message *msg2; |
95 | struct GNUNET_HELLO_Message *msg3; | 95 | struct GNUNET_HELLO_Message *msg3; |
96 | struct GNUNET_CRYPTO_EccPublicKey publicKey; | 96 | struct GNUNET_CRYPTO_EccPublicSignKey publicKey; |
97 | struct GNUNET_CRYPTO_EccPublicKey pk; | 97 | struct GNUNET_CRYPTO_EccPublicSignKey pk; |
98 | struct GNUNET_TIME_Absolute startup_time; | 98 | struct GNUNET_TIME_Absolute startup_time; |
99 | unsigned int i; | 99 | unsigned int i; |
100 | 100 | ||
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, | |||
226 | void **ctx, | 226 | void **ctx, |
227 | const char *identifier) | 227 | const char *identifier) |
228 | { | 228 | { |
229 | struct GNUNET_CRYPTO_EccPublicKey pk; | 229 | struct GNUNET_CRYPTO_EccPublicSignKey pk; |
230 | char *s; | 230 | char *s; |
231 | 231 | ||
232 | if ( (NULL != set_ego) && | 232 | 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 * | |||
179 | GNUNET_IDENTITY_ego_get_anonymous () | 179 | GNUNET_IDENTITY_ego_get_anonymous () |
180 | { | 180 | { |
181 | static struct GNUNET_IDENTITY_Ego anon; | 181 | static struct GNUNET_IDENTITY_Ego anon; |
182 | struct GNUNET_CRYPTO_EccPublicKey pub; | 182 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
183 | 183 | ||
184 | if (NULL != anon.pk) | 184 | if (NULL != anon.pk) |
185 | return &anon; | 185 | return &anon; |
186 | anon.pk = (struct GNUNET_CRYPTO_EccPrivateKey *) GNUNET_CRYPTO_ecc_key_get_anonymous (); | 186 | anon.pk = (struct GNUNET_CRYPTO_EccPrivateKey *) GNUNET_CRYPTO_ecc_key_get_anonymous (); |
187 | GNUNET_CRYPTO_ecc_key_get_public (anon.pk, | 187 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (anon.pk, |
188 | &pub); | 188 | &pub); |
189 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &anon.id); | 189 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &anon.id); |
190 | return &anon; | 190 | return &anon; |
@@ -249,7 +249,7 @@ message_handler (void *cls, | |||
249 | const struct GNUNET_IDENTITY_ResultCodeMessage *rcm; | 249 | const struct GNUNET_IDENTITY_ResultCodeMessage *rcm; |
250 | const struct GNUNET_IDENTITY_UpdateMessage *um; | 250 | const struct GNUNET_IDENTITY_UpdateMessage *um; |
251 | const struct GNUNET_IDENTITY_SetDefaultMessage *sdm; | 251 | const struct GNUNET_IDENTITY_SetDefaultMessage *sdm; |
252 | struct GNUNET_CRYPTO_EccPublicKey pub; | 252 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
253 | struct GNUNET_HashCode id; | 253 | struct GNUNET_HashCode id; |
254 | const char *str; | 254 | const char *str; |
255 | uint16_t size; | 255 | uint16_t size; |
@@ -326,7 +326,7 @@ message_handler (void *cls, | |||
326 | h->cb (h->cb_cls, NULL, NULL, NULL); | 326 | h->cb (h->cb_cls, NULL, NULL, NULL); |
327 | break; | 327 | break; |
328 | } | 328 | } |
329 | GNUNET_CRYPTO_ecc_key_get_public (&um->private_key, | 329 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&um->private_key, |
330 | &pub); | 330 | &pub); |
331 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id); | 331 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id); |
332 | if (0 == name_len) | 332 | if (0 == name_len) |
@@ -406,7 +406,7 @@ message_handler (void *cls, | |||
406 | } | 406 | } |
407 | /* Note: we know which service this should be for, so we're not | 407 | /* Note: we know which service this should be for, so we're not |
408 | really using 'str' henceforth */ | 408 | really using 'str' henceforth */ |
409 | GNUNET_CRYPTO_ecc_key_get_public (&sdm->private_key, | 409 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&sdm->private_key, |
410 | &pub); | 410 | &pub); |
411 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id); | 411 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id); |
412 | ego = GNUNET_CONTAINER_multihashmap_get (h->egos, | 412 | ego = GNUNET_CONTAINER_multihashmap_get (h->egos, |
@@ -602,9 +602,9 @@ GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego) | |||
602 | */ | 602 | */ |
603 | void | 603 | void |
604 | GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, | 604 | GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, |
605 | struct GNUNET_CRYPTO_EccPublicKey *pk) | 605 | struct GNUNET_CRYPTO_EccPublicSignKey *pk) |
606 | { | 606 | { |
607 | GNUNET_CRYPTO_ecc_key_get_public (ego->pk, | 607 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (ego->pk, |
608 | pk); | 608 | pk); |
609 | } | 609 | } |
610 | 610 | ||
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 | |||
58 | /** | 58 | /** |
59 | * The peer providing this service | 59 | * The peer providing this service |
60 | */ | 60 | */ |
61 | struct GNUNET_CRYPTO_EccPublicKey peer; | 61 | struct GNUNET_CRYPTO_EccPublicSignKey peer; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * The descriptor for the service | 64 | * 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 | |||
58 | /** | 58 | /** |
59 | * Public key used to sign this block. | 59 | * Public key used to sign this block. |
60 | */ | 60 | */ |
61 | struct GNUNET_CRYPTO_EccPublicKey verification_key; | 61 | struct GNUNET_CRYPTO_EccPublicSignKey verification_key; |
62 | 62 | ||
63 | /* rest of the data is encrypted */ | 63 | /* rest of the data is encrypted */ |
64 | 64 | ||
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 | |||
67 | /** | 67 | /** |
68 | * Public key of the peer signing. | 68 | * Public key of the peer signing. |
69 | */ | 69 | */ |
70 | struct GNUNET_CRYPTO_EccPublicKey public_key; | 70 | struct GNUNET_CRYPTO_EccPublicSignKey public_key; |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * The signature. | 73 | * 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 | |||
149 | 149 | ||
150 | /** | 150 | /** |
151 | * Public ECC key (always for NIST P-521) encoded in a format suitable | 151 | * Public ECC key (always for NIST P-521) encoded in a format suitable |
152 | * for network transmission. | 152 | * for network transmission and signatures (ECDSA/EdDSA). |
153 | */ | 153 | */ |
154 | struct GNUNET_CRYPTO_EccPublicKey | 154 | struct GNUNET_CRYPTO_EccPublicSignKey |
155 | { | 155 | { |
156 | /** | 156 | /** |
157 | * Q consists of an x- and a y-value, each mod p (256 bits), | 157 | * Q consists of an x- and a y-value, each mod p (256 bits), |
158 | * given here in affine coordinates. | 158 | * given here in affine coordinates. |
159 | * | ||
160 | * FIXME: this coordinate will be removed in the future (compressed point!). | ||
159 | */ | 161 | */ |
160 | unsigned char q_x[256 / 8]; | 162 | unsigned char q_x[256 / 8]; |
161 | 163 | ||
@@ -169,6 +171,29 @@ struct GNUNET_CRYPTO_EccPublicKey | |||
169 | 171 | ||
170 | 172 | ||
171 | /** | 173 | /** |
174 | * Public ECC key (always for NIST P-521) encoded in a format suitable | ||
175 | * for network transmission and encryption (ECDH). | ||
176 | */ | ||
177 | struct GNUNET_CRYPTO_EccPublicEncryptKey | ||
178 | { | ||
179 | /** | ||
180 | * Q consists of an x- and a y-value, each mod p (256 bits), | ||
181 | * given here in affine coordinates. | ||
182 | */ | ||
183 | unsigned char q_x[256 / 8]; | ||
184 | |||
185 | /** | ||
186 | * Q consists of an x- and a y-value, each mod p (256 bits), | ||
187 | * given here in affine coordinates. | ||
188 | * | ||
189 | * FIXME: this coordinate will be removed in the future (compressed point!). | ||
190 | */ | ||
191 | unsigned char q_y[256 / 8]; | ||
192 | |||
193 | }; | ||
194 | |||
195 | |||
196 | /** | ||
172 | * Private ECC key encoded for transmission. | 197 | * Private ECC key encoded for transmission. |
173 | */ | 198 | */ |
174 | struct GNUNET_CRYPTO_EccPrivateKey | 199 | struct GNUNET_CRYPTO_EccPrivateKey |
@@ -415,11 +440,11 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, | |||
415 | 440 | ||
416 | /** | 441 | /** |
417 | * @ingroup hash | 442 | * @ingroup hash |
418 | * Convert ASCII encoding back to struct GNUNET_HashCode | 443 | * Convert ASCII encoding back to `struct GNUNET_HashCode` |
419 | * | 444 | * |
420 | * @param enc the encoding | 445 | * @param enc the encoding |
421 | * @param result where to store the hash code | 446 | * @param result where to store the hash code |
422 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding | 447 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding |
423 | */ | 448 | */ |
424 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ | 449 | #define GNUNET_CRYPTO_hash_from_string(enc, result) \ |
425 | GNUNET_CRYPTO_hash_from_string2 (enc, strlen(enc), result) | 450 | GNUNET_CRYPTO_hash_from_string2 (enc, strlen(enc), result) |
@@ -495,7 +520,7 @@ struct GNUNET_CRYPTO_FileHashContext; | |||
495 | * @param filename name of file to hash | 520 | * @param filename name of file to hash |
496 | * @param blocksize number of bytes to process in one task | 521 | * @param blocksize number of bytes to process in one task |
497 | * @param callback function to call upon completion | 522 | * @param callback function to call upon completion |
498 | * @param callback_cls closure for callback | 523 | * @param callback_cls closure for @a callback |
499 | * @return NULL on (immediate) errror | 524 | * @return NULL on (immediate) errror |
500 | */ | 525 | */ |
501 | struct GNUNET_CRYPTO_FileHashContext * | 526 | struct GNUNET_CRYPTO_FileHashContext * |
@@ -586,12 +611,13 @@ GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc, | |||
586 | * @ingroup hash | 611 | * @ingroup hash |
587 | * Obtain a bit from a hashcode. | 612 | * Obtain a bit from a hashcode. |
588 | * | 613 | * |
589 | * @param code the GNUNET_CRYPTO_hash to index bit-wise | 614 | * @param code the `struct GNUNET_HashCode` to index bit-wise |
590 | * @param bit index into the hashcode, [0...159] | 615 | * @param bit index into the hashcode, [0...159] |
591 | * @return Bit \a bit from hashcode \a code, -1 for invalid index | 616 | * @return Bit \a bit from hashcode \a code, -1 for invalid index |
592 | */ | 617 | */ |
593 | int | 618 | int |
594 | GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode * code, unsigned int bit); | 619 | GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, |
620 | unsigned int bit); | ||
595 | 621 | ||
596 | 622 | ||
597 | /** | 623 | /** |
@@ -738,7 +764,7 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, | |||
738 | * @param skm source key material | 764 | * @param skm source key material |
739 | * @param skm_len length of skm | 765 | * @param skm_len length of skm |
740 | * @param ... void * & size_t pairs for context chunks | 766 | * @param ... void * & size_t pairs for context chunks |
741 | * @return GNUNET_YES on success | 767 | * @return #GNUNET_YES on success |
742 | */ | 768 | */ |
743 | int | 769 | int |
744 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, | 770 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, |
@@ -765,32 +791,70 @@ typedef void (*GNUNET_CRYPTO_EccKeyCallback)(void *cls, | |||
765 | * @param pub where to write the public key | 791 | * @param pub where to write the public key |
766 | */ | 792 | */ |
767 | void | 793 | void |
768 | GNUNET_CRYPTO_ecc_key_get_public (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | 794 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPrivateKey *priv, |
769 | struct GNUNET_CRYPTO_EccPublicKey *pub); | 795 | struct GNUNET_CRYPTO_EccPublicSignKey *pub); |
796 | |||
797 | |||
798 | |||
799 | /** | ||
800 | * @ingroup crypto | ||
801 | * Extract the public key for the given private key. | ||
802 | * | ||
803 | * @param priv the private key | ||
804 | * @param pub where to write the public key | ||
805 | */ | ||
806 | void | ||
807 | GNUNET_CRYPTO_ecc_key_get_public_for_encryption (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | ||
808 | struct GNUNET_CRYPTO_EccPublicEncryptKey *pub); | ||
770 | 809 | ||
771 | 810 | ||
772 | /** | 811 | /** |
773 | * Convert a public key to a string. | 812 | * Convert a public key to a string. |
774 | * | 813 | * |
775 | * @param pub key to convert | 814 | * @param pub key to convert |
776 | * @return string representing 'pub' | 815 | * @return string representing @a pub |
777 | */ | 816 | */ |
778 | char * | 817 | char * |
779 | GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey *pub); | 818 | GNUNET_CRYPTO_ecc_public_sign_key_to_string (const struct GNUNET_CRYPTO_EccPublicSignKey *pub); |
780 | 819 | ||
781 | 820 | ||
782 | /** | 821 | /** |
783 | * Convert a string representing a public key to a public key. | 822 | * Convert a string representing a public key to a public key. |
784 | * | 823 | * |
785 | * @param enc encoded public key | 824 | * @param enc encoded public key |
786 | * @param enclen number of bytes in enc (without 0-terminator) | 825 | * @param enclen number of bytes in @a enc (without 0-terminator) |
787 | * @param pub where to store the public key | 826 | * @param pub where to store the public key |
788 | * @return GNUNET_OK on success | 827 | * @return #GNUNET_OK on success |
789 | */ | 828 | */ |
790 | int | 829 | int |
791 | GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, | 830 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc, |
792 | size_t enclen, | 831 | size_t enclen, |
793 | struct GNUNET_CRYPTO_EccPublicKey *pub); | 832 | struct GNUNET_CRYPTO_EccPublicSignKey *pub); |
833 | |||
834 | |||
835 | |||
836 | /** | ||
837 | * Convert a public key to a string. | ||
838 | * | ||
839 | * @param pub key to convert | ||
840 | * @return string representing @a pub | ||
841 | */ | ||
842 | char * | ||
843 | GNUNET_CRYPTO_ecc_public_encrypt_key_to_string (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub); | ||
844 | |||
845 | |||
846 | /** | ||
847 | * Convert a string representing a public key to a public key. | ||
848 | * | ||
849 | * @param enc encoded public key | ||
850 | * @param enclen number of bytes in @a enc (without 0-terminator) | ||
851 | * @param pub where to store the public key | ||
852 | * @return #GNUNET_OK on success | ||
853 | */ | ||
854 | int | ||
855 | GNUNET_CRYPTO_ecc_public_encrypt_key_from_string (const char *enc, | ||
856 | size_t enclen, | ||
857 | struct GNUNET_CRYPTO_EccPublicEncryptKey *pub); | ||
794 | 858 | ||
795 | 859 | ||
796 | /** | 860 | /** |
@@ -817,6 +881,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename); | |||
817 | * Create a new private key by reading our peer's key from | 881 | * Create a new private key by reading our peer's key from |
818 | * the file specified in the configuration. | 882 | * the file specified in the configuration. |
819 | * | 883 | * |
884 | * @param cfg the configuration to use | ||
820 | * @return new private key, NULL on error (for example, | 885 | * @return new private key, NULL on error (for example, |
821 | * permission denied); free using #GNUNET_free | 886 | * permission denied); free using #GNUNET_free |
822 | */ | 887 | */ |
@@ -830,8 +895,8 @@ GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATI | |||
830 | * | 895 | * |
831 | * @return fresh private key; free using #GNUNET_free | 896 | * @return fresh private key; free using #GNUNET_free |
832 | */ | 897 | */ |
833 | struct GNUNET_CRYPTO_EccPrivateKey * | 898 | struct GNUNET_CRYPTO_EccPrivateEncryptKey * |
834 | GNUNET_CRYPTO_ecc_key_create (void); | 899 | GNUNET_CRYPTO_ecc_key_encrypt_create (void); |
835 | 900 | ||
836 | 901 | ||
837 | /** | 902 | /** |
@@ -882,7 +947,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
882 | */ | 947 | */ |
883 | int | 948 | int |
884 | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | 949 | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, |
885 | const struct GNUNET_CRYPTO_EccPublicKey *pub, | 950 | const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub, |
886 | struct GNUNET_HashCode *key_material); | 951 | struct GNUNET_HashCode *key_material); |
887 | 952 | ||
888 | 953 | ||
@@ -916,7 +981,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, | |||
916 | const struct GNUNET_CRYPTO_EccSignaturePurpose | 981 | const struct GNUNET_CRYPTO_EccSignaturePurpose |
917 | *validate, | 982 | *validate, |
918 | const struct GNUNET_CRYPTO_EccSignature *sig, | 983 | const struct GNUNET_CRYPTO_EccSignature *sig, |
919 | const struct GNUNET_CRYPTO_EccPublicKey *pub); | 984 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub); |
920 | 985 | ||
921 | 986 | ||
922 | /** | 987 | /** |
@@ -950,10 +1015,10 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
950 | * @param result where to write the derived public key | 1015 | * @param result where to write the derived public key |
951 | */ | 1016 | */ |
952 | void | 1017 | void |
953 | GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicKey *pub, | 1018 | GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
954 | const char *label, | 1019 | const char *label, |
955 | const char *context, | 1020 | const char *context, |
956 | struct GNUNET_CRYPTO_EccPublicKey *result); | 1021 | struct GNUNET_CRYPTO_EccPublicSignKey *result); |
957 | 1022 | ||
958 | 1023 | ||
959 | #if 0 /* keep Emacsens' auto-indent happy */ | 1024 | #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); | |||
336 | * @return an FS URI for the given namespace and identifier | 336 | * @return an FS URI for the given namespace and identifier |
337 | */ | 337 | */ |
338 | struct GNUNET_FS_Uri * | 338 | struct GNUNET_FS_Uri * |
339 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, | 339 | GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicSignKey *ns, |
340 | const char *id); | 340 | const char *id); |
341 | 341 | ||
342 | 342 | ||
@@ -350,7 +350,7 @@ GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EccPublicKey *ns, | |||
350 | */ | 350 | */ |
351 | int | 351 | int |
352 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 352 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
353 | struct GNUNET_CRYPTO_EccPublicKey *pseudonym); | 353 | struct GNUNET_CRYPTO_EccPublicSignKey *pseudonym); |
354 | 354 | ||
355 | 355 | ||
356 | /** | 356 | /** |
@@ -1376,7 +1376,7 @@ struct GNUNET_FS_ProgressInfo | |||
1376 | /** | 1376 | /** |
1377 | * Public key of the namespace. | 1377 | * Public key of the namespace. |
1378 | */ | 1378 | */ |
1379 | struct GNUNET_CRYPTO_EccPublicKey pseudonym; | 1379 | struct GNUNET_CRYPTO_EccPublicSignKey pseudonym; |
1380 | 1380 | ||
1381 | } ns; | 1381 | } ns; |
1382 | 1382 | ||
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, | |||
107 | struct GNUNET_GNS_LookupRequest * | 107 | struct GNUNET_GNS_LookupRequest * |
108 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, | 108 | GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, |
109 | const char *name, | 109 | const char *name, |
110 | const struct GNUNET_CRYPTO_EccPublicKey *zone, | 110 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone, |
111 | int type, | 111 | int type, |
112 | int only_cached, | 112 | int only_cached, |
113 | const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone_key, | 113 | 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, | |||
199 | * @return the hello message | 199 | * @return the hello message |
200 | */ | 200 | */ |
201 | struct GNUNET_HELLO_Message * | 201 | struct GNUNET_HELLO_Message * |
202 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicKey *publicKey, | 202 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EccPublicSignKey *publicKey, |
203 | GNUNET_HELLO_GenerateAddressListCallback addrgen, | 203 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
204 | void *addrgen_cls, | 204 | void *addrgen_cls, |
205 | int friend_only); | 205 | int friend_only); |
@@ -326,7 +326,7 @@ GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | |||
326 | */ | 326 | */ |
327 | int | 327 | int |
328 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 328 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
329 | struct GNUNET_CRYPTO_EccPublicKey *publicKey); | 329 | struct GNUNET_CRYPTO_EccPublicSignKey *publicKey); |
330 | 330 | ||
331 | 331 | ||
332 | /** | 332 | /** |
@@ -379,7 +379,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, | |||
379 | */ | 379 | */ |
380 | int | 380 | int |
381 | GNUNET_HELLO_parse_uri (const char *uri, | 381 | GNUNET_HELLO_parse_uri (const char *uri, |
382 | struct GNUNET_CRYPTO_EccPublicKey *pubkey, | 382 | struct GNUNET_CRYPTO_EccPublicSignKey *pubkey, |
383 | struct GNUNET_HELLO_Message **hello, | 383 | struct GNUNET_HELLO_Message **hello, |
384 | GNUNET_HELLO_TransportPluginsFind plugins_find); | 384 | GNUNET_HELLO_TransportPluginsFind plugins_find); |
385 | 385 | ||
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); | |||
97 | */ | 97 | */ |
98 | void | 98 | void |
99 | GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, | 99 | GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego, |
100 | struct GNUNET_CRYPTO_EccPublicKey *pk); | 100 | struct GNUNET_CRYPTO_EccPublicSignKey *pk); |
101 | 101 | ||
102 | 102 | ||
103 | /** | 103 | /** |
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, | |||
210 | */ | 210 | */ |
211 | typedef void | 211 | typedef void |
212 | (*GNUNET_MULTICAST_JoinCallback) (void *cls, | 212 | (*GNUNET_MULTICAST_JoinCallback) (void *cls, |
213 | const struct GNUNET_CRYPTO_EccPublicKey *member_key, | 213 | const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, |
214 | const struct GNUNET_MessageHeader *join_req, | 214 | const struct GNUNET_MessageHeader *join_req, |
215 | struct GNUNET_MULTICAST_JoinHandle *jh); | 215 | struct GNUNET_MULTICAST_JoinHandle *jh); |
216 | 216 | ||
@@ -249,7 +249,7 @@ GNUNET_MULTICAST_membership_test_result (struct GNUNET_MULTICAST_MembershipTestH | |||
249 | */ | 249 | */ |
250 | typedef void | 250 | typedef void |
251 | (*GNUNET_MULTICAST_MembershipTestCallback) (void *cls, | 251 | (*GNUNET_MULTICAST_MembershipTestCallback) (void *cls, |
252 | const struct GNUNET_CRYPTO_EccPublicKey *member_key, | 252 | const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, |
253 | uint64_t message_id, | 253 | uint64_t message_id, |
254 | uint64_t group_generation, | 254 | uint64_t group_generation, |
255 | struct GNUNET_MULTICAST_MembershipTestHandle *mth); | 255 | struct GNUNET_MULTICAST_MembershipTestHandle *mth); |
@@ -266,7 +266,7 @@ typedef void | |||
266 | */ | 266 | */ |
267 | typedef void | 267 | typedef void |
268 | (*GNUNET_MULTICAST_RequestCallback) (void *cls, | 268 | (*GNUNET_MULTICAST_RequestCallback) (void *cls, |
269 | const struct GNUNET_CRYPTO_EccPublicKey *member_key, | 269 | const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, |
270 | const struct GNUNET_MessageHeader *req, | 270 | const struct GNUNET_MessageHeader *req, |
271 | enum GNUNET_MULTICAST_MessageFlags flags); | 271 | enum GNUNET_MULTICAST_MessageFlags flags); |
272 | 272 | ||
@@ -324,7 +324,7 @@ struct GNUNET_MULTICAST_ReplayHandle; | |||
324 | */ | 324 | */ |
325 | typedef void | 325 | typedef void |
326 | (*GNUNET_MULTICAST_ReplayFragmentCallback) (void *cls, | 326 | (*GNUNET_MULTICAST_ReplayFragmentCallback) (void *cls, |
327 | const struct GNUNET_CRYPTO_EccPublicKey *member_key, | 327 | const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, |
328 | uint64_t fragment_id, | 328 | uint64_t fragment_id, |
329 | uint64_t flags, | 329 | uint64_t flags, |
330 | struct GNUNET_MULTICAST_ReplayHandle *rh); | 330 | struct GNUNET_MULTICAST_ReplayHandle *rh); |
@@ -347,7 +347,7 @@ typedef void | |||
347 | */ | 347 | */ |
348 | typedef void | 348 | typedef void |
349 | (*GNUNET_MULTICAST_ReplayMessageCallback) (void *cls, | 349 | (*GNUNET_MULTICAST_ReplayMessageCallback) (void *cls, |
350 | const struct GNUNET_CRYPTO_EccPublicKey *member_key, | 350 | const struct GNUNET_CRYPTO_EccPublicSignKey *member_key, |
351 | uint64_t message_id, | 351 | uint64_t message_id, |
352 | uint64_t fragment_offset, | 352 | uint64_t fragment_offset, |
353 | uint64_t flags, | 353 | uint64_t flags, |
@@ -586,7 +586,7 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin); | |||
586 | */ | 586 | */ |
587 | struct GNUNET_MULTICAST_Member * | 587 | struct GNUNET_MULTICAST_Member * |
588 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 588 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
589 | const struct GNUNET_CRYPTO_EccPublicKey *group_key, | 589 | const struct GNUNET_CRYPTO_EccPublicSignKey *group_key, |
590 | const struct GNUNET_CRYPTO_EccPrivateKey *member_key, | 590 | const struct GNUNET_CRYPTO_EccPrivateKey *member_key, |
591 | const struct GNUNET_PeerIdentity *origin, | 591 | const struct GNUNET_PeerIdentity *origin, |
592 | size_t relay_count, | 592 | 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 | |||
152 | */ | 152 | */ |
153 | int (*zone_to_name) (void *cls, | 153 | int (*zone_to_name) (void *cls, |
154 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, | 154 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, |
155 | const struct GNUNET_CRYPTO_EccPublicKey *value_zone, | 155 | const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, |
156 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); | 156 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls); |
157 | 157 | ||
158 | 158 | ||
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 | |||
237 | /** | 237 | /** |
238 | * Derived key used for signing; hash of this is the query. | 238 | * Derived key used for signing; hash of this is the query. |
239 | */ | 239 | */ |
240 | struct GNUNET_CRYPTO_EccPublicKey derived_key; | 240 | struct GNUNET_CRYPTO_EccPublicSignKey derived_key; |
241 | 241 | ||
242 | /** | 242 | /** |
243 | * Number of bytes signed; also specifies the number of bytes | 243 | * Number of bytes signed; also specifies the number of bytes |
@@ -355,7 +355,7 @@ typedef void (*GNUNET_NAMESTORE_RecordMonitor) (void *cls, | |||
355 | struct GNUNET_NAMESTORE_QueueEntry * | 355 | struct GNUNET_NAMESTORE_QueueEntry * |
356 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | 356 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, |
357 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, | 357 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, |
358 | const struct GNUNET_CRYPTO_EccPublicKey *value_zone, | 358 | const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, |
359 | GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls); | 359 | GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls); |
360 | 360 | ||
361 | 361 | ||
@@ -604,7 +604,7 @@ GNUNET_NAMESTORE_normalize_string (const char *src); | |||
604 | * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s. | 604 | * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s. |
605 | */ | 605 | */ |
606 | const char * | 606 | const char * |
607 | GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicKey *z); | 607 | GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z); |
608 | 608 | ||
609 | 609 | ||
610 | /** | 610 | /** |
@@ -618,7 +618,7 @@ GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicKey *z); | |||
618 | * key in an encoding suitable for DNS labels. | 618 | * key in an encoding suitable for DNS labels. |
619 | */ | 619 | */ |
620 | const char * | 620 | const char * |
621 | GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey); | 621 | GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey); |
622 | 622 | ||
623 | 623 | ||
624 | /** | 624 | /** |
@@ -632,7 +632,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey); | |||
632 | */ | 632 | */ |
633 | int | 633 | int |
634 | GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, | 634 | GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, |
635 | struct GNUNET_CRYPTO_EccPublicKey *pkey); | 635 | struct GNUNET_CRYPTO_EccPublicSignKey *pkey); |
636 | 636 | ||
637 | 637 | ||
638 | /** | 638 | /** |
@@ -656,7 +656,7 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe | |||
656 | * @param query hash to use for the query | 656 | * @param query hash to use for the query |
657 | */ | 657 | */ |
658 | void | 658 | void |
659 | GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pub, | 659 | GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
660 | const char *label, | 660 | const char *label, |
661 | struct GNUNET_HashCode *query); | 661 | struct GNUNET_HashCode *query); |
662 | 662 | ||
@@ -702,7 +702,7 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block); | |||
702 | */ | 702 | */ |
703 | int | 703 | int |
704 | GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, | 704 | GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, |
705 | const struct GNUNET_CRYPTO_EccPublicKey *zone_key, | 705 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, |
706 | const char *label, | 706 | const char *label, |
707 | GNUNET_NAMESTORE_RecordCallback proc, | 707 | GNUNET_NAMESTORE_RecordCallback proc, |
708 | void *proc_cls); | 708 | 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; | |||
215 | */ | 215 | */ |
216 | typedef int | 216 | typedef int |
217 | (*GNUNET_PSYC_Method) (void *cls, | 217 | (*GNUNET_PSYC_Method) (void *cls, |
218 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 218 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
219 | uint64_t message_id, | 219 | uint64_t message_id, |
220 | const char *method_name, | 220 | const char *method_name, |
221 | size_t modifier_count, | 221 | size_t modifier_count, |
@@ -241,7 +241,7 @@ typedef int | |||
241 | */ | 241 | */ |
242 | typedef int | 242 | typedef int |
243 | (*GNUNET_PSYC_JoinCallback) (void *cls, | 243 | (*GNUNET_PSYC_JoinCallback) (void *cls, |
244 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 244 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
245 | const char *method_name, | 245 | const char *method_name, |
246 | size_t variable_count, | 246 | size_t variable_count, |
247 | const struct GNUNET_ENV_Modifier *variables, | 247 | const struct GNUNET_ENV_Modifier *variables, |
@@ -456,7 +456,7 @@ struct GNUNET_PSYC_Slave; | |||
456 | */ | 456 | */ |
457 | struct GNUNET_PSYC_Slave * | 457 | struct GNUNET_PSYC_Slave * |
458 | GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 458 | GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
459 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 459 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
460 | const struct GNUNET_CRYPTO_EccPrivateKey *slave_key, | 460 | const struct GNUNET_CRYPTO_EccPrivateKey *slave_key, |
461 | const struct GNUNET_PeerIdentity *origin, | 461 | const struct GNUNET_PeerIdentity *origin, |
462 | size_t relay_count, | 462 | size_t relay_count, |
@@ -593,7 +593,7 @@ GNUNET_PSYC_slave_get_channel (struct GNUNET_PSYC_Slave *slave); | |||
593 | */ | 593 | */ |
594 | void | 594 | void |
595 | GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, | 595 | GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, |
596 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 596 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
597 | uint64_t announced_at, | 597 | uint64_t announced_at, |
598 | uint64_t effective_since); | 598 | uint64_t effective_since); |
599 | 599 | ||
@@ -621,7 +621,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *channel, | |||
621 | */ | 621 | */ |
622 | void | 622 | void |
623 | GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, | 623 | GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *channel, |
624 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 624 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
625 | uint64_t announced_at); | 625 | uint64_t announced_at); |
626 | 626 | ||
627 | 627 | ||
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 | |||
60 | */ | 60 | */ |
61 | int | 61 | int |
62 | (*membership_store) (void *cls, | 62 | (*membership_store) (void *cls, |
63 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 63 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
64 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 64 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
65 | int did_join, | 65 | int did_join, |
66 | uint64_t announced_at, | 66 | uint64_t announced_at, |
67 | uint64_t effective_since, | 67 | uint64_t effective_since, |
@@ -77,8 +77,8 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
77 | */ | 77 | */ |
78 | int | 78 | int |
79 | (*membership_test) (void *cls, | 79 | (*membership_test) (void *cls, |
80 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 80 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
81 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 81 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
82 | uint64_t message_id); | 82 | uint64_t message_id); |
83 | 83 | ||
84 | /** | 84 | /** |
@@ -90,7 +90,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
90 | */ | 90 | */ |
91 | int | 91 | int |
92 | (*fragment_store) (void *cls, | 92 | (*fragment_store) (void *cls, |
93 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 93 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
94 | const struct GNUNET_MULTICAST_MessageHeader *message, | 94 | const struct GNUNET_MULTICAST_MessageHeader *message, |
95 | uint32_t psycstore_flags); | 95 | uint32_t psycstore_flags); |
96 | 96 | ||
@@ -108,7 +108,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
108 | */ | 108 | */ |
109 | int | 109 | int |
110 | (*message_add_flags) (void *cls, | 110 | (*message_add_flags) (void *cls, |
111 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 111 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
112 | uint64_t message_id, | 112 | uint64_t message_id, |
113 | uint64_t psycstore_flags); | 113 | uint64_t psycstore_flags); |
114 | 114 | ||
@@ -121,7 +121,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
121 | */ | 121 | */ |
122 | int | 122 | int |
123 | (*fragment_get) (void *cls, | 123 | (*fragment_get) (void *cls, |
124 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 124 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
125 | uint64_t fragment_id, | 125 | uint64_t fragment_id, |
126 | GNUNET_PSYCSTORE_FragmentCallback cb, | 126 | GNUNET_PSYCSTORE_FragmentCallback cb, |
127 | void *cb_cls); | 127 | void *cb_cls); |
@@ -135,7 +135,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
135 | */ | 135 | */ |
136 | int | 136 | int |
137 | (*message_get) (void *cls, | 137 | (*message_get) (void *cls, |
138 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 138 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
139 | uint64_t message_id, | 139 | uint64_t message_id, |
140 | GNUNET_PSYCSTORE_FragmentCallback cb, | 140 | GNUNET_PSYCSTORE_FragmentCallback cb, |
141 | void *cb_cls); | 141 | void *cb_cls); |
@@ -150,7 +150,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
150 | */ | 150 | */ |
151 | int | 151 | int |
152 | (*message_get_fragment) (void *cls, | 152 | (*message_get_fragment) (void *cls, |
153 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 153 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
154 | uint64_t message_id, | 154 | uint64_t message_id, |
155 | uint64_t fragment_offset, | 155 | uint64_t fragment_offset, |
156 | GNUNET_PSYCSTORE_FragmentCallback cb, | 156 | GNUNET_PSYCSTORE_FragmentCallback cb, |
@@ -165,7 +165,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
165 | */ | 165 | */ |
166 | int | 166 | int |
167 | (*counters_get_master) (void *cls, | 167 | (*counters_get_master) (void *cls, |
168 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 168 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
169 | uint64_t *fragment_id, | 169 | uint64_t *fragment_id, |
170 | uint64_t *message_id, | 170 | uint64_t *message_id, |
171 | uint64_t *group_generation); | 171 | uint64_t *group_generation); |
@@ -179,7 +179,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
179 | */ | 179 | */ |
180 | int | 180 | int |
181 | (*counters_get_slave) (void *cls, | 181 | (*counters_get_slave) (void *cls, |
182 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 182 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
183 | uint64_t *max_state_msg_id); | 183 | uint64_t *max_state_msg_id); |
184 | 184 | ||
185 | /** | 185 | /** |
@@ -191,7 +191,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
191 | */ | 191 | */ |
192 | int | 192 | int |
193 | (*state_set) (void *cls, | 193 | (*state_set) (void *cls, |
194 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 194 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
195 | const char *name, | 195 | const char *name, |
196 | const void *value, | 196 | const void *value, |
197 | size_t value_size); | 197 | size_t value_size); |
@@ -208,7 +208,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
208 | */ | 208 | */ |
209 | int | 209 | int |
210 | (*state_reset) (void *cls, | 210 | (*state_reset) (void *cls, |
211 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key); | 211 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key); |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * Update signed state values from the current ones. | 214 | * Update signed state values from the current ones. |
@@ -217,7 +217,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
217 | */ | 217 | */ |
218 | int | 218 | int |
219 | (*state_update_signed) (void *cls, | 219 | (*state_update_signed) (void *cls, |
220 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key); | 220 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key); |
221 | 221 | ||
222 | /** | 222 | /** |
223 | * Update signed values of state variables in the state store. | 223 | * Update signed values of state variables in the state store. |
@@ -233,7 +233,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
233 | */ | 233 | */ |
234 | int | 234 | int |
235 | (*state_hash_update) (void *cls, | 235 | (*state_hash_update) (void *cls, |
236 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 236 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
237 | uint64_t message_id, | 237 | uint64_t message_id, |
238 | const struct GNUNET_HashCode *hash, | 238 | const struct GNUNET_HashCode *hash, |
239 | GNUNET_PSYCSTORE_ResultCallback rcb, | 239 | GNUNET_PSYCSTORE_ResultCallback rcb, |
@@ -246,7 +246,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
246 | */ | 246 | */ |
247 | int | 247 | int |
248 | (*state_get) (void *cls, | 248 | (*state_get) (void *cls, |
249 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 249 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
250 | const char *name, | 250 | const char *name, |
251 | GNUNET_PSYCSTORE_StateCallback cb, | 251 | GNUNET_PSYCSTORE_StateCallback cb, |
252 | void *cb_cls); | 252 | void *cb_cls); |
@@ -260,7 +260,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
260 | */ | 260 | */ |
261 | int | 261 | int |
262 | (*state_get_all) (void *cls, | 262 | (*state_get_all) (void *cls, |
263 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 263 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
264 | const char *name, | 264 | const char *name, |
265 | GNUNET_PSYCSTORE_StateCallback cb, | 265 | GNUNET_PSYCSTORE_StateCallback cb, |
266 | void *cb_cls); | 266 | void *cb_cls); |
@@ -273,7 +273,7 @@ struct GNUNET_PSYCSTORE_PluginFunctions | |||
273 | */ | 273 | */ |
274 | int | 274 | int |
275 | (*state_get_signed) (void *cls, | 275 | (*state_get_signed) (void *cls, |
276 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 276 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
277 | GNUNET_PSYCSTORE_StateCallback cb, | 277 | GNUNET_PSYCSTORE_StateCallback cb, |
278 | void *cb_cls); | 278 | void *cb_cls); |
279 | 279 | ||
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 | |||
133 | */ | 133 | */ |
134 | struct GNUNET_PSYCSTORE_OperationHandle * | 134 | struct GNUNET_PSYCSTORE_OperationHandle * |
135 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | 135 | GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, |
136 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 136 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
137 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 137 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
138 | int did_join, | 138 | int did_join, |
139 | uint64_t announced_at, | 139 | uint64_t announced_at, |
140 | uint64_t effective_since, | 140 | uint64_t effective_since, |
@@ -165,8 +165,8 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h, | |||
165 | */ | 165 | */ |
166 | struct GNUNET_PSYCSTORE_OperationHandle * | 166 | struct GNUNET_PSYCSTORE_OperationHandle * |
167 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | 167 | GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, |
168 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 168 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
169 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 169 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
170 | uint64_t message_id, | 170 | uint64_t message_id, |
171 | uint64_t group_generation, | 171 | uint64_t group_generation, |
172 | GNUNET_PSYCSTORE_ResultCallback rcb, | 172 | GNUNET_PSYCSTORE_ResultCallback rcb, |
@@ -188,7 +188,7 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h, | |||
188 | */ | 188 | */ |
189 | struct GNUNET_PSYCSTORE_OperationHandle * | 189 | struct GNUNET_PSYCSTORE_OperationHandle * |
190 | GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h, | 190 | GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h, |
191 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 191 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
192 | const struct GNUNET_MULTICAST_MessageHeader *message, | 192 | const struct GNUNET_MULTICAST_MessageHeader *message, |
193 | uint32_t psycstore_flags, | 193 | uint32_t psycstore_flags, |
194 | GNUNET_PSYCSTORE_ResultCallback rcb, | 194 | GNUNET_PSYCSTORE_ResultCallback rcb, |
@@ -226,7 +226,7 @@ typedef int | |||
226 | */ | 226 | */ |
227 | struct GNUNET_PSYCSTORE_OperationHandle * | 227 | struct GNUNET_PSYCSTORE_OperationHandle * |
228 | GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, | 228 | GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, |
229 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 229 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
230 | uint64_t fragment_id, | 230 | uint64_t fragment_id, |
231 | GNUNET_PSYCSTORE_FragmentCallback cb, | 231 | GNUNET_PSYCSTORE_FragmentCallback cb, |
232 | void *cb_cls); | 232 | void *cb_cls); |
@@ -245,7 +245,7 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
245 | */ | 245 | */ |
246 | struct GNUNET_PSYCSTORE_OperationHandle * | 246 | struct GNUNET_PSYCSTORE_OperationHandle * |
247 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | 247 | GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, |
248 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 248 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
249 | uint64_t message_id, | 249 | uint64_t message_id, |
250 | GNUNET_PSYCSTORE_FragmentCallback cb, | 250 | GNUNET_PSYCSTORE_FragmentCallback cb, |
251 | void *cb_cls); | 251 | void *cb_cls); |
@@ -266,7 +266,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
266 | */ | 266 | */ |
267 | struct GNUNET_PSYCSTORE_OperationHandle * | 267 | struct GNUNET_PSYCSTORE_OperationHandle * |
268 | GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, | 268 | GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, |
269 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 269 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
270 | uint64_t message_id, | 270 | uint64_t message_id, |
271 | uint64_t fragment_offset, | 271 | uint64_t fragment_offset, |
272 | GNUNET_PSYCSTORE_FragmentCallback cb, | 272 | GNUNET_PSYCSTORE_FragmentCallback cb, |
@@ -319,7 +319,7 @@ typedef void | |||
319 | */ | 319 | */ |
320 | struct GNUNET_PSYCSTORE_OperationHandle * | 320 | struct GNUNET_PSYCSTORE_OperationHandle * |
321 | GNUNET_PSYCSTORE_counters_get_master (struct GNUNET_PSYCSTORE_Handle *h, | 321 | GNUNET_PSYCSTORE_counters_get_master (struct GNUNET_PSYCSTORE_Handle *h, |
322 | struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 322 | struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
323 | GNUNET_PSYCSTORE_MasterCountersCallback *cb, | 323 | GNUNET_PSYCSTORE_MasterCountersCallback *cb, |
324 | void *cb_cls); | 324 | void *cb_cls); |
325 | 325 | ||
@@ -339,7 +339,7 @@ GNUNET_PSYCSTORE_counters_get_master (struct GNUNET_PSYCSTORE_Handle *h, | |||
339 | */ | 339 | */ |
340 | struct GNUNET_PSYCSTORE_OperationHandle * | 340 | struct GNUNET_PSYCSTORE_OperationHandle * |
341 | GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h, | 341 | GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h, |
342 | struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 342 | struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
343 | GNUNET_PSYCSTORE_SlaveCountersCallback *cb, | 343 | GNUNET_PSYCSTORE_SlaveCountersCallback *cb, |
344 | void *cb_cls); | 344 | void *cb_cls); |
345 | 345 | ||
@@ -363,7 +363,7 @@ GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h, | |||
363 | */ | 363 | */ |
364 | struct GNUNET_PSYCSTORE_OperationHandle * | 364 | struct GNUNET_PSYCSTORE_OperationHandle * |
365 | GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, | 365 | GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, |
366 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 366 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
367 | uint64_t message_id, | 367 | uint64_t message_id, |
368 | uint64_t state_delta, | 368 | uint64_t state_delta, |
369 | size_t modifier_count, | 369 | size_t modifier_count, |
@@ -386,7 +386,7 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, | |||
386 | */ | 386 | */ |
387 | struct GNUNET_PSYCSTORE_Handle * | 387 | struct GNUNET_PSYCSTORE_Handle * |
388 | GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, | 388 | GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, |
389 | const struct GNUNET_CRYPTO_EccPublicKey | 389 | const struct GNUNET_CRYPTO_EccPublicSignKey |
390 | *channel_key, | 390 | *channel_key, |
391 | GNUNET_PSYCSTORE_ResultCallback rcb, | 391 | GNUNET_PSYCSTORE_ResultCallback rcb, |
392 | void *rcb_cls); | 392 | void *rcb_cls); |
@@ -405,7 +405,7 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, | |||
405 | */ | 405 | */ |
406 | struct GNUNET_PSYCSTORE_OperationHandle * | 406 | struct GNUNET_PSYCSTORE_OperationHandle * |
407 | GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, | 407 | GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, |
408 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 408 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
409 | uint64_t message_id, | 409 | uint64_t message_id, |
410 | const struct GNUNET_HashCode *hash, | 410 | const struct GNUNET_HashCode *hash, |
411 | GNUNET_PSYCSTORE_ResultCallback rcb, | 411 | GNUNET_PSYCSTORE_ResultCallback rcb, |
@@ -444,7 +444,7 @@ typedef int | |||
444 | */ | 444 | */ |
445 | struct GNUNET_PSYCSTORE_OperationHandle * | 445 | struct GNUNET_PSYCSTORE_OperationHandle * |
446 | GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, | 446 | GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, |
447 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 447 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
448 | const char *name, | 448 | const char *name, |
449 | GNUNET_PSYCSTORE_StateCallback cb, | 449 | GNUNET_PSYCSTORE_StateCallback cb, |
450 | void *cb_cls); | 450 | void *cb_cls); |
@@ -463,7 +463,7 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
463 | */ | 463 | */ |
464 | struct GNUNET_PSYCSTORE_OperationHandle * | 464 | struct GNUNET_PSYCSTORE_OperationHandle * |
465 | GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h, | 465 | GNUNET_PSYCSTORE_state_get_all (struct GNUNET_PSYCSTORE_Handle *h, |
466 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 466 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
467 | const char *name_prefix, | 467 | const char *name_prefix, |
468 | GNUNET_PSYCSTORE_StateCallback cb, | 468 | GNUNET_PSYCSTORE_StateCallback cb, |
469 | void *cb_cls); | 469 | 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, | |||
283 | */ | 283 | */ |
284 | void | 284 | void |
285 | GNUNET_SOCIAL_nym_get_key (struct GNUNET_SOCIAL_Nym *nym, | 285 | GNUNET_SOCIAL_nym_get_key (struct GNUNET_SOCIAL_Nym *nym, |
286 | struct GNUNET_CRYPTO_EccPublicKey *nym_key); | 286 | struct GNUNET_CRYPTO_EccPublicSignKey *nym_key); |
287 | 287 | ||
288 | 288 | ||
289 | /** | 289 | /** |
@@ -440,7 +440,7 @@ GNUNET_SOCIAL_place_enter (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
440 | struct GNUNET_SOCIAL_Place * | 440 | struct GNUNET_SOCIAL_Place * |
441 | GNUNET_SOCIAL_place_enter2 (const struct GNUNET_CONFIGURATION_Handle *cfg, | 441 | GNUNET_SOCIAL_place_enter2 (const struct GNUNET_CONFIGURATION_Handle *cfg, |
442 | struct GNUNET_IDENTITY_Ego *ego, | 442 | struct GNUNET_IDENTITY_Ego *ego, |
443 | struct GNUNET_CRYPTO_EccPublicKey *crypto_address, | 443 | struct GNUNET_CRYPTO_EccPublicSignKey *crypto_address, |
444 | struct GNUNET_PeerIdentity *origin, | 444 | struct GNUNET_PeerIdentity *origin, |
445 | size_t relay_count, | 445 | size_t relay_count, |
446 | struct GNUNET_PeerIdentity *relays, | 446 | 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 | |||
675 | /** | 675 | /** |
676 | * Local peer ephemeral public key | 676 | * Local peer ephemeral public key |
677 | */ | 677 | */ |
678 | struct GNUNET_CRYPTO_EccPublicKey *my_eph; | 678 | struct GNUNET_CRYPTO_EccPublicSignKey *my_eph; |
679 | 679 | ||
680 | /** | 680 | /** |
681 | * Remote peer's public key. | 681 | * Remote peer's public key. |
682 | */ | 682 | */ |
683 | struct GNUNET_CRYPTO_EccPublicKey *peers_eph; | 683 | struct GNUNET_CRYPTO_EccPublicSignKey *peers_eph; |
684 | 684 | ||
685 | /** | 685 | /** |
686 | * Encryption ("our") key. | 686 | * Encryption ("our") key. |
@@ -934,7 +934,7 @@ static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; | |||
934 | /** | 934 | /** |
935 | * Own public key. | 935 | * Own public key. |
936 | */ | 936 | */ |
937 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 937 | static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
938 | 938 | ||
939 | /** | 939 | /** |
940 | * All ports clients of this peer have opened. | 940 | * All ports clients of this peer have opened. |
@@ -7273,7 +7273,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
7273 | pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (c); | 7273 | pk = GNUNET_CRYPTO_ecc_key_create_from_configuration (c); |
7274 | GNUNET_assert (NULL != pk); | 7274 | GNUNET_assert (NULL != pk); |
7275 | my_private_key = pk; | 7275 | my_private_key = pk; |
7276 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); | 7276 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); |
7277 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), | 7277 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
7278 | &my_full_id.hashPubKey); | 7278 | &my_full_id.hashPubKey); |
7279 | myid = GNUNET_PEER_intern (&my_full_id); | 7279 | 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; | |||
722 | /** | 722 | /** |
723 | * Own public key. | 723 | * Own public key. |
724 | */ | 724 | */ |
725 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 725 | static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
726 | 726 | ||
727 | /** | 727 | /** |
728 | * Tunnel ID for the next created tunnel (global tunnel number). | 728 | * Tunnel ID for the next created tunnel (global tunnel number). |
@@ -5902,7 +5902,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
5902 | GNUNET_free (keyfile); | 5902 | GNUNET_free (keyfile); |
5903 | GNUNET_assert (NULL != pk); | 5903 | GNUNET_assert (NULL != pk); |
5904 | my_private_key = pk; | 5904 | my_private_key = pk; |
5905 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); | 5905 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); |
5906 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), | 5906 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
5907 | &my_full_id.hashPubKey); | 5907 | &my_full_id.hashPubKey); |
5908 | myid = GNUNET_PEER_intern (&my_full_id); | 5908 | 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 | |||
58 | /** | 58 | /** |
59 | * Public key of the sending member. | 59 | * Public key of the sending member. |
60 | */ | 60 | */ |
61 | struct GNUNET_CRYPTO_EccPublicKey member_key; | 61 | struct GNUNET_CRYPTO_EccPublicSignKey member_key; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * ECC signature of the request fragment. | 64 | * ECC signature of the request fragment. |
@@ -122,12 +122,12 @@ struct GNUNET_MULTICAST_JoinRequest | |||
122 | /** | 122 | /** |
123 | * Public key of the target group. | 123 | * Public key of the target group. |
124 | */ | 124 | */ |
125 | struct GNUNET_CRYPTO_EccPublicKey group_key; | 125 | struct GNUNET_CRYPTO_EccPublicSignKey group_key; |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * Public key of the joining member. | 128 | * Public key of the joining member. |
129 | */ | 129 | */ |
130 | struct GNUNET_CRYPTO_EccPublicKey member_key; | 130 | struct GNUNET_CRYPTO_EccPublicSignKey member_key; |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * Peer identity of the joining member. | 133 | * Peer identity of the joining member. |
@@ -402,7 +402,7 @@ GNUNET_MULTICAST_origin_stop (struct GNUNET_MULTICAST_Origin *origin) | |||
402 | */ | 402 | */ |
403 | struct GNUNET_MULTICAST_Member * | 403 | struct GNUNET_MULTICAST_Member * |
404 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | 404 | GNUNET_MULTICAST_member_join (const struct GNUNET_CONFIGURATION_Handle *cfg, |
405 | const struct GNUNET_CRYPTO_EccPublicKey *group_key, | 405 | const struct GNUNET_CRYPTO_EccPublicSignKey *group_key, |
406 | const struct GNUNET_CRYPTO_EccPrivateKey *member_key, | 406 | const struct GNUNET_CRYPTO_EccPrivateKey *member_key, |
407 | const struct GNUNET_PeerIdentity *origin, | 407 | const struct GNUNET_PeerIdentity *origin, |
408 | size_t relay_count, | 408 | 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, | |||
552 | const struct GNUNET_NAMESTORE_RecordData *rd) | 552 | const struct GNUNET_NAMESTORE_RecordData *rd) |
553 | { | 553 | { |
554 | struct Request *request = cls; | 554 | struct Request *request = cls; |
555 | struct GNUNET_CRYPTO_EccPublicKey pub; | 555 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
556 | 556 | ||
557 | if (0 != rd_count) | 557 | if (0 != rd_count) |
558 | { | 558 | { |
@@ -565,7 +565,7 @@ lookup_result_processor (void *cls, | |||
565 | return; | 565 | return; |
566 | } | 566 | } |
567 | if (GNUNET_OK != | 567 | if (GNUNET_OK != |
568 | GNUNET_CRYPTO_ecc_public_key_from_string (request->public_key, | 568 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (request->public_key, |
569 | strlen (request->public_key), | 569 | strlen (request->public_key), |
570 | &pub)) | 570 | &pub)) |
571 | { | 571 | { |
@@ -594,7 +594,7 @@ lookup_block_processor (void *cls, | |||
594 | const struct GNUNET_NAMESTORE_Block *block) | 594 | const struct GNUNET_NAMESTORE_Block *block) |
595 | { | 595 | { |
596 | struct Request *request = cls; | 596 | struct Request *request = cls; |
597 | struct GNUNET_CRYPTO_EccPublicKey pub; | 597 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
598 | 598 | ||
599 | request->qe = NULL; | 599 | request->qe = NULL; |
600 | if (NULL == block) | 600 | if (NULL == block) |
@@ -602,7 +602,7 @@ lookup_block_processor (void *cls, | |||
602 | lookup_result_processor (request, 0, NULL); | 602 | lookup_result_processor (request, 0, NULL); |
603 | return; | 603 | return; |
604 | } | 604 | } |
605 | GNUNET_CRYPTO_ecc_key_get_public (&fcfs_zone_pkey, | 605 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey, |
606 | &pub); | 606 | &pub); |
607 | if (GNUNET_OK != | 607 | if (GNUNET_OK != |
608 | GNUNET_NAMESTORE_block_decrypt (block, | 608 | GNUNET_NAMESTORE_block_decrypt (block, |
@@ -655,7 +655,7 @@ create_response (void *cls, | |||
655 | struct MHD_Response *response; | 655 | struct MHD_Response *response; |
656 | struct Request *request; | 656 | struct Request *request; |
657 | int ret; | 657 | int ret; |
658 | struct GNUNET_CRYPTO_EccPublicKey pub; | 658 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
659 | struct GNUNET_HashCode query; | 659 | struct GNUNET_HashCode query; |
660 | 660 | ||
661 | if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) || | 661 | if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) || |
@@ -705,7 +705,7 @@ create_response (void *cls, | |||
705 | request->pp = NULL; | 705 | request->pp = NULL; |
706 | } | 706 | } |
707 | if (GNUNET_OK != | 707 | if (GNUNET_OK != |
708 | GNUNET_CRYPTO_ecc_public_key_from_string (request->public_key, | 708 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (request->public_key, |
709 | strlen (request->public_key), | 709 | strlen (request->public_key), |
710 | &pub)) | 710 | &pub)) |
711 | { | 711 | { |
@@ -733,7 +733,7 @@ create_response (void *cls, | |||
733 | request, connection); | 733 | request, connection); |
734 | } | 734 | } |
735 | request->phase = RP_LOOKUP; | 735 | request->phase = RP_LOOKUP; |
736 | GNUNET_CRYPTO_ecc_key_get_public (&fcfs_zone_pkey, | 736 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey, |
737 | &pub); | 737 | &pub); |
738 | GNUNET_NAMESTORE_query_from_public_key (&pub, | 738 | GNUNET_NAMESTORE_query_from_public_key (&pub, |
739 | request->domain_name, | 739 | 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, | |||
430 | int result) | 430 | int result) |
431 | { | 431 | { |
432 | const struct GNUNET_CONFIGURATION_Handle *cfg = cls; | 432 | const struct GNUNET_CONFIGURATION_Handle *cfg = cls; |
433 | struct GNUNET_CRYPTO_EccPublicKey pub; | 433 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
434 | struct GNUNET_NAMESTORE_RecordData rd; | 434 | struct GNUNET_NAMESTORE_RecordData rd; |
435 | 435 | ||
436 | if (GNUNET_YES != result) | 436 | if (GNUNET_YES != result) |
@@ -446,7 +446,7 @@ testservice_task (void *cls, | |||
446 | _("No options given\n")); | 446 | _("No options given\n")); |
447 | return; | 447 | return; |
448 | } | 448 | } |
449 | GNUNET_CRYPTO_ecc_key_get_public (&zone_pkey, | 449 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&zone_pkey, |
450 | &pub); | 450 | &pub); |
451 | 451 | ||
452 | ns = GNUNET_NAMESTORE_connect (cfg); | 452 | ns = GNUNET_NAMESTORE_connect (cfg); |
@@ -575,14 +575,14 @@ testservice_task (void *cls, | |||
575 | { | 575 | { |
576 | char sh[105]; | 576 | char sh[105]; |
577 | char sname[64]; | 577 | char sname[64]; |
578 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 578 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
579 | 579 | ||
580 | if ( (2 != (sscanf (uri, | 580 | if ( (2 != (sscanf (uri, |
581 | "gnunet://gns/%104s/%63s", | 581 | "gnunet://gns/%104s/%63s", |
582 | sh, | 582 | sh, |
583 | sname)) ) || | 583 | sname)) ) || |
584 | (GNUNET_OK != | 584 | (GNUNET_OK != |
585 | GNUNET_CRYPTO_ecc_public_key_from_string (sh, strlen (sh), &pkey)) ) | 585 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (sh, strlen (sh), &pkey)) ) |
586 | { | 586 | { |
587 | fprintf (stderr, | 587 | fprintf (stderr, |
588 | _("Invalid URI `%s'\n"), | 588 | _("Invalid URI `%s'\n"), |
@@ -593,7 +593,7 @@ testservice_task (void *cls, | |||
593 | } | 593 | } |
594 | memset (&rd, 0, sizeof (rd)); | 594 | memset (&rd, 0, sizeof (rd)); |
595 | rd.data = &pkey; | 595 | rd.data = &pkey; |
596 | rd.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey); | 596 | rd.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); |
597 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; | 597 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
598 | if (GNUNET_YES == etime_is_rel) | 598 | if (GNUNET_YES == etime_is_rel) |
599 | { | 599 | { |
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, | |||
573 | const char *rd_ser; | 573 | const char *rd_ser; |
574 | unsigned int rd_count; | 574 | unsigned int rd_count; |
575 | int res; | 575 | int res; |
576 | struct GNUNET_CRYPTO_EccPublicKey pubkey; | 576 | struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
577 | 577 | ||
578 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 578 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
579 | "Received `%s' message\n", | 579 | "Received `%s' message\n", |
@@ -624,7 +624,7 @@ handle_record_store (void *cls, | |||
624 | } | 624 | } |
625 | 625 | ||
626 | /* Extracting and converting private key */ | 626 | /* Extracting and converting private key */ |
627 | GNUNET_CRYPTO_ecc_key_get_public (&rp_msg->private_key, | 627 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&rp_msg->private_key, |
628 | &pubkey); | 628 | &pubkey); |
629 | conv_name = GNUNET_NAMESTORE_normalize_string (name_tmp); | 629 | conv_name = GNUNET_NAMESTORE_normalize_string (name_tmp); |
630 | if (NULL == conv_name) | 630 | 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 | |||
93 | /** | 93 | /** |
94 | * Derived public key. | 94 | * Derived public key. |
95 | */ | 95 | */ |
96 | struct GNUNET_CRYPTO_EccPublicKey derived_key; | 96 | struct GNUNET_CRYPTO_EccPublicSignKey derived_key; |
97 | 97 | ||
98 | /* follwed by encrypted block data */ | 98 | /* follwed by encrypted block data */ |
99 | }; | 99 | }; |
@@ -122,7 +122,7 @@ struct BlockCacheMessage | |||
122 | /** | 122 | /** |
123 | * Derived public key. | 123 | * Derived public key. |
124 | */ | 124 | */ |
125 | struct GNUNET_CRYPTO_EccPublicKey derived_key; | 125 | struct GNUNET_CRYPTO_EccPublicSignKey derived_key; |
126 | 126 | ||
127 | /* follwed by encrypted block data */ | 127 | /* follwed by encrypted block data */ |
128 | }; | 128 | }; |
@@ -228,7 +228,7 @@ struct ZoneToNameMessage | |||
228 | /** | 228 | /** |
229 | * The public key of the target zone | 229 | * The public key of the target zone |
230 | */ | 230 | */ |
231 | struct GNUNET_CRYPTO_EccPublicKey value_zone; | 231 | struct GNUNET_CRYPTO_EccPublicSignKey value_zone; |
232 | }; | 232 | }; |
233 | 233 | ||
234 | 234 | ||
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, | |||
1146 | struct GNUNET_NAMESTORE_QueueEntry * | 1146 | struct GNUNET_NAMESTORE_QueueEntry * |
1147 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, | 1147 | GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, |
1148 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, | 1148 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, |
1149 | const struct GNUNET_CRYPTO_EccPublicKey *value_zone, | 1149 | const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, |
1150 | GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls) | 1150 | GNUNET_NAMESTORE_RecordMonitor proc, void *proc_cls) |
1151 | { | 1151 | { |
1152 | struct GNUNET_NAMESTORE_QueueEntry *qe; | 1152 | 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) | |||
97 | * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s | 97 | * @return string form; will be overwritten by next call to #GNUNET_NAMESTORE_z2s |
98 | */ | 98 | */ |
99 | const char * | 99 | const char * |
100 | GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicKey *z) | 100 | GNUNET_NAMESTORE_z2s (const struct GNUNET_CRYPTO_EccPublicSignKey *z) |
101 | { | 101 | { |
102 | static char buf[sizeof (struct GNUNET_CRYPTO_EccPublicKey) * 8]; | 102 | static char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) * 8]; |
103 | char *end; | 103 | char *end; |
104 | 104 | ||
105 | end = GNUNET_STRINGS_data_to_string ((const unsigned char *) z, | 105 | end = GNUNET_STRINGS_data_to_string ((const unsigned char *) z, |
106 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 106 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
107 | buf, sizeof (buf)); | 107 | buf, sizeof (buf)); |
108 | if (NULL == end) | 108 | if (NULL == end) |
109 | { | 109 | { |
@@ -324,18 +324,18 @@ static void | |||
324 | derive_block_aes_key (struct GNUNET_CRYPTO_AesInitializationVector *iv, | 324 | derive_block_aes_key (struct GNUNET_CRYPTO_AesInitializationVector *iv, |
325 | struct GNUNET_CRYPTO_AesSessionKey *skey, | 325 | struct GNUNET_CRYPTO_AesSessionKey *skey, |
326 | const char *label, | 326 | const char *label, |
327 | const struct GNUNET_CRYPTO_EccPublicKey *pub) | 327 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
328 | { | 328 | { |
329 | static const char ctx_key[] = "gns-aes-ctx-key"; | 329 | static const char ctx_key[] = "gns-aes-ctx-key"; |
330 | static const char ctx_iv[] = "gns-aes-ctx-iv"; | 330 | static const char ctx_iv[] = "gns-aes-ctx-iv"; |
331 | 331 | ||
332 | GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_AesSessionKey), | 332 | GNUNET_CRYPTO_kdf (skey, sizeof (struct GNUNET_CRYPTO_AesSessionKey), |
333 | pub, sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 333 | pub, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
334 | label, strlen (label), | 334 | label, strlen (label), |
335 | ctx_key, strlen (ctx_key), | 335 | ctx_key, strlen (ctx_key), |
336 | NULL, 0); | 336 | NULL, 0); |
337 | GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_AesInitializationVector), | 337 | GNUNET_CRYPTO_kdf (iv, sizeof (struct GNUNET_CRYPTO_AesInitializationVector), |
338 | pub, sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 338 | pub, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
339 | label, strlen (label), | 339 | label, strlen (label), |
340 | ctx_iv, strlen (ctx_iv), | 340 | ctx_iv, strlen (ctx_iv), |
341 | NULL, 0); | 341 | NULL, 0); |
@@ -362,7 +362,7 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key, | |||
362 | size_t payload_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); | 362 | size_t payload_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); |
363 | char payload[sizeof (uint32_t) + payload_len]; | 363 | char payload[sizeof (uint32_t) + payload_len]; |
364 | struct GNUNET_NAMESTORE_Block *block; | 364 | struct GNUNET_NAMESTORE_Block *block; |
365 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 365 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
366 | struct GNUNET_CRYPTO_EccPrivateKey *dkey; | 366 | struct GNUNET_CRYPTO_EccPrivateKey *dkey; |
367 | struct GNUNET_CRYPTO_AesInitializationVector iv; | 367 | struct GNUNET_CRYPTO_AesInitializationVector iv; |
368 | struct GNUNET_CRYPTO_AesSessionKey skey; | 368 | struct GNUNET_CRYPTO_AesSessionKey skey; |
@@ -385,9 +385,9 @@ GNUNET_NAMESTORE_block_create (const struct GNUNET_CRYPTO_EccPrivateKey *key, | |||
385 | dkey = GNUNET_CRYPTO_ecc_key_derive (key, | 385 | dkey = GNUNET_CRYPTO_ecc_key_derive (key, |
386 | label, | 386 | label, |
387 | "gns"); | 387 | "gns"); |
388 | GNUNET_CRYPTO_ecc_key_get_public (dkey, | 388 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (dkey, |
389 | &block->derived_key); | 389 | &block->derived_key); |
390 | GNUNET_CRYPTO_ecc_key_get_public (key, | 390 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, |
391 | &pkey); | 391 | &pkey); |
392 | derive_block_aes_key (&iv, &skey, label, &pkey); | 392 | derive_block_aes_key (&iv, &skey, label, &pkey); |
393 | GNUNET_break (payload_len + sizeof (uint32_t) == | 393 | GNUNET_break (payload_len + sizeof (uint32_t) == |
@@ -439,7 +439,7 @@ GNUNET_NAMESTORE_block_verify (const struct GNUNET_NAMESTORE_Block *block) | |||
439 | */ | 439 | */ |
440 | int | 440 | int |
441 | GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, | 441 | GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block, |
442 | const struct GNUNET_CRYPTO_EccPublicKey *zone_key, | 442 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, |
443 | const char *label, | 443 | const char *label, |
444 | GNUNET_NAMESTORE_RecordCallback proc, | 444 | GNUNET_NAMESTORE_RecordCallback proc, |
445 | void *proc_cls) | 445 | void *proc_cls) |
@@ -580,7 +580,7 @@ GNUNET_NAMESTORE_value_to_string (uint32_t type, | |||
580 | return NULL; | 580 | return NULL; |
581 | return GNUNET_strdup (tmp); | 581 | return GNUNET_strdup (tmp); |
582 | case GNUNET_NAMESTORE_TYPE_PKEY: | 582 | case GNUNET_NAMESTORE_TYPE_PKEY: |
583 | if (data_size != sizeof (struct GNUNET_CRYPTO_EccPublicKey)) | 583 | if (data_size != sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) |
584 | return NULL; | 584 | return NULL; |
585 | return GNUNET_CRYPTO_ecc_public_key_to_string (data); | 585 | return GNUNET_CRYPTO_ecc_public_key_to_string (data); |
586 | case GNUNET_NAMESTORE_TYPE_PSEU: | 586 | case GNUNET_NAMESTORE_TYPE_PSEU: |
@@ -664,7 +664,7 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
664 | { | 664 | { |
665 | struct in_addr value_a; | 665 | struct in_addr value_a; |
666 | struct in6_addr value_aaaa; | 666 | struct in6_addr value_aaaa; |
667 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 667 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
668 | struct GNUNET_TUN_DnsSoaRecord *soa; | 668 | struct GNUNET_TUN_DnsSoaRecord *soa; |
669 | struct GNUNET_TUN_GnsVpnRecord *vpn; | 669 | struct GNUNET_TUN_GnsVpnRecord *vpn; |
670 | struct GNUNET_TUN_DnsTlsaRecord *tlsa; | 670 | struct GNUNET_TUN_DnsTlsaRecord *tlsa; |
@@ -769,16 +769,16 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, | |||
769 | return GNUNET_OK; | 769 | return GNUNET_OK; |
770 | case GNUNET_NAMESTORE_TYPE_PKEY: | 770 | case GNUNET_NAMESTORE_TYPE_PKEY: |
771 | if (GNUNET_OK != | 771 | if (GNUNET_OK != |
772 | GNUNET_CRYPTO_ecc_public_key_from_string (s, strlen (s), &pkey)) | 772 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (s, strlen (s), &pkey)) |
773 | { | 773 | { |
774 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 774 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
775 | _("Unable to parse PKEY record `%s'\n"), | 775 | _("Unable to parse PKEY record `%s'\n"), |
776 | s); | 776 | s); |
777 | return GNUNET_SYSERR; | 777 | return GNUNET_SYSERR; |
778 | } | 778 | } |
779 | *data = GNUNET_new (struct GNUNET_CRYPTO_EccPublicKey); | 779 | *data = GNUNET_new (struct GNUNET_CRYPTO_EccPublicSignKey); |
780 | memcpy (*data, &pkey, sizeof (pkey)); | 780 | memcpy (*data, &pkey, sizeof (pkey)); |
781 | *data_size = sizeof (struct GNUNET_CRYPTO_EccPublicKey); | 781 | *data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); |
782 | return GNUNET_OK; | 782 | return GNUNET_OK; |
783 | case GNUNET_NAMESTORE_TYPE_PSEU: | 783 | case GNUNET_NAMESTORE_TYPE_PSEU: |
784 | *data = GNUNET_strdup (s); | 784 | *data = GNUNET_strdup (s); |
@@ -928,9 +928,9 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe | |||
928 | const char *label, | 928 | const char *label, |
929 | struct GNUNET_HashCode *query) | 929 | struct GNUNET_HashCode *query) |
930 | { | 930 | { |
931 | struct GNUNET_CRYPTO_EccPublicKey pub; | 931 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
932 | 932 | ||
933 | GNUNET_CRYPTO_ecc_key_get_public (zone, &pub); | 933 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (zone, &pub); |
934 | GNUNET_NAMESTORE_query_from_public_key (&pub, label, query); | 934 | GNUNET_NAMESTORE_query_from_public_key (&pub, label, query); |
935 | } | 935 | } |
936 | 936 | ||
@@ -943,11 +943,11 @@ GNUNET_NAMESTORE_query_from_private_key (const struct GNUNET_CRYPTO_EccPrivateKe | |||
943 | * @param query hash to use for the query | 943 | * @param query hash to use for the query |
944 | */ | 944 | */ |
945 | void | 945 | void |
946 | GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pub, | 946 | GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
947 | const char *label, | 947 | const char *label, |
948 | struct GNUNET_HashCode *query) | 948 | struct GNUNET_HashCode *query) |
949 | { | 949 | { |
950 | struct GNUNET_CRYPTO_EccPublicKey pd; | 950 | struct GNUNET_CRYPTO_EccPublicSignKey pd; |
951 | 951 | ||
952 | GNUNET_CRYPTO_ecc_public_key_derive (pub, label, "gns", &pd); | 952 | GNUNET_CRYPTO_ecc_public_key_derive (pub, label, "gns", &pd); |
953 | GNUNET_CRYPTO_hash (&pd, sizeof (pd), query); | 953 | GNUNET_CRYPTO_hash (&pd, sizeof (pd), query); |
@@ -965,7 +965,7 @@ GNUNET_NAMESTORE_query_from_public_key (const struct GNUNET_CRYPTO_EccPublicKey | |||
965 | * key in an encoding suitable for DNS labels. | 965 | * key in an encoding suitable for DNS labels. |
966 | */ | 966 | */ |
967 | const char * | 967 | const char * |
968 | GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey) | 968 | GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey) |
969 | { | 969 | { |
970 | static char ret[128]; | 970 | static char ret[128]; |
971 | char *pkeys; | 971 | char *pkeys; |
@@ -991,7 +991,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey) | |||
991 | */ | 991 | */ |
992 | int | 992 | int |
993 | GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, | 993 | GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, |
994 | struct GNUNET_CRYPTO_EccPublicKey *pkey) | 994 | struct GNUNET_CRYPTO_EccPublicSignKey *pkey) |
995 | { | 995 | { |
996 | char *cpy; | 996 | char *cpy; |
997 | char *dot; | 997 | char *dot; |
@@ -1007,7 +1007,7 @@ GNUNET_NAMESTORE_zkey_to_pkey (const char *zkey, | |||
1007 | goto error; | 1007 | goto error; |
1008 | 1008 | ||
1009 | if (GNUNET_OK != | 1009 | if (GNUNET_OK != |
1010 | GNUNET_CRYPTO_ecc_public_key_from_string (x, | 1010 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (x, |
1011 | strlen (x), | 1011 | strlen (x), |
1012 | pkey)) | 1012 | pkey)) |
1013 | goto error; | 1013 | 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, | |||
273 | */ | 273 | */ |
274 | static int | 274 | static int |
275 | namestore_postgres_put_records (void *cls, | 275 | namestore_postgres_put_records (void *cls, |
276 | const struct GNUNET_CRYPTO_EccPublicKey *zone_key, | 276 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, |
277 | struct GNUNET_TIME_Absolute expire, | 277 | struct GNUNET_TIME_Absolute expire, |
278 | const char *name, | 278 | const char *name, |
279 | unsigned int rd_count, | 279 | unsigned int rd_count, |
@@ -291,7 +291,7 @@ namestore_postgres_put_records (void *cls, | |||
291 | unsigned int i; | 291 | unsigned int i; |
292 | 292 | ||
293 | GNUNET_CRYPTO_short_hash (zone_key, | 293 | GNUNET_CRYPTO_short_hash (zone_key, |
294 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 294 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
295 | &zone); | 295 | &zone); |
296 | (void) namestore_postgres_remove_records (plugin, &zone, name); | 296 | (void) namestore_postgres_remove_records (plugin, &zone, name); |
297 | name_len = strlen (name); | 297 | name_len = strlen (name); |
@@ -331,7 +331,7 @@ namestore_postgres_put_records (void *cls, | |||
331 | (const char *) &rvalue_be | 331 | (const char *) &rvalue_be |
332 | }; | 332 | }; |
333 | int paramLengths[] = { | 333 | int paramLengths[] = { |
334 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 334 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
335 | name_len, | 335 | name_len, |
336 | sizeof (uint32_t), | 336 | sizeof (uint32_t), |
337 | data_size, | 337 | data_size, |
@@ -383,7 +383,7 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
383 | { | 383 | { |
384 | unsigned int record_count; | 384 | unsigned int record_count; |
385 | size_t data_size; | 385 | size_t data_size; |
386 | /* const struct GNUNET_CRYPTO_EccPublicKey *zone_key; */ | 386 | /* const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key; */ |
387 | const struct GNUNET_CRYPTO_EccPrivateKey *zone_key; | 387 | const struct GNUNET_CRYPTO_EccPrivateKey *zone_key; |
388 | /* const struct GNUNET_CRYPTO_EccSignature *sig; */ | 388 | /* const struct GNUNET_CRYPTO_EccSignature *sig; */ |
389 | /* struct GNUNET_TIME_Absolute expiration; */ | 389 | /* struct GNUNET_TIME_Absolute expiration; */ |
@@ -413,7 +413,7 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
413 | } | 413 | } |
414 | GNUNET_assert (1 == cnt); | 414 | GNUNET_assert (1 == cnt); |
415 | if ((6 != PQnfields (res)) || | 415 | if ((6 != PQnfields (res)) || |
416 | (sizeof (struct GNUNET_CRYPTO_EccPublicKey) != PQgetlength (res, 0, 0)) || | 416 | (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) != PQgetlength (res, 0, 0)) || |
417 | (sizeof (uint32_t) != PQfsize (res, 2)) || | 417 | (sizeof (uint32_t) != PQfsize (res, 2)) || |
418 | (sizeof (uint64_t) != PQfsize (res, 4)) || | 418 | (sizeof (uint64_t) != PQfsize (res, 4)) || |
419 | (sizeof (struct GNUNET_CRYPTO_EccSignature) != PQgetlength (res, 0, 5))) | 419 | (sizeof (struct GNUNET_CRYPTO_EccSignature) != PQgetlength (res, 0, 5))) |
@@ -423,7 +423,7 @@ get_record_and_call_iterator (struct Plugin *plugin, | |||
423 | return GNUNET_SYSERR; | 423 | return GNUNET_SYSERR; |
424 | } | 424 | } |
425 | zone_key = (const struct GNUNET_CRYPTO_EccPrivateKey *) PQgetvalue (res, 0, 0); | 425 | zone_key = (const struct GNUNET_CRYPTO_EccPrivateKey *) PQgetvalue (res, 0, 0); |
426 | /* zone_key = (const struct GNUNET_CRYPTO_EccPublicKey *) PQgetvalue (res, 0, 0); */ | 426 | /* zone_key = (const struct GNUNET_CRYPTO_EccPublicSignKey *) PQgetvalue (res, 0, 0); */ |
427 | name = PQgetvalue (res, 0, 1); | 427 | name = PQgetvalue (res, 0, 1); |
428 | name_len = PQgetlength (res, 0, 1); | 428 | name_len = PQgetlength (res, 0, 1); |
429 | record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); | 429 | record_count = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); |
@@ -563,7 +563,7 @@ namestore_postgres_iterate_records (void *cls, | |||
563 | static int | 563 | static int |
564 | namestore_postgres_zone_to_name (void *cls, | 564 | namestore_postgres_zone_to_name (void *cls, |
565 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, | 565 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, |
566 | const struct GNUNET_CRYPTO_EccPublicKey *value_zone, | 566 | const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, |
567 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls) | 567 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls) |
568 | { | 568 | { |
569 | #if 0 | 569 | #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, | |||
455 | 455 | ||
456 | namestore_sqlite_expire_blocks (plugin); | 456 | namestore_sqlite_expire_blocks (plugin); |
457 | GNUNET_CRYPTO_hash (&block->derived_key, | 457 | GNUNET_CRYPTO_hash (&block->derived_key, |
458 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 458 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
459 | &query); | 459 | &query); |
460 | expiration = GNUNET_TIME_absolute_ntoh (block->expiration_time); | 460 | expiration = GNUNET_TIME_absolute_ntoh (block->expiration_time); |
461 | block_size = ntohl (block->purpose.size) + | 461 | block_size = ntohl (block->purpose.size) + |
462 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 462 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
463 | sizeof (struct GNUNET_CRYPTO_EccSignature); | 463 | sizeof (struct GNUNET_CRYPTO_EccSignature); |
464 | if (block_size > 64 * 65536) | 464 | if (block_size > 64 * 65536) |
465 | { | 465 | { |
@@ -542,7 +542,7 @@ namestore_sqlite_lookup_block (void *cls, | |||
542 | block_size = sqlite3_column_bytes (plugin->lookup_block, 0); | 542 | block_size = sqlite3_column_bytes (plugin->lookup_block, 0); |
543 | if ( (block_size < sizeof (struct GNUNET_NAMESTORE_Block)) || | 543 | if ( (block_size < sizeof (struct GNUNET_NAMESTORE_Block)) || |
544 | (ntohl (block->purpose.size) + | 544 | (ntohl (block->purpose.size) + |
545 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 545 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
546 | sizeof (struct GNUNET_CRYPTO_EccSignature) != block_size) ) | 546 | sizeof (struct GNUNET_CRYPTO_EccSignature) != block_size) ) |
547 | { | 547 | { |
548 | GNUNET_break (0); | 548 | GNUNET_break (0); |
@@ -599,7 +599,7 @@ namestore_sqlite_store_records (void *cls, | |||
599 | for (i=0;i<rd_count;i++) | 599 | for (i=0;i<rd_count;i++) |
600 | if (GNUNET_NAMESTORE_TYPE_PKEY == rd[i].record_type) | 600 | if (GNUNET_NAMESTORE_TYPE_PKEY == rd[i].record_type) |
601 | { | 601 | { |
602 | GNUNET_break (sizeof (struct GNUNET_CRYPTO_EccPublicKey) == rd[i].data_size); | 602 | GNUNET_break (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) == rd[i].data_size); |
603 | GNUNET_CRYPTO_hash (rd[i].data, | 603 | GNUNET_CRYPTO_hash (rd[i].data, |
604 | rd[i].data_size, | 604 | rd[i].data_size, |
605 | &pkey_hash); | 605 | &pkey_hash); |
@@ -834,7 +834,7 @@ namestore_sqlite_iterate_records (void *cls, | |||
834 | static int | 834 | static int |
835 | namestore_sqlite_zone_to_name (void *cls, | 835 | namestore_sqlite_zone_to_name (void *cls, |
836 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, | 836 | const struct GNUNET_CRYPTO_EccPrivateKey *zone, |
837 | const struct GNUNET_CRYPTO_EccPublicKey *value_zone, | 837 | const struct GNUNET_CRYPTO_EccPublicSignKey *value_zone, |
838 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls) | 838 | GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls) |
839 | { | 839 | { |
840 | struct Plugin *plugin = cls; | 840 | struct Plugin *plugin = cls; |
@@ -845,7 +845,7 @@ namestore_sqlite_zone_to_name (void *cls, | |||
845 | zone, sizeof (struct GNUNET_CRYPTO_EccPrivateKey), | 845 | zone, sizeof (struct GNUNET_CRYPTO_EccPrivateKey), |
846 | SQLITE_STATIC)) || | 846 | SQLITE_STATIC)) || |
847 | (SQLITE_OK != sqlite3_bind_blob (stmt, 2, | 847 | (SQLITE_OK != sqlite3_bind_blob (stmt, 2, |
848 | value_zone, sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 848 | value_zone, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
849 | SQLITE_STATIC)) ) | 849 | SQLITE_STATIC)) ) |
850 | { | 850 | { |
851 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | 851 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, |
diff --git a/src/namestore/test_namestore_api_blocks.c b/src/namestore/test_namestore_api_blocks.c index 446a28c18..d7057fc8f 100644 --- a/src/namestore/test_namestore_api_blocks.c +++ b/src/namestore/test_namestore_api_blocks.c | |||
@@ -101,7 +101,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
101 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 101 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
102 | { | 102 | { |
103 | struct GNUNET_NAMESTORE_Block *block; | 103 | struct GNUNET_NAMESTORE_Block *block; |
104 | struct GNUNET_CRYPTO_EccPublicKey pubkey; | 104 | struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
105 | 105 | ||
106 | /* load privat key */ | 106 | /* load privat key */ |
107 | char *hostkey_file; | 107 | char *hostkey_file; |
@@ -113,7 +113,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
113 | GNUNET_assert (privkey != NULL); | 113 | GNUNET_assert (privkey != NULL); |
114 | struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get(); | 114 | struct GNUNET_TIME_Absolute expire = GNUNET_TIME_absolute_get(); |
115 | /* get public key */ | 115 | /* get public key */ |
116 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); | 116 | GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey); |
117 | 117 | ||
118 | /* create record */ | 118 | /* create record */ |
119 | s_name = "DUMMY.dummy.gnunet"; | 119 | s_name = "DUMMY.dummy.gnunet"; |
diff --git a/src/namestore/test_namestore_api_put.c b/src/namestore/test_namestore_api_put.c index f5adc7d85..6c7ca6b0f 100644 --- a/src/namestore/test_namestore_api_put.c +++ b/src/namestore/test_namestore_api_put.c | |||
@@ -44,7 +44,7 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
44 | 44 | ||
45 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; | 45 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
46 | 46 | ||
47 | static struct GNUNET_CRYPTO_EccPublicKey pubkey; | 47 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
48 | 48 | ||
49 | static struct GNUNET_NAMESTORE_RecordData *s_rd; | 49 | static struct GNUNET_NAMESTORE_RecordData *s_rd; |
50 | 50 | ||
@@ -151,7 +151,7 @@ run (void *cls, | |||
151 | GNUNET_assert (privkey != NULL); | 151 | GNUNET_assert (privkey != NULL); |
152 | GNUNET_free (hostkey_file); | 152 | GNUNET_free (hostkey_file); |
153 | /* get public key */ | 153 | /* get public key */ |
154 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); | 154 | GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey); |
155 | nsh = GNUNET_NAMESTORE_connect (cfg); | 155 | nsh = GNUNET_NAMESTORE_connect (cfg); |
156 | GNUNET_break (NULL != nsh); | 156 | GNUNET_break (NULL != nsh); |
157 | /* create record */ | 157 | /* create record */ |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 22ab2bca4..0b027b7e1 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -41,7 +41,7 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; | 42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EccPublicKey pubkey; | 44 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
45 | 45 | ||
46 | static struct GNUNET_HashCode derived_hash; | 46 | static struct GNUNET_HashCode derived_hash; |
47 | 47 | ||
@@ -263,7 +263,7 @@ run (void *cls, | |||
263 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); | 263 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); |
264 | GNUNET_free (hostkey_file); | 264 | GNUNET_free (hostkey_file); |
265 | GNUNET_assert (privkey != NULL); | 265 | GNUNET_assert (privkey != NULL); |
266 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); | 266 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey); |
267 | 267 | ||
268 | removed = GNUNET_NO; | 268 | removed = GNUNET_NO; |
269 | 269 | ||
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index 396e69ff0..7c4dcc253 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -41,7 +41,7 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; | 42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EccPublicKey pubkey; | 44 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
45 | 45 | ||
46 | static int res; | 46 | static int res; |
47 | 47 | ||
@@ -152,7 +152,7 @@ run (void *cls, | |||
152 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); | 152 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); |
153 | GNUNET_free (hostkey_file); | 153 | GNUNET_free (hostkey_file); |
154 | GNUNET_assert (privkey != NULL); | 154 | GNUNET_assert (privkey != NULL); |
155 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); | 155 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey); |
156 | 156 | ||
157 | nsh = GNUNET_NAMESTORE_connect (cfg); | 157 | nsh = GNUNET_NAMESTORE_connect (cfg); |
158 | GNUNET_break (NULL != nsh); | 158 | GNUNET_break (NULL != nsh); |
diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c index b85003c60..00a3a1a1c 100644 --- a/src/namestore/test_namestore_api_store.c +++ b/src/namestore/test_namestore_api_store.c | |||
@@ -41,7 +41,7 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
41 | 41 | ||
42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; | 42 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
43 | 43 | ||
44 | static struct GNUNET_CRYPTO_EccPublicKey pubkey; | 44 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
45 | 45 | ||
46 | static int res; | 46 | static int res; |
47 | 47 | ||
@@ -185,7 +185,7 @@ run (void *cls, | |||
185 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); | 185 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); |
186 | GNUNET_free (hostkey_file); | 186 | GNUNET_free (hostkey_file); |
187 | GNUNET_assert (privkey != NULL); | 187 | GNUNET_assert (privkey != NULL); |
188 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); | 188 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey); |
189 | 189 | ||
190 | 190 | ||
191 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; | 191 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
diff --git a/src/namestore/test_namestore_api_store_update.c b/src/namestore/test_namestore_api_store_update.c index 9455c6bd6..e36272fca 100644 --- a/src/namestore/test_namestore_api_store_update.c +++ b/src/namestore/test_namestore_api_store_update.c | |||
@@ -48,7 +48,7 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
48 | 48 | ||
49 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; | 49 | static struct GNUNET_CRYPTO_EccPrivateKey *privkey; |
50 | 50 | ||
51 | static struct GNUNET_CRYPTO_EccPublicKey pubkey; | 51 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
52 | 52 | ||
53 | static int res; | 53 | static int res; |
54 | 54 | ||
@@ -222,7 +222,7 @@ run (void *cls, | |||
222 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); | 222 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file (hostkey_file); |
223 | GNUNET_free (hostkey_file); | 223 | GNUNET_free (hostkey_file); |
224 | GNUNET_assert (privkey != NULL); | 224 | GNUNET_assert (privkey != NULL); |
225 | GNUNET_CRYPTO_ecc_key_get_public (privkey, &pubkey); | 225 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (privkey, &pubkey); |
226 | 226 | ||
227 | 227 | ||
228 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; | 228 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value_us; |
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index 5e6cf5a4e..31a8eafa3 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -45,7 +45,7 @@ static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | |||
45 | 45 | ||
46 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; | 46 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
47 | 47 | ||
48 | static struct GNUNET_CRYPTO_EccPublicKey pubkey; | 48 | static struct GNUNET_CRYPTO_EccPublicSignKey pubkey; |
49 | 49 | ||
50 | static struct GNUNET_TIME_Absolute expire; | 50 | static struct GNUNET_TIME_Absolute expire; |
51 | 51 | ||
@@ -98,7 +98,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
98 | 98 | ||
99 | static void | 99 | static void |
100 | zone_to_name_proc (void *cls, | 100 | zone_to_name_proc (void *cls, |
101 | const struct GNUNET_CRYPTO_EccPublicKey *zone_key, | 101 | const struct GNUNET_CRYPTO_EccPublicSignKey *zone_key, |
102 | struct GNUNET_TIME_Absolute expire, | 102 | struct GNUNET_TIME_Absolute expire, |
103 | const char *n, | 103 | const char *n, |
104 | unsigned int rd_count, | 104 | unsigned int rd_count, |
@@ -125,7 +125,7 @@ zone_to_name_proc (void *cls, | |||
125 | fail = GNUNET_YES; | 125 | fail = GNUNET_YES; |
126 | GNUNET_break (0); | 126 | GNUNET_break (0); |
127 | } | 127 | } |
128 | if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKey)))) | 128 | if ((zone_key == NULL) || (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)))) |
129 | { | 129 | { |
130 | fail = GNUNET_YES; | 130 | fail = GNUNET_YES; |
131 | GNUNET_break (0); | 131 | GNUNET_break (0); |
@@ -179,10 +179,10 @@ run (void *cls, | |||
179 | GNUNET_free (hostkey_file); | 179 | GNUNET_free (hostkey_file); |
180 | GNUNET_assert (privkey != NULL); | 180 | GNUNET_assert (privkey != NULL); |
181 | /* get public key */ | 181 | /* get public key */ |
182 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); | 182 | GNUNET_CRYPTO_ecc_key_get_public_for_signature(privkey, &pubkey); |
183 | 183 | ||
184 | /* zone hash */ | 184 | /* zone hash */ |
185 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKey), &s_zone); | 185 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), &s_zone); |
186 | GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); | 186 | GNUNET_CRYPTO_short_hash (s_name, strlen (s_name) + 1, &s_zone_value); |
187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); | 187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_NAMESTORE_short_h2s (&s_zone_value)); |
188 | 188 | ||
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 7aabca6b5..29a038d3b 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -190,7 +190,7 @@ struct GNUNET_NSE_FloodMessage | |||
190 | /** | 190 | /** |
191 | * Public key of the originator. | 191 | * Public key of the originator. |
192 | */ | 192 | */ |
193 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 193 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
194 | 194 | ||
195 | /** | 195 | /** |
196 | * Proof of work, causing leading zeros when hashed with pkey. | 196 | * Proof of work, causing leading zeros when hashed with pkey. |
@@ -289,7 +289,7 @@ static struct GNUNET_TIME_Absolute current_timestamp; | |||
289 | /** | 289 | /** |
290 | * The public key of this peer. | 290 | * The public key of this peer. |
291 | */ | 291 | */ |
292 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 292 | static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
293 | 293 | ||
294 | /** | 294 | /** |
295 | * The private key of this peer. | 295 | * The private key of this peer. |
@@ -845,16 +845,16 @@ count_leading_zeroes (const struct GNUNET_HashCode * hash) | |||
845 | * @return GNUNET_YES if valid, GNUNET_NO if not | 845 | * @return GNUNET_YES if valid, GNUNET_NO if not |
846 | */ | 846 | */ |
847 | static int | 847 | static int |
848 | check_proof_of_work (const struct GNUNET_CRYPTO_EccPublicKey *pkey, | 848 | check_proof_of_work (const struct GNUNET_CRYPTO_EccPublicSignKey *pkey, |
849 | uint64_t val) | 849 | uint64_t val) |
850 | { | 850 | { |
851 | char buf[sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 851 | char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
852 | sizeof (val)] GNUNET_ALIGN; | 852 | sizeof (val)] GNUNET_ALIGN; |
853 | struct GNUNET_HashCode result; | 853 | struct GNUNET_HashCode result; |
854 | 854 | ||
855 | memcpy (buf, &val, sizeof (val)); | 855 | memcpy (buf, &val, sizeof (val)); |
856 | memcpy (&buf[sizeof (val)], pkey, | 856 | memcpy (&buf[sizeof (val)], pkey, |
857 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 857 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
858 | pow_hash (buf, sizeof (buf), &result); | 858 | pow_hash (buf, sizeof (buf), &result); |
859 | return (count_leading_zeroes (&result) >= | 859 | return (count_leading_zeroes (&result) >= |
860 | nse_work_required) ? GNUNET_YES : GNUNET_NO; | 860 | nse_work_required) ? GNUNET_YES : GNUNET_NO; |
@@ -893,14 +893,14 @@ find_proof (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
893 | { | 893 | { |
894 | #define ROUND_SIZE 10 | 894 | #define ROUND_SIZE 10 |
895 | uint64_t counter; | 895 | uint64_t counter; |
896 | char buf[sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 896 | char buf[sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
897 | sizeof (uint64_t)] GNUNET_ALIGN; | 897 | sizeof (uint64_t)] GNUNET_ALIGN; |
898 | struct GNUNET_HashCode result; | 898 | struct GNUNET_HashCode result; |
899 | unsigned int i; | 899 | unsigned int i; |
900 | 900 | ||
901 | proof_task = GNUNET_SCHEDULER_NO_TASK; | 901 | proof_task = GNUNET_SCHEDULER_NO_TASK; |
902 | memcpy (&buf[sizeof (uint64_t)], &my_public_key, | 902 | memcpy (&buf[sizeof (uint64_t)], &my_public_key, |
903 | sizeof (struct GNUNET_CRYPTO_EccPublicKey)); | 903 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)); |
904 | i = 0; | 904 | i = 0; |
905 | counter = my_proof; | 905 | counter = my_proof; |
906 | while ((counter != UINT64_MAX) && (i < ROUND_SIZE)) | 906 | while ((counter != UINT64_MAX) && (i < ROUND_SIZE)) |
@@ -1053,7 +1053,7 @@ handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1053 | struct GNUNET_PeerIdentity os; | 1053 | struct GNUNET_PeerIdentity os; |
1054 | 1054 | ||
1055 | GNUNET_CRYPTO_hash (&incoming_flood->pkey, | 1055 | GNUNET_CRYPTO_hash (&incoming_flood->pkey, |
1056 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 1056 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
1057 | &os.hashPubKey); | 1057 | &os.hashPubKey); |
1058 | GNUNET_snprintf (origin, sizeof (origin), "%s", GNUNET_i2s (&os)); | 1058 | GNUNET_snprintf (origin, sizeof (origin), "%s", GNUNET_i2s (&os)); |
1059 | GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer)); | 1059 | GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer)); |
@@ -1461,7 +1461,7 @@ run (void *cls, | |||
1461 | GNUNET_free (keyfile); | 1461 | GNUNET_free (keyfile); |
1462 | GNUNET_assert (NULL != pk); | 1462 | GNUNET_assert (NULL != pk); |
1463 | my_private_key = pk; | 1463 | my_private_key = pk; |
1464 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); | 1464 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); |
1465 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), | 1465 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
1466 | &my_identity.hashPubKey); | 1466 | &my_identity.hashPubKey); |
1467 | if (GNUNET_OK != | 1467 | 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; | |||
192 | /** | 192 | /** |
193 | * My public key. | 193 | * My public key. |
194 | */ | 194 | */ |
195 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 195 | static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
196 | 196 | ||
197 | /** | 197 | /** |
198 | * Head of list of print contexts. | 198 | * Head of list of print contexts. |
@@ -677,7 +677,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
677 | return; | 677 | return; |
678 | } | 678 | } |
679 | GNUNET_free (fn); | 679 | GNUNET_free (fn); |
680 | GNUNET_CRYPTO_ecc_key_get_public (priv, &my_public_key); | 680 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &my_public_key); |
681 | GNUNET_free (priv); | 681 | GNUNET_free (priv); |
682 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_peer_identity.hashPubKey); | 682 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), &my_peer_identity.hashPubKey); |
683 | } | 683 | } |
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, | |||
653 | { | 653 | { |
654 | struct GNUNET_HELLO_Message * res; | 654 | struct GNUNET_HELLO_Message * res; |
655 | struct GNUNET_HELLO_Message * tmp; | 655 | struct GNUNET_HELLO_Message * tmp; |
656 | struct GNUNET_CRYPTO_EccPublicKey pk; | 656 | struct GNUNET_CRYPTO_EccPublicSignKey pk; |
657 | 657 | ||
658 | if (NULL != friend_hello) | 658 | if (NULL != friend_hello) |
659 | { | 659 | { |
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) | |||
82 | static void | 82 | static void |
83 | add_peer (size_t i) | 83 | add_peer (size_t i) |
84 | { | 84 | { |
85 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 85 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
86 | struct GNUNET_HELLO_Message *h2; | 86 | struct GNUNET_HELLO_Message *h2; |
87 | 87 | ||
88 | memset (&pkey, i, sizeof (pkey)); | 88 | 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; | |||
86 | static void | 86 | static void |
87 | add_peer () | 87 | add_peer () |
88 | { | 88 | { |
89 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 89 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
90 | struct GNUNET_HELLO_Message *h2; | 90 | struct GNUNET_HELLO_Message *h2; |
91 | size_t agc; | 91 | size_t agc; |
92 | 92 | ||
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; | |||
68 | static void | 68 | static void |
69 | add_peer () | 69 | add_peer () |
70 | { | 70 | { |
71 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 71 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
72 | struct GNUNET_HELLO_Message *h2; | 72 | struct GNUNET_HELLO_Message *h2; |
73 | size_t agc; | 73 | size_t agc; |
74 | 74 | ||
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) | |||
227 | static void | 227 | static void |
228 | add_peer () | 228 | add_peer () |
229 | { | 229 | { |
230 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 230 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
231 | struct GNUNET_HELLO_Message *h2; | 231 | struct GNUNET_HELLO_Message *h2; |
232 | size_t agc; | 232 | size_t agc; |
233 | 233 | ||
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) | |||
609 | 609 | ||
610 | static int | 610 | static int |
611 | channel_key_store (struct Plugin *plugin, | 611 | channel_key_store (struct Plugin *plugin, |
612 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key) | 612 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key) |
613 | { | 613 | { |
614 | sqlite3_stmt *stmt = plugin->insert_channel_key; | 614 | sqlite3_stmt *stmt = plugin->insert_channel_key; |
615 | 615 | ||
@@ -638,7 +638,7 @@ channel_key_store (struct Plugin *plugin, | |||
638 | 638 | ||
639 | static int | 639 | static int |
640 | slave_key_store (struct Plugin *plugin, | 640 | slave_key_store (struct Plugin *plugin, |
641 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key) | 641 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key) |
642 | { | 642 | { |
643 | sqlite3_stmt *stmt = plugin->insert_slave_key; | 643 | sqlite3_stmt *stmt = plugin->insert_slave_key; |
644 | 644 | ||
@@ -676,8 +676,8 @@ slave_key_store (struct Plugin *plugin, | |||
676 | */ | 676 | */ |
677 | static int | 677 | static int |
678 | membership_store (void *cls, | 678 | membership_store (void *cls, |
679 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 679 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
680 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 680 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
681 | int did_join, | 681 | int did_join, |
682 | uint64_t announced_at, | 682 | uint64_t announced_at, |
683 | uint64_t effective_since, | 683 | uint64_t effective_since, |
@@ -736,8 +736,8 @@ membership_store (void *cls, | |||
736 | */ | 736 | */ |
737 | static int | 737 | static int |
738 | membership_test (void *cls, | 738 | membership_test (void *cls, |
739 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 739 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
740 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 740 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
741 | uint64_t message_id) | 741 | uint64_t message_id) |
742 | { | 742 | { |
743 | struct Plugin *plugin = cls; | 743 | struct Plugin *plugin = cls; |
@@ -783,7 +783,7 @@ membership_test (void *cls, | |||
783 | */ | 783 | */ |
784 | static int | 784 | static int |
785 | fragment_store (void *cls, | 785 | fragment_store (void *cls, |
786 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 786 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
787 | const struct GNUNET_MULTICAST_MessageHeader *msg, | 787 | const struct GNUNET_MULTICAST_MessageHeader *msg, |
788 | uint32_t psycstore_flags) | 788 | uint32_t psycstore_flags) |
789 | { | 789 | { |
@@ -847,7 +847,7 @@ fragment_store (void *cls, | |||
847 | */ | 847 | */ |
848 | static int | 848 | static int |
849 | message_add_flags (void *cls, | 849 | message_add_flags (void *cls, |
850 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 850 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
851 | uint64_t message_id, | 851 | uint64_t message_id, |
852 | uint64_t psycstore_flags) | 852 | uint64_t psycstore_flags) |
853 | { | 853 | { |
@@ -923,7 +923,7 @@ fragment_row (sqlite3_stmt *stmt, GNUNET_PSYCSTORE_FragmentCallback cb, | |||
923 | static int | 923 | static int |
924 | fragment_get (void *cls, | 924 | fragment_get (void *cls, |
925 | const struct | 925 | const struct |
926 | GNUNET_CRYPTO_EccPublicKey *channel_key, | 926 | GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
927 | uint64_t fragment_id, | 927 | uint64_t fragment_id, |
928 | GNUNET_PSYCSTORE_FragmentCallback cb, | 928 | GNUNET_PSYCSTORE_FragmentCallback cb, |
929 | void *cb_cls) | 929 | void *cb_cls) |
@@ -974,7 +974,7 @@ fragment_get (void *cls, | |||
974 | */ | 974 | */ |
975 | static int | 975 | static int |
976 | message_get (void *cls, | 976 | message_get (void *cls, |
977 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 977 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
978 | uint64_t message_id, | 978 | uint64_t message_id, |
979 | GNUNET_PSYCSTORE_FragmentCallback cb, | 979 | GNUNET_PSYCSTORE_FragmentCallback cb, |
980 | void *cb_cls) | 980 | void *cb_cls) |
@@ -1035,7 +1035,7 @@ message_get (void *cls, | |||
1035 | */ | 1035 | */ |
1036 | static int | 1036 | static int |
1037 | message_get_fragment (void *cls, | 1037 | message_get_fragment (void *cls, |
1038 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1038 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1039 | uint64_t message_id, | 1039 | uint64_t message_id, |
1040 | uint64_t fragment_offset, | 1040 | uint64_t fragment_offset, |
1041 | GNUNET_PSYCSTORE_FragmentCallback cb, | 1041 | GNUNET_PSYCSTORE_FragmentCallback cb, |
@@ -1089,7 +1089,7 @@ message_get_fragment (void *cls, | |||
1089 | */ | 1089 | */ |
1090 | static int | 1090 | static int |
1091 | counters_get_master (void *cls, | 1091 | counters_get_master (void *cls, |
1092 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1092 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1093 | uint64_t *fragment_id, | 1093 | uint64_t *fragment_id, |
1094 | uint64_t *message_id, | 1094 | uint64_t *message_id, |
1095 | uint64_t *group_generation) | 1095 | uint64_t *group_generation) |
@@ -1142,7 +1142,7 @@ counters_get_master (void *cls, | |||
1142 | */ | 1142 | */ |
1143 | static int | 1143 | static int |
1144 | counters_get_slave (void *cls, | 1144 | counters_get_slave (void *cls, |
1145 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1145 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1146 | uint64_t *max_state_msg_id) | 1146 | uint64_t *max_state_msg_id) |
1147 | { | 1147 | { |
1148 | struct Plugin *plugin = cls; | 1148 | struct Plugin *plugin = cls; |
@@ -1193,7 +1193,7 @@ counters_get_slave (void *cls, | |||
1193 | */ | 1193 | */ |
1194 | static int | 1194 | static int |
1195 | state_set (void *cls, | 1195 | state_set (void *cls, |
1196 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1196 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1197 | const char *name, const void *value, size_t value_size) | 1197 | const char *name, const void *value, size_t value_size) |
1198 | { | 1198 | { |
1199 | struct Plugin *plugin = cls; | 1199 | struct Plugin *plugin = cls; |
@@ -1242,7 +1242,7 @@ state_set (void *cls, | |||
1242 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 1242 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
1243 | */ | 1243 | */ |
1244 | static int | 1244 | static int |
1245 | state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key) | 1245 | state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key) |
1246 | { | 1246 | { |
1247 | struct Plugin *plugin = cls; | 1247 | struct Plugin *plugin = cls; |
1248 | sqlite3_stmt *stmt = plugin->delete_state; | 1248 | sqlite3_stmt *stmt = plugin->delete_state; |
@@ -1279,7 +1279,7 @@ state_reset (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key) | |||
1279 | */ | 1279 | */ |
1280 | static int | 1280 | static int |
1281 | state_update_signed (void *cls, | 1281 | state_update_signed (void *cls, |
1282 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key) | 1282 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key) |
1283 | { | 1283 | { |
1284 | struct Plugin *plugin = cls; | 1284 | struct Plugin *plugin = cls; |
1285 | sqlite3_stmt *stmt = plugin->update_state_signed; | 1285 | sqlite3_stmt *stmt = plugin->update_state_signed; |
@@ -1315,7 +1315,7 @@ state_update_signed (void *cls, | |||
1315 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 1315 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
1316 | */ | 1316 | */ |
1317 | static int | 1317 | static int |
1318 | state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1318 | state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1319 | const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) | 1319 | const char *name, GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) |
1320 | { | 1320 | { |
1321 | struct Plugin *plugin = cls; | 1321 | struct Plugin *plugin = cls; |
@@ -1367,7 +1367,7 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | |||
1367 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 1367 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR |
1368 | */ | 1368 | */ |
1369 | static int | 1369 | static int |
1370 | state_get_all (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1370 | state_get_all (void *cls, const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1371 | const char *name, GNUNET_PSYCSTORE_StateCallback cb, | 1371 | const char *name, GNUNET_PSYCSTORE_StateCallback cb, |
1372 | void *cb_cls) | 1372 | void *cb_cls) |
1373 | { | 1373 | { |
@@ -1435,7 +1435,7 @@ state_get_all (void *cls, const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | |||
1435 | */ | 1435 | */ |
1436 | static int | 1436 | static int |
1437 | state_get_signed (void *cls, | 1437 | state_get_signed (void *cls, |
1438 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 1438 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
1439 | GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) | 1439 | GNUNET_PSYCSTORE_StateCallback cb, void *cb_cls) |
1440 | { | 1440 | { |
1441 | struct Plugin *plugin = cls; | 1441 | 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 | |||
58 | */ | 58 | */ |
59 | struct MembershipStoreMessage | 59 | struct MembershipStoreMessage |
60 | { | 60 | { |
61 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key; | 61 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key; |
62 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key; | 62 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key; |
63 | int did_join; | 63 | int did_join; |
64 | uint64_t announced_at; | 64 | uint64_t announced_at; |
65 | uint64_t effective_since; | 65 | uint64_t effective_since; |
@@ -72,8 +72,8 @@ struct MembershipStoreMessage | |||
72 | */ | 72 | */ |
73 | struct MembershipTestMessage | 73 | struct MembershipTestMessage |
74 | { | 74 | { |
75 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key; | 75 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key; |
76 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key; | 76 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key; |
77 | uint64_t message_id; | 77 | uint64_t message_id; |
78 | uint64_t group_generation; | 78 | uint64_t group_generation; |
79 | }; | 79 | }; |
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) | |||
437 | struct GNUNET_PSYCSTORE_OperationHandle * | 437 | struct GNUNET_PSYCSTORE_OperationHandle * |
438 | GNUNET_PSYCSTORE_membership_store ( | 438 | GNUNET_PSYCSTORE_membership_store ( |
439 | struct GNUNET_PSYCSTORE_Handle *h, | 439 | struct GNUNET_PSYCSTORE_Handle *h, |
440 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 440 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
441 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 441 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
442 | int did_join, | 442 | int did_join, |
443 | uint64_t announced_at, | 443 | uint64_t announced_at, |
444 | uint64_t effective_since, | 444 | uint64_t effective_since, |
@@ -453,8 +453,8 @@ GNUNET_PSYCSTORE_membership_store ( | |||
453 | struct GNUNET_PSYCSTORE_OperationHandle * | 453 | struct GNUNET_PSYCSTORE_OperationHandle * |
454 | GNUNET_PSYCSTORE_membership_test ( | 454 | GNUNET_PSYCSTORE_membership_test ( |
455 | struct GNUNET_PSYCSTORE_Handle *h, | 455 | struct GNUNET_PSYCSTORE_Handle *h, |
456 | const struct GNUNET_CRYPTO_EccPublicKey *channel_key, | 456 | const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key, |
457 | const struct GNUNET_CRYPTO_EccPublicKey *slave_key, | 457 | const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key, |
458 | uint64_t message_id, | 458 | uint64_t message_id, |
459 | uint64_t group_generation, | 459 | uint64_t group_generation, |
460 | GNUNET_PSYCSTORE_ResultCallback rcb, | 460 | 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; | |||
53 | static struct GNUNET_CRYPTO_EccPrivateKey *channel_key; | 53 | static struct GNUNET_CRYPTO_EccPrivateKey *channel_key; |
54 | static struct GNUNET_CRYPTO_EccPrivateKey *slave_key; | 54 | static struct GNUNET_CRYPTO_EccPrivateKey *slave_key; |
55 | 55 | ||
56 | static struct GNUNET_CRYPTO_EccPublicKey channel_pub_key; | 56 | static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key; |
57 | static struct GNUNET_CRYPTO_EccPublicKey slave_pub_key; | 57 | static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * Function called when the service shuts down. Unloads our psycstore | 60 | * Function called when the service shuts down. Unloads our psycstore |
@@ -174,8 +174,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
174 | channel_key = GNUNET_CRYPTO_ecc_key_create (); | 174 | channel_key = GNUNET_CRYPTO_ecc_key_create (); |
175 | slave_key = GNUNET_CRYPTO_ecc_key_create (); | 175 | slave_key = GNUNET_CRYPTO_ecc_key_create (); |
176 | 176 | ||
177 | GNUNET_CRYPTO_ecc_key_get_public (channel_key, &channel_pub_key); | 177 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key, &channel_pub_key); |
178 | GNUNET_CRYPTO_ecc_key_get_public (slave_key, &slave_pub_key); | 178 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key); |
179 | 179 | ||
180 | ASSERT (GNUNET_OK == db->membership_store(db->cls, &channel_pub_key, | 180 | ASSERT (GNUNET_OK == db->membership_store(db->cls, &channel_pub_key, |
181 | &slave_pub_key, GNUNET_YES, | 181 | &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; | |||
58 | static struct GNUNET_CRYPTO_EccPrivateKey *channel_key; | 58 | static struct GNUNET_CRYPTO_EccPrivateKey *channel_key; |
59 | static struct GNUNET_CRYPTO_EccPrivateKey *slave_key; | 59 | static struct GNUNET_CRYPTO_EccPrivateKey *slave_key; |
60 | 60 | ||
61 | static struct GNUNET_CRYPTO_EccPublicKey channel_pub_key; | 61 | static struct GNUNET_CRYPTO_EccPublicSignKey channel_pub_key; |
62 | static struct GNUNET_CRYPTO_EccPublicKey slave_pub_key; | 62 | static struct GNUNET_CRYPTO_EccPublicSignKey slave_pub_key; |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Clean up all resources used. | 65 | * Clean up all resources used. |
@@ -160,8 +160,8 @@ run (void *cls, | |||
160 | channel_key = GNUNET_CRYPTO_ecc_key_create (); | 160 | channel_key = GNUNET_CRYPTO_ecc_key_create (); |
161 | slave_key = GNUNET_CRYPTO_ecc_key_create (); | 161 | slave_key = GNUNET_CRYPTO_ecc_key_create (); |
162 | 162 | ||
163 | GNUNET_CRYPTO_ecc_key_get_public (channel_key, &channel_pub_key); | 163 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (channel_key, &channel_pub_key); |
164 | GNUNET_CRYPTO_ecc_key_get_public (slave_key, &slave_pub_key); | 164 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (slave_key, &slave_pub_key); |
165 | 165 | ||
166 | op = GNUNET_PSYCSTORE_membership_store (h, &channel_pub_key, &slave_pub_key, | 166 | op = GNUNET_PSYCSTORE_membership_store (h, &channel_pub_key, &slave_pub_key, |
167 | GNUNET_YES, 2, 2, 1, | 167 | 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, | |||
112 | ab.purpose.purpose = ntohl (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT); | 112 | ab.purpose.purpose = ntohl (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT); |
113 | ab.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_DHT_MAX_EXPIRATION)); | 113 | ab.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_DHT_MAX_EXPIRATION)); |
114 | ab.key = *key; | 114 | ab.key = *key; |
115 | GNUNET_CRYPTO_ecc_key_get_public (h->priv, | 115 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (h->priv, |
116 | &ab.public_key); | 116 | &ab.public_key); |
117 | GNUNET_assert (GNUNET_OK == | 117 | GNUNET_assert (GNUNET_OK == |
118 | GNUNET_CRYPTO_ecc_sign (h->priv, | 118 | GNUNET_CRYPTO_ecc_sign (h->priv, |
@@ -381,7 +381,7 @@ dht_get_string_accept_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
381 | "# regex accepting block bytes found", | 381 | "# regex accepting block bytes found", |
382 | size, GNUNET_NO); | 382 | size, GNUNET_NO); |
383 | GNUNET_CRYPTO_hash (&block->public_key, | 383 | GNUNET_CRYPTO_hash (&block->public_key, |
384 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 384 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
385 | &pid.hashPubKey); | 385 | &pid.hashPubKey); |
386 | info->callback (info->callback_cls, | 386 | info->callback (info->callback_cls, |
387 | &pid, | 387 | &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, | |||
701 | struct GNUNET_PeerIdentity *id) | 701 | struct GNUNET_PeerIdentity *id) |
702 | { | 702 | { |
703 | struct GNUNET_CRYPTO_EccPrivateKey *private_key; | 703 | struct GNUNET_CRYPTO_EccPrivateKey *private_key; |
704 | struct GNUNET_CRYPTO_EccPublicKey public_key; | 704 | struct GNUNET_CRYPTO_EccPublicSignKey public_key; |
705 | 705 | ||
706 | if ((NULL == id) || (NULL == system->hostkeys_data)) | 706 | if ((NULL == id) || (NULL == system->hostkeys_data)) |
707 | return NULL; | 707 | return NULL; |
@@ -722,9 +722,9 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, | |||
722 | _("Error while decoding key %u\n"), key_number); | 722 | _("Error while decoding key %u\n"), key_number); |
723 | return NULL; | 723 | return NULL; |
724 | } | 724 | } |
725 | GNUNET_CRYPTO_ecc_key_get_public (private_key, &public_key); | 725 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key, &public_key); |
726 | GNUNET_CRYPTO_hash (&public_key, | 726 | GNUNET_CRYPTO_hash (&public_key, |
727 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 727 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
728 | &(id->hashPubKey)); | 728 | &(id->hashPubKey)); |
729 | return private_key; | 729 | return private_key; |
730 | } | 730 | } |
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; | |||
70 | /** | 70 | /** |
71 | * Our public key. | 71 | * Our public key. |
72 | */ | 72 | */ |
73 | struct GNUNET_CRYPTO_EccPublicKey GST_my_public_key; | 73 | struct GNUNET_CRYPTO_EccPublicSignKey GST_my_public_key; |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * Our private key. | 76 | * Our private key. |
@@ -769,7 +769,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
769 | 769 | ||
770 | GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg); | 770 | GST_stats = GNUNET_STATISTICS_create ("transport", GST_cfg); |
771 | GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg); | 771 | GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg); |
772 | GNUNET_CRYPTO_ecc_key_get_public (GST_my_private_key, &GST_my_public_key); | 772 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (GST_my_private_key, &GST_my_public_key); |
773 | GNUNET_CRYPTO_hash (&GST_my_public_key, sizeof (GST_my_public_key), | 773 | GNUNET_CRYPTO_hash (&GST_my_public_key, sizeof (GST_my_public_key), |
774 | &GST_my_identity.hashPubKey); | 774 | &GST_my_identity.hashPubKey); |
775 | GNUNET_assert (NULL != GST_my_private_key); | 775 | 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; | |||
55 | /** | 55 | /** |
56 | * Our public key. | 56 | * Our public key. |
57 | */ | 57 | */ |
58 | extern struct GNUNET_CRYPTO_EccPublicKey GST_my_public_key; | 58 | extern struct GNUNET_CRYPTO_EccPublicSignKey GST_my_public_key; |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * Our private key. | 61 | * 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 | |||
329 | /** | 329 | /** |
330 | * Public key of the sender. | 330 | * Public key of the sender. |
331 | */ | 331 | */ |
332 | struct GNUNET_CRYPTO_EccPublicKey public_key; | 332 | struct GNUNET_CRYPTO_EccPublicSignKey public_key; |
333 | 333 | ||
334 | /** | 334 | /** |
335 | * Signature of the peer that sends us the disconnect. Only | 335 | * Signature of the peer that sends us the disconnect. Only |
@@ -1195,7 +1195,7 @@ send_disconnect (struct NeighbourMapEntry *n) | |||
1195 | disconnect_msg.reserved = htonl (0); | 1195 | disconnect_msg.reserved = htonl (0); |
1196 | disconnect_msg.purpose.size = | 1196 | disconnect_msg.purpose.size = |
1197 | htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 1197 | htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
1198 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 1198 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
1199 | sizeof (struct GNUNET_TIME_AbsoluteNBO)); | 1199 | sizeof (struct GNUNET_TIME_AbsoluteNBO)); |
1200 | disconnect_msg.purpose.purpose = | 1200 | disconnect_msg.purpose.purpose = |
1201 | htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); | 1201 | htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); |
@@ -3155,7 +3155,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity | |||
3155 | return; | 3155 | return; |
3156 | } | 3156 | } |
3157 | GNUNET_CRYPTO_hash (&sdm->public_key, | 3157 | GNUNET_CRYPTO_hash (&sdm->public_key, |
3158 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 3158 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
3159 | &hc); | 3159 | &hc); |
3160 | if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) | 3160 | if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) |
3161 | { | 3161 | { |
@@ -3164,7 +3164,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity | |||
3164 | } | 3164 | } |
3165 | if (ntohl (sdm->purpose.size) != | 3165 | if (ntohl (sdm->purpose.size) != |
3166 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 3166 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
3167 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + | 3167 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + |
3168 | sizeof (struct GNUNET_TIME_AbsoluteNBO)) | 3168 | sizeof (struct GNUNET_TIME_AbsoluteNBO)) |
3169 | { | 3169 | { |
3170 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3170 | 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 | |||
189 | /** | 189 | /** |
190 | * Public key of the peer. | 190 | * Public key of the peer. |
191 | */ | 191 | */ |
192 | struct GNUNET_CRYPTO_EccPublicKey public_key; | 192 | struct GNUNET_CRYPTO_EccPublicSignKey public_key; |
193 | 193 | ||
194 | /** | 194 | /** |
195 | * The identity of the peer. FIXME: duplicated (also in 'address') | 195 | * The identity of the peer. FIXME: duplicated (also in 'address') |
@@ -678,7 +678,7 @@ revalidate_address (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
678 | * if we don't have an existing entry and no public key was given | 678 | * if we don't have an existing entry and no public key was given |
679 | */ | 679 | */ |
680 | static struct ValidationEntry * | 680 | static struct ValidationEntry * |
681 | find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKey *public_key, | 681 | find_validation_entry (const struct GNUNET_CRYPTO_EccPublicSignKey *public_key, |
682 | const struct GNUNET_HELLO_Address *address) | 682 | const struct GNUNET_HELLO_Address *address) |
683 | { | 683 | { |
684 | struct ValidationEntryMatchContext vemc; | 684 | struct ValidationEntryMatchContext vemc; |
@@ -733,7 +733,7 @@ add_valid_address (void *cls, const struct GNUNET_HELLO_Address *address, | |||
733 | struct ValidationEntry *ve; | 733 | struct ValidationEntry *ve; |
734 | struct GNUNET_PeerIdentity pid; | 734 | struct GNUNET_PeerIdentity pid; |
735 | struct GNUNET_ATS_Information ats; | 735 | struct GNUNET_ATS_Information ats; |
736 | struct GNUNET_CRYPTO_EccPublicKey public_key; | 736 | struct GNUNET_CRYPTO_EccPublicSignKey public_key; |
737 | 737 | ||
738 | if (0 == GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us) | 738 | if (0 == GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us) |
739 | return GNUNET_OK; /* expired */ | 739 | return GNUNET_OK; /* expired */ |
@@ -855,7 +855,7 @@ GST_validation_stop () | |||
855 | */ | 855 | */ |
856 | static void | 856 | static void |
857 | multicast_pong (void *cls, | 857 | multicast_pong (void *cls, |
858 | const struct GNUNET_CRYPTO_EccPublicKey *public_key, | 858 | const struct GNUNET_CRYPTO_EccPublicSignKey *public_key, |
859 | struct GNUNET_TIME_Absolute valid_until, | 859 | struct GNUNET_TIME_Absolute valid_until, |
860 | struct GNUNET_TIME_Absolute validation_block, | 860 | struct GNUNET_TIME_Absolute validation_block, |
861 | const struct GNUNET_HELLO_Address *address) | 861 | const struct GNUNET_HELLO_Address *address) |
@@ -1141,7 +1141,7 @@ struct ValidateAddressContext | |||
1141 | /** | 1141 | /** |
1142 | * Public key of the peer whose address is being validated. | 1142 | * Public key of the peer whose address is being validated. |
1143 | */ | 1143 | */ |
1144 | struct GNUNET_CRYPTO_EccPublicKey public_key; | 1144 | struct GNUNET_CRYPTO_EccPublicSignKey public_key; |
1145 | }; | 1145 | }; |
1146 | 1146 | ||
1147 | 1147 | ||
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); | |||
134 | */ | 134 | */ |
135 | typedef void (*GST_ValidationAddressCallback) (void *cls, | 135 | typedef void (*GST_ValidationAddressCallback) (void *cls, |
136 | const struct | 136 | const struct |
137 | GNUNET_CRYPTO_EccPublicKey *public_key, | 137 | GNUNET_CRYPTO_EccPublicSignKey *public_key, |
138 | struct GNUNET_TIME_Absolute | 138 | struct GNUNET_TIME_Absolute |
139 | valid_until, | 139 | valid_until, |
140 | struct GNUNET_TIME_Absolute | 140 | 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 @@ | |||
48 | /** | 48 | /** |
49 | * Our public key. | 49 | * Our public key. |
50 | */ | 50 | */ |
51 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; | 51 | static struct GNUNET_CRYPTO_EccPublicSignKey my_public_key; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Our identity. | 54 | * Our identity. |
@@ -634,7 +634,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
634 | end_badly_now (); | 634 | end_badly_now (); |
635 | return; | 635 | return; |
636 | } | 636 | } |
637 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); | 637 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (my_private_key, &my_public_key); |
638 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), | 638 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
639 | &my_identity.hashPubKey); | 639 | &my_identity.hashPubKey); |
640 | 640 | ||
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 @@ | |||
35 | * structs that use 256 bits, so using a bigger curve will require | 35 | * structs that use 256 bits, so using a bigger curve will require |
36 | * changes that break stuff badly. The name of the curve given here | 36 | * changes that break stuff badly. The name of the curve given here |
37 | * must be agreed by all peers and be supported by libgcrypt. | 37 | * must be agreed by all peers and be supported by libgcrypt. |
38 | * | ||
39 | * NOTE: this will change to Curve25519 before GNUnet 0.10.0. | ||
38 | */ | 40 | */ |
39 | #define CURVE "NIST P-256" | 41 | #define CURVE "NIST P-256" |
40 | 42 | ||
@@ -113,11 +115,11 @@ key_from_sexp (gcry_mpi_t * array, gcry_sexp_t sexp, const char *topname, | |||
113 | 115 | ||
114 | 116 | ||
115 | /** | 117 | /** |
116 | * If target != size, move target bytes to the end of the size-sized | 118 | * If target != size, move @a target bytes to the end of the size-sized |
117 | * buffer and zero out the first target-size bytes. | 119 | * buffer and zero out the first @a target - @a size bytes. |
118 | * | 120 | * |
119 | * @param buf original buffer | 121 | * @param buf original buffer |
120 | * @param size number of bytes in the buffer | 122 | * @param size number of bytes in @a buf |
121 | * @param target target size of the buffer | 123 | * @param target target size of the buffer |
122 | */ | 124 | */ |
123 | static void | 125 | static void |
@@ -137,8 +139,8 @@ adjust (unsigned char *buf, | |||
137 | * Output the given MPI value to the given buffer. | 139 | * Output the given MPI value to the given buffer. |
138 | * | 140 | * |
139 | * @param buf where to output to | 141 | * @param buf where to output to |
140 | * @param size number of bytes in buf | 142 | * @param size number of bytes in @a buf |
141 | * @param val value to write to buf | 143 | * @param val value to write to @a buf |
142 | */ | 144 | */ |
143 | static void | 145 | static void |
144 | mpi_print (unsigned char *buf, | 146 | mpi_print (unsigned char *buf, |
@@ -227,7 +229,7 @@ decode_private_key (const struct GNUNET_CRYPTO_EccPrivateKey *priv) | |||
227 | static void | 229 | static void |
228 | point_to_public_key (gcry_mpi_point_t q, | 230 | point_to_public_key (gcry_mpi_point_t q, |
229 | gcry_ctx_t ctx, | 231 | gcry_ctx_t ctx, |
230 | struct GNUNET_CRYPTO_EccPublicKey *pub) | 232 | struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
231 | { | 233 | { |
232 | gcry_mpi_t q_x; | 234 | gcry_mpi_t q_x; |
233 | gcry_mpi_t q_y; | 235 | gcry_mpi_t q_y; |
@@ -254,8 +256,8 @@ point_to_public_key (gcry_mpi_point_t q, | |||
254 | * @param pub where to write the public key | 256 | * @param pub where to write the public key |
255 | */ | 257 | */ |
256 | void | 258 | void |
257 | GNUNET_CRYPTO_ecc_key_get_public (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | 259 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (const struct GNUNET_CRYPTO_EccPrivateKey *priv, |
258 | struct GNUNET_CRYPTO_EccPublicKey *pub) | 260 | struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
259 | { | 261 | { |
260 | gcry_sexp_t sexp; | 262 | gcry_sexp_t sexp; |
261 | gcry_ctx_t ctx; | 263 | gcry_ctx_t ctx; |
@@ -276,13 +278,13 @@ GNUNET_CRYPTO_ecc_key_get_public (const struct GNUNET_CRYPTO_EccPrivateKey *priv | |||
276 | * Convert a public key to a string. | 278 | * Convert a public key to a string. |
277 | * | 279 | * |
278 | * @param pub key to convert | 280 | * @param pub key to convert |
279 | * @return string representing 'pub' | 281 | * @return string representing @a pub |
280 | */ | 282 | */ |
281 | char * | 283 | char * |
282 | GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey *pub) | 284 | GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
283 | { | 285 | { |
284 | char *pubkeybuf; | 286 | char *pubkeybuf; |
285 | size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicKey)) * 8; | 287 | size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8; |
286 | char *end; | 288 | char *end; |
287 | 289 | ||
288 | if (keylen % 5 > 0) | 290 | if (keylen % 5 > 0) |
@@ -290,7 +292,7 @@ GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey | |||
290 | keylen /= 5; | 292 | keylen /= 5; |
291 | pubkeybuf = GNUNET_malloc (keylen + 1); | 293 | pubkeybuf = GNUNET_malloc (keylen + 1); |
292 | end = GNUNET_STRINGS_data_to_string ((unsigned char *) pub, | 294 | end = GNUNET_STRINGS_data_to_string ((unsigned char *) pub, |
293 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), | 295 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), |
294 | pubkeybuf, | 296 | pubkeybuf, |
295 | keylen); | 297 | keylen); |
296 | if (NULL == end) | 298 | if (NULL == end) |
@@ -307,16 +309,16 @@ GNUNET_CRYPTO_ecc_public_key_to_string (const struct GNUNET_CRYPTO_EccPublicKey | |||
307 | * Convert a string representing a public key to a public key. | 309 | * Convert a string representing a public key to a public key. |
308 | * | 310 | * |
309 | * @param enc encoded public key | 311 | * @param enc encoded public key |
310 | * @param enclen number of bytes in enc (without 0-terminator) | 312 | * @param enclen number of bytes in @a enc (without 0-terminator) |
311 | * @param pub where to store the public key | 313 | * @param pub where to store the public key |
312 | * @return #GNUNET_OK on success | 314 | * @return #GNUNET_OK on success |
313 | */ | 315 | */ |
314 | int | 316 | int |
315 | GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, | 317 | GNUNET_CRYPTO_ecc_public_sign_key_from_string (const char *enc, |
316 | size_t enclen, | 318 | size_t enclen, |
317 | struct GNUNET_CRYPTO_EccPublicKey *pub) | 319 | struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
318 | { | 320 | { |
319 | size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicKey)) * 8; | 321 | size_t keylen = (sizeof (struct GNUNET_CRYPTO_EccPublicSignKey)) * 8; |
320 | 322 | ||
321 | if (keylen % 5 > 0) | 323 | if (keylen % 5 > 0) |
322 | keylen += 5 - keylen % 5; | 324 | keylen += 5 - keylen % 5; |
@@ -326,7 +328,7 @@ GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, | |||
326 | 328 | ||
327 | if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen, | 329 | if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen, |
328 | pub, | 330 | pub, |
329 | sizeof (struct GNUNET_CRYPTO_EccPublicKey))) | 331 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey))) |
330 | return GNUNET_SYSERR; | 332 | return GNUNET_SYSERR; |
331 | return GNUNET_OK; | 333 | return GNUNET_OK; |
332 | } | 334 | } |
@@ -340,7 +342,7 @@ GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, | |||
340 | * @return NULL on error | 342 | * @return NULL on error |
341 | */ | 343 | */ |
342 | static gcry_sexp_t | 344 | static gcry_sexp_t |
343 | decode_public_key (const struct GNUNET_CRYPTO_EccPublicKey *pub) | 345 | decode_public_sign_key (const struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
344 | { | 346 | { |
345 | gcry_sexp_t pub_sexp; | 347 | gcry_sexp_t pub_sexp; |
346 | gcry_mpi_t q_x; | 348 | gcry_mpi_t q_x; |
@@ -620,6 +622,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename) | |||
620 | * Create a new private key by reading our peer's key from | 622 | * Create a new private key by reading our peer's key from |
621 | * the file specified in the configuration. | 623 | * the file specified in the configuration. |
622 | * | 624 | * |
625 | * @param cfg the configuration to use | ||
623 | * @return new private key, NULL on error (for example, | 626 | * @return new private key, NULL on error (for example, |
624 | * permission denied) | 627 | * permission denied) |
625 | */ | 628 | */ |
@@ -666,7 +669,7 @@ GNUNET_CRYPTO_ecc_setup_key (const char *cfg_name) | |||
666 | * | 669 | * |
667 | * @param cfg configuration to use | 670 | * @param cfg configuration to use |
668 | * @param dst pointer to where to write the peer identity | 671 | * @param dst pointer to where to write the peer identity |
669 | * @return GNUNET_OK on success, GNUNET_SYSERR if the identity | 672 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the identity |
670 | * could not be retrieved | 673 | * could not be retrieved |
671 | */ | 674 | */ |
672 | int | 675 | int |
@@ -674,7 +677,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
674 | struct GNUNET_PeerIdentity *dst) | 677 | struct GNUNET_PeerIdentity *dst) |
675 | { | 678 | { |
676 | struct GNUNET_CRYPTO_EccPrivateKey *priv; | 679 | struct GNUNET_CRYPTO_EccPrivateKey *priv; |
677 | struct GNUNET_CRYPTO_EccPublicKey pub; | 680 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
678 | 681 | ||
679 | if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg))) | 682 | if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg))) |
680 | { | 683 | { |
@@ -682,7 +685,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
682 | _("Could not load peer's private key\n")); | 685 | _("Could not load peer's private key\n")); |
683 | return GNUNET_SYSERR; | 686 | return GNUNET_SYSERR; |
684 | } | 687 | } |
685 | GNUNET_CRYPTO_ecc_key_get_public (priv, &pub); | 688 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &pub); |
686 | GNUNET_free (priv); | 689 | GNUNET_free (priv); |
687 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &dst->hashPubKey); | 690 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &dst->hashPubKey); |
688 | return GNUNET_OK; | 691 | return GNUNET_OK; |
@@ -723,7 +726,7 @@ data_to_pkcs1 (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose) | |||
723 | * @param priv private key to use for the signing | 726 | * @param priv private key to use for the signing |
724 | * @param purpose what to sign (size, purpose) | 727 | * @param purpose what to sign (size, purpose) |
725 | * @param sig where to write the signature | 728 | * @param sig where to write the signature |
726 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 729 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
727 | */ | 730 | */ |
728 | int | 731 | int |
729 | GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | 732 | GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv, |
@@ -774,14 +777,14 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
774 | * @param validate block to validate (size, purpose, data) | 777 | * @param validate block to validate (size, purpose, data) |
775 | * @param sig signature that is being validated | 778 | * @param sig signature that is being validated |
776 | * @param pub public key of the signer | 779 | * @param pub public key of the signer |
777 | * @returns GNUNET_OK if ok, GNUNET_SYSERR if invalid | 780 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid |
778 | */ | 781 | */ |
779 | int | 782 | int |
780 | GNUNET_CRYPTO_ecc_verify (uint32_t purpose, | 783 | GNUNET_CRYPTO_ecc_verify (uint32_t purpose, |
781 | const struct GNUNET_CRYPTO_EccSignaturePurpose | 784 | const struct GNUNET_CRYPTO_EccSignaturePurpose |
782 | *validate, | 785 | *validate, |
783 | const struct GNUNET_CRYPTO_EccSignature *sig, | 786 | const struct GNUNET_CRYPTO_EccSignature *sig, |
784 | const struct GNUNET_CRYPTO_EccPublicKey *pub) | 787 | const struct GNUNET_CRYPTO_EccPublicSignKey *pub) |
785 | { | 788 | { |
786 | gcry_sexp_t data; | 789 | gcry_sexp_t data; |
787 | gcry_sexp_t sig_sexpr; | 790 | gcry_sexp_t sig_sexpr; |
@@ -808,7 +811,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, | |||
808 | gcry_mpi_release (r); | 811 | gcry_mpi_release (r); |
809 | gcry_mpi_release (s); | 812 | gcry_mpi_release (s); |
810 | data = data_to_pkcs1 (validate); | 813 | data = data_to_pkcs1 (validate); |
811 | if (! (pub_sexpr = decode_public_key (pub))) | 814 | if (! (pub_sexpr = decode_public_sign_key (pub))) |
812 | { | 815 | { |
813 | gcry_sexp_release (data); | 816 | gcry_sexp_release (data); |
814 | gcry_sexp_release (sig_sexpr); | 817 | gcry_sexp_release (sig_sexpr); |
@@ -830,6 +833,41 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, | |||
830 | 833 | ||
831 | 834 | ||
832 | /** | 835 | /** |
836 | * Convert the given public key from the network format to the | ||
837 | * S-expression that can be used by libgcrypt. | ||
838 | * | ||
839 | * @param pub public key to decode | ||
840 | * @return NULL on error | ||
841 | */ | ||
842 | static gcry_sexp_t | ||
843 | decode_public_encrypt_key (const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub) | ||
844 | { | ||
845 | gcry_sexp_t pub_sexp; | ||
846 | gcry_mpi_t q_x; | ||
847 | gcry_mpi_t q_y; | ||
848 | gcry_mpi_point_t q; | ||
849 | gcry_ctx_t ctx; | ||
850 | |||
851 | mpi_scan (&q_x, pub->q_x, sizeof (pub->q_x)); | ||
852 | mpi_scan (&q_y, pub->q_y, sizeof (pub->q_y)); | ||
853 | q = gcry_mpi_point_new (256); | ||
854 | gcry_mpi_point_set (q, q_x, q_y, GCRYMPI_CONST_ONE); | ||
855 | gcry_mpi_release (q_x); | ||
856 | gcry_mpi_release (q_y); | ||
857 | |||
858 | /* initialize 'ctx' with 'q' */ | ||
859 | GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); | ||
860 | gcry_mpi_ec_set_point ("q", q, ctx); | ||
861 | gcry_mpi_point_release (q); | ||
862 | |||
863 | /* convert 'ctx' to 'sexp' */ | ||
864 | GNUNET_assert (0 == gcry_pubkey_get_sexp (&pub_sexp, GCRY_PK_GET_PUBKEY, ctx)); | ||
865 | gcry_ctx_release (ctx); | ||
866 | return pub_sexp; | ||
867 | } | ||
868 | |||
869 | |||
870 | /** | ||
833 | * Derive key material from a public and a private ECC key. | 871 | * Derive key material from a public and a private ECC key. |
834 | * | 872 | * |
835 | * @param priv private key to use for the ECDH (x) | 873 | * @param priv private key to use for the ECDH (x) |
@@ -839,7 +877,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose, | |||
839 | */ | 877 | */ |
840 | int | 878 | int |
841 | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | 879 | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, |
842 | const struct GNUNET_CRYPTO_EccPublicKey *pub, | 880 | const struct GNUNET_CRYPTO_EccPublicEncryptKey *pub, |
843 | struct GNUNET_HashCode *key_material) | 881 | struct GNUNET_HashCode *key_material) |
844 | { | 882 | { |
845 | gcry_mpi_point_t result; | 883 | gcry_mpi_point_t result; |
@@ -852,7 +890,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
852 | unsigned char xbuf[256 / 8]; | 890 | unsigned char xbuf[256 / 8]; |
853 | 891 | ||
854 | /* first, extract the q = dP value from the public key */ | 892 | /* first, extract the q = dP value from the public key */ |
855 | if (! (pub_sexpr = decode_public_key (pub))) | 893 | if (! (pub_sexpr = decode_public_encrypt_key (pub))) |
856 | return GNUNET_SYSERR; | 894 | return GNUNET_SYSERR; |
857 | GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, pub_sexpr, NULL)); | 895 | GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, pub_sexpr, NULL)); |
858 | gcry_sexp_release (pub_sexpr); | 896 | gcry_sexp_release (pub_sexpr); |
@@ -899,7 +937,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
899 | * @return h value | 937 | * @return h value |
900 | */ | 938 | */ |
901 | static gcry_mpi_t | 939 | static gcry_mpi_t |
902 | derive_h (const struct GNUNET_CRYPTO_EccPublicKey *pub, | 940 | derive_h (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
903 | const char *label, | 941 | const char *label, |
904 | const char *context) | 942 | const char *context) |
905 | { | 943 | { |
@@ -934,7 +972,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
934 | const char *label, | 972 | const char *label, |
935 | const char *context) | 973 | const char *context) |
936 | { | 974 | { |
937 | struct GNUNET_CRYPTO_EccPublicKey pub; | 975 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
938 | struct GNUNET_CRYPTO_EccPrivateKey *ret; | 976 | struct GNUNET_CRYPTO_EccPrivateKey *ret; |
939 | gcry_mpi_t h; | 977 | gcry_mpi_t h; |
940 | gcry_mpi_t x; | 978 | gcry_mpi_t x; |
@@ -944,7 +982,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
944 | 982 | ||
945 | GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); | 983 | GNUNET_assert (0 == gcry_mpi_ec_new (&ctx, NULL, CURVE)); |
946 | n = gcry_mpi_ec_get_mpi ("n", ctx, 1); | 984 | n = gcry_mpi_ec_get_mpi ("n", ctx, 1); |
947 | GNUNET_CRYPTO_ecc_key_get_public (priv, &pub); | 985 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &pub); |
948 | h = derive_h (&pub, label, context); | 986 | h = derive_h (&pub, label, context); |
949 | mpi_scan (&x, priv->d, sizeof (priv->d)); | 987 | mpi_scan (&x, priv->d, sizeof (priv->d)); |
950 | d = gcry_mpi_new (256); | 988 | d = gcry_mpi_new (256); |
@@ -971,10 +1009,10 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv, | |||
971 | * @param result where to write the derived public key | 1009 | * @param result where to write the derived public key |
972 | */ | 1010 | */ |
973 | void | 1011 | void |
974 | GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicKey *pub, | 1012 | GNUNET_CRYPTO_ecc_public_key_derive (const struct GNUNET_CRYPTO_EccPublicSignKey *pub, |
975 | const char *label, | 1013 | const char *label, |
976 | const char *context, | 1014 | const char *context, |
977 | struct GNUNET_CRYPTO_EccPublicKey *result) | 1015 | struct GNUNET_CRYPTO_EccPublicSignKey *result) |
978 | { | 1016 | { |
979 | gcry_ctx_t ctx; | 1017 | gcry_ctx_t ctx; |
980 | gcry_mpi_t h; | 1018 | 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, | |||
110 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 110 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
111 | { | 111 | { |
112 | struct GNUNET_CRYPTO_EccPrivateKey *pk; | 112 | struct GNUNET_CRYPTO_EccPrivateKey *pk; |
113 | struct GNUNET_CRYPTO_EccPublicKey pub; | 113 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
114 | struct GNUNET_PeerIdentity pid; | 114 | struct GNUNET_PeerIdentity pid; |
115 | 115 | ||
116 | if (NULL == args[0]) | 116 | if (NULL == args[0]) |
@@ -130,7 +130,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
130 | { | 130 | { |
131 | char *s; | 131 | char *s; |
132 | 132 | ||
133 | GNUNET_CRYPTO_ecc_key_get_public (pk, &pub); | 133 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub); |
134 | s = GNUNET_CRYPTO_ecc_public_key_to_string (&pub); | 134 | s = GNUNET_CRYPTO_ecc_public_key_to_string (&pub); |
135 | fprintf (stdout, "%s\n", s); | 135 | fprintf (stdout, "%s\n", s); |
136 | GNUNET_free (s); | 136 | GNUNET_free (s); |
@@ -139,7 +139,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
139 | { | 139 | { |
140 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; | 140 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; |
141 | 141 | ||
142 | GNUNET_CRYPTO_ecc_key_get_public (pk, &pub); | 142 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub); |
143 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey); | 143 | GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey); |
144 | GNUNET_CRYPTO_hash_to_enc (&pid.hashPubKey, &enc); | 144 | GNUNET_CRYPTO_hash_to_enc (&pid.hashPubKey, &enc); |
145 | fprintf (stdout, "%s\n", enc.encoding); | 145 | 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 () | |||
43 | { | 43 | { |
44 | struct GNUNET_CRYPTO_EccSignature sig; | 44 | struct GNUNET_CRYPTO_EccSignature sig; |
45 | struct GNUNET_CRYPTO_EccSignaturePurpose purp; | 45 | struct GNUNET_CRYPTO_EccSignaturePurpose purp; |
46 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 46 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
47 | int i; | 47 | int i; |
48 | struct GNUNET_TIME_Absolute start; | 48 | struct GNUNET_TIME_Absolute start; |
49 | int ok = GNUNET_OK; | 49 | int ok = GNUNET_OK; |
50 | 50 | ||
51 | FPRINTF (stderr, "%s", "W"); | 51 | FPRINTF (stderr, "%s", "W"); |
52 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 52 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
53 | start = GNUNET_TIME_absolute_get (); | 53 | start = GNUNET_TIME_absolute_get (); |
54 | purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); | 54 | purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); |
55 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); | 55 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); |
@@ -92,11 +92,11 @@ testDeriveSignVerify () | |||
92 | struct GNUNET_CRYPTO_EccSignature sig; | 92 | struct GNUNET_CRYPTO_EccSignature sig; |
93 | struct GNUNET_CRYPTO_EccSignaturePurpose purp; | 93 | struct GNUNET_CRYPTO_EccSignaturePurpose purp; |
94 | struct GNUNET_CRYPTO_EccPrivateKey *dpriv; | 94 | struct GNUNET_CRYPTO_EccPrivateKey *dpriv; |
95 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 95 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
96 | struct GNUNET_CRYPTO_EccPublicKey dpub; | 96 | struct GNUNET_CRYPTO_EccPublicSignKey dpub; |
97 | 97 | ||
98 | dpriv = GNUNET_CRYPTO_ecc_key_derive (key, "test-derive", "test-CTX"); | 98 | dpriv = GNUNET_CRYPTO_ecc_key_derive (key, "test-derive", "test-CTX"); |
99 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 99 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
100 | GNUNET_CRYPTO_ecc_public_key_derive (&pkey, "test-derive", "test-CTX", &dpub); | 100 | GNUNET_CRYPTO_ecc_public_key_derive (&pkey, "test-derive", "test-CTX", &dpub); |
101 | purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); | 101 | purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); |
102 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); | 102 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); |
@@ -146,7 +146,7 @@ testSignPerformance () | |||
146 | { | 146 | { |
147 | struct GNUNET_CRYPTO_EccSignaturePurpose purp; | 147 | struct GNUNET_CRYPTO_EccSignaturePurpose purp; |
148 | struct GNUNET_CRYPTO_EccSignature sig; | 148 | struct GNUNET_CRYPTO_EccSignature sig; |
149 | struct GNUNET_CRYPTO_EccPublicKey pkey; | 149 | struct GNUNET_CRYPTO_EccPublicSignKey pkey; |
150 | int i; | 150 | int i; |
151 | struct GNUNET_TIME_Absolute start; | 151 | struct GNUNET_TIME_Absolute start; |
152 | int ok = GNUNET_OK; | 152 | int ok = GNUNET_OK; |
@@ -154,7 +154,7 @@ testSignPerformance () | |||
154 | purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); | 154 | purp.size = htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)); |
155 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); | 155 | purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); |
156 | FPRINTF (stderr, "%s", "W"); | 156 | FPRINTF (stderr, "%s", "W"); |
157 | GNUNET_CRYPTO_ecc_key_get_public (key, &pkey); | 157 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &pkey); |
158 | start = GNUNET_TIME_absolute_get (); | 158 | start = GNUNET_TIME_absolute_get (); |
159 | for (i = 0; i < ITER; i++) | 159 | for (i = 0; i < ITER; i++) |
160 | { | 160 | { |
@@ -177,22 +177,22 @@ testSignPerformance () | |||
177 | static int | 177 | static int |
178 | testCreateFromFile () | 178 | testCreateFromFile () |
179 | { | 179 | { |
180 | struct GNUNET_CRYPTO_EccPublicKey p1; | 180 | struct GNUNET_CRYPTO_EccPublicSignKey p1; |
181 | struct GNUNET_CRYPTO_EccPublicKey p2; | 181 | struct GNUNET_CRYPTO_EccPublicSignKey p2; |
182 | 182 | ||
183 | key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); | 183 | key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); |
184 | GNUNET_assert (NULL != key); | 184 | GNUNET_assert (NULL != key); |
185 | GNUNET_CRYPTO_ecc_key_get_public (key, &p1); | 185 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &p1); |
186 | GNUNET_free (key); | 186 | GNUNET_free (key); |
187 | key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); | 187 | key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); |
188 | GNUNET_assert (NULL != key); | 188 | GNUNET_assert (NULL != key); |
189 | GNUNET_CRYPTO_ecc_key_get_public (key, &p2); | 189 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &p2); |
190 | GNUNET_assert (0 == memcmp (&p1, &p2, sizeof (p1))); | 190 | GNUNET_assert (0 == memcmp (&p1, &p2, sizeof (p1))); |
191 | GNUNET_free (key); | 191 | GNUNET_free (key); |
192 | GNUNET_assert (0 == UNLINK (KEYFILE)); | 192 | GNUNET_assert (0 == UNLINK (KEYFILE)); |
193 | key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); | 193 | key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE); |
194 | GNUNET_assert (NULL != key); | 194 | GNUNET_assert (NULL != key); |
195 | GNUNET_CRYPTO_ecc_key_get_public (key, &p2); | 195 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (key, &p2); |
196 | GNUNET_assert (0 != memcmp (&p1, &p2, sizeof (p1))); | 196 | GNUNET_assert (0 != memcmp (&p1, &p2, sizeof (p1))); |
197 | GNUNET_free (key); | 197 | GNUNET_free (key); |
198 | return GNUNET_OK; | 198 | return GNUNET_OK; |
@@ -204,15 +204,15 @@ test_ecdh () | |||
204 | { | 204 | { |
205 | struct GNUNET_CRYPTO_EccPrivateKey *priv1; | 205 | struct GNUNET_CRYPTO_EccPrivateKey *priv1; |
206 | struct GNUNET_CRYPTO_EccPrivateKey *priv2; | 206 | struct GNUNET_CRYPTO_EccPrivateKey *priv2; |
207 | struct GNUNET_CRYPTO_EccPublicKey pub1; | 207 | struct GNUNET_CRYPTO_EccPublicSignKey pub1; |
208 | struct GNUNET_CRYPTO_EccPublicKey pub2; | 208 | struct GNUNET_CRYPTO_EccPublicSignKey pub2; |
209 | struct GNUNET_HashCode ecdh1; | 209 | struct GNUNET_HashCode ecdh1; |
210 | struct GNUNET_HashCode ecdh2; | 210 | struct GNUNET_HashCode ecdh2; |
211 | 211 | ||
212 | priv1 = GNUNET_CRYPTO_ecc_key_create (); | 212 | priv1 = GNUNET_CRYPTO_ecc_key_create (); |
213 | priv2 = GNUNET_CRYPTO_ecc_key_create (); | 213 | priv2 = GNUNET_CRYPTO_ecc_key_create (); |
214 | GNUNET_CRYPTO_ecc_key_get_public (priv1, &pub1); | 214 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv1, &pub1); |
215 | GNUNET_CRYPTO_ecc_key_get_public (priv2, &pub2); | 215 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv2, &pub2); |
216 | GNUNET_CRYPTO_ecc_ecdh (priv1, &pub2, &ecdh1); | 216 | GNUNET_CRYPTO_ecc_ecdh (priv1, &pub2, &ecdh1); |
217 | GNUNET_CRYPTO_ecc_ecdh (priv2, &pub1, &ecdh2); | 217 | GNUNET_CRYPTO_ecc_ecdh (priv2, &pub1, &ecdh2); |
218 | GNUNET_assert (0 == memcmp (&ecdh1, &ecdh2, | 218 | GNUNET_assert (0 == memcmp (&ecdh1, &ecdh2, |