aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-02-05 20:49:21 +0000
committerChristian Grothoff <christian@grothoff.org>2013-02-05 20:49:21 +0000
commitca35f67faee8371fa763bdf49f04a8d5d4cdc021 (patch)
tree5535df5e5a2428ed838c6a0e60b2c6c68a7842c5 /src/transport/gnunet-service-transport_neighbours.c
parentdd7cca21c5dbaef4d56f92bab3932f0f73d092d1 (diff)
downloadgnunet-ca35f67faee8371fa763bdf49f04a8d5d4cdc021.tar.gz
gnunet-ca35f67faee8371fa763bdf49f04a8d5d4cdc021.zip
switching to ECDHE cryptography f, implementation is incomplete and INSECURE, do not use for anything but testing
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index cad325d98..8c8397ee2 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -318,7 +318,7 @@ struct SessionDisconnectMessage
318 * Purpose of the signature. Extends over the timestamp. 318 * Purpose of the signature. Extends over the timestamp.
319 * Purpose should be GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DISCONNECT. 319 * Purpose should be GNUNET_SIGNATURE_PURPOSE_TRANSPORT_DISCONNECT.
320 */ 320 */
321 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; 321 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
322 322
323 /** 323 /**
324 * Absolute time at the sender. Only the most recent connect 324 * Absolute time at the sender. Only the most recent connect
@@ -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_RsaPublicKeyBinaryEncoded public_key; 332 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded 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_RsaSignature signature; 339 struct GNUNET_CRYPTO_EccSignature signature;
340 340
341}; 341};
342 342
@@ -1205,8 +1205,8 @@ send_disconnect (struct NeighbourMapEntry *n)
1205 htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); 1205 htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT);
1206 disconnect_msg.reserved = htonl (0); 1206 disconnect_msg.reserved = htonl (0);
1207 disconnect_msg.purpose.size = 1207 disconnect_msg.purpose.size =
1208 htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) + 1208 htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
1209 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 1209 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) +
1210 sizeof (struct GNUNET_TIME_AbsoluteNBO)); 1210 sizeof (struct GNUNET_TIME_AbsoluteNBO));
1211 disconnect_msg.purpose.purpose = 1211 disconnect_msg.purpose.purpose =
1212 htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT); 1212 htonl (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT);
@@ -1214,7 +1214,7 @@ send_disconnect (struct NeighbourMapEntry *n)
1214 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()); 1214 GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ());
1215 disconnect_msg.public_key = GST_my_public_key; 1215 disconnect_msg.public_key = GST_my_public_key;
1216 GNUNET_assert (GNUNET_OK == 1216 GNUNET_assert (GNUNET_OK ==
1217 GNUNET_CRYPTO_rsa_sign (GST_my_private_key, 1217 GNUNET_CRYPTO_ecc_sign (GST_my_private_key,
1218 &disconnect_msg.purpose, 1218 &disconnect_msg.purpose,
1219 &disconnect_msg.signature)); 1219 &disconnect_msg.signature));
1220 1220
@@ -3195,7 +3195,7 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
3195 return; 3195 return;
3196 } 3196 }
3197 GNUNET_CRYPTO_hash (&sdm->public_key, 3197 GNUNET_CRYPTO_hash (&sdm->public_key,
3198 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), 3198 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
3199 &hc); 3199 &hc);
3200 if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity))) 3200 if (0 != memcmp (peer, &hc, sizeof (struct GNUNET_PeerIdentity)))
3201 { 3201 {
@@ -3203,15 +3203,15 @@ GST_neighbours_handle_disconnect_message (const struct GNUNET_PeerIdentity
3203 return; 3203 return;
3204 } 3204 }
3205 if (ntohl (sdm->purpose.size) != 3205 if (ntohl (sdm->purpose.size) !=
3206 sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) + 3206 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
3207 sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded) + 3207 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded) +
3208 sizeof (struct GNUNET_TIME_AbsoluteNBO)) 3208 sizeof (struct GNUNET_TIME_AbsoluteNBO))
3209 { 3209 {
3210 GNUNET_break_op (0); 3210 GNUNET_break_op (0);
3211 return; 3211 return;
3212 } 3212 }
3213 if (GNUNET_OK != 3213 if (GNUNET_OK !=
3214 GNUNET_CRYPTO_rsa_verify 3214 GNUNET_CRYPTO_ecc_verify
3215 (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, &sdm->purpose, 3215 (GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT, &sdm->purpose,
3216 &sdm->signature, &sdm->public_key)) 3216 &sdm->signature, &sdm->public_key))
3217 { 3217 {