Compare commits
5 Commits
9f86a965ed
...
b642c39109
Author | SHA1 | Date |
---|---|---|
Oliver Smith | b642c39109 | |
Oliver Smith | 19ee605ece | |
Oliver Smith | d6db916831 | |
Oliver Smith | 7207af6bf1 | |
Oliver Smith | b5ea94924d |
|
@ -0,0 +1,110 @@
|
|||
SUMMARY = "A lightweight SSH and SCP implementation"
|
||||
HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
|
||||
SECTION = "console/network"
|
||||
|
||||
# some files are from other projects and have others license terms:
|
||||
# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
|
||||
LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f"
|
||||
|
||||
DEPENDS = "zlib"
|
||||
RPROVIDES_${PN} = "ssh sshd"
|
||||
|
||||
DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
|
||||
|
||||
SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
|
||||
file://0001-urandom-xauth-changes-to-options.h.patch \
|
||||
file://dropbear-disable-weak-ciphers.patch \
|
||||
file://init \
|
||||
file://dropbearkey.service \
|
||||
file://dropbear@.service \
|
||||
file://dropbear.socket \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
|
||||
|
||||
PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
|
||||
file://0006-dropbear-configuration-file.patch \
|
||||
file://dropbear"
|
||||
|
||||
PAM_PLUGINS = "libpam-runtime \
|
||||
pam-plugin-deny \
|
||||
pam-plugin-permit \
|
||||
pam-plugin-unix \
|
||||
"
|
||||
RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)} \
|
||||
sftp-server \
|
||||
"
|
||||
|
||||
inherit autotools update-rc.d systemd
|
||||
|
||||
INITSCRIPT_NAME = "dropbear"
|
||||
INITSCRIPT_PARAMS = "defaults 10"
|
||||
|
||||
SYSTEMD_SERVICE_${PN} = "dropbear.socket"
|
||||
|
||||
SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
|
||||
BINCOMMANDS = "dbclient ssh scp"
|
||||
EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
|
||||
|
||||
PACKAGECONFIG ?= ""
|
||||
PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt"
|
||||
|
||||
EXTRA_OECONF += "\
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
|
||||
|
||||
# This option appends to CFLAGS and LDFLAGS from OE
|
||||
# This is causing [textrel] QA warning
|
||||
EXTRA_OECONF += "--disable-harden"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sysconfdir} \
|
||||
${D}${sysconfdir}/init.d \
|
||||
${D}${sysconfdir}/default \
|
||||
${D}${sysconfdir}/dropbear \
|
||||
${D}${bindir} \
|
||||
${D}${sbindir} \
|
||||
${D}${localstatedir}
|
||||
|
||||
install -m 0755 dropbearmulti ${D}${sbindir}/
|
||||
ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
|
||||
|
||||
for i in ${SBINCOMMANDS}
|
||||
do
|
||||
ln -s ./dropbearmulti ${D}${sbindir}/$i
|
||||
done
|
||||
sed -e 's,/etc,${sysconfdir},g' \
|
||||
-e 's,/usr/sbin,${sbindir},g' \
|
||||
-e 's,/var,${localstatedir},g' \
|
||||
-e 's,/usr/bin,${bindir},g' \
|
||||
-e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear
|
||||
chmod 755 ${D}${sysconfdir}/init.d/dropbear
|
||||
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
|
||||
install -d ${D}${sysconfdir}/pam.d
|
||||
install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
|
||||
fi
|
||||
|
||||
# deal with systemd unit files
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
|
||||
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
|
||||
-e 's,@BINDIR@,${bindir},g' \
|
||||
-e 's,@SBINDIR@,${sbindir},g' \
|
||||
${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
|
||||
}
|
||||
|
||||
inherit update-alternatives
|
||||
|
||||
ALTERNATIVE_PRIORITY = "20"
|
||||
ALTERNATIVE_${PN} = "scp ssh"
|
||||
|
||||
ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
|
||||
|
||||
pkg_postrm_append_${PN} () {
|
||||
if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
|
||||
rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
|
||||
fi
|
||||
if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
|
||||
rm ${sysconfdir}/dropbear/dropbear_dss_host_key
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
---
|
||||
default_options.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/default_options.h b/default_options.h
|
||||
index 349338c..5ffac25 100644
|
||||
--- a/default_options.h
|
||||
+++ b/default_options.h
|
||||
@@ -289,7 +289,7 @@ group1 in Dropbear server too */
|
||||
|
||||
/* The command to invoke for xauth when using X11 forwarding.
|
||||
* "-q" for quiet */
|
||||
-#define XAUTH_COMMAND "/usr/bin/xauth -q"
|
||||
+#define XAUTH_COMMAND "xauth -q"
|
||||
|
||||
|
||||
/* If you want to enable running an sftp server (such as the one included with
|
||||
--
|
||||
2.25.1
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
From b8cece92ba19aa77ac013ea161bfe4c7147747c9 Mon Sep 17 00:00:00 2001
|
||||
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
|
||||
Date: Wed, 2 Dec 2015 11:36:02 +0200
|
||||
Subject: Enable pam
|
||||
|
||||
We need modify file option.h besides enabling pam in
|
||||
configure if we want dropbear to support pam.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
|
||||
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
|
||||
---
|
||||
options.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/options.h b/options.h
|
||||
index 94261f6..90bfe2f 100644
|
||||
--- a/options.h
|
||||
+++ b/options.h
|
||||
@@ -208,10 +208,10 @@ If you test it please contact the Dropbear author */
|
||||
|
||||
/* This requires crypt() */
|
||||
#ifdef HAVE_CRYPT
|
||||
-#define ENABLE_SVR_PASSWORD_AUTH
|
||||
+/*#define ENABLE_SVR_PASSWORD_AUTH*/
|
||||
#endif
|
||||
/* PAM requires ./configure --enable-pam */
|
||||
-/*#define ENABLE_SVR_PAM_AUTH */
|
||||
+#define ENABLE_SVR_PAM_AUTH
|
||||
#define ENABLE_SVR_PUBKEY_AUTH
|
||||
|
||||
/* Whether to take public key options in
|
||||
--
|
||||
2.1.4
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
Subject: [PATCH 6/6] dropbear configuration file
|
||||
|
||||
dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
|
||||
to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
|
||||
Signed-off-by: Maxin B. John <maxin.john@enea.com>
|
||||
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
|
||||
---
|
||||
diff -Naur dropbear-2013.60-orig/svr-authpam.c dropbear-2013.60/svr-authpam.c
|
||||
--- dropbear-2013.60-orig/svr-authpam.c 2013-10-16 16:34:53.000000000 +0200
|
||||
+++ dropbear-2013.60/svr-authpam.c 2013-10-21 17:04:04.969416055 +0200
|
||||
@@ -211,7 +211,7 @@
|
||||
userData.passwd = password;
|
||||
|
||||
/* Init pam */
|
||||
- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
|
||||
+ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
|
||||
dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
|
||||
rc, pam_strerror(pamHandlep, rc));
|
||||
goto cleanup;
|
|
@ -0,0 +1,4 @@
|
|||
#%PAM-1.0
|
||||
|
||||
auth include common-auth
|
||||
account include common-account
|
|
@ -0,0 +1,31 @@
|
|||
From c347ece05a7fdbf50d76cb136b9ed45caed333f6 Mon Sep 17 00:00:00 2001
|
||||
From: Joseph Reynolds <joseph.reynolds1@ibm.com>
|
||||
Date: Thu, 20 Jun 2019 16:29:15 -0500
|
||||
Subject: [PATCH] dropbear: new feature: disable-weak-ciphers
|
||||
|
||||
This feature disables all CBC, SHA1, and diffie-hellman group1 ciphers
|
||||
in the dropbear ssh server and client since they're considered weak ciphers
|
||||
and we want to support the stong algorithms.
|
||||
|
||||
Upstream-Status: Inappropriate [configuration]
|
||||
Signed-off-by: Joseph Reynolds <joseph.reynolds1@ibm.com>
|
||||
---
|
||||
default_options.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/default_options.h b/default_options.h
|
||||
index d417588..bc5200f 100644
|
||||
--- a/default_options.h
|
||||
+++ b/default_options.h
|
||||
@@ -180,7 +180,7 @@ IMPORTANT: Some options will require "make clean" after changes */
|
||||
* Small systems should generally include either curve25519 or ecdh for performance.
|
||||
* curve25519 is less widely supported but is faster
|
||||
*/
|
||||
-#define DROPBEAR_DH_GROUP14_SHA1 1
|
||||
+#define DROPBEAR_DH_GROUP14_SHA1 0
|
||||
#define DROPBEAR_DH_GROUP14_SHA256 1
|
||||
#define DROPBEAR_DH_GROUP16 0
|
||||
#define DROPBEAR_CURVE25519 1
|
||||
--
|
||||
2.25.1
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Conflicts=dropbear.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=22
|
||||
Accept=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
Also=dropbearkey.service
|
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=SSH Per-Connection Server
|
||||
Wants=dropbearkey.service
|
||||
After=syslog.target dropbearkey.service
|
||||
|
||||
[Service]
|
||||
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
|
||||
EnvironmentFile=-/etc/default/dropbear
|
||||
ExecStart=-@SBINDIR@/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
|
||||
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
|
||||
StandardInput=socket
|
||||
KillMode=process
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=SSH Key Generation
|
||||
RequiresMountsFor=/var /var/lib
|
||||
ConditionPathExists=!/etc/dropbear/dropbear_rsa_host_key
|
||||
ConditionPathExists=!/var/lib/dropbear/dropbear_rsa_host_key
|
||||
|
||||
[Service]
|
||||
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
|
||||
EnvironmentFile=-/etc/default/dropbear
|
||||
Type=oneshot
|
||||
ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}
|
||||
ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key
|
||||
RemainAfterExit=yes
|
36
recipes-fixes/dropbear/files/init → recipes-core/dropbear/dropbear/init
Normal file → Executable file
36
recipes-fixes/dropbear/files/init → recipes-core/dropbear/dropbear/init
Normal file → Executable file
|
@ -40,49 +40,28 @@ 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" -a ! -s "$DROPBEAR_RSAKEY" ]; then
|
||||
rm $DROPBEAR_RSAKEY
|
||||
fi
|
||||
test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
|
||||
;;
|
||||
dsa)
|
||||
if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
|
||||
rm $DROPBEAR_DSSKEY
|
||||
fi
|
||||
test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
|
||||
rm $DROPBEAR_RSAKEY || true
|
||||
fi
|
||||
test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: "
|
||||
gen_keys
|
||||
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 -p $PIDFILE \
|
||||
-x "$DAEMON" -- $KEY_ARGS \
|
||||
-x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
|
||||
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
|
||||
echo "$NAME."
|
||||
;;
|
||||
|
@ -95,11 +74,8 @@ case "$1" in
|
|||
echo -n "Restarting $DESC: "
|
||||
start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
|
||||
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 -p $PIDFILE \
|
||||
-x "$DAEMON" -- $KEY_ARGS \
|
||||
-x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
|
||||
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
|
||||
echo "$NAME."
|
||||
;;
|
|
@ -0,0 +1,5 @@
|
|||
require dropbear.inc
|
||||
|
||||
SRC_URI[md5sum] = "a75a34bcc03cacf71a2db9da3b7c94a5"
|
||||
SRC_URI[sha256sum] = "bc5a121ffbc94b5171ad5ebe01be42746d50aa797c9549a4639894a16749443b"
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# Package OpenSSH's sftp server, so the openssh client finds it and doesn't
|
||||
# need to be run with a flag to use the legacy SCP protocol (SYS#6403)
|
||||
SUMMARY = "OpenSSH's sftp-server"
|
||||
DESCRIPTION = "OpenSSH's sftp-server, to be used with dropbear"
|
||||
HOMEPAGE = "http://www.openssh.com/"
|
||||
SECTION = "console/network"
|
||||
LICENSE = "BSD"
|
||||
LIC_FILES_CHKSUM = "file://LICENCE;md5=072979064e691d342002f43cd89c0394"
|
||||
DEPENDS = ""
|
||||
SRC_URI = "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz"
|
||||
|
||||
SRC_URI[md5sum] = "3430d5e6e71419e28f440a42563cb553"
|
||||
SRC_URI[sha256sum] = "e9baba7701a76a51f3d85a62c383a3c9dcd97fa900b859bc7db114c1868af8a8"
|
||||
|
||||
inherit autotools
|
||||
|
||||
EXTRA_OECONF += "--without-openssl --without-zlib"
|
||||
|
||||
S = "${WORKDIR}/openssh-${PV}"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake sftp-server
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -Dm755 "${B}"/sftp-server \
|
||||
-t "${D}"/usr/libexec/
|
||||
}
|
||||
|
||||
FILES_${PN} = "/usr/libexec/sftp-server"
|
|
@ -1,4 +0,0 @@
|
|||
THISDIR := "${@os.path.dirname(d.getVar('FILE', True))}"
|
||||
FILESPATH =. "${@base_set_filespath(["${THISDIR}/files"], d)}:"
|
||||
|
||||
PRINC="4"
|
Loading…
Reference in New Issue