diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-16 15:05:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-16 15:05:29 +0100 |
commit | 7815ced57e8849465e9d821ea8c8e9d705efd0ca (patch) | |
tree | 79267034ca0b0986e70d974d418d9c9d13135261 /src/authorization | |
parent | 157efff4973ed4e6837fabd5e7397cc6e578d9a0 (diff) | |
download | anastasis-7815ced57e8849465e9d821ea8c8e9d705efd0ca.tar.gz anastasis-7815ced57e8849465e9d821ea8c8e9d705efd0ca.tar.bz2 anastasis-7815ced57e8849465e9d821ea8c8e9d705efd0ca.zip |
generate shorter UUID strings for interaction with users (#7089)
Diffstat (limited to 'src/authorization')
3 files changed, 16 insertions, 42 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_email.c b/src/authorization/anastasis_authorization_plugin_email.c index 0eefcc5..f618d7b 100644 --- a/src/authorization/anastasis_authorization_plugin_email.c +++ b/src/authorization/anastasis_authorization_plugin_email.c @@ -374,20 +374,12 @@ email_process (struct ANASTASIS_AUTHORIZATION_State *as, GNUNET_DISK_PIPE_END_WRITE); GNUNET_assert (NULL != pipe_stdin); GNUNET_DISK_pipe_close (p); - { - char *tpk; - - tpk = GNUNET_STRINGS_data_to_string_alloc ( - &as->truth_uuid, - sizeof (as->truth_uuid)); - GNUNET_asprintf (&as->msg, - get_message (as->ctx->messages, - connection, - "body"), - (unsigned long long) as->code, - tpk); - GNUNET_free (tpk); - } + GNUNET_asprintf (&as->msg, + get_message (as->ctx->messages, + connection, + "body"), + (unsigned long long) as->code, + ANASTASIS_crypto_uuid2s (&as->truth_uuid)); { const char *off = as->msg; diff --git a/src/authorization/anastasis_authorization_plugin_post.c b/src/authorization/anastasis_authorization_plugin_post.c index 4adeffd..b938bce 100644 --- a/src/authorization/anastasis_authorization_plugin_post.c +++ b/src/authorization/anastasis_authorization_plugin_post.c @@ -448,21 +448,12 @@ post_process (struct ANASTASIS_AUTHORIZATION_State *as, GNUNET_DISK_PIPE_END_WRITE); GNUNET_assert (NULL != pipe_stdin); GNUNET_DISK_pipe_close (p); - { - char *tpk; - - tpk = GNUNET_STRINGS_data_to_string_alloc ( - &as->truth_uuid, - sizeof (as->truth_uuid)); - GNUNET_asprintf (&as->msg, - get_message (as->ctx->messages, - connection, - "body"), - (unsigned long long) as->code, - tpk); - GNUNET_free (tpk); - } - + GNUNET_asprintf (&as->msg, + get_message (as->ctx->messages, + connection, + "body"), + (unsigned long long) as->code, + ANASTASIS_CRYPTO_uuid2s (&as->truth_uuid)); { const char *off = as->msg; size_t left = strlen (off); diff --git a/src/authorization/anastasis_authorization_plugin_sms.c b/src/authorization/anastasis_authorization_plugin_sms.c index 94b2c0d..2410677 100644 --- a/src/authorization/anastasis_authorization_plugin_sms.c +++ b/src/authorization/anastasis_authorization_plugin_sms.c @@ -373,19 +373,10 @@ sms_process (struct ANASTASIS_AUTHORIZATION_State *as, GNUNET_DISK_PIPE_END_WRITE); GNUNET_assert (NULL != pipe_stdin); GNUNET_DISK_pipe_close (p); - { - char *tpk; - - tpk = GNUNET_STRINGS_data_to_string_alloc ( - &as->truth_uuid, - sizeof (as->truth_uuid)); - GNUNET_asprintf (&as->msg, - "A-%llu\nAnastasis\n%s", - (unsigned long long) as->code, - tpk); - GNUNET_free (tpk); - } - + GNUNET_asprintf (&as->msg, + "A-%llu\nAnastasis\n: %s", + (unsigned long long) as->code, + ANASTASIS_CRYPTO_uuid2s (&as->truth_uuid)); { const char *off = as->msg; size_t left = strlen (off); |