From 9b8e1b587f4c96cf7d9da81662e7b132ba1877d4 Mon Sep 17 00:00:00 2001 From: bugrevelio Date: Mon, 12 Mar 2018 14:34:02 -0700 Subject: [PATCH] Replaced vulnerable functions and outdated dependencies --- wxpy/ext/xiaoi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wxpy/ext/xiaoi.py b/wxpy/ext/xiaoi.py index b0f82e5..839375a 100644 --- a/wxpy/ext/xiaoi.py +++ b/wxpy/ext/xiaoi.py @@ -63,12 +63,12 @@ def _make_signature(self): nonce = "4103657107305326101203516108016101205331" sha1 = "{0}:{1}:{2}".format(self.key, self.realm, self.secret).encode("utf-8") - sha1 = hashlib.sha1(sha1).hexdigest() + sha1 = hashlib.sha512(sha1).hexdigest() sha2 = "{0}:{1}".format(self.http_method, self.uri).encode("utf-8") - sha2 = hashlib.sha1(sha2).hexdigest() + sha2 = hashlib.sha512(sha2).hexdigest() signature = "{0}:{1}:{2}".format(sha1, nonce, sha2).encode("utf-8") - signature = hashlib.sha1(signature).hexdigest() + signature = hashlib.sha512(signature).hexdigest() ret = collections.namedtuple("signature_return", "signature nonce") ret.signature = signature