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

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

Issue 2078653002: Add an out parameter to VerifyCertificateChain for retrieving the trusted chain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nit Created 4 years, 6 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.cc
diff --git a/net/cert/internal/verify_certificate_chain.cc b/net/cert/internal/verify_certificate_chain.cc
index f6a45b2435cc41cb96bcbd3da6b3aba91b758a79..73bd6f1361da5648dda73b37d3958cfab303e599 100644
--- a/net/cert/internal/verify_certificate_chain.cc
+++ b/net/cert/internal/verify_certificate_chain.cc
@@ -483,7 +483,8 @@ bool VerifyCertificateChain(
const std::vector<scoped_refptr<ParsedCertificate>>& cert_chain,
const TrustStore& trust_store,
const SignaturePolicy* signature_policy,
- const der::GeneralizedTime& time) {
+ const der::GeneralizedTime& time,
+ std::vector<scoped_refptr<ParsedCertificate>>* trusted_chain_out) {
if (cert_chain.empty())
return false;
@@ -494,8 +495,11 @@ bool VerifyCertificateChain(
return false;
// Verify the chain.
- return VerifyCertificateChainAssumingTrustedRoot(full_chain, trust_store,
- signature_policy, time);
+ bool success = VerifyCertificateChainAssumingTrustedRoot(
+ full_chain, trust_store, signature_policy, time);
+ if (success && trusted_chain_out != nullptr)
+ *trusted_chain_out = std::move(full_chain);
+ return success;
}
} // namespace net
« no previous file with comments | « net/cert/internal/verify_certificate_chain.h ('k') | net/cert/internal/verify_certificate_chain_pkits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698