2010-03-07 16:39:22 PST
I am having some issues with creating passkeys.
I have the binary form of a torrent info hash. Using file/bittorrent2 libs.
I then try to generate the key via the following code:
$site_keyQ = "SELECT `value` FROM `xbt_config` WHERE name='torrent_pass_private_key'";
if($result = $dbLink->query($site_keyQ)){
while ($row = $result->fetch_row()){
$site_key=$row[0];}
$result->close();
}
$torInHash = "SELECT `info_hash` FROM `xbt_files` WHERE fid={$fid}";
if($result = $dbLink->query($torInHash)){
while ($row = $result->fetch_row()){
$info_hash=$row[0];}
$result->close();
}
$torPaQu = "SELECT `torrent_pass_version` FROM `xbt_users` WHERE uid={$uid}";
if($result = $dbLink->query($torPaQu)){
while ($row = $result->fetch_row()){
$torrent_pass_version=$row[0];}
$result->close();
}
$passkey = sprintf('%08x%s', $uid, substr(sha1(sprintf('%s %d %d %s', $site_key, $torrent_pass_version, $uid, pack('H*', $info_hash))), 0, 24));
But I still get the tracker reporting unregistered pass key. How can I resolve this issue?