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

Unified Diff: net/http/http_response_info.cc

Issue 1313363003: Expose OpenSSL's key_exchange_info in the content API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: net/http/http_response_info.cc
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index c6be3e65a4fc86847db36f9e92b35bb14ece3cdf..60936207df43d16669e7759f4fda4a7fe9e5dd32 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -56,42 +56,45 @@ enum {
// strength, in bits, of the SSL connection) at the end.
RESPONSE_INFO_HAS_SECURITY_BITS = 1 << 9,
+ // This bit is set if the response has a key-exchange-info field at the end.
+ RESPONSE_INFO_HAS_KEY_EXCHANGE_INFO = 1 << 10,
Ryan Sleevi 2015/08/28 00:25:04 Renumbering these breaks the cache, since we seria
sigbjorn 2015/08/28 09:32:00 Done.
+
// This bit is set if the response info has a cert status at the end.
- RESPONSE_INFO_HAS_CERT_STATUS = 1 << 10,
+ RESPONSE_INFO_HAS_CERT_STATUS = 1 << 11,
// This bit is set if the response info has vary header data.
- RESPONSE_INFO_HAS_VARY_DATA = 1 << 11,
+ RESPONSE_INFO_HAS_VARY_DATA = 1 << 12,
// This bit is set if the request was cancelled before completion.
- RESPONSE_INFO_TRUNCATED = 1 << 12,
+ RESPONSE_INFO_TRUNCATED = 1 << 13,
// This bit is set if the response was received via SPDY.
- RESPONSE_INFO_WAS_SPDY = 1 << 13,
+ RESPONSE_INFO_WAS_SPDY = 1 << 14,
// This bit is set if the request has NPN negotiated.
- RESPONSE_INFO_WAS_NPN = 1 << 14,
+ RESPONSE_INFO_WAS_NPN = 1 << 15,
// This bit is set if the request was fetched via an explicit proxy.
- RESPONSE_INFO_WAS_PROXY = 1 << 15,
+ RESPONSE_INFO_WAS_PROXY = 1 << 16,
// This bit is set if the response info has an SSL connection status field.
// This contains the ciphersuite used to fetch the resource as well as the
// protocol version, compression method and whether SSLv3 fallback was used.
- RESPONSE_INFO_HAS_SSL_CONNECTION_STATUS = 1 << 16,
+ RESPONSE_INFO_HAS_SSL_CONNECTION_STATUS = 1 << 17,
// This bit is set if the response info has protocol version.
- RESPONSE_INFO_HAS_NPN_NEGOTIATED_PROTOCOL = 1 << 17,
+ RESPONSE_INFO_HAS_NPN_NEGOTIATED_PROTOCOL = 1 << 18,
// This bit is set if the response info has connection info.
- RESPONSE_INFO_HAS_CONNECTION_INFO = 1 << 18,
+ RESPONSE_INFO_HAS_CONNECTION_INFO = 1 << 19,
// This bit is set if the request has http authentication.
- RESPONSE_INFO_USE_HTTP_AUTHENTICATION = 1 << 19,
+ RESPONSE_INFO_USE_HTTP_AUTHENTICATION = 1 << 20,
// This bit is set if ssl_info has SCTs.
- RESPONSE_INFO_HAS_SIGNED_CERTIFICATE_TIMESTAMPS = 1 << 20,
+ RESPONSE_INFO_HAS_SIGNED_CERTIFICATE_TIMESTAMPS = 1 << 21,
- RESPONSE_INFO_UNUSED_SINCE_PREFETCH = 1 << 21,
+ RESPONSE_INFO_UNUSED_SINCE_PREFETCH = 1 << 22,
// TODO(darin): Add other bits to indicate alternate request methods.
// For now, we don't support storing those.
@@ -211,6 +214,12 @@ bool HttpResponseInfo::InitFromPickle(const base::Pickle& pickle,
return false;
ssl_info.security_bits = security_bits;
}
+ if (flags & RESPONSE_INFO_HAS_KEY_EXCHANGE_INFO) {
+ int key_exchange_info;
+ if (!iter.ReadInt(&key_exchange_info))
+ return false;
+ ssl_info.key_exchange_info = key_exchange_info;
+ }
if (flags & RESPONSE_INFO_HAS_SSL_CONNECTION_STATUS) {
int connection_status;
@@ -297,6 +306,8 @@ void HttpResponseInfo::Persist(base::Pickle* pickle,
flags |= RESPONSE_INFO_HAS_CERT_STATUS;
if (ssl_info.security_bits != -1)
flags |= RESPONSE_INFO_HAS_SECURITY_BITS;
+ if (ssl_info.key_exchange_info != 0)
+ flags |= RESPONSE_INFO_HAS_KEY_EXCHANGE_INFO;
if (ssl_info.connection_status != 0)
flags |= RESPONSE_INFO_HAS_SSL_CONNECTION_STATUS;
}
@@ -344,6 +355,8 @@ void HttpResponseInfo::Persist(base::Pickle* pickle,
pickle->WriteUInt32(ssl_info.cert_status);
if (ssl_info.security_bits != -1)
pickle->WriteInt(ssl_info.security_bits);
+ if (ssl_info.key_exchange_info != 0)
+ pickle->WriteInt(ssl_info.key_exchange_info);
if (ssl_info.connection_status != 0)
pickle->WriteInt(ssl_info.connection_status);
if (!ssl_info.signed_certificate_timestamps.empty()) {

Powered by Google App Engine
This is Rietveld 408576698