Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of the encryptPacket method #123

Merged
merged 1 commit into from
Nov 21, 2022

Commits on Nov 7, 2022

  1. refactoring of the encryptPacket method

    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:
     - Extract packet writing logic to a separate function that will be
       used by both plaintext and ciphertext modes
     - Removes usage of EncryptablePayload
     - Write plaintext packet structure (including payload) in the parser
     - TransportProtection implementations now only have to encrypt and tag
    artemredkin committed Nov 7, 2022
    Configuration menu
    Copy the full SHA
    f31df60 View commit details
    Browse the repository at this point in the history