diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-13 12:00:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-13 12:00:01 +0000 |
commit | a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae (patch) | |
tree | b7768c5cb22e8a4f84d51cbd06dc04861fdb8510 /src/fs | |
parent | 95d42fdcb47eedcf2747614a22dacd676bc7faae (diff) | |
download | gnunet-a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae.tar.gz gnunet-a35c5a11d32bdd0bc24f64de36fbc6b0d0b20aae.zip |
splitting 'struct GNUNET_CRYPTO_EccPublicKey' into one struct for signing and another for encryption
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_api.h | 6 | ||||
-rw-r--r-- | src/fs/fs_namespace.c | 6 | ||||
-rw-r--r-- | src/fs/fs_publish_ublock.c | 10 | ||||
-rw-r--r-- | src/fs/fs_publish_ublock.h | 2 | ||||
-rw-r--r-- | src/fs/fs_search.c | 16 | ||||
-rw-r--r-- | src/fs/fs_unindex.c | 6 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 26 | ||||
-rw-r--r-- | src/fs/test_fs_namespace.c | 4 | ||||
-rw-r--r-- | src/fs/test_fs_uri.c | 4 |
9 files changed, 40 insertions, 40 deletions
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); |