mirror of
https://github.com/ceph/ceph
synced 2024-12-29 06:52:35 +00:00
Merge pull request #28172 from joke-lee/rgw-sts-bad-token
rgw: fix rgw crash and set correct error code Reviewed-by: Matt Benjamin <mbenjamin@redhat.com> Reviewed-by: Pritha Srivastava <prsrivas@redhat.com>
This commit is contained in:
commit
891fc11670
@ -4614,9 +4614,14 @@ rgw::auth::s3::STSEngine::get_session_token(const DoutPrefixProvider* dpp, const
|
||||
ldpp_dout(dpp, 0) << "ERROR: Decryption failed: " << error << dendl;
|
||||
return -EPERM;
|
||||
} else {
|
||||
dec_output.append('\0');
|
||||
auto iter = dec_output.cbegin();
|
||||
decode(token, iter);
|
||||
try {
|
||||
dec_output.append('\0');
|
||||
auto iter = dec_output.cbegin();
|
||||
decode(token, iter);
|
||||
} catch (const buffer::error& e) {
|
||||
ldout(cct, 0) << "ERROR: decode SessionToken failed: " << error << dendl;
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user