Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1895)

Unified Diff: components/data_reduction_proxy/common/data_reduction_proxy_headers.h

Issue 387353003: Modify data_reduction_proxy_header to support tamper detection logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@work
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/common/data_reduction_proxy_headers.h
diff --git a/components/data_reduction_proxy/common/data_reduction_proxy_headers.h b/components/data_reduction_proxy/common/data_reduction_proxy_headers.h
index 28eccee3073e6c84e4779a338e6e36eb035761e9..319d90da8194c7aa26267192c38f326da497fb1d 100644
--- a/components/data_reduction_proxy/common/data_reduction_proxy_headers.h
+++ b/components/data_reduction_proxy/common/data_reduction_proxy_headers.h
@@ -41,8 +41,12 @@ bool ParseHeadersAndSetProxyInfo(const net::HttpResponseHeaders* headers,
DataReductionProxyInfo* proxy_info);
// Returns true if the response contains the data reduction proxy Via header
-// value. Used to check the integrity of data reduction proxy responses.
-bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers);
+// value. If non-NULL, sets |has_intermediary| to true if another server added
+// a Via header after the data reduction proxy, and to false otherwise. Used to
+// check the integrity of data reduction proxy responses and whether there are
+// other middleboxes between the data reduction proxy and the client.
+bool HasDataReductionProxyViaHeader(const net::HttpResponseHeaders* headers,
+ bool* has_intermediary);
// Returns the reason why the Chrome proxy should be bypassed or not, and
// populates |proxy_info| with information on how long to bypass if
@@ -51,11 +55,44 @@ net::ProxyService::DataReductionProxyBypassType GetDataReductionProxyBypassType(
const net::HttpResponseHeaders* headers,
DataReductionProxyInfo* proxy_info);
+// Searches for the specified Chrome-Proxy action, and if present saves its
+// value as a string in |action_value|. Only returns the first one and ignores
+// the rest if multiple actions match |action_prefix|.
+bool GetDataReductionProxyActionValue(
+ const net::HttpResponseHeaders* headers,
+ const std::string& action_prefix,
+ std::string* action_value);
+
// Searches for the specified Chrome-Proxy action, and if present interprets
// its value as a duration in seconds.
bool ParseHeadersAndSetBypassDuration(const net::HttpResponseHeaders* headers,
const std::string& action_prefix,
base::TimeDelta* bypass_duration);
+// Gets the fingerprint of the Chrome-Proxy header.
+bool GetDataReductionProxyActionFingerprintChromeProxy(
+ const net::HttpResponseHeaders* headers,
+ std::string* chrome_proxy_fingerprint);
+
+// Gets the fingerprint of the Via header.
+bool GetDataReductionProxyActionFingerprintVia(
+ const net::HttpResponseHeaders* headers,
+ std::string* via_fingerprint);
+
+// Gets the fingerprint of a list of headers.
+bool GetDataReductionProxyActionFingerprintOtherHeaders(
+ const net::HttpResponseHeaders* headers,
+ std::string* other_headers_fingerprint);
+
+// Gets the fingerprint of Content-Length header.
+bool GetDataReductionProxyActionFingerprintContentLength(
+ const net::HttpResponseHeaders* headers,
+ std::string* content_length_fingerprint);
+
+// Returns values of the Chrome-Proxy header, but with its fingerprint removed.
+void GetDataReductionProxyHeaderWithFingerprintRemoved(
+ const net::HttpResponseHeaders* headers,
+ std::vector<std::string>* values);
+
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_COMMON_DATA_REDUCTION_PROXY_HEADERS_H_

Powered by Google App Engine
This is Rietveld 408576698