diff options
author | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-03-08 19:58:10 +0530 |
---|---|---|
committer | krishnaa96 <krishna.moorthy6@wipro.com> | 2021-03-09 17:31:58 +0530 |
commit | 7caca923b07e60ba17b8d499668c0314e98789e5 (patch) | |
tree | 1cd0eb3f1d4f9474c186a35475d391842174f263 /conductor | |
parent | 575ac80f1bbfdb71436135d5a9762df51de05b83 (diff) |
Replace pycryptodome with pycryptodomex2.1.4
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 <krishna.moorthy6@wipro.com>
Change-Id: I989d27e407d5e332278a387f92df32eda96067fb
Diffstat (limited to 'conductor')
-rw-r--r-- | conductor/conductor/common/utils/cipherUtils.py | 15 | ||||
-rw-r--r-- | conductor/pom.xml | 2 | ||||
-rw-r--r-- | conductor/requirements.txt | 2 |
3 files changed, 9 insertions, 10 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 @@ <parent> <groupId>org.onap.optf.has</groupId> - <version>2.1.3-SNAPSHOT</version> + <version>2.1.4-SNAPSHOT</version> <artifactId>optf-has</artifactId> </parent> 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 |