diff options
author | Heikki Toivonen <heikki@heikkitoivonen.net> | 2009-02-09 05:11:47 +0000 |
---|---|---|
committer | Heikki Toivonen <heikki@heikkitoivonen.net> | 2009-02-09 05:11:47 +0000 |
commit | 5db6821b366d5d0173fa5e0e79a5df380c8f6e2d (patch) | |
tree | f9a0f7310d8ecefd0f90f2609ad3057c407fc636 /tests/test_evp.py | |
parent | 001b040d8708a09abad402b95d91efdb05987ec0 (diff) | |
download | m2crypto-5db6821b366d5d0173fa5e0e79a5df380c8f6e2d.tar.gz |
Try to test idea and rc5 ciphers.
git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@667 2715db39-9adf-0310-9c64-84f055769b4b
Diffstat (limited to 'tests/test_evp.py')
-rw-r--r-- | tests/test_evp.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/test_evp.py b/tests/test_evp.py index 6dd2bdc..bf732f7 100644 --- a/tests/test_evp.py +++ b/tests/test_evp.py @@ -203,9 +203,7 @@ class CipherTestCase(unittest.TestCase): def test_ciphers(self): ciphers=['bf_ecb', 'bf_cbc', 'bf_cfb', 'bf_ofb',\ - #'idea_ecb', 'idea_cbc', 'idea_cfb', 'idea_ofb',\ 'cast5_ecb', 'cast5_cbc', 'cast5_cfb', 'cast5_ofb',\ - #'rc5_ecb', 'rc5_cbc', 'rc5_cfb', 'rc5_ofb',\ 'des_ecb', 'des_cbc', 'des_cfb', 'des_ofb',\ 'des_ede_ecb', 'des_ede_cbc', 'des_ede_cfb', 'des_ede_ofb',\ 'des_ede3_ecb', 'des_ede3_cbc', 'des_ede3_cfb', 'des_ede3_ofb',\ @@ -216,6 +214,24 @@ class CipherTestCase(unittest.TestCase): for i in ciphers: self.try_algo(i) + # idea might not be compiled in + ciphers=['idea_ecb', 'idea_cbc', 'idea_cfb', 'idea_ofb'] + try: + for i in ciphers: + self.try_algo(i) + except ValueError, e: + if str(e) != "('unknown cipher', 'idea_ecb')": + raise + + # rc5 might not be compiled in + ciphers=['rc5_ecb', 'rc5_cbc', 'rc5_cfb', 'rc5_ofb'] + try: + for i in ciphers: + self.try_algo(i) + except ValueError, e: + if str(e) != "('unknown cipher', 'rc5_ecb')": + raise + self.assertRaises(ValueError, self.try_algo, 'nosuchalgo4567') def test_AES(self): |