mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: ptxdist@pengutronix.de
Cc: Ian Abbott <abbotti@mev.co.uk>, Bruno Thomsen <bruno.thomsen@gmail.com>
Subject: [ptxdist] [PATCH 6/8] dropbear: Rework key exchange algorithm options
Date: Mon,  4 Jul 2022 14:18:29 +0200	[thread overview]
Message-ID: <20220704121831.23787-7-ada@thorsis.com> (raw)
In-Reply-To: <20220704121831.23787-1-ada@thorsis.com>

The options for diffie-hellman key exchange were mixed up with message
integrity hmacs.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 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




  parent reply	other threads:[~2022-07-04 12:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 12:18 [ptxdist] [PATCH 0/8] dropbear: version bump and option revise Alexander Dahl
2022-07-04 12:18 ` [ptxdist] [PATCH 1/8] dropbear: version bump 2020.81 -> 2022.82 Alexander Dahl
2022-07-08 15:13   ` Michael Olbrich
2022-07-21  7:10     ` [ptxdist] [PATCH] dropbear: Add patch to fix build with X11 forwarding Alexander Dahl
2022-08-04 15:14       ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-29  6:23   ` [ptxdist] [APPLIED] dropbear: version bump 2020.81 -> 2022.82 Michael Olbrich
2022-07-04 12:18 ` [ptxdist] [PATCH 2/8] dropbear: Add ed25519 hostkey/public key support Alexander Dahl
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-04 12:18 ` [ptxdist] [PATCH 3/8] dropbear: Remove curve25519 dependency Alexander Dahl
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-04 12:18 ` [ptxdist] [PATCH 4/8] dropbear: Make Chacha20-Poly1305 encryption optional Alexander Dahl
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-04 12:18 ` [ptxdist] [PATCH 5/8] dropbear: Append hints to some menu prompts Alexander Dahl
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-04 12:18 ` Alexander Dahl [this message]
2022-07-04 12:31   ` [ptxdist] [PATCH 6/8] dropbear: Rework key exchange algorithm options Ian Abbott
2022-07-08  9:09     ` Michael Olbrich
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-04 12:18 ` [ptxdist] [PATCH 7/8] dropbear: Add conditional comments with warnings Alexander Dahl
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-07-04 12:18 ` [ptxdist] [PATCH 8/8] dropbear: Move option groups to sub menus Alexander Dahl
2022-07-29  6:23   ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220704121831.23787-7-ada@thorsis.com \
    --to=ada@thorsis.com \
    --cc=abbotti@mev.co.uk \
    --cc=bruno.thomsen@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox