namespace auth {
namespace s3 {
-bool AWSGeneralAbstractor::is_time_skew_ok(const utime_t& header_time,
- const bool qsr) const
+bool AWSGeneralAbstractor::is_time_skew_ok(const utime_t& header_time) const
{
/* Check for time skew first. */
const time_t req_sec = header_time.sec();
time_t now;
time(&now);
- if ((req_sec < now - RGW_AUTH_GRACE_MINS * 60 ||
- req_sec > now + RGW_AUTH_GRACE_MINS * 60) && !qsr) {
+ if (req_sec < now - RGW_AUTH_GRACE_MINS * 60 ||
+ req_sec > now + RGW_AUTH_GRACE_MINS * 60) {
ldout(cct, 10) << "req_sec=" << req_sec << " now=" << now
<< "; now - RGW_AUTH_GRACE_MINS="
<< now - RGW_AUTH_GRACE_MINS * 60
<< " req_time=" << header_time
<< dendl;
return false;
- } else {
- return true;
}
+
+ return true;
}
ldout(cct, 10) << "string_to_sign:\n"
<< rgw::crypt_sanitize::auth{s,string_to_sign} << dendl;
- if (! is_time_skew_ok(header_time, qsr)) {
+ if (!qsr && !is_time_skew_ok(header_time)) {
throw -ERR_REQUEST_TIME_SKEWED;
}
class AWSGeneralAbstractor : public AWSEngine::VersionAbstractor {
CephContext* const cct;
- bool is_time_skew_ok(const utime_t& header_time,
- const bool qsr) const;
+ bool is_time_skew_ok(const utime_t& header_time) const;
virtual boost::optional<std::string>
get_v4_canonical_headers(const req_info& info,