Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (database, password, transformed_key,
keyfile, encryption_algorithm, kdf_algorithm, version) in zip(
databases, passwords, transformed_keys,
keyfiles, encryption_algorithms, kdf_algorithms, versions
):
kp = PyKeePass(
os.path.join(base_dir, database),
password,
None if keyfile is None else os.path.join(base_dir, keyfile),
transformed_key=transformed_key
)
self.assertEqual(kp.encryption_algorithm, encryption_algorithm)
self.assertEqual(kp.kdf_algorithm, kdf_algorithm)
self.assertEqual(kp.version, version)
KDBX.parse(
KDBX.build(
kp.kdbx,
password=password,
keyfile=None if keyfile is None else os.path.join(base_dir, keyfile),
transformed_key=transformed_key
),
password=password,
keyfile=None if keyfile is None else os.path.join(base_dir, keyfile),
transformed_key=transformed_key
)