def test_get_mangled_passphrase(self): # Confirm that a mangled passphrase is provided as per bug#1633518 unmangled_raw_key = bytes(binascii.unhexlify('0725230b')) symmetric_key = key.SymmetricKey('AES', len(unmangled_raw_key) * 8, unmangled_raw_key) unmangled_encoded_key = symmetric_key.get_encoded() encryptor = luks.LuksEncryptor(self.connection_info) self.assertEqual(encryptor._get_mangled_passphrase( unmangled_encoded_key), '72523b')
def _create(self, connection_info): return luks.LuksEncryptor(connection_info)