Skip to content

Commit e733cbd

Browse files
authored
fix: set result.Err when verification failed (#61)
Signed-off-by: Binbin Li <libinbin@microsoft.com>
1 parent dae0ed2 commit e733cbd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

cosign/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/notaryproject/ratify-verifier-go/cosign
33
go 1.24.0
44

55
require (
6-
github.com/notaryproject/ratify-go v0.0.0-20250818061551-d370d67b849c
6+
github.com/notaryproject/ratify-go v0.0.0-20250829072315-27c492341d9c
77
github.com/opencontainers/go-digest v1.0.0
88
github.com/opencontainers/image-spec v1.1.1
99
github.com/sigstore/protobuf-specs v0.4.1

cosign/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
216216
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
217217
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
218218
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
219-
github.com/notaryproject/ratify-go v0.0.0-20250818061551-d370d67b849c h1:wCyBFVMocBvZnhNkqjuPbtYBbBmrjmxsQUtl3buY60Y=
220-
github.com/notaryproject/ratify-go v0.0.0-20250818061551-d370d67b849c/go.mod h1:143YHpwNPodbDo7OsDWdyLeR3oqF0oOEglD5UeIQWLY=
219+
github.com/notaryproject/ratify-go v0.0.0-20250829072315-27c492341d9c h1:7Xh7ikKFNLR3Cf8OlkaV3+MfkILQCOS94kSBFenjnnQ=
220+
github.com/notaryproject/ratify-go v0.0.0-20250829072315-27c492341d9c/go.mod h1:dxZiAQf5wyXtc9mvNEbSUp+NLcinlCJjMRijZwHr9zo=
221221
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
222222
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
223223
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=

cosign/verifier.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ func (v *Verifier) Verify(ctx context.Context, opts *ratify.VerifyOptions) (*rat
280280
result.Description = "Cosign signature verification succeeded"
281281
} else {
282282
result.Description = "Cosign signature verification failed: no valid signatures found"
283+
result.Err = errors.New("no valid signatures found, see result for details")
283284
}
284285
return result, nil
285286
}

0 commit comments

Comments
 (0)