diff --git a/kmip/services/server/crypto/engine.py b/kmip/services/server/crypto/engine.py index e6527e4..1552770 100644 --- a/kmip/services/server/crypto/engine.py +++ b/kmip/services/server/crypto/engine.py @@ -269,8 +269,7 @@ class CryptographyEngine(api.CryptographicEngine): ) cipher_algorithm = self._symmetric_key_algorithms.get(algorithm) try: - # ARC4 and IDEA algorithms will raise exception as CMAC - # requires block ciphers + # ARC4 and other non-block cipher algorithms will raise TypeError exceptions c = cmac.CMAC(cipher_algorithm(key), backend=default_backend()) c.update(data) mac_data = c.finalize() diff --git a/kmip/tests/unit/services/server/crypto/test_engine.py b/kmip/tests/unit/services/server/crypto/test_engine.py index 4adb222..edb5283 100644 --- a/kmip/tests/unit/services/server/crypto/test_engine.py +++ b/kmip/tests/unit/services/server/crypto/test_engine.py @@ -247,8 +247,8 @@ class TestCryptographyEngine(testtools.TestCase): engine = crypto.CryptographyEngine() - # IDEA is not block cipher so cmac should raise exception - args = [enums.CryptographicAlgorithm.IDEA, key, data] + # RC4 is not block cipher so cmac should raise exception + args = [enums.CryptographicAlgorithm.RC4, key, data] self.assertRaises( exceptions.CryptographicFailure, engine.mac,