Open
Description
Hi there.
I found this issue, and as per my understanding a credential issued CAN have any of the claims specified on the schema.
So basically if I got a schema like:
{
"name": "Driving licence Anoncred Schema",
"version": "1.0",
"attrNames": [
"emailAddress",
"familyName",
"dateOfIssuance",
"drivingLicenseID",
"drivingClass"
],
"issuerId": "did:test:mock"
}
If then I issue a credential with only "familyName".
The credential is issued successfully, but because of this code, any credential that doest fully have all claims defined of a schema will not be able to create a proof:
let schema_attrs = non_credential_schema
.attrs
.union(&cred_schema.attrs)
.cloned()
.collect::<BTreeSet<String>>();
let cred_attrs = BTreeSet::from_iter(cred_values.attrs_values.keys().cloned());
if schema_attrs != cred_attrs {
return Err(err_msg!(
"Credential doesn't correspond to credential schema"
));
}
Here is the location of the code:
anoncreds-clsignatures-rs/src/prover.rs
Line 1137 in 3ba4f23
If this logic is correct then IMO a credential cannot be issued without all the claims on a schema, and should fail there.
Metadata
Metadata
Assignees
Labels
No labels