summaryrefslogtreecommitdiff
path: root/paramiko/common.py
diff options
context:
space:
mode:
authorJeff Quast <contact@jeffquast.com>2014-12-14 00:05:39 -0800
committerJeff Forcier <jeff@bitprophet.org>2014-12-17 16:04:25 -0800
commit6b7d45f2c87c993b7944e7526b184290314d7f9b (patch)
treed161a73690f9f7e1cfd387b4ba192be4ecbfaff1 /paramiko/common.py
parent25e3c0c34e98b50f429a2e72ecc059d469dc1168 (diff)
downloadparamiko-6b7d45f2c87c993b7944e7526b184290314d7f9b.tar.gz
Suggest a MIN_WINDOW_SIZE and MIN_PACKET_SIZE
Not fully confident with this change, though I will describe my findings fully in the pull request. The OpenSSH client requests a maximum packet size of 16384, but this MIN_PACKET_SIZE value of 32768 causes its request to be "clamped" up to 32768, later causing an error to stderr on the OpenSSH client. Suggest then, to delineate MIN_WINDOW_SIZE from MIN_PACKET_SIZE, as they are applied. I don't think there is any minimum value of MIN_PACKET_SIZE, however we can suggest a value of 4096 for now.
Diffstat (limited to 'paramiko/common.py')
-rw-r--r--paramiko/common.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/paramiko/common.py b/paramiko/common.py
index 97b2f958..0b0cc2a7 100644
--- a/paramiko/common.py
+++ b/paramiko/common.py
@@ -195,7 +195,11 @@ DEFAULT_MAX_PACKET_SIZE = 2 ** 15
# lower bound on the max packet size we'll accept from the remote host
# Minimum packet size is 32768 bytes according to
# http://www.ietf.org/rfc/rfc4254.txt
-MIN_PACKET_SIZE = 2 ** 15
+MIN_WINDOW_SIZE = 2 ** 15
+
+# However, according to http://www.ietf.org/rfc/rfc4253.txt it is perfectly
+# legal to accept a size much smaller, as OpenSSH client does as size 16384.
+MIN_PACKET_SIZE = 2 ** 12
# Max windows size according to http://www.ietf.org/rfc/rfc4254.txt
MAX_WINDOW_SIZE = 2**32 -1