aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/dropbear/dropbear
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/dropbear/dropbear
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/dropbear/dropbear')
-rw-r--r--recipes/dropbear/dropbear/allow-nopw.patch37
-rw-r--r--recipes/dropbear/dropbear/configure.patch27
-rw-r--r--recipes/dropbear/dropbear/fix-2kb-keys.patch11
-rwxr-xr-xrecipes/dropbear/dropbear/init104
-rw-r--r--recipes/dropbear/dropbear/openmoko/default1
-rw-r--r--recipes/dropbear/dropbear/urandom-xauth-changes-to-options.h.patch21
6 files changed, 201 insertions, 0 deletions
diff --git a/recipes/dropbear/dropbear/allow-nopw.patch b/recipes/dropbear/dropbear/allow-nopw.patch
new file mode 100644
index 0000000000..1a709b8da0
--- /dev/null
+++ b/recipes/dropbear/dropbear/allow-nopw.patch
@@ -0,0 +1,37 @@
+diff -Nurd dropbear-0.45/svr-auth.c dropbear-0.45.patched/svr-auth.c
+--- dropbear-0.45/svr-auth.c 2005-03-06 20:27:02.000000000 -0800
++++ dropbear-0.45.patched/svr-auth.c 2005-03-08 15:22:43.998592744 -0800
+@@ -237,6 +237,7 @@
+ }
+
+ /* check for an empty password */
++#ifdef DISALLOW_EMPTY_PW
+ if (ses.authstate.pw->pw_passwd[0] == '\0') {
+ TRACE(("leave checkusername: empty pword"))
+ dropbear_log(LOG_WARNING, "user '%s' has blank password, rejected",
+@@ -244,7 +245,7 @@
+ send_msg_userauth_failure(0, 1);
+ return DROPBEAR_FAILURE;
+ }
+-
++#endif
+ TRACE(("shell is %s", ses.authstate.pw->pw_shell))
+
+ /* check that the shell is set */
+diff -Nurd dropbear-0.45/svr-authpasswd.c dropbear-0.45.patched/svr-authpasswd.c
+--- dropbear-0.45/svr-authpasswd.c 2005-03-06 20:27:02.000000000 -0800
++++ dropbear-0.45.patched/svr-authpasswd.c 2005-03-08 15:22:44.010591023 -0800
+@@ -64,9 +64,13 @@
+ * since the shadow password may differ to that tested
+ * in auth.c */
+ if (passwdcrypt[0] == '\0') {
++#ifdef DISALLOW_EMPTY_PASSWD
+ dropbear_log(LOG_WARNING, "user '%s' has blank password, rejected",
+ ses.authstate.printableuser);
+ send_msg_userauth_failure(0, 1);
++#else
++ send_msg_userauth_success();
++#endif
+ return;
+ }
+
diff --git a/recipes/dropbear/dropbear/configure.patch b/recipes/dropbear/dropbear/configure.patch
new file mode 100644
index 0000000000..9ae84b2604
--- /dev/null
+++ b/recipes/dropbear/dropbear/configure.patch
@@ -0,0 +1,27 @@
+diff -Nurd dropbear-0.45/configure.in dropbear-0.45.patched/configure.in
+--- dropbear-0.45/configure.in 2005-03-06 20:27:02.000000000 -0800
++++ dropbear-0.45.patched/configure.in 2005-03-08 15:22:44.040586721 -0800
+@@ -161,15 +161,20 @@
+ AC_MSG_RESULT(Not using openpty)
+ else
+ AC_MSG_RESULT(Using openpty if available)
+- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
++ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
+ fi
+ ],
+ [
+ AC_MSG_RESULT(Using openpty if available)
+- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
++ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
+ ]
+ )
+-
++
++if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
++ AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
++ no_ptc_check=yes
++ no_ptmx_check=yes
++fi
+
+ AC_ARG_ENABLE(syslog,
+ [ --disable-syslog Don't include syslog support],
diff --git a/recipes/dropbear/dropbear/fix-2kb-keys.patch b/recipes/dropbear/dropbear/fix-2kb-keys.patch
new file mode 100644
index 0000000000..ba2b19d44a
--- /dev/null
+++ b/recipes/dropbear/dropbear/fix-2kb-keys.patch
@@ -0,0 +1,11 @@
+diff -Nurd dropbear-0.45/kex.h dropbear-0.45.patched/kex.h
+--- dropbear-0.45/kex.h 2005-03-06 20:27:02.000000000 -0800
++++ dropbear-0.45.patched/kex.h 2005-03-08 15:22:44.064583279 -0800
+@@ -64,6 +64,6 @@
+
+ };
+
+-#define MAX_KEXHASHBUF 2000
++#define MAX_KEXHASHBUF 3000
+
+ #endif /* _KEX_H_ */
diff --git a/recipes/dropbear/dropbear/init b/recipes/dropbear/dropbear/init
new file mode 100755
index 0000000000..5c8dfc12a8
--- /dev/null
+++ b/recipes/dropbear/dropbear/init
@@ -0,0 +1,104 @@
+#!/bin/sh
+#
+# Do not configure this file. Edit /etc/default/dropbear instead!
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dropbear
+NAME=dropbear
+DESC="Dropbear SSH server"
+
+DROPBEAR_PORT=22
+DROPBEAR_EXTRA_ARGS=
+NO_START=0
+
+set -e
+
+test ! -r /etc/default/dropbear || . /etc/default/dropbear
+test "$NO_START" = "0" || exit 0
+test -x "$DAEMON" || exit 0
+test ! -h /var/service/dropbear || exit 0
+
+readonly_rootfs=0
+for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
+ case $flag in
+ ro)
+ readonly_rootfs=1
+ ;;
+ esac
+done
+
+if [ $readonly_rootfs = "1" ]; then
+ mkdir -p /var/lib/dropbear
+ DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
+ DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
+else
+ DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
+ DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
+fi
+
+test -z "$DROPBEAR_BANNER" || \
+ DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
+test -n "$DROPBEAR_RSAKEY" || \
+ DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
+test -n "$DROPBEAR_DSSKEY" || \
+ DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
+test -n "$DROPBEAR_KEYTYPES" || \
+ DROPBEAR_KEYTYPES="rsa"
+
+gen_keys() {
+for t in $DROPBEAR_KEYTYPES; do
+ case $t in
+ rsa)
+ if [ ! -f $DROPBEAR_RSAKEY ]; then
+ echo "Creating $DESC RSA host key."
+ dropbearkey -t rsa -f $DROPBEAR_RSAKEY
+ fi
+ ;;
+ dsa)
+ if [ ! -f $DROPBEAR_DSSKEY ]; then
+ echo "Creating $DESC DSA host key."
+ dropbearkey -t dss -f $DROPBEAR_DSSKEY
+ fi
+ ;;
+ esac
+done
+}
+
+case "$1" in
+ start)
+ gen_keys
+ echo -n "Starting $DESC: "
+ KEY_ARGS=""
+ test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
+ test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
+ start-stop-daemon -S \
+ -x "$DAEMON" -- $KEY_ARGS \
+ -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -K -x "$DAEMON"
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon -K -x "$DAEMON"
+ sleep 1
+ KEY_ARGS=""
+ test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
+ test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
+ start-stop-daemon -S \
+ -x "$DAEMON" -- $KEY_ARGS \
+ -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/dropbear/dropbear/openmoko/default b/recipes/dropbear/dropbear/openmoko/default
new file mode 100644
index 0000000000..19816b32a6
--- /dev/null
+++ b/recipes/dropbear/dropbear/openmoko/default
@@ -0,0 +1 @@
+DROPBEAR_PORT=`ip addr list usb0 | awk 'BEGIN { FS="[ /]+" } /inet / { print $3 }'`:22
diff --git a/recipes/dropbear/dropbear/urandom-xauth-changes-to-options.h.patch b/recipes/dropbear/dropbear/urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 0000000000..e2b1dd5da5
--- /dev/null
+++ b/recipes/dropbear/dropbear/urandom-xauth-changes-to-options.h.patch
@@ -0,0 +1,21 @@
+diff -Nurd dropbear-0.45/options.h dropbear-0.45.patched/options.h
+--- dropbear-0.45/options.h 2005-03-06 20:27:02.000000000 -0800
++++ dropbear-0.45.patched/options.h 2005-03-08 15:25:09.368742090 -0800
+@@ -143,7 +143,7 @@
+ * however significantly reduce the security of your ssh connections
+ * if the PRNG state becomes guessable - make sure you know what you are
+ * doing if you change this. */
+-#define DROPBEAR_RANDOM_DEV "/dev/random"
++#define DROPBEAR_RANDOM_DEV "/dev/urandom"
+
+ /* prngd must be manually set up to produce output */
+ /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
+@@ -167,7 +167,7 @@
+ /* The command to invoke for xauth when using X11 forwarding.
+ * "-q" for quiet */
+ #ifndef XAUTH_COMMAND
+-#define XAUTH_COMMAND "/usr/X11R6/bin/xauth -q"
++#define XAUTH_COMMAND "xauth -q"
+ #endif
+
+ /* if you want to enable running an sftp server (such as the one included with