mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: encrypt checksums in metadata (#15620)
This commit is contained in:
@@ -36,7 +36,6 @@ import (
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/minio/minio/internal/bucket/lifecycle"
|
||||
"github.com/minio/minio/internal/bucket/replication"
|
||||
"github.com/minio/minio/internal/hash"
|
||||
xhttp "github.com/minio/minio/internal/http"
|
||||
"github.com/minio/minio/internal/logger"
|
||||
"github.com/tinylib/msgp/msgp"
|
||||
@@ -640,7 +639,7 @@ func (j xlMetaV2Object) ToFileInfo(volume, path string) (FileInfo, error) {
|
||||
fi.TransitionTier = string(sc)
|
||||
}
|
||||
if crcs := j.MetaSys[ReservedMetadataPrefixLower+"crc"]; len(crcs) > 0 {
|
||||
fi.Checksum = hash.ReadCheckSums(crcs)
|
||||
fi.Checksum = crcs
|
||||
}
|
||||
return fi, nil
|
||||
}
|
||||
@@ -1541,14 +1540,7 @@ func (x *xlMetaV2) AddVersion(fi FileInfo) error {
|
||||
ventry.ObjectV2.MetaSys[ReservedMetadataPrefixLower+TransitionTier] = []byte(fi.TransitionTier)
|
||||
}
|
||||
if len(fi.Checksum) > 0 {
|
||||
res := make([]byte, 0, len(fi.Checksum)*40)
|
||||
for k, v := range fi.Checksum {
|
||||
crc := hash.NewChecksumString(k, v)
|
||||
if crc.Valid() {
|
||||
res = crc.AppendTo(res)
|
||||
}
|
||||
}
|
||||
ventry.ObjectV2.MetaSys[ReservedMetadataPrefixLower+"crc"] = res
|
||||
ventry.ObjectV2.MetaSys[ReservedMetadataPrefixLower+"crc"] = fi.Checksum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user