aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services
diff options
context:
space:
mode:
authorMartin Schiller <ms@dev.tdt.de>2020-05-04 16:13:13 +0200
committerPaul Spooren <mail@aparcar.org>2021-10-06 20:34:23 -1000
commite604873e8a66697fd8728d7896a4a715d85182fb (patch)
tree98f6b9a5503ee4adf320254c855c1d9ac0eb0d7c /package/network/services
parent76d90a5eaf3b7fc5bb1a1b8626db0e4e2487e876 (diff)
downloadupstream-e604873e8a66697fd8728d7896a4a715d85182fb.tar.gz
upstream-e604873e8a66697fd8728d7896a4a715d85182fb.tar.bz2
upstream-e604873e8a66697fd8728d7896a4a715d85182fb.zip
uhttpd: make organization (O=) of the cert configurable via uci
Make the organization (O=) of the cert configurable via uci. If not configured, use a combination of "OpenWrt" and an unique id like it was done before. Signed-off-by: Martin Schiller <ms@dev.tdt.de> (cherry picked from commit 2c6c1501af664490ec9b701b46a201e21c670b96)
Diffstat (limited to 'package/network/services')
-rw-r--r--package/network/services/uhttpd/Makefile2
-rwxr-xr-xpackage/network/services/uhttpd/files/uhttpd.init5
2 files changed, 4 insertions, 3 deletions
diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 87b3690515..de666a480d 100644
--- a/package/network/services/uhttpd/Makefile
+++ b/package/network/services/uhttpd/Makefile
@@ -8,7 +8,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 869f79bea2..e7709941c2 100755
--- a/package/network/services/uhttpd/files/uhttpd.init
+++ b/package/network/services/uhttpd/files/uhttpd.init
@@ -35,13 +35,14 @@ generate_keys() {
local cfg="$1"
local key="$2"
local crt="$3"
- local days bits country state location commonname
+ local days bits country state location organization commonname
config_get days "$cfg" days
config_get bits "$cfg" bits
config_get country "$cfg" country
config_get state "$cfg" state
config_get location "$cfg" location
+ config_get organization "$cfg" organization
config_get commonname "$cfg" commonname
config_get key_type "$cfg" key_type
config_get ec_curve "$cfg" ec_curve
@@ -56,7 +57,7 @@ generate_keys() {
[ -n "$GENKEY_CMD" ] && {
$GENKEY_CMD \
-days ${days:-730} -newkey ${KEY_OPTS} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
- -subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}"
+ -subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${organization:-OpenWrt$UNIQUEID}"/CN="${commonname:-OpenWrt}"
sync
mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}"
mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}"