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

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

Issue 2759023002: Improvements to the net/cert/internal error handling. (Closed)
Patch Set: fix comment Created 3 years, 9 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 52a5ff88a0de067c77f4e05ea559aeff2060745a..e8279104d2f76c207a47c3f1e23061c41537427d 100644
--- a/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
+++ b/net/cert/internal/verify_certificate_chain_pkits_unittest.cc
@@ -57,14 +57,15 @@ class VerifyCertificateChainPkitsTestDelegate {
// PKITS lists chains from trust anchor to target, VerifyCertificateChain
// takes them starting with the target and not including the trust anchor.
std::vector<scoped_refptr<net::ParsedCertificate>> input_chain;
- CertErrors errors;
+ CertErrors parsing_errors;
for (auto i = cert_ders.rbegin(); i != cert_ders.rend(); ++i) {
if (!net::ParsedCertificate::CreateAndAddToVector(
bssl::UniquePtr<CRYPTO_BUFFER>(
CRYPTO_BUFFER_new(reinterpret_cast<const uint8_t*>(i->data()),
i->size(), nullptr)),
- {}, &input_chain, &errors)) {
- ADD_FAILURE() << "Cert failed to parse:\n" << errors.ToDebugString();
+ {}, &input_chain, &parsing_errors)) {
+ ADD_FAILURE() << "Cert failed to parse:\n"
+ << parsing_errors.ToDebugString();
return false;
}
}
@@ -78,13 +79,12 @@ class VerifyCertificateChainPkitsTestDelegate {
// Run all tests at the time the PKITS was published.
der::GeneralizedTime time = {2011, 4, 15, 0, 0, 0};
+ CertPathErrors path_errors;
bool result = VerifyCertificateChain(input_chain, trust_anchor.get(),
- &signature_policy, time, &errors);
+ &signature_policy, time, &path_errors);
// TODO(crbug.com/634443): Test errors on failure?
- if (!result)
- EXPECT_FALSE(errors.empty());
-
+ EXPECT_EQ(result, !path_errors.ContainsHighSeverityErrors());
return result;
}
};
« 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