aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-05-03 08:43:23 (GMT)
committerJouni Malinen <j@w1.fi>2020-05-03 08:58:54 (GMT)
commit674758ed5994daa0620b69dd7a610b2006b6efdb (patch)
tree34ef18ded165ad9252058dd1bfb5ffacf98c6b89
parenta7d6098fb455fd5c41c08d30bed5427472d4c368 (diff)
downloadhostap-674758ed5994daa0620b69dd7a610b2006b6efdb.zip
hostap-674758ed5994daa0620b69dd7a610b2006b6efdb.tar.gz
hostap-674758ed5994daa0620b69dd7a610b2006b6efdb.tar.bz2
tests: Provide digestmod to hmac.new() for Python 3.8
Python 3.8 removed the previously used default of MD5 algorithm, so provide the explicit digestmod=hashlib.md5 parameter to the couple of places that were missing it. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_eap_proto.py2
-rw-r--r--tests/hwsim/test_radius.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/hwsim/test_eap_proto.py b/tests/hwsim/test_eap_proto.py
index 59519bd..7494b42 100644
--- a/tests/hwsim/test_eap_proto.py
+++ b/tests/hwsim/test_eap_proto.py
@@ -106,7 +106,7 @@ def start_radius_server(eap_handler):
logger.info("No EAP request available")
reply.code = pyrad.packet.AccessChallenge
- hmac_obj = hmac.new(reply.secret)
+ hmac_obj = hmac.new(reply.secret, digestmod=hashlib.md5)
hmac_obj.update(struct.pack("B", reply.code))
hmac_obj.update(struct.pack("B", reply.id))
diff --git a/tests/hwsim/test_radius.py b/tests/hwsim/test_radius.py
index 84163f3..16a29ec 100644
--- a/tests/hwsim/test_radius.py
+++ b/tests/hwsim/test_radius.py
@@ -760,7 +760,7 @@ def test_radius_das_disconnect(dev, apdev):
def add_message_auth_req(req):
req.authenticator = req.CreateAuthenticator()
- hmac_obj = hmac.new(req.secret)
+ hmac_obj = hmac.new(req.secret, digestmod=hashlib.md5)
hmac_obj.update(struct.pack("B", req.code))
hmac_obj.update(struct.pack("B", req.id))
@@ -1046,7 +1046,7 @@ def test_radius_protocol(dev, apdev):
pw = b"incorrect"
else:
pw = reply.secret
- hmac_obj = hmac.new(pw)
+ hmac_obj = hmac.new(pw, digestmod=hashlib.md5)
hmac_obj.update(struct.pack("B", reply.code))
hmac_obj.update(struct.pack("B", reply.id))
@@ -1389,7 +1389,7 @@ def test_radius_auth_force_invalid_client_addr(dev, apdev):
def add_message_auth(req):
req.authenticator = req.CreateAuthenticator()
- hmac_obj = hmac.new(req.secret)
+ hmac_obj = hmac.new(req.secret, digestmod=hashlib.md5)
hmac_obj.update(struct.pack("B", req.code))
hmac_obj.update(struct.pack("B", req.id))