Skip to content

Commit

Permalink
updated notation-go
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Aug 30, 2023
1 parent d818c0a commit 920747b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions cmd/notation/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package main
import (
"errors"
"fmt"
"io/fs"
"os"
"reflect"

Expand Down Expand Up @@ -158,12 +159,13 @@ func checkVerificationFailure(outcomes []*notation.VerificationOutcome, printOut
// write out on failure
if err != nil {
for _, outcome := range outcomes {
fmt.Fprintf(os.Stderr, "Error: Failed to verify signature with digest %v, ", outcome.SignatureManifestDescriptor.Digest)
var errorNonExistence truststore.ErrorNonExistence
if errors.As(outcome.Error, &errorNonExistence) {
fmt.Fprintf(os.Stderr, "%s. Use command 'notation cert add' to create and add trusted certificates to the trust store.\n", errorNonExistence)
var errTrustStore truststore.ErrorTrustStore
var errCertificate truststore.ErrorCertificate
if (errors.As(outcome.Error, &errTrustStore) && errors.Is(errTrustStore, fs.ErrNotExist)) ||
(errors.As(outcome.Error, &errCertificate) && errors.Is(errCertificate, fs.ErrNotExist)) {
fmt.Fprintf(os.Stderr, "Error: %v. Use command 'notation cert add' to create and add trusted certificates to the trust store.\n", outcome.Error)
} else {
fmt.Fprintln(os.Stderr, outcome.Error)
fmt.Fprintf(os.Stderr, "Error: %v\n", outcome.Error)
}
}
var errorVerificationFailed notation.ErrorVerificationFailed
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ require (
golang.org/x/sys v0.11.0 // indirect
)

replace github.com/notaryproject/notation-go => github.com/Two-Hearts/notation-go v0.0.0-20230829013913-fcd8ca6c4475
replace github.com/notaryproject/notation-go => github.com/Two-Hearts/notation-go v0.0.0-20230830040707-06b9ea427f0e
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8=
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
github.com/Two-Hearts/notation-go v0.0.0-20230829013913-fcd8ca6c4475 h1:U4v/Olg4RhrsmkVXuQt7ecvrvE7saactrvA86ahHaFs=
github.com/Two-Hearts/notation-go v0.0.0-20230829013913-fcd8ca6c4475/go.mod h1:nk9Wa8cwIkpajw3J+2axNzk/bOuIGa446gTyjjbalWs=
github.com/Two-Hearts/notation-go v0.0.0-20230830040707-06b9ea427f0e h1:CS85l8f1kPkq5uwfFLtLl9kLK16RfoeepSR2jnZqA3U=
github.com/Two-Hearts/notation-go v0.0.0-20230830040707-06b9ea427f0e/go.mod h1:nk9Wa8cwIkpajw3J+2axNzk/bOuIGa446gTyjjbalWs=
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA=
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down

0 comments on commit 920747b

Please sign in to comment.