summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2021-03-08 19:58:10 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2021-03-09 17:31:58 +0530
commit7caca923b07e60ba17b8d499668c0314e98789e5 (patch)
tree1cd0eb3f1d4f9474c186a35475d391842174f263
parent575ac80f1bbfdb71436135d5a9762df51de05b83 (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
-rw-r--r--conductor/conductor/common/utils/cipherUtils.py15
-rw-r--r--conductor/pom.xml2
-rw-r--r--conductor/requirements.txt2
-rw-r--r--pom.xml2
-rw-r--r--version.properties2
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 @@
<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
diff --git a/pom.xml b/pom.xml
index f5f4919..76ee19f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<artifactId>optf-has</artifactId>
<name>optf-has</name>
- <version>2.1.3-SNAPSHOT</version>
+ <version>2.1.4-SNAPSHOT</version>
<description>Homing Allocation Service</description>
<modules>
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}