Chromium Code Reviews| 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; |