proper handling of coin with age restriction

When a coin with age restriction is used for payment, the contract might
or might not require an attestation of minimum age.

When it does, we sent the signed minimum age along with the whole age
commitment (array of pubkeys).

Added:  When the contract doesn't require a minimum age, we still sent
the hash of the age commitment, as this is needed for the deposit of the
coin.
This commit is contained in:
Özgür Kesim 2022-07-21 11:35:31 +02:00
parent b8a61eb98c
commit aff3100d89
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7

View File

@ -1042,9 +1042,15 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
cipher: DenomKeyType.Rsa,
rsa_signature: depositInfo.denomSig.rsa_signature,
},
age_commitment: depositInfo.ageCommitmentProof?.commitment.publicKeys,
minimum_age_sig: minimumAgeSig,
};
if (depositInfo.requiredMinimumAge != null) {
s.minimum_age_sig = minimumAgeSig;
s.age_commitment = depositInfo.ageCommitmentProof?.commitment.publicKeys;
} else if (depositInfo.ageCommitmentProof) {
s.h_age_commitment = hAgeCommitment;
}
return s;
} else {
throw Error(