2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2005-10-29 09:01:33 +02:00
|
|
|
#
|
|
|
|
# dropbear
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2005-10-29 09:01:33 +02:00
|
|
|
|
2020-11-03 17:41:29 +01:00
|
|
|
DROPBEAR_VERSION = 2020.81
|
2018-02-12 09:21:50 +01:00
|
|
|
DROPBEAR_SITE = https://matt.ucc.asn.au/dropbear/releases
|
2013-03-21 09:02:23 +01:00
|
|
|
DROPBEAR_SOURCE = dropbear-$(DROPBEAR_VERSION).tar.bz2
|
2020-06-22 09:39:33 +02:00
|
|
|
DROPBEAR_LICENSE = MIT, BSD-2-Clause, Public domain
|
2012-11-13 02:05:40 +01:00
|
|
|
DROPBEAR_LICENSE_FILES = LICENSE
|
2015-02-04 19:33:29 +01:00
|
|
|
DROPBEAR_TARGET_BINS = dropbearkey dropbearconvert scp
|
|
|
|
DROPBEAR_PROGRAMS = dropbear $(DROPBEAR_TARGET_BINS)
|
2021-01-14 23:34:30 +01:00
|
|
|
DROPBEAR_CPE_ID_VENDOR = dropbear_ssh_project
|
2021-01-18 18:41:51 +01:00
|
|
|
DROPBEAR_CPE_ID_PRODUCT = dropbear_ssh
|
2015-02-04 19:33:29 +01:00
|
|
|
|
2018-04-28 17:31:43 +02:00
|
|
|
# Disable hardening flags added by dropbear configure.ac, and let
|
|
|
|
# Buildroot add them when the relevant options are enabled. This
|
|
|
|
# prevents dropbear from using SSP support when not available.
|
|
|
|
DROPBEAR_CONF_OPTS = --disable-harden
|
|
|
|
|
2015-02-04 19:33:29 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_DROPBEAR_CLIENT),y)
|
|
|
|
# Build dbclient, and create a convenience symlink named ssh
|
|
|
|
DROPBEAR_PROGRAMS += dbclient
|
|
|
|
DROPBEAR_TARGET_BINS += dbclient ssh
|
|
|
|
endif
|
|
|
|
|
|
|
|
DROPBEAR_MAKE = \
|
|
|
|
$(MAKE) MULTI=1 SCPPROGRESS=1 \
|
|
|
|
PROGRAMS="$(DROPBEAR_PROGRAMS)"
|
2012-11-13 02:05:40 +01:00
|
|
|
|
2018-05-07 14:28:43 +02:00
|
|
|
# With BR2_SHARED_STATIC_LIBS=y the generic infrastructure adds a
|
|
|
|
# --enable-static flags causing dropbear to be built as a static
|
|
|
|
# binary. Adding a --disable-static reverts this
|
|
|
|
ifeq ($(BR2_SHARED_STATIC_LIBS),y)
|
|
|
|
DROPBEAR_CONF_OPTS += --disable-static
|
2011-05-13 12:04:10 +02:00
|
|
|
endif
|
|
|
|
|
2018-06-29 14:21:09 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
|
|
|
|
define DROPBEAR_SVR_PAM_AUTH
|
|
|
|
echo '#define DROPBEAR_SVR_PASSWORD_AUTH 0' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_SVR_PAM_AUTH 1' >> $(@D)/localoptions.h
|
|
|
|
endef
|
|
|
|
define DROPBEAR_INSTALL_PAM_CONF
|
|
|
|
$(INSTALL) -D -m 644 package/dropbear/etc-pam.d-sshd $(TARGET_DIR)/etc/pam.d/sshd
|
|
|
|
endef
|
|
|
|
DROPBEAR_DEPENDENCIES += linux-pam
|
|
|
|
DROPBEAR_CONF_OPTS += --enable-pam
|
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_SVR_PAM_AUTH
|
|
|
|
DROPBEAR_POST_INSTALL_TARGET_HOOKS += DROPBEAR_INSTALL_PAM_CONF
|
|
|
|
else
|
2018-03-28 10:38:26 +02:00
|
|
|
# Ensure that dropbear doesn't use crypt() when it's not available
|
|
|
|
define DROPBEAR_SVR_PASSWORD_AUTH
|
|
|
|
echo '#if !HAVE_CRYPT' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_SVR_PASSWORD_AUTH 0' >> $(@D)/localoptions.h
|
|
|
|
echo '#endif' >> $(@D)/localoptions.h
|
2010-09-01 22:42:27 +02:00
|
|
|
endef
|
2018-03-28 10:38:26 +02:00
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_SVR_PASSWORD_AUTH
|
2018-06-29 14:21:09 +02:00
|
|
|
endif
|
2010-09-01 22:42:27 +02:00
|
|
|
|
2020-06-25 09:58:41 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_DROPBEAR_LEGACY_CRYPTO),y)
|
|
|
|
define DROPBEAR_ENABLE_LEGACY_CRYPTO
|
|
|
|
echo '#define DROPBEAR_3DES 1' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_ENABLE_CBC_MODE 1' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_SHA1_96_HMAC 1' >> $(@D)/localoptions.h
|
|
|
|
endef
|
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_LEGACY_CRYPTO
|
|
|
|
else
|
2018-07-03 09:48:10 +02:00
|
|
|
define DROPBEAR_DISABLE_LEGACY_CRYPTO
|
|
|
|
echo '#define DROPBEAR_DSS 0' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_DH_GROUP1 0' >> $(@D)/localoptions.h
|
|
|
|
endef
|
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_LEGACY_CRYPTO
|
|
|
|
endif
|
|
|
|
|
2019-12-20 17:05:10 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),)
|
2013-12-04 14:24:00 +01:00
|
|
|
define DROPBEAR_ENABLE_REVERSE_DNS
|
2018-03-28 10:38:26 +02:00
|
|
|
echo '#define DO_HOST_LOOKUP 1' >> $(@D)/localoptions.h
|
2011-03-04 15:22:26 +01:00
|
|
|
endef
|
2019-12-20 17:05:10 +01:00
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ENABLE_REVERSE_DNS
|
|
|
|
endif
|
2011-03-04 15:22:26 +01:00
|
|
|
|
2019-12-20 17:05:10 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_DROPBEAR_SMALL),y)
|
2020-06-29 22:13:00 +02:00
|
|
|
DROPBEAR_LICENSE += , Unlicense, WTFPL
|
2020-06-29 09:16:55 +02:00
|
|
|
DROPBEAR_LICENSE_FILES += libtommath/LICENSE libtomcrypt/LICENSE
|
2019-12-20 17:05:10 +01:00
|
|
|
DROPBEAR_CONF_OPTS += --disable-zlib --enable-bundled-libtom
|
|
|
|
else
|
2011-03-04 15:22:26 +01:00
|
|
|
define DROPBEAR_BUILD_FEATURED
|
2018-03-28 10:38:26 +02:00
|
|
|
echo '#define DROPBEAR_SMALL_CODE 0' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_TWOFISH128 1' >> $(@D)/localoptions.h
|
|
|
|
echo '#define DROPBEAR_TWOFISH256 1' >> $(@D)/localoptions.h
|
2011-03-04 15:22:26 +01:00
|
|
|
endef
|
2019-12-20 17:05:10 +01:00
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_BUILD_FEATURED
|
|
|
|
DROPBEAR_DEPENDENCIES += zlib libtomcrypt
|
|
|
|
DROPBEAR_CONF_OPTS += --disable-bundled-libtom
|
|
|
|
endif
|
2013-05-07 05:45:50 +02:00
|
|
|
|
2018-12-20 18:58:14 +01:00
|
|
|
define DROPBEAR_CUSTOM_PATH
|
|
|
|
echo '#define DEFAULT_PATH $(BR2_SYSTEM_DEFAULT_PATH)' >>$(@D)/localoptions.h
|
|
|
|
endef
|
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_CUSTOM_PATH
|
|
|
|
|
2013-12-04 14:24:00 +01:00
|
|
|
define DROPBEAR_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 644 package/dropbear/dropbear.service \
|
2015-03-20 20:14:01 +01:00
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/dropbear.service
|
2013-12-04 14:24:00 +01:00
|
|
|
endef
|
|
|
|
|
2013-05-07 05:45:50 +02:00
|
|
|
ifeq ($(BR2_USE_MMU),y)
|
|
|
|
define DROPBEAR_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -D -m 755 package/dropbear/S50dropbear \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S50dropbear
|
|
|
|
endef
|
|
|
|
else
|
2019-12-20 17:05:10 +01:00
|
|
|
define DROPBEAR_DISABLE_STANDALONE
|
|
|
|
echo '#define NON_INETD_MODE 0' >> $(@D)/localoptions.h
|
|
|
|
endef
|
2013-05-07 05:45:50 +02:00
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_STANDALONE
|
|
|
|
endif
|
|
|
|
|
2011-10-25 14:22:18 +02:00
|
|
|
ifneq ($(BR2_PACKAGE_DROPBEAR_WTMP),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
DROPBEAR_CONF_OPTS += --disable-wtmp
|
2011-10-25 14:22:18 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(BR2_PACKAGE_DROPBEAR_LASTLOG),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
DROPBEAR_CONF_OPTS += --disable-lastlog
|
2011-10-25 14:22:18 +02:00
|
|
|
endif
|
|
|
|
|
2019-05-29 12:27:06 +02:00
|
|
|
DROPBEAR_LOCALOPTIONS_FILE = $(call qstrip,$(BR2_PACKAGE_DROPBEAR_LOCALOPTIONS_FILE))
|
|
|
|
ifneq ($(DROPBEAR_LOCALOPTIONS_FILE),)
|
|
|
|
define DROPBEAR_APPEND_LOCALOPTIONS_FILE
|
|
|
|
cat $(DROPBEAR_LOCALOPTIONS_FILE) >> $(@D)/localoptions.h
|
|
|
|
endef
|
|
|
|
DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_APPEND_LOCALOPTIONS_FILE
|
|
|
|
endif
|
|
|
|
|
2010-09-01 22:42:27 +02:00
|
|
|
define DROPBEAR_INSTALL_TARGET_CMDS
|
|
|
|
$(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
|
|
|
|
for f in $(DROPBEAR_TARGET_BINS); do \
|
|
|
|
ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
|
|
|
|
done
|
2015-08-18 21:25:53 +02:00
|
|
|
ln -snf /var/run/dropbear $(TARGET_DIR)/etc/dropbear
|
2010-09-01 22:42:27 +02:00
|
|
|
endef
|
2005-10-29 09:01:33 +02:00
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|