Skip to content

Commit b3635ec

Browse files
committed
Remove deprecated saml2.aes module
Use saml2.cryptography.symmetric instead Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 9982e4b commit b3635ec

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

src/saml2/aes.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/test_92_aes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
22

3-
import saml2.aes
3+
from saml2.cryptography.symmetric import AESCipher
44

55

66
class TestAES():
77
def test_aes_defaults(self):
88
original_msg = b'ToBeOrNotTobe W.S.'
99
key = os.urandom(16)
10-
aes = saml2.aes.AESCipher(key)
10+
aes = AESCipher(key)
1111

1212
encrypted_msg = aes.encrypt(original_msg)
1313
decrypted_msg = aes.decrypt(encrypted_msg)
@@ -16,7 +16,7 @@ def test_aes_defaults(self):
1616
def test_aes_128_cbc(self):
1717
original_msg = b'ToBeOrNotTobe W.S.'
1818
key = os.urandom(16)
19-
aes = saml2.aes.AESCipher(key)
19+
aes = AESCipher(key)
2020
alg = 'aes_128_cbc'
2121

2222
encrypted_msg = aes.encrypt(original_msg, alg=alg)
@@ -26,7 +26,7 @@ def test_aes_128_cbc(self):
2626
def test_aes_128_cfb(self):
2727
original_msg = b'ToBeOrNotTobe W.S.'
2828
key = os.urandom(16)
29-
aes = saml2.aes.AESCipher(key)
29+
aes = AESCipher(key)
3030
alg = 'aes_128_cfb'
3131

3232
encrypted_msg = aes.encrypt(original_msg, alg=alg)
@@ -36,7 +36,7 @@ def test_aes_128_cfb(self):
3636
def test_aes_192_cbc(self):
3737
original_msg = b'ToBeOrNotTobe W.S.'
3838
key = os.urandom(24)
39-
aes = saml2.aes.AESCipher(key)
39+
aes = AESCipher(key)
4040
alg = 'aes_192_cbc'
4141

4242
encrypted_msg = aes.encrypt(original_msg, alg=alg)
@@ -46,7 +46,7 @@ def test_aes_192_cbc(self):
4646
def test_aes_192_cfb(self):
4747
original_msg = b'ToBeOrNotTobe W.S.'
4848
key = os.urandom(24)
49-
aes = saml2.aes.AESCipher(key)
49+
aes = AESCipher(key)
5050
alg = 'aes_192_cfb'
5151

5252
encrypted_msg = aes.encrypt(original_msg, alg=alg)
@@ -56,7 +56,7 @@ def test_aes_192_cfb(self):
5656
def test_aes_256_cbc(self):
5757
original_msg = b'ToBeOrNotTobe W.S.'
5858
key = os.urandom(32)
59-
aes = saml2.aes.AESCipher(key)
59+
aes = AESCipher(key)
6060
alg = 'aes_256_cbc'
6161

6262
encrypted_msg = aes.encrypt(original_msg, alg=alg)
@@ -66,7 +66,7 @@ def test_aes_256_cbc(self):
6666
def test_aes_256_cfb(self):
6767
original_msg = b'ToBeOrNotTobe W.S.'
6868
key = os.urandom(32)
69-
aes = saml2.aes.AESCipher(key)
69+
aes = AESCipher(key)
7070
alg = 'aes_256_cfb'
7171

7272
encrypted_msg = aes.encrypt(original_msg, alg=alg)

0 commit comments

Comments
 (0)