summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-03-07 20:44:18 +0100
committerFlorian Dold <florian@dold.me>2022-03-07 20:44:18 +0100
commit0323868e10ca1fc5d3e10ad9e6866b986f552680 (patch)
tree1545d12e40bf5caabecd006d842ad05339624e48 /packages/taler-wallet-core/src
parent0290c5fd379a4b4262d8835d4131b7c4e8a2f2f2 (diff)
downloadwallet-core-0323868e10ca1fc5d3e10ad9e6866b986f552680.tar.gz
wallet-core-0323868e10ca1fc5d3e10ad9e6866b986f552680.tar.bz2
wallet-core-0323868e10ca1fc5d3e10ad9e6866b986f552680.zip
fix tipping
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r--packages/taler-wallet-core/src/crypto/cryptoTypes.ts2
-rw-r--r--packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts11
-rw-r--r--packages/taler-wallet-core/src/operations/tip.ts2
3 files changed, 9 insertions, 6 deletions
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),
};
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts
index 039fb64a1..cc2d71ef4 100644
--- a/packages/taler-wallet-core/src/operations/tip.ts
+++ b/packages/taler-wallet-core/src/operations/tip.ts
@@ -27,13 +27,11 @@ import {
NotificationType,
TipPlanchetDetail,
TalerErrorCode,
- codecForMerchantTipResponseV1,
Logger,
URL,
DenomKeyType,
BlindedDenominationSignature,
codecForMerchantTipResponseV2,
- MerchantProtocolVersion,
} from "@gnu-taler/taler-util";
import { DerivedTipPlanchet } from "../crypto/cryptoTypes.js";
import {