From 7ac433a6ac7b2cdf8608e8571102d599a15febde Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 1 Aug 2006 11:20:53 -0700 Subject: [PATCH] [project @ robey@lag.net-20060801182053-a74d120228b8009a] use hexlify instead of custom-made hexify in demos --- demos/demo.py | 3 ++- demos/demo_server.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/demos/demo.py b/demos/demo.py index 8b496d8..cde75a6 100755 --- a/demos/demo.py +++ b/demos/demo.py @@ -20,6 +20,7 @@ import base64 +from binascii import hexlify import getpass import os import select @@ -45,7 +46,7 @@ def agent_auth(transport, username): return for key in agent_keys: - print 'Trying ssh-agent key %s' % paramiko.util.hexify(key.get_fingerprint()), + print 'Trying ssh-agent key %s' % hexlify(key.get_fingerprint()), try: transport.auth_publickey(username, key) print '... success!' diff --git a/demos/demo_server.py b/demos/demo_server.py index 345a12f..83ff399 100644 --- a/demos/demo_server.py +++ b/demos/demo_server.py @@ -19,6 +19,7 @@ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. import base64 +from binascii import hexlify import os import socket import sys @@ -34,7 +35,7 @@ paramiko.util.log_to_file('demo_server.log') host_key = paramiko.RSAKey(filename='test_rsa.key') #host_key = paramiko.DSSKey(filename='test_dss.key') -print 'Read key: ' + paramiko.util.hexify(host_key.get_fingerprint()) +print 'Read key: ' + hexlify(host_key.get_fingerprint()) class Server (paramiko.ServerInterface): @@ -60,7 +61,7 @@ class Server (paramiko.ServerInterface): return paramiko.AUTH_FAILED def check_auth_publickey(self, username, key): - print 'Auth attempt with key: ' + paramiko.util.hexify(key.get_fingerprint()) + print 'Auth attempt with key: ' + hexlify(key.get_fingerprint()) if (username == 'robey') and (key == self.good_pub_key): return paramiko.AUTH_SUCCESSFUL return paramiko.AUTH_FAILED