From: Gabriel Valcazar <gabriel.valcazar@digi.com>
Date: Tue, 12 Nov 2019 12:00:07 +0100
Subject: [PATCH] Modify openssl.cnf to automatically load the pkcs11 engine

https://jira.digi.com/browse/DEL-6835

Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
---
 apps/openssl.cnf | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/apps/openssl.cnf b/apps/openssl.cnf
index 4acca4b..2261048 100644
--- a/apps/openssl.cnf
+++ b/apps/openssl.cnf
@@ -7,6 +7,8 @@
 # file using the .include directive.
 #.include filename
 
+openssl_conf = openssl_init
+
 # This definition stops the following lines choking if HOME isn't
 # defined.
 HOME			= .
@@ -348,3 +350,15 @@ ess_cert_id_chain	= no	# Must the ESS cert id chain be included?
 				# (optional, default: no)
 ess_cert_id_alg		= sha1	# algorithm to compute certificate
 				# identifier (optional, default: sha1)
+
+[ openssl_init ]
+engines = engine_section
+
+[ engine_section ]
+pkcs11 = pkcs11_config
+
+[ pkcs11_config ]
+engine_id = pkcs11
+dynamic_path = /usr/lib/engines-1.1/pkcs11.so
+MODULE_PATH = /usr/lib/libcryptoauth.so.2018.10.26
+init = 0
