1 ENGINES_DIR
=engines-1.1
3 define Package
/openssl
/engine
/Default
7 DEPENDS
:=libopenssl @OPENSSL_ENGINE
+libopenssl-conf
11 # 2 - package name, defaults to libopenssl-$(1)
12 define Package
/openssl
/add-engine
13 OSSL_ENG_PKG
:=$(if
$(2),$(2),libopenssl-
$(1))
14 Package
/$$(OSSL_ENG_PKG
)/conffiles
:=/etc
/ssl
/engines.cnf.d
/$(1).cnf
16 define Package
/$$(OSSL_ENG_PKG
)/install
17 $$(INSTALL_DIR
) $$(1)/usr
/lib
/$(ENGINES_DIR
)
18 $$(INSTALL_BIN
) $$(PKG_INSTALL_DIR
)/usr
/lib
/$(ENGINES_DIR
)/$(1).so \
19 $$(1)/usr
/lib
/$(ENGINES_DIR
)
20 $$(INSTALL_DIR
) $$(1)/etc
/ssl
/engines.cnf.d
21 $$(INSTALL_DATA
) .
/files
/$(1).cnf
$$(1)/etc
/ssl
/engines.cnf.d
/
24 define Package
/$$(OSSL_ENG_PKG
)/postinst
:=
26 # $$$$1 == non-empty: suggest reinstall
28 [ "$1" ] && cat
<<- EOF
29 Reinstalling the libopenssl-conf package may fix this
:
31 opkg
install --force-reinstall libopenssl-conf
35 Then
, you will have to reinstall this package
, and any other engine package you have
36 you have previously installed to ensure they are enabled
:
38 opkg
install --force-reinstall
$$(OSSL_ENG_PKG
) [OTHER_ENGINE_PKG
]...
43 ENGINES_CNF
="$$$${IPKG_INSTROOT}/etc/ssl/engines.cnf.d/engines.cnf"
44 OPENSSL_CNF
="$$$${IPKG_INSTROOT}/etc/ssl/openssl.cnf"
45 if
[ ! -f
"$$$${OPENSSL_CNF}" ]; then
46 echo
-e
"ERROR: File $$$${OPENSSL_CNF} not found."
49 if
! grep
-q
"^.include /etc/ssl/engines.cnf.d" "$$$${OPENSSL_CNF}"; then
51 Your
/etc
/ssl
/openssl.cnf file is not loading engine configuration files from
52 /etc
/ssl
/engines.cnf.d. You should consider start with a fresh
, updated OpenSSL config by
55 opkg
install --force-reinstall
--force-maintainer libopenssl-conf
57 The above command will overwrite any changes you may have made to both
/etc
/ssl
/openssl.cnf
58 and
/etc
/ssl
/engines.cnf.d
/engines.cnf files
, so back them up first
!
62 if
[ ! -f
"$$$${ENGINES_CNF}" ]; then
63 echo
"Can't configure $$(OSSL_ENG_PKG): File $$$${ENGINES_CNF} not found."
66 if grep
-q
"$(1)=$(1)" "$$$${ENGINES_CNF}"; then
67 echo
"$$(OSSL_ENG_PKG): $(1) engine was already configured. Nothing to be done."
69 echo
"$(1)=$(1)" >> "$$$${ENGINES_CNF}"
70 echo
"$$(OSSL_ENG_PKG): $(1) engine enabled. All done!"
74 define Package
/$$(OSSL_ENG_PKG
)/prerm
:=
76 ENGINES_CNF
="$$$${IPKG_INSTROOT}/etc/ssl/engines.cnf.d/engines.cnf"
77 [ -f
"$$$${ENGINES_CNF}" ] || exit
0
78 sed
-e
'/$(1)=$(1)/d' -i
"$$$${ENGINES_CNF}"