Review report

bitcoin/bitcoin: PR #35292

1 suggestion

Optional improvements

Link

[suggestion] · New HASHEDPASSWORD cases miss embedded-quote escaping

Removing the existing quote-escaping step would leave all four new tests' assertions satisfied because none supplies a password containing a quote.

Location: test/functional/feature_torcontrol.py:115 (head).

Details and suggested fix

The success and wrong-password cases use only letters and underscores, while the no-password and unsupported-method cases never reach the password-encoding branch. Consequently, none exercises ReplaceAll(torpassword, "\"", "\\\"") in protocolinfo_cb (src/torcontrol.cpp:695). Add a success case with the literal password pa"ss and use the mock's existing expected_auth parameter to require the wire command AUTHENTICATE "pa\"ss". This exercises the current implementation and would catch removal of the escaping step, which would produce a malformed command for that password. Keep backslash coverage coordinated with a production encoding fix: this head escapes quotes only, so a correct expectation for an embedded backslash would fail without a production change.


Coverage details