mirror of
https://github.com/pgsty/minio.git
synced 2026-11-02 05:42:06 +03:00
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:
@@ -576,9 +576,11 @@ func testAPICopyObjectSSECKeyRotationNullVersionWrongKey(obj ObjectLayer, instan
|
|||||||
xhttp.AmzServerSideEncryptionCopyCustomerKey: base64.StdEncoding.EncodeToString(newKey),
|
xhttp.AmzServerSideEncryptionCopyCustomerKey: base64.StdEncoding.EncodeToString(newKey),
|
||||||
xhttp.AmzServerSideEncryptionCopyCustomerKeyMD5: base64.StdEncoding.EncodeToString(newMD5[:]),
|
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",
|
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{})
|
after, err := obj.GetObjectInfo(t.Context(), bucketName, object, ObjectOptions{})
|
||||||
|
|||||||
Reference in New Issue
Block a user