From ed1275a06345f578c3a21fd62458f3c7c96053ac Mon Sep 17 00:00:00 2001 From: poornas Date: Wed, 9 Jan 2019 15:17:21 -0800 Subject: [PATCH] Fix copy from encrypted multipart to single encrypted part (#7056) When source is encrypted multipart object and the parts are not evenly divisible by DARE package block size, target encrypted size will not necessarily be the same as encrypted source object. --- cmd/object-handlers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 8e85ff7cd..65919cbe5 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -914,7 +914,8 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re case !isSourceEncrypted && !isTargetEncrypted: targetSize = srcInfo.Size case isSourceEncrypted && isTargetEncrypted: - targetSize = srcInfo.Size + objInfo := ObjectInfo{Size: actualSize} + targetSize = objInfo.EncryptedSize() case !isSourceEncrypted && isTargetEncrypted: targetSize = srcInfo.EncryptedSize() case isSourceEncrypted && !isTargetEncrypted: