From c8adb2c69016ed2f6a901c59fc947a1034884435 Mon Sep 17 00:00:00 2001 From: Gerard Snaauw <33763579+gerardsn@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:07:46 +0200 Subject: [PATCH] update go-did to v0.15.0 (#3492) --- go.mod | 2 +- go.sum | 4 ++-- vcr/verifier/signature_verifier.go | 3 +++ vcr/verifier/signature_verifier_test.go | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index eb5442895b..7b64dd1f03 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/nats-io/nats-server/v2 v2.10.21 github.com/nats-io/nats.go v1.37.0 github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b - github.com/nuts-foundation/go-did v0.14.0 + github.com/nuts-foundation/go-did v0.15.0 github.com/nuts-foundation/go-leia/v4 v4.0.3 github.com/nuts-foundation/go-stoabs v1.10.0 github.com/nuts-foundation/sqlite v1.0.0 diff --git a/go.sum b/go.sum index 9b9b5e51e9..e5d5c5fa70 100644 --- a/go.sum +++ b/go.sum @@ -350,8 +350,8 @@ github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAm github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI= github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b h1:80icUxWHwE1MrIOOEK5rxrtyKOgZeq5Iu1IjAEkggTY= github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b/go.mod h1:6YUioYirD6/8IahZkoS4Ypc8xbeJW76Xdk1QKcziNTM= -github.com/nuts-foundation/go-did v0.14.0 h1:Y1tuQCC2xmDX1bdXQS9iquwzJgcT1zcJxbZkqC5Dfac= -github.com/nuts-foundation/go-did v0.14.0/go.mod h1:dQm9b2dYUnhgVW1FmpAi5nNe0mfIrnxM3EaQx4GsDhI= +github.com/nuts-foundation/go-did v0.15.0 h1:aNl6KC8jiyRJGl9PPKFBboLLC0wUm5h+tjE1UBDQEPw= +github.com/nuts-foundation/go-did v0.15.0/go.mod h1:swjCJvcRxc+i1nyieIERWEb3vFb4N7iYC+qen2OIbNg= github.com/nuts-foundation/go-leia/v4 v4.0.3 h1:xNZznXWvcIwonXIDmpDDvF7KmP9BOK0MFt9ir3RD2gI= github.com/nuts-foundation/go-leia/v4 v4.0.3/go.mod h1:tYveGED8tSbQYhZNv2DVTc51c2zEWmSF+MG96PAtalY= github.com/nuts-foundation/go-stoabs v1.10.0 h1:mNzm9jgraMc69a8gTgteli8t1CMxr1+gyI7A9Eh0NDk= diff --git a/vcr/verifier/signature_verifier.go b/vcr/verifier/signature_verifier.go index 8e498c7f56..824bed7fd0 100644 --- a/vcr/verifier/signature_verifier.go +++ b/vcr/verifier/signature_verifier.go @@ -84,6 +84,9 @@ func (sv *signatureVerifier) jsonldProof(documentToVerify any, issuer string, at // for a VP this will not fail verificationMethod := ldProof.VerificationMethod.String() + if verificationMethod == "" { + return newVerificationError("missing proof") + } verificationMethodIssuer := strings.Split(verificationMethod, "#")[0] if verificationMethodIssuer == "" || verificationMethodIssuer != issuer { return errVerificationMethodNotOfIssuer diff --git a/vcr/verifier/signature_verifier_test.go b/vcr/verifier/signature_verifier_test.go index fdfa327ecf..cd1e9169e5 100644 --- a/vcr/verifier/signature_verifier_test.go +++ b/vcr/verifier/signature_verifier_test.go @@ -219,7 +219,7 @@ func TestSignatureVerifier_VerifySignature(t *testing.T) { err := sv.VerifySignature(vc2, nil) - assert.EqualError(t, err, "verification error: unsupported proof type: json: cannot unmarshal array into Go value of type proof.LDProof") + assert.EqualError(t, err, "verification error: missing proof") }) t.Run("error - wrong jws in proof", func(t *testing.T) {