commit 4b72bbd0170a37ce271b6bd2016401baab4adcf5 parent 117baf0e5b30c1848a83f31083a9b0f5c117c90a Author: Florian Dold <florian@dold.me> Date: Fri, 16 Sep 2022 17:51:07 +0200 wallet-core: fix mixed age restrictions Diffstat:
| M | packages/taler-wallet-core/src/crypto/cryptoImplementation.ts | | | 9 | ++------- |
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -675,13 +675,8 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { let maybeAcp: AgeCommitmentProof | undefined = undefined; let maybeAgeCommitmentHash: string | undefined = undefined; - if (req.restrictAge || denomPub.age_mask) { - if (req.restrictAge && denomPub.age_mask === 0) { - throw Error( - "requested age restriction for a denomination that does not support age restriction", - ); - } - const age = req.restrictAge || 32; + if (denomPub.age_mask) { + const age = req.restrictAge || AgeRestriction.AGE_UNRESTRICTED; logger.info(`creating age-restricted planchet (age ${age})`); maybeAcp = await AgeRestriction.restrictionCommit( denomPub.age_mask,