gost_engine: adapt to new openssl UCI config
authorEneas U de Queiroz <cotequeiroz@gmail.com>
Sat, 1 May 2021 17:26:32 +0000 (14:26 -0300)
committerRosen Penev <rosenp@gmail.com>
Thu, 24 Mar 2022 18:29:46 +0000 (11:29 -0700)
OpenSSL now uses UCI to enable and disable engines, and engine packages
need to adapt.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
libs/gost_engine/Makefile
libs/gost_engine/files/gost.cnf [new file with mode: 0644]

index 00b55e7c23cb0a87756f38939299d855369f31cc..0ba69f72699daf72ab7b263e8b8c1d5cc38f8cca 100644 (file)
@@ -13,29 +13,27 @@ PKG_LICENSE:=OpenSSL
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
+include $(INCLUDE_DIR)/openssl-engine.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
 PKG_INSTALL:=
 
-ENGINES_DIR:=engines-1.1
-
 define Package/gost_engine/Default
+  $(call Package/openssl/engine/Default)
   TITLE:=GOST engine for OpenSSL
   URL:=http://www.openssl.org/
-  SECTION:=libs
-  CATEGORY:=Libraries
 endef
 
 define Package/gost_engine/Default/description
 Russian GOST crypto algorithms for OpenSSL.
 endef
 
+$(eval $(call Package/openssl/add-engine,gost,libopenssl-gost_engine))
 define Package/libopenssl-gost_engine
     $(call Package/gost_engine/Default)
-    SUBMENU:=SSL
+    $(call Package/openssl/engine/Default)
     TITLE+= (library)
     URL:=https://github.com/gost-engine/engine/
-    DEPENDS:=libopenssl @OPENSSL_ENGINE +libopenssl-conf
 endef
 
 define Package/libopenssl-gost_engine/description
@@ -63,9 +61,10 @@ endef
 CMAKE_OPTIONS += -DOPENSSL_ENGINES_DIR=/usr/lib/$(ENGINES_DIR)
 
 define Package/libopenssl-gost_engine/install
-       $(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR)
+       $(INSTALL_DIR) $(1)/usr/lib/$(ENGINES_DIR) $(1)/etc/ssl/engines.cnf.d
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/bin/gost.so \
                        $(1)/usr/lib/$(ENGINES_DIR)/
+       $(INSTALL_DATA) ./files/gost.cnf $(1)/etc/ssl/engines.cnf.d/
 endef
 
 define Package/gost_engine-util/install
diff --git a/libs/gost_engine/files/gost.cnf b/libs/gost_engine/files/gost.cnf
new file mode 100644 (file)
index 0000000..84a707c
--- /dev/null
@@ -0,0 +1,16 @@
+[gost]
+default_algorithms = ALL
+# CRYPT_PARAMS: OID of default GOST 28147-89 parameters It allows the
+# user to choose between different parameter sets of symmetric cipher
+# algorithm. RFC 4357 specifies several parameters for the
+# GOST 28147-89 algorithm, but OpenSSL doesn't provide user interface
+# to choose one when encrypting. So use engine configuration parameter
+# instead.
+# Value of this parameter can be either short name, defined in OpenSSL
+# obj_dat.h header file or numeric representation of OID, defined in
+# RFC 4357.  Defaults to id-tc26-gost-28147-param-Z
+#CRYPT_PARAMS = id-tc26-gost-28147-param-Z
+
+# PBE_PARAMS: Shortname of default digest alg for PBE
+#PBE_PARAMS =
+