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

Unified Diff: net/cert/internal/verify_certificate_chain_pkits_unittest.cc

Issue 1890193003: Make Cast certificate verification enforce constraints specified in the trusted root certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: list datafiles for ios (needed following the rebase) Created 4 years, 8 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: net/cert/internal/verify_certificate_chain_pkits_unittest.cc
diff --git a/net/cert/internal/verify_certificate_chain_pkits_unittest.cc b/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
index 5993b9c18c653e585d99ac94aca1365dd9539874..606563708ae98da1df7bc8e0412616eb28a0d9df 100644
--- a/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
+++ b/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
@@ -43,18 +43,6 @@ namespace net {
namespace {
-// Adds the certificate |cert_der| as a trust anchor to |trust_store|.
-void AddCertificateToTrustStore(const std::string& cert_der,
- TrustStore* trust_store) {
- ParsedCertificate cert;
- ASSERT_TRUE(ParseCertificate(der::Input(&cert_der), &cert));
-
- ParsedTbsCertificate tbs;
- ASSERT_TRUE(ParseTbsCertificate(cert.tbs_certificate_tlv, &tbs));
- TrustAnchor anchor = {tbs.spki_tlv.AsString(), tbs.subject_tlv.AsString()};
- trust_store->anchors.push_back(anchor);
-}
-
class VerifyCertificateChainPkitsTestDelegate {
public:
static bool Verify(std::vector<std::string> cert_ders,
@@ -65,7 +53,7 @@ class VerifyCertificateChainPkitsTestDelegate {
}
// First entry in the PKITS chain is the trust anchor.
TrustStore trust_store;
- AddCertificateToTrustStore(cert_ders[0], &trust_store);
+ EXPECT_TRUE(trust_store.AddTrustedCertificate(cert_ders[0]));
// PKITS lists chains from trust anchor to target, VerifyCertificateChain
// takes them starting with the target and not including the trust anchor.
« no previous file with comments | « net/cert/internal/verify_certificate_chain.cc ('k') | net/cert/internal/verify_certificate_chain_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698