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

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

Issue 2854263004: Add tests for PathBuilder when certificates are distrusted. (Closed)
Patch Set: address mattm's feedback Created 3 years, 7 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 | « net/cert/internal/path_builder.h ('k') | net/cert/internal/path_builder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/path_builder.cc
diff --git a/net/cert/internal/path_builder.cc b/net/cert/internal/path_builder.cc
index 7f4284b2f0fc85226aa44ba4d1f138db80c7eb07..d1ce0bdbe5db7f8e70425ccf4540aac38b8f9575 100644
--- a/net/cert/internal/path_builder.cc
+++ b/net/cert/internal/path_builder.cc
@@ -520,6 +520,10 @@ bool CertPathBuilder::ResultPath::IsValid() const {
CertPathBuilder::Result::Result() = default;
CertPathBuilder::Result::~Result() = default;
+bool CertPathBuilder::Result::HasValidPath() const {
+ return GetBestValidPath() != nullptr;
+}
+
const CertPathBuilder::ResultPath* CertPathBuilder::Result::GetBestValidPath()
const {
DCHECK((paths.empty() && best_result_index == 0) ||
@@ -535,8 +539,9 @@ const CertPathBuilder::ResultPath* CertPathBuilder::Result::GetBestValidPath()
return nullptr;
}
-bool CertPathBuilder::Result::HasValidPath() const {
- return GetBestValidPath() != nullptr;
+void CertPathBuilder::Result::Clear() {
+ paths.clear();
+ best_result_index = 0;
}
CertPathBuilder::CertPathBuilder(scoped_refptr<ParsedCertificate> cert,
@@ -551,6 +556,7 @@ CertPathBuilder::CertPathBuilder(scoped_refptr<ParsedCertificate> cert,
key_purpose_(key_purpose),
next_state_(STATE_NONE),
out_result_(result) {
+ result->Clear();
// The TrustStore also implements the CertIssuerSource interface.
AddCertIssuerSource(trust_store);
}
« no previous file with comments | « net/cert/internal/path_builder.h ('k') | net/cert/internal/path_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698