[OpenWrt-Devel] [PATCH] Combine CA-certificates in one file

micke.prag at telldus.se micke.prag at telldus.se
Fri Jun 12 03:30:56 EDT 2015


 From: Micke Prag <micke.prag at telldus.se>

Some packages or libraries cannot use split ca cetificates in a folder. 
This adds a config to combine all certificates into one file.

Since this adds another ~300 Kb to the image this can be enabled by a 
config
which is disabled by default.

This also allows for packes to require this option in the DEPENDS 
section.

Signed-off-by: Micke Prag <micke.prag at telldus.se>
---
  package/system/ca-certificates/Config.in | 7 +++++++
  package/system/ca-certificates/Makefile  | 7 +++++++
  2 files changed, 14 insertions(+)
  create mode 100644 package/system/ca-certificates/Config.in

diff --git a/package/system/ca-certificates/Config.in 
b/package/system/ca-certificates/Config.in
new file mode 100644
index 0000000..36ebdc3
--- /dev/null
+++ b/package/system/ca-certificates/Config.in
@@ -0,0 +1,7 @@
+config CA_CERTIFICATES_COMBINE_CERTIFICATES
+	bool "Combine certificates"
+	depends on PACKAGE_ca-certificates
+	help
+		Combine all CA-certificates in /etc/ssl/certs/ca-certificates.crt
+		This might be required by some applications and adds ~300 Kb to the 
image
+	default n
diff --git a/package/system/ca-certificates/Makefile 
b/package/system/ca-certificates/Makefile
index 9c50fef..9fd1632 100644
--- a/package/system/ca-certificates/Makefile
+++ b/package/system/ca-certificates/Makefile
@@ -23,6 +23,10 @@ define Package/ca-certificates
    TITLE:=System CA certificates
  endef

+define Package/ca-certificates/config
+	source "$(SOURCE)/Config.in"
+endef
+
  define Build/Install
  	mkdir -p \
  		$(PKG_INSTALL_DIR)/usr/sbin \
@@ -41,6 +45,9 @@ define Package/ca-certificates/install
  			let "SUFFIX += 1" ; \
  		done ; \
  		$(LN) "$$$$CERTFILE" "$(1)/etc/ssl/certs/$$$$HASH.$$$$SUFFIX" ; \
+		if [ "$(CONFIG_CA_CERTIFICATES_COMBINE_CERTIFICATES)" == "y" ]; then 
\
+			cat "$(1)/etc/ssl/certs/$$$$CERTFILE" >> 
"$(1)/etc/ssl/certs/ca-certificates.crt" ; \
+		fi ; \
  	done
  endef

-- 
2.0.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list