diff --git a/storage/manifest.go b/storage/manifest.go index 895a112ec..000bc617c 100644 --- a/storage/manifest.go +++ b/storage/manifest.go @@ -6,6 +6,8 @@ import ( "fmt" "strings" + "github.com/Sirupsen/logrus" + "github.com/docker/libtrust" "github.com/docker/docker-registry/digest" @@ -78,7 +80,7 @@ type Manifest struct { // SignedManifest. This typically won't be used within the registry, except // for testing. func (m *Manifest) Sign(pk libtrust.PrivateKey) (*SignedManifest, error) { - p, err := json.Marshal(m) + p, err := json.MarshalIndent(m, "", " ") if err != nil { return nil, err } @@ -107,7 +109,7 @@ func (m *Manifest) Sign(pk libtrust.PrivateKey) (*SignedManifest, error) { // The public key of the first element in the chain must be the public key // corresponding with the sign key. func (m *Manifest) SignWithChain(key libtrust.PrivateKey, chain []*x509.Certificate) (*SignedManifest, error) { - p, err := json.Marshal(m) + p, err := json.MarshalIndent(m, "", " ") if err != nil { return nil, err } @@ -148,6 +150,7 @@ type SignedManifest struct { func (sm *SignedManifest) Verify() ([]libtrust.PublicKey, error) { js, err := libtrust.ParsePrettySignature(sm.Raw, "signatures") if err != nil { + logrus.WithField("err", err).Debugf("(*SignedManifest).Verify") return nil, err }