ssh c# implementation exaplanation of some shenanigans
i have a couple of questions regarding this code,
the first one being it reads 8 bytes from the socket, which contains the packet_length (4 bytes) and the padding_length (1 byte)
why then is required to calculate
the bytes to read, if the packetLength itself is
`
and also this, why is needed to substract one also, like if packetLength is 7 and the paddingLength is 2, the payload length should be 5, althought this variable remains unused til later i guess
the first one being it reads 8 bytes from the socket, which contains the packet_length (4 bytes) and the padding_length (1 byte)
why then is required to calculate
the bytes to read, if the packetLength itself is
the length of the packet in bytes, not including 'mac' or the 'packet_length' field itself., so, if that is the case why is it necessary to remove the blockSize + 4, and even then, why is this necessary, the socket.Receive() shouldn't offset the stream from the last position it was when it was read?`
and also this, why is needed to substract one also, like if packetLength is 7 and the paddingLength is 2, the payload length should be 5, althought this variable remains unused til later i guess