Browse Source

Payload checksum now match the checksum simple

Backported for backward compatibility.

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
Sam Alba 11 years ago
parent
commit
de9fba7172
1 changed files with 3 additions and 1 deletions
  1. 3 1
      registry/registry.go

+ 3 - 1
registry/registry.go

@@ -437,8 +437,10 @@ func (r *Registry) PushImageLayerRegistry(imgID string, layer io.Reader, registr
 
 	utils.Debugf("[registry] Calling PUT %s", registry+"images/"+imgID+"/layer")
 
-	h := sha256.New()
 	tarsumLayer := &utils.TarSum{Reader: layer}
+	h := sha256.New()
+	h.Write(jsonRaw)
+	h.Write([]byte{'\n'})
 	checksumLayer := &utils.CheckSum{Reader: tarsumLayer, Hash: h}
 
 	req, err := r.reqFactory.NewRequest("PUT", registry+"images/"+imgID+"/layer", checksumLayer)