aboutsummaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/m4/acx_openssl_gost.m4
diff options
context:
space:
mode:
authorPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2019-01-02 09:59:48 -0800
committerPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2019-03-29 09:59:04 -0700
commit7626b75b3c71173ba62c2f92d22bab8f4291e44a (patch)
tree7308a2628a014fef0f245ef4f00408cf92d15e60 /SoftHSMv2/m4/acx_openssl_gost.m4
parentf2ff7a136a152b36b3aa4d0d574796e6edbef24a (diff)
Update SoftHSM v2.0 to the latest version
Change-Id: Ib3ec2c297f897c82776a66fe2ad55b18984c0337 Issue-ID: AAF-687 Signed-off-by: Pramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>
Diffstat (limited to 'SoftHSMv2/m4/acx_openssl_gost.m4')
-rw-r--r--SoftHSMv2/m4/acx_openssl_gost.m495
1 files changed, 51 insertions, 44 deletions
diff --git a/SoftHSMv2/m4/acx_openssl_gost.m4 b/SoftHSMv2/m4/acx_openssl_gost.m4
index dca489b..7deaacb 100644
--- a/SoftHSMv2/m4/acx_openssl_gost.m4
+++ b/SoftHSMv2/m4/acx_openssl_gost.m4
@@ -8,56 +8,63 @@ AC_DEFUN([ACX_OPENSSL_GOST],[
LIBS="$CRYPTO_LIBS $LIBS"
AC_LANG_PUSH([C])
- AC_RUN_IFELSE([
- AC_LANG_SOURCE([[
- #include <openssl/engine.h>
- #include <openssl/crypto.h>
- #include <openssl/opensslv.h>
- int main()
- {
- ENGINE* eg;
- const EVP_MD* EVP_GOST_34_11;
+ AC_CACHE_VAL([acx_cv_lib_openssl_gost_support],[
+ acx_cv_lib_openssl_gost_support=no
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([[
+ #include <openssl/engine.h>
+ #include <openssl/crypto.h>
+ #include <openssl/opensslv.h>
+ int main()
+ {
+ ENGINE* eg;
+ const EVP_MD* EVP_GOST_34_11;
- /* Initialise OpenSSL */
- OpenSSL_add_all_algorithms();
+ /* Initialise OpenSSL */
+ OpenSSL_add_all_algorithms();
- /* Load engines */
- #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- ENGINE_load_builtin_engines();
- #else
- OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN | OPENSSL_INIT_LOAD_CONFIG, NULL);
- #endif
+ /* Load engines */
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ ENGINE_load_builtin_engines();
+ #else
+ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN | OPENSSL_INIT_LOAD_CONFIG, NULL);
+ #endif
- /* Initialise the GOST engine */
- eg = ENGINE_by_id("gost");
- if (eg == NULL)
- return 1;
- if (ENGINE_init(eg) <= 0)
- return 1;
+ /* Initialise the GOST engine */
+ eg = ENGINE_by_id("gost");
+ if (eg == NULL)
+ return 1;
+ if (ENGINE_init(eg) <= 0)
+ return 1;
- /* better than digest_gost */
- EVP_GOST_34_11 = ENGINE_get_digest(eg, NID_id_GostR3411_94);
- if (EVP_GOST_34_11 == NULL)
- return 1;
+ /* better than digest_gost */
+ EVP_GOST_34_11 = ENGINE_get_digest(eg, NID_id_GostR3411_94);
+ if (EVP_GOST_34_11 == NULL)
+ return 1;
- /* from the openssl.cnf */
- if (ENGINE_register_pkey_asn1_meths(eg) <= 0)
- return 1;
- if (ENGINE_ctrl_cmd_string(eg,
- "CRYPT_PARAMS",
- "id-Gost28147-89-CryptoPro-A-ParamSet",
- 0) <= 0)
- return 1;
+ /* from the openssl.cnf */
+ if (ENGINE_register_pkey_asn1_meths(eg) <= 0)
+ return 1;
+ if (ENGINE_ctrl_cmd_string(eg,
+ "CRYPT_PARAMS",
+ "id-Gost28147-89-CryptoPro-A-ParamSet",
+ 0) <= 0)
+ return 1;
- return 0;
- }
- ]])
- ],[
- AC_MSG_RESULT([Found GOST engine])
- ],[
- AC_MSG_RESULT([Cannot find GOST engine])
- AC_MSG_ERROR([OpenSSL library has no GOST support])
- ],[])
+ return 0;
+ }
+ ]])
+ ],[
+ AC_MSG_RESULT([Found GOST engine])
+ acx_cv_lib_openssl_gost_support=yes
+ ],[
+ AC_MSG_RESULT([Cannot find GOST engine])
+ AC_MSG_ERROR([OpenSSL library has no GOST support])
+ ],[
+ AC_MSG_WARN([Cannot test, assuming GOST engine])
+ acx_cv_lib_openssl_gost_support=yes
+ ])
+ ])
AC_LANG_POP([C])
CPPFLAGS=$tmp_CPPFLAGS