From 3f68f21f56a27f794678314bdd89daad532dce54 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 13 Jan 2014 20:09:54 -0800 Subject: [PATCH] camerrors: rename MissingKeyBlob to ErrMissingKeyBlob Change-Id: I15b7e9c1d82b8933f7969d50030ae02fa27deae7 --- pkg/camerrors/errors.go | 5 ++++- pkg/jsonsign/verify.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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()