Merge lp:~twom/lazr.sshserver/python3-turnip into lp:~cjwatson/lazr.sshserver/python3

Proposed by Tom Wardill
Status: Merged
Merged at revision: 89
Proposed branch: lp:~twom/lazr.sshserver/python3-turnip
Merge into: lp:~cjwatson/lazr.sshserver/python3
Diff against target: 95 lines (+15/-15)
3 files modified
src/lazr/sshserver/auth.py (+7/-7)
src/lazr/sshserver/service.py (+1/-1)
src/lazr/sshserver/tests/test_auth.py (+7/-7)
To merge this branch: bzr merge lp:~twom/lazr.sshserver/python3-turnip
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+361063@code.launchpad.net

Commit message

Required fixes for turnip

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/lazr/sshserver/auth.py'
--- src/lazr/sshserver/auth.py 2018-07-04 11:52:47 +0000
+++ src/lazr/sshserver/auth.py 2018-12-18 11:51:31 +0000
@@ -99,9 +99,9 @@
9999
100 # Set the only channel as a standard SSH session (with a couple of bug100 # Set the only channel as a standard SSH session (with a couple of bug
101 # fixes).101 # fixes).
102 self.channelLookup = {'session': PatchedSSHSession}102 self.channelLookup = {b'session': PatchedSSHSession}
103 # ...and set the only subsystem to be SFTP.103 # ...and set the only subsystem to be SFTP.
104 self.subsystemLookup = {'sftp': FileTransferServer}104 self.subsystemLookup = {b'sftp': FileTransferServer}
105105
106 def logout(self):106 def logout(self):
107 notify(events.UserLoggedOut(self))107 notify(events.UserLoggedOut(self))
@@ -182,7 +182,7 @@
182 self._configured_banner_sent = False182 self._configured_banner_sent = False
183 self._mind = UserDetailsMind()183 self._mind = UserDetailsMind()
184 self.interfaceToMethod = userauth.SSHUserAuthServer.interfaceToMethod184 self.interfaceToMethod = userauth.SSHUserAuthServer.interfaceToMethod
185 self.interfaceToMethod[ISSHPrivateKeyWithMind] = 'publickey'185 self.interfaceToMethod[ISSHPrivateKeyWithMind] = b'publickey'
186186
187 def sendBanner(self, text, language='en'):187 def sendBanner(self, text, language='en'):
188 bytes = b'\r\n'.join(text.encode('UTF8').splitlines() + [b''])188 bytes = b'\r\n'.join(text.encode('UTF8').splitlines() + [b''])
@@ -331,13 +331,13 @@
331331
332 def _checkForAuthorizedKey(self, user_dict, credentials):332 def _checkForAuthorizedKey(self, user_dict, credentials):
333 """Check the key data in credentials against the keys found in LP."""333 """Check the key data in credentials against the keys found in LP."""
334 if credentials.algName == 'ssh-dss':334 if credentials.algName == b'ssh-dss':
335 wantKeyType = 'DSA'335 wantKeyType = 'DSA'
336 elif credentials.algName == 'ssh-rsa':336 elif credentials.algName == b'ssh-rsa':
337 wantKeyType = 'RSA'337 wantKeyType = 'RSA'
338 elif credentials.algName.startswith('ecdsa-sha2-'):338 elif credentials.algName.startswith(b'ecdsa-sha2-'):
339 wantKeyType = 'ECDSA'339 wantKeyType = 'ECDSA'
340 elif credentials.algName == 'ssh-ed25519':340 elif credentials.algName == b'ssh-ed25519':
341 wantKeyType = 'ED25519'341 wantKeyType = 'ED25519'
342 else:342 else:
343 # unknown key type343 # unknown key type
344344
=== modified file 'src/lazr/sshserver/service.py'
--- src/lazr/sshserver/service.py 2018-12-18 09:46:55 +0000
+++ src/lazr/sshserver/service.py 2018-12-18 11:51:31 +0000
@@ -92,7 +92,7 @@
92 # at it. (Look for the beautiful line "self.portal =92 # at it. (Look for the beautiful line "self.portal =
93 # self.transport.factory.portal").93 # self.transport.factory.portal").
94 self.portal = portal94 self.portal = portal
95 self.services['ssh-userauth'] = self._makeAuthServer95 self.services[b'ssh-userauth'] = self._makeAuthServer
96 self._private_key = private_key96 self._private_key = private_key
97 self._public_key = public_key97 self._public_key = public_key
98 self._banner = banner98 self._banner = banner
9999
=== modified file 'src/lazr/sshserver/tests/test_auth.py'
--- src/lazr/sshserver/tests/test_auth.py 2018-07-04 11:53:22 +0000
+++ src/lazr/sshserver/tests/test_auth.py 2018-12-18 11:51:31 +0000
@@ -488,10 +488,10 @@
488 # Attempting to log in with a username and key known to the488 # Attempting to log in with a username and key known to the
489 # authentication end-point succeeds.489 # authentication end-point succeeds.
490 for key_type, public_key in (490 for key_type, public_key in (
491 ('ssh-rsa', self.authserver.valid_key_rsa),491 (b'ssh-rsa', self.authserver.valid_key_rsa),
492 ('ssh-dss', self.authserver.valid_key_dsa),492 (b'ssh-dss', self.authserver.valid_key_dsa),
493 ('ecdsa-sha2-nistp256', self.authserver.valid_key_ecdsa),493 (b'ecdsa-sha2-nistp256', self.authserver.valid_key_ecdsa),
494 ('ssh-ed25519', self.authserver.valid_key_ed25519),494 (b'ssh-ed25519', self.authserver.valid_key_ed25519),
495 ):495 ):
496 creds = self.makeCredentials(496 creds = self.makeCredentials(
497 self.authserver.valid_user, key_type, public_key)497 self.authserver.valid_user, key_type, public_key)
@@ -550,7 +550,7 @@
550 # server informs you that the account has no keys.550 # server informs you that the account has no keys.
551 checker = self.makeChecker()551 checker = self.makeChecker()
552 creds = self.makeCredentials(552 creds = self.makeCredentials(
553 self.authserver.no_key_user, 'ssh-dss',553 self.authserver.no_key_user, b'ssh-dss',
554 self.authserver.valid_key_dsa)554 self.authserver.valid_key_dsa)
555 return self.assertLoginError(555 return self.assertLoginError(
556 checker, creds,556 checker, creds,
@@ -600,9 +600,9 @@
600 checker = self.makeChecker()600 checker = self.makeChecker()
601 mind = auth.UserDetailsMind()601 mind = auth.UserDetailsMind()
602 wrong_key_creds = self.makeCredentials(602 wrong_key_creds = self.makeCredentials(
603 self.authserver.valid_user, 'ssh-dss', 'invalid key', mind)603 self.authserver.valid_user, b'ssh-dss', 'invalid key', mind)
604 right_key_creds = self.makeCredentials(604 right_key_creds = self.makeCredentials(
605 self.authserver.valid_user, 'ssh-dss',605 self.authserver.valid_user, b'ssh-dss',
606 self.authserver.valid_key_dsa, mind)606 self.authserver.valid_key_dsa, mind)
607 try:607 try:
608 username = yield checker.requestAvatarId(wrong_key_creds)608 username = yield checker.requestAvatarId(wrong_key_creds)

Subscribers

People subscribed via source and target branches

to all changes: