aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_shorten.c
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/gns/gnunet-service-gns_shorten.c
parent8beabcd96c0cf1e1873c0b5ff96e537f1beb0b34 (diff)
downloadgnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.tar.gz
gnunet-9351b1e9bdf2b067b6db06562c26ba658cff42b8.zip
separating ECC crypto into functions/structs for ECDHE, ECDSA and EDDSA
Diffstat (limited to 'src/gns/gnunet-service-gns_shorten.c')
-rw-r--r--src/gns/gnunet-service-gns_shorten.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gns/gnunet-service-gns_shorten.c b/src/gns/gnunet-service-gns_shorten.c
index ff2cab097..f0c96716a 100644
--- a/src/gns/gnunet-service-gns_shorten.c
+++ b/src/gns/gnunet-service-gns_shorten.c
@@ -65,7 +65,7 @@ struct GetPseuAuthorityHandle
65 * Private key of the (shorten) zone to store the resulting 65 * Private key of the (shorten) zone to store the resulting
66 * pseudonym in. 66 * pseudonym in.
67 */ 67 */
68 struct GNUNET_CRYPTO_EccPrivateKey shorten_zone_key; 68 struct GNUNET_CRYPTO_EcdsaPrivateKey shorten_zone_key;
69 69
70 /** 70 /**
71 * Original label (used if no PSEU record is found). 71 * Original label (used if no PSEU record is found).
@@ -80,7 +80,7 @@ struct GetPseuAuthorityHandle
80 /** 80 /**
81 * The zone for which we are trying to find the PSEU record. 81 * The zone for which we are trying to find the PSEU record.
82 */ 82 */
83 struct GNUNET_CRYPTO_EccPublicSignKey target_zone; 83 struct GNUNET_CRYPTO_EcdsaPublicKey target_zone;
84 84
85 /** 85 /**
86 * Handle for DHT lookups. Should be NULL if no lookups are in progress 86 * Handle for DHT lookups. Should be NULL if no lookups are in progress
@@ -195,7 +195,7 @@ process_pseu_block_ns (void *cls,
195 const struct GNUNET_NAMESTORE_Block *block) 195 const struct GNUNET_NAMESTORE_Block *block)
196{ 196{
197 struct GetPseuAuthorityHandle *gph = cls; 197 struct GetPseuAuthorityHandle *gph = cls;
198 struct GNUNET_CRYPTO_EccPublicSignKey pub; 198 struct GNUNET_CRYPTO_EcdsaPublicKey pub;
199 199
200 gph->namestore_task = NULL; 200 gph->namestore_task = NULL;
201 if (NULL == block) 201 if (NULL == block)
@@ -203,7 +203,7 @@ process_pseu_block_ns (void *cls,
203 process_pseu_lookup_ns (gph, 0, NULL); 203 process_pseu_lookup_ns (gph, 0, NULL);
204 return; 204 return;
205 } 205 }
206 GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, 206 GNUNET_CRYPTO_ecdsa_key_get_public (&gph->shorten_zone_key,
207 &pub); 207 &pub);
208 if (GNUNET_OK != 208 if (GNUNET_OK !=
209 GNUNET_NAMESTORE_block_decrypt (block, 209 GNUNET_NAMESTORE_block_decrypt (block,
@@ -229,10 +229,10 @@ static void
229perform_pseu_lookup (struct GetPseuAuthorityHandle *gph, 229perform_pseu_lookup (struct GetPseuAuthorityHandle *gph,
230 const char *label) 230 const char *label)
231{ 231{
232 struct GNUNET_CRYPTO_EccPublicSignKey pub; 232 struct GNUNET_CRYPTO_EcdsaPublicKey pub;
233 struct GNUNET_HashCode query; 233 struct GNUNET_HashCode query;
234 234
235 GNUNET_CRYPTO_ecc_key_get_public_for_signature (&gph->shorten_zone_key, 235 GNUNET_CRYPTO_ecdsa_key_get_public (&gph->shorten_zone_key,
236 &pub); 236 &pub);
237 GNUNET_free_non_null (gph->current_label); 237 GNUNET_free_non_null (gph->current_label);
238 gph->current_label = GNUNET_strdup (label); 238 gph->current_label = GNUNET_strdup (label);
@@ -287,7 +287,7 @@ process_pseu_lookup_ns (void *cls,
287 GNUNET_NAMESTORE_z2s (&gph->target_zone), 287 GNUNET_NAMESTORE_z2s (&gph->target_zone),
288 gph->current_label); 288 gph->current_label);
289 new_pkey.expiration_time = UINT64_MAX; 289 new_pkey.expiration_time = UINT64_MAX;
290 new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EccPublicSignKey); 290 new_pkey.data_size = sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey);
291 new_pkey.data = &gph->target_zone; 291 new_pkey.data = &gph->target_zone;
292 new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY; 292 new_pkey.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
293 new_pkey.flags = GNUNET_NAMESTORE_RF_NONE 293 new_pkey.flags = GNUNET_NAMESTORE_RF_NONE
@@ -437,8 +437,8 @@ process_auth_discovery_dht_result (void* cls,
437 block = data; 437 block = data;
438 if (size != 438 if (size !=
439 ntohl (block->purpose.size) + 439 ntohl (block->purpose.size) +
440 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey) + 440 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +
441 sizeof (struct GNUNET_CRYPTO_EccSignature)) 441 sizeof (struct GNUNET_CRYPTO_EcdsaSignature))
442 { 442 {
443 /* how did this pass DHT block validation!? */ 443 /* how did this pass DHT block validation!? */
444 GNUNET_break (0); 444 GNUNET_break (0);
@@ -472,7 +472,7 @@ process_auth_discovery_dht_result (void* cls,
472 */ 472 */
473static void 473static void
474process_zone_to_name_discover (void *cls, 474process_zone_to_name_discover (void *cls,
475 const struct GNUNET_CRYPTO_EccPrivateKey *zone_key, 475 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
476 const char *name, 476 const char *name,
477 unsigned int rd_len, 477 unsigned int rd_len,
478 const struct GNUNET_NAMESTORE_RecordData *rd) 478 const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -519,8 +519,8 @@ process_zone_to_name_discover (void *cls,
519 */ 519 */
520void 520void
521GNS_shorten_start (const char *original_label, 521GNS_shorten_start (const char *original_label,
522 const struct GNUNET_CRYPTO_EccPublicSignKey *pub, 522 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
523 const struct GNUNET_CRYPTO_EccPrivateKey *shorten_zone) 523 const struct GNUNET_CRYPTO_EcdsaPrivateKey *shorten_zone)
524{ 524{
525 struct GetPseuAuthorityHandle *gph; 525 struct GetPseuAuthorityHandle *gph;
526 526