diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-05-29 08:18:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-05-29 08:18:55 +0000 |
commit | 022002438e4047d235a688cfd9da7b63ab990103 (patch) | |
tree | 8d0cb444a3ab376b5a8f614fb87bdeb31e7b3327 /src/namestore/test_namestore_api_remove_not_existing_record.c | |
parent | b62eb443ee3af84f87030fad9fd11a948b1a2503 (diff) | |
download | gnunet-022002438e4047d235a688cfd9da7b63ab990103.tar.gz gnunet-022002438e4047d235a688cfd9da7b63ab990103.zip |
-switching GNS from RSA to ECC
Diffstat (limited to 'src/namestore/test_namestore_api_remove_not_existing_record.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove_not_existing_record.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index 973cf94e4..16586240a 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -49,11 +49,11 @@ static struct GNUNET_NAMESTORE_Handle * nsh; | |||
49 | 49 | ||
50 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; | 50 | static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; |
51 | 51 | ||
52 | static struct GNUNET_CRYPTO_RsaPrivateKey * privkey; | 52 | static struct GNUNET_CRYPTO_EccPrivateKey * privkey; |
53 | 53 | ||
54 | static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pubkey; | 54 | static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; |
55 | 55 | ||
56 | static struct GNUNET_CRYPTO_RsaSignature *s_signature; | 56 | static struct GNUNET_CRYPTO_EccSignature *s_signature; |
57 | 57 | ||
58 | static struct GNUNET_HashCode s_zone; | 58 | static struct GNUNET_HashCode s_zone; |
59 | 59 | ||
@@ -77,7 +77,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
77 | GNUNET_NAMESTORE_disconnect (nsh); | 77 | GNUNET_NAMESTORE_disconnect (nsh); |
78 | nsh = NULL; | 78 | nsh = NULL; |
79 | if (privkey != NULL) | 79 | if (privkey != NULL) |
80 | GNUNET_CRYPTO_rsa_key_free (privkey); | 80 | GNUNET_CRYPTO_ecc_key_free (privkey); |
81 | privkey = NULL; | 81 | privkey = NULL; |
82 | GNUNET_free_non_null (s_name); | 82 | GNUNET_free_non_null (s_name); |
83 | res = 1; | 83 | res = 1; |
@@ -99,7 +99,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
99 | GNUNET_free (s_rd); | 99 | GNUNET_free (s_rd); |
100 | 100 | ||
101 | if (privkey != NULL) | 101 | if (privkey != NULL) |
102 | GNUNET_CRYPTO_rsa_key_free (privkey); | 102 | GNUNET_CRYPTO_ecc_key_free (privkey); |
103 | privkey = NULL; | 103 | privkey = NULL; |
104 | if (nsh != NULL) | 104 | if (nsh != NULL) |
105 | GNUNET_NAMESTORE_disconnect (nsh); | 105 | GNUNET_NAMESTORE_disconnect (nsh); |
@@ -190,11 +190,11 @@ run (void *cls, | |||
190 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 190 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
191 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 191 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
192 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 192 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); |
193 | privkey = GNUNET_CRYPTO_rsa_key_create_from_file(hostkey_file); | 193 | privkey = GNUNET_CRYPTO_ecc_key_create_from_file(hostkey_file); |
194 | GNUNET_free (hostkey_file); | 194 | GNUNET_free (hostkey_file); |
195 | GNUNET_assert (privkey != NULL); | 195 | GNUNET_assert (privkey != NULL); |
196 | /* get public key */ | 196 | /* get public key */ |
197 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 197 | GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); |
198 | 198 | ||
199 | /* create record */ | 199 | /* create record */ |
200 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); | 200 | s_name = GNUNET_NAMESTORE_normalize_string ("DUMMY.dummy.gnunet"); |
@@ -209,7 +209,7 @@ run (void *cls, | |||
209 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | 209 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); |
210 | 210 | ||
211 | /* create random zone hash */ | 211 | /* create random zone hash */ |
212 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 212 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); |
213 | 213 | ||
214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_h2s_full(&s_zone)); | 214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Name: `%s' Zone: `%s' \n", s_name, GNUNET_h2s_full(&s_zone)); |
215 | nsh = GNUNET_NAMESTORE_connect (cfg); | 215 | nsh = GNUNET_NAMESTORE_connect (cfg); |