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

Unified Diff: net/quic/crypto/common_cert_set.cc

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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
« no previous file with comments | « net/quic/crypto/common_cert_set.h ('k') | net/quic/crypto/common_cert_set_1_50.inc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/common_cert_set.cc
diff --git a/net/quic/crypto/common_cert_set.cc b/net/quic/crypto/common_cert_set.cc
index a8de6aef1d8ba6d9b7e703062d8d16f9d6bc7ea4..78aa9276197b303f54e427f7ca31b2ac37f62945 100644
--- a/net/quic/crypto/common_cert_set.cc
+++ b/net/quic/crypto/common_cert_set.cc
@@ -16,11 +16,15 @@ namespace common_cert_set_0 {
#include "net/quic/crypto/common_cert_set_0.c"
}
-
struct CertSet {
+ // num_certs contains the number of certificates in this set.
size_t num_certs;
+ // certs is an array of |num_certs| pointers to the DER encoded certificates.
const unsigned char* const* certs;
+ // lens is an array of |num_certs| integers describing the length, in bytes,
+ // of each certificate.
const size_t* lens;
+ // hash contains the 64-bit, FNV-1a hash of this set.
uint64 hash;
};
@@ -37,18 +41,18 @@ static const uint64 kSetHashes[] = {
common_cert_set_0::kHash,
};
-CommonCertSet::~CommonCertSet() {
+CommonCertSets::~CommonCertSets() {
}
-CommonCertSetQUIC::CommonCertSetQUIC() {
+CommonCertSetsQUIC::CommonCertSetsQUIC() {
}
-StringPiece CommonCertSetQUIC::GetCommonHashes() {
+StringPiece CommonCertSetsQUIC::GetCommonHashes() const {
return StringPiece(reinterpret_cast<const char*>(kSetHashes),
sizeof(uint64) * arraysize(kSetHashes));
}
-StringPiece CommonCertSetQUIC::GetCert(uint64 hash, uint32 index) {
+StringPiece CommonCertSetsQUIC::GetCert(uint64 hash, uint32 index) const {
for (size_t i = 0; i < arraysize(kSets); i++) {
if (kSets[i].hash == hash) {
if (index >= kSets[i].num_certs) {
@@ -82,10 +86,10 @@ static int Compare(StringPiece a, const unsigned char* b, size_t b_len) {
return 0;
}
-bool CommonCertSetQUIC::MatchCert(StringPiece cert,
- StringPiece common_set_hashes,
- uint64* out_hash,
- uint32* out_index) {
+bool CommonCertSetsQUIC::MatchCert(StringPiece cert,
+ StringPiece common_set_hashes,
+ uint64* out_hash,
+ uint32* out_index) const {
if (common_set_hashes.size() % sizeof(uint64) != 0) {
return false;
}
« no previous file with comments | « net/quic/crypto/common_cert_set.h ('k') | net/quic/crypto/common_cert_set_1_50.inc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698