You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ACApy holders create a VP (as part of a DIF presentation exchange), the VP adds an extra field presentation_submission as the DIF spec says to do, however the @context and type for this field are not added to the VP document. For instance ACApy will create:
Without this context, presentation_submission is effectively undefined, which can cause more strict document loaders to error out completely. I had a look at ACApy's urdna2015 normalization for these VPs, and the behaviour i found is that context-less fields are silently dropped from the VP. In this case, presentation_submission and all of it's inner fields are dropped when normalized (both when signing as the holder, and verifying as the verifier). Effectively the presentation_submission data is never signed by the ld-proof.
I added some logs around the _canonize function to check this:
the presentation_submission field is silently dropped from the normalized data (used for signing and verifying the ldproof).
I believe the get_properties_without_context is meant to safe guard this from happening, however the first line of code for get_properties_without_context is a get-out-of-jail-free-card for VPs:
# FIXME: this doesn't work with nested @context structures...
if "verifiableCredential" in document:
return []
I'm not sure exactly how concerning the dropped fields are in this case; i see no reason why the presentation_submissionneeds signature integrity, it just seems like a convenience to include it in the VP document. Either way, i believe acapy definitely should be typing and signing it, and may need some caution around the normalization behaviour of dropping context-less fields
The text was updated successfully, but these errors were encountered:
Versions tested: 0.9.0 and 0.11.0
Missing DIF context/type in VP
When ACApy holders create a VP (as part of a DIF presentation exchange), the VP adds an extra field
presentation_submission
as the DIF spec says to do, however the@context
andtype
for this field are not added to the VP document. For instance ACApy will create:but it should be:
See DIF spec for document examples.
Dropped fields
Without this context,
presentation_submission
is effectively undefined, which can cause more strict document loaders to error out completely. I had a look at ACApy's urdna2015 normalization for these VPs, and the behaviour i found is that context-less fields are silently dropped from the VP. In this case,presentation_submission
and all of it's inner fields are dropped when normalized (both when signing as the holder, and verifying as the verifier). Effectively thepresentation_submission
data is never signed by the ld-proof.I added some logs around the
_canonize
function to check this:Here's an example of the result:
the
presentation_submission
field is silently dropped from the normalized data (used for signing and verifying the ldproof).I believe the
get_properties_without_context
is meant to safe guard this from happening, however the first line of code forget_properties_without_context
is a get-out-of-jail-free-card for VPs:I'm not sure exactly how concerning the dropped fields are in this case; i see no reason why the
presentation_submission
needs signature integrity, it just seems like a convenience to include it in the VP document. Either way, i believe acapy definitely should be typing and signing it, and may need some caution around the normalization behaviour of dropping context-less fieldsThe text was updated successfully, but these errors were encountered: