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

Unified Diff: net/ssl/channel_id_store.cc

Issue 1076063002: Remove certificates from Channel ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Udpate KeysEqual to fail if preconditions fail Created 5 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/ssl/channel_id_store.h ('k') | net/ssl/default_channel_id_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/channel_id_store.cc
diff --git a/net/ssl/channel_id_store.cc b/net/ssl/channel_id_store.cc
index 930ef8f4ed993d038bb390524704d2c3533e10b1..e1835ff1546a645d22ef3226a6e099b8800ad57a 100644
--- a/net/ssl/channel_id_store.cc
+++ b/net/ssl/channel_id_store.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "crypto/ec_private_key.h"
#include "net/ssl/channel_id_store.h"
namespace net {
@@ -9,25 +10,37 @@ namespace net {
ChannelIDStore::ChannelID::ChannelID() {
}
-ChannelIDStore::ChannelID::ChannelID(
- const std::string& server_identifier,
- base::Time creation_time,
- base::Time expiration_time,
- const std::string& private_key,
- const std::string& cert)
+ChannelIDStore::ChannelID::ChannelID(const std::string& server_identifier,
+ base::Time creation_time,
+ scoped_ptr<crypto::ECPrivateKey> key)
: server_identifier_(server_identifier),
creation_time_(creation_time),
- expiration_time_(expiration_time),
- private_key_(private_key),
- cert_(cert) {}
+ key_(key.Pass()) {
+}
+
+ChannelIDStore::ChannelID::ChannelID(const ChannelID& other)
+ : server_identifier_(other.server_identifier_),
+ creation_time_(other.creation_time_),
+ key_(other.key_ ? other.key_->Copy() : nullptr) {
+}
+
+ChannelIDStore::ChannelID& ChannelIDStore::ChannelID::operator=(
+ const ChannelID& other) {
+ if (&other == this)
+ return *this;
+ server_identifier_ = other.server_identifier_;
+ creation_time_ = other.creation_time_;
+ if (other.key_)
+ key_.reset(other.key_->Copy());
+ return *this;
+}
ChannelIDStore::ChannelID::~ChannelID() {}
void ChannelIDStore::InitializeFrom(const ChannelIDList& list) {
for (ChannelIDList::const_iterator i = list.begin(); i != list.end();
++i) {
- SetChannelID(i->server_identifier(), i->creation_time(),
- i->expiration_time(), i->private_key(), i->cert());
+ SetChannelID(scoped_ptr<ChannelID>(new ChannelID(*i)));
}
}
« no previous file with comments | « net/ssl/channel_id_store.h ('k') | net/ssl/default_channel_id_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698