diff options
author | Jeremy T. Bouse <jbouse@debian.org> | 2011-05-29 08:16:54 -0400 |
---|---|---|
committer | Jeremy T. Bouse <jbouse@debian.org> | 2011-05-29 10:15:03 -0400 |
commit | be5542c05e46b500e47b94bc8a6254cae8335a8b (patch) | |
tree | 1d13e6d43698839fb5fedc9a685cc5f634b4bacf /paramiko/agent.py | |
parent | 5952c8ac9aff9f0bf1fe295d9ed5c6ec1656d819 (diff) | |
download | python-paramiko-be5542c05e46b500e47b94bc8a6254cae8335a8b.tar python-paramiko-be5542c05e46b500e47b94bc8a6254cae8335a8b.tar.gz |
Imported Upstream version 1.7.7.1
Diffstat (limited to 'paramiko/agent.py')
-rw-r--r-- | paramiko/agent.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py index 71de8b8..3bb9426 100644 --- a/paramiko/agent.py +++ b/paramiko/agent.py @@ -55,6 +55,7 @@ class Agent: @raise SSHException: if an SSH agent is found, but speaks an incompatible protocol """ + self.conn = None self.keys = () if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'): conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) @@ -87,7 +88,8 @@ class Agent: """ Close the SSH agent connection. """ - self.conn.close() + if self.conn is not None: + self.conn.close() self.conn = None self.keys = () @@ -139,7 +141,7 @@ class AgentKey(PKey): def get_name(self): return self.name - def sign_ssh_data(self, randpool, data): + def sign_ssh_data(self, rng, data): msg = Message() msg.add_byte(chr(SSH2_AGENTC_SIGN_REQUEST)) msg.add_string(self.blob) |