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

Unified Diff: chromeos/network/certificate_pattern.cc

Issue 16946002: Resolve certificate references in ONC by PEM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a unit test for the resolve function. Created 7 years, 6 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 | « chromeos/network/certificate_pattern.h ('k') | chromeos/network/certificate_pattern_matcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/certificate_pattern.cc
diff --git a/chromeos/network/certificate_pattern.cc b/chromeos/network/certificate_pattern.cc
index c69ce55871f47803a6d8c47056a8a6d3cf374f70..63c9c19a5940390b15e5e9c3220118b9d4fd9eb1 100644
--- a/chromeos/network/certificate_pattern.cc
+++ b/chromeos/network/certificate_pattern.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/values.h"
+#include "chromeos/network/onc/onc_constants.h"
namespace chromeos {
@@ -16,7 +17,6 @@ const char kCommonNameKey[] = "CommonName";
const char kLocalityKey[] = "Locality";
const char kOrganizationKey[] = "Organization";
const char kOrganizationalUnitKey[] = "OrganizationalUnit";
-const char kIssuerCaRefKey[] = "IssuerCARef";
const char kIssuerKey[] = "Issuer";
const char kSubjectKey[] = "Subject";
const char kEnrollmentUriKey[] = "EnrollmentURI";
@@ -114,13 +114,13 @@ CertificatePattern::CertificatePattern() {}
CertificatePattern::~CertificatePattern() {}
bool CertificatePattern::Empty() const {
- return issuer_ca_ref_list_.empty() &&
+ return issuer_ca_pems_.empty() &&
issuer_.Empty() &&
subject_.Empty();
}
void CertificatePattern::Clear() {
- issuer_ca_ref_list_.clear();
+ issuer_ca_pems_.clear();
issuer_.Clear();
subject_.Clear();
enrollment_uri_list_.clear();
@@ -129,8 +129,10 @@ void CertificatePattern::Clear() {
base::DictionaryValue* CertificatePattern::CreateAsDictionary() const {
base::DictionaryValue* dict = new base::DictionaryValue;
- if (!issuer_ca_ref_list_.empty())
- dict->Set(kIssuerCaRefKey, CreateListFromStrings(issuer_ca_ref_list_));
+ if (!issuer_ca_pems_.empty()) {
+ dict->Set(onc::certificate::kIssuerCAPEMs,
+ CreateListFromStrings(issuer_ca_pems_));
+ }
if (!issuer_.Empty())
dict->Set(kIssuerKey, issuer_.CreateAsDictionary());
@@ -149,8 +151,9 @@ bool CertificatePattern::CopyFromDictionary(const base::DictionaryValue &dict) {
Clear();
// All of these are optional.
- if (dict.GetList(kIssuerCaRefKey, &child_list) && child_list) {
- if (!GetAsListOfStrings(*child_list, &issuer_ca_ref_list_))
+ if (dict.GetList(onc::certificate::kIssuerCAPEMs, &child_list) &&
+ child_list) {
+ if (!GetAsListOfStrings(*child_list, &issuer_ca_pems_))
return false;
}
if (dict.GetDictionary(kIssuerKey, &child_dict) && child_dict) {
« no previous file with comments | « chromeos/network/certificate_pattern.h ('k') | chromeos/network/certificate_pattern_matcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698