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

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: fix 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 98b0e7b800aa5a1c9fec16a9060682599f269a2f..ee559584cf610bde7ef5d2becda059bb7f7bdb20 100644
--- a/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
+++ b/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
@@ -47,18 +47,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,
@@ -69,7 +57,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.

Powered by Google App Engine
This is Rietveld 408576698