aboutsummaryrefslogtreecommitdiff
path: root/cast/common
diff options
context:
space:
mode:
authorAbraham Corea Diaz <abrahamcd@google.com>2021-07-02 00:11:05 +0000
committerOpenscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-07-02 17:01:55 +0000
commitcf428dff2a51418bff4c5b54ecac0f71294db18d (patch)
tree4065798866bf0bfd297435fa5e97cdd314596486 /cast/common
parent2e2730fe0190f72dadd631176d2f380b4a6186a8 (diff)
downloadopenscreen-cf428dff2a51418bff4c5b54ecac0f71294db18d.tar.gz
Remove DVLOG debug logging throughout LibCast
This patch removes instances of OSP_DVLOG in LibCast or changes them to OSP_VLOG as needed. Bug: b/159172782 Change-Id: I2fab57cece82af0dc67ad9a596404d563e7707cd Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/3001340 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'cast/common')
-rw-r--r--cast/common/certificate/cast_cert_validator_internal.cc16
-rw-r--r--cast/common/channel/cast_socket_message_port.cc1
-rw-r--r--cast/common/channel/connection_namespace_handler.cc10
3 files changed, 5 insertions, 22 deletions
diff --git a/cast/common/certificate/cast_cert_validator_internal.cc b/cast/common/certificate/cast_cert_validator_internal.cc
index 764ac3e4..7bdcacca 100644
--- a/cast/common/certificate/cast_cert_validator_internal.cc
+++ b/cast/common/certificate/cast_cert_validator_internal.cc
@@ -407,15 +407,11 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
result_path->intermediate_certs;
target_cert.reset(ParseX509Der(der_certs[0]));
if (!target_cert) {
- OSP_DVLOG << "FindCertificatePath: Invalid target certificate";
return Error::Code::kErrCertsParse;
}
for (size_t i = 1; i < der_certs.size(); ++i) {
intermediate_certs.emplace_back(ParseX509Der(der_certs[i]));
if (!intermediate_certs.back()) {
- OSP_DVLOG
- << "FindCertificatePath: Failed to parse intermediate certificate "
- << i << " of " << der_certs.size();
return Error::Code::kErrCertsParse;
}
}
@@ -423,12 +419,10 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
// Basic checks on the target certificate.
Error::Code error = VerifyCertTime(target_cert.get(), time);
if (error != Error::Code::kNone) {
- OSP_DVLOG << "FindCertificatePath: Failed to verify certificate time";
return error;
}
bssl::UniquePtr<EVP_PKEY> public_key{X509_get_pubkey(target_cert.get())};
if (!VerifyPublicKeyLength(public_key.get())) {
- OSP_DVLOG << "FindCertificatePath: Failed with invalid public key length";
return Error::Code::kErrCertsVerifyGeneric;
}
const X509_ALGOR* sig_alg;
@@ -438,13 +432,11 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
}
bssl::UniquePtr<ASN1_BIT_STRING> key_usage = GetKeyUsage(target_cert.get());
if (!key_usage) {
- OSP_DVLOG << "FindCertificatePath: Failed with no key usage";
return Error::Code::kErrCertsRestrictions;
}
int bit =
ASN1_BIT_STRING_get_bit(key_usage.get(), KeyUsageBits::kDigitalSignature);
if (bit == 0) {
- OSP_DVLOG << "FindCertificatePath: Failed to get digital signature";
return Error::Code::kErrCertsRestrictions;
}
@@ -478,8 +470,6 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
Error::Code last_error = Error::Code::kNone;
for (;;) {
X509_NAME* target_issuer_name = X509_get_issuer_name(path_head);
- OSP_DVLOG << "FindCertificatePath: Target certificate issuer name: "
- << X509_NAME_oneline(target_issuer_name, 0, 0);
// The next issuer certificate to add to the current path.
X509* next_issuer = nullptr;
@@ -488,8 +478,6 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
X509* trust_store_cert = trust_store->certs[i].get();
X509_NAME* trust_store_cert_name =
X509_get_subject_name(trust_store_cert);
- OSP_DVLOG << "FindCertificatePath: Trust store certificate issuer name: "
- << X509_NAME_oneline(trust_store_cert_name, 0, 0);
if (X509_NAME_cmp(trust_store_cert_name, target_issuer_name) == 0) {
CertPathStep& next_step = path[--path_index];
next_step.cert = trust_store_cert;
@@ -524,8 +512,6 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
if (path_index == first_index) {
// There are no more paths to try. Ensure an error is returned.
if (last_error == Error::Code::kNone) {
- OSP_DVLOG << "FindCertificatePath: Failed after trying all "
- "certificate paths, no matches";
return Error::Code::kErrCertsVerifyUntrustedCert;
}
return last_error;
@@ -556,8 +542,6 @@ Error FindCertificatePath(const std::vector<std::string>& der_certs,
result_path->path.push_back(path[i].cert);
}
- OSP_DVLOG
- << "FindCertificatePath: Succeeded at validating receiver certificates";
return Error::Code::kNone;
}
diff --git a/cast/common/channel/cast_socket_message_port.cc b/cast/common/channel/cast_socket_message_port.cc
index 0c51304b..bdc33f20 100644
--- a/cast/common/channel/cast_socket_message_port.cc
+++ b/cast/common/channel/cast_socket_message_port.cc
@@ -93,7 +93,6 @@ void CastSocketMessagePort::OnMessage(VirtualConnectionRouter* router,
return;
}
- OSP_DVLOG << "Received a cast socket message";
if (!client_) {
OSP_DLOG_WARN << "Dropping message due to nullptr client_";
return;
diff --git a/cast/common/channel/connection_namespace_handler.cc b/cast/common/channel/connection_namespace_handler.cc
index d3b2ea8b..c50b97be 100644
--- a/cast/common/channel/connection_namespace_handler.cc
+++ b/cast/common/channel/connection_namespace_handler.cc
@@ -221,8 +221,8 @@ void ConnectionNamespaceHandler::HandleConnect(CastSocket* socket,
data.ip_fragment = {};
}
- OSP_DVLOG << "Connection opened: " << virtual_conn.local_id << ", "
- << virtual_conn.peer_id << ", " << virtual_conn.socket_id;
+ OSP_VLOG << "Connection opened: " << virtual_conn.local_id << ", "
+ << virtual_conn.peer_id << ", " << virtual_conn.socket_id;
// NOTE: Only send a response for senders that actually sent a version. This
// maintains compatibility with older senders that don't send a version and
@@ -242,9 +242,9 @@ void ConnectionNamespaceHandler::HandleClose(CastSocket* socket,
ToCastSocketId(socket)};
const auto reason = GetCloseReason(parsed_message);
if (RemoveConnection(conn, reason)) {
- OSP_DVLOG << "Connection closed (reason: " << reason
- << "): " << conn.local_id << ", " << conn.peer_id << ", "
- << conn.socket_id;
+ OSP_VLOG << "Connection closed (reason: " << reason
+ << "): " << conn.local_id << ", " << conn.peer_id << ", "
+ << conn.socket_id;
}
}