test: align zero-byte rotation key errors

After zero-byte reads authenticate SSE-C at the object layer, equal invalid rotation keys match non-empty reads and return AccessDenied before the rotation-specific distinction.

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-08-29 17:28:36 +08:00
parent b73581b05d
commit c4fd97d0bf
+4 -2
View File
@@ -576,9 +576,11 @@ func testAPICopyObjectSSECKeyRotationNullVersionWrongKey(obj ObjectLayer, instan
xhttp.AmzServerSideEncryptionCopyCustomerKey: base64.StdEncoding.EncodeToString(newKey),
xhttp.AmzServerSideEncryptionCopyCustomerKeyMD5: base64.StdEncoding.EncodeToString(newMD5[:]),
})
if rec.Code != http.StatusBadRequest {
// The zero-byte read path authenticates the source key before the
// rotation-specific equal-key distinction, matching non-empty reads.
if rec.Code != http.StatusForbidden {
t.Fatalf("%s: rotation with equal invalid keys returned %d, want %d: %s",
instanceType, rec.Code, http.StatusBadRequest, rec.Body.String())
instanceType, rec.Code, http.StatusForbidden, rec.Body.String())
}
after, err := obj.GetObjectInfo(t.Context(), bucketName, object, ObjectOptions{})