Revert "[fragments] Pad fragments before decrypting (#1298)"

This reverts commit 373475f035.
This commit is contained in:
pukkandan 2021-10-19 22:13:45 +05:30
parent aa7785f860
commit 2cda6b401d
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -355,8 +355,7 @@ class FragmentFD(FileDownloader):
# not what it decrypts to.
if self.params.get('test', False):
return frag_content
padding_len = 16 - (len(frag_content) % 16)
decrypted_data = aes_cbc_decrypt_bytes(frag_content + bytes([padding_len] * padding_len), decrypt_info['KEY'], iv)
decrypted_data = aes_cbc_decrypt_bytes(frag_content, decrypt_info['KEY'], iv)
return decrypted_data[:-decrypted_data[-1]]
return decrypt_fragment