When decrypting the data encrypted with the "SSE-KMS" method, the "InvalidAccessKeyId" error is reported when the KMS key is unavailable, which is unreasonable.So we replaced it with EINVAL
Fixes: https://tracker.ceph.com/issues/55799
Signed-off-by: wangyingbin <ybwang0211@163.com>
ldpp_dout(s, 0) << "ERROR: key obtained from key_id:" <<
key_id << " is not 256 bit size" << dendl;
s->err.message = "KMS provided an invalid key for the given kms-keyid.";
- return -ERR_INVALID_ACCESS_KEY;
+ return -EINVAL;
}
auto aes = std::unique_ptr<AES_256_CBC>(new AES_256_CBC(s, s->cct));
ldpp_dout(s, 0) << "ERROR: key obtained " <<
"is not 256 bit size" << dendl;
s->err.message = "SSE-S3 provided an invalid key for the given keyid.";
- return -ERR_INVALID_ACCESS_KEY;
+ return -EINVAL;
}
auto aes = std::unique_ptr<AES_256_CBC>(new AES_256_CBC(s, s->cct));
map<string, string>::iterator it = str_map.find(std::string(key_id));
if (it == str_map.end())
- return -ERR_INVALID_ACCESS_KEY;
+ return -EINVAL;
std::string master_key;
try {