]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: rgwx-skip-decrypt header bypasses decryption filter on GetObj
authorCasey Bodley <cbodley@redhat.com>
Wed, 26 Jul 2017 20:26:25 +0000 (16:26 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 16 Aug 2017 16:22:31 +0000 (12:22 -0400)
Fixes: http://tracker.ceph.com/issues/20668
Fixes: http://tracker.ceph.com/issues/20671
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_op.h
src/rgw/rgw_rest_s3.cc

index d3a63aee73d17c0818d3e7ea1afec1ade642f944..d9ce2b400011ff815b3c800cad4b9364e9d04809 100644 (file)
@@ -203,6 +203,7 @@ protected:
   bool partial_content;
   bool range_parsed;
   bool skip_manifest;
+  bool skip_decrypt{false};
   rgw_obj obj;
   utime_t gc_invalidate_time;
   bool is_slo;
index d005571fc9a150badb04afad21b76f2b7d1cb671..024ac4a0229f5379928fac36ec15ddfd7dc0f03d 100644 (file)
@@ -129,6 +129,12 @@ int RGWGetObj_ObjStore_S3::get_params()
   // all of the data from its parts. the parts will sync as separate objects
   skip_manifest = s->info.args.exists(RGW_SYS_PARAM_PREFIX "sync-manifest");
 
+  // multisite sync requests should fetch encrypted data, along with the
+  // attributes needed to support decryption on the other zone
+  if (s->system_request) {
+    skip_decrypt = s->info.args.exists(RGW_SYS_PARAM_PREFIX "skip-decrypt");
+  }
+
   return RGWGetObj_ObjStore::get_params();
 }
 
@@ -337,6 +343,10 @@ send_data:
 
 int RGWGetObj_ObjStore_S3::get_decrypt_filter(std::unique_ptr<RGWGetDataCB> *filter, RGWGetDataCB* cb, bufferlist* manifest_bl)
 {
+  if (skip_decrypt) { // bypass decryption for multisite sync requests
+    return 0;
+  }
+
   int res = 0;
   std::unique_ptr<BlockCrypt> block_crypt;
   res = rgw_s3_prepare_decrypt(s, attrs, &block_crypt, crypt_http_responses);