]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/crypt - generalize putbucketencryption.
authorMarcus Watts <mwatts@redhat.com>
Fri, 28 Jan 2022 10:34:43 +0000 (05:34 -0500)
committerMarcus Watts <mwatts@redhat.com>
Tue, 19 Apr 2022 21:35:40 +0000 (17:35 -0400)
The previous logic only suported putbucketencryption to enable
sse-s3.  The protocol allows putbucketencryption to be used to
enable sse-kms by default, and the surrounding logic is now ready
to do this as well.  This commit removes the checks which stopped
this from working, so that it is now possible to use putbucketencryption
to default either sse-s3 or sse-kms on.

Signed-off-by: Marcus Watts <mwatts@redhat.com>
src/rgw/rgw_op.cc

index ef5e8eb69f2d03f101716a2c827aae9dff9d6199..da8c22dc96ebde6a5ca4082d9e6344c8c933e757 100644 (file)
@@ -8668,20 +8668,6 @@ void RGWPutBucketEncryption::execute(optional_yield y)
     return;
   }
 
-  if(bucket_encryption_conf.kms_master_key_id().compare("") != 0) {
-    ldpp_dout(this, 5) << "encryption not supported with sse-kms" << dendl;
-    op_ret = -ERR_NOT_IMPLEMENTED;
-    s->err.message = "SSE-KMS support is not provided";
-    return;
-  }
-
-  if(bucket_encryption_conf.sse_algorithm().compare("AES256") != 0) {
-    ldpp_dout(this, 5) << "only aes256 algorithm is supported for encryption" << dendl;
-    op_ret = -ERR_NOT_IMPLEMENTED;
-    s->err.message = "Encryption is supported only with AES256 algorithm";
-    return;
-  }
-
   op_ret = store->forward_request_to_master(this, s->user.get(), nullptr, data, nullptr, s->info, y);
   if (op_ret < 0) {
     ldpp_dout(this, 20) << "forward_request_to_master returned ret=" << op_ret << dendl;