net: cleanup SOCKS5 auth logging #35116

pull takeshikurosawaa wants to merge 2 commits into bitcoin:master from takeshikurosawaa:cleanup-socks5-auth-logging changing 1 files +1 −1
  1. takeshikurosawaa commented at 6:16 PM on April 19, 2026: contributor

    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.

  2. DrahtBot added the label P2P on Apr 19, 2026
  3. DrahtBot commented at 6:17 PM on April 19, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK davidgumberg, theStack, sedited

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34729 (Reduce log noise by ajtowns)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. takeshikurosawaa force-pushed on Apr 19, 2026
  5. sedited commented at 8:26 PM on April 19, 2026: contributor

    I don't think a unit test is required for this. Matching that way for a log string seems brittle. I'd be fine with just the log line change.

  6. takeshikurosawaa force-pushed on Apr 19, 2026
  7. takeshikurosawaa commented at 8:57 PM on April 19, 2026: contributor

    Removed the unit test.

    This only changes the log message.

  8. net: cleanup SOCKS5 auth logging
    Do not log SOCKS5 auth credentials.
    
    Keep the log entry for the auth path, but omit the
    username and password.
    
    No behavior change intended.
    b2debc9276
  9. takeshikurosawaa force-pushed on Apr 19, 2026
  10. net: log SOCKS5 auth before sending 3bf3b6d59a
  11. in src/netbase.cpp:435 in b2debc9276 outdated
     431 | @@ -432,7 +432,7 @@ bool Socks5(const std::string& strDest, uint16_t port, const ProxyCredentials* a
     432 |              vAuth.push_back(auth->password.size());
     433 |              vAuth.insert(vAuth.end(), auth->password.begin(), auth->password.end());
     434 |              sock.SendComplete(vAuth, g_socks5_recv_timeout, g_socks5_interrupt);
     435 | -            LogDebug(BCLog::PROXY, "SOCKS5 sending proxy authentication %s:%s\n", auth->username, auth->password);
     436 | +            LogDebug(BCLog::PROXY, "SOCKS5 sending username/password authentication\n");
    


    furszy commented at 10:01 PM on April 19, 2026:

    Isn't this occurring after the send happened?. Could move it to the line above to actually log prior to sending the data.


    takeshikurosawaa commented at 10:45 PM on April 19, 2026:

    Fixed, moved it above send.

  12. DrahtBot added the label CI failed on Apr 20, 2026
  13. DrahtBot removed the label CI failed on Apr 20, 2026
  14. theStack approved
  15. theStack commented at 11:45 AM on April 23, 2026: contributor

    ACK 3bf3b6d59abddd126ca2710fb382b759e57ccdd5

  16. sedited approved
  17. sedited commented at 11:46 AM on April 23, 2026: contributor

    ACK 3bf3b6d59abddd126ca2710fb382b759e57ccdd5

  18. sedited merged this on Apr 23, 2026
  19. sedited closed this on Apr 23, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:52 UTC