commit 41bd4a733c5b67a691219c328af89c3a68447234 parent b8f40c83dad67a6a4e41d723e28b75641eae537c Author: Christian Grothoff <christian@grothoff.org> Date: Wed, 29 Jul 2026 18:59:26 +0200 totp: re-check the secret length before computing codes Diffstat:
| M | src/authorization/anastasis_authorization_plugin_totp.c | | | 7 | +++++++ |
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/authorization/anastasis_authorization_plugin_totp.c b/src/authorization/anastasis_authorization_plugin_totp.c @@ -227,6 +227,13 @@ totp_start (void *cls, unsigned int off = 0; GNUNET_assert (0 == code); + if (SECRET_LEN != data_length) + { + /* totp_validate() enforces this on upload, but the truth we are handed + here comes back from the database, so do not trust its length. */ + GNUNET_break_op (0); + return NULL; + } as = GNUNET_new (struct ANASTASIS_AUTHORIZATION_State); as->ac = ac; as->truth_uuid = *truth_uuid;