php hex code for cookie authentication to controller?

Wesley Kenzie wkenzie at gmail.com
Tue Oct 21 18:52:33 UTC 2008


per 5.1 Authentication in control-spec.txt: "To authenticate, the controller
must send the contents of this file, encoded in hexadecimal."

Fine, but when using the following in PHP:

$ch = fopen('cookiefilename', 'r');
$auth_value = fread($ch, 128);
$send_auth_value = "AUTHENTICATE \"". bin2hex($auth_value) . "\"\r\n";
$fh = fsockopen('127.0.0.1', controlportnumber);
fwrite($fh, $send_auth_value);
$buf = fgets($fh);

... I get 515 Authentication failed: Wrong length on authentication cookie.


Anyone help me with this? Thanks.

Wesley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-talk/attachments/20081021/8f612ae6/attachment.htm>


More information about the tor-talk mailing list