apple / swift-nio-ssh

SwiftNIO SSH is a programmatic implementation of SSH using SwiftNIO
Apache License 2.0
398 stars 49 forks source link

Refactoring of the encryptPacket method #123

Closed artemredkin closed 1 year ago

artemredkin commented 1 year ago

Motivation: I think there is a bit of a mix of responsibilities between TransportProtection and PacketSerializer. PacketSerializer is responsible for writing out plaintext packet structure, but encrypted packet structure is written out by the TransportProtection implementations. This means that we will have duplicate implementations of basic packet writing logic, every implementation of TP will have to write length, padding length, payload and padding. Also, right now this API uses EncryptablePayload, which we cannot make fully public and accessible for writing tests as it will mean making all SSHMessages public as well.

Modifications:

Lukasa commented 1 year ago

This breaks our API, but we haven't gone 1.0 yet so this will just take us to 0.5.0.

artemredkin commented 1 year ago

We made parts of TransportProtection APIs public with #97 and we haven't tagged anything yet, this only changes that part, yes