[DGD] ssh

Felix A. Croes felix at dworkin.nl
Tue Feb 24 23:05:48 CET 2004


It looks as if there is going to be a small sourceforge project to
take care of LPC ssh.  Since ssh is going to be almost universally
useful, thanks to the well-developed tool suite that already exists
for it, I thought it would be best to release it in the public
domain and let the community take care of how it evolves.

I have already cleaned up the code a little, and Erwin Harte has
implemented public key authentication.  In this email I'm including
a quick patch, for those who have run into the "hanging
intermittently during key negotiation" problem.

Regards,
Dworkin


--- snip ---
--- ssh.c.old	Tue Feb 24 12:42:03 2004
+++ ssh.c	Tue Feb 24 12:45:58 2004
@@ -4,6 +4,9 @@
 inherit conn LIB_CONN;
 inherit user LIB_USER;
 
+# define SSHD	"/usr/System/sys/sshd"
+# define SSH	"/usr/System/sys/ssh"
+
 # define DEBUG(mesg)	DRIVER->message("SSH: " + (mesg) + "\n")
 
 # define SSH_MSG_DISCONNECT			1
@@ -300,7 +303,12 @@
 {
     int mode;
 
-    if (previous_program() == LIB_CONN) {
+    if (previous_program() == LIB_CONN || previous_program() == SSH) {
+	if (!buffer) {
+	    buffer = str;
+	    return MODE_NOCHANGE;
+	}
+
 	buffer += str;
 	while (query_conn()) {
 	    if (length < 0) {
@@ -360,7 +368,6 @@
  */
 private void create_packet()
 {
-    buffer = "";
     length = -1;
 }
 
@@ -369,8 +376,6 @@
  *			    Section 2: transport layer			     *
  * ========================================================================= */
 
-# define SSHD	"/usr/System/sys/sshd"
-
 # define TRANSPORT_KEXINIT	0
 # define TRANSPORT_SKIP		1
 # define TRANSPORT_KEXDH	2
@@ -567,6 +572,7 @@
 		     "\0" +
 		     "\0\0\0\0";
     send_packet(server_kexinit);
+    receive_message("");	/* process message in buffer, if any */
 }
 
 /*
--- snip ---
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list