diff --git a/cmd/api-errors.go b/cmd/api-errors.go index 5bc0df7b1..4209ebc38 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -1507,8 +1507,6 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) { apiErr = ErrInvalidEncryptionMethod case crypto.ErrInvalidCustomerAlgorithm: apiErr = ErrInvalidSSECustomerAlgorithm - case crypto.ErrInvalidCustomerKey: - apiErr = ErrInvalidSSECustomerKey case crypto.ErrMissingCustomerKey: apiErr = ErrMissingSSECustomerKey case crypto.ErrMissingCustomerKeyMD5: diff --git a/cmd/api-errors_test.go b/cmd/api-errors_test.go index d959e3006..cbc11a7c9 100644 --- a/cmd/api-errors_test.go +++ b/cmd/api-errors_test.go @@ -55,7 +55,7 @@ var toAPIErrorTests = []struct { // SSE-C errors {err: crypto.ErrInvalidCustomerAlgorithm, errCode: ErrInvalidSSECustomerAlgorithm}, {err: crypto.ErrMissingCustomerKey, errCode: ErrMissingSSECustomerKey}, - {err: crypto.ErrInvalidCustomerKey, errCode: ErrInvalidSSECustomerKey}, + {err: crypto.ErrInvalidCustomerKey, errCode: ErrAccessDenied}, {err: crypto.ErrMissingCustomerKeyMD5, errCode: ErrMissingSSECustomerKeyMD5}, {err: crypto.ErrCustomerKeyMD5Mismatch, errCode: ErrSSECustomerKeyMD5Mismatch}, {err: errObjectTampered, errCode: ErrObjectTampered},