def test_distdoc_decrypt_tail(self): section = self.section key = section.head_key() tail = section.tail() try: decrypted = decrypt_tail(key, tail) except NotImplementedError, e: if e.message == 'aes128ecb_decrypt': # skip this test return raise
def test_distdoc_decrypt_tail(self): section = self.section key = section.head_key() tail = section.tail() decrypted = decrypt_tail(key, tail) decompressed = zlib.decompress(decrypted, -15) record = read_record(BytesIO(decompressed), 0) self.assertEqual(0, record['level']) self.assertEqual(HWPTAG_PARA_HEADER, record['tagid']) self.assertEqual(22, record['size']) self.assertEqual(390, len(decompressed))
def tail_decrypted(self): from hwp5.distdoc import decrypt_tail key = self.head_key() tail = self.tail() return decrypt_tail(key, tail)