Commit bc5c0754 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Use b64decode and b64encode instead of deprecated decodestring and encodestring

parent cc1ee494
Pipeline #17564 passed with stage
in 0 seconds
...@@ -23,7 +23,7 @@ import sys ...@@ -23,7 +23,7 @@ import sys
import tarfile import tarfile
import tempfile import tempfile
import traceback import traceback
from base64 import b64encode, decodestring, encodestring from base64 import b64encode, b64decode
try: try:
import configparser import configparser
from http.client import HTTPConnection, HTTPSConnection from http.client import HTTPConnection, HTTPSConnection
...@@ -431,7 +431,7 @@ class NetworkcacheClient(object): ...@@ -431,7 +431,7 @@ class NetworkcacheClient(object):
k = self.signature_private_key k = self.signature_private_key
if k is None: if k is None:
return '' return ''
return encodestring(crypto.sign(k, content, 'sha1')).decode() return b64encode(crypto.sign(k, content, 'sha1')).decode()
def _verifySignatureInCertificateList(self, content, signature_string): def _verifySignatureInCertificateList(self, content, signature_string):
""" """
...@@ -439,7 +439,7 @@ class NetworkcacheClient(object): ...@@ -439,7 +439,7 @@ class NetworkcacheClient(object):
find any. find any.
""" """
if signature_string: if signature_string:
signature = decodestring(signature_string.encode()) signature = b64decode(signature_string.encode())
content = content.encode() content = content.encode()
for certificate in self.signature_certificate_list: for certificate in self.signature_certificate_list:
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment