File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -5755,6 +5755,19 @@ AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s,
57555755 std::placeholders::_3,
57565756 s);
57575757
5758+ // some ops don't expect a request body at all, so never call complete() to
5759+ // validate the payload hash. check empty signed payloads now and return a
5760+ // null completer below
5761+ constexpr std::string_view empty_sha256sum = // echo -n | sha256sum
5762+ " e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ;
5763+ if (is_v4_payload_empty (s) &&
5764+ !is_v4_payload_unsigned (exp_payload_hash) &&
5765+ exp_payload_hash != empty_sha256sum) {
5766+ ldpp_dout (s, 4 ) << " ERROR: empty payload checksum mismatch, expected "
5767+ << empty_sha256sum << " got " << exp_payload_hash << dendl;
5768+ throw -ERR_AMZ_CONTENT_SHA256_MISMATCH;
5769+ }
5770+
57585771 /* Requests authenticated with the Query Parameters are treated as unsigned.
57595772 * From "Authenticating Requests: Using Query Parameters (AWS Signature
57605773 * Version 4)":
You can’t perform that action at this time.
0 commit comments