diff options
Diffstat (limited to 'packages/taler-wallet-core/src/crypto')
-rw-r--r-- | packages/taler-wallet-core/src/crypto/cryptoImplementation.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts index f0a5cba2b..193712e52 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -674,16 +674,17 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { let maybeAcp: AgeCommitmentProof | undefined = undefined; let maybeAgeCommitmentHash: string | undefined = undefined; - if (req.restrictAge) { - if (denomPub.age_mask === 0) { + 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", ); } - logger.info("creating age-restricted planchet"); + const age = req.restrictAge || 32; + logger.info(`creating age-restricted planchet (age ${age})`); maybeAcp = await AgeRestriction.restrictionCommit( denomPub.age_mask, - req.restrictAge, + age, ); maybeAgeCommitmentHash = AgeRestriction.hashCommitment( maybeAcp.commitment, |