From a664187bc46e875b6d3926a6ab9d166884441951 Mon Sep 17 00:00:00 2001 From: justin-h-loi Date: Tue, 29 Aug 2023 15:13:53 -0400 Subject: [PATCH] Fix code syntax and docs --- kmip/services/server/crypto/engine.py | 3 +-- kmip/services/server/session.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kmip/services/server/crypto/engine.py b/kmip/services/server/crypto/engine.py index 0821826..3c6534a 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 other non-block cipher algorithms will - # raise TypeError exceptions + # ARC4 and other non-block cipher algorithm will raise TypeError c = cmac.CMAC(cipher_algorithm(key), backend=default_backend()) c.update(data) mac_data = c.finalize() diff --git a/kmip/services/server/session.py b/kmip/services/server/session.py index 2b17ef0..c6a5f70 100644 --- a/kmip/services/server/session.py +++ b/kmip/services/server/session.py @@ -127,8 +127,8 @@ class KmipSession(threading.Thread): ) try: - if hasattr(self._connection, 'shared_ciphers') \ - and self._connection.shared_ciphers() is not None: + if (hasattr(self._connection, 'shared_ciphers') + and self._connection.shared_ciphers() is not None): shared_ciphers = self._connection.shared_ciphers() self._logger.debug( "Possible session ciphers: {0}".format(len(shared_ciphers))