Initial rename: paramiko=>ssh
This commit is contained in:
parent
7bcbc24198
commit
3971917d2b
|
@ -1,7 +1,7 @@
|
|||
*.pyc
|
||||
./build
|
||||
./paramiko.egg-info
|
||||
./ssh.egg-info
|
||||
./dist
|
||||
./.project
|
||||
./paramiko.tmproj
|
||||
./ssh.tmproj
|
||||
./test.log
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
*.pyc
|
||||
build/
|
||||
dist/
|
||||
paramiko.egg-info/
|
||||
ssh.egg-info/
|
||||
|
|
480
ChangeLog.1
480
ChangeLog.1
File diff suppressed because it is too large
Load Diff
12
Makefile
12
Makefile
|
@ -46,21 +46,21 @@ release: docs
|
|||
python ./setup.py sdist --formats=gztar
|
||||
python ./setup.py bdist_egg
|
||||
zip -r dist/docs.zip docs && rm -rf docs
|
||||
cd dist && $(MD5SUM) paramiko*.zip *.gz > md5-sums
|
||||
cd dist && gpg -ba paramiko*.zip
|
||||
cd dist && gpg -ba paramiko*.gz
|
||||
cd dist && $(MD5SUM) ssh*.zip *.gz > md5-sums
|
||||
cd dist && gpg -ba ssh*.zip
|
||||
cd dist && gpg -ba ssh*.gz
|
||||
|
||||
|
||||
docs: always
|
||||
epydoc --no-private -o docs/ paramiko
|
||||
epydoc --no-private -o docs/ ssh
|
||||
always:
|
||||
|
||||
clean:
|
||||
rm -rf build dist docs
|
||||
rm -f MANIFEST *.log demos/*.log
|
||||
rm -f paramiko/*.pyc
|
||||
rm -f ssh/*.pyc
|
||||
rm -f test.log
|
||||
rm -rf paramiko.egg-info
|
||||
rm -rf ssh.egg-info
|
||||
|
||||
test:
|
||||
python ./test.py
|
||||
|
|
4
NEWS
4
NEWS
|
@ -225,7 +225,7 @@ v1.3.1 (nidoran) 28jun05
|
|||
* added Transport.open_sftp_client() for convenience
|
||||
* refactored packetizing out of Transport
|
||||
* fixed bug (reported by alain s.) where connecting to a non-SSH host could
|
||||
cause paramiko to freeze up
|
||||
cause ssh to freeze up
|
||||
* fixed Channel.fileno() for Windows (again)
|
||||
* some more unit tests
|
||||
|
||||
|
@ -321,7 +321,7 @@ v0.9 (fearow) 23apr04
|
|||
* Transport.get_remove_server_key() now returns a PKey object instead of a
|
||||
tuple of strings
|
||||
* Transport.get_username() -- return the username you auth'd as [client]
|
||||
* Transport.set_keepalive() -- makes paramiko send periodic junk packets
|
||||
* Transport.set_keepalive() -- makes ssh send periodic junk packets
|
||||
to the remote host, to keep the session active
|
||||
* python 2.2 support (thanks to Roger Binns)
|
||||
* misc. bug fixes
|
||||
|
|
21
README
21
README
|
@ -1,15 +1,15 @@
|
|||
|
||||
========
|
||||
paramiko
|
||||
ssh
|
||||
========
|
||||
|
||||
:Paramiko: Python SSH module
|
||||
:'ssh': Python SSH module
|
||||
:Copyright: Copyright (c) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
:License: LGPL
|
||||
:Homepage: http://www.lag.net/paramiko/
|
||||
|
||||
|
||||
paramiko 1.7.7.1
|
||||
ssh 1.7.7.1
|
||||
================
|
||||
|
||||
"George" release, 21 may 2011
|
||||
|
@ -18,8 +18,7 @@ paramiko 1.7.7.1
|
|||
What
|
||||
----
|
||||
|
||||
"paramiko" is a combination of the esperanto words for "paranoid" and
|
||||
"friend". it's a module for python 2.2+ that implements the SSH2 protocol
|
||||
"ssh" is a module for python 2.2+ that implements the SSH2 protocol
|
||||
for secure (encrypted and authenticated) connections to remote machines.
|
||||
unlike SSL (aka TLS), SSH2 protocol does not require hierarchical
|
||||
certificates signed by a powerful central authority. you may know SSH2 as
|
||||
|
@ -42,7 +41,7 @@ Requirements
|
|||
(python 2.2 is also supported, but not recommended)
|
||||
- pycrypto 2.1 or better <https://www.dlitz.net/software/pycrypto/>
|
||||
|
||||
If you have setuptools, you can build and install paramiko and all its
|
||||
If you have setuptools, you can build and install ssh and all its
|
||||
dependencies with this command (as root)::
|
||||
|
||||
easy_install ./
|
||||
|
@ -62,7 +61,7 @@ watch out for:
|
|||
|
||||
* sockets in 2.2 don't support timeouts, so the 'select' module is
|
||||
imported to do polling.
|
||||
* logging is mostly stubbed out. it works just enough to let paramiko
|
||||
* logging is mostly stubbed out. it works just enough to let ssh
|
||||
create log files for debugging, if you want them. to get real logging,
|
||||
you can backport python 2.3's logging package. Roger has done that
|
||||
already:
|
||||
|
@ -99,12 +98,12 @@ there's also a low-traffic mailing list for support and discussions:
|
|||
Demo
|
||||
----
|
||||
|
||||
several demo scripts come with paramiko to demonstrate how to use it.
|
||||
several demo scripts come with ssh to demonstrate how to use it.
|
||||
probably the simplest demo of all is this::
|
||||
|
||||
import paramiko, base64
|
||||
key = paramiko.RSAKey(data=base64.decodestring('AAA...'))
|
||||
client = paramiko.SSHClient()
|
||||
import ssh, base64
|
||||
key = ssh.RSAKey(data=base64.decodestring('AAA...'))
|
||||
client = ssh.SSHClient()
|
||||
client.get_host_keys().add('ssh.example.com', 'ssh-rsa', key)
|
||||
client.connect('ssh.example.com', username='strongbad', password='thecheat')
|
||||
stdin, stdout, stderr = client.exec_command('ls')
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
|
||||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ import threading
|
|||
import time
|
||||
import traceback
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
import interactive
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ def agent_auth(transport, username):
|
|||
keys available from an SSH agent.
|
||||
"""
|
||||
|
||||
agent = paramiko.Agent()
|
||||
agent = ssh.Agent()
|
||||
agent_keys = agent.get_keys()
|
||||
if len(agent_keys) == 0:
|
||||
return
|
||||
|
@ -51,7 +51,7 @@ def agent_auth(transport, username):
|
|||
transport.auth_publickey(username, key)
|
||||
print '... success!'
|
||||
return
|
||||
except paramiko.SSHException:
|
||||
except ssh.SSHException:
|
||||
print '... nope.'
|
||||
|
||||
|
||||
|
@ -67,10 +67,10 @@ def manual_auth(username, hostname):
|
|||
if len(path) == 0:
|
||||
path = default_path
|
||||
try:
|
||||
key = paramiko.RSAKey.from_private_key_file(path)
|
||||
except paramiko.PasswordRequiredException:
|
||||
key = ssh.RSAKey.from_private_key_file(path)
|
||||
except ssh.PasswordRequiredException:
|
||||
password = getpass.getpass('RSA key password: ')
|
||||
key = paramiko.RSAKey.from_private_key_file(path, password)
|
||||
key = ssh.RSAKey.from_private_key_file(path, password)
|
||||
t.auth_publickey(username, key)
|
||||
elif auth == 'd':
|
||||
default_path = os.path.join(os.environ['HOME'], '.ssh', 'id_dsa')
|
||||
|
@ -78,10 +78,10 @@ def manual_auth(username, hostname):
|
|||
if len(path) == 0:
|
||||
path = default_path
|
||||
try:
|
||||
key = paramiko.DSSKey.from_private_key_file(path)
|
||||
except paramiko.PasswordRequiredException:
|
||||
key = ssh.DSSKey.from_private_key_file(path)
|
||||
except ssh.PasswordRequiredException:
|
||||
password = getpass.getpass('DSS key password: ')
|
||||
key = paramiko.DSSKey.from_private_key_file(path, password)
|
||||
key = ssh.DSSKey.from_private_key_file(path, password)
|
||||
t.auth_publickey(username, key)
|
||||
else:
|
||||
pw = getpass.getpass('Password for %s@%s: ' % (username, hostname))
|
||||
|
@ -89,7 +89,7 @@ def manual_auth(username, hostname):
|
|||
|
||||
|
||||
# setup logging
|
||||
paramiko.util.log_to_file('demo.log')
|
||||
ssh.util.log_to_file('demo.log')
|
||||
|
||||
username = ''
|
||||
if len(sys.argv) > 1:
|
||||
|
@ -116,18 +116,18 @@ except Exception, e:
|
|||
sys.exit(1)
|
||||
|
||||
try:
|
||||
t = paramiko.Transport(sock)
|
||||
t = ssh.Transport(sock)
|
||||
try:
|
||||
t.start_client()
|
||||
except paramiko.SSHException:
|
||||
except ssh.SSHException:
|
||||
print '*** SSH negotiation failed.'
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
keys = paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
|
||||
keys = ssh.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
|
||||
except IOError:
|
||||
try:
|
||||
keys = paramiko.util.load_host_keys(os.path.expanduser('~/ssh/known_hosts'))
|
||||
keys = ssh.util.load_host_keys(os.path.expanduser('~/ssh/known_hosts'))
|
||||
except IOError:
|
||||
print '*** Unable to open host keys file'
|
||||
keys = {}
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
|
||||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
import base64
|
||||
|
@ -26,45 +26,45 @@ import sys
|
|||
import threading
|
||||
import traceback
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
|
||||
# setup logging
|
||||
paramiko.util.log_to_file('demo_server.log')
|
||||
ssh.util.log_to_file('demo_server.log')
|
||||
|
||||
host_key = paramiko.RSAKey(filename='test_rsa.key')
|
||||
#host_key = paramiko.DSSKey(filename='test_dss.key')
|
||||
host_key = ssh.RSAKey(filename='test_rsa.key')
|
||||
#host_key = ssh.DSSKey(filename='test_dss.key')
|
||||
|
||||
print 'Read key: ' + hexlify(host_key.get_fingerprint())
|
||||
|
||||
|
||||
class Server (paramiko.ServerInterface):
|
||||
class Server (ssh.ServerInterface):
|
||||
# 'data' is the output of base64.encodestring(str(key))
|
||||
# (using the "user_rsa_key" files)
|
||||
data = 'AAAAB3NzaC1yc2EAAAABIwAAAIEAyO4it3fHlmGZWJaGrfeHOVY7RWO3P9M7hp' + \
|
||||
'fAu7jJ2d7eothvfeuoRFtJwhUmZDluRdFyhFY/hFAh76PJKGAusIqIQKlkJxMC' + \
|
||||
'KDqIexkgHAfID/6mqvmnSJf0b5W8v5h2pI/stOSwTQ+pxVhwJ9ctYDhRSlF0iT' + \
|
||||
'UWT10hcuO4Ks8='
|
||||
good_pub_key = paramiko.RSAKey(data=base64.decodestring(data))
|
||||
good_pub_key = ssh.RSAKey(data=base64.decodestring(data))
|
||||
|
||||
def __init__(self):
|
||||
self.event = threading.Event()
|
||||
|
||||
def check_channel_request(self, kind, chanid):
|
||||
if kind == 'session':
|
||||
return paramiko.OPEN_SUCCEEDED
|
||||
return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
return ssh.OPEN_SUCCEEDED
|
||||
return ssh.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
|
||||
def check_auth_password(self, username, password):
|
||||
if (username == 'robey') and (password == 'foo'):
|
||||
return paramiko.AUTH_SUCCESSFUL
|
||||
return paramiko.AUTH_FAILED
|
||||
return ssh.AUTH_SUCCESSFUL
|
||||
return ssh.AUTH_FAILED
|
||||
|
||||
def check_auth_publickey(self, username, key):
|
||||
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
|
||||
return ssh.AUTH_SUCCESSFUL
|
||||
return ssh.AUTH_FAILED
|
||||
|
||||
def get_allowed_auths(self, username):
|
||||
return 'password,publickey'
|
||||
|
@ -100,7 +100,7 @@ except Exception, e:
|
|||
print 'Got a connection!'
|
||||
|
||||
try:
|
||||
t = paramiko.Transport(client)
|
||||
t = ssh.Transport(client)
|
||||
try:
|
||||
t.load_server_moduli()
|
||||
except:
|
||||
|
@ -110,7 +110,7 @@ try:
|
|||
server = Server()
|
||||
try:
|
||||
t.start_server(server=server)
|
||||
except paramiko.SSHException, x:
|
||||
except ssh.SSHException, x:
|
||||
print '*** SSH negotiation failed.'
|
||||
sys.exit(1)
|
||||
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
|
||||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
# based on code provided by raymond mosteller (thanks!)
|
||||
|
@ -27,11 +27,11 @@ import socket
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
|
||||
# setup logging
|
||||
paramiko.util.log_to_file('demo_sftp.log')
|
||||
ssh.util.log_to_file('demo_sftp.log')
|
||||
|
||||
# get hostname
|
||||
username = ''
|
||||
|
@ -63,11 +63,11 @@ password = getpass.getpass('Password for %s@%s: ' % (username, hostname))
|
|||
hostkeytype = None
|
||||
hostkey = None
|
||||
try:
|
||||
host_keys = paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
|
||||
host_keys = ssh.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
|
||||
except IOError:
|
||||
try:
|
||||
# try ~/ssh/ too, because windows can't have a folder named ~/.ssh/
|
||||
host_keys = paramiko.util.load_host_keys(os.path.expanduser('~/ssh/known_hosts'))
|
||||
host_keys = ssh.util.load_host_keys(os.path.expanduser('~/ssh/known_hosts'))
|
||||
except IOError:
|
||||
print '*** Unable to open host keys file'
|
||||
host_keys = {}
|
||||
|
@ -78,11 +78,11 @@ if host_keys.has_key(hostname):
|
|||
print 'Using host key of type %s' % hostkeytype
|
||||
|
||||
|
||||
# now, connect and use paramiko Transport to negotiate SSH2 across the connection
|
||||
# now, connect and use ssh Transport to negotiate SSH2 across the connection
|
||||
try:
|
||||
t = paramiko.Transport((hostname, port))
|
||||
t = ssh.Transport((hostname, port))
|
||||
t.connect(username=username, password=password, hostkey=hostkey)
|
||||
sftp = paramiko.SFTPClient.from_transport(t)
|
||||
sftp = ssh.SFTPClient.from_transport(t)
|
||||
|
||||
# dirlist on remote host
|
||||
dirlist = sftp.listdir('.')
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
|
||||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
|
||||
|
@ -26,12 +26,12 @@ import socket
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
import interactive
|
||||
|
||||
|
||||
# setup logging
|
||||
paramiko.util.log_to_file('demo_simple.log')
|
||||
ssh.util.log_to_file('demo_simple.log')
|
||||
|
||||
# get hostname
|
||||
username = ''
|
||||
|
@ -59,11 +59,11 @@ if username == '':
|
|||
password = getpass.getpass('Password for %s@%s: ' % (username, hostname))
|
||||
|
||||
|
||||
# now, connect and use paramiko Client to negotiate SSH2 across the connection
|
||||
# now, connect and use ssh Client to negotiate SSH2 across the connection
|
||||
try:
|
||||
client = paramiko.SSHClient()
|
||||
client = ssh.SSHClient()
|
||||
client.load_system_host_keys()
|
||||
client.set_missing_host_key_policy(paramiko.WarningPolicy)
|
||||
client.set_missing_host_key_policy(ssh.WarningPolicy)
|
||||
print '*** Connecting...'
|
||||
client.connect(hostname, port, username, password)
|
||||
chan = client.invoke_shell()
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
|
||||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
Sample script showing how to do local port forwarding over paramiko.
|
||||
Sample script showing how to do local port forwarding over ssh.
|
||||
|
||||
This script connects to the requested SSH server and sets up local port
|
||||
forwarding (the openssh -L option) from a local port through a tunneled
|
||||
|
@ -34,7 +34,7 @@ import SocketServer
|
|||
import sys
|
||||
from optparse import OptionParser
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
SSH_PORT = 22
|
||||
DEFAULT_PORT = 4000
|
||||
|
@ -100,7 +100,7 @@ def verbose(s):
|
|||
|
||||
|
||||
HELP = """\
|
||||
Set up a forward tunnel across an SSH server, using paramiko. A local port
|
||||
Set up a forward tunnel across an SSH server, using ssh. A local port
|
||||
(given with -p) is forwarded across an SSH session to an address:port from
|
||||
the SSH server. This is similar to the openssh -L option.
|
||||
"""
|
||||
|
@ -155,9 +155,9 @@ def main():
|
|||
if options.readpass:
|
||||
password = getpass.getpass('Enter SSH password: ')
|
||||
|
||||
client = paramiko.SSHClient()
|
||||
client = ssh.SSHClient()
|
||||
client.load_system_host_keys()
|
||||
client.set_missing_host_key_policy(paramiko.WarningPolicy())
|
||||
client.set_missing_host_key_policy(ssh.WarningPolicy())
|
||||
|
||||
verbose('Connecting to ssh host %s:%d ...' % (server[0], server[1]))
|
||||
try:
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
|
||||
# Copyright (C) 2008 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
Sample script showing how to do remote port forwarding over paramiko.
|
||||
Sample script showing how to do remote port forwarding over ssh.
|
||||
|
||||
This script connects to the requested SSH server and sets up remote port
|
||||
forwarding (the openssh -R option) from a remote port through a tunneled
|
||||
|
@ -34,7 +34,7 @@ import sys
|
|||
import threading
|
||||
from optparse import OptionParser
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
SSH_PORT = 22
|
||||
DEFAULT_PORT = 4000
|
||||
|
@ -86,7 +86,7 @@ def verbose(s):
|
|||
|
||||
|
||||
HELP = """\
|
||||
Set up a reverse forwarding tunnel across an SSH server, using paramiko. A
|
||||
Set up a reverse forwarding tunnel across an SSH server, using ssh. A
|
||||
port on the SSH server (given with -p) is forwarded across an SSH session
|
||||
back to the local machine, and out to a remote site reachable from this
|
||||
network. This is similar to the openssh -R option.
|
||||
|
@ -142,9 +142,9 @@ def main():
|
|||
if options.readpass:
|
||||
password = getpass.getpass('Enter SSH password: ')
|
||||
|
||||
client = paramiko.SSHClient()
|
||||
client = ssh.SSHClient()
|
||||
client.load_system_host_keys()
|
||||
client.set_missing_host_key_policy(paramiko.WarningPolicy())
|
||||
client.set_missing_host_key_policy(ssh.WarningPolicy())
|
||||
|
||||
verbose('Connecting to ssh host %s:%d ...' % (server[0], server[1]))
|
||||
try:
|
||||
|
|
Binary file not shown.
14
setup.py
14
setup.py
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2008 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
|
||||
|
@ -47,13 +47,13 @@ if sys.platform == 'darwin':
|
|||
setup_helper.install_custom_make_tarball()
|
||||
|
||||
|
||||
setup(name = "paramiko",
|
||||
setup(name = "ssh",
|
||||
version = "1.7.7.1",
|
||||
description = "SSH2 protocol library",
|
||||
author = "Robey Pointer",
|
||||
author_email = "robeypointer@gmail.com",
|
||||
url = "http://www.lag.net/paramiko/",
|
||||
packages = [ 'paramiko' ],
|
||||
url = "http://www.lag.net/ssh/",
|
||||
packages = [ 'ssh' ],
|
||||
license = 'LGPL',
|
||||
platforms = 'Posix; MacOS X; Windows',
|
||||
classifiers = [ 'Development Status :: 5 - Production/Stable',
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
# Note: Despite the copyright notice, this was submitted by John
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
# Copyright (C) 2003-2011 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
I{Paramiko} (a combination of the esperanto words for "paranoid" and "friend")
|
||||
I{'ssh'} (a combination of the esperanto words for "paranoid" and "friend")
|
||||
is a module for python 2.3 or greater that implements the SSH2 protocol for
|
||||
secure (encrypted and authenticated) connections to remote machines. Unlike
|
||||
SSL (aka TLS), the SSH2 protocol does not require hierarchical certificates
|
||||
|
@ -32,7 +32,7 @@ L{Transport}, and use L{start_server <Transport.start_server>} or
|
|||
L{start_client <Transport.start_client>} to negoatite
|
||||
with the remote host as either a server or client. As a client, you are
|
||||
responsible for authenticating using a password or private key, and checking
|
||||
the server's host key. I{(Key signature and verification is done by paramiko,
|
||||
the server's host key. I{(Key signature and verification is done by ssh,
|
||||
but you will need to provide private keys and check that the content of a
|
||||
public key matches what you expected to see.)} As a server, you are
|
||||
responsible for deciding which users, passwords, and keys to allow, and what
|
||||
|
@ -42,10 +42,10 @@ Once you have finished, either side may request flow-controlled L{Channel}s to
|
|||
the other side, which are python objects that act like sockets, but send and
|
||||
receive data over the encrypted session.
|
||||
|
||||
Paramiko is written entirely in python (no C or platform-dependent code) and is
|
||||
'ssh' is written entirely in python (no C or platform-dependent code) and is
|
||||
released under the GNU Lesser General Public License (LGPL).
|
||||
|
||||
Website: U{http://www.lag.net/paramiko/}
|
||||
Website: U{http://www.lag.net/ssh/}
|
||||
|
||||
@version: 1.7.7.1 (George)
|
||||
@author: Robey Pointer
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 John Rochester <john@jrochester.org>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -25,9 +25,9 @@ import socket
|
|||
import struct
|
||||
import sys
|
||||
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from paramiko.message import Message
|
||||
from paramiko.pkey import PKey
|
||||
from ssh.ssh_exception import SSHException
|
||||
from ssh.message import Message
|
||||
from ssh.pkey import PKey
|
||||
|
||||
|
||||
SSH2_AGENTC_REQUEST_IDENTITIES, SSH2_AGENT_IDENTITIES_ANSWER, \
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -26,12 +26,12 @@ import weakref
|
|||
# this helps freezing utils
|
||||
import encodings.utf_8
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.message import Message
|
||||
from paramiko.ssh_exception import SSHException, AuthenticationException, \
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.message import Message
|
||||
from ssh.ssh_exception import SSHException, AuthenticationException, \
|
||||
BadAuthenticationType, PartialAuthentication
|
||||
from paramiko.server import InteractiveQuery
|
||||
from ssh.server import InteractiveQuery
|
||||
|
||||
|
||||
class AuthHandler (object):
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -27,13 +27,13 @@ import threading
|
|||
import socket
|
||||
import os
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.message import Message
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from paramiko.file import BufferedFile
|
||||
from paramiko.buffered_pipe import BufferedPipe, PipeTimeout
|
||||
from paramiko import pipe
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.message import Message
|
||||
from ssh.ssh_exception import SSHException
|
||||
from ssh.file import BufferedFile
|
||||
from ssh.buffered_pipe import BufferedPipe, PipeTimeout
|
||||
from ssh import pipe
|
||||
|
||||
|
||||
# lower bound on the max packet size we'll accept from the remote host
|
||||
|
@ -87,7 +87,7 @@ class Channel (object):
|
|||
self.in_window_sofar = 0
|
||||
self.status_event = threading.Event()
|
||||
self._name = str(chanid)
|
||||
self.logger = util.get_logger('paramiko.transport')
|
||||
self.logger = util.get_logger('ssh.transport')
|
||||
self._pipe = None
|
||||
self.event = threading.Event()
|
||||
self.event_ready = False
|
||||
|
@ -107,7 +107,7 @@ class Channel (object):
|
|||
|
||||
@rtype: str
|
||||
"""
|
||||
out = '<paramiko.Channel %d' % self.chanid
|
||||
out = '<ssh.Channel %d' % self.chanid
|
||||
if self.closed:
|
||||
out += ' (closed)'
|
||||
elif self.active:
|
||||
|
@ -1209,7 +1209,7 @@ class ChannelFile (BufferedFile):
|
|||
|
||||
@rtype: str
|
||||
"""
|
||||
return '<paramiko.ChannelFile from ' + repr(self.channel) + '>'
|
||||
return '<ssh.ChannelFile from ' + repr(self.channel) + '>'
|
||||
|
||||
def _read(self, size):
|
||||
return self.channel.recv(size)
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -26,14 +26,14 @@ import os
|
|||
import socket
|
||||
import warnings
|
||||
|
||||
from paramiko.agent import Agent
|
||||
from paramiko.common import *
|
||||
from paramiko.dsskey import DSSKey
|
||||
from paramiko.hostkeys import HostKeys
|
||||
from paramiko.resource import ResourceManager
|
||||
from paramiko.rsakey import RSAKey
|
||||
from paramiko.ssh_exception import SSHException, BadHostKeyException
|
||||
from paramiko.transport import Transport
|
||||
from ssh.agent import Agent
|
||||
from ssh.common import *
|
||||
from ssh.dsskey import DSSKey
|
||||
from ssh.hostkeys import HostKeys
|
||||
from ssh.resource import ResourceManager
|
||||
from ssh.rsakey import RSAKey
|
||||
from ssh.ssh_exception import SSHException, BadHostKeyException
|
||||
from ssh.transport import Transport
|
||||
|
||||
|
||||
SSH_PORT = 22
|
||||
|
@ -187,7 +187,7 @@ class SSHClient (object):
|
|||
@raise IOError: if the file could not be written
|
||||
"""
|
||||
f = open(filename, 'w')
|
||||
f.write('# SSH host keys collected by paramiko\n')
|
||||
f.write('# SSH host keys collected by ssh\n')
|
||||
for hostname, keys in self._host_keys.iteritems():
|
||||
for keytype, key in keys.iteritems():
|
||||
f.write('%s %s %s\n' % (hostname, keytype, key.get_base64()))
|
||||
|
@ -205,7 +205,7 @@ class SSHClient (object):
|
|||
|
||||
def set_log_channel(self, name):
|
||||
"""
|
||||
Set the channel for logging. The default is C{"paramiko.transport"}
|
||||
Set the channel for logging. The default is C{"ssh.transport"}
|
||||
but it can be set to anything you want.
|
||||
|
||||
@param name: new channel name for logging
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -23,12 +23,12 @@ L{DSSKey}
|
|||
from Crypto.PublicKey import DSA
|
||||
from Crypto.Hash import SHA
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from paramiko.message import Message
|
||||
from paramiko.ber import BER, BERException
|
||||
from paramiko.pkey import PKey
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.ssh_exception import SSHException
|
||||
from ssh.message import Message
|
||||
from ssh.ber import BER, BERException
|
||||
from ssh.pkey import PKey
|
||||
|
||||
|
||||
class DSSKey (PKey):
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -24,9 +24,9 @@ import base64
|
|||
from Crypto.Hash import SHA, HMAC
|
||||
import UserDict
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko.dsskey import DSSKey
|
||||
from paramiko.rsakey import RSAKey
|
||||
from ssh.common import *
|
||||
from ssh.dsskey import DSSKey
|
||||
from ssh.rsakey import RSAKey
|
||||
|
||||
|
||||
class HostKeyEntry:
|
|
@ -1,23 +1,23 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
Variant on L{KexGroup1 <paramiko.kex_group1.KexGroup1>} where the prime "p" and
|
||||
Variant on L{KexGroup1 <ssh.kex_group1.KexGroup1>} where the prime "p" and
|
||||
generator "g" are provided by the server. A bit more work is required on the
|
||||
client side, and a B{lot} more on the server side.
|
||||
"""
|
||||
|
@ -25,10 +25,10 @@ client side, and a B{lot} more on the server side.
|
|||
from Crypto.Hash import SHA
|
||||
from Crypto.Util import number
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.message import Message
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.message import Message
|
||||
from ssh.ssh_exception import SSHException
|
||||
|
||||
|
||||
_MSG_KEXDH_GEX_REQUEST_OLD, _MSG_KEXDH_GEX_GROUP, _MSG_KEXDH_GEX_INIT, \
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -23,10 +23,10 @@ Standard SSH key exchange ("kex" if you wanna sound cool). Diffie-Hellman of
|
|||
|
||||
from Crypto.Hash import SHA
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.message import Message
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.message import Message
|
||||
from ssh.ssh_exception import SSHException
|
||||
|
||||
|
||||
_MSG_KEXDH_INIT, _MSG_KEXDH_REPLY = range(30, 32)
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -23,7 +23,7 @@ Implementation of an SSH2 "message".
|
|||
import struct
|
||||
import cStringIO
|
||||
|
||||
from paramiko import util
|
||||
from ssh import util
|
||||
|
||||
|
||||
class Message (object):
|
||||
|
@ -34,7 +34,7 @@ class Message (object):
|
|||
|
||||
Normally you don't need to deal with anything this low-level, but it's
|
||||
exposed for people implementing custom extensions, or features that
|
||||
paramiko doesn't support yet.
|
||||
ssh doesn't support yet.
|
||||
"""
|
||||
|
||||
def __init__(self, content=None):
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -27,10 +27,10 @@ import struct
|
|||
import threading
|
||||
import time
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from paramiko.message import Message
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.ssh_exception import SSHException
|
||||
from ssh.message import Message
|
||||
|
||||
|
||||
got_r_hmac = False
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -27,10 +27,10 @@ import os
|
|||
from Crypto.Hash import MD5
|
||||
from Crypto.Cipher import DES3, AES
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.message import Message
|
||||
from paramiko.ssh_exception import SSHException, PasswordRequiredException
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.message import Message
|
||||
from ssh.ssh_exception import SSHException, PasswordRequiredException
|
||||
|
||||
|
||||
class PKey (object):
|
||||
|
@ -331,7 +331,7 @@ class PKey (object):
|
|||
def _write_private_key_file(self, tag, filename, data, password=None):
|
||||
"""
|
||||
Write an SSH2-format private key file in a form that can be read by
|
||||
paramiko or openssh. If no password is given, the key is written in
|
||||
ssh or openssh. If no password is given, the key is written in
|
||||
a trivially-encoded format (base64) which is completely insecure. If
|
||||
a password is given, DES-EDE3-CBC is used.
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -22,8 +22,8 @@ Utility functions for dealing with primes.
|
|||
|
||||
from Crypto.Util import number
|
||||
|
||||
from paramiko import util
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from ssh import util
|
||||
from ssh.ssh_exception import SSHException
|
||||
|
||||
|
||||
def _generate_prime(bits, rng):
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -24,12 +24,12 @@ from Crypto.PublicKey import RSA
|
|||
from Crypto.Hash import SHA, MD5
|
||||
from Crypto.Cipher import DES3
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.message import Message
|
||||
from paramiko.ber import BER, BERException
|
||||
from paramiko.pkey import PKey
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.message import Message
|
||||
from ssh.ber import BER, BERException
|
||||
from ssh.pkey import PKey
|
||||
from ssh.ssh_exception import SSHException
|
||||
|
||||
|
||||
class RSAKey (PKey):
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -21,8 +21,8 @@ L{ServerInterface} is an interface to override for server support.
|
|||
"""
|
||||
|
||||
import threading
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
|
||||
|
||||
class InteractiveQuery (object):
|
||||
|
@ -69,10 +69,10 @@ class InteractiveQuery (object):
|
|||
|
||||
class ServerInterface (object):
|
||||
"""
|
||||
This class defines an interface for controlling the behavior of paramiko
|
||||
This class defines an interface for controlling the behavior of ssh
|
||||
in server mode.
|
||||
|
||||
Methods on this class are called from paramiko's primary thread, so you
|
||||
Methods on this class are called from ssh's primary thread, so you
|
||||
shouldn't do too much work in them. (Certainly nothing that blocks or
|
||||
sleeps.)
|
||||
"""
|
||||
|
@ -202,7 +202,7 @@ class ServerInterface (object):
|
|||
options it has for continuing the authentication.)
|
||||
|
||||
Note that you don't have to actually verify any key signtature here.
|
||||
If you're willing to accept the key, paramiko will do the work of
|
||||
If you're willing to accept the key, ssh will do the work of
|
||||
verifying the client's signature.
|
||||
|
||||
The default implementation always returns L{AUTH_FAILED}.
|
|
@ -1,29 +1,29 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
import select
|
||||
import socket
|
||||
import struct
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko import util
|
||||
from paramiko.channel import Channel
|
||||
from paramiko.message import Message
|
||||
from ssh.common import *
|
||||
from ssh import util
|
||||
from ssh.channel import Channel
|
||||
from ssh.message import Message
|
||||
|
||||
|
||||
CMD_INIT, CMD_VERSION, CMD_OPEN, CMD_CLOSE, CMD_READ, CMD_WRITE, CMD_LSTAT, CMD_FSTAT, \
|
||||
|
@ -95,7 +95,7 @@ class SFTPError (Exception):
|
|||
|
||||
class BaseSFTP (object):
|
||||
def __init__(self):
|
||||
self.logger = util.get_logger('paramiko.sftp')
|
||||
self.logger = util.get_logger('ssh.sftp')
|
||||
self.sock = None
|
||||
self.ultra_debug = False
|
||||
|
||||
|
@ -146,7 +146,7 @@ class BaseSFTP (object):
|
|||
while n > 0:
|
||||
if isinstance(self.sock, socket.socket):
|
||||
# sometimes sftp is used directly over a socket instead of
|
||||
# through a paramiko channel. in this case, check periodically
|
||||
# through a ssh channel. in this case, check periodically
|
||||
# if the socket is closed. (for some reason, recv() won't ever
|
||||
# return or raise an exception, but calling select on a closed
|
||||
# socket will.)
|
|
@ -1,25 +1,25 @@
|
|||
# Copyright (C) 2003-2006 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
import stat
|
||||
import time
|
||||
from paramiko.common import *
|
||||
from paramiko.sftp import *
|
||||
from ssh.common import *
|
||||
from ssh.sftp import *
|
||||
|
||||
|
||||
class SFTPAttributes (object):
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -28,10 +28,10 @@ import threading
|
|||
import time
|
||||
import weakref
|
||||
|
||||
from paramiko.sftp import *
|
||||
from paramiko.sftp_attr import SFTPAttributes
|
||||
from paramiko.ssh_exception import SSHException
|
||||
from paramiko.sftp_file import SFTPFile
|
||||
from ssh.sftp import *
|
||||
from ssh.sftp_attr import SFTPAttributes
|
||||
from ssh.ssh_exception import SSHException
|
||||
from ssh.sftp_file import SFTPFile
|
||||
|
||||
|
||||
def _to_unicode(s):
|
||||
|
@ -501,7 +501,7 @@ class SFTPClient (BaseSFTP):
|
|||
"""
|
||||
Change the "current directory" of this SFTP session. Since SFTP
|
||||
doesn't really have the concept of a current working directory, this
|
||||
is emulated by paramiko. Once you use this method to set a working
|
||||
is emulated by ssh. Once you use this method to set a working
|
||||
directory, all operations on this SFTPClient object will be relative
|
||||
to that path. You can pass in C{None} to stop using a current working
|
||||
directory.
|
||||
|
@ -523,7 +523,7 @@ class SFTPClient (BaseSFTP):
|
|||
def getcwd(self):
|
||||
"""
|
||||
Return the "current working directory" for this SFTP session, as
|
||||
emulated by paramiko. If no directory has been set with L{chdir},
|
||||
emulated by ssh. If no directory has been set with L{chdir},
|
||||
this method will return C{None}.
|
||||
|
||||
@return: the current working directory on the server, or C{None}
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -25,10 +25,10 @@ import socket
|
|||
import threading
|
||||
import time
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko.sftp import *
|
||||
from paramiko.file import BufferedFile
|
||||
from paramiko.sftp_attr import SFTPAttributes
|
||||
from ssh.common import *
|
||||
from ssh.sftp import *
|
||||
from ssh.file import BufferedFile
|
||||
from ssh.sftp_attr import SFTPAttributes
|
||||
|
||||
|
||||
class SFTPFile (BufferedFile):
|
||||
|
@ -349,7 +349,7 @@ class SFTPFile (BufferedFile):
|
|||
def set_pipelined(self, pipelined=True):
|
||||
"""
|
||||
Turn on/off the pipelining of write operations to this file. When
|
||||
pipelining is on, paramiko won't wait for the server response after
|
||||
pipelining is on, ssh won't wait for the server response after
|
||||
each write operation. Instead, they're collected as they come in.
|
||||
At the first non-write operation (including L{close}), all remaining
|
||||
server responses are collected. This means that if there was an error
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -22,8 +22,8 @@ Abstraction of an SFTP file handle (for server mode).
|
|||
|
||||
import os
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko.sftp import *
|
||||
from ssh.common import *
|
||||
from ssh.sftp import *
|
||||
|
||||
|
||||
class SFTPHandle (object):
|
||||
|
@ -199,4 +199,4 @@ class SFTPHandle (object):
|
|||
self.__name = name
|
||||
|
||||
|
||||
from paramiko.sftp_server import SFTPServer
|
||||
from ssh.sftp_server import SFTPServer
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -24,11 +24,11 @@ import os
|
|||
import errno
|
||||
|
||||
from Crypto.Hash import MD5, SHA
|
||||
from paramiko.common import *
|
||||
from paramiko.server import SubsystemHandler
|
||||
from paramiko.sftp import *
|
||||
from paramiko.sftp_si import *
|
||||
from paramiko.sftp_attr import *
|
||||
from ssh.common import *
|
||||
from ssh.server import SubsystemHandler
|
||||
from ssh.sftp import *
|
||||
from ssh.sftp_si import *
|
||||
from ssh.sftp_attr import *
|
||||
|
||||
|
||||
# known hash algorithms for the "check-file" extension
|
||||
|
@ -441,4 +441,4 @@ class SFTPServer (BaseSFTP, SubsystemHandler):
|
|||
self._send_status(request_number, SFTP_OP_UNSUPPORTED)
|
||||
|
||||
|
||||
from paramiko.sftp_handle import SFTPHandle
|
||||
from ssh.sftp_handle import SFTPHandle
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -22,13 +22,13 @@ L{SFTPServerInterface} is an interface to override for SFTP server support.
|
|||
|
||||
import os
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko.sftp import *
|
||||
from ssh.common import *
|
||||
from ssh.sftp import *
|
||||
|
||||
|
||||
class SFTPServerInterface (object):
|
||||
"""
|
||||
This class defines an interface for controlling the behavior of paramiko
|
||||
This class defines an interface for controlling the behavior of ssh
|
||||
when using the L{SFTPServer} subsystem to provide an SFTP server.
|
||||
|
||||
Methods on this class are called from the SFTP session's thread, so you can
|
|
@ -1,23 +1,23 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
Exceptions defined by paramiko.
|
||||
Exceptions defined by ssh.
|
||||
"""
|
||||
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -29,21 +29,21 @@ import threading
|
|||
import time
|
||||
import weakref
|
||||
|
||||
from paramiko import util
|
||||
from paramiko.auth_handler import AuthHandler
|
||||
from paramiko.channel import Channel
|
||||
from paramiko.common import *
|
||||
from paramiko.compress import ZlibCompressor, ZlibDecompressor
|
||||
from paramiko.dsskey import DSSKey
|
||||
from paramiko.kex_gex import KexGex
|
||||
from paramiko.kex_group1 import KexGroup1
|
||||
from paramiko.message import Message
|
||||
from paramiko.packet import Packetizer, NeedRekeyException
|
||||
from paramiko.primes import ModulusPack
|
||||
from paramiko.rsakey import RSAKey
|
||||
from paramiko.server import ServerInterface
|
||||
from paramiko.sftp_client import SFTPClient
|
||||
from paramiko.ssh_exception import SSHException, BadAuthenticationType, ChannelException
|
||||
from ssh import util
|
||||
from ssh.auth_handler import AuthHandler
|
||||
from ssh.channel import Channel
|
||||
from ssh.common import *
|
||||
from ssh.compress import ZlibCompressor, ZlibDecompressor
|
||||
from ssh.dsskey import DSSKey
|
||||
from ssh.kex_gex import KexGex
|
||||
from ssh.kex_group1 import KexGroup1
|
||||
from ssh.message import Message
|
||||
from ssh.packet import Packetizer, NeedRekeyException
|
||||
from ssh.primes import ModulusPack
|
||||
from ssh.rsakey import RSAKey
|
||||
from ssh.server import ServerInterface
|
||||
from ssh.sftp_client import SFTPClient
|
||||
from ssh.ssh_exception import SSHException, BadAuthenticationType, ChannelException
|
||||
|
||||
from Crypto import Random
|
||||
from Crypto.Cipher import Blowfish, AES, DES3, ARC4
|
||||
|
@ -51,7 +51,7 @@ from Crypto.Hash import SHA, MD5
|
|||
try:
|
||||
from Crypto.Util import Counter
|
||||
except ImportError:
|
||||
from paramiko.util import Counter
|
||||
from ssh.util import Counter
|
||||
|
||||
|
||||
# for thread cleanup
|
||||
|
@ -71,7 +71,7 @@ class SecurityOptions (object):
|
|||
|
||||
Changing the contents and/or order of these fields affects the underlying
|
||||
L{Transport} (but only if you change them before starting the session).
|
||||
If you try to add an algorithm that paramiko doesn't recognize,
|
||||
If you try to add an algorithm that ssh doesn't recognize,
|
||||
C{ValueError} will be raised. If you try to assign something besides a
|
||||
tuple to one of the fields, C{TypeError} will be raised.
|
||||
"""
|
||||
|
@ -86,7 +86,7 @@ class SecurityOptions (object):
|
|||
|
||||
@rtype: str
|
||||
"""
|
||||
return '<paramiko.SecurityOptions for %s>' % repr(self._transport)
|
||||
return '<ssh.SecurityOptions for %s>' % repr(self._transport)
|
||||
|
||||
def _get_ciphers(self):
|
||||
return self._transport._preferred_ciphers
|
||||
|
@ -348,7 +348,7 @@ class Transport (threading.Thread):
|
|||
self.clear_to_send = threading.Event()
|
||||
self.clear_to_send_lock = threading.Lock()
|
||||
self.clear_to_send_timeout = 30.0
|
||||
self.log_name = 'paramiko.transport'
|
||||
self.log_name = 'ssh.transport'
|
||||
self.logger = util.get_logger(self.log_name)
|
||||
self.packetizer.set_log(self.logger)
|
||||
self.auth_handler = None
|
||||
|
@ -370,7 +370,7 @@ class Transport (threading.Thread):
|
|||
|
||||
@rtype: str
|
||||
"""
|
||||
out = '<paramiko.Transport at %s' % hex(long(id(self)) & 0xffffffffL)
|
||||
out = '<ssh.Transport at %s' % hex(long(id(self)) & 0xffffffffL)
|
||||
if not self.active:
|
||||
out += ' (unconnected)'
|
||||
else:
|
||||
|
@ -1290,7 +1290,7 @@ class Transport (threading.Thread):
|
|||
def set_log_channel(self, name):
|
||||
"""
|
||||
Set the channel for this transport's logging. The default is
|
||||
C{"paramiko.transport"} but it can be set to anything you want.
|
||||
C{"ssh.transport"} but it can be set to anything you want.
|
||||
(See the C{logging} module for more info.) SSH Channels will log
|
||||
to a sub-channel of the one specified.
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
Useful functions used by the rest of paramiko.
|
||||
Useful functions used by the rest of ssh.
|
||||
"""
|
||||
|
||||
from __future__ import generators
|
||||
|
@ -29,8 +29,8 @@ import struct
|
|||
import traceback
|
||||
import threading
|
||||
|
||||
from paramiko.common import *
|
||||
from paramiko.config import SSHConfig
|
||||
from ssh.common import *
|
||||
from ssh.config import SSHConfig
|
||||
|
||||
|
||||
# Change by RogerB - python < 2.3 doesn't have enumerate so we implement it
|
||||
|
@ -184,7 +184,7 @@ def generate_key_bytes(hashclass, salt, key, nbytes):
|
|||
def load_host_keys(filename):
|
||||
"""
|
||||
Read a file of known SSH host keys, in the format used by openssh, and
|
||||
return a compound dict of C{hostname -> keytype ->} L{PKey <paramiko.pkey.PKey>}.
|
||||
return a compound dict of C{hostname -> keytype ->} L{PKey <ssh.pkey.PKey>}.
|
||||
The hostname may be an IP address or DNS name. The keytype will be either
|
||||
C{"ssh-rsa"} or C{"ssh-dss"}.
|
||||
|
||||
|
@ -196,9 +196,9 @@ def load_host_keys(filename):
|
|||
@param filename: name of the file to read host keys from
|
||||
@type filename: str
|
||||
@return: dict of host keys, indexed by hostname and then keytype
|
||||
@rtype: dict(hostname, dict(keytype, L{PKey <paramiko.pkey.PKey>}))
|
||||
@rtype: dict(hostname, dict(keytype, L{PKey <ssh.pkey.PKey>}))
|
||||
"""
|
||||
from paramiko.hostkeys import HostKeys
|
||||
from ssh.hostkeys import HostKeys
|
||||
return HostKeys(filename)
|
||||
|
||||
def parse_ssh_config(file_obj):
|
||||
|
@ -247,8 +247,8 @@ def get_thread_id():
|
|||
return ret
|
||||
|
||||
def log_to_file(filename, level=DEBUG):
|
||||
"send paramiko logs to a logfile, if they're not already going somewhere"
|
||||
l = logging.getLogger("paramiko")
|
||||
"send ssh logs to a logfile, if they're not already going somewhere"
|
||||
l = logging.getLogger("ssh")
|
||||
if len(l.handlers) > 0:
|
||||
return
|
||||
l.setLevel(level)
|
|
@ -1,20 +1,20 @@
|
|||
# Copyright (C) 2005 John Arbash-Meinel <john@arbash-meinel.com>
|
||||
# Modified up by: Todd Whiteman <ToddW@ActiveState.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
12
test.py
12
test.py
|
@ -2,20 +2,20 @@
|
|||
|
||||
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -27,7 +27,7 @@ import re
|
|||
import sys
|
||||
import unittest
|
||||
from optparse import OptionParser
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
sys.path.append('tests')
|
||||
|
||||
|
@ -105,7 +105,7 @@ def main():
|
|||
options, args = parser.parse_args()
|
||||
|
||||
# setup logging
|
||||
paramiko.util.log_to_file('test.log')
|
||||
ssh.util.log_to_file('test.log')
|
||||
|
||||
if options.use_sftp:
|
||||
if options.use_loopback_sftp:
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -21,7 +21,7 @@ A stub SFTP server for loopback SFTP testing.
|
|||
"""
|
||||
|
||||
import os
|
||||
from paramiko import ServerInterface, SFTPServerInterface, SFTPServer, SFTPAttributes, \
|
||||
from ssh import ServerInterface, SFTPServerInterface, SFTPServer, SFTPAttributes, \
|
||||
SFTPHandle, SFTP_OK, AUTH_SUCCESSFUL, OPEN_SUCCEEDED
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2008 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -24,11 +24,11 @@ import sys
|
|||
import threading
|
||||
import unittest
|
||||
|
||||
from paramiko import Transport, ServerInterface, RSAKey, DSSKey, \
|
||||
from ssh import Transport, ServerInterface, RSAKey, DSSKey, \
|
||||
SSHException, BadAuthenticationType, InteractiveQuery, ChannelException, \
|
||||
AuthenticationException
|
||||
from paramiko import AUTH_FAILED, AUTH_PARTIALLY_SUCCESSFUL, AUTH_SUCCESSFUL
|
||||
from paramiko import OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
from ssh import AUTH_FAILED, AUTH_PARTIALLY_SUCCESSFUL, AUTH_SUCCESSFUL
|
||||
from ssh import OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
from loop import LoopSocket
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -23,8 +23,8 @@ Some unit tests for BufferedPipe.
|
|||
import threading
|
||||
import time
|
||||
import unittest
|
||||
from paramiko.buffered_pipe import BufferedPipe, PipeTimeout
|
||||
from paramiko import pipe
|
||||
from ssh.buffered_pipe import BufferedPipe, PipeTimeout
|
||||
from ssh import pipe
|
||||
|
||||
|
||||
def delay_thread(pipe):
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -27,10 +27,10 @@ import unittest
|
|||
import weakref
|
||||
from binascii import hexlify
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
|
||||
class NullServer (paramiko.ServerInterface):
|
||||
class NullServer (ssh.ServerInterface):
|
||||
|
||||
def get_allowed_auths(self, username):
|
||||
if username == 'slowdive':
|
||||
|
@ -39,16 +39,16 @@ class NullServer (paramiko.ServerInterface):
|
|||
|
||||
def check_auth_password(self, username, password):
|
||||
if (username == 'slowdive') and (password == 'pygmalion'):
|
||||
return paramiko.AUTH_SUCCESSFUL
|
||||
return paramiko.AUTH_FAILED
|
||||
return ssh.AUTH_SUCCESSFUL
|
||||
return ssh.AUTH_FAILED
|
||||
|
||||
def check_auth_publickey(self, username, key):
|
||||
if (key.get_name() == 'ssh-dss') and (hexlify(key.get_fingerprint()) == '4478f0b9a23cc5182009ff755bc1d26c'):
|
||||
return paramiko.AUTH_SUCCESSFUL
|
||||
return paramiko.AUTH_FAILED
|
||||
return ssh.AUTH_SUCCESSFUL
|
||||
return ssh.AUTH_FAILED
|
||||
|
||||
def check_channel_request(self, kind, chanid):
|
||||
return paramiko.OPEN_SUCCEEDED
|
||||
return ssh.OPEN_SUCCEEDED
|
||||
|
||||
def check_channel_exec_request(self, channel, command):
|
||||
if command != 'yes':
|
||||
|
@ -76,8 +76,8 @@ class SSHClientTest (unittest.TestCase):
|
|||
|
||||
def _run(self):
|
||||
self.socks, addr = self.sockl.accept()
|
||||
self.ts = paramiko.Transport(self.socks)
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
self.ts = ssh.Transport(self.socks)
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
self.ts.add_server_key(host_key)
|
||||
server = NullServer()
|
||||
self.ts.start_server(self.event, server)
|
||||
|
@ -87,10 +87,10 @@ class SSHClientTest (unittest.TestCase):
|
|||
"""
|
||||
verify that the SSHClient stuff works too.
|
||||
"""
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = paramiko.RSAKey(data=str(host_key))
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = ssh.RSAKey(data=str(host_key))
|
||||
|
||||
self.tc = paramiko.SSHClient()
|
||||
self.tc = ssh.SSHClient()
|
||||
self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
|
||||
self.tc.connect(self.addr, self.port, username='slowdive', password='pygmalion')
|
||||
|
||||
|
@ -120,10 +120,10 @@ class SSHClientTest (unittest.TestCase):
|
|||
"""
|
||||
verify that SSHClient works with a DSA key.
|
||||
"""
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = paramiko.RSAKey(data=str(host_key))
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = ssh.RSAKey(data=str(host_key))
|
||||
|
||||
self.tc = paramiko.SSHClient()
|
||||
self.tc = ssh.SSHClient()
|
||||
self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
|
||||
self.tc.connect(self.addr, self.port, username='slowdive', key_filename='tests/test_dss.key')
|
||||
|
||||
|
@ -153,10 +153,10 @@ class SSHClientTest (unittest.TestCase):
|
|||
"""
|
||||
verify that SSHClient accepts and tries multiple key files.
|
||||
"""
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = paramiko.RSAKey(data=str(host_key))
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = ssh.RSAKey(data=str(host_key))
|
||||
|
||||
self.tc = paramiko.SSHClient()
|
||||
self.tc = ssh.SSHClient()
|
||||
self.tc.get_host_keys().add('[%s]:%d' % (self.addr, self.port), 'ssh-rsa', public_host_key)
|
||||
self.tc.connect(self.addr, self.port, username='slowdive', key_filename=[ 'tests/test_rsa.key', 'tests/test_dss.key' ])
|
||||
|
||||
|
@ -170,11 +170,11 @@ class SSHClientTest (unittest.TestCase):
|
|||
"""
|
||||
verify that SSHClient's AutoAddPolicy works.
|
||||
"""
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = paramiko.RSAKey(data=str(host_key))
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = ssh.RSAKey(data=str(host_key))
|
||||
|
||||
self.tc = paramiko.SSHClient()
|
||||
self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
self.tc = ssh.SSHClient()
|
||||
self.tc.set_missing_host_key_policy(ssh.AutoAddPolicy())
|
||||
self.assertEquals(0, len(self.tc.get_host_keys()))
|
||||
self.tc.connect(self.addr, self.port, username='slowdive', password='pygmalion')
|
||||
|
||||
|
@ -191,11 +191,11 @@ class SSHClientTest (unittest.TestCase):
|
|||
verify that when an SSHClient is collected, its transport (and the
|
||||
transport's packetizer) is closed.
|
||||
"""
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = paramiko.RSAKey(data=str(host_key))
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
public_host_key = ssh.RSAKey(data=str(host_key))
|
||||
|
||||
self.tc = paramiko.SSHClient()
|
||||
self.tc.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
self.tc = ssh.SSHClient()
|
||||
self.tc.set_missing_host_key_policy(ssh.AutoAddPolicy())
|
||||
self.assertEquals(0, len(self.tc.get_host_keys()))
|
||||
self.tc.connect(self.addr, self.port, username='slowdive', password='pygmalion')
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -21,7 +21,7 @@ Some unit tests for the BufferedFile abstraction.
|
|||
"""
|
||||
|
||||
import unittest
|
||||
from paramiko.file import BufferedFile
|
||||
from ssh.file import BufferedFile
|
||||
|
||||
|
||||
class LoopbackFile (BufferedFile):
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -24,7 +24,7 @@ import base64
|
|||
from binascii import hexlify
|
||||
import os
|
||||
import unittest
|
||||
import paramiko
|
||||
import ssh
|
||||
|
||||
|
||||
test_hosts_file = """\
|
||||
|
@ -63,7 +63,7 @@ class HostKeysTest (unittest.TestCase):
|
|||
os.unlink('hostfile.temp')
|
||||
|
||||
def test_1_load(self):
|
||||
hostdict = paramiko.HostKeys('hostfile.temp')
|
||||
hostdict = ssh.HostKeys('hostfile.temp')
|
||||
self.assertEquals(2, len(hostdict))
|
||||
self.assertEquals(1, len(hostdict.values()[0]))
|
||||
self.assertEquals(1, len(hostdict.values()[1]))
|
||||
|
@ -71,9 +71,9 @@ class HostKeysTest (unittest.TestCase):
|
|||
self.assertEquals('E6684DB30E109B67B70FF1DC5C7F1363', fp)
|
||||
|
||||
def test_2_add(self):
|
||||
hostdict = paramiko.HostKeys('hostfile.temp')
|
||||
hostdict = ssh.HostKeys('hostfile.temp')
|
||||
hh = '|1|BMsIC6cUIP2zBuXR3t2LRcJYjzM=|hpkJMysjTk/+zzUUzxQEa2ieq6c='
|
||||
key = paramiko.RSAKey(data=base64.decodestring(keyblob))
|
||||
key = ssh.RSAKey(data=base64.decodestring(keyblob))
|
||||
hostdict.add(hh, 'ssh-rsa', key)
|
||||
self.assertEquals(3, len(hostdict))
|
||||
x = hostdict['foo.example.com']
|
||||
|
@ -82,7 +82,7 @@ class HostKeysTest (unittest.TestCase):
|
|||
self.assert_(hostdict.check('foo.example.com', key))
|
||||
|
||||
def test_3_dict(self):
|
||||
hostdict = paramiko.HostKeys('hostfile.temp')
|
||||
hostdict = ssh.HostKeys('hostfile.temp')
|
||||
self.assert_('secure.example.com' in hostdict)
|
||||
self.assert_('not.example.com' not in hostdict)
|
||||
self.assert_(hostdict.has_key('secure.example.com'))
|
||||
|
@ -97,9 +97,9 @@ class HostKeysTest (unittest.TestCase):
|
|||
self.assertEquals(2, i)
|
||||
|
||||
def test_4_dict_set(self):
|
||||
hostdict = paramiko.HostKeys('hostfile.temp')
|
||||
key = paramiko.RSAKey(data=base64.decodestring(keyblob))
|
||||
key_dss = paramiko.DSSKey(data=base64.decodestring(keyblob_dss))
|
||||
hostdict = ssh.HostKeys('hostfile.temp')
|
||||
key = ssh.RSAKey(data=base64.decodestring(keyblob))
|
||||
key_dss = ssh.DSSKey(data=base64.decodestring(keyblob_dss))
|
||||
hostdict['secure.example.com'] = {
|
||||
'ssh-rsa': key,
|
||||
'ssh-dss': key_dss
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -22,10 +22,10 @@ Some unit tests for the key exchange protocols.
|
|||
|
||||
from binascii import hexlify
|
||||
import unittest
|
||||
import paramiko.util
|
||||
from paramiko.kex_group1 import KexGroup1
|
||||
from paramiko.kex_gex import KexGex
|
||||
from paramiko import Message
|
||||
import ssh.util
|
||||
from ssh.kex_group1 import KexGroup1
|
||||
from ssh.kex_gex import KexGex
|
||||
from ssh import Message
|
||||
|
||||
|
||||
class FakeRng (object):
|
||||
|
@ -90,7 +90,7 @@ class KexTest (unittest.TestCase):
|
|||
kex.start_kex()
|
||||
x = '1E000000807E2DDB1743F3487D6545F04F1C8476092FB912B013626AB5BCEB764257D88BBA64243B9F348DF7B41B8C814A995E00299913503456983FFB9178D3CD79EB6D55522418A8ABF65375872E55938AB99A84A0B5FC8A1ECC66A7C3766E7E0F80B7CE2C9225FC2DD683F4764244B72963BBB383F529DCF0C5D17740B8A2ADBE9208D4'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_group1._MSG_KEXDH_REPLY,), transport._expect)
|
||||
self.assertEquals((ssh.kex_group1._MSG_KEXDH_REPLY,), transport._expect)
|
||||
|
||||
# fake "reply"
|
||||
msg = Message()
|
||||
|
@ -98,7 +98,7 @@ class KexTest (unittest.TestCase):
|
|||
msg.add_mpint(69)
|
||||
msg.add_string('fake-sig')
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_group1._MSG_KEXDH_REPLY, msg)
|
||||
kex.parse_next(ssh.kex_group1._MSG_KEXDH_REPLY, msg)
|
||||
H = '03079780F3D3AD0B3C6DB30C8D21685F367A86D2'
|
||||
self.assertEquals(self.K, transport._K)
|
||||
self.assertEquals(H, hexlify(transport._H).upper())
|
||||
|
@ -110,12 +110,12 @@ class KexTest (unittest.TestCase):
|
|||
transport.server_mode = True
|
||||
kex = KexGroup1(transport)
|
||||
kex.start_kex()
|
||||
self.assertEquals((paramiko.kex_group1._MSG_KEXDH_INIT,), transport._expect)
|
||||
self.assertEquals((ssh.kex_group1._MSG_KEXDH_INIT,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_mpint(69)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_group1._MSG_KEXDH_INIT, msg)
|
||||
kex.parse_next(ssh.kex_group1._MSG_KEXDH_INIT, msg)
|
||||
H = 'B16BF34DD10945EDE84E9C1EF24A14BFDC843389'
|
||||
x = '1F0000000866616B652D6B6579000000807E2DDB1743F3487D6545F04F1C8476092FB912B013626AB5BCEB764257D88BBA64243B9F348DF7B41B8C814A995E00299913503456983FFB9178D3CD79EB6D55522418A8ABF65375872E55938AB99A84A0B5FC8A1ECC66A7C3766E7E0F80B7CE2C9225FC2DD683F4764244B72963BBB383F529DCF0C5D17740B8A2ADBE9208D40000000866616B652D736967'
|
||||
self.assertEquals(self.K, transport._K)
|
||||
|
@ -130,23 +130,23 @@ class KexTest (unittest.TestCase):
|
|||
kex.start_kex()
|
||||
x = '22000004000000080000002000'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_GROUP,), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_GROUP,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_mpint(FakeModulusPack.P)
|
||||
msg.add_mpint(FakeModulusPack.G)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_GROUP, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_GROUP, msg)
|
||||
x = '20000000807E2DDB1743F3487D6545F04F1C8476092FB912B013626AB5BCEB764257D88BBA64243B9F348DF7B41B8C814A995E00299913503456983FFB9178D3CD79EB6D55522418A8ABF65375872E55938AB99A84A0B5FC8A1ECC66A7C3766E7E0F80B7CE2C9225FC2DD683F4764244B72963BBB383F529DCF0C5D17740B8A2ADBE9208D4'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_REPLY,), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_REPLY,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_string('fake-host-key')
|
||||
msg.add_mpint(69)
|
||||
msg.add_string('fake-sig')
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_REPLY, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_REPLY, msg)
|
||||
H = 'A265563F2FA87F1A89BF007EE90D58BE2E4A4BD0'
|
||||
self.assertEquals(self.K, transport._K)
|
||||
self.assertEquals(H, hexlify(transport._H).upper())
|
||||
|
@ -160,23 +160,23 @@ class KexTest (unittest.TestCase):
|
|||
kex.start_kex(_test_old_style=True)
|
||||
x = '1E00000800'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_GROUP,), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_GROUP,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_mpint(FakeModulusPack.P)
|
||||
msg.add_mpint(FakeModulusPack.G)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_GROUP, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_GROUP, msg)
|
||||
x = '20000000807E2DDB1743F3487D6545F04F1C8476092FB912B013626AB5BCEB764257D88BBA64243B9F348DF7B41B8C814A995E00299913503456983FFB9178D3CD79EB6D55522418A8ABF65375872E55938AB99A84A0B5FC8A1ECC66A7C3766E7E0F80B7CE2C9225FC2DD683F4764244B72963BBB383F529DCF0C5D17740B8A2ADBE9208D4'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_REPLY,), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_REPLY,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_string('fake-host-key')
|
||||
msg.add_mpint(69)
|
||||
msg.add_string('fake-sig')
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_REPLY, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_REPLY, msg)
|
||||
H = '807F87B269EF7AC5EC7E75676808776A27D5864C'
|
||||
self.assertEquals(self.K, transport._K)
|
||||
self.assertEquals(H, hexlify(transport._H).upper())
|
||||
|
@ -188,22 +188,22 @@ class KexTest (unittest.TestCase):
|
|||
transport.server_mode = True
|
||||
kex = KexGex(transport)
|
||||
kex.start_kex()
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_REQUEST, paramiko.kex_gex._MSG_KEXDH_GEX_REQUEST_OLD), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_REQUEST, ssh.kex_gex._MSG_KEXDH_GEX_REQUEST_OLD), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_int(1024)
|
||||
msg.add_int(2048)
|
||||
msg.add_int(4096)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_REQUEST, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_REQUEST, msg)
|
||||
x = '1F0000008100FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF0000000102'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_INIT,), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_INIT,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_mpint(12345)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_INIT, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_INIT, msg)
|
||||
K = 67592995013596137876033460028393339951879041140378510871612128162185209509220726296697886624612526735888348020498716482757677848959420073720160491114319163078862905400020959196386947926388406687288901564192071077389283980347784184487280885335302632305026248574716290537036069329724382811853044654824945750581L
|
||||
H = 'CE754197C21BF3452863B4F44D0B3951F12516EF'
|
||||
x = '210000000866616B652D6B6579000000807E2DDB1743F3487D6545F04F1C8476092FB912B013626AB5BCEB764257D88BBA64243B9F348DF7B41B8C814A995E00299913503456983FFB9178D3CD79EB6D55522418A8ABF65375872E55938AB99A84A0B5FC8A1ECC66A7C3766E7E0F80B7CE2C9225FC2DD683F4764244B72963BBB383F529DCF0C5D17740B8A2ADBE9208D40000000866616B652D736967'
|
||||
|
@ -217,20 +217,20 @@ class KexTest (unittest.TestCase):
|
|||
transport.server_mode = True
|
||||
kex = KexGex(transport)
|
||||
kex.start_kex()
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_REQUEST, paramiko.kex_gex._MSG_KEXDH_GEX_REQUEST_OLD), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_REQUEST, ssh.kex_gex._MSG_KEXDH_GEX_REQUEST_OLD), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_int(2048)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_REQUEST_OLD, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_REQUEST_OLD, msg)
|
||||
x = '1F0000008100FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF0000000102'
|
||||
self.assertEquals(x, hexlify(str(transport._message)).upper())
|
||||
self.assertEquals((paramiko.kex_gex._MSG_KEXDH_GEX_INIT,), transport._expect)
|
||||
self.assertEquals((ssh.kex_gex._MSG_KEXDH_GEX_INIT,), transport._expect)
|
||||
|
||||
msg = Message()
|
||||
msg.add_mpint(12345)
|
||||
msg.rewind()
|
||||
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_INIT, msg)
|
||||
kex.parse_next(ssh.kex_gex._MSG_KEXDH_GEX_INIT, msg)
|
||||
K = 67592995013596137876033460028393339951879041140378510871612128162185209509220726296697886624612526735888348020498716482757677848959420073720160491114319163078862905400020959196386947926388406687288901564192071077389283980347784184487280885335302632305026248574716290537036069329724382811853044654824945750581L
|
||||
H = 'B41A06B2E59043CEFC1AE16EC31F1E2D12EC455B'
|
||||
x = '210000000866616B652D6B6579000000807E2DDB1743F3487D6545F04F1C8476092FB912B013626AB5BCEB764257D88BBA64243B9F348DF7B41B8C814A995E00299913503456983FFB9178D3CD79EB6D55522418A8ABF65375872E55938AB99A84A0B5FC8A1ECC66A7C3766E7E0F80B7CE2C9225FC2DD683F4764244B72963BBB383F529DCF0C5D17740B8A2ADBE9208D40000000866616B652D736967'
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -21,7 +21,7 @@ Some unit tests for ssh protocol message blocks.
|
|||
"""
|
||||
|
||||
import unittest
|
||||
from paramiko.message import Message
|
||||
from ssh.message import Message
|
||||
|
||||
|
||||
class MessageTest (unittest.TestCase):
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -24,7 +24,7 @@ import unittest
|
|||
from loop import LoopSocket
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Hash import SHA, HMAC
|
||||
from paramiko import Message, Packetizer, util
|
||||
from ssh import Message, Packetizer, util
|
||||
|
||||
class PacketizerTest (unittest.TestCase):
|
||||
|
||||
|
@ -33,7 +33,7 @@ class PacketizerTest (unittest.TestCase):
|
|||
wsock = LoopSocket()
|
||||
rsock.link(wsock)
|
||||
p = Packetizer(wsock)
|
||||
p.set_log(util.get_logger('paramiko.transport'))
|
||||
p.set_log(util.get_logger('ssh.transport'))
|
||||
p.set_hexdump(True)
|
||||
cipher = AES.new('\x00' * 16, AES.MODE_CBC, '\x55' * 16)
|
||||
p.set_outbound_cipher(cipher, 16, SHA, 12, '\x1f' * 20)
|
||||
|
@ -56,7 +56,7 @@ class PacketizerTest (unittest.TestCase):
|
|||
wsock = LoopSocket()
|
||||
rsock.link(wsock)
|
||||
p = Packetizer(rsock)
|
||||
p.set_log(util.get_logger('paramiko.transport'))
|
||||
p.set_log(util.get_logger('ssh.transport'))
|
||||
p.set_hexdump(True)
|
||||
cipher = AES.new('\x00' * 16, AES.MODE_CBC, '\x55' * 16)
|
||||
p.set_inbound_cipher(cipher, 16, SHA, 12, '\x1f' * 20)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -23,8 +23,8 @@ Some unit tests for public/private key objects.
|
|||
from binascii import hexlify, unhexlify
|
||||
import StringIO
|
||||
import unittest
|
||||
from paramiko import RSAKey, DSSKey, Message, util
|
||||
from paramiko.common import rng
|
||||
from ssh import RSAKey, DSSKey, Message, util
|
||||
from ssh.common import rng
|
||||
|
||||
# from openssh's ssh-keygen
|
||||
PUB_RSA = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA049W6geFpmsljTwfvI1UmKWWJPNFI74+vNKTk4dmzkQY2yAMs6FhlvhlI8ysU4oj71ZsRYMecHbBbxdN79+JRFVYTKaLqjwGENeTd+yv4q+V2PvZv3fLnzApI3l7EJCqhWwJUHJ1jAkZzqDx0tyOL4uoZpww3nmE0kb3y21tH4c='
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -33,10 +33,10 @@ import threading
|
|||
import time
|
||||
import unittest
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
from stub_sftp import StubServer, StubSFTPServer
|
||||
from loop import LoopSocket
|
||||
from paramiko.sftp_attr import SFTPAttributes
|
||||
from ssh.sftp_attr import SFTPAttributes
|
||||
|
||||
ARTICLE = '''
|
||||
Insulin sensitivity and liver insulin receptor structure in ducks from two
|
||||
|
@ -82,12 +82,12 @@ class SFTPTest (unittest.TestCase):
|
|||
def init(hostname, username, keyfile, passwd):
|
||||
global sftp, tc
|
||||
|
||||
t = paramiko.Transport(hostname)
|
||||
t = ssh.Transport(hostname)
|
||||
tc = t
|
||||
try:
|
||||
key = paramiko.RSAKey.from_private_key_file(keyfile, passwd)
|
||||
except paramiko.PasswordRequiredException:
|
||||
sys.stderr.write('\n\nparamiko.RSAKey.from_private_key_file REQUIRES PASSWORD.\n')
|
||||
key = ssh.RSAKey.from_private_key_file(keyfile, passwd)
|
||||
except ssh.PasswordRequiredException:
|
||||
sys.stderr.write('\n\nssh.RSAKey.from_private_key_file REQUIRES PASSWORD.\n')
|
||||
sys.stderr.write('You have two options:\n')
|
||||
sys.stderr.write('* Use the "-K" option to point to a different (non-password-protected)\n')
|
||||
sys.stderr.write(' private key file.\n')
|
||||
|
@ -97,9 +97,9 @@ class SFTPTest (unittest.TestCase):
|
|||
sys.exit(1)
|
||||
try:
|
||||
t.connect(username=username, pkey=key)
|
||||
except paramiko.SSHException:
|
||||
except ssh.SSHException:
|
||||
t.close()
|
||||
sys.stderr.write('\n\nparamiko.Transport.connect FAILED.\n')
|
||||
sys.stderr.write('\n\nssh.Transport.connect FAILED.\n')
|
||||
sys.stderr.write('There are several possible reasons why it might fail so quickly:\n\n')
|
||||
sys.stderr.write('* The host to connect to (%s) is not a valid SSH server.\n' % hostname)
|
||||
sys.stderr.write(' (Use the "-H" option to change the host.)\n')
|
||||
|
@ -109,7 +109,7 @@ class SFTPTest (unittest.TestCase):
|
|||
sys.stderr.write(' (Use the "-K" option to provide a different key file.)\n')
|
||||
sys.stderr.write('\n')
|
||||
sys.exit(1)
|
||||
sftp = paramiko.SFTP.from_transport(t)
|
||||
sftp = ssh.SFTP.from_transport(t)
|
||||
init = staticmethod(init)
|
||||
|
||||
def init_loopback():
|
||||
|
@ -118,19 +118,19 @@ class SFTPTest (unittest.TestCase):
|
|||
socks = LoopSocket()
|
||||
sockc = LoopSocket()
|
||||
sockc.link(socks)
|
||||
tc = paramiko.Transport(sockc)
|
||||
ts = paramiko.Transport(socks)
|
||||
tc = ssh.Transport(sockc)
|
||||
ts = ssh.Transport(socks)
|
||||
|
||||
host_key = paramiko.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
host_key = ssh.RSAKey.from_private_key_file('tests/test_rsa.key')
|
||||
ts.add_server_key(host_key)
|
||||
event = threading.Event()
|
||||
server = StubServer()
|
||||
ts.set_subsystem_handler('sftp', paramiko.SFTPServer, StubSFTPServer)
|
||||
ts.set_subsystem_handler('sftp', ssh.SFTPServer, StubSFTPServer)
|
||||
ts.start_server(event, server)
|
||||
tc.connect(username='slowdive', password='pygmalion')
|
||||
event.wait(1.0)
|
||||
|
||||
sftp = paramiko.SFTP.from_transport(tc)
|
||||
sftp = ssh.SFTP.from_transport(tc)
|
||||
init_loopback = staticmethod(init_loopback)
|
||||
|
||||
def set_big_file_test(onoff):
|
||||
|
@ -174,7 +174,7 @@ class SFTPTest (unittest.TestCase):
|
|||
self.fail('expected exception')
|
||||
except:
|
||||
pass
|
||||
sftp = paramiko.SFTP.from_transport(tc)
|
||||
sftp = ssh.SFTP.from_transport(tc)
|
||||
|
||||
def test_3_write(self):
|
||||
"""
|
||||
|
@ -699,7 +699,7 @@ class SFTPTest (unittest.TestCase):
|
|||
"""
|
||||
verify that seek does't affect writes during append.
|
||||
|
||||
does not work except through paramiko. :( openssh fails.
|
||||
does not work except through ssh. :( openssh fails.
|
||||
"""
|
||||
f = sftp.open(FOLDER + '/append.txt', 'a')
|
||||
try:
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -32,7 +32,7 @@ import threading
|
|||
import time
|
||||
import unittest
|
||||
|
||||
import paramiko
|
||||
import ssh
|
||||
from stub_sftp import StubServer, StubSFTPServer
|
||||
from loop import LoopSocket
|
||||
from test_sftp import get_sftp
|
||||
|
@ -242,7 +242,7 @@ class BigSFTPTest (unittest.TestCase):
|
|||
def test_6_lots_of_prefetching(self):
|
||||
"""
|
||||
prefetch a 1MB file a bunch of times, discarding the file object
|
||||
without using it, to verify that paramiko doesn't get confused.
|
||||
without using it, to verify that ssh doesn't get confused.
|
||||
"""
|
||||
sftp = get_sftp()
|
||||
kblob = (1024 * 'x')
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -29,12 +29,12 @@ import threading
|
|||
import unittest
|
||||
import random
|
||||
|
||||
from paramiko import Transport, SecurityOptions, ServerInterface, RSAKey, DSSKey, \
|
||||
from ssh import Transport, SecurityOptions, ServerInterface, RSAKey, DSSKey, \
|
||||
SSHException, BadAuthenticationType, InteractiveQuery, ChannelException
|
||||
from paramiko import AUTH_FAILED, AUTH_PARTIALLY_SUCCESSFUL, AUTH_SUCCESSFUL
|
||||
from paramiko import OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
from paramiko.common import MSG_KEXINIT, MSG_CHANNEL_WINDOW_ADJUST
|
||||
from paramiko.message import Message
|
||||
from ssh import AUTH_FAILED, AUTH_PARTIALLY_SUCCESSFUL, AUTH_SUCCESSFUL
|
||||
from ssh import OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
|
||||
from ssh.common import MSG_KEXINIT, MSG_CHANNEL_WINDOW_ADJUST
|
||||
from ssh.message import Message
|
||||
from loop import LoopSocket
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
|
||||
#
|
||||
# This file is part of paramiko.
|
||||
# This file is part of ssh.
|
||||
#
|
||||
# Paramiko is free software; you can redistribute it and/or modify it under the
|
||||
# 'ssh' is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU Lesser General Public License as published by the Free
|
||||
# Software Foundation; either version 2.1 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# 'ssh' is distrubuted in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
|
||||
# along with 'ssh'; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
|
||||
"""
|
||||
|
@ -25,7 +25,7 @@ import cStringIO
|
|||
import os
|
||||
import unittest
|
||||
from Crypto.Hash import SHA
|
||||
import paramiko.util
|
||||
import ssh.util
|
||||
|
||||
|
||||
test_config_file = """\
|
||||
|
@ -54,7 +54,7 @@ BGQ3GQ/Fc7SX6gkpXkwcZryoi4kNFhHu5LvHcZPdxXV1D+uTMfGS1eyd2Yz/DoNWXNAl8TI0cAsW\
|
|||
|
||||
|
||||
# for test 1:
|
||||
from paramiko import *
|
||||
from ssh import *
|
||||
|
||||
|
||||
class UtilTest (unittest.TestCase):
|
||||
|
@ -70,7 +70,7 @@ class UtilTest (unittest.TestCase):
|
|||
|
||||
def test_1_import(self):
|
||||
"""
|
||||
verify that all the classes can be imported from paramiko.
|
||||
verify that all the classes can be imported from ssh.
|
||||
"""
|
||||
symbols = globals().keys()
|
||||
self.assertTrue('Transport' in symbols)
|
||||
|
@ -109,7 +109,7 @@ class UtilTest (unittest.TestCase):
|
|||
def test_2_parse_config(self):
|
||||
global test_config_file
|
||||
f = cStringIO.StringIO(test_config_file)
|
||||
config = paramiko.util.parse_ssh_config(f)
|
||||
config = ssh.util.parse_ssh_config(f)
|
||||
self.assertEquals(config._config,
|
||||
[ {'identityfile': '~/.ssh/id_rsa', 'host': '*', 'user': 'robey',
|
||||
'crazy': 'something dumb '},
|
||||
|
@ -119,16 +119,16 @@ class UtilTest (unittest.TestCase):
|
|||
def test_3_host_config(self):
|
||||
global test_config_file
|
||||
f = cStringIO.StringIO(test_config_file)
|
||||
config = paramiko.util.parse_ssh_config(f)
|
||||
c = paramiko.util.lookup_ssh_host_config('irc.danger.com', config)
|
||||
config = ssh.util.parse_ssh_config(f)
|
||||
c = ssh.util.lookup_ssh_host_config('irc.danger.com', config)
|
||||
self.assertEquals(c, {'identityfile': '~/.ssh/id_rsa', 'user': 'robey', 'crazy': 'something dumb '})
|
||||
c = paramiko.util.lookup_ssh_host_config('irc.example.com', config)
|
||||
c = ssh.util.lookup_ssh_host_config('irc.example.com', config)
|
||||
self.assertEquals(c, {'identityfile': '~/.ssh/id_rsa', 'user': 'bjork', 'crazy': 'something dumb ', 'port': '3333'})
|
||||
c = paramiko.util.lookup_ssh_host_config('spoo.example.com', config)
|
||||
c = ssh.util.lookup_ssh_host_config('spoo.example.com', config)
|
||||
self.assertEquals(c, {'identityfile': '~/.ssh/id_rsa', 'user': 'bjork', 'crazy': 'something else', 'port': '3333'})
|
||||
|
||||
def test_4_generate_key_bytes(self):
|
||||
x = paramiko.util.generate_key_bytes(SHA, 'ABCDEFGH', 'This is my secret passphrase.', 64)
|
||||
x = ssh.util.generate_key_bytes(SHA, 'ABCDEFGH', 'This is my secret passphrase.', 64)
|
||||
hex = ''.join(['%02x' % ord(c) for c in x])
|
||||
self.assertEquals(hex, '9110e2f6793b69363e58173e9436b13a5a4b339005741d5c680e505f57d871347b4239f14fb5c46e857d5e100424873ba849ac699cea98d729e57b3e84378e8b')
|
||||
|
||||
|
@ -137,7 +137,7 @@ class UtilTest (unittest.TestCase):
|
|||
f.write(test_hosts_file)
|
||||
f.close()
|
||||
try:
|
||||
hostdict = paramiko.util.load_host_keys('hostfile.temp')
|
||||
hostdict = ssh.util.load_host_keys('hostfile.temp')
|
||||
self.assertEquals(2, len(hostdict))
|
||||
self.assertEquals(1, len(hostdict.values()[0]))
|
||||
self.assertEquals(1, len(hostdict.values()[1]))
|
||||
|
@ -147,7 +147,7 @@ class UtilTest (unittest.TestCase):
|
|||
os.unlink('hostfile.temp')
|
||||
|
||||
def test_6_random(self):
|
||||
from paramiko.common import rng
|
||||
from ssh.common import rng
|
||||
# just verify that we can pull out 32 bytes and not get an exception.
|
||||
x = rng.read(32)
|
||||
self.assertEquals(len(x), 32)
|
||||
|
|
Loading…
Reference in New Issue