torsocks with server_type = 5 doesn't work with tor 0.2.4.17-rc-1~d70.wheezy+1
After upgrading to 0.2.4.17-rc-1~d70.wheezy+1, torsocks (1.2-3 from wheezy) stopped working. It says "Need a password in torsocks.conf or $TORSOCKS_PASSWORD to authenticate with" and tor logs this:
Sep 07 19:26:18.000 [warn] Socks5 username/password version 71 not recognized; rejecting.
Sep 07 19:26:18.000 [warn] Fetching socks handshake failed. Closing.
Worse, while failing, it appears to send 10 bytes of data to the client (or maybe this is a curl bug?).
$ usewithtor curl -v 1.1.1.1 | xxd
* About to connect() to 1.1.1.1 port 80 (#0)
* Trying 1.1.1.1...
19:29:17 libtorsocks(20833): Need a password in torsocks.conf or $TORSOCKS_PASSWORD to authenticate with % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0* connected
* getpeername() failed with errno 107: Transport endpoint is not connected
* Connected to 1.1.1.1 (1.1.1.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.26.0
> Host: 1.1.1.1
> Accept: */*
>
* additional stuff not fine transfer.c:1037: 0 0
{ [data not shown]
* Increasing bytecount by 10 from hbuflen
* nread <= 0, server closed connection, bailing
100 20 0 20 0 0 19 0 --:--:-- 0:00:01 --:--:-- 20000
* Connection #0 to host 1.1.1.1 left intact
* Closing connection #0
0000000: 0501 0001 0000 0000 0000 ..........
(it does the same thing with a real or fake IP)