hmac.digest -> hmac.new (the former is too new) (sasl.scram)

This commit is contained in:
jesopo 2019-02-15 01:21:24 +00:00
parent 4e7bfee3a6
commit a7d3fd93fc

View file

@ -48,7 +48,7 @@ class SCRAM(object):
return dict((piece[0], piece[1]) for piece in pieces) return dict((piece[0], piece[1]) for piece in pieces)
def _hmac(self, key: bytes, msg: bytes) -> bytes: def _hmac(self, key: bytes, msg: bytes) -> bytes:
return hmac.digest(key, msg, self._algo) return hmac.new(key, msg, self._algo).digest()
def _hash(self, msg: bytes) -> bytes: def _hash(self, msg: bytes) -> bytes:
return hashlib.new(self._algo, msg).digest() return hashlib.new(self._algo, msg).digest()