Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

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

Open
vasile135 opened this issue Nov 2, 2022 · 0 comments

Comments

@vasile135
Copy link

vasile135 commented Nov 2, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant