Merge bitcoin/bitcoin#35116: net: cleanup SOCKS5 auth logging

3bf3b6d59a net: log SOCKS5 auth before sending (takeshikurosawaa)
b2debc9276 net: cleanup SOCKS5 auth logging (takeshikurosawaa)

Pull request description:

  `Socks5()` logs the supplied `username` and `password` in `BCLog::PROXY`
  when the server selects `USER_PASS`.

  Keep the log entry for the auth path, but omit the credentials.
  Log the message before sending the authentication data.

  No functional behavior change intended.

ACKs for top commit:
  davidgumberg:
    crACK 3bf3b6d59a
  theStack:
    ACK 3bf3b6d59a
  sedited:
    ACK 3bf3b6d59a

Tree-SHA512: ef90fca297b954c8659d108259b7f25216c0c0ddb7305539154f14a7bfdad807b70b7ddd0cf6e4ad0127d0a1ccfdfbb3f4785d7662b134409375ff1830b9df9b
This commit is contained in:
merge-script
2026-04-23 13:52:13 +02:00

View File

@@ -431,8 +431,8 @@ bool Socks5(const std::string& strDest, uint16_t port, const ProxyCredentials* a
vAuth.insert(vAuth.end(), auth->username.begin(), auth->username.end());
vAuth.push_back(auth->password.size());
vAuth.insert(vAuth.end(), auth->password.begin(), auth->password.end());
LogDebug(BCLog::PROXY, "SOCKS5 sending username/password authentication\n");
sock.SendComplete(vAuth, g_socks5_recv_timeout, g_socks5_interrupt);
LogDebug(BCLog::PROXY, "SOCKS5 sending proxy authentication %s:%s\n", auth->username, auth->password);
uint8_t pchRetA[2];
if (InterruptibleRecv(pchRetA, 2, g_socks5_recv_timeout, sock) != IntrRecvError::OK) {
LogError("Error reading proxy authentication response\n");