From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 04 Jul 2022 14:19:18 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o8L2o-005XSC-LK for lore@lore.pengutronix.de; Mon, 04 Jul 2022 14:19:18 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1o8L2q-0003H9-8F; Mon, 04 Jul 2022 14:19:16 +0200 Received: from mail.thorsis.com ([92.198.35.195]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1o8L28-0002ve-8D for ptxdist@pengutronix.de; Mon, 04 Jul 2022 14:18:33 +0200 Received: from adahl by ada.ifak-system.com with local (Exim 4.92) (envelope-from ) id 1o8L27-0006Ch-Ag; Mon, 04 Jul 2022 14:18:31 +0200 From: Alexander Dahl To: ptxdist@pengutronix.de Date: Mon, 4 Jul 2022 14:18:29 +0200 Message-Id: <20220704121831.23787-7-ada@thorsis.com> In-Reply-To: <20220704121831.23787-1-ada@thorsis.com> References: <20220704121831.23787-1-ada@thorsis.com> Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH 6/8] dropbear: Rework key exchange algorithm options X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Ian Abbott , Bruno Thomsen Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false The options for diffie-hellman key exchange were mixed up with message integrity hmacs. Signed-off-by: Alexander Dahl --- rules/dropbear.in | 43 +++++++++++++++++++++++++++++++++++++++++-- rules/dropbear.make | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/rules/dropbear.in b/rules/dropbear.in index f7f96a762..043b0e76d 100644 --- a/rules/dropbear.in +++ b/rules/dropbear.in @@ -278,23 +278,62 @@ config DROPBEAR_ED25519 Public keys are 256 bits long and signatures are 512 bits long. -comment "Key exchange algorithm ---" +comment "Key exchange algorithm, at least one required ---" + +config DROPBEAR_DH_GROUP14_SHA256 + bool + prompt "group14_sha256" + default y + help + 2048 bit, sha2-256. + group14 is supported by most implementations. + +config DROPBEAR_DH_GROUP14_SHA1 + bool + prompt "group14_sha1" + help + 2048 bit, sha1. + group14 is supported by most implementations. + +config DROPBEAR_DH_GROUP16 + bool + prompt "group16" + help + 4096 bit, sha2-512. + group16 provides a greater strength level but is slower and + increases binary size. config DROPBEAR_ECDH bool prompt "ecdh" help ECDH stands for Elliptic Curve Diffie-Hellman. + + Small systems should generally include either curve25519 or + ecdh for performance. config DROPBEAR_CURVE25519 bool - prompt "curve25519-donna" + prompt "curve25519" help Enable curve25519-donna for key exchange. This is another elliptic curve method with good security properties. This algorithm does not rely on NIST-based curves and gives us more security confidence against a possible backdoor in nistp-256 curve. + + Small systems should generally include either curve25519 or + ecdh for performance. + +config DROPBEAR_DH_GROUP1 + bool + prompt "group1 (legacy, client only)" + help + 1024 bit, sha1. + is too small for security though is necessary if you need + compatibility with some implementations such as Dropbear + versions < 0.53. + Client only! comment "Authentication types, at least one required --- RFC Draft requires pubkey auth" diff --git a/rules/dropbear.make b/rules/dropbear.make index 7653cf3e5..e86b8bf43 100644 --- a/rules/dropbear.make +++ b/rules/dropbear.make @@ -157,13 +157,9 @@ endif ifdef PTXCONF_DROPBEAR_SHA1 @echo "ptxdist: enabling sha1" @echo "#define DROPBEAR_SHA1_HMAC 1" >> $(DROPBEAR_LOCALOPTIONS) - @echo "#define DROPBEAR_DH_GROUP1 1" >> $(DROPBEAR_LOCALOPTIONS) - @echo "#define DROPBEAR_DH_GROUP14_SHA1 1" >> $(DROPBEAR_LOCALOPTIONS) else @echo "ptxdist: disabling sha1" @echo "#define DROPBEAR_SHA1_HMAC 0" >> $(DROPBEAR_LOCALOPTIONS) - @echo "#define DROPBEAR_DH_GROUP1 0" >> $(DROPBEAR_LOCALOPTIONS) - @echo "#define DROPBEAR_DH_GROUP14_SHA1 0" >> $(DROPBEAR_LOCALOPTIONS) endif ifdef PTXCONF_DROPBEAR_SHA1_96 @@ -223,6 +219,30 @@ endif @echo "#define DROPBEAR_SK_ED25519 0" >> $(DROPBEAR_LOCALOPTIONS) # key exchange algorithm +ifdef PTXCONF_DROPBEAR_DH_GROUP14_SHA256 + @echo "ptxdist: enabling dh_group14_sha256" + @echo "#define DROPBEAR_DH_GROUP14_SHA256 1" >> $(DROPBEAR_LOCALOPTIONS) +else + @echo "ptxdist: disabling dh_group14_sha256" + @echo "#define DROPBEAR_DH_GROUP14_SHA256 0" >> $(DROPBEAR_LOCALOPTIONS) +endif + +ifdef PTXCONF_DROPBEAR_DH_GROUP14_SHA1 + @echo "ptxdist: enabling dh_group14_sha1" + @echo "#define DROPBEAR_DH_GROUP14_SHA1 1" >> $(DROPBEAR_LOCALOPTIONS) +else + @echo "ptxdist: disabling dh_group14_sha1" + @echo "#define DROPBEAR_DH_GROUP14_SHA1 0" >> $(DROPBEAR_LOCALOPTIONS) +endif + +ifdef PTXCONF_DROPBEAR_DH_GROUP16 + @echo "ptxdist: enabling dh_group16" + @echo "#define DROPBEAR_DH_GROUP16 1" >> $(DROPBEAR_LOCALOPTIONS) +else + @echo "ptxdist: disabling dh_group16" + @echo "#define DROPBEAR_DH_GROUP16 0" >> $(DROPBEAR_LOCALOPTIONS) +endif + ifdef PTXCONF_DROPBEAR_ECDH @echo "ptxdist: enabling ecdh" @echo "#define DROPBEAR_ECDH 1" >> $(DROPBEAR_LOCALOPTIONS) @@ -239,6 +259,14 @@ else @echo "#define DROPBEAR_CURVE25519 0" >> $(DROPBEAR_LOCALOPTIONS) endif +ifdef PTXCONF_DROPBEAR_DH_GROUP1 + @echo "ptxdist: enabling dh_group1" + @echo "#define DROPBEAR_DH_GROUP1 1" >> $(DROPBEAR_LOCALOPTIONS) +else + @echo "ptxdist: disabling dh_group1" + @echo "#define DROPBEAR_DH_GROUP1 0" >> $(DROPBEAR_LOCALOPTIONS) +endif + # authentication types ifdef PTXCONF_DROPBEAR_PASSWD @echo "ptxdist: enabling passwd" -- 2.30.2