diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-02-07 15:08:53 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-02-07 15:08:53 +0000 |
commit | 46ecdb6cd88f76fc6c56368743740fce56b52cfc (patch) | |
tree | 1cb00a3de536baff3fba0fce5ea22e3c1ae8f7a6 /src/mesh | |
parent | 55ccae4842f05afd041d4775288aae344e15f547 (diff) | |
download | gnunet-46ecdb6cd88f76fc6c56368743740fce56b52cfc.tar.gz gnunet-46ecdb6cd88f76fc6c56368743740fce56b52cfc.zip |
- use ECC in mesh
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 2ee5b9d3f..0d7f228d2 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -903,7 +903,7 @@ static unsigned long long max_peers; | |||
903 | /** | 903 | /** |
904 | * Hostkey generation context | 904 | * Hostkey generation context |
905 | */ | 905 | */ |
906 | static struct GNUNET_CRYPTO_RsaKeyGenerationContext *keygen; | 906 | static struct GNUNET_CRYPTO_EccKeyGenerationContext *keygen; |
907 | 907 | ||
908 | /** | 908 | /** |
909 | * DLL with all the clients, head. | 909 | * DLL with all the clients, head. |
@@ -979,12 +979,12 @@ static struct GNUNET_PeerIdentity my_full_id; | |||
979 | /** | 979 | /** |
980 | * Own private key. | 980 | * Own private key. |
981 | */ | 981 | */ |
982 | static struct GNUNET_CRYPTO_RsaPrivateKey *my_private_key; | 982 | static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key; |
983 | 983 | ||
984 | /** | 984 | /** |
985 | * Own public key. | 985 | * Own public key. |
986 | */ | 986 | */ |
987 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded my_public_key; | 987 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded my_public_key; |
988 | 988 | ||
989 | /** | 989 | /** |
990 | * Tunnel ID for the next created tunnel (global tunnel number). | 990 | * Tunnel ID for the next created tunnel (global tunnel number). |
@@ -8180,7 +8180,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
8180 | } | 8180 | } |
8181 | if (NULL != keygen) | 8181 | if (NULL != keygen) |
8182 | { | 8182 | { |
8183 | GNUNET_CRYPTO_rsa_key_create_stop (keygen); | 8183 | GNUNET_CRYPTO_ecc_key_create_stop (keygen); |
8184 | keygen = NULL; | 8184 | keygen = NULL; |
8185 | } | 8185 | } |
8186 | GNUNET_CONTAINER_multihashmap_iterate (tunnels, &shutdown_tunnel, NULL); | 8186 | GNUNET_CONTAINER_multihashmap_iterate (tunnels, &shutdown_tunnel, NULL); |
@@ -8210,15 +8210,15 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
8210 | 8210 | ||
8211 | 8211 | ||
8212 | /** | 8212 | /** |
8213 | * Callback for hostkey read/generation | 8213 | * Callback for hostkey read/generation. |
8214 | * | 8214 | * |
8215 | * @param cls Closure (Configuration handle). | 8215 | * @param cls Closure (Configuration handle). |
8216 | * @param pk the private key | 8216 | * @param pk The ECC private key. |
8217 | * @param emsg error message | 8217 | * @param emsg Error message, if any. |
8218 | */ | 8218 | */ |
8219 | static void | 8219 | static void |
8220 | key_generation_cb (void *cls, | 8220 | key_generation_cb (void *cls, |
8221 | struct GNUNET_CRYPTO_RsaPrivateKey *pk, | 8221 | struct GNUNET_CRYPTO_EccPrivateKey *pk, |
8222 | const char *emsg) | 8222 | const char *emsg) |
8223 | { | 8223 | { |
8224 | const struct GNUNET_CONFIGURATION_Handle *c = cls; | 8224 | const struct GNUNET_CONFIGURATION_Handle *c = cls; |
@@ -8235,7 +8235,7 @@ key_generation_cb (void *cls, | |||
8235 | return; | 8235 | return; |
8236 | } | 8236 | } |
8237 | my_private_key = pk; | 8237 | my_private_key = pk; |
8238 | GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key); | 8238 | GNUNET_CRYPTO_ecc_key_get_public (my_private_key, &my_public_key); |
8239 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), | 8239 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
8240 | &my_full_id.hashPubKey); | 8240 | &my_full_id.hashPubKey); |
8241 | myid = GNUNET_PEER_intern (&my_full_id); | 8241 | myid = GNUNET_PEER_intern (&my_full_id); |
@@ -8440,7 +8440,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
8440 | /* Scheduled the task to clean up when shutdown is called */ | 8440 | /* Scheduled the task to clean up when shutdown is called */ |
8441 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, | 8441 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, |
8442 | NULL); | 8442 | NULL); |
8443 | keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile, | 8443 | keygen = GNUNET_CRYPTO_ecc_key_create_start (keyfile, |
8444 | &key_generation_cb, | 8444 | &key_generation_cb, |
8445 | (void *) c); | 8445 | (void *) c); |
8446 | GNUNET_free (keyfile); | 8446 | GNUNET_free (keyfile); |