Commit ea78046d authored by Matt Mueller's avatar Matt Mueller Committed by Commit Bot

Fix cert_verify_tool dump filename conflict between CertVerifyProc impls.

Change-Id: Ia496ac5f5311871ebb234f8d725d3d902ae3f597
Reviewed-on: https://chromium-review.googlesource.com/1058045Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Commit-Queue: Matt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558475}
parent 58e27abc
......@@ -116,9 +116,13 @@ class CertVerifyImplUsingProc : public CertVerifyImpl {
return true; // "skipping" is considered a successful return.
}
base::FilePath dump_path;
if (!dump_prefix_path.empty())
dump_path = dump_prefix_path.AddExtension("." + GetName() + ".pem");
return VerifyUsingCertVerifyProc(proc_.get(), target_der_cert, hostname,
intermediate_der_certs, root_der_certs,
crl_set, dump_prefix_path);
crl_set, dump_path);
}
private:
......
......@@ -115,7 +115,7 @@ bool VerifyUsingCertVerifyProc(
const std::vector<CertInput>& intermediate_der_certs,
const std::vector<CertInput>& root_der_certs,
net::CRLSet* crl_set,
const base::FilePath& dump_prefix_path) {
const base::FilePath& dump_path) {
std::cout
<< "NOTE: CertVerifyProc always uses OS trust settings (--roots are in "
"addition).\n";
......@@ -165,10 +165,8 @@ bool VerifyUsingCertVerifyProc(
std::cout << "CertVerifyProc result: " << net::ErrorToShortString(rv) << "\n";
PrintCertVerifyResult(result);
if (!dump_prefix_path.empty() && result.verified_cert) {
if (!DumpX509CertificateChain(dump_prefix_path.AddExtension(
FILE_PATH_LITERAL(".CertVerifyProc.pem")),
result.verified_cert.get())) {
if (!dump_path.empty() && result.verified_cert) {
if (!DumpX509CertificateChain(dump_path, result.verified_cert.get())) {
return false;
}
}
......
......@@ -30,6 +30,6 @@ bool VerifyUsingCertVerifyProc(
const std::vector<CertInput>& intermediate_der_certs,
const std::vector<CertInput>& root_der_certs,
net::CRLSet* crl_set,
const base::FilePath& dump_prefix_path);
const base::FilePath& dump_path);
#endif // NET_TOOLS_CERT_VERIFY_TOOL_VERIFY_USING_CERT_VERIFY_PROC_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment