Skip to content

Commit e86fd18

Browse files
committed
Limit size of SSH packet to 35.000 bytes.
Improve documentation of LocalChannelDataPacketSize.
1 parent fa640e1 commit e86fd18

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Renci.SshNet/Session.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ public class Session : ISession
4949
/// <summary>
5050
/// Specifies maximum packet size defined by the protocol.
5151
/// </summary>
52-
private const int MaximumSshPacketSize = LocalChannelDataPacketSize + 3000;
52+
/// <value>
53+
/// 35000.
54+
/// </value>
55+
private const int MaximumSshPacketSize = 35000;
5356

5457
/// <summary>
5558
/// Holds the initial local window size for the channels.
@@ -65,6 +68,15 @@ public class Session : ISession
6568
/// <value>
6669
/// 64 KB.
6770
/// </value>
71+
/// <remarks>
72+
/// <para>
73+
/// This is the maximum size (in bytes) we support for the data (payload) of a
74+
/// <c>SSH_MSG_CHANNEL_DATA</c> message we receive.
75+
/// </para>
76+
/// <para>
77+
/// We currently do not enforce this limit.
78+
/// </para>
79+
/// </remarks>
6880
private const int LocalChannelDataPacketSize = 1024*64;
6981

7082
#if FEATURE_REGEX_COMPILE

0 commit comments

Comments
 (0)