aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tinyssh/keepalive-not-implemented.patch
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2015-07-19 14:17:31 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2015-07-20 06:59:25 +0000
commitd83d72586061c304bc02aa505bf131dbbc7d81f8 (patch)
tree7ef478c354e145ce741264e156f727a1071ffff5 /testing/tinyssh/keepalive-not-implemented.patch
parent23cd29abe11fcc8679157f34900c02c9359d0748 (diff)
downloadaports-d83d72586061c304bc02aa505bf131dbbc7d81f8.tar.bz2
aports-d83d72586061c304bc02aa505bf131dbbc7d81f8.tar.xz
testing/tinyssh: fix keepalive not implemented
this fixes sessions being reset when a keepalive is sent
Diffstat (limited to 'testing/tinyssh/keepalive-not-implemented.patch')
-rw-r--r--testing/tinyssh/keepalive-not-implemented.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/testing/tinyssh/keepalive-not-implemented.patch b/testing/tinyssh/keepalive-not-implemented.patch
new file mode 100644
index 0000000000..19c21c1c23
--- /dev/null
+++ b/testing/tinyssh/keepalive-not-implemented.patch
@@ -0,0 +1,84 @@
+diff --git a/tinyssh-tests/packet_uinmplementedtest.c b/tinyssh-tests/packet_uinmplementedtest.c
+new file mode 120000
+index 0000000..c1c5f9b
+--- /dev/null
++++ b/tinyssh-tests/packet_uinmplementedtest.c
+@@ -0,0 +1 @@
++emptytest.c
+\ No newline at end of file
+diff --git a/tinyssh/LIBS b/tinyssh/LIBS
+index 7f1bcf5..9c1f27a 100644
+--- a/tinyssh/LIBS
++++ b/tinyssh/LIBS
+@@ -36,6 +36,7 @@ packetparser.o
+ packet_put.o
+ packet_recv.o
+ packet_send.o
++packet_uinmplemented.o
+ porttostr.o
+ randommod.o
+ readall.o
+diff --git a/tinyssh/SOURCES b/tinyssh/SOURCES
+index be77a5f..613535d 100644
+--- a/tinyssh/SOURCES
++++ b/tinyssh/SOURCES
+@@ -36,6 +36,7 @@ packetparser
+ packet_put
+ packet_recv
+ packet_send
++packet_uinmplemented
+ porttostr
+ randommod
+ readall
+diff --git a/tinyssh/packet.h b/tinyssh/packet.h
+index 891ede8..b2cba92 100644
+--- a/tinyssh/packet.h
++++ b/tinyssh/packet.h
+@@ -127,4 +127,7 @@ extern int packet_channel_send_windowadjust(struct buf *);
+ extern void packet_channel_send_eof(struct buf *);
+ extern int packet_channel_send_close(struct buf *, int, int);
+
++/* packet_uinmplemented.c */
++extern int packet_uinmplemented(struct buf *);
++
+ #endif
+diff --git a/tinyssh/packet_uinmplemented.c b/tinyssh/packet_uinmplemented.c
+new file mode 100644
+index 0000000..1ca82d6
+--- /dev/null
++++ b/tinyssh/packet_uinmplemented.c
+@@ -0,0 +1,18 @@
++/*
++20150719
++Jan Mojzis
++Public domain.
++*/
++
++#include "buf.h"
++#include "ssh.h"
++#include "packet.h"
++
++int packet_uinmplemented(struct buf *b) {
++
++ buf_purge(b);
++ buf_putnum8(b, SSH_MSG_UNIMPLEMENTED); /* SSH_MSG_UNIMPLEMENTED */
++ buf_putnum32(b, packet.receivepacketid); /* packeid */
++ packet_put(b);
++ return packet_sendall();
++}
+diff --git a/tinyssh/tinysshd.c b/tinyssh/tinysshd.c
+index ba44584..78677f5 100644
+--- a/tinyssh/tinysshd.c
++++ b/tinyssh/tinysshd.c
+@@ -300,8 +300,8 @@ int main(int argc, char **argv) {
+ case SSH_MSG_KEXINIT:
+ goto rekeying;
+ default:
+- die_fatal("unknown message type", 0, 0);
+- /* XXX TODO - send SSH_MSG_UNIMPLEMENTED */
++ log_d1("unknown packet - sending SSH_MSG_UNIMPLEMENTED message");
++ if (!packet_uinmplemented(&b1)) die_fatal("unable to send SSH_MSG_UNIMPLEMENTED message", 0, 0);
+ }
+ }
+ }
+