From: Wouter Wijngaards Date: Fri, 7 Aug 2009 15:02:00 +0000 (+0000) Subject: Do not use the ENGINE_load_gost but detect if another engine gives gost. X-Git-Tag: release-1.6.1~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=546017f7bbda1d2cf2b920c60d973b5c35aaaec4;p=thirdparty%2Fldns.git Do not use the ENGINE_load_gost but detect if another engine gives gost. --- diff --git a/configure.ac b/configure.ac index 18b07e0d..2b6f6dfa 100644 --- a/configure.ac +++ b/configure.ac @@ -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|*) diff --git a/examples/configure.ac b/examples/configure.ac index 4d8fce40..6f630e2e 100644 --- a/examples/configure.ac +++ b/examples/configure.ac @@ -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 b8fcd5aa..c124da11 100644 --- 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) {