]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_crypt.cc
update sources to v12.2.1
[ceph.git] / ceph / src / rgw / rgw_crypt.cc
index 88abd3b833d687c782b5f3c45073842d91f12b17..4d5b00ff6baafd0edce91996d6e64c49bed9530c 100644 (file)
@@ -1155,6 +1155,12 @@ int rgw_s3_prepare_decrypt(struct req_state* s,
   int res = 0;
   std::string stored_mode = get_str_attribute(attrs, RGW_ATTR_CRYPT_MODE);
   ldout(s->cct, 15) << "Encryption mode: " << stored_mode << dendl;
+
+  const char *req_sse = s->info.env->get("HTTP_X_AMZ_SERVER_SIDE_ENCRYPTION", NULL);
+  if (nullptr != req_sse && (s->op == OP_GET || s->op == OP_HEAD)) {
+    return -ERR_INVALID_REQUEST;
+  }
+
   if (stored_mode == "SSE-C-AES256") {
     if (s->cct->_conf->rgw_crypt_require_ssl &&
         !s->info.env->exists("SERVER_PORT_SECURE")) {