aries-framework-dotnet icon indicating copy to clipboard operation
aries-framework-dotnet copied to clipboard

VerifyProofAsync error when credential attribute is a string made of digits starting with "0".

Open vasile135 opened this issue 3 years ago • 0 comments

Steps to reproduce:

  • Issued a credential that has an attribute with the mime type "text/plain" and the value "088003297" (a string that starts with "0" and has only digits).
  • The holder successfully accepted and stored this credential.
  • Created a presentation using this document and this attribute value. The created Proof JSON contains the following revealed attribute: "RegistrationDocumentNumber": { "sub_proof_index": 0, "raw": "088003297", "encoded": "88003297" }, The "encoded" value have lost it's "0".
  • When the verifier calls _proofService.VerifyProofAsync(context, proof.RequestJson, proof.ProofJson), an error is thrown saying: "The encoded value for 'RegistrationDocumentNumber' is invalid. Expected '88003297'. Actual '88003297'". image When emit a document with the RegistrationDocumentNumber = "55454" for example, everything works as expected.

Expected result:

  • Must be able to create a valid presentation using an attribute with the string value "088003297" (starting with 0, only digits).

Not sure if the issue is in Aries or Indy. Theoretically the issue occurs when the Proof is created at the Hyperledger.Indy.AnonCredsApi.AnonCreds.ProverCreateProofAsync method that calls the NativeMethods.indy_prover_create_proof from Indy.

vasile135 avatar Nov 02 '22 13:11 vasile135