From b3635ec9792e0d2bc9682a14987248f37242a659 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Thu, 26 Dec 2019 15:03:17 +0200 Subject: Remove deprecated saml2.aes module Use saml2.cryptography.symmetric instead Signed-off-by: Ivan Kanakarakis --- src/saml2/aes.py | 16 ---------------- tests/test_92_aes.py | 16 ++++++++-------- 2 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 src/saml2/aes.py diff --git a/src/saml2/aes.py b/src/saml2/aes.py deleted file mode 100644 index 6f37fb33..00000000 --- a/src/saml2/aes.py +++ /dev/null @@ -1,16 +0,0 @@ -import warnings as _warnings - -from saml2.cryptography.symmetric import AESCipher as _AESCipher - - -_deprecation_msg = ( - '{name} {type} is deprecated. ' - 'It will be removed in the next version. ' - 'Use saml2.cryptography.symmetric instead.' -).format(name=__name__, type='module') -_warnings.warn(_deprecation_msg, DeprecationWarning) - - -AESCipher = _AESCipher -POSTFIX_MODE = _AESCipher.POSTFIX_MODE -AES_BLOCK_SIZE = _AESCipher.AES_BLOCK_SIZE diff --git a/tests/test_92_aes.py b/tests/test_92_aes.py index 564260bc..424ee15d 100644 --- a/tests/test_92_aes.py +++ b/tests/test_92_aes.py @@ -1,13 +1,13 @@ import os -import saml2.aes +from saml2.cryptography.symmetric import AESCipher class TestAES(): def test_aes_defaults(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(16) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) encrypted_msg = aes.encrypt(original_msg) decrypted_msg = aes.decrypt(encrypted_msg) @@ -16,7 +16,7 @@ class TestAES(): def test_aes_128_cbc(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(16) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) alg = 'aes_128_cbc' encrypted_msg = aes.encrypt(original_msg, alg=alg) @@ -26,7 +26,7 @@ class TestAES(): def test_aes_128_cfb(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(16) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) alg = 'aes_128_cfb' encrypted_msg = aes.encrypt(original_msg, alg=alg) @@ -36,7 +36,7 @@ class TestAES(): def test_aes_192_cbc(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(24) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) alg = 'aes_192_cbc' encrypted_msg = aes.encrypt(original_msg, alg=alg) @@ -46,7 +46,7 @@ class TestAES(): def test_aes_192_cfb(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(24) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) alg = 'aes_192_cfb' encrypted_msg = aes.encrypt(original_msg, alg=alg) @@ -56,7 +56,7 @@ class TestAES(): def test_aes_256_cbc(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(32) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) alg = 'aes_256_cbc' encrypted_msg = aes.encrypt(original_msg, alg=alg) @@ -66,7 +66,7 @@ class TestAES(): def test_aes_256_cfb(self): original_msg = b'ToBeOrNotTobe W.S.' key = os.urandom(32) - aes = saml2.aes.AESCipher(key) + aes = AESCipher(key) alg = 'aes_256_cfb' encrypted_msg = aes.encrypt(original_msg, alg=alg) -- cgit v1.2.1