summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2006-03-28 16:04:11 +0000
committerMatt Johnston <matt@ucc.asn.au>2006-03-28 16:04:11 +0000
commitd6d67025fce029d66bc0aee1002851dd4a0e4531 (patch)
tree96787af5cb5972d9c8be6f35ad58de98698cd75c
parent07896ad419cc7e4d5e58eae9e1df1960e670efcf (diff)
downloaddropbear-d6d67025fce029d66bc0aee1002851dd4a0e4531.tar.gz
smaller yet again
-rw-r--r--AXIS-README27
-rw-r--r--Makefile.in5
-rw-r--r--common-channel.c2
-rw-r--r--compat.c2
-rw-r--r--dbutil.h4
-rw-r--r--fake-rfc2553.h46
-rw-r--r--signkey.c6
-rw-r--r--svr-auth.c2
-rw-r--r--svr-session.c4
9 files changed, 71 insertions, 27 deletions
diff --git a/AXIS-README b/AXIS-README
index 5fc024c..6db3480 100644
--- a/AXIS-README
+++ b/AXIS-README
@@ -66,3 +66,30 @@ svr-authpubkey.o svr-session.o svr-service.o svr-chansession.o svr-runopts.o
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.
diff --git a/Makefile.in b/Makefile.in
index fc17c1f..2f5acb2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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 @@ CLIOBJS=cli-algo.o cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o \
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
diff --git a/common-channel.c b/common-channel.c
index 9a7eda2..32b7b93 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -883,7 +883,7 @@ static void send_msg_channel_open_confirmation(struct Channel* channel,
}
#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
diff --git a/compat.c b/compat.c
index 7e0c1ac..6f9c94a 100644
--- a/compat.c
+++ b/compat.c
@@ -199,6 +199,7 @@ char *basename(const char *path) {
#endif /* HAVE_BASENAME */
#ifndef HAVE_GETUSERSHELL
+#if 0
/*
* Get a list of shells from /etc/shells, if it exists.
@@ -278,4 +279,5 @@ static char **initshells() {
return (shells);
}
+#endif
#endif /* HAVE_GETUSERSHELL */
diff --git a/dbutil.h b/dbutil.h
index d74e17e..64a0696 100644
--- a/dbutil.h
+++ b/dbutil.h
@@ -68,6 +68,10 @@ void setnonblocking(int fd);
#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_ */
diff --git a/fake-rfc2553.h b/fake-rfc2553.h
index 2ba0f46..053e6a6 100644
--- a/fake-rfc2553.h
+++ b/fake-rfc2553.h
@@ -64,19 +64,19 @@ struct sockaddr_storage {
#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 @@ struct sockaddr_storage {
# 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
diff --git a/signkey.c b/signkey.c
index b8afb58..d7f64b2 100644
--- a/signkey.c
+++ b/signkey.c
@@ -259,6 +259,9 @@ void sign_key_free(sign_key *key) {
TRACE(("leave sign_key_free"))
}
+/* don't need fingerprints */
+#if 0
+
static char hexdig(unsigned char x) {
if (x > 0xf)
@@ -353,6 +356,7 @@ char * sign_key_fingerprint(unsigned char* keyblob, unsigned int keybloblen) {
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 @@ void buf_put_sign(buffer* buf, sign_key *key, int type,
}
#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 @@ int buf_verify(buffer * buf, sign_key *key, const unsigned char *data,
#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
diff --git a/svr-auth.c b/svr-auth.c
index 77336d1..1f0f740 100644
--- a/svr-auth.c
+++ b/svr-auth.c
@@ -276,7 +276,9 @@ static int checkusername(unsigned char *username, unsigned int userlen) {
#endif
goodshell:
+#if 0
endusershell();
+#endif
TRACE(("matching shell"))
TRACE(("uid = %d", ses.authstate.pw->pw_uid))
diff --git a/svr-session.c b/svr-session.c
index b335556..193cdc8 100644
--- a/svr-session.c
+++ b/svr-session.c
@@ -182,11 +182,13 @@ void svr_dropbear_log(int priority, const char* format, va_list param) {
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);
}
}