Remove fillins/log.h
In the test code we simply use std::cerr instead of LOG, this then
removes some of the DVLOG from path_builder that seem inappropriate
to send as debugging information to the delegate.
(Alternatively we could keep them and deal with the DVLOG define
in this file if we really wanted to keep these)
Bug: 668
Change-Id: I323f7a896999f279d0d6af5b73c7e1d132c07f3b
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/64170
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: Bob Beck <bbe@google.com>
diff --git a/pki/fillins/log.h b/pki/fillins/log.h
deleted file mode 100644
index 3b6bbb5..0000000
--- a/pki/fillins/log.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2023 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BSSL_FILLINS_LOG_H_
-#define BSSL_FILLINS_LOG_H_
-
-#include <iostream>
-
-// This header defines the logging macros, inherited from chrome.
-
-// TODO(crbug.com/boringssl/663): Replace this with methods on the delegate.
-#define DVLOG(l) 0 && std::cerr
-#define LOG(l) 0 && std::cerr
-
-#endif // BSSL_FILLINS_LOG_H_
diff --git a/pki/path_builder.cc b/pki/path_builder.cc
index 873ccba..c629550 100644
--- a/pki/path_builder.cc
+++ b/pki/path_builder.cc
@@ -9,8 +9,6 @@
#include <set>
#include <unordered_set>
-#include "fillins/log.h"
-
#include <openssl/base.h>
#include <openssl/sha.h>
#include "cert_issuer_source.h"
@@ -246,9 +244,7 @@
CertIssuerSources *cert_issuer_sources, TrustStore *trust_store)
: cert_(std::move(in_cert)),
cert_issuer_sources_(cert_issuer_sources),
- trust_store_(trust_store) {
- DVLOG(2) << "CertIssuersIter created for " << CertDebugString(cert());
-}
+ trust_store_(trust_store) {}
void CertIssuersIter::GetNextIssuer(IssuerEntry *out) {
if (!did_initial_query_) {
@@ -286,8 +282,6 @@
if (HasCurrentIssuer()) {
SortRemainingIssuers();
- DVLOG(2) << "CertIssuersIter returning issuer " << cur_issuer_ << " of "
- << issuers_.size() << " for " << CertDebugString(cert());
// Still have issuers that haven't been returned yet, return the highest
// priority one (head of remaining list). A reference to the returned issuer
// is retained, since |present_issuers_| points to data owned by it.
@@ -295,8 +289,6 @@
return;
}
- DVLOG(2) << "CertIssuersIter reached the end of all available issuers for "
- << CertDebugString(cert());
// Reached the end of all available issuers.
*out = IssuerEntry();
}
@@ -329,7 +321,6 @@
std::unique_ptr<CertIssuerSource::Request> request;
cert_issuer_source->AsyncGetIssuersOf(cert(), &request);
if (request) {
- DVLOG(1) << "AsyncGetIssuersOf pending for " << CertDebugString(cert());
pending_async_requests_.push_back(std::move(request));
}
}
diff --git a/pki/path_builder_pkits_unittest.cc b/pki/path_builder_pkits_unittest.cc
index e912e46..1cd1238 100644
--- a/pki/path_builder_pkits_unittest.cc
+++ b/pki/path_builder_pkits_unittest.cc
@@ -6,8 +6,6 @@
#include <cstdint>
-#include "fillins/log.h"
-
#include <openssl/pool.h>
#include "cert_issuer_source_static.h"
#include "common_cert_errors.h"
@@ -235,16 +233,17 @@
CertPathBuilder::Result result = path_builder.Run();
if (info.should_validate != result.HasValidPath()) {
+ testing::Message msg;
for (size_t i = 0; i < result.paths.size(); ++i) {
const bssl::CertPathBuilderResultPath *result_path =
result.paths[i].get();
- LOG(ERROR) << "path " << i << " errors:\n"
- << result_path->errors.ToDebugString(result_path->certs);
+ msg << "path " << i << " errors:\n"
+ << result_path->errors.ToDebugString(result_path->certs)
+ << "\n";
}
+ ASSERT_EQ(info.should_validate, result.HasValidPath()) << msg;
}
- ASSERT_EQ(info.should_validate, result.HasValidPath());
-
if (result.HasValidPath()) {
EXPECT_EQ(info.user_constrained_policy_set,
result.GetBestValidPath()->user_constrained_policy_set);