Patch to fix compilation of 0.48.1

Simon Rowe srowe at cambridgebroadband.com
Thu Mar 30 21:59:14 WST 2006


dropbear 0.48.1 will not compile with gcc 2.96, there are a number of places 
where variables as declared after function code. The attached patch fixes 
those we've encountered.


--- third-party/dropbear/cli-auth.c	29 Mar 2006 12:57:19 -0000	1.1.1.3
+++ third-party/dropbear/cli-auth.c	30 Mar 2006 13:44:16 -0000	1.1.1.3.2.2
@@ -236,9 +236,9 @@
 
 void cli_auth_try() {
 
-	TRACE(("enter cli_auth_try"))
 	int finished = 0;
+	TRACE(("enter cli_auth_try"))
 
 	CHECKCLEARTOWRITE();
 	
--- third-party/dropbear/cli-chansession.c	29 Mar 2006 12:57:19 -0000	1.1.1.3
+++ third-party/dropbear/cli-chansession.c	30 Mar 2006 13:45:30 -0000	
1.1.1.3.2.2
@@ -162,7 +162,6 @@
 
 static void put_termcodes() {
 
-	TRACE(("enter put_termcodes"))
 
 	struct termios tio;
 	unsigned int sshcode;
@@ -171,7 +170,8 @@
 	unsigned int mapcode;
 
 	unsigned int bufpos1, bufpos2;
+	TRACE(("enter put_termcodes"))
 
 	if (tcgetattr(STDIN_FILENO, &tio) == -1) {
 		dropbear_log(LOG_WARNING, "Failed reading termmodes");
--- third-party/dropbear/random.c	29 Mar 2006 12:57:19 -0000	1.1.1.4
+++ third-party/dropbear/random.c	29 Mar 2006 14:03:31 -0000	1.1.1.1.24.2
@@ -158,6 +158,8 @@
 
     pid_t pid;
     struct timeval tv;
+	hash_state hs;
+	unsigned char hash[SHA1_HASH_SIZE];
 
 	if (!donerandinit) {
 		dropbear_exit("seedrandom not done");
@@ -166,8 +168,6 @@
     pid = getpid();
     gettimeofday(&tv, NULL);
 
-	hash_state hs;
-	unsigned char hash[SHA1_HASH_SIZE];
 	sha1_init(&hs);
 	sha1_process(&hs, (void*)hashpool, sizeof(hashpool));
 	sha1_process(&hs, (void*)&pid, sizeof(pid));



More information about the Dropbear mailing list