From 5c4c25516df9d65d29dc7f3f38b5a2a1a8e9e374 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 27 Nov 2021 20:56:58 +0100 Subject: wallet: support both protocol versions --- packages/taler-wallet-core/src/operations/tip.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/tip.ts') diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index 0253930ea..cf3502ecd 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -314,13 +314,13 @@ async function processTipImpl( let blindedSigs: BlindedDenominationSignature[] = []; - if (merchantInfo.supportsMerchantProtocolV2) { + if (merchantInfo.protocolVersionCurrent === 2) { const response = await readSuccessResponseJsonOrThrow( merchantResp, codecForMerchantTipResponseV2(), ); blindedSigs = response.blind_sigs.map((x) => x.blind_sig); - } else if (merchantInfo.supportsMerchantProtocolV1) { + } else if (merchantInfo.protocolVersionCurrent === 1) { const response = await readSuccessResponseJsonOrThrow( merchantResp, codecForMerchantTipResponseV1(), @@ -347,11 +347,17 @@ async function processTipImpl( const planchet = planchets[i]; checkLogicInvariant(!!planchet); - if (denom.denomPub.cipher !== DenomKeyType.Rsa) { + if ( + denom.denomPub.cipher !== DenomKeyType.Rsa && + denom.denomPub.cipher !== DenomKeyType.LegacyRsa + ) { throw Error("unsupported cipher"); } - if (blindedSig.cipher !== DenomKeyType.Rsa) { + if ( + blindedSig.cipher !== DenomKeyType.Rsa && + blindedSig.cipher !== DenomKeyType.LegacyRsa + ) { throw Error("unsupported cipher"); } -- cgit v1.2.3