From c6c02f7e799e5aea6d2945261ff07cd993ac4ac1 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Mon, 5 Oct 2026 07:31:55 +0200 Subject: [PATCH] uhttpd: use hexdump -v for the certificate ID uhttpd.init appends four random bytes as hex digits to the default organization of its self-signed certificate. Without -v, hexdump prints "*" instead of repeated lines, and with the format used here each byte is a line of its own. When adjacent bytes are equal, the organization gets a "*" instead of the repeated bytes, followed by a newline if more bytes follow. For example 8b 35 35 ba gives "OpenWrt8b35*", a newline and "ba". This happens for about 1 in 86 generated certificates. Pass -v to hexdump, so all four bytes are printed. Signed-off-by: Josef Schlehofer Link: https://github.com/openwrt/openwrt/pull/25628 Signed-off-by: Robert Marko --- package/network/services/uhttpd/Makefile | 2 +- package/network/services/uhttpd/files/uhttpd.init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 8a2e5a6d5aa..53a31be04bd 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index c6e0b210c5a..a90d3f9a5a0 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -50,7 +50,7 @@ generate_keys() { # Prefer px5g for certificate generation (existence evaluated last) local GENKEY_CMD="" local KEY_OPTS="rsa:${bits:-2048}" - local UNIQUEID=$(dd if=/dev/urandom bs=1 count=4 | hexdump -e '1/1 "%02x"') + local UNIQUEID=$(dd if=/dev/urandom bs=1 count=4 | hexdump -v -e '1/1 "%02x"') [ "$key_type" = "ec" ] && KEY_OPTS="ec -pkeyopt ec_paramgen_curve:${ec_curve:-P-256}" [ -x "$OPENSSL_BIN" ] && GENKEY_CMD="$OPENSSL_BIN req -x509 -sha256 -outform der -nodes" [ -x "$PX5G_BIN" ] && GENKEY_CMD="$PX5G_BIN selfsigned -der"