aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/client/agent.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/client/agent.py')
-rwxr-xr-xlib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/client/agent.py73
1 files changed, 0 insertions, 73 deletions
diff --git a/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/client/agent.py b/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/client/agent.py
deleted file mode 100755
index 50a8feaa..00000000
--- a/lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/client/agent.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- test-case-name: twisted.conch.test.test_default -*-
-# Copyright (c) Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-"""
-Accesses the key agent for user authentication.
-
-Maintainer: Paul Swartz
-"""
-
-import os
-
-from twisted.conch.ssh import agent, channel, keys
-from twisted.internet import protocol, reactor
-from twisted.python import log
-
-
-
-class SSHAgentClient(agent.SSHAgentClient):
-
- def __init__(self):
- agent.SSHAgentClient.__init__(self)
- self.blobs = []
-
-
- def getPublicKeys(self):
- return self.requestIdentities().addCallback(self._cbPublicKeys)
-
-
- def _cbPublicKeys(self, blobcomm):
- log.msg('got %i public keys' % len(blobcomm))
- self.blobs = [x[0] for x in blobcomm]
-
-
- def getPublicKey(self):
- """
- Return a L{Key} from the first blob in C{self.blobs}, if any, or
- return C{None}.
- """
- if self.blobs:
- return keys.Key.fromString(self.blobs.pop(0))
- return None
-
-
-
-class SSHAgentForwardingChannel(channel.SSHChannel):
-
- def channelOpen(self, specificData):
- cc = protocol.ClientCreator(reactor, SSHAgentForwardingLocal)
- d = cc.connectUNIX(os.environ['SSH_AUTH_SOCK'])
- d.addCallback(self._cbGotLocal)
- d.addErrback(lambda x:self.loseConnection())
- self.buf = ''
-
-
- def _cbGotLocal(self, local):
- self.local = local
- self.dataReceived = self.local.transport.write
- self.local.dataReceived = self.write
-
-
- def dataReceived(self, data):
- self.buf += data
-
-
- def closed(self):
- if self.local:
- self.local.loseConnection()
- self.local = None
-
-
-class SSHAgentForwardingLocal(protocol.Protocol):
- pass