diff --git a/front/plugins/fritzbox/fritzbox.py b/front/plugins/fritzbox/fritzbox.py index 08915ecb..af6b2fca 100755 --- a/front/plugins/fritzbox/fritzbox.py +++ b/front/plugins/fritzbox/fritzbox.py @@ -54,6 +54,7 @@ def get_fritzbox_connection(host, port, user, password, use_tls): user=user, password=password, use_tls=use_tls, + timeout=10, ) mylog('verbose', [f'[{pluginName}] Successfully connected to Fritz!Box']) @@ -188,7 +189,7 @@ def create_guest_wifi_device(fc): # The 02 prefix sets the locally-administered bit, ensuring no collision # with real OUI-assigned MACs. The remaining 5 bytes come from an MD5 # hash of the Fritz!Box MAC so the guest MAC is stable across runs. - digest = hashlib.md5(f'GUEST:{normalize_mac(fritzbox_mac)}'.encode()).digest() + digest = hashlib.md5(f'GUEST:{normalize_mac(fritzbox_mac)}'.encode(), usedforsecurity=False).digest() guest_mac = '02:' + ':'.join(f'{b:02x}' for b in digest[:5]) else: # Fallback if we can't get Fritz!Box MAC diff --git a/test/plugins/test_fritzbox.py b/test/plugins/test_fritzbox.py index 4a1d13a8..cddb2cea 100644 --- a/test/plugins/test_fritzbox.py +++ b/test/plugins/test_fritzbox.py @@ -304,7 +304,7 @@ class TestGetFritzboxConnection: assert result is fc_instance fc_class.assert_called_once_with( - address="fritz.box", port=49443, user="admin", password="pass", use_tls=True, + address="fritz.box", port=49443, user="admin", password="pass", use_tls=True, timeout=10, ) def test_import_error_returns_none(self):