Update the Wheezy patch

The patch had a lingering incompatibily to address.

Change-Id: If7d23efbfdb7cfa2400920e5b9ae04282e66a9a7
This commit is contained in:
Jarrod Johnson 2019-02-08 15:22:53 -05:00
parent 90a9be1344
commit 9fa2095fe7

View File

@ -1,18 +1,16 @@
diff --git a/lower-constraints.txt b/lower-constraints.txt diff -urN pyghmi/lower-constraints.txt pyghmi-wheezy/lower-constraints.txt
index a02749a..1741a51 100644 --- pyghmi/lower-constraints.txt 2018-08-30 09:41:36.771908238 -0400
--- a/lower-constraints.txt +++ pyghmi-wheezy/lower-constraints.txt 2019-02-08 14:27:21.322413226 -0500
+++ b/lower-constraints.txt
@@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
coverage===4.0 coverage===4.0
-cryptography===2.1 -cryptography===2.1
fixtures===3.0.0 fixtures===3.0.0
openstackdocstheme==1.18.1 openstackdocstheme==1.18.1
oslotest===3.2.0 oslotest===3.2.0
diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py diff -urN pyghmi/pyghmi/ipmi/private/session.py pyghmi-wheezy/pyghmi/ipmi/private/session.py
index 0cd2043..c31020d 100644 --- pyghmi/pyghmi/ipmi/private/session.py 2019-02-08 14:26:57.039077089 -0500
--- a/pyghmi/ipmi/private/session.py +++ pyghmi-wheezy/pyghmi/ipmi/private/session.py 2019-02-08 14:28:35.048397582 -0500
+++ b/pyghmi/ipmi/private/session.py @@ -28,8 +28,8 @@
@@ -28,8 +28,8 @@ import struct
import threading import threading
@ -23,7 +21,7 @@ index 0cd2043..c31020d 100644
import pyghmi.exceptions as exc import pyghmi.exceptions as exc
from pyghmi.ipmi.private import constants from pyghmi.ipmi.private import constants
@@ -309,10 +309,6 @@ class Session(object): @@ -309,10 +309,6 @@
# can do something like reassign our threading and select modules # can do something like reassign our threading and select modules
socketchecking = None socketchecking = None
@ -34,7 +32,7 @@ index 0cd2043..c31020d 100644
@classmethod @classmethod
def _cleanup(cls): def _cleanup(cls):
for sesskey in list(cls.bmc_handlers): for sesskey in list(cls.bmc_handlers):
@@ -872,14 +868,9 @@ class Session(object): @@ -872,14 +868,9 @@
iv = os.urandom(16) iv = os.urandom(16)
message += iv message += iv
payloadtocrypt = bytes(payload + _aespad(payload)) payloadtocrypt = bytes(payload + _aespad(payload))
@ -52,7 +50,7 @@ index 0cd2043..c31020d 100644
else: # no confidetiality algorithm else: # no confidetiality algorithm
message.append(psize & 0xff) message.append(psize & 0xff)
message.append(psize >> 8) message.append(psize >> 8)
@@ -1367,14 +1358,9 @@ class Session(object): @@ -1366,14 +1357,9 @@
payload = data[16:16 + psize] payload = data[16:16 + psize]
if encrypted: if encrypted:
iv = data[16:32] iv = data[16:32]
@ -66,14 +64,13 @@ index 0cd2043..c31020d 100644
- ) + decryptor.finalize()) - ) + decryptor.finalize())
+ decrypter = AES.new(self.aeskey, AES.MODE_CBC, iv) + decrypter = AES.new(self.aeskey, AES.MODE_CBC, iv)
+ decrypted = decrypter.decrypt(payload[16:]) + decrypted = decrypter.decrypt(payload[16:])
+ payload = decrypted + payload = bytearray(decrypted)
padsize = payload[-1] + 1 padsize = payload[-1] + 1
payload = payload[:-padsize] payload = payload[:-padsize]
if ptype == 0: if ptype == 0:
diff --git a/requirements.txt b/requirements.txt diff -urN pyghmi/requirements.txt pyghmi-wheezy/requirements.txt
index 1fb58a9..26ff921 100644 --- pyghmi/requirements.txt 2018-08-15 08:43:19.779309677 -0400
--- a/requirements.txt +++ pyghmi-wheezy/requirements.txt 2019-02-08 14:27:21.322413226 -0500
+++ b/requirements.txt
@@ -1 +1 @@ @@ -1 +1 @@
-cryptography>=2.1 # BSD/Apache-2.0 -cryptography>=2.1 # BSD/Apache-2.0
+pycryptodomex>=2.6 +pycryptodomex>=2.6