aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-06-01 11:54:45 +0200
committerFlorian Dold <florian@dold.me>2022-06-01 11:54:45 +0200
commitd780e9b187ffd4a3221ca1cf6c51dc5fa5385809 (patch)
tree4025c2aa992e597669110955980e1e56346071cb
parentf9192d986f1e8fda891a2fd379f645f814fd68a3 (diff)
wallet-core: only attest age if required/possible
-rw-r--r--packages/taler-wallet-core/src/crypto/cryptoImplementation.ts10
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);