Replace pycryptodome with pycryptodomex 11/118911/2 2.1.4
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Mon, 8 Mar 2021 14:28:10 +0000 (19:58 +0530)
committerkrishnaa96 <krishna.moorthy6@wipro.com>
Tue, 9 Mar 2021 12:01:58 +0000 (17:31 +0530)
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

conductor/conductor/common/utils/cipherUtils.py
conductor/pom.xml
conductor/requirements.txt
pom.xml
version.properties

index 21a33b4..0daf8ba 100644 (file)
@@ -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:])]
index ba595ae..e51abd4 100644 (file)
@@ -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>
 
index 0627288..3cf31cc 100644 (file)
@@ -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 (file)
--- 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>
index 83e9806..a5e25bd 100644 (file)
@@ -19,7 +19,7 @@
 
 major=2
 minor=1
-patch=3
+patch=4
 
 base_version=${major}.${minor}.${patch}