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

Use b64decode and b64encode instead of deprecated decodestring and encodestring

parent cc1ee494
......@@ -23,7 +23,7 @@ import sys
import tarfile
import tempfile
import traceback
from base64 import b64encode, decodestring, encodestring
from base64 import b64encode, b64decode
try:
import configparser
from http.client import HTTPConnection, HTTPSConnection
......@@ -431,7 +431,7 @@ class NetworkcacheClient(object):
k = self.signature_private_key
if k is None:
return ''
return encodestring(crypto.sign(k, content, 'sha1')).decode()
return b64encode(crypto.sign(k, content, 'sha1')).decode()
def _verifySignatureInCertificateList(self, content, signature_string):
"""
......@@ -439,7 +439,7 @@ class NetworkcacheClient(object):
find any.
"""
if signature_string:
signature = decodestring(signature_string.encode())
signature = b64decode(signature_string.encode())
content = content.encode()
for certificate in self.signature_certificate_list:
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