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/psycstore | |
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/psycstore')
-rw-r--r-- | src/psycstore/plugin_psycstore_sqlite.c | 38 | ||||
-rw-r--r-- | src/psycstore/psycstore.h | 8 | ||||
-rw-r--r-- | src/psycstore/psycstore_api.c | 8 | ||||
-rw-r--r-- | src/psycstore/test_plugin_psycstore.c | 8 | ||||
-rw-r--r-- | src/psycstore/test_psycstore.c | 8 |
5 files changed, 35 insertions, 35 deletions
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, |