(self, pyfile)
| 32 | IV = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" |
| 33 | |
| 34 | def decrypt(self, pyfile): |
| 35 | KEY = binascii.unhexlify(self.KEY) |
| 36 | IV = binascii.unhexlify(self.IV) |
| 37 | |
| 38 | iv = Crypto.Cipher.AES.new(KEY, Crypto.Cipher.AES.MODE_ECB).encrypt(IV) |
| 39 | cipher = Crypto.Cipher.AES.new(KEY, Crypto.Cipher.AES.MODE_CFB, iv) |
| 40 | |
| 41 | try: |
| 42 | fs_filename = fs_encode(pyfile.url) |
| 43 | with open(fs_filename, 'r') as rsdf: |
| 44 | data = rsdf.read() |
| 45 | |
| 46 | except IOError, e: |
| 47 | self.fail(e.message) |
| 48 | |
| 49 | if re.search(r'<title>404 - Not Found</title>', data): |
| 50 | pyfile.setStatus("offline") |
| 51 | |
| 52 | else: |
| 53 | try: |
| 54 | raw_links = binascii.unhexlify(''.join(data.split())).splitlines() |
| 55 | |
| 56 | except TypeError: |
| 57 | self.fail(_("Container is corrupted")) |
| 58 | |
| 59 | for link in raw_links: |
| 60 | if not link: |
| 61 | continue |
| 62 | link = cipher.decrypt(link.decode('base64')).replace('CCF: ', '') |
| 63 | self.links.append(link) |
nothing calls this directly
no test coverage detected