Review report

bitcoin/bitcoin: PR #36637

1 suggestion

Optional improvements

Link

[suggestion] · Legacy backslash escaping lacks migration guidance

Users who doubled backslashes in -torpassword to work around the old escaping bug will fail Tor authentication after upgrading, preventing automatic onion-service creation, but the PR provides no migration note.

Location: src/torcontrol.cpp:695 (head).

Details and suggested fix

The old code escaped only double quotes before sending a QuotedString, so Tor decoded a doubled backslash into one password backslash. Hex encoding correctly sends the configured bytes unchanged, but an existing workaround such as torpassword=pa\\ss now authenticates with two literal backslashes instead of one. For nodes using HASHEDPASSWORD authentication and automatic onion-service creation, that mismatch logs tor: Authentication failed and skips ADD_ONION. A configured password prevents NULL or SAFECOOKIE fallback, and reconnecting with the same configuration cannot repair the mismatch. Keep the corrected encoding and add a short release note explaining that users must remove backslashes added solely for the old Tor escaping workaround. Although doc/tor.md already specifies the clear-text password, it does not explain this migration. Whether any deployed configurations use the workaround is unconfirmed.


Coverage details