aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-03-08 11:47:51 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2022-03-08 11:47:51 +0100
commitcd5ee2338cd0c1d2923244d3ac2cc9695c5a8e25 (patch)
treeb67efcc47511f9bffb5163f5d5ca130a5c40c61f /src/util
parentab3868f83ba8d90ab5a85938a0a9084dcb54b249 (diff)
-ensure label has no zero bytes
Diffstat (limited to 'src/util')
-rw-r--r--src/util/age_restriction.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/age_restriction.c b/src/util/age_restriction.c
index 58db23413..92143ad09 100644
--- a/src/util/age_restriction.c
+++ b/src/util/age_restriction.c
@@ -184,7 +184,12 @@ TALER_age_commitment_derive (
new->proof.num,
struct TALER_AgeCommitmentPrivateKeyP);
- memcpy (label, &salt, sizeof(salt));
+ {
+ /* Because GNUNET_CRYPTO_ecdsa_public_key_derive expects char * (and calls
+ * strlen on it), we must avoid 0's in the label. */
+ uint64_t nz_salt = salt | 0x8040201008040201;
+ memcpy (label, &nz_salt, sizeof(nz_salt));
+ }
/* 1. Derive the public keys */
for (size_t i = 0; i < orig->commitment.num; i++)