mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-14 17:47:33 -05:00
Fix mishandling of refusal to compress in SSH-1.
I've just noticed that we call ssh1_bpp_start_compression even if the server responded to our compression request with SSH1_SMSG_FAILURE! Also, while I'm here, there's a potential race condition if the server were to send an unrelated message (such as SSH1_MSG_IGNORE) immediately after the SSH1_SMSG_SUCCESS that indicates compression being enabled - the BPP would try to decode the compressed IGNORE message before the SUCCESS got to the higher layer that would tell the BPP it should have enabled compression. Fixed that by changing the method by which we tell the BPP what's going on.
This commit is contained in:
6
sshbpp.h
6
sshbpp.h
@ -34,7 +34,11 @@ BinaryPacketProtocol *ssh1_bpp_new(void);
|
||||
void ssh1_bpp_new_cipher(BinaryPacketProtocol *bpp,
|
||||
const struct ssh1_cipheralg *cipher,
|
||||
const void *session_key);
|
||||
void ssh1_bpp_start_compression(BinaryPacketProtocol *bpp);
|
||||
/* requested_compression() notifies the SSH-1 BPP that we've just sent
|
||||
* a request to enable compression, which means that on receiving the
|
||||
* next SSH1_SMSG_SUCCESS or SSH1_SMSG_FAILURE message, it should set
|
||||
* up zlib compression if it was SUCCESS. */
|
||||
void ssh1_bpp_requested_compression(BinaryPacketProtocol *bpp);
|
||||
|
||||
/*
|
||||
* Structure that tracks how much data is sent and received, for
|
||||
|
Reference in New Issue
Block a user