mirror of
https://github.com/minio/minio.git
synced 2026-02-05 02:10:14 -05:00
Fix SSE-C checksums (#19896)
Compression will be disabled by default if SSE-C is specified. So we can still honor SSE-C.
This commit is contained in:
@@ -755,7 +755,7 @@ type ObjReaderFn func(inputReader io.Reader, h http.Header, cleanupFns ...func()
|
||||
// are called on Close() in FIFO order as passed in ObjReadFn(). NOTE: It is
|
||||
// assumed that clean up functions do not panic (otherwise, they may
|
||||
// not all run!).
|
||||
func NewGetObjectReader(rs *HTTPRangeSpec, oi ObjectInfo, opts ObjectOptions) (
|
||||
func NewGetObjectReader(rs *HTTPRangeSpec, oi ObjectInfo, opts ObjectOptions, h http.Header) (
|
||||
fn ObjReaderFn, off, length int64, err error,
|
||||
) {
|
||||
if opts.CheckPrecondFn != nil && opts.CheckPrecondFn(oi) {
|
||||
@@ -810,7 +810,9 @@ func NewGetObjectReader(rs *HTTPRangeSpec, oi ObjectInfo, opts ObjectOptions) (
|
||||
return b, nil
|
||||
}
|
||||
if isEncrypted {
|
||||
decrypt = oi.compressionIndexDecrypt
|
||||
decrypt = func(b []byte) ([]byte, error) {
|
||||
return oi.compressionIndexDecrypt(b, h)
|
||||
}
|
||||
}
|
||||
// In case of range based queries on multiparts, the offset and length are reduced.
|
||||
off, decOff, firstPart, decryptSkip, seqNum = getCompressedOffsets(oi, off, decrypt)
|
||||
@@ -982,8 +984,8 @@ func compressionIndexEncrypter(key crypto.ObjectKey, input func() []byte) func()
|
||||
}
|
||||
|
||||
// compressionIndexDecrypt reverses compressionIndexEncrypter.
|
||||
func (o *ObjectInfo) compressionIndexDecrypt(input []byte) ([]byte, error) {
|
||||
return o.metadataDecrypter()("compression-index", input)
|
||||
func (o *ObjectInfo) compressionIndexDecrypt(input []byte, h http.Header) ([]byte, error) {
|
||||
return o.metadataDecrypter(h)("compression-index", input)
|
||||
}
|
||||
|
||||
// SealMD5CurrFn seals md5sum with object encryption key and returns sealed
|
||||
|
||||
Reference in New Issue
Block a user