From 624b3ac5053dbef008d2e9238c6958d07206f6c3 Mon Sep 17 00:00:00 2001 From: Zhang Shaowen Date: Tue, 26 Sep 2017 10:00:59 +0800 Subject: [PATCH] rgw: Torrents are not supported for objects encrypted using SSE-C Fixes: http://tracker.ceph.com/issues/21720 Signed-off-by: Zhang Shaowen (cherry picked from commit 9a8ae664da54eb74e74a12cc16a52b0df7df70a0) --- src/rgw/rgw_op.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f7e5caf67f51d..73ea66607594f 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1638,6 +1638,11 @@ void RGWGetObj::execute() /* start gettorrent */ if (torrent.get_flag()) { + attr_iter = attrs.find(RGW_ATTR_CRYPT_MODE); + if (attr_iter != attrs.end() && attr_iter->second.to_str() == "SSE-C-AES256") { + op_ret = -ERR_INVALID_REQUEST; + goto done_err; + } torrent.init(s, store); op_ret = torrent.get_torrent_file(read_op, total_len, bl, obj); if (op_ret < 0) -- 2.39.5