Skip to content

Commit

Permalink
change error for invalid algorithm to invalidArgument
Browse files Browse the repository at this point in the history
Signed-off-by: nadav mizrahi <[email protected]>
  • Loading branch information
nadavMiz committed Apr 17, 2023
1 parent 7f9f9a5 commit a179062
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/endpoint/s3/s3_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ function parse_sse(req) {
}
}

if (algorithm !== 'AES256' && algorithm !== 'aws:kms') throw new S3Error(S3Error.InvalidDigest);
if (algorithm !== 'AES256' && algorithm !== 'aws:kms') throw new S3Error(S3Error.InvalidArgument);

if (algorithm === 'aws:kms' && !kms_key_id) throw new S3Error(S3Error.InvalidDigest);
if (algorithm === 'aws:kms' && !kms_key_id) throw new S3Error(S3Error.InvalidArgument);
// const md5_regex = new RegExp('/^[a-f0-9]{32}$/');
// if (kms_key_id && !md5_regex.test(kms_key_id)) throw new S3Error(S3Error.InvalidDigest);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ s3tests_boto3.functional.test_s3.test_lifecycle_expiration_header_tags_head
s3tests_boto3.functional.test_s3.test_put_obj_enc_conflict_c_s3
s3tests_boto3.functional.test_s3.test_put_obj_enc_conflict_c_kms
s3tests_boto3.functional.test_s3.test_put_obj_enc_conflict_s3_kms
s3tests_boto3.functional.test_s3.test_put_obj_enc_conflict_bad_enc_kms
s3tests_boto3.functional.test_s3.test_bucket_policy_put_obj_s3_noenc
s3tests_boto3.functional.test_s3.test_bucket_policy_put_obj_s3_kms
s3tests_boto3.functional.test_s3.test_bucket_policy_put_obj_kms_noenc
Expand Down

0 comments on commit a179062

Please sign in to comment.