From d425561a6754ebf855afe167ec0c7db06252b709 Mon Sep 17 00:00:00 2001 From: lyubomirtraykov Date: Tue, 18 Aug 2026 23:52:40 +0300 Subject: [PATCH 1/3] Update password validation logic in connection.py Refactor password validation to check for ASCII only. Authentication can be performed in 3 ways: * Without password, via IP of the device within the IP range enabled in the gateway * With numeric password (at least 5 characters) for gateways that use simple password * With alphanumeric password (from 5 to 16 characters) for the gateways that implement HMAC authentication (eg MHS1 or F454 with the HMAC option enabled) --- OWNd/connection.py | 1 - 1 file changed, 1 deletion(-) diff --git a/OWNd/connection.py b/OWNd/connection.py index 7716427..e027faa 100644 --- a/OWNd/connection.py +++ b/OWNd/connection.py @@ -547,7 +547,6 @@ async def _negotiate_exchange(self) -> dict: if self._gateway.password is not None and not ( isinstance(self._gateway.password, str) and self._gateway.password.isascii() - and self._gateway.password.isdecimal() ): self._logger.error( "%s Invalid OpenWebNet password: expected decimal digits only.", From 091999ef46d769984afbbaaec1bbd15b3d444bd9 Mon Sep 17 00:00:00 2001 From: lyubomirtraykov Date: Wed, 19 Aug 2026 00:05:04 +0300 Subject: [PATCH 2/3] Validate OpenWebNet password for alphanumeric characters Ensure OpenWebNet password is alphanumeric. --- OWNd/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OWNd/connection.py b/OWNd/connection.py index e027faa..48851fe 100644 --- a/OWNd/connection.py +++ b/OWNd/connection.py @@ -546,7 +546,7 @@ async def _negotiate_exchange(self) -> dict: if self._gateway.password is not None and not ( isinstance(self._gateway.password, str) - and self._gateway.password.isascii() + and self._gateway.password.isalnum() ): self._logger.error( "%s Invalid OpenWebNet password: expected decimal digits only.", From 7347bd69f7805d42e09da79aaef2ac6961226cc5 Mon Sep 17 00:00:00 2001 From: lyubomirtraykov Date: Wed, 19 Aug 2026 13:26:17 +0300 Subject: [PATCH 3/3] Fix error message for invalid OpenWebNet password --- OWNd/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OWNd/connection.py b/OWNd/connection.py index 48851fe..1fdff59 100644 --- a/OWNd/connection.py +++ b/OWNd/connection.py @@ -547,9 +547,10 @@ async def _negotiate_exchange(self) -> dict: if self._gateway.password is not None and not ( isinstance(self._gateway.password, str) and self._gateway.password.isalnum() + and len(self._gateway.password) <= 16 ): self._logger.error( - "%s Invalid OpenWebNet password: expected decimal digits only.", + "%s Invalid OpenWebNet password: expected alphanumerics only.", self._log_id, ) return {"Success": False, "Message": "password_error"}