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

Unified Diff: net/http/http_response_info.cc

Issue 4645001: Change the HTTP cache to cache the entire certificate chain for SSL sites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/net/base
Patch Set: Rebase before commit Created 9 years, 8 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
« net/base/x509_certificate_win.cc ('K') | « net/base/x509_certificate_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_info.cc
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index fd76462be59d4e60493f0a0f638ca8a2b68704fb..49090e00b8b8fa373e8788399d6c427e70012a2f 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,7 +22,10 @@ namespace net {
// serialized HttpResponseInfo.
enum {
// The version of the response info used when persisting response info.
- RESPONSE_INFO_VERSION = 1,
+ RESPONSE_INFO_VERSION = 2,
+
+ // The minimum version supported for deserializing response info.
+ RESPONSE_INFO_MINIMUM_VERSION = 1,
// We reserve up to 8 bits for the version number.
RESPONSE_INFO_VERSION_MASK = 0xFF,
@@ -108,7 +111,8 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
if (!pickle.ReadInt(&iter, &flags))
return false;
int version = flags & RESPONSE_INFO_VERSION_MASK;
- if (version != RESPONSE_INFO_VERSION) {
+ if (version < RESPONSE_INFO_MINIMUM_VERSION ||
+ version > RESPONSE_INFO_VERSION) {
DLOG(ERROR) << "unexpected response info version: " << version;
return false;
}
@@ -131,8 +135,12 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
// read ssl-info
if (flags & RESPONSE_INFO_HAS_CERT) {
- ssl_info.cert =
- X509Certificate::CreateFromPickle(pickle, &iter);
+ // Version 1 only serialized only the end-entity certificate,
rvargas (doing something else) 2011/04/20 23:51:14 nit: extra only
+ // while subsequent versions include the entire chain.
wtc 2011/04/20 23:07:58 This comment should be moved (or copied) to the de
+ X509Certificate::PickleType type = (version == 1) ?
+ X509Certificate::PICKLETYPE_SINGLE_CERTIFICATE :
+ X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN;
+ ssl_info.cert = X509Certificate::CreateFromPickle(pickle, &iter, type);
}
if (flags & RESPONSE_INFO_HAS_CERT_STATUS) {
int cert_status;
« net/base/x509_certificate_win.cc ('K') | « net/base/x509_certificate_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698