Skip to content

Commit f6cc969

Browse files
JuliusBairaktarishauke
authored andcommitted
dropbear: drop obsolete rsa-sha2-256 pubkey patch
The patch relaxes buf_verify()'s "Non-matching signing type" check so that an rsa-sha2-256 signature is accepted against an ssh-rsa key. Dropbear no longer needs the help: both sides of that comparison are now taken from the wire's own algorithm names, so a compliant client satisfies expect_sigtype == sigtype unaided. Tracing the provenance in 2026.92, since it is what the removal rests on. svr-authpubkey.c:113 reads the algorithm name out of the SSH_MSG_USERAUTH_REQUEST and :126 turns it into sigtype with signature_type_from_name(); that value is what :233 hands to buf_verify() as expect_sigtype. signkey.c:655 parses the type name out of the signature blob through the same signature_type_from_name(), and :659 compares the two. Neither is derived from the key format found in authorized_keys: :132 maps the signature type back to the key algorithm with signkey_type_from_signature() purely for the checkpubkey() lookup. RFC 8332 section 3 has a client using rsa-sha2-256 send that name in the userauth request and in the signature both, so the two agree and the check passes - with an ssh-rsa key in authorized_keys, which is the case the patch was written for. Confirmed rather than reasoned: built pristine 2026.92 with this package's defaults (DROPBEAR_RSA 1, DROPBEAR_RSA_SHA1 0) and logged in over publickey with an OpenSSH client pinned to PubkeyAcceptedAlgorithms=rsa-sha2-256. It succeeds, and the server reports "Pubkey auth succeeded ... with ssh-rsa key" - an ssh-rsa entry in authorized_keys, an rsa-sha2-256 signature, no patch. Keeping the patch has an effect of its own. With DROPBEAR_RSA_SHA1 0, signature_type_from_name("ssh-rsa") falls through to signkey_type_from_name() and returns DROPBEAR_SIGNKEY_RSA, which is 0. That is not DROPBEAR_SIGNATURE_NONE, so the patch's own "No signature type" guard passes it, and expect_sigtype == DROPBEAR_SIGNATURE_RSA_SHA256 skips the type check. buf_rsa_verify() then calls rsa_pad_em(), whose switch has no case for 0 and ends in default: assert(0), so the process aborts. Upstream's unconditional check rejects the mismatch instead. It is also narrower than upstream's in a second way: the replacement sits inside #if DROPBEAR_RSA / #if DROPBEAR_RSA_SHA256, while the check it displaces is unconditional. An ECDSA or Ed25519 only build therefore has no expect_sigtype check at all today, only the "No signature type" guard. Dropping the patch restores the check for every configuration, not just this package's default one. buf_verify() runs only after checkpubkey() has succeeded, so the abort needs a key already listed in the target's authorized_keys - post-auth, not an authentication bypass. The patch's extra DROPBEAR_SIGNATURE_NONE guard is not lost with it: svr-authpubkey.c rejects that case before buf_verify() is reached. Assisted-by: Claude:claude-opus-5 Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de> Link: openwrt#24525 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 6c30301 commit f6cc969

2 files changed

Lines changed: 1 addition & 45 deletions

File tree

package/network/services/dropbear/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=dropbear
1111
PKG_VERSION:=2026.92
12-
PKG_RELEASE:=1
12+
PKG_RELEASE:=2
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
1515
PKG_SOURCE_URL:= \

package/network/services/dropbear/patches/910-signkey-fix-use-of-rsa-sha2-256-pubkeys.patch

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)