summary refs log tree commit diff
path: root/synapse/util/manhole.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-11-01 21:31:46 +1100
committerAmber Brown <hawkowl@atleastfornow.net>2018-11-01 21:31:46 +1100
commit907e6da5be20523bd1d0a14c196289a73182aa65 (patch)
tree30e700dadabd415c169c3850aaf73aef817ef7e2 /synapse/util/manhole.py
parentMerge pull request #4072 from steamp0rt/patch-1 (diff)
parentchangelog (diff)
downloadsynapse-907e6da5be20523bd1d0a14c196289a73182aa65.tar.xz
Merge branch 'release-v0.33.8'
Diffstat (limited to 'synapse/util/manhole.py')
-rw-r--r--synapse/util/manhole.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/util/manhole.py b/synapse/util/manhole.py
index 8d0f2a8918..9cb7e9c9ab 100644
--- a/synapse/util/manhole.py
+++ b/synapse/util/manhole.py
@@ -70,6 +70,8 @@ def manhole(username, password, globals):
     Returns:
         twisted.internet.protocol.Factory: A factory to pass to ``listenTCP``
     """
+    if not isinstance(password, bytes):
+        password = password.encode('ascii')
 
     checker = checkers.InMemoryUsernamePasswordDatabaseDontUse(
         **{username: password}
@@ -82,7 +84,7 @@ def manhole(username, password, globals):
     )
 
     factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker]))
-    factory.publicKeys['ssh-rsa'] = Key.fromString(PUBLIC_KEY)
-    factory.privateKeys['ssh-rsa'] = Key.fromString(PRIVATE_KEY)
+    factory.publicKeys[b'ssh-rsa'] = Key.fromString(PUBLIC_KEY)
+    factory.privateKeys[b'ssh-rsa'] = Key.fromString(PRIVATE_KEY)
 
     return factory