From 780eb20227d07afeea654e8b883790b6b1ab8e1c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 31 Oct 2022 16:50:54 +0100 Subject: wallet-core: fix deposit with age restrictions --- packages/taler-wallet-core/src/crypto/cryptoImplementation.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core/src/crypto/cryptoImplementation.ts') diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts index 98bb6c9cb..892d3fc8f 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -1074,13 +1074,11 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { // FIXME: put extensions here if used const hExt = new Uint8Array(64); let hAgeCommitment: Uint8Array; - let maybeAgeCommitmentHash: string | undefined = undefined; let minimumAgeSig: string | undefined = undefined; if (depositInfo.ageCommitmentProof) { const ach = AgeRestriction.hashCommitment( depositInfo.ageCommitmentProof.commitment, ); - maybeAgeCommitmentHash = ach; hAgeCommitment = decodeCrock(ach); if (depositInfo.requiredMinimumAge != null) { minimumAgeSig = encodeCrock( @@ -1130,11 +1128,12 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { }; if (depositInfo.requiredMinimumAge != null) { + // These are only required by the merchant s.minimum_age_sig = minimumAgeSig; s.age_commitment = depositInfo.ageCommitmentProof?.commitment.publicKeys; } else if (depositInfo.ageCommitmentProof) { - (s as any).h_age_commitment = encodeCrock(hAgeCommitment); + s.h_age_commitment = encodeCrock(hAgeCommitment); } return s; -- cgit v1.2.3