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

Unified Diff: components/cast_certificate/cast_cert_validator.cc

Issue 2292333002: Add errors per ResultPath for CertPathBuilder. (Closed)
Patch Set: remove error for null trust anchor 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
« no previous file with comments | « no previous file | components/cast_certificate/cast_crl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cast_certificate/cast_cert_validator.cc
diff --git a/components/cast_certificate/cast_cert_validator.cc b/components/cast_certificate/cast_cert_validator.cc
index c1c34389f667653e081bfaa8800517a3ca5ba64b..915cab7d8f2c19cbc39191f021b2e37d43072054 100644
--- a/components/cast_certificate/cast_cert_validator.cc
+++ b/components/cast_certificate/cast_cert_validator.cc
@@ -299,8 +299,10 @@ bool VerifyDeviceCert(const std::vector<std::string>& certs,
path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source);
net::CompletionStatus rv = path_builder.Run(base::Closure());
DCHECK_EQ(rv, net::CompletionStatus::SYNC);
- if (!result.is_success())
+ if (!result.HasValidPath()) {
+ // TODO(crbug.com/634443): Log error information.
return false;
+ }
// Check properties of the leaf certificate (key usage, policy), and construct
// a CertVerificationContext that uses its public key.
@@ -313,12 +315,7 @@ bool VerifyDeviceCert(const std::vector<std::string>& certs,
return false;
}
} else {
- if (result.paths.empty() ||
- !result.paths[result.best_result_index]->is_success())
- return false;
-
- if (!crl->CheckRevocation(result.paths[result.best_result_index]->path,
- time)) {
+ if (!crl->CheckRevocation(result.GetBestValidPath()->path, time)) {
return false;
}
}
« no previous file with comments | « no previous file | components/cast_certificate/cast_crl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698