Files
seaweedfs/weed
d84235e74f s3api: encrypt SSE-KMS requests that name no key with alias/aws/s3 (#13378)
* s3api: encrypt SSE-KMS requests that name no key with alias/aws/s3

AWS encrypts an SSE-KMS request that sends no key ID with the aws/s3
managed key. PutObject, UploadPart and CreateMultipartUpload passed the
empty key ID on, and the KMS call rejected it, so the request failed
with 500. A bucket default of aws:kms without a key failed the same way
for multipart uploads.

CopyObject was worse: its copy paths read an empty key ID as no
SSE-KMS, stored the data unencrypted or under the source key, and
marked the object as SSE-KMS, so reading it back returned garbage.

Resolve an empty key ID to alias/aws/s3 wherever a request or a bucket
default is read, with the helper the bucket default uploads and copies
already had inline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3api: re-encrypt an in-place SSE-KMS copy that changes the key

The key-rotation strategy handed back the source chunks for an in-place
SSE-KMS copy, so an object copied onto itself under another key, or
under alias/aws/s3 when the request names none, stayed encrypted under
the old key. Route it through the re-encrypt copy, which already keeps
the same-key case direct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
2026-12-04 11:33:51 -08:00
..
2026-04-23 10:05:51 -07:00