changeset 316:dc6173e09ff7 ucc-axis-hack

smaller yet again
author Matt Johnston <matt@ucc.asn.au>
date Tue, 28 Mar 2006 16:04:11 +0000
parents 827f87dfbc22
children 063cf9e8efea
files AXIS-README Makefile.in common-channel.c compat.c dbutil.h fake-rfc2553.h signkey.c svr-auth.c svr-session.c
diffstat 9 files changed, 71 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/AXIS-README	Mon Mar 27 08:36:44 2006 +0000
+++ b/AXIS-README	Tue Mar 28 16:04:11 2006 +0000
@@ -66,3 +66,30 @@
 svr-agentfwd.o svr-main.o svr-x11fwd.o svr-tcpfwd.o svr-authpam.o
 libtomcrypt/libtomcrypt.a libtommath/libtommath.a  -melinux -s -symbolic
 -static -L /usr/local/cris/lib/gcc-lib/cris/2.96/elinux/ uccrt/*.o
+
+
+---------------
+
+
+Saner again:
+
+Get http://developer.axis.com/download/old/devboard/R1_1_0/devboard-R1_1_0.tgz
+And the cris-dist debian package (we're using 1.16-1).
+
+PATH=/usr/local/cris:$PATH
+
+Build the axis dev env thing with 
+"prefix=/space/axis/matt/R1_1_0-prefix ./install"
+
+You'll actually end up with some images which could be flashed, I haven't tried
+them.
+
+PATH=/space/axis/matt/devboard-R1_1_0/devboard/tools:$PATH
+(includes /usr/local/cris too)
+
+In dropbear dir:
+  ./configure CC=gcc_cris CFLAGS="-melinux -muclibc=/space/axis/matt/R1_1_0-prefix -Wall -O2 -DELINUX" --disable-zlib --disable-syslog --host=cris LDFLAGS="-melinux -muclibc=/space/axis/matt/R1_1_0-prefix"
+
+make, it should work.
+
+If you strip it, it won't work. -Os should work.
--- a/Makefile.in	Mon Mar 27 08:36:44 2006 +0000
+++ b/Makefile.in	Tue Mar 28 16:04:11 2006 +0000
@@ -10,7 +10,8 @@
 # Hopefully that seems intuitive.
 
 ifndef PROGRAMS
-	PROGRAMS=dropbear dbclient dropbearkey dropbearconvert
+	PROGRAMS=dropbear
+#	PROGRAMS=dropbear dbclient dropbearkey dropbearconvert
 endif
 
 LTC=libtomcrypt/libtomcrypt.a
@@ -32,7 +33,7 @@
 		cli-authpubkey.o cli-tcpfwd.o cli-channel.o cli-authinteract.o
 
 CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \
-			common-channel.o common-chansession.o termcodes.o loginrec.o \
+			common-channel.o common-chansession.o termcodes.o \
 			tcp-accept.o listener.o process-packet.o \
 			common-runopts.o circbuffer.o
 
--- a/common-channel.c	Mon Mar 27 08:36:44 2006 +0000
+++ b/common-channel.c	Tue Mar 28 16:04:11 2006 +0000
@@ -883,7 +883,7 @@
 }
 
 #if defined(USING_LISTENERS) || defined(DROPBEAR_CLIENT)
-matterror
+#error Remove this line if you intend to compile listeners (ie tcp fwding, client) in.
 /* Create a new channel, and start the open request. This is intended
  * for X11, agent, tcp forwarding, and should be filled with channel-specific
  * options, with the calling function calling encrypt_packet() after
--- a/compat.c	Mon Mar 27 08:36:44 2006 +0000
+++ b/compat.c	Tue Mar 28 16:04:11 2006 +0000
@@ -199,6 +199,7 @@
 #endif /* HAVE_BASENAME */
 
 #ifndef HAVE_GETUSERSHELL
+#if 0
 
 /*
  * Get a list of shells from /etc/shells, if it exists.
@@ -278,4 +279,5 @@
 	return (shells);
 }
 
+#endif
 #endif /* HAVE_GETUSERSHELL */
--- a/dbutil.h	Mon Mar 27 08:36:44 2006 +0000
+++ b/dbutil.h	Tue Mar 28 16:04:11 2006 +0000
@@ -68,6 +68,10 @@
 #define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL}
 
 /* Dropbear assertion */
+#ifndef NDEBUG
 #define dropbear_assert(X) do { if (!(X)) { fail_assert(#X, __FILE__, __LINE__); } } while (0)
+#else
+#define dropbear_assert(X)
+#endif
 
 #endif /* _DBUTIL_H_ */
--- a/fake-rfc2553.h	Mon Mar 27 08:36:44 2006 +0000
+++ b/fake-rfc2553.h	Tue Mar 28 16:04:11 2006 +0000
@@ -64,19 +64,19 @@
 #endif /* !IN6_IS_ADDR_LOOPBACK */
 
 #ifndef HAVE_STRUCT_IN6_ADDR
