|
|
@ -543,6 +543,7 @@ class TestVaultCipherAes256(unittest.TestCase):
|
|
|
|
self.assertIsInstance(b_key_2, six.binary_type)
|
|
|
|
self.assertIsInstance(b_key_2, six.binary_type)
|
|
|
|
self.assertEqual(b_key_1, b_key_2)
|
|
|
|
self.assertEqual(b_key_1, b_key_2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if vault.HAS_PYCRYPTO:
|
|
|
|
# And again with pycrypto
|
|
|
|
# And again with pycrypto
|
|
|
|
b_key_3 = self.vault_cipher._create_key_pycrypto(b_password, b_salt, key_length=32, iv_length=16)
|
|
|
|
b_key_3 = self.vault_cipher._create_key_pycrypto(b_password, b_salt, key_length=32, iv_length=16)
|
|
|
|
self.assertIsInstance(b_key_3, six.binary_type)
|
|
|
|
self.assertIsInstance(b_key_3, six.binary_type)
|
|
|
@ -555,6 +556,8 @@ class TestVaultCipherAes256(unittest.TestCase):
|
|
|
|
self.assertEqual(b_key_3, b_key_4)
|
|
|
|
self.assertEqual(b_key_3, b_key_4)
|
|
|
|
self.assertEqual(b_key_1, b_key_4)
|
|
|
|
self.assertEqual(b_key_1, b_key_4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.skipif(not vault.HAS_PYCRYPTO,
|
|
|
|
|
|
|
|
reason='PyCrypto is not installed')
|
|
|
|
def test_create_key_known_pycrypto(self):
|
|
|
|
def test_create_key_known_pycrypto(self):
|
|
|
|
b_password = b'hunter42'
|
|
|
|
b_password = b'hunter42'
|
|
|
|
|
|
|
|
|
|
|
|