[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/2] Fix connection success dependency on malloc behavior
[Thread Prev] | [Thread Next]
- Subject: [PATCH 0/2] Fix connection success dependency on malloc behavior
- From: Alan Dunn <amdunn@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 5 Feb 2014 20:14:05 -0600
- To: libssh@xxxxxxxxxx
- Cc: Alan Dunn <amdunn@xxxxxxxxx>
Hi folks,
When using libssh with uclibc I noticed that the behavior of
ssh_packet_socket_callback ultimately depends on the behavior of
malloc (which can be different than glibc's depending on compile-time
flags). This is due to circumstances where decryption of zero length
buffers is attempted. The following patch set removes a particular
attempt to decrypt zero bytes and makes packet {en,de}cryption fail
deterministically (regardless of malloc behavior) on zero length
attempts.
Tested with unit tests and examples/sample.c connecting to OpenSSH
sshd. SSH1 code untested (experienced unexpected problems getting
libssh to be an SSH1 client and server), but seems likely to work.
Alan Dunn (2):
packet: Do not decrypt zero length rest of buffer
packet_crypt: Make packet_{en,de}crypt fail consistently on len == 0
src/packet.c | 16 ++++++++++------
src/packet1.c | 5 ++++-
src/packet_crypt.c | 6 ++++--
3 files changed, 18 insertions(+), 9 deletions(-)
--
1.7.9.5
| [PATCH 1/2] packet: Do not decrypt zero length rest of buffer | Alan Dunn <amdunn@xxxxxxxxx> |
| [PATCH 2/2] packet_crypt: Make packet_{en,de}crypt fail consistently on len == 0 | Alan Dunn <amdunn@xxxxxxxxx> |