Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

fix: BBS+ Selective Disclosure output fields mix #2481

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

kdimak
Copy link
Contributor

@kdimak kdimak commented Jan 22, 2021

When the input VC document has the same id of two fields, output BBS+ Signature Proof of VC (selective disclosure) may contain invalid substituted fields.

The issue is filed in json-gold library (link). It works properly at JSON-LD playground (link). So current PR provides a workaround solution - to replace duplicated IDs with generated unique IDs before JSON-LD framing and then replacing IDs back.

closes #2460

Signed-off-by: Dmitriy Kinoshenko [email protected]

@codecov
Copy link

codecov bot commented Jan 22, 2021

Codecov Report

Merging #2481 (b41bcfb) into main (3510620) will increase coverage by 0.01%.
The diff coverage is 89.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2481      +/-   ##
==========================================
+ Coverage   89.28%   89.29%   +0.01%     
==========================================
  Files         250      250              
  Lines       18799    18850      +51     
==========================================
+ Hits        16784    16832      +48     
- Misses       1185     1187       +2     
- Partials      830      831       +1     
Impacted Files Coverage Δ
pkg/doc/signature/jsonld/processor.go 84.02% <88.70%> (+2.26%) ⬆️
...signature/suite/bbsblssignatureproof2020/signer.go 81.67% <100.00%> (+1.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3510620...b41bcfb. Read the comment docs.

@@ -484,7 +484,7 @@ func ExampleCredential_GenerateBBSSelectiveDisclosure() {
"VerifiableCredential",
"PermanentResidentCard"
],
"issuer": "did:example:489398593",
"issuer": "did:example:b34ca6cd37bbf23",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we use did:example:b34ca6cd37bbf23 ID for the issuer what coincides with ID of credentialSubject.

@@ -192,19 +192,7 @@ func buildDocVerificationData(docCompacted, revealDoc map[string]interface{},
return nil, fmt.Errorf("create verify document data: %w", err)
}

transformedInputDocumentStatements := make([]string, len(documentStatements))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was redundant.

@troyronda troyronda merged commit ff6d251 into hyperledger-archives:main Jan 22, 2021
@kdimak kdimak deleted the issue-2460 branch January 23, 2021 11:36
sudeshrshetty pushed a commit to sudeshrshetty/aries-framework-go that referenced this pull request Oct 18, 2021
sudeshrshetty pushed a commit to sudeshrshetty/aries-framework-go that referenced this pull request Jan 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

BBS+ Selective Disclosure output fields mix
4 participants