aboutsummaryrefslogtreecommitdiff
path: root/src/testing
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/testing
parent8beabcd96c0cf1e1873c0b5ff96e537f1beb0b34 (diff)
downloadgnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.tar.gz
gnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.zip
separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/gnunet-testing.c4
-rw-r--r--src/testing/testing.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c
index 1cec948a2..a79e836c7 100644
--- a/src/testing/gnunet-testing.c
+++ b/src/testing/gnunet-testing.c
@@ -164,7 +164,7 @@ create_hostkeys (const unsigned int no)
164 struct GNUNET_TESTING_System *system; 164 struct GNUNET_TESTING_System *system;
165 struct GNUNET_PeerIdentity id; 165 struct GNUNET_PeerIdentity id;
166 struct GNUNET_DISK_FileHandle *fd; 166 struct GNUNET_DISK_FileHandle *fd;
167 struct GNUNET_CRYPTO_EccPrivateKey *pk; 167 struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
168 168
169 system = GNUNET_TESTING_system_create ("testing", NULL, NULL, NULL); 169 system = GNUNET_TESTING_system_create ("testing", NULL, NULL, NULL);
170 pk = GNUNET_TESTING_hostkey_get (system, create_no, &id); 170 pk = GNUNET_TESTING_hostkey_get (system, create_no, &id);
@@ -182,7 +182,7 @@ create_hostkeys (const unsigned int no)
182 GNUNET_DISK_PERM_USER_WRITE); 182 GNUNET_DISK_PERM_USER_WRITE);
183 GNUNET_assert (fd != NULL); 183 GNUNET_assert (fd != NULL);
184 ret = GNUNET_DISK_file_write (fd, pk, 184 ret = GNUNET_DISK_file_write (fd, pk,
185 sizeof (struct GNUNET_CRYPTO_EccPrivateKey)); 185 sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey));
186 GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd)); 186 GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fd));
187 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing", 187 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "transport-testing",
188 "Wrote hostkey to file: `%s'\n", create_hostkey); 188 "Wrote hostkey to file: `%s'\n", create_hostkey);
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 89d4c0f50..cfca8ce9b 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -701,12 +701,12 @@ GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
701 * key; if NULL, GNUNET_SYSERR is returned immediately 701 * key; if NULL, GNUNET_SYSERR is returned immediately
702 * @return NULL on error (not enough keys) 702 * @return NULL on error (not enough keys)
703 */ 703 */
704struct GNUNET_CRYPTO_EccPrivateKey * 704struct GNUNET_CRYPTO_EddsaPrivateKey *
705GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, 705GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
706 uint32_t key_number, 706 uint32_t key_number,
707 struct GNUNET_PeerIdentity *id) 707 struct GNUNET_PeerIdentity *id)
708{ 708{
709 struct GNUNET_CRYPTO_EccPrivateKey *private_key; 709 struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
710 710
711 if ((NULL == id) || (NULL == system->hostkeys_data)) 711 if ((NULL == id) || (NULL == system->hostkeys_data))
712 return NULL; 712 return NULL;
@@ -716,12 +716,12 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
716 _("Key number %u does not exist\n"), key_number); 716 _("Key number %u does not exist\n"), key_number);
717 return NULL; 717 return NULL;
718 } 718 }
719 private_key = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); 719 private_key = GNUNET_new (struct GNUNET_CRYPTO_EddsaPrivateKey);
720 memcpy (private_key, 720 memcpy (private_key,
721 system->hostkeys_data + 721 system->hostkeys_data +
722 (key_number * GNUNET_TESTING_HOSTKEYFILESIZE), 722 (key_number * GNUNET_TESTING_HOSTKEYFILESIZE),
723 GNUNET_TESTING_HOSTKEYFILESIZE); 723 GNUNET_TESTING_HOSTKEYFILESIZE);
724 GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key, 724 GNUNET_CRYPTO_eddsa_key_get_public (private_key,
725 &id->public_key); 725 &id->public_key);
726 return private_key; 726 return private_key;
727} 727}
@@ -1137,7 +1137,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
1137 char *config_filename; 1137 char *config_filename;
1138 char *libexec_binary; 1138 char *libexec_binary;
1139 char *emsg_; 1139 char *emsg_;
1140 struct GNUNET_CRYPTO_EccPrivateKey *pk; 1140 struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
1141 uint16_t *ports; 1141 uint16_t *ports;
1142 struct SharedService *ss; 1142 struct SharedService *ss;
1143 struct SharedServiceInstance **ss_instances; 1143 struct SharedServiceInstance **ss_instances;