• Dave Cheney's avatar
    exp/ssh: fix length header leaking into channel data streams. · 0f6b80c6
    Dave Cheney authored
    The payload of a data message is defined as an SSH string type,
    which uses the first four bytes to encode its length. When channelData
    and channelExtendedData were added I defined Payload as []byte to
    be able to use it directly without a string to []byte conversion. This
    resulted in the length data leaking into the payload data.
    
    This CL fixes the bug, and restores agl's original fast path code.
    
    Additionally, a bug whereby s.lock was not released if a packet arrived
    for an invalid channel has been fixed.
    
    Finally, as they were no longer used, I have removed
    the channelData and channelExtedendData structs.
    
    R=agl, rsc
    CC=golang-dev
    https://golang.org/cl/5330053
    0f6b80c6
client.go 13.8 KB