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 08:16:54 -0400 |
commit | a88b8c8c0f591a3bfa8d7984343a27815184f495 (patch) | |
tree | 85986bed44cc7148c461d6aa7736b627b83c24fb /paramiko/agent.py | |
parent | e299181a5dda25aed4879ebcbe1359604448b3ae (diff) | |
download | python-paramiko-a88b8c8c0f591a3bfa8d7984343a27815184f495.tar python-paramiko-a88b8c8c0f591a3bfa8d7984343a27815184f495.tar.gz |
Imported Upstream version 1.7.7.1upstream/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) |