wallet-core: update deposit signature

This commit is contained in:
Florian Dold 2023-08-29 14:22:43 +02:00
parent 5aa883b5d1
commit 5852b5cf2e
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -723,7 +723,7 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
maybeAcp = await AgeRestriction.restrictionCommitSeeded( maybeAcp = await AgeRestriction.restrictionCommitSeeded(
denomPub.age_mask, denomPub.age_mask,
age, age,
stringToBytes(req.secretSeed) stringToBytes(req.secretSeed),
); );
maybeAgeCommitmentHash = AgeRestriction.hashCommitment( maybeAgeCommitmentHash = AgeRestriction.hashCommitment(
maybeAcp.commitment, maybeAcp.commitment,
@ -1127,6 +1127,8 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
// All zeros. // All zeros.
hAgeCommitment = new Uint8Array(32); hAgeCommitment = new Uint8Array(32);
} }
// FIXME: Actually allow passing user data here!
const walletDataHash = new Uint8Array(64);
let d: Uint8Array; let d: Uint8Array;
if (depositInfo.denomKeyType === DenomKeyType.Rsa) { if (depositInfo.denomKeyType === DenomKeyType.Rsa) {
d = buildSigPS(TalerSignaturePurpose.WALLET_COIN_DEPOSIT) d = buildSigPS(TalerSignaturePurpose.WALLET_COIN_DEPOSIT)
@ -1140,6 +1142,7 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
.put(amountToBuffer(depositInfo.spendAmount)) .put(amountToBuffer(depositInfo.spendAmount))
.put(amountToBuffer(depositInfo.feeDeposit)) .put(amountToBuffer(depositInfo.feeDeposit))
.put(decodeCrock(depositInfo.merchantPub)) .put(decodeCrock(depositInfo.merchantPub))
.put(walletDataHash)
.build(); .build();
} else { } else {
throw Error("unsupported exchange protocol version"); throw Error("unsupported exchange protocol version");