Esempio n. 1
0
 def test_password_change(self):
     from synnefo.db import aes_encrypt as aes
     old_pass = aes.SECRET_ENCRYPTION_KEY
     old = 'bar'
     encrypted = aes.encrypt_db_charfield(old)
     aes.SECRET_ENCRYPTION_KEY = 'foo2'
     self.assertRaises(aes.CorruptedPassword, aes.decrypt_db_charfield,
                       encrypted)
     aes.SECRET_ENCRYPTION_KEY = old_pass
     new = aes.decrypt_db_charfield(encrypted)
     self.assertEqual(old, new)
Esempio n. 2
0
 def test_password_change(self):
     from synnefo.db import aes_encrypt as aes
     old_pass = aes.SECRET_ENCRYPTION_KEY
     old = 'bar'
     encrypted = aes.encrypt_db_charfield(old)
     aes.SECRET_ENCRYPTION_KEY = 'foo2'
     self.assertRaises(aes.CorruptedPassword, aes.decrypt_db_charfield,
                       encrypted)
     aes.SECRET_ENCRYPTION_KEY = old_pass
     new = aes.decrypt_db_charfield(encrypted)
     self.assertEqual(old, new)
Esempio n. 3
0
 def test_encrypt_decrtypt(self):
     from synnefo.db import aes_encrypt as aes
     old = 'bar'
     new = aes.decrypt_db_charfield(aes.encrypt_db_charfield(old))
     self.assertEqual(old, new)
Esempio n. 4
0
 def test_encrypt_decrtypt(self):
     from synnefo.db import aes_encrypt as aes
     old = 'bar'
     new = aes.decrypt_db_charfield(aes.encrypt_db_charfield(old))
     self.assertEqual(old, new)