Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypt checksums with KMS on CompleteMultipartUpload #16177

Merged

Conversation

klauspost
Copy link
Contributor

Description

With KMS encryption, if checksums were provided on upload, they were not encrypted, resulting in the following error:

Error: sio: unexpected EOF (sio.Error)
       5: d:\minio\minio\internal\logger\logger.go:258:logger.LogIf()
       4: d:\minio\minio\cmd\encryption-v1.go:1095:cmd.(*ObjectInfo).decryptChecksums()
       3: d:\minio\minio\cmd\object-handlers-common.go:319:cmd.setPutObjHeaders()
       2: d:\minio\minio\cmd\object-multipart-handlers.go:687:cmd.objectAPIHandlers.CompleteMultipartUploadHandler()
       1: net\http\server.go:2109:http.HandlerFunc.ServeHTTP()

Add encryption function to encrypt data properly.

How to test this PR?

Upload multipart with checksum to encrypted backend.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

On KMS encryption, if checksums were provided on upload, they were not encrypted, resulting in the following error:

```
Error: sio: unexpected EOF (sio.Error)
       5: d:\minio\minio\internal\logger\logger.go:258:logger.LogIf()
       4: d:\minio\minio\cmd\encryption-v1.go:1095:cmd.(*ObjectInfo).decryptChecksums()
       3: d:\minio\minio\cmd\object-handlers-common.go:319:cmd.setPutObjHeaders()
       2: d:\minio\minio\cmd\object-multipart-handlers.go:687:cmd.objectAPIHandlers.CompleteMultipartUploadHandler()
       1: net\http\server.go:2109:http.HandlerFunc.ServeHTTP()
```

Add encryption function to encrypt data properly.
cmd/erasure-multipart.go Outdated Show resolved Hide resolved
cmd/erasure-multipart.go Outdated Show resolved Hide resolved
Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@klauspost
Copy link
Contributor Author

x-amz-server-side-encryption-customer-algorithm
The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm.

So this is required for checksums.

@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-erasure.sh ✔️
mint-dist-erasure.sh ✔️
mint-compress-encrypt-dist-erasure.sh ✔️
mint-pools.sh ✔️
Deleting image on docker hub
Deleting image locally

@harshavardhana harshavardhana merged commit 12fd667 into minio:master Dec 7, 2022
@klauspost klauspost deleted the add-multipart-sse-kms-checksums branch December 7, 2022 18:28
@bh4t bh4t added the bugfix label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants