Skip to content

Commit

Permalink
Update dropbear to version 2022.83
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Feb 5, 2024
1 parent 4fc52b7 commit 9bd2e3d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 24 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "src/dropbear/dropbear"]
path = src/dropbear/dropbear
url = https://github.com/mkj/dropbear
[submodule "src/ftpd/pure-ftpd"]
path = src/ftpd/pure-ftpd
url = https://github.com/jedisct1/pure-ftpd
Expand Down
3 changes: 2 additions & 1 deletion src/dropbear/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ignore the install dir
_install/

dropbear-DROPBEAR_2022.83/
*.tar.gz
4 changes: 2 additions & 2 deletions src/dropbear/cleanup.dropbear
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR

cd dropbear
source config.dropbear

make clean
rm -rf "${BUILD_FOLDER}"
3 changes: 2 additions & 1 deletion src/dropbear/compile.dropbear
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR

source config.dropbear

cd dropbear
cd "${BUILD_FOLDER}"

make clean
make -j$(nproc) \
Expand Down
7 changes: 7 additions & 0 deletions src/dropbear/config.dropbear
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

VERSION="2022.83"
MAIN_URL=https://github.com/mkj/dropbear/archive/refs/tags/DROPBEAR_${VERSION}.tar.gz
PACKAGE="DROPBEAR_${VERSION}"
ARCHIVE="${PACKAGE}.tar.gz"
BUILD_FOLDER="dropbear-DROPBEAR_${VERSION}"
1 change: 0 additions & 1 deletion src/dropbear/dropbear
Submodule dropbear deleted from b8669b
21 changes: 15 additions & 6 deletions src/dropbear/init.dropbear
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
#!/bin/bash

CROSSLINK_BASE=${CROSSLINK_BASE:=/home/user/x-tools/arm-sonoff-linux-uclibcgnueabi}

SCRIPT_DIR=$(cd `dirname $0` && pwd)
cd $SCRIPT_DIR

source config.dropbear

rm -rf ./_install

cd dropbear
git reset --hard
if [ ! -f "${ARCHIVE}" ]; then
wget "${MAIN_URL}"
fi

tar xvf "${ARCHIVE}"

cd "${BUILD_FOLDER}"

autoconf; autoheader || exit 1

./configure \
./configure CC=arm-sonoff-linux-uclibcgnueabi-gcc \
--prefix=$SCRIPT_DIR/_install \
CFLAGS="-Os -I${CROSSLINK_BASE}/arm-sonoff-linux-uclibcgnueabi/sysroot/usr/include -L${CROSSLINK_BASE}/arm-sonoff-linux-uclibcgnueabi/sysroot/lib" \
--host=arm-sonoff-linux-uclibcgnueabi \
AR=arm-sonoff-linux-uclibcgnueabi-ar \
RANLIB=arm-sonoff-linux-uclibcgnueabi-ranlib \
--host=arm \
--disable-zlib \
--disable-harden \
--disable-syslog \
|| exit 1

cp ../localoptions.h ./ || exit 1
17 changes: 8 additions & 9 deletions src/dropbear/localoptions.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#ifndef DROPBEAR_LOCALOPTIONS_H
#define DROPBEAR_LOCALOPTIONS_H

#define DSS_PRIV_FILENAME "/etc/dropbear/dropbear_dss_host_key"
#define RSA_PRIV_FILENAME "/etc/dropbear/dropbear_rsa_host_key"
#define ECDSA_PRIV_FILENAME "/etc/dropbear/dropbear_ecdsa_host_key"
#define ED25519_PRIV_FILENAME "/etc/dropbear/dropbear_ed25519_host_key"
#define DSS_PRIV_FILENAME "/tmp/sd/yi-hack/etc/dropbear/dropbear_dss_host_key"
#define RSA_PRIV_FILENAME "/tmp/sd/yi-hack/etc/dropbear/dropbear_rsa_host_key"
#define ECDSA_PRIV_FILENAME "/tmp/sd/yi-hack/etc/dropbear/dropbear_ecdsa_host_key"
#define ED25519_PRIV_FILENAME "/tmp/sd/yi-hack/etc/dropbear/dropbear_ed25519_host_key"

#define DROPBEAR_PATH_SSH_PROGRAM "/mnt/mmc/sonoff-hack/bin/dbclient"
#define DROPBEAR_PATH_SSH_PROGRAM "/tmp/sd/yi-hack/bin/dbclient"

#define DEFAULT_PATH "/usr/bin:/bin:/gm/bin:/gm/tools:/mnt/mmc/sonoff-hack/bin:/mnt/mmc/sonoff-hack/usr/bin"
#define DEFAULT_ROOT_PATH "/usr/bin:/usr/sbin:/bin:/sbin:/gm/bin:/gm/tools:/mnt/mmc/sonoff-hack/bin:/mnt/mmc/sonoff-hack/sbin:/mnt/mmc/sonoff-hack/usr/bin:/mnt/mmc/sonoff-hack/usr/sbin"

#define SFTPSERVER_PATH "/mnt/mmc/sonoff-hack/usr/libexec/sftp-server"
#define DEFAULT_PATH "/usr/bin:/usr/sbin:/bin:/sbin:/gm/bin:/gm/tools:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin:/tmp/sd/yi-hack/usr/bin:/tmp/sd/yi-hack/usr/sbin"
#define DEFAULT_ROOT_PATH "/usr/bin:/usr/sbin:/bin:/sbin:/gm/bin:/gm/tools:/tmp/sd/yi-hack/bin:/tmp/sd/yi-hack/sbin:/tmp/sd/yi-hack/usr/bin:/tmp/sd/yi-hack/usr/sbin"

#define SFTPSERVER_PATH "/tmp/sd/yi-hack/usr/libexec/sftp-server"

#endif /* DROPBEAR_LOCALOPTIONS_H */
2 changes: 1 addition & 1 deletion src/static/static/sonoff-hack/script/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ if [[ $(get_config SSHD) == "yes" ]] ; then
dropbearkey -t ecdsa -f /tmp/dropbear_ecdsa_host_key
mv /tmp/dropbear_ecdsa_host_key $SONOFF_HACK_PREFIX/etc/dropbear/
fi
dropbear -E -r $SONOFF_HACK_PREFIX/etc/dropbear/dropbear_ecdsa_host_key
dropbear -r $SONOFF_HACK_PREFIX/etc/dropbear/dropbear_ecdsa_host_key
fi

if [[ $(get_config NTPD) == "yes" ]] ; then
Expand Down

0 comments on commit 9bd2e3d

Please sign in to comment.