diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-06 14:18:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-06 14:18:31 +0000 |
commit | fe76c075e315c0351e2fe465434ae39087daf014 (patch) | |
tree | 436887ccaf331932a3c13a8b9d2a2a710dad4be6 /src/transport | |
parent | 7eb2835d8a494c83aedb720a2ac6f6e5ba23f22f (diff) | |
download | gnunet-fe76c075e315c0351e2fe465434ae39087daf014.tar.gz gnunet-fe76c075e315c0351e2fe465434ae39087daf014.zip |
moving to new, fixed-size encoding of public and private ECC keys everywhere, also improving ECC API to better support ECRS/GADS operations
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 2 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport.h | 2 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 8 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 14 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_validation.h | 3 | ||||
-rw-r--r-- | src/transport/test_plugin_transport.c | 2 |
6 files changed, 15 insertions, 16 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 0039b9a4c..3ef5e1dbf 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_EccPublicKeyBinaryEncoded GST_my_public_key; | 73 | struct GNUNET_CRYPTO_EccPublicKey GST_my_public_key; |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * Our private key. | 76 | * Our private key. |
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h index cb2c11a9b..a9f455b6a 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_EccPublicKeyBinaryEncoded GST_my_public_key; | 58 | extern struct GNUNET_CRYPTO_EccPublicKey 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 269525a55..e0e549a3a 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_EccPublicKeyBinaryEncoded public_key; | 332 | struct GNUNET_CRYPTO_EccPublicKey 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_EccPublicKeyBinaryEncoded) + | 1198 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + |
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); |
@@ -3151,7 +3151,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity | |||
3151 | return; | 3151 | return; |
3152 | } | 3152 | } |
3153 | GNUNET_CRYPTO_hash (&sdm->public_key, | 3153 | GNUNET_CRYPTO_hash (&sdm->public_key, |
3154 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), | 3154 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), |
3155 | &hc); | 3155 | &hc); |
3156 | if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) | 3156 | if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) |
3157 | { | 3157 | { |
@@ -3160,7 +3160,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity | |||
3160 | } | 3160 | } |
3161 | if (ntohl (sdm->purpose.size) != | 3161 | if (ntohl (sdm->purpose.size) != |
3162 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + | 3162 | sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + |
3163 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) + | 3163 | sizeof (struct GNUNET_CRYPTO_EccPublicKey) + |
3164 | sizeof (struct GNUNET_TIME_AbsoluteNBO)) | 3164 | sizeof (struct GNUNET_TIME_AbsoluteNBO)) |
3165 | { | 3165 | { |
3166 | GNUNET_break_op (0); | 3166 | GNUNET_break_op (0); |
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 4ea0f07a6..087c52411 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_EccPublicKeyBinaryEncoded public_key; | 192 | struct GNUNET_CRYPTO_EccPublicKey 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') |
@@ -682,8 +682,8 @@ revalidate_address (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
682 | * if we don't have an existing entry and no public key was given | 682 | * if we don't have an existing entry and no public key was given |
683 | */ | 683 | */ |
684 | static struct ValidationEntry * | 684 | static struct ValidationEntry * |
685 | find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded | 685 | find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKey *public_key, |
686 | *public_key, const struct GNUNET_HELLO_Address *address) | 686 | const struct GNUNET_HELLO_Address *address) |
687 | { | 687 | { |
688 | struct ValidationEntryMatchContext vemc; | 688 | struct ValidationEntryMatchContext vemc; |
689 | struct ValidationEntry *ve; | 689 | struct ValidationEntry *ve; |
@@ -737,7 +737,7 @@ add_valid_address (void *cls, const struct GNUNET_HELLO_Address *address, | |||
737 | struct ValidationEntry *ve; | 737 | struct ValidationEntry *ve; |
738 | struct GNUNET_PeerIdentity pid; | 738 | struct GNUNET_PeerIdentity pid; |
739 | struct GNUNET_ATS_Information ats; | 739 | struct GNUNET_ATS_Information ats; |
740 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; | 740 | struct GNUNET_CRYPTO_EccPublicKey public_key; |
741 | 741 | ||
742 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0) | 742 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0) |
743 | return GNUNET_OK; /* expired */ | 743 | return GNUNET_OK; /* expired */ |
@@ -857,8 +857,8 @@ GST_validation_stop () | |||
857 | */ | 857 | */ |
858 | static void | 858 | static void |
859 | multicast_pong (void *cls, | 859 | multicast_pong (void *cls, |
860 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded | 860 | const struct GNUNET_CRYPTO_EccPublicKey *public_key, |
861 | *public_key, struct GNUNET_TIME_Absolute valid_until, | 861 | struct GNUNET_TIME_Absolute valid_until, |
862 | struct GNUNET_TIME_Absolute validation_block, | 862 | struct GNUNET_TIME_Absolute validation_block, |
863 | const struct GNUNET_HELLO_Address *address) | 863 | const struct GNUNET_HELLO_Address *address) |
864 | { | 864 | { |
@@ -1139,7 +1139,7 @@ struct ValidateAddressContext | |||
1139 | /** | 1139 | /** |
1140 | * Public key of the peer whose address is being validated. | 1140 | * Public key of the peer whose address is being validated. |
1141 | */ | 1141 | */ |
1142 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; | 1142 | struct GNUNET_CRYPTO_EccPublicKey public_key; |
1143 | }; | 1143 | }; |
1144 | 1144 | ||
1145 | 1145 | ||
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index 929e97a5c..46d3162c4 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h | |||
@@ -134,8 +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_EccPublicKeyBinaryEncoded | 137 | GNUNET_CRYPTO_EccPublicKey *public_key, |
138 | * public_key, | ||
139 | struct GNUNET_TIME_Absolute | 138 | struct GNUNET_TIME_Absolute |
140 | valid_until, | 139 | valid_until, |
141 | 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 c48fc2d49..ffaad19ff 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_EccPublicKeyBinaryEncoded my_public_key; | 51 | static struct GNUNET_CRYPTO_EccPublicKey my_public_key; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Our identity. | 54 | * Our identity. |