Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk): disable data integrity proof for multi cred scenario #843

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions pkg/openid4vp/openid4vp.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,21 +731,22 @@ func createAuthorizedResponseMultiCred( //nolint:funlen,gocyclo // Unable to dec
return nil, e
}

if signer != nil {
e = addDataIntegrityProof(
fullVMID(holderDID, signingVM.ID),
didResolver,
documentLoader,
signer,
presentation,
ecdsa2019.SuiteTypeNew,
requestObject.Nonce,
requestObject.ClientID,
)
if e != nil {
return nil, fmt.Errorf("failed to add data integrity proof to VP: %w", e)
}
}
// TODO: Refactor data integrity proof implementation
//if signer != nil {
// e = addDataIntegrityProof(
// fullVMID(holderDID, signingVM.ID),
// didResolver,
// documentLoader,
// signer,
// presentation,
// ecdsa2019.SuiteTypeNew,
// requestObject.Nonce,
// requestObject.ClientID,
// )
// if e != nil {
// return nil, fmt.Errorf("failed to add data integrity proof to VP: %w", e)
// }
//}

jwtSigner, e := getHolderSigner(signingVM, crypto)
if e != nil {
Expand Down
40 changes: 20 additions & 20 deletions pkg/openid4vp/openid4vp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,26 +764,26 @@ func TestOpenID4VP_PresentCredential(t *testing.T) {
)
require.ErrorContains(t, err, "no supported linked data proof found")
})
t.Run("multiple credentials", func(t *testing.T) {
localKMS, err := localkms.NewLocalKMS(localkms.Config{
Storage: localkms.NewMemKMSStore(),
})
require.NoError(t, err)

signer, err := localKMS.AriesSuite.KMSCryptoSigner()
require.NoError(t, err)

_, err = createAuthorizedResponse(
credentials,
reqObject,
CustomClaims{},
&didResolverMock{ResolveValue: mockDoc},
&cryptoMock{},
lddl,
&presentOpts{signer: signer},
)
require.ErrorContains(t, err, "failed to add data integrity proof to VP")
})
//t.Run("multiple credentials", func(t *testing.T) {
// localKMS, err := localkms.NewLocalKMS(localkms.Config{
// Storage: localkms.NewMemKMSStore(),
// })
// require.NoError(t, err)
//
// signer, err := localKMS.AriesSuite.KMSCryptoSigner()
// require.NoError(t, err)
//
// _, err = createAuthorizedResponse(
// credentials,
// reqObject,
// CustomClaims{},
// &didResolverMock{ResolveValue: mockDoc},
// &cryptoMock{},
// lddl,
// &presentOpts{signer: signer},
// )
// require.ErrorContains(t, err, "failed to add data integrity proof to VP")
//})
})

t.Run("fail to send authorized response", func(t *testing.T) {
Expand Down
Loading