From 979ec38ec44bf223c6578bffd5201d2de18a89c7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 2 Apr 2023 14:12:13 +0200 Subject: [PATCH] left-pad TOTP code with 0s --- src/util/crypto_confirmation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/crypto_confirmation.c b/src/util/crypto_confirmation.c index c5a674501..e52562e3e 100644 --- a/src/util/crypto_confirmation.c +++ b/src/util/crypto_confirmation.c @@ -189,7 +189,7 @@ executive_totp (void *h_key, if (NULL == ret) { GNUNET_asprintf (&ret, - "%llu", + "%08llu", (unsigned long long) code); } else @@ -197,7 +197,7 @@ executive_totp (void *h_key, char *tmp; GNUNET_asprintf (&tmp, - "%s\n%llu", + "%s\n%08llu", ret, (unsigned long long) code); GNUNET_free (ret);