diff --git a/pkg/camerrors/errors.go b/pkg/camerrors/errors.go index 1ff9b8cbc..4934d974d 100644 --- a/pkg/camerrors/errors.go +++ b/pkg/camerrors/errors.go @@ -22,4 +22,7 @@ import ( "errors" ) -var MissingKeyBlob = errors.New("key blob not found") +// ErrMissingKeyBlob is returned by the jsonsign handler when a +// verification fails because the public key for a signed blob is +// missing. +var ErrMissingKeyBlob = errors.New("key blob not found") diff --git a/pkg/jsonsign/verify.go b/pkg/jsonsign/verify.go index 651b9df5f..d8513c7d1 100644 --- a/pkg/jsonsign/verify.go +++ b/pkg/jsonsign/verify.go @@ -138,11 +138,11 @@ func (vr *VerifyRequest) ParsePayloadMap() bool { func (vr *VerifyRequest) FindAndParsePublicKeyBlob() bool { reader, _, err := vr.fetcher.FetchStreaming(vr.CamliSigner) if err != nil { - log.Printf("error fetching public key blob: %v", err) + log.Printf("error fetching public key blob %v: %v", vr.CamliSigner, err) // TODO(mpl): we're losing some info here, so maybe // create an error type that contains the reason, // instead of logging the reason. - vr.Err = camerrors.MissingKeyBlob + vr.Err = camerrors.ErrMissingKeyBlob return false } defer reader.Close()