-// struct in6_addr {
-//	u_int8_t	s6_addr[16];
-// };
+struct in6_addr {
+	u_int8_t	s6_addr[16];
+};
 #endif /* !HAVE_STRUCT_IN6_ADDR */
 
-// #ifndef HAVE_STRUCT_SOCKADDR_IN6
-// struct sockaddr_in6 {
-// 	unsigned short	sin6_family;
-// 	u_int16_t	sin6_port;
-// 	u_int32_t	sin6_flowinfo;
-// 	struct in6_addr	sin6_addr;
-// };
-// #endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
+#ifndef HAVE_STRUCT_SOCKADDR_IN6
+struct sockaddr_in6 {
+	unsigned short	sin6_family;
+	u_int16_t	sin6_port;
+	u_int32_t	sin6_flowinfo;
+	struct in6_addr	sin6_addr;
+};
+#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
 
 #ifndef AF_INET6
 /* Define it to something that should never appear */
@@ -120,18 +120,18 @@
 # define EAI_NONAME	3
 #endif
 
-// #ifndef HAVE_STRUCT_ADDRINFO
-// struct addrinfo {
-// 	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME */
-// 	int	ai_family;	/* PF_xxx */
-// 	int	ai_socktype;	/* SOCK_xxx */
-// 	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
-// 	size_t	ai_addrlen;	/* length of ai_addr */
-// 	char	*ai_canonname;	/* canonical name for hostname */
-// 	struct sockaddr *ai_addr;	/* binary address */
-// 	struct addrinfo *ai_next;	/* next structure in linked list */
-// };
-// #endif /* !HAVE_STRUCT_ADDRINFO */
+#ifndef HAVE_STRUCT_ADDRINFO
+struct addrinfo {
+	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME */
+	int	ai_family;	/* PF_xxx */
+	int	ai_socktype;	/* SOCK_xxx */
+	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+	size_t	ai_addrlen;	/* length of ai_addr */
+	char	*ai_canonname;	/* canonical name for hostname */
+	struct sockaddr *ai_addr;	/* binary address */
+	struct addrinfo *ai_next;	/* next structure in linked list */
+};
+#endif /* !HAVE_STRUCT_ADDRINFO */
 
 #ifndef HAVE_GETADDRINFO
 #ifdef getaddrinfo
--- a/signkey.c	Mon Mar 27 08:36:44 2006 +0000
+++ b/signkey.c	Tue Mar 28 16:04:11 2006 +0000
@@ -259,6 +259,9 @@
 	TRACE(("leave sign_key_free"))
 }
 
+/* don't need fingerprints */
+#if 0
+
 static char hexdig(unsigned char x) {
 
 	if (x > 0xf)
@@ -353,6 +356,7 @@
 	return sign_key_sha1_fingerprint(keyblob, keybloblen);
 #endif
 }
+#endif
 
 void buf_put_sign(buffer* buf, sign_key *key, int type, 
 		const unsigned char *data, unsigned int len) {
@@ -384,6 +388,7 @@
 }
 
 #ifdef DROPBEAR_SIGNKEY_VERIFY
+#error Get rid of this line if you intended to have pubkey auth
 /* Return DROPBEAR_SUCCESS or DROPBEAR_FAILURE.
  * If FAILURE is returned, the position of
  * buf is undefined. If SUCCESS is returned, buf will be positioned after the
@@ -428,6 +433,7 @@
 #endif /* DROPBEAR_SIGNKEY_VERIFY */
 
 #ifdef DROPBEAR_KEY_LINES /* ie we're using authorized_keys or known_hosts */
+#error Get rid of this line if you intended to have pubkey auth
 
 /* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE when given a buffer containing
  * a key, a key, and a type. The buffer is positioned at the start of the
--- a/svr-auth.c	Mon Mar 27 08:36:44 2006 +0000
+++ b/svr-auth.c	Tue Mar 28 16:04:11 2006 +0000
@@ -276,7 +276,9 @@
 #endif
 	
 goodshell:
+#if 0
 	endusershell();
+#endif
 	TRACE(("matching shell"))
 
 	TRACE(("uid = %d", ses.authstate.pw->pw_uid))
--- a/svr-session.c	Mon Mar 27 08:36:44 2006 +0000
+++ b/svr-session.c	Tue Mar 28 16:04:11 2006 +0000
@@ -182,11 +182,13 @@
 	if (!svr_opts.usingsyslog || havetrace)
 	{
 		timesec = time(NULL);
+#if 0
 		if (strftime(datestr, sizeof(datestr), "%b %d %H:%M:%S", 
 					localtime(&timesec)) == 0) {
 			datestr[0] = '?'; datestr[1] = '\0';
 		}
-		printf( "[%d] %s %s\n", getpid(), datestr, printbuf);
+#endif
+		printf( "[%d] %d %s\n", getpid(), timesec, printbuf);
 	}
 }