From 0323868e10ca1fc5d3e10ad9e6866b986f552680 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 7 Mar 2022 20:44:18 +0100 Subject: fix tipping --- packages/taler-wallet-core/src/crypto/cryptoTypes.ts | 2 +- .../src/crypto/workers/cryptoImplementation.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/crypto') diff --git a/packages/taler-wallet-core/src/crypto/cryptoTypes.ts b/packages/taler-wallet-core/src/crypto/cryptoTypes.ts index 94abb8f7c..00a7fba81 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoTypes.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoTypes.ts @@ -110,7 +110,7 @@ export interface DeriveTipRequest { */ export interface DerivedTipPlanchet { blindingKey: string; - coinEv: string; + coinEv: CoinEnvelope; coinEvHash: string; coinPriv: string; coinPub: string; diff --git a/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts index f9cc63ecc..d96e83058 100644 --- a/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts @@ -229,11 +229,16 @@ export class CryptoImplementation { const denomPub = decodeCrock(req.denomPub.rsa_public_key); const coinPubHash = hash(fc.coinPub); const ev = rsaBlind(coinPubHash, fc.bks, denomPub); - + const coinEv = { + cipher: DenomKeyType.Rsa, + rsa_blinded_planchet: encodeCrock(ev), + }; const tipPlanchet: DerivedTipPlanchet = { blindingKey: encodeCrock(fc.bks), - coinEv: encodeCrock(ev), - coinEvHash: encodeCrock(hash(ev)), + coinEv, + coinEvHash: encodeCrock( + hashCoinEv(coinEv, encodeCrock(hashDenomPub(req.denomPub))), + ), coinPriv: encodeCrock(fc.coinPriv), coinPub: encodeCrock(fc.coinPub), }; -- cgit v1.2.3