Commit Graph

163 Commits

Author SHA1 Message Date
Robey Pointer 13f818f04f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-114]
fix typo in channel
fix typo that alain found: pipd_wfd -> pipe_wfd.
2004-11-22 07:40:39 +00:00
Robey Pointer a8a023a243 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-113]
sftp server support!
finally check in sftp_handle (file handle abstraction), sftp_si (server
interface), and sftp_server (server implementation) -- all of which make
a roughly 90% implementation of server-side sftp.
2004-11-22 07:27:21 +00:00
Robey Pointer 611d66428e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-112]
add finish_subsystem()
when a SubsystemHandler is being decomissioned (the client has closed the
channel or transport, or the socket went away), make a callback to let the
handler do any shutdown it needs to.
2004-11-22 07:07:08 +00:00
Robey Pointer 961525f3d8 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-111]
fix extremely unlikely channel counter wrapping
Transport's channel counter can overflow after 4 billion some channels are
created.  make it wrap back around after 16 million instead.  also allow the
logging channel to be set manually.  fix some comments elsewhere.
2004-11-22 07:04:31 +00:00
Robey Pointer fda92c6f44 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-110]
fix Transport.get_username() to work in server mode too
whenever i split the 'username' field into username and auth_username,
i guess that made get_username() stop working for server mode (because the
username was stored in a different field).  this should fix it.
2004-11-22 07:01:43 +00:00
Robey Pointer 73e8a134ce [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-109]
v1.0 (jigglypuff)
bump all the version numbers up to 1.0 (jigglypuff).
2004-11-07 03:10:53 +00:00
Robey Pointer 920df7d0ae [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-108]
add filename to SFTPAttributes
add filename to the attributes stored in an SFTPAttributes object.
2004-11-07 02:51:42 +00:00
Robey Pointer 2f3228dd88 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-107]
fix kex_gex
fix kex_gex (group-exchange key exchange) to, *cough*, work again, and also
layout kex_group1 a little more sanely.
2004-11-07 02:31:48 +00:00
Robey Pointer 5a1b5848ae [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-105]
move ChangeLog
move ChangeLog out of the way because tla can autogenerate any useful
ChangeLog.
2004-11-07 02:29:20 +00:00
Robey Pointer 224f6e4747 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-104]
fix location of SFTPError
fix location of SFTPError.
2004-11-07 02:28:33 +00:00
Robey Pointer 1c32fcd99a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-103]
rename sftp constants
replace oddly named sftp constants (FX_OK for example) with names that make
a bit more sense when sober (SFTP_OK).
2004-11-07 02:17:18 +00:00
Robey Pointer 0ab2735dd4 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-102]
add key exchange tests + 1 more sftp test
add test suite for key-exchange protocols, since i apparently broke the
"gex" protocol recently and never noticed.  also add an sftp unit test for
mkdir/rmdir.
2004-11-07 02:08:11 +00:00
Robey Pointer a97b9946bb [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-101]
remove old demo keys
the keys are in tests/ now.
2004-11-07 02:00:50 +00:00
Robey Pointer e86c5f0106 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-100]
don't forget demo_windows.py
update MANIFEST.in to include demo_windows.py and not include the demo
keys (they're in tests/ now).  clean up the README to explain the demo
scripts better now, since there are so many of them.  then fix up the
demo scripts to look in tests/ for the keys.

demo_windows.py doesn't need to call get_pty() (in fact, i think that's
blowing openssh's mind) and was executing the wrong command.
2004-11-06 20:32:08 +00:00
Robey Pointer 1d1a60047c [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-99]
use getpass
convert raw_input to getpass as suggested many weeks ago.
2004-11-01 07:07:48 +00:00
Robey Pointer 6eb59a2b53 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-98]
don't unlink a Channel until the server closes it too
when close()'ing a Channel, don't immediately unlink it from the Transport.
instead, wait for the server to send a close message.

this should fix a bug where doing close() on an EOF'd channel would cause
the entire transport to be killed, because the server would send an
'exit-status' and 'close' message for a channel that we no longer had a
record of.
2004-11-01 03:54:01 +00:00
Robey Pointer d7caa20213 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-97]
better debugging, improve subsytem handler
add a list of ssh packet names for debugging.  improve the server-mode
subsystem handler so it can take extra parameters (list or keyword) and
pass them to the subsystem constructor.  remove a misleading comment
about rekeying (which was already implemented).
2004-11-01 03:43:28 +00:00
Robey Pointer 44d07583bb [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-96]
remove key.valid check
oops!  'key.valid' no longer works -- catch the SSHException instead, and log
it.
2004-11-01 03:37:42 +00:00
Robey Pointer a73413c588 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-95]
ivysaur 0.9
update ivysaur release date, and add the list of changes to the README
file.
2004-10-23 07:36:23 +00:00
Robey Pointer 6caf15b425 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-94]
start testing Transport
the beginnings of tests for Transport.  only the bare minimum is there right
now.

