wallet-core: only attest age if required/possible

This commit is contained in:
Florian Dold 2022-06-01 11:54:45 +02:00
parent f9192d986f
commit d780e9b187
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -916,10 +916,12 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
); );
maybeAgeCommitmentHash = ach; maybeAgeCommitmentHash = ach;
hAgeCommitment = decodeCrock(ach); hAgeCommitment = decodeCrock(ach);
minimumAgeSig = AgeRestriction.commitmentAttest( if (depositInfo.requiredMinimumAge != null) {
depositInfo.ageCommitmentProof, minimumAgeSig = AgeRestriction.commitmentAttest(
depositInfo.requiredMinimumAge!, depositInfo.ageCommitmentProof,
); depositInfo.requiredMinimumAge,
);
}
} else { } else {
// All zeros. // All zeros.
hAgeCommitment = new Uint8Array(32); hAgeCommitment = new Uint8Array(32);