[#543] Add md5 sse-c S3Tests compatability #551
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#551
Loading…
Reference in a new issue
No description provided.
Delete branch "pogpp/frostfs-s3-gw:bugfix/543_md5_sse"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Pavel Pogodaev p.pogodaev@yadro.com
6cde68914a
to061c029e24
@ -229,0 +229,4 @@
rr := wrapReader(p.Reader, 64*1024, func(buf []byte) {
md5Hash.Write(buf)
})
r, encSize, err := encryptionReader(rr, p.Size, p.Info.Encryption.Key())
We need investigate on wrappers and, at least, remove hardcode for buffer sizes later on. #555
What about adding tests?
061c029e24
toae7b1fa478
ae7b1fa478
to5a5d5eee29
New commits pushed, approval review dismissed automatically according to repository settings
@ -385,0 +385,4 @@
result := listVersions(t, hc, bktName)
require.Len(t, result.Version, 1)
require.EqualValues(t, objLen, result.Version[0].Size)
As I understand this test pass even without fix. Please move these 3 line to
TestMultipartEncrypted
5a5d5eee29
to69a77c0194
See the following test
69a77c0194
to64cf1449b8
64cf1449b8
to12a1e0226a
12a1e0226a
todda6a17e8b
LGTM
@ -250,0 +253,4 @@
match := hex.EncodeToString(hashBytes) == hex.EncodeToString(createdObj.MD5Sum)
if p.Info.Encryption.Enabled() {
match = hex.EncodeToString(hashBytes) == hex.EncodeToString(md5Hash.Sum(nil))
// drive-by comment:
Is there any reason we convert to string here instead of using
bytes.Equal
?Seems like no reason at all. Seems like a good suggestion to me. /cc @pogpp
@ -449,7 +458,6 @@ func (n *Layer) CompleteMultipartUpload(ctx context.Context, p *CompleteMultipar
initMetadata[AttributeHMACKey] = encInfo.HMACKey
initMetadata[AttributeHMACSalt] = encInfo.HMACSalt
initMetadata[AttributeDecryptedSize] = strconv.FormatUint(multipartObjetSize, 10)
multipartObjetSize = encMultipartObjectSize
Seems that
encMultipartObjectSize
is unused now@ -248,3 +246,3 @@
if r, _, err = encryptionReader(p.Reader, size, p.Encryption.Key()); err != nil {
return nil, fmt.Errorf("create encrypter: %w", err)
}
p.Size = &encSize
@dkirillov Does this change affect s3-tests by any means? Can we safely remove setting
p.Size
there?I would say it doesn't affect. But haven't run all s3 tests on this pr
Please, see comments
dda6a17e8b
to8e260e3475
New commits pushed, approval review dismissed automatically according to repository settings
8e260e3475
to910331cd42
910331cd42
tod6c9ad4312