also started doc'ing things up to ivysaur.
2004-10-20 16:52:51 +00:00
Robey Pointer 2939b6936b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-93]
switch Transport.connect() to using a Pkey object for the host key
i suddenly realized that passing "hostkeytype" and "hostkey" as strings to
Transport.connect() was pretty silly since i went to all the effort of making
a class specifically for holding keys.  so Transport.connect() now just takes
host-key argument: "hostkey" as a PKey object.

updated the demos to use PKey objects when reading the host key file, and to
use the new "hostkey" argument.
2004-10-18 04:54:27 +00:00
Robey Pointer e1639180f9 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-92]
add rsa/dss key object unit tests
add tests for rsa/dss key objects -- yay!
2004-09-25 22:07:59 +00:00
Robey Pointer ec3df4cc0d [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-91]
fix test.py to use options instead of env vars, sftp tests default off
fix up the test framework so that the sftp unit tests aren't always run (you
have to ask for them explicitly) and they take their configuration from
command-line options.  they still require a remote server.
2004-09-25 22:03:48 +00:00
Robey Pointer a5f6a984ee [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-90]
fix __init__
fix __init__ to export BufferedFile and randpool, and to catch up with the
changes from a week or 2 ago where sftp_attr & friends were split off.
2004-09-25 21:58:11 +00:00
Robey Pointer 12269c0c9b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-89]
fix some Transport docs
document that Transport also would like close() and settimeout() to exist
on the socket-like object passed to the constructor.
2004-09-25 21:47:19 +00:00
Robey Pointer 3e644a94f1 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-88]
add Message.rewind()
add rewind() method to Message, which just resets the pointer so you can
start reading from the beginning again.  this is useful for some tests.
2004-09-25 21:32:53 +00:00
Robey Pointer 12287b3e0e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-87]
clean up pkey interface
change the pkey interface so that it's no longer possible to have a pkey
that doesn't represent a valid key.  (ie: no more "blank" key objects.)
also add "get_bits" and "can_sign" methods to determine the key bit length
and whether it can sign things (contains the "private parts") respectively.
2004-09-25 21:28:23 +00:00
Robey Pointer 0737ea2ca4 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-86]
unit tests for Message
spanking new unit tests for Message.  i'm trying to fix the embarrassment
of having so little of paramiko testable.  next up is Transport!
2004-09-11 21:01:32 +00:00
Robey Pointer 4cac30252a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-85]
move SFTPFile and SFTPAttributes into their own files
move SFTPFile and SFTPAttributes into their own files.
2004-09-11 20:56:01 +00:00
Robey Pointer 3a4ca74e0a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-84]
add sftp.normalize
kevin c. dorff pointed out that it would be nice to expose a way to
determine the server's "current working directory", so this new method
(normalize) directly maps to REALPATH.
2004-09-11 20:50:39 +00:00
Robey Pointer 5176b1ab85 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-83]
tweak Message.add() in the key exchanges
use the new Message.add() behavior to make a little code here much easier
to read.
2004-09-11 20:43:09 +00:00
Robey Pointer 0e66dd47ac [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-82]
doc fixes
fix "string" -> "str" in types when documenting BufferedFile.
2004-09-11 20:40:08 +00:00
Robey Pointer 0e96d4a7e2 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-81]
more unit tests
add test for BufferedFile.read(-1) and sftp.normalize().
2004-09-11 20:37:59 +00:00
Robey Pointer 8c9add1a6b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-80]
move SubsystemHandler to server.py
move SubsystemHandler into server.py where it makes more sense (it's part of
the server interface).

also fix up paramiko's "version string" used in ssh2 negotiation to stop
saying "pyssh" and start saying "paramiko". :)
2004-09-11 20:36:49 +00:00
Robey Pointer 026425c117 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-79]
Message.add() can take many args
a bit of cleanup to Message:  add() can now take any number of params, and
will add them all in order (using type guessing).
2004-09-11 20:35:19 +00:00
Robey Pointer caa1f88105 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-78]
fix rbuffer -> _rbuffer in 3 places i missed
fix 3 places where "rbuffer" hadn't been converted to "_rbuffer".  thanks to
kevin c. dorff for the bug report.
2004-09-09 01:36:45 +00:00
Robey Pointer ff6ff88209 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-77]
docs for SubsystemHandler
add documentation to constructor for SubsystemHandler.
2004-09-07 06:56:49 +00:00
Robey Pointer 7946f33769 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-76]
add sftp_client.py
i retardedly forgot to import this file a few days ago: it's the split-out
client mode for sftp.  it now also has some changes to adapt it to the
improved SFTPAttributes object API.
2004-09-07 06:54:31 +00:00
Robey Pointer 574c0dd368 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-75]
clean up SFTPAttributes
add english descriptions to the FX_* error codes of sftp.  clean up (and
document) SFTPAttributes since it's exported now, and make it simple to
generate one from a python os.stat object.  make "_pythonize" the default --
that is, just use the same field names as python does for os.stat.  (i'm not
sure why i didn't do it that way in the first place; probably ignorance.)
also add str() method that converts the SFTPAttributes into a string suitable
for use in ls (used in an obscure way in sftp servers).
2004-09-07 06:51:03 +00:00
Robey Pointer 4cbbc57c6b [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-74]
note pycrypto 2.0 in README
update the README to note that pycrypto 2.0 works (i just tried it).  also
fix the name from pyCrypt back to pycrypto -- that project is having trouble
making up its mind about naming. :)
2004-09-07 06:45:53 +00:00
Robey Pointer 3973265264 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-73]
split sftp into sftp, sftp_client; renamed SFTP -> SFTPClient
add sftp_client file, and split out the common code (sftp) from stuff specific
to client mode (sftp_client).  renamed SFTP class to SFTPClient, but left an
alias so old code will still work.

