diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-14 19:47:32 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 12:11:18 +0200 |
commit | 96c802b46be51e5c45f34e2de823f787d26c2929 (patch) | |
tree | 457ccfd8f9a61563af86318739c4a8f964a57025 /src/identity/gnunet-identity.c | |
parent | c14e3a2769ff0f15fdbb32797e37e43ce2344fa3 (diff) | |
download | gnunet-96c802b46be51e5c45f34e2de823f787d26c2929.tar.gz gnunet-96c802b46be51e5c45f34e2de823f787d26c2929.zip |
- towards crypto agility; wip
Diffstat (limited to 'src/identity/gnunet-identity.c')
-rw-r--r-- | src/identity/gnunet-identity.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index d0f5546f3..e16ca83e3 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c | |||
@@ -108,7 +108,7 @@ static struct GNUNET_IDENTITY_Operation *delete_op; | |||
108 | /** | 108 | /** |
109 | * Private key from command line option, or NULL. | 109 | * Private key from command line option, or NULL. |
110 | */ | 110 | */ |
111 | struct GNUNET_CRYPTO_EcdsaPrivateKey pk; | 111 | struct GNUNET_IDENTITY_PrivateKey pk; |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * Value to return from #main(). | 114 | * Value to return from #main(). |
@@ -197,7 +197,7 @@ delete_finished (void *cls, | |||
197 | */ | 197 | */ |
198 | static void | 198 | static void |
199 | create_finished (void *cls, | 199 | create_finished (void *cls, |
200 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk, | 200 | const struct GNUNET_IDENTITY_PrivateKey *pk, |
201 | const char *emsg) | 201 | const char *emsg) |
202 | { | 202 | { |
203 | struct GNUNET_IDENTITY_Operation **op = cls; | 203 | struct GNUNET_IDENTITY_Operation **op = cls; |
@@ -212,16 +212,16 @@ create_finished (void *cls, | |||
212 | } | 212 | } |
213 | else if (verbose) | 213 | else if (verbose) |
214 | { | 214 | { |
215 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 215 | struct GNUNET_IDENTITY_PublicKey pub; |
216 | char *pubs; | 216 | char *pubs; |
217 | 217 | ||
218 | GNUNET_CRYPTO_ecdsa_key_get_public (pk, &pub); | 218 | GNUNET_IDENTITY_key_get_public (pk, &pub); |
219 | pubs = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pub); | 219 | pubs = GNUNET_IDENTITY_public_key_to_string (&pub); |
220 | if (private_keys) | 220 | if (private_keys) |
221 | { | 221 | { |
222 | char *privs; | 222 | char *privs; |
223 | 223 | ||
224 | privs = GNUNET_CRYPTO_ecdsa_private_key_to_string (pk); | 224 | privs = GNUNET_IDENTITY_private_key_to_string (pk); |
225 | fprintf (stdout, "%s - %s\n", pubs, privs); | 225 | fprintf (stdout, "%s - %s\n", pubs, privs); |
226 | GNUNET_free (privs); | 226 | GNUNET_free (privs); |
227 | } | 227 | } |
@@ -293,7 +293,7 @@ print_ego (void *cls, | |||
293 | void **ctx, | 293 | void **ctx, |
294 | const char *identifier) | 294 | const char *identifier) |
295 | { | 295 | { |
296 | struct GNUNET_CRYPTO_EcdsaPublicKey pk; | 296 | struct GNUNET_IDENTITY_PublicKey pk; |
297 | char *s; | 297 | char *s; |
298 | char *privs; | 298 | char *privs; |
299 | 299 | ||
@@ -342,8 +342,8 @@ print_ego (void *cls, | |||
342 | set_ego)) ) | 342 | set_ego)) ) |
343 | return; | 343 | return; |
344 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 344 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
345 | s = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 345 | s = GNUNET_IDENTITY_public_key_to_string (&pk); |
346 | privs = GNUNET_CRYPTO_ecdsa_private_key_to_string ( | 346 | privs = GNUNET_IDENTITY_private_key_to_string ( |
347 | GNUNET_IDENTITY_ego_get_private_key (ego)); | 347 | GNUNET_IDENTITY_ego_get_private_key (ego)); |
348 | if ((monitor) || (NULL != identifier)) | 348 | if ((monitor) || (NULL != identifier)) |
349 | { | 349 | { |
@@ -407,11 +407,12 @@ run (void *cls, | |||
407 | strlen (privkey_ego), | 407 | strlen (privkey_ego), |
408 | &pk, | 408 | &pk, |
409 | sizeof(struct | 409 | sizeof(struct |
410 | GNUNET_CRYPTO_EcdsaPrivateKey)); | 410 | GNUNET_IDENTITY_PrivateKey)); |
411 | create_op = | 411 | create_op = |
412 | GNUNET_IDENTITY_create (sh, | 412 | GNUNET_IDENTITY_create (sh, |
413 | create_ego, | 413 | create_ego, |
414 | &pk, | 414 | &pk, |
415 | 0, //Ignored | ||
415 | &create_finished, | 416 | &create_finished, |
416 | &create_op); | 417 | &create_op); |
417 | } | 418 | } |
@@ -420,6 +421,7 @@ run (void *cls, | |||
420 | GNUNET_IDENTITY_create (sh, | 421 | GNUNET_IDENTITY_create (sh, |
421 | create_ego, | 422 | create_ego, |
422 | NULL, | 423 | NULL, |
424 | GNUNET_IDENTITY_TYPE_ECDSA, //FIXME from parameter | ||
423 | &create_finished, | 425 | &create_finished, |
424 | &create_op); | 426 | &create_op); |
425 | } | 427 | } |