mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
isMultipart to test on parts sizes only if object is encrypted (#13839)
ObjectInfo.isMultipart() is testing if parts sizes are compatible with encrypted parts but this only can be done if the object is encrypted.
This commit is contained in:
parent
b120bcb60a
commit
f286ef8e17
@ -91,15 +91,18 @@ func (o *ObjectInfo) isMultipart() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
_, encrypted := crypto.IsEncrypted(o.UserDefined)
|
_, encrypted := crypto.IsEncrypted(o.UserDefined)
|
||||||
if encrypted && !crypto.IsMultiPart(o.UserDefined) {
|
if encrypted {
|
||||||
return false
|
if !crypto.IsMultiPart(o.UserDefined) {
|
||||||
}
|
|
||||||
for _, part := range o.Parts {
|
|
||||||
_, err := sio.DecryptedSize(uint64(part.Size))
|
|
||||||
if err != nil {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
for _, part := range o.Parts {
|
||||||
|
_, err := sio.DecryptedSize(uint64(part.Size))
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Further check if this object is uploaded using multipart mechanism
|
// Further check if this object is uploaded using multipart mechanism
|
||||||
// by the user and it is not about Erasure internally splitting the
|
// by the user and it is not about Erasure internally splitting the
|
||||||
// object into parts in PutObject()
|
// object into parts in PutObject()
|
||||||
|
Loading…
Reference in New Issue
Block a user