[tests] Use 16 bytes key when testing Blowfish
authorJérémy Bobbio <jeremy.bobbio@irq7.fr>
Wed, 19 Jun 2019 18:43:38 +0200
changeset 12682 da36da3f89f1
parent 12681 42afaaf708d8
child 12683 d77afae12d45
[tests] Use 16 bytes key when testing Blowfish The version of Cryptodome currently in Debian only accepts Blowfish keys with at least 5 bytes. This is a bug (it should accept 4 as it did before) that has since been fixed upstream: https://github.com/Legrandin/pycryptodome/commit/93912230f3c39e09f4038cb17e301468687c6538 So we work around this issue by using a 16 bytes key instead (which happens to be the minimum recommended length).
cubicweb/test/unittest_crypto.py
--- a/cubicweb/test/unittest_crypto.py	Tue Jul 09 14:35:44 2019 +0200
+++ b/cubicweb/test/unittest_crypto.py	Wed Jun 19 18:43:38 2019 +0200
@@ -7,7 +7,7 @@
 
     def test_encrypt_decrypt_roundtrip(self):
         data = {'a': u'ah', 'b': [1, 2]}
-        seed = 'ssss'
+        seed = 's' * 16
         crypted = crypto.encrypt(data, seed)
         decrypted = crypto.decrypt(crypted, seed)
         self.assertEqual(decrypted, data)