Invalid input_descriptors
parsing while presenting mdoc
credentials
#834
Labels
bug
Something isn't working
Bug Description
It seems that the
path
values of theinput_descriptors.constraints.fields
of the Presentation Definition are incorrectly parsed by the Wallet when executing the presentation flow of themdoc
credentials, resulting in empty documents, i.e. no disclosures are presented.This is applicable when the
namespace
contains.
(dot) characters, as is the case with the Mobile Driving License (mDL), where, by the ISO/IEC 18013-5:2021, thenamespace
should be set toorg.iso.18013.5.1
.Additional context
The ISO/IEC TS 18013-7:2024 specifies that the
path
for selecting disclosures formdoc
credentials should look like$['<namespace>']['<data_element_identifier>']
, e.g.$['org.iso.18013.5.1']['family_name']
fornamespace
org.iso.18013.5.1
and disclosurefamily_name
.Here is the method that parses that
path
:waltid-identity/waltid-libraries/protocols/waltid-openid4vc/src/commonMain/kotlin/id/walt/oid4vc/data/dif/InputDescriptorField.kt
Lines 30 to 36 in 4d0f11a
Here, the call to
split('.')
will also split thenamespace
value, thus making thepathSegments.first()
return justorg
instead oforg.iso.18013.5.1
in the previous example. Theorg
namespace will not exist, and consequently, no disclosures will ever be matched/returned.There are multiple tests for creating the
mdoc
presentations, but they use the underlyingaddDataElementRequest
method directly, with the appropriate values, avoiding the call to the referencedaddToMdocRequest
method.To Reproduce
Without going into details, I will focus on the request body parameters of the end-to-end flow, i.e. the
mdoc
credential issuance, presentation, and verification. The issue seems to only be on the Wallet side, where the Issuer and the Verifier here serve only to be able to execute the whole flow.When calling the
/openid4vc/mdoc/issue
endpoint on the Issuer, the following payload is used (the key- and certificate-related data is intentionally omitted):Furthermore, when calling the
/openid4vc/verify
endpoint on the Verifier, the following payload is used (again, the key- and certificate-related data is intentionally omitted):The Presentation Definition sent to the Wallet will then contain this
input_desctiptor
. The wallet will parse thepath
value incorrectly and will present an empty credential.The text was updated successfully, but these errors were encountered: