diff options
author | Florian Dold <florian@dold.me> | 2022-06-01 11:54:45 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-06-01 11:54:45 +0200 |
commit | d780e9b187ffd4a3221ca1cf6c51dc5fa5385809 (patch) | |
tree | 4025c2aa992e597669110955980e1e56346071cb /packages/taler-wallet-core/src/crypto/cryptoImplementation.ts | |
parent | f9192d986f1e8fda891a2fd379f645f814fd68a3 (diff) | |
download | wallet-core-d780e9b187ffd4a3221ca1cf6c51dc5fa5385809.tar.xz |
wallet-core: only attest age if required/possible
Diffstat (limited to 'packages/taler-wallet-core/src/crypto/cryptoImplementation.ts')
-rw-r--r-- | packages/taler-wallet-core/src/crypto/cryptoImplementation.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts index 052d50ca7..7c6b00bcc 100644 --- a/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/cryptoImplementation.ts @@ -916,10 +916,12 @@ export const nativeCryptoR: TalerCryptoInterfaceR = { ); maybeAgeCommitmentHash = ach; hAgeCommitment = decodeCrock(ach); - minimumAgeSig = AgeRestriction.commitmentAttest( - depositInfo.ageCommitmentProof, - depositInfo.requiredMinimumAge!, - ); + if (depositInfo.requiredMinimumAge != null) { + minimumAgeSig = AgeRestriction.commitmentAttest( + depositInfo.ageCommitmentProof, + depositInfo.requiredMinimumAge, + ); + } } else { // All zeros. hAgeCommitment = new Uint8Array(32); |