commit 351eeea26e5c55801e358be198b11d6a43fa44eb
parent aa12a8a80b99937af7f1dedd5245efad8bd150bc
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 27 Apr 2026 22:13:11 +0200
paivana-ID uses base64, not base32
Diffstat:
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_post-templates-TEMPLATE_ID.c b/src/backend/taler-merchant-httpd_post-templates-TEMPLATE_ID.c
@@ -488,7 +488,6 @@ parse_using_templates_paivana_request (
GNUNET_JSON_spec_end ()
};
enum GNUNET_GenericReturnValue res;
- struct GNUNET_ShortHashCode sh;
unsigned long long tv;
const char *dash;
@@ -518,18 +517,23 @@ parse_using_templates_paivana_request (
dash = strchr (uc->parse_request.paivana.paivana_id,
'-');
GNUNET_assert (NULL != dash);
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (dash + 1,
- strlen (dash + 1),
- &sh,
- sizeof (sh)))
{
- GNUNET_break_op (0);
- use_reply_with_error (uc,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "paivana_id");
- return GNUNET_SYSERR;
+ size_t olen;
+ void *out = NULL;
+
+ olen = GNUNET_STRINGS_base64url_decode (dash + 1,
+ strlen (dash + 1),
+ &out);
+ GNUNET_free (out);
+ if (sizeof (struct GNUNET_ShortHashCode) != olen)
+ {
+ GNUNET_break_op (0);
+ use_reply_with_error (uc,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MALFORMED,
+ "paivana_id");
+ return GNUNET_SYSERR;
+ }
}
return GNUNET_OK;
}