aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport.c23
-rw-r--r--src/transport/gnunet-service-transport.h4
-rw-r--r--src/transport/gnunet-service-transport_hello.c4
-rw-r--r--src/transport/gnunet-service-transport_hello.h2
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c20
-rw-r--r--src/transport/gnunet-service-transport_validation.c26
-rw-r--r--src/transport/gnunet-service-transport_validation.h2
-rw-r--r--src/transport/test_plugin_transport.c12
8 files changed, 44 insertions, 49 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index e64cbfbfe..513a660ac 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -65,7 +65,7 @@ struct GNUNET_PEERINFO_Handle *GST_peerinfo;
65/** 65/**
66 * Hostkey generation context 66 * Hostkey generation context
67 */ 67 */
68struct GNUNET_CRYPTO_RsaKeyGenerationContext *GST_keygen; 68struct GNUNET_CRYPTO_EccKeyGenerationContext *GST_keygen;
69 69
70/** 70/**
71 * Handle to our service's server. 71 * Handle to our service's server.
@@ -75,12 +75,12 @@ static struct GNUNET_SERVER_Handle *GST_server;
75/** 75/**
76 * Our public key. 76 * Our public key.
77 */ 77 */
78struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded GST_my_public_key; 78struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded GST_my_public_key;
79 79
80/** 80/**
81 * Our private key. 81 * Our private key.
82 */ 82 */
83struct GNUNET_CRYPTO_RsaPrivateKey *GST_my_private_key; 83struct GNUNET_CRYPTO_EccPrivateKey *GST_my_private_key;
84 84
85/** 85/**
86 * ATS handle. 86 * ATS handle.
@@ -557,7 +557,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
557{ 557{
558 if (NULL != GST_keygen) 558 if (NULL != GST_keygen)
559 { 559 {
560 GNUNET_CRYPTO_rsa_key_create_stop (GST_keygen); 560 GNUNET_CRYPTO_ecc_key_create_stop (GST_keygen);
561 GST_keygen = NULL; 561 GST_keygen = NULL;
562 } 562 }
563 GST_neighbours_stop (); 563 GST_neighbours_stop ();
@@ -583,7 +583,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
583 } 583 }
584 if (NULL != GST_my_private_key) 584 if (NULL != GST_my_private_key)
585 { 585 {
586 GNUNET_CRYPTO_rsa_key_free (GST_my_private_key); 586 GNUNET_CRYPTO_ecc_key_free (GST_my_private_key);
587 GST_my_private_key = NULL; 587 GST_my_private_key = NULL;
588 } 588 }
589 GST_server = NULL; 589 GST_server = NULL;
@@ -599,10 +599,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
599 */ 599 */
600static void 600static void
601key_generation_cb (void *cls, 601key_generation_cb (void *cls,
602 struct GNUNET_CRYPTO_RsaPrivateKey *pk, 602 struct GNUNET_CRYPTO_EccPrivateKey *pk,
603 const char *emsg) 603 const char *emsg)
604{ 604{
605 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded tmp;
606 long long unsigned int max_fd_cfg; 605 long long unsigned int max_fd_cfg;
607 int max_fd_rlimit; 606 int max_fd_rlimit;
608 int max_fd; 607 int max_fd;
@@ -627,14 +626,10 @@ key_generation_cb (void *cls,
627 return; 626 return;
628 } 627 }
629 GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg); 628 GST_peerinfo = GNUNET_PEERINFO_connect (GST_cfg);
630 memset (&GST_my_public_key, '\0', sizeof (GST_my_public_key)); 629 GNUNET_CRYPTO_ecc_key_get_public (GST_my_private_key, &GST_my_public_key);
631 memset (&tmp, '\0', sizeof (tmp));
632 GNUNET_CRYPTO_rsa_key_get_public (GST_my_private_key, &GST_my_public_key);
633 GNUNET_CRYPTO_hash (&GST_my_public_key, sizeof (GST_my_public_key), 630 GNUNET_CRYPTO_hash (&GST_my_public_key, sizeof (GST_my_public_key),
634 &GST_my_identity.hashPubKey); 631 &GST_my_identity.hashPubKey);
635
636 GNUNET_assert (NULL != GST_my_private_key); 632 GNUNET_assert (NULL != GST_my_private_key);
637 GNUNET_assert (0 != memcmp (&GST_my_public_key, &tmp, sizeof (GST_my_public_key)));
638 633
639 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, 634 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
640 NULL); 635 NULL);
@@ -712,7 +707,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
712 /* setup globals */ 707 /* setup globals */
713 GST_cfg = c; 708 GST_cfg = c;
714 if (GNUNET_OK != 709 if (GNUNET_OK !=
715 GNUNET_CONFIGURATION_get_value_filename (c, "GNUNETD", "HOSTKEY", 710 GNUNET_CONFIGURATION_get_value_filename (c, "PEER", "PRIVATE_KEY",
716 &keyfile)) 711 &keyfile))
717 { 712 {
718 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 713 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -729,7 +724,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
729 } 724 }
730 GST_server = server; 725 GST_server = server;
731 GNUNET_SERVER_suspend (server); 726 GNUNET_SERVER_suspend (server);
732 GST_keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile, &key_generation_cb, NULL); 727 GST_keygen = GNUNET_CRYPTO_ecc_key_create_start (keyfile, &key_generation_cb, NULL);
733 GNUNET_free (keyfile); 728 GNUNET_free (keyfile);
734 if (NULL == GST_keygen) 729 if (NULL == GST_keygen)
735 { 730 {
diff --git a/src/transport/gnunet-service-transport.h b/src/transport/gnunet-service-transport.h
index abc473e21..1cbc14c6c 100644
--- a/src/transport/gnunet-service-transport.h
+++ b/src/transport/gnunet-service-transport.h
@@ -55,12 +55,12 @@ extern struct GNUNET_PEERINFO_Handle *GST_peerinfo;
55/** 55/**
56 * Our public key. 56 * Our public key.
57 */ 57 */
58extern struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded GST_my_public_key; 58extern struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded GST_my_public_key;
59 59
60/** 60/**
61 * Our private key. 61 * Our private key.
62 */ 62 */
63extern struct GNUNET_CRYPTO_RsaPrivateKey *GST_my_private_key; 63extern struct GNUNET_CRYPTO_EccPrivateKey *GST_my_private_key;
64 64
65/** 65/**
66 * ATS handle. 66 * ATS handle.
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c
index 247fbc882..c04d2e1dd 100644
--- a/src/transport/gnunet-service-transport_hello.c
+++ b/src/transport/gnunet-service-transport_hello.c
@@ -74,7 +74,7 @@ struct OwnAddressList
74 /** 74 /**
75 * Signature for a 'struct TransportPongMessage' for this address. 75 * Signature for a 'struct TransportPongMessage' for this address.
76 */ 76 */
77 struct GNUNET_CRYPTO_RsaSignature pong_signature; 77 struct GNUNET_CRYPTO_EccSignature pong_signature;
78 78
79}; 79};
80 80
@@ -299,7 +299,7 @@ GST_hello_modify_addresses (int addremove,
299 */ 299 */
300int 300int
301GST_hello_test_address (const struct GNUNET_HELLO_Address *address, 301GST_hello_test_address (const struct GNUNET_HELLO_Address *address,
302 struct GNUNET_CRYPTO_RsaSignature **sig, 302 struct GNUNET_CRYPTO_EccSignature **sig,
303 struct GNUNET_TIME_Absolute **sig_expiration) 303 struct GNUNET_TIME_Absolute **sig_expiration)
304{ 304{
305 struct OwnAddressList *al; 305 struct OwnAddressList *al;
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h
index 605d19861..9927408d2 100644
--- a/src/transport/gnunet-service-transport_hello.h
+++ b/src/transport/gnunet-service-transport_hello.h
@@ -92,7 +92,7 @@ GST_hello_modify_addresses (int addremove,
92 */ 92 */
93int 93int
94GST_hello_test_address (const struct GNUNET_HELLO_Address *address, 94GST_hello_test_address (const struct GNUNET_HELLO_Address *address,
95 struct GNUNET_CRYPTO_RsaSignature **sig, 95 struct GNUNET_CRYPTO_EccSignature **sig,
96 struct GNUNET_TIME_Absolute **sig_expiration); 96 struct GNUNET_TIME_Absolute **sig_expiration);
97 97
98 98
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 {
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 3598a3494..c38a5022c 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -149,13 +149,13 @@ struct TransportPongMessage
149 /** 149 /**
150 * Signature. 150 * Signature.
151 */ 151 */
152 struct GNUNET_CRYPTO_RsaSignature signature; 152 struct GNUNET_CRYPTO_EccSignature signature;
153 153
154 /** 154 /**
155 * GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN to confirm that this is a 155 * GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN to confirm that this is a
156 * plausible address for the signing peer. 156 * plausible address for the signing peer.
157 */ 157 */
158 struct GNUNET_CRYPTO_RsaSignaturePurpose purpose; 158 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
159 159
160 /** 160 /**
161 * When does this signature expire? 161 * When does this signature expire?
@@ -190,7 +190,7 @@ struct ValidationEntry
190 /** 190 /**
191 * Public key of the peer. 191 * Public key of the peer.
192 */ 192 */
193 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; 193 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
194 194
195 /** 195 /**
196 * The identity of the peer. FIXME: duplicated (also in 'address') 196 * The identity of the peer. FIXME: duplicated (also in 'address')
@@ -636,7 +636,7 @@ revalidate_address (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
636 * if we don't have an existing entry and no public key was given 636 * if we don't have an existing entry and no public key was given
637 */ 637 */
638static struct ValidationEntry * 638static struct ValidationEntry *
639find_validation_entry (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 639find_validation_entry (const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
640 *public_key, const struct GNUNET_HELLO_Address *address) 640 *public_key, const struct GNUNET_HELLO_Address *address)
641{ 641{
642 struct ValidationEntryMatchContext vemc; 642 struct ValidationEntryMatchContext vemc;
@@ -688,7 +688,7 @@ add_valid_address (void *cls, const struct GNUNET_HELLO_Address *address,
688 const struct GNUNET_HELLO_Message *hello = cls; 688 const struct GNUNET_HELLO_Message *hello = cls;
689 struct ValidationEntry *ve; 689 struct ValidationEntry *ve;
690 struct GNUNET_PeerIdentity pid; 690 struct GNUNET_PeerIdentity pid;
691 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; 691 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
692 692
693 if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0) 693 if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value == 0)
694 return GNUNET_OK; /* expired */ 694 return GNUNET_OK; /* expired */
@@ -789,7 +789,7 @@ GST_validation_stop ()
789 */ 789 */
790static void 790static void
791multicast_pong (void *cls, 791multicast_pong (void *cls,
792 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 792 const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
793 *public_key, struct GNUNET_TIME_Absolute valid_until, 793 *public_key, struct GNUNET_TIME_Absolute valid_until,
794 struct GNUNET_TIME_Absolute validation_block, 794 struct GNUNET_TIME_Absolute validation_block,
795 const struct GNUNET_HELLO_Address *address) 795 const struct GNUNET_HELLO_Address *address)
@@ -835,7 +835,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
835 const struct TransportPingMessage *ping; 835 const struct TransportPingMessage *ping;
836 struct TransportPongMessage *pong; 836 struct TransportPongMessage *pong;
837 struct GNUNET_TRANSPORT_PluginFunctions *papi; 837 struct GNUNET_TRANSPORT_PluginFunctions *papi;
838 struct GNUNET_CRYPTO_RsaSignature *sig_cache; 838 struct GNUNET_CRYPTO_EccSignature *sig_cache;
839 struct GNUNET_TIME_Absolute *sig_cache_exp; 839 struct GNUNET_TIME_Absolute *sig_cache_exp;
840 const char *addr; 840 const char *addr;
841 const char *addrend; 841 const char *addrend;
@@ -931,7 +931,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
931 { 931 {
932 addrend = NULL; /* make gcc happy */ 932 addrend = NULL; /* make gcc happy */
933 slen = 0; 933 slen = 0;
934 static struct GNUNET_CRYPTO_RsaSignature no_address_signature; 934 static struct GNUNET_CRYPTO_EccSignature no_address_signature;
935 static struct GNUNET_TIME_Absolute no_address_signature_expiration; 935 static struct GNUNET_TIME_Absolute no_address_signature_expiration;
936 936
937 sig_cache = &no_address_signature; 937 sig_cache = &no_address_signature;
@@ -951,7 +951,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
951 htons (sizeof (struct TransportPongMessage) + alen + slen); 951 htons (sizeof (struct TransportPongMessage) + alen + slen);
952 pong->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_PONG); 952 pong->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_PONG);
953 pong->purpose.size = 953 pong->purpose.size =
954 htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose) + 954 htonl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
955 sizeof (uint32_t) + sizeof (struct GNUNET_TIME_AbsoluteNBO) + 955 sizeof (uint32_t) + sizeof (struct GNUNET_TIME_AbsoluteNBO) +
956 alen + slen); 956 alen + slen);
957 pong->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN); 957 pong->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN);
@@ -981,7 +981,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
981 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating buggy PONG signature to indicate ownership.\n"); 981 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating buggy PONG signature to indicate ownership.\n");
982 pong->expiration = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME)); 982 pong->expiration = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME));
983 GNUNET_assert (GNUNET_OK == 983 GNUNET_assert (GNUNET_OK ==
984 GNUNET_CRYPTO_rsa_sign (GST_my_private_key, &pong->purpose, 984 GNUNET_CRYPTO_ecc_sign (GST_my_private_key, &pong->purpose,
985 &pong->signature)); 985 &pong->signature));
986 } 986 }
987 else 987 else
@@ -1001,7 +1001,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
1001 *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME); 1001 *sig_cache_exp = GNUNET_TIME_relative_to_absolute (PONG_SIGNATURE_LIFETIME);
1002 pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp); 1002 pong->expiration = GNUNET_TIME_absolute_hton (*sig_cache_exp);
1003 GNUNET_assert (GNUNET_OK == 1003 GNUNET_assert (GNUNET_OK ==
1004 GNUNET_CRYPTO_rsa_sign (GST_my_private_key, &pong->purpose, 1004 GNUNET_CRYPTO_ecc_sign (GST_my_private_key, &pong->purpose,
1005 sig_cache)); 1005 sig_cache));
1006 } 1006 }
1007 else 1007 else
@@ -1080,7 +1080,7 @@ struct ValidateAddressContext
1080 /** 1080 /**
1081 * Public key of the peer whose address is being validated. 1081 * Public key of the peer whose address is being validated.
1082 */ 1082 */
1083 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded public_key; 1083 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key;
1084}; 1084};
1085 1085
1086 1086
@@ -1197,7 +1197,7 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
1197 } 1197 }
1198 1198
1199 if (GNUNET_OK != 1199 if (GNUNET_OK !=
1200 GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN, 1200 GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_TRANSPORT_PONG_OWN,
1201 &pong->purpose, &pong->signature, 1201 &pong->purpose, &pong->signature,
1202 &ve->public_key)) 1202 &ve->public_key))
1203 { 1203 {
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h
index 6f1206f65..929e97a5c 100644
--- a/src/transport/gnunet-service-transport_validation.h
+++ b/src/transport/gnunet-service-transport_validation.h
@@ -134,7 +134,7 @@ GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello);
134 */ 134 */
135typedef void (*GST_ValidationAddressCallback) (void *cls, 135typedef void (*GST_ValidationAddressCallback) (void *cls,
136 const struct 136 const struct
137 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 137 GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
138 * public_key, 138 * public_key,
139 struct GNUNET_TIME_Absolute 139 struct GNUNET_TIME_Absolute
140 valid_until, 140 valid_until,
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index f0dbc411b..7fcbe9d63 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -43,12 +43,12 @@
43#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 43#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
44#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 44#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
45 45
46#define HOSTKEY_FILE "test_plugin_hostkey" 46#define HOSTKEY_FILE "test_plugin_hostkey.ecc"
47 47
48/** 48/**
49 * Our public key. 49 * Our public key.
50 */ 50 */
51static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded my_public_key; 51static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded my_public_key;
52 52
53/** 53/**
54 * Our identity. 54 * Our identity.
@@ -58,7 +58,7 @@ static struct GNUNET_PeerIdentity my_identity;
58/** 58/**
59 * Our private key. 59 * Our private key.
60 */ 60 */
61static struct GNUNET_CRYPTO_RsaPrivateKey *my_private_key; 61static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
62 62
63/** 63/**
64 * Our configuration. 64 * Our configuration.
@@ -533,7 +533,7 @@ run (void *cls, char *const *args, const char *cfgfile,
533 "NEIGHBOUR_LIMIT", 533 "NEIGHBOUR_LIMIT",
534 &tneigh)) || 534 &tneigh)) ||
535 (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (c, 535 (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (c,
536 "GNUNETD", "HOSTKEY", 536 "PEER", "PRIVATE_KEY",
537 &keyfile))) 537 &keyfile)))
538 { 538 {
539 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 539 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -576,7 +576,7 @@ run (void *cls, char *const *args, const char *cfgfile,
576 576
577 577
578 max_connect_per_transport = (uint32_t) tneigh; 578 max_connect_per_transport = (uint32_t) tneigh;
579 my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); 579 my_private_key = GNUNET_CRYPTO_ecc_key_create_from_file (keyfile);
580 GNUNET_free (keyfile); 580 GNUNET_free (keyfile);
581 if (NULL == my_private_key) 581 if (NULL == my_private_key)
582 { 582 {
@@ -585,7 +585,7 @@ run (void *cls, char *const *args, const char *cfgfile,
585 end_badly_now (); 585 end_badly_now ();
586 return; 586 return;
587 } 587 }
588 GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key); 588 GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key);
589 GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), 589 GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key),
590 &my_identity.hashPubKey); 590 &my_identity.hashPubKey);
591 591