Closed sfan5 closed 7 years ago
It may make sense to reject torrents that do not come out byte-identical after a bencode decode-encode roundtrip. It would indicate that they're created by buggy clients that could cause problems for other clients.
Or at least show a warning when something like that happens.
This still doesn't fix the infohashes of already uploaded files by the way. Someone would have to rehash all the torrent files to see which other ones are affected by this bug and update the database/upload file names.
Download this torrent: https://sukebei.nyaa.si/view/2306646 Plug it into this code (standalone replica of what we use currently): https://gist.github.com/anonymous/a06a35583e2dd80d2cdab533855a924e
Notice how the output says the infohash is
C7136E94A2D7780B1545ABBDA3C5A05F6BFBBDB0
The correct infohash would be9bc0144182103cc4946e61be3d6f7de99daeaed2
(as reported on nyaa.si or by any torrent client)this is a bug in either https://github.com/majestrate/XD or https://github.com/zeebo/bencode
high prio because this (obviously) prevents the magnet links from working