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

Unified Diff: components/cast_certificate/cast_crl.cc

Issue 2205403002: Add production Cast CRL certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: components/cast_certificate/cast_crl.cc
diff --git a/components/cast_certificate/cast_crl.cc b/components/cast_certificate/cast_crl.cc
index 7efd90b127b60d4ec1804d31753ad81ea03e4681..b2025d18527c625981fd7a66eface0897f93ba05 100644
--- a/components/cast_certificate/cast_crl.cc
+++ b/components/cast_certificate/cast_crl.cc
@@ -57,18 +57,22 @@ class CastCRLTrustStore {
static net::TrustStore& Get() { return GetInstance()->store_; }
+ static void Reinitialize() { GetInstance()->Initialize(); }
+
private:
friend struct base::DefaultSingletonTraits<CastCRLTrustStore>;
- CastCRLTrustStore() {
+ CastCRLTrustStore() { Initialize(); }
+
+ void Initialize() {
+ store_.Clear();
// Initialize the trust store with the root certificate.
- // TODO(ryanchung): Add official Cast CRL Root here
- // scoped_refptr<net::ParsedCertificate> root = net::ParsedCertificate::
- // net::ParsedCertificate::CreateFromCertificateData(
- // kCastCRLRootCaDer, sizeof(kCastCRLRootCaDer),
- // net::ParsedCertificate::DataSource::EXTERNAL_REFERENCE, {});
- // CHECK(root);
- // store_.AddTrustedCertificate(std::move(root));
+ scoped_refptr<net::ParsedCertificate> root =
+ net::ParsedCertificate::CreateFromCertificateData(
+ kCastCRLRootCaDer, sizeof(kCastCRLRootCaDer),
+ net::ParsedCertificate::DataSource::EXTERNAL_REFERENCE, {});
+ CHECK(root);
+ store_.AddTrustedCertificate(std::move(root));
}
net::TrustStore store_;
@@ -337,4 +341,8 @@ bool SetCRLTrustAnchorForTest(const std::string& cert) {
return true;
}
+void ResetCRLTrustAnchorForTest() {
+ CastCRLTrustStore::Reinitialize();
+}
+
} // namespace cast_certificate

Powered by Google App Engine
This is Rietveld 408576698