From 5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 21 Feb 2022 12:40:51 +0100 Subject: towards implementing breaking exchange protocol changes --- .../taler-wallet-core/src/operations/withdraw.ts | 29 ++++------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts') diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 79220089b..731e9b3aa 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -43,6 +43,7 @@ import { DenomKeyType, LibtoolVersion, UnblindedSignature, + ExchangeWithdrawRequest, } from "@gnu-taler/taler-util"; import { CoinRecord, @@ -497,9 +498,8 @@ async function processPlanchetExchangeRequest( `processing planchet #${coinIdx} in withdrawal ${withdrawalGroup.withdrawalGroupId}`, ); - const reqBody: any = { + const reqBody: ExchangeWithdrawRequest = { denom_pub_hash: planchet.denomPubHash, - reserve_pub: planchet.reservePub, reserve_sig: planchet.withdrawSig, coin_ev: planchet.coinEv, }; @@ -580,28 +580,12 @@ async function processPlanchetVerifyAndStoreCoin( const { planchet, exchangeBaseUrl } = d; const planchetDenomPub = planchet.denomPub; - if ( - planchetDenomPub.cipher !== DenomKeyType.Rsa && - planchetDenomPub.cipher !== DenomKeyType.LegacyRsa - ) { + if (planchetDenomPub.cipher !== DenomKeyType.Rsa) { throw Error(`cipher (${planchetDenomPub.cipher}) not supported`); } let evSig = resp.ev_sig; - if (typeof resp.ev_sig === "string") { - evSig = { - cipher: DenomKeyType.LegacyRsa, - blinded_rsa_signature: resp.ev_sig, - }; - } else { - evSig = resp.ev_sig; - } - if ( - !( - evSig.cipher === DenomKeyType.Rsa || - evSig.cipher === DenomKeyType.LegacyRsa - ) - ) { + if (!(evSig.cipher === DenomKeyType.Rsa)) { throw Error("unsupported cipher"); } @@ -639,10 +623,7 @@ async function processPlanchetVerifyAndStoreCoin( } let denomSig: UnblindedSignature; - if ( - planchet.denomPub.cipher === DenomKeyType.LegacyRsa || - planchet.denomPub.cipher === DenomKeyType.Rsa - ) { + if (planchet.denomPub.cipher === DenomKeyType.Rsa) { denomSig = { cipher: planchet.denomPub.cipher, rsa_signature: denomSigRsa, -- cgit v1.2.3