diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-16 09:48:03 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-16 09:48:03 +0200 |
commit | 4bf09d00f1aeb0586f14587dfa455a0a5b902eda (patch) | |
tree | 7d40dd74b1303e66f52668d6cc659bd2657232fd /src/identity/gnunet-identity.c | |
parent | ffd4382a73e2fa1d99812df14ed1025fadeb4017 (diff) | |
download | gnunet-4bf09d00f1aeb0586f14587dfa455a0a5b902eda.tar.gz gnunet-4bf09d00f1aeb0586f14587dfa455a0a5b902eda.zip |
- fix tvgs; expose alternative identity type
Diffstat (limited to 'src/identity/gnunet-identity.c')
-rw-r--r-- | src/identity/gnunet-identity.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index e16ca83e3..a01cd1ed7 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c | |||
@@ -66,6 +66,11 @@ static unsigned int verbose; | |||
66 | static int quiet; | 66 | static int quiet; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Was "eddsa" specified? | ||
70 | */ | ||
71 | static int type_eddsa; | ||
72 | |||
73 | /** | ||
69 | * -C option | 74 | * -C option |
70 | */ | 75 | */ |
71 | static char *create_ego; | 76 | static char *create_ego; |
@@ -357,9 +362,16 @@ print_ego (void *cls, | |||
357 | else | 362 | else |
358 | { | 363 | { |
359 | if (private_keys) | 364 | if (private_keys) |
360 | fprintf (stdout, "%s - %s - %s\n", identifier, s, privs); | 365 | fprintf (stdout, "%s - %s - %s - %s\n", |
366 | identifier, s, privs, | ||
367 | (ntohl (pk.type) == GNUNET_IDENTITY_TYPE_ECDSA) ? | ||
368 | "ECDSA" : "EdDSA"); | ||
361 | else | 369 | else |
362 | fprintf (stdout, "%s - %s\n", identifier, s); | 370 | fprintf (stdout, "%s - %s - %s\n", |
371 | identifier, s, | ||
372 | (ntohl (pk.type) == GNUNET_IDENTITY_TYPE_ECDSA) ? | ||
373 | "ECDSA" : "EdDSA"); | ||
374 | |||
363 | } | 375 | } |
364 | } | 376 | } |
365 | GNUNET_free (privs); | 377 | GNUNET_free (privs); |
@@ -412,7 +424,7 @@ run (void *cls, | |||
412 | GNUNET_IDENTITY_create (sh, | 424 | GNUNET_IDENTITY_create (sh, |
413 | create_ego, | 425 | create_ego, |
414 | &pk, | 426 | &pk, |
415 | 0, //Ignored | 427 | 0, // Ignored |
416 | &create_finished, | 428 | &create_finished, |
417 | &create_op); | 429 | &create_op); |
418 | } | 430 | } |
@@ -421,7 +433,9 @@ run (void *cls, | |||
421 | GNUNET_IDENTITY_create (sh, | 433 | GNUNET_IDENTITY_create (sh, |
422 | create_ego, | 434 | create_ego, |
423 | NULL, | 435 | NULL, |
424 | GNUNET_IDENTITY_TYPE_ECDSA, //FIXME from parameter | 436 | (type_eddsa) ? |
437 | GNUNET_IDENTITY_TYPE_EDDSA : | ||
438 | GNUNET_IDENTITY_TYPE_ECDSA, | ||
425 | &create_finished, | 439 | &create_finished, |
426 | &create_op); | 440 | &create_op); |
427 | } | 441 | } |
@@ -458,6 +472,11 @@ main (int argc, char *const *argv) | |||
458 | gettext_noop ( | 472 | gettext_noop ( |
459 | "set the private key for the identity to PRIVATE_KEY (use together with -C)"), | 473 | "set the private key for the identity to PRIVATE_KEY (use together with -C)"), |
460 | &privkey_ego), | 474 | &privkey_ego), |
475 | GNUNET_GETOPT_option_flag ('X', | ||
476 | "eddsa", | ||
477 | gettext_noop ( | ||
478 | "generate an EdDSA identity. (use together with -C) EXPERIMENTAL"), | ||
479 | &type_eddsa), | ||
461 | GNUNET_GETOPT_option_flag ('d', | 480 | GNUNET_GETOPT_option_flag ('d', |
462 | "display", | 481 | "display", |
463 | gettext_noop ("display all egos"), | 482 | gettext_noop ("display all egos"), |