commit ecfb6f19b1f9e113bc0ead00db9fde8188581084
parent e0c644bddca4bab83c3f9ec197fe5e59d1d3e9c1
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 20 Apr 2026 00:15:50 +0200
compute paivana hash without complex KDF as per spec
Diffstat:
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/backend/paivana-httpd_cookie.c b/src/backend/paivana-httpd_cookie.c
@@ -1,7 +1,6 @@
/*
This file is part of GNU Taler
- Copyright (C) 2012-2014 GNUnet e.V.
- Copyright (C) 2018, 2025 Taler Systems SA
+ Copyright (C) 2026 Taler Systems SA
GNU Taler is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -20,9 +19,7 @@
*/
/**
- * @author Martin Schanzenbach
* @author Christian Grothoff
- * @author Marcello Stanisci
* @file src/backend/paivana-httpd_cookie.c
* @brief Cookie computation logic for paivana
*/
@@ -150,21 +147,25 @@ PAIVANA_HTTPD_compute_paivana_id (struct GNUNET_TIME_Timestamp cur_time,
const struct PAIVANA_Nonce *nonce)
{
struct GNUNET_TIME_AbsoluteNBO e;
+ struct GNUNET_HashContext *hc;
struct GNUNET_HashCode h;
char *end;
char cstr[128];
char *res;
e = GNUNET_TIME_absolute_hton (cur_time.abs_time);
- GNUNET_assert (GNUNET_YES ==
- GNUNET_CRYPTO_hkdf_gnunet (
- &h, /* result */
- sizeof (h),
- nonce,
- sizeof (*nonce),
- &e,
- sizeof (e),
- GNUNET_CRYPTO_kdf_arg_string (website)));
+ hc = GNUNET_CRYPTO_hash_context_start ();
+ GNUNET_CRYPTO_hash_context_read (hc,
+ nonce,
+ sizeof (*nonce));
+ GNUNET_CRYPTO_hash_context_read (hc,
+ website,
+ strlen (website) + 1);
+ GNUNET_CRYPTO_hash_context_read (hc,
+ &e,
+ sizeof (e));
+ GNUNET_CRYPTO_hash_context_finish (hc,
+ &h);
end = GNUNET_STRINGS_data_to_string (&h,
sizeof (h),
cstr,