--- a/connectors/PYRO/PSK_Adapter.py Mon Oct 15 16:26:59 2018 +0200
+++ b/connectors/PYRO/PSK_Adapter.py Thu Oct 18 11:01:14 2018 +0200
@@ -1,4 +1,7 @@
+from __future__ import absolute_import +from __future__ import print_function from Pyro.protocol import _connect_socket,TCPConnection,PYROAdapter
@@ -22,7 +25,8 @@
raw_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
_connect_socket(raw_sock, URI.address, URI.port, self.timeout)
sock = sslpsk.wrap_socket(
- raw_sock, psk=Pyro.config.PYROPSK, server_side=False)
+ raw_sock, psk=Pyro.config.PYROPSK, server_side=False, + ciphers="PSK-AES256-GCM-SHA384:PSK-AES256-CBC-SHA") # all the rest is the same as in Pyro/protocol.py
conn=TCPConnection(sock, sock.getpeername())
--- a/connectors/PYRO/__init__.py Mon Oct 15 16:26:59 2018 +0200
+++ b/connectors/PYRO/__init__.py Thu Oct 18 11:01:14 2018 +0200
@@ -36,7 +36,7 @@
from Pyro.errors import PyroError
-service_type = '_PYRO._tcp.local.'
+zeroconf_service_type = '_PYRO._tcp.local.' # this module attribute contains a list of DNS-SD (Zeroconf) service types
# supported by this connector confnode.
@@ -53,23 +53,25 @@
servicetype, location = uri.split("://")
if servicetype == "PYROS":
import connectors.PYRO.PSK_Adapter
- schemename = "PYROLOCPSK"
- urlpath, ID = location.split('#')
+ url, ID = location.split('#') secpath = os.path.join(str(confnodesroot.ProjectPath), 'psk', ID+'.secret')
if not os.path.exists(secpath):
confnodesroot.logger.write_error(
'Error: Pre-Shared-Key Secret in %s is missing!\n' % secpath)
- Pyro.config.PYROPSK = open(secpath).read()
+ Pyro.config.PYROPSK = (open(secpath).read(), ID) + # strip ID from URL, so that pyro can understand it. - if location.find(service_type) != -1:
+ if location.find(zeroconf_service_type) != -1: from zeroconf import Zeroconf
- i = r.get_service_info(service_type, location)
+ i = r.get_service_info(zeroconf_service_type, location) raise Exception("'%s' not found" % location)
ip = str(socket.inet_ntoa(i.address))