diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-10-25 18:37:06 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-27 09:23:13 +0200 |
commit | 74234f75a41222f6a630106be75a799f4f02ec1d (patch) | |
tree | 0462b4a2c46d157cdeb07236c0b94962c9e185d9 /src/util | |
parent | f0951d34ddd525a04bcb9daabbc55bd1ced2575e (diff) | |
download | exchange-74234f75a41222f6a630106be75a799f4f02ec1d.tar.xz |
-work on FTBFS
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/crypto_wire.c | 30 | ||||
-rw-r--r-- | src/util/payto.c | 15 |
2 files changed, 19 insertions, 26 deletions
diff --git a/src/util/crypto_wire.c b/src/util/crypto_wire.c index 1975b518a..616ae410e 100644 --- a/src/util/crypto_wire.c +++ b/src/util/crypto_wire.c @@ -24,28 +24,6 @@ /** - * Compute the hash of the given wire details. The resulting - * hash is what is signed by the master key. - * - * @param payto_uri bank account - * @param[out] hc set to the hash - */ -void -TALER_exchange_wire_signature_hash (const char *payto_uri, - struct TALER_PaytoHash *hc) -{ - GNUNET_assert (GNUNET_YES == - GNUNET_CRYPTO_kdf (hc, - sizeof (*hc), - payto_uri, - strlen (payto_uri) + 1, - "exchange-wire-signature", - strlen ("exchange-wire-signature"), - NULL, 0)); -} - - -/** * Check the signature in @a master_sig. * * @param payto_uri URL that is signed @@ -64,8 +42,8 @@ TALER_exchange_wire_signature_check ( .purpose.size = htonl (sizeof (wd)) }; - TALER_exchange_wire_signature_hash (payto_uri, - &wd.h_wire_details); + TALER_payto_hash (payto_uri, + &wd.h_wire_details); return GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_WIRE_DETAILS, &wd, &master_sig->eddsa_signature, @@ -91,8 +69,8 @@ TALER_exchange_wire_signature_make ( .purpose.size = htonl (sizeof (wd)) }; - TALER_exchange_wire_signature_hash (payto_uri, - &wd.h_wire_details); + TALER_payto_hash (payto_uri, + &wd.h_wire_details); GNUNET_CRYPTO_eddsa_sign (&master_priv->eddsa_priv, &wd, &master_sig->eddsa_signature); diff --git a/src/util/payto.c b/src/util/payto.c index 26872f1ee..bc8370c40 100644 --- a/src/util/payto.c +++ b/src/util/payto.c @@ -260,7 +260,22 @@ void TALER_payto_hash (const char *payto, struct TALER_PaytoHash *h_payto) { + /* FIXME: 0.8 had TWO WAYS to hash a payto! + one for the exchange, the other + for merchants (i.e. reserve closing). + I think we should unify... */ +#if OLD_EXCHANGE_WAY + GNUNET_assert (GNUNET_YES == + GNUNET_CRYPTO_kdf (hc, + sizeof (*hc), + payto_uri, + strlen (payto_uri) + 1, + "exchange-wire-signature", + strlen ("exchange-wire-signature"), + NULL, 0)); +#else GNUNET_CRYPTO_hash (payto, strlen (payto) + 1, &h_payto->hash); +#endif } |