aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-10 14:38:55 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-10 14:38:55 +0000
commit9351b1e9bdf2b067b6db06562c26ba658cff42b8 (patch)
tree68dc4ab447e7e8b6a20a706858cd36238c1c7c5f /src/transport/gnunet-service-transport_neighbours.c
parent8beabcd96c0cf1e1873c0b5ff96e537f1beb0b34 (diff)
downloadgnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.tar.gz
gnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.zip
separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 0cffe0aeb..d89aa2f32 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -329,14 +329,14 @@ struct SessionDisconnectMessage
329 /** 329 /**
330 * Public key of the sender. 330 * Public key of the sender.
331 */ 331 */
332 struct GNUNET_CRYPTO_EccPublicSignKey public_key; 332 struct GNUNET_CRYPTO_EddsaPublicKey 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
336 * valid if the timestamp is AFTER the timestamp from the 336 * valid if the timestamp is AFTER the timestamp from the
337 * corresponding 'CONNECT' message. 337 * corresponding 'CONNECT' message.
338 */ 338 */
339 struct GNUNET_CRYPTO_EccSignature signature; 339 struct GNUNET_CRYPTO_EddsaSignature signature;
340 340
341}; 341};
342 342
@@ -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_EccPublicSignKey) + 1198 sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
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);
@@ -1203,7 +1203,7 @@ send_disconnect (struct NeighbourMapEntry *n)
1203 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 1203 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
1204 disconnect_msg.public_key = GST_my_identity.public_key; 1204 disconnect_msg.public_key = GST_my_identity.public_key;
1205 GNUNET_assert (GNUNET_OK == 1205 GNUNET_assert (GNUNET_OK ==
1206 GNUNET_CRYPTO_ecc_sign (GST_my_private_key, 1206 GNUNET_CRYPTO_eddsa_sign (GST_my_private_key,
1207 &disconnect_msg.purpose, 1207 &disconnect_msg.purpose,
1208 &disconnect_msg.signature)); 1208 &disconnect_msg.signature));
1209 1209
@@ -3157,7 +3157,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
3157 return; 3157 return;
3158 } 3158 }
3159 GNUNET_CRYPTO_hash (&sdm->public_key, 3159 GNUNET_CRYPTO_hash (&sdm->public_key,
3160 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), 3160 sizeof (struct GNUNET_CRYPTO_EddsaPublicKey),
3161 &hc); 3161 &hc);
3162 if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) 3162 if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity)))
3163 { 3163 {
@@ -3166,7 +3166,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
3166 } 3166 }
3167 if (ntohl (sdm->purpose.size) != 3167 if (ntohl (sdm->purpose.size) !=
3168 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + 3168 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
3169 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + 3169 sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) +
3170 sizeof (struct GNUNET_TIME_AbsoluteNBO)) 3170 sizeof (struct GNUNET_TIME_AbsoluteNBO))
3171 { 3171 {
3172 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3172 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -3177,7 +3177,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
3177 return; 3177 return;
3178 } 3178 }
3179 if (GNUNET_OK != 3179 if (GNUNET_OK !=
3180 GNUNET_CRYPTO_ecc_verify 3180 GNUNET_CRYPTO_eddsa_verify
3181 (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, &sdm->purpose, 3181 (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, &sdm->purpose,
3182 &sdm->signature, &sdm->public_key)) 3182 &sdm->signature, &sdm->public_key))
3183 { 3183 {