[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 0/2] Fix connection success dependency on malloc behavior


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.

v2:
- Style changes as suggested by Andreas (with some slight
  modifications: don't reuse variable len which already has a meaning
  and is used in debug statements)

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       |   19 ++++++++++++-------
 src/packet1.c      |   19 +++++++++++++------
 src/packet_crypt.c |   13 +++++++++++--
 3 files changed, 36 insertions(+), 15 deletions(-)

-- 
1.7.9.5


Archive administrator: postmaster@lists.cynapses.org