diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-06 14:18:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-06 14:18:31 +0000 |
commit | fe76c075e315c0351e2fe465434ae39087daf014 (patch) | |
tree | 436887ccaf331932a3c13a8b9d2a2a710dad4be6 /src/testing/testing.c | |
parent | 7eb2835d8a494c83aedb720a2ac6f6e5ba23f22f (diff) | |
download | gnunet-fe76c075e315c0351e2fe465434ae39087daf014.tar.gz gnunet-fe76c075e315c0351e2fe465434ae39087daf014.zip |
moving to new, fixed-size encoding of public and private ECC keys everywhere, also improving ECC API to better support ECRS/GADS operations
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r-- | src/testing/testing.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index 898af1674..73b2a4ee1 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -712,7 +712,7 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, | |||
712 | struct GNUNET_PeerIdentity *id) | 712 | struct GNUNET_PeerIdentity *id) |
713 | { | 713 | { |
714 | struct GNUNET_CRYPTO_EccPrivateKey *private_key; | 714 | struct GNUNET_CRYPTO_EccPrivateKey *private_key; |
715 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded public_key; | 715 | struct GNUNET_CRYPTO_EccPublicKey public_key; |
716 | 716 | ||
717 | if ((NULL == id) || (NULL == system->hostkeys_data)) | 717 | if ((NULL == id) || (NULL == system->hostkeys_data)) |
718 | return NULL; | 718 | return NULL; |
@@ -722,11 +722,11 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, | |||
722 | _("Key number %u does not exist\n"), key_number); | 722 | _("Key number %u does not exist\n"), key_number); |
723 | return NULL; | 723 | return NULL; |
724 | } | 724 | } |
725 | private_key = GNUNET_CRYPTO_ecc_decode_key (system->hostkeys_data + | 725 | private_key = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); |
726 | (key_number * | 726 | memcpy (private_key, |
727 | GNUNET_TESTING_HOSTKEYFILESIZE), | 727 | system->hostkeys_data + |
728 | GNUNET_TESTING_HOSTKEYFILESIZE, | 728 | (key_number * GNUNET_TESTING_HOSTKEYFILESIZE), |
729 | GNUNET_NO); | 729 | GNUNET_TESTING_HOSTKEYFILESIZE); |
730 | if (NULL == private_key) | 730 | if (NULL == private_key) |
731 | { | 731 | { |
732 | LOG (GNUNET_ERROR_TYPE_ERROR, | 732 | LOG (GNUNET_ERROR_TYPE_ERROR, |
@@ -735,7 +735,7 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system, | |||
735 | } | 735 | } |
736 | GNUNET_CRYPTO_ecc_key_get_public (private_key, &public_key); | 736 | GNUNET_CRYPTO_ecc_key_get_public (private_key, &public_key); |
737 | GNUNET_CRYPTO_hash (&public_key, | 737 | GNUNET_CRYPTO_hash (&public_key, |
738 | sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), | 738 | sizeof (struct GNUNET_CRYPTO_EccPublicKey), |
739 | &(id->hashPubKey)); | 739 | &(id->hashPubKey)); |
740 | return private_key; | 740 | return private_key; |
741 | } | 741 | } |