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

Unified Diff: net/base/default_origin_bound_cert_store.cc

Issue 8662036: Support EC certs in OriginBoundCertService and OriginBoundCertStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: net/base/default_origin_bound_cert_store.cc
diff --git a/net/base/default_origin_bound_cert_store.cc b/net/base/default_origin_bound_cert_store.cc
index e897cd9736ab807e16b4c9ab5f420f91e80261a6..439785d1de548001779599cf763abc7ac388b77b 100644
--- a/net/base/default_origin_bound_cert_store.cc
+++ b/net/base/default_origin_bound_cert_store.cc
@@ -27,6 +27,7 @@ void DefaultOriginBoundCertStore::FlushStore(Task* completion_task) {
bool DefaultOriginBoundCertStore::GetOriginBoundCert(
const std::string& origin,
+ OriginBoundCertType* type,
std::string* private_key_result,
std::string* cert_result) {
base::AutoLock autolock(lock_);
@@ -38,6 +39,7 @@ bool DefaultOriginBoundCertStore::GetOriginBoundCert(
return false;
OriginBoundCert* cert = it->second;
+ *type = cert->type();
*private_key_result = cert->private_key();
*cert_result = cert->cert();
@@ -46,14 +48,15 @@ bool DefaultOriginBoundCertStore::GetOriginBoundCert(
void DefaultOriginBoundCertStore::SetOriginBoundCert(
const std::string& origin,
+ OriginBoundCertType type,
const std::string& private_key,
const std::string& cert) {
base::AutoLock autolock(lock_);
InitIfNecessary();
InternalDeleteOriginBoundCert(origin);
- InternalInsertOriginBoundCert(origin,
- new OriginBoundCert(origin, private_key, cert));
+ InternalInsertOriginBoundCert(
+ origin, new OriginBoundCert(origin, type, private_key, cert));
}
void DefaultOriginBoundCertStore::DeleteOriginBoundCert(
@@ -84,6 +87,7 @@ void DefaultOriginBoundCertStore::GetAllOriginBoundCerts(
it != origin_bound_certs_.end(); ++it) {
OriginBoundCertInfo cert_info = {
it->second->origin(),
+ it->second->type(),
it->second->private_key(),
it->second->cert()
};
@@ -162,9 +166,11 @@ DefaultOriginBoundCertStore::OriginBoundCert::OriginBoundCert() {}
DefaultOriginBoundCertStore::OriginBoundCert::OriginBoundCert(
const std::string& origin,
+ OriginBoundCertType type,
const std::string& private_key,
const std::string& cert)
: origin_(origin),
+ type_(type),
private_key_(private_key),
cert_(cert) {}

Powered by Google App Engine
This is Rietveld 408576698