]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Do not use the ENGINE_load_gost but detect if another engine gives gost.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Fri, 7 Aug 2009 15:02:00 +0000 (15:02 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Fri, 7 Aug 2009 15:02:00 +0000 (15:02 +0000)
configure.ac
examples/configure.ac
keys.c

index 18b07e0df39b795ac84e9a32b849cf3cb214b0a7..2b6f6dfafcea0dc0f1283e99e940323495a96a59 100644 (file)
@@ -102,9 +102,6 @@ AC_ARG_ENABLE(gost, AC_HELP_STRING([--enable-gost], [Enable GOST support]))
 case "$enable_gost" in
     yes)
         AC_MSG_CHECKING(for GOST)
-        AC_CHECK_LIB(crypto, ENGINE_load_gost,, [
-            AC_MSG_ERROR([GOST enabled, but no GOST functions found in OpenSSL. Need openssl-1.0.0 or later.])
-        ])
         AC_DEFINE_UNQUOTED([USE_GOST], [1], [Define this to enable GOST support.])
         ;;
     no|*)
index 4d8fce407afa6443d207055251b21f352e00f64f..6f630e2eb887944f7e9ee8c21479b74b0e29bce3 100644 (file)
@@ -214,9 +214,6 @@ AC_ARG_ENABLE(gost, AC_HELP_STRING([--enable-gost], [Enable GOST support]))
 case "$enable_gost" in
     yes)
         AC_MSG_CHECKING(for GOST)
-        AC_CHECK_LIB(crypto, ENGINE_load_gost,, [
-            AC_MSG_ERROR([GOST enabled, but no GOST functions found in OpenSSL. Need openssl-1.0.0 or later.])
-        ])
         AC_DEFINE_UNQUOTED([USE_GOST], [1], [Define this to enable GOST support.])
         ;;
     no|*)
diff --git a/keys.c b/keys.c
index b8fcd5aa9b0e42af0562064485f00ad48b6681bd..c124da116aa037b135f52411181c11f0c816ebcf 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -113,11 +113,19 @@ ldns_key_EVP_load_gost_id(void)
 
        if(gost_id) return gost_id;
 
-       /* loaded already */
+       /* see if configuration loaded gost implementation from other engine*/
+       meth = EVP_PKEY_asn1_find_str(NULL, "gost2001", -1);
+       if(meth) {
+               EVP_PKEY_asn1_get0_info(&gost_id, NULL, NULL, NULL, NULL, meth);
+               return gost_id;
+       }
+
+       /* see if engine can be loaded already */
        e = ENGINE_by_id("gost");
        if(!e) {
-               /* load it ourself */
-               ENGINE_load_gost();
+               /* load it ourself, in case statically linked */
+               ENGINE_load_builtin_engines();
+               ENGINE_load_dynamic();
                e = ENGINE_by_id("gost");
        }
        if(!e) {