]> Cypherpunks repositories - gostls13.git/commit
exp/ssh: fix length header leaking into channel data streams.
authorDave Cheney <dave@cheney.net>
Sat, 29 Oct 2011 18:22:30 +0000 (14:22 -0400)
committerAdam Langley <agl@golang.org>
Sat, 29 Oct 2011 18:22:30 +0000 (14:22 -0400)
commit0f6b80c69498d2047d584d365e4056ced9f38adc
tree390f17df906791db12f2a722be5f4679e09ad5a7
parent604e10c34d359f6522b076e488dccd7b075f4bc7
exp/ssh: fix length header leaking into channel data streams.

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
src/pkg/exp/ssh/client.go
src/pkg/exp/ssh/messages.go
src/pkg/exp/ssh/server.go