icwmp: support to use ca-bundle

This commit is contained in:
Vivek Kumar Dutta 2024-04-23 17:50:26 +05:30
parent 41bcbe55b9
commit 23d4e3cf18
3 changed files with 15 additions and 7 deletions

View file

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.7.8
PKG_VERSION:=9.7.9
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=5139c70c5f4da5107b7996456763b6beecb3b7d4
PKG_SOURCE_VERSION:=6b061b56d8cb9e109b61f60d9bc56ae9c5a0c2ae
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@ -48,7 +48,6 @@ define Package/icwmp/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_DIR) $(1)/etc/icwmpd/plugins
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp

View file

@ -5,7 +5,7 @@ config acs 'acs'
option periodic_inform_interval '1800'
option periodic_inform_time '0001-01-01T00:00:00Z'
option dhcp_discovery 'enable'
option ssl_capath "/etc/ssl/certs"
#option ssl_capath "/etc/icwmpd/ca.pem"
# compression possible configs: GZIP, Deflate, Disabled
option compression 'Disabled'
#­ possible configs interval :[1:65535]

View file

@ -17,7 +17,15 @@ log() {
}
regenerate_ssl_link() {
local cert_dir="${1%/}"
local cert_dir
cert_dir="${1%/}"
if [ -f "${cert_dir}" ]; then
return 0
fi
# do not generate the c_rehash if its system default cert path
# ca-certificate package already generates c_rehash on compilation
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
generate_links() {
@ -26,14 +34,15 @@ regenerate_ssl_link() {
for cfile in ${files}; do
if [ -f "${cfile}" ]; then
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
[ -f "${cert_dir}/${rehash}.0" ] || \
if [ ! -f "${cert_dir}/${rehash}.0" ]; then
log "Generating c_rehash for ${cfile}=>${rehash}.0"
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
fi
fi
done
}
generate_links "pem"
generate_links "crt"
}
enable_dhcp_option43() {