コード例 #1
0
ファイル: gwssh.py プロジェクト: affix/supybot-plugins
 def auth_publickey(self, packet):
     NS = userauth.NS
     hasSig = ord(packet[0])
     algName, blob, rest = userauth.getNS(packet[1:], 2)
     pubKey = userauth.keys.getPublicKeyObject(data=blob)
     b = NS(self.transport.sessionID) + chr(userauth.MSG_USERAUTH_REQUEST) + \
         NS(self.user) + NS(self.nextService) + NS('publickey') + \
         chr(hasSig) +  NS(keys.objectType(pubKey)) + NS(blob)
     signature = hasSig and userauth.getNS(rest)[0] or None
     c = credentials.SSHPrivateKey(self.user, blob, b, signature)
     c.peer = self.transport.transport.getPeer().host
     return self.portal.login(c, None, self.USERCLASS).addErrback(
         self._ebCheckKey, packet[1:])
コード例 #2
0
ファイル: gwssh.py プロジェクト: D0MF/supybot-plugins-1
 def auth_publickey(self, packet):
     NS = userauth.NS
     hasSig = ord(packet[0])
     algName, blob, rest = userauth.getNS(packet[1:], 2)
     pubKey = userauth.keys.getPublicKeyObject(data = blob)
     b = NS(self.transport.sessionID) + chr(userauth.MSG_USERAUTH_REQUEST) + \
         NS(self.user) + NS(self.nextService) + NS('publickey') + \
         chr(hasSig) +  NS(keys.objectType(pubKey)) + NS(blob)
     signature = hasSig and userauth.getNS(rest)[0] or None
     c = credentials.SSHPrivateKey(self.user, blob, b, signature)
     c.peer = self.transport.transport.getPeer().host
     return self.portal.login(c, None, self.USERCLASS).addErrback(
                                                 self._ebCheckKey,
                                                 packet[1:])
コード例 #3
0
ファイル: gwssh.py プロジェクト: D0MF/supybot-plugins-1
 def auth_password(self, packet):
     password = userauth.getNS(packet[1:])[0]
     c = userauth.credentials.UsernamePassword(self.user, password)
     c.peer = self.transport.transport.getPeer().host
     return self.portal.login(c, None, self.USERCLASS).addErrback(
                                                 self._ebPassword)
コード例 #4
0
ファイル: gwssh.py プロジェクト: affix/supybot-plugins
 def auth_password(self, packet):
     password = userauth.getNS(packet[1:])[0]
     c = userauth.credentials.UsernamePassword(self.user, password)
     c.peer = self.transport.transport.getPeer().host
     return self.portal.login(c, None,
                              self.USERCLASS).addErrback(self._ebPassword)