summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-27 19:41:59 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-27 19:41:59 +0000
commitfaf6cc757fa0e8f0baf343c589a3d35bb7019e23 (patch)
tree3651f9babd40361012f69914173366c12daaf9aa /net
parent7d57cb4da95798f698b858b3d6e46bc0fdcfda08 (diff)
downloadchromium_src-faf6cc757fa0e8f0baf343c589a3d35bb7019e23.zip
chromium_src-faf6cc757fa0e8f0baf343c589a3d35bb7019e23.tar.gz
chromium_src-faf6cc757fa0e8f0baf343c589a3d35bb7019e23.tar.bz2
Address wtc's comments in http://codereview.chromium.org/7461088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/crl_set.cc14
-rw-r--r--net/base/crl_set.h5
2 files changed, 10 insertions, 9 deletions
diff --git a/net/base/crl_set.cc b/net/base/crl_set.cc
index eb22e8b..5b28be7 100644
--- a/net/base/crl_set.cc
+++ b/net/base/crl_set.cc
@@ -67,7 +67,7 @@ CRLSet::~CRLSet() {
// header_bytes consists of a JSON dictionary with the following keys:
// Version (int): currently 0
// ContentType (string): "CRLSet" or "CRLSetDelta" (magic value)
-// DeltaFrom (int): if this is a delta update (see below), then this contains
+// DeltaFrom (int32): if this is a delta update (see below), then this contains
// the sequence number of the base CRLSet.
// NextUpdate (int64, epoch seconds): the time at which an update is
// availible.
@@ -114,8 +114,8 @@ CRLSet::~CRLSet() {
//
// A delta CRLSet applies to a specific CRL set as given in the
// header's "DeltaFrom" value. The delta describes the changes to each CRL
-// in turn with a zlib compressed array of options: either the CRL is the case,
-// a new CRL is inserted, the CRL is deleted or the CRL is updated. In the same
+// in turn with a zlib compressed array of options: either the CRL is the same,
+// a new CRL is inserted, the CRL is deleted or the CRL is updated. In the case
// of an update, the serials in the CRL are considered in the same fashion
// except there is no delta update of a serial number: they are either
// inserted, deleted or left the same.
@@ -208,10 +208,10 @@ bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
return false;
}
- double next_update, window_secs;
+ double next_update, update_window;
int sequence;
if (!header_dict->GetDouble("NextUpdate", &next_update) ||
- !header_dict->GetDouble("WindowSecs", &window_secs) ||
+ !header_dict->GetDouble("WindowSecs", &update_window) ||
!header_dict->GetInteger("Sequence", &sequence)) {
return false;
}
@@ -219,7 +219,7 @@ bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
scoped_refptr<CRLSet> crl_set(new CRLSet);
crl_set->next_update_ = base::Time::FromDoubleT(next_update);
crl_set->update_window_ =
- base::TimeDelta::FromSeconds(static_cast<int64>(window_secs));
+ base::TimeDelta::FromSeconds(static_cast<int64>(update_window));
crl_set->sequence_ = static_cast<uint32>(sequence);
for (size_t crl_index = 0; !data.empty(); crl_index++) {
@@ -416,7 +416,7 @@ CRLSet::Result CRLSet::CheckCertificate(
for (std::vector<std::string>::const_iterator i = serials.begin();
i != serials.end(); ++i) {
- if (*i == serial_number.as_string())
+ if (base::StringPiece(*i) == serial_number)
return REVOKED;
}
diff --git a/net/base/crl_set.h b/net/base/crl_set.h
index 99a39c6..8a7440a 100644
--- a/net/base/crl_set.h
+++ b/net/base/crl_set.h
@@ -40,7 +40,8 @@ class NET_EXPORT_PRIVATE CRLSet : public base::RefCounted<CRLSet> {
// CheckCertificate returns the information contained in the set for a given
// certificate:
// serial_number: the serial number of the certificate
- // issuer_spki_hash: the SubjectPublicKeyInfo of the CRL signer
+ // issuer_spki_hash: the SHA256 of the SubjectPublicKeyInfo of the CRL
+ // signer
//
// This does not check that the CRLSet is timely. See |next_update|.
Result CheckCertificate(
@@ -55,7 +56,7 @@ class NET_EXPORT_PRIVATE CRLSet : public base::RefCounted<CRLSet> {
// next_update returns the time at which a new CRLSet may be availible.
base::Time next_update() const;
- // update_window returns the number of seconds in the update window. Once the
+ // update_window returns the length of the update window. Once the
// |next_update| time has occured, the client should schedule a fetch,
// uniformly at random, within |update_window|. This aims to smooth the load
// on the server.