renamed a bunch of sftp constants now that they're better hidden from epydoc.
2004-09-05 07:44:03 +00:00
Robey Pointer 8dbab50233 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-72]
some framework for adding subsystem handlers in server mode
you can now register a subsystem with a Transport by passing in the name
(like "sftp") and a class (like a hypothetical SFTPServer).  the default
ServerInterface.check_channel_request_subsystem now checks this table in
Transport, and if it finds a match, it creates a new thread for the handler
and calls into it.  a new class SubsystemHandler is added for this purpose
(to be subclassed).
2004-09-05 07:41:45 +00:00
Robey Pointer 6cef2f1259 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-71]
remove redundant 'auth_complete' member
remove the redundant 'auth_complete' field and just use 'authenticated' for
both client and server mode.  this makes the repr() string look correct in
server mode instead of always claiming that the transport is un-auth'd.
2004-09-05 07:37:40 +00:00
Robey Pointer aba7e37a38 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-70]
clean up server interface; no longer need to subclass Channel
- export AUTH_*, OPEN_FAILED_*, and the new OPEN_SUCCEEDED into the paramiko
  namespace instead of making people dig into paramiko.Transport.AUTH_* etc.
- move all of the check_* methods from Channel to ServerInterface so apps
  don't need to subclass Channel anymore just to run an ssh server
- ServerInterface.check_channel_request() returns an error code now, not a
  new Channel object
- fix demo_server.py to follow all these changes
- fix a bunch of places where i used "string" in docstrings but meant "str"
- added Channel.get_id()
2004-09-03 22:39:20 +00:00
Robey Pointer 440b3de06a [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-69]
clean up SecurityOptions
the preferences are now tuples in Transport, and passed as tuples out of
SecurityOptions, so that the options can't be modified without setting them
back to the options field again.  the algorithm lists in Transport are used
to validate the fields.
2004-08-31 02:44:56 +00:00
Robey Pointer aebe186c3e [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-68]
added Transport.get_security_options()
just something i wanted to play with:
added Transport.get_security_options() which returns a SecurityOptions object.
this object is a kind of proxy for the 4 "preferred_*" fields in Transport,
and lets me avoid exposing those fields directly in case i change my mind
later about how they should be stored.

added some docs to Channel explaining that the request methods now return
True/False, and fixed up docs in a few other places.
2004-08-30 20:22:10 +00:00
Robey Pointer 5598a8f88f [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-67]
replay patch 63 (missing channel changes)
i'm still getting the hang of tla/arch, obviously.

replay patch 63, which was meant to be part of the later mega-patch, but
apparently when i reversed it, i lost it entirely.
2004-08-28 04:21:12 +00:00
Robey Pointer c86c4f3949 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-66]
new ServerInterface class, outbound rekey works, etc.
a bunch of changes that i'm too lazy to split out into individual patches:
* all the server overrides from transport.py have been moved into a separate
  class ServerInterface, so server code doesn't have to subclass the whole
  paramiko library
* updated demo_server to subclass ServerInterface
* when re-keying during a session, block other messages until the new keys
  are activated (openssh doensn't like any other traffic during a rekey)
* re-key when outbound limits are tripped too (was only counting inbound
  traffic)
* don't log scary things on EOF
2004-08-27 00:57:40 +00:00
Robey Pointer 34d975b972 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-65]
add settimeout/gettimeout/setblocking, some bugfixes.
hide the command and response codes in sftp so they aren't exported.
add settimeout/gettimeout/setblocking that just wrap calls to the underlying
socket or channel.  fix _read_all to not catch timeout exceptions.
2004-08-27 00:28:33 +00:00
Robey Pointer 32afce8d49 [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-64]
reverse messed-up patch
Patches applied:

 * robey@lag.net--2003-public/secsh--dev--1.0--base-0
   initial import

 * robey@lag.net--2003-public/secsh--dev--1.0--patch-1
   no changes
2004-08-27 00:26:35 +00:00