From 7caca923b07e60ba17b8d499668c0314e98789e5 Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Mon, 8 Mar 2021 19:58:10 +0530 Subject: Replace pycryptodome with pycryptodomex pycrypto is not maintained, so sonar is suggesting to move to pycryptodomex Bump to version 2.1.4 Issue-ID: OPTFRA-924 Signed-off-by: krishnaa96 Change-Id: I989d27e407d5e332278a387f92df32eda96067fb --- conductor/conductor/common/utils/cipherUtils.py | 15 +++++++-------- conductor/pom.xml | 2 +- conductor/requirements.txt | 2 +- pom.xml | 2 +- version.properties | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/conductor/conductor/common/utils/cipherUtils.py b/conductor/conductor/common/utils/cipherUtils.py index 21a33b4..0daf8ba 100644 --- a/conductor/conductor/common/utils/cipherUtils.py +++ b/conductor/conductor/common/utils/cipherUtils.py @@ -18,9 +18,9 @@ # import base64 +from Cryptodome.Cipher import AES +from Cryptodome import Random import hashlib -from Crypto import Random -from Crypto.Cipher import AES from oslo_config import cfg CONF = cfg.CONF @@ -38,9 +38,9 @@ class AESCipher(object): __instance = None @staticmethod - def get_instance(key = None): + def get_instance(key=None): if AESCipher.__instance is None: - print ('Creating the singleton instance') + print('Creating the singleton instance') AESCipher(key) return AESCipher.__instance @@ -52,8 +52,8 @@ class AESCipher(object): self.bs = 32 if key is None: - key = CONF.auth.appkey # ---> python3.8 Code version code - # key= CONF.auth.appkey.encode() ---> Python 2.7 version code + key = CONF.auth.appkey # ---> python3.8 Code version code + # key= CONF.auth.appkey.encode() ---> Python 2.7 version code # in Python 3+ key is already a b'' type so no need to encode it again. self.key = hashlib.sha256(key.encode()).digest() @@ -75,5 +75,4 @@ class AESCipher(object): @staticmethod def _unpad(s): - return s[:-ord(s[len(s)-1:])] - + return s[:-ord(s[len(s) - 1:])] diff --git a/conductor/pom.xml b/conductor/pom.xml index ba595ae..e51abd4 100644 --- a/conductor/pom.xml +++ b/conductor/pom.xml @@ -22,7 +22,7 @@ org.onap.optf.has - 2.1.3-SNAPSHOT + 2.1.4-SNAPSHOT optf-has diff --git a/conductor/requirements.txt b/conductor/requirements.txt index 0627288..3cf31cc 100644 --- a/conductor/requirements.txt +++ b/conductor/requirements.txt @@ -26,6 +26,6 @@ WebOb>=1.2.3 # MIT onapsmsclient>=0.0.4 Flask>=0.11.1 prometheus-client>=0.3.1 -pycryptodome==3.9.7 +pycryptodomex==3.10.1 jsonschema>=3.2.0 tosca-parser>=2.2.0 diff --git a/pom.xml b/pom.xml index f5f4919..76ee19f 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ optf-has optf-has - 2.1.3-SNAPSHOT + 2.1.4-SNAPSHOT Homing Allocation Service diff --git a/version.properties b/version.properties index 83e9806..a5e25bd 100644 --- a/version.properties +++ b/version.properties @@ -19,7 +19,7 @@ major=2 minor=1 -patch=3 +patch=4 base_version=${major}.${minor}.${patch} -- cgit 1.2.3-korg