Browse Source

fixed andorid build

pull/816/head
orignal 7 years ago
parent
commit
ffc3a31d09
  1. 11
      Crypto.cpp

11
Crypto.cpp

@ -823,7 +823,8 @@ namespace crypto
bool InitGost () bool InitGost ()
{ {
#if OPENSSL_API_COMPAT < 0x10100000L #ifndef OPENSSL_NO_ENGINE
#if (OPENSSL_VERSION_NUMBER < 0x010100000) || defined(LIBRESSL_VERSION_NUMBER)
ENGINE_load_builtin_engines (); ENGINE_load_builtin_engines ();
ENGINE_load_dynamic (); ENGINE_load_dynamic ();
#else #else
@ -843,20 +844,26 @@ namespace crypto
EVP_PKEY_keygen (ctx, &g_GostPKEY); // it seems only way to fill with correct params EVP_PKEY_keygen (ctx, &g_GostPKEY); // it seems only way to fill with correct params
EVP_PKEY_CTX_free (ctx); EVP_PKEY_CTX_free (ctx);
return true; return true;
#else
LogPrint (eLogError, "Can't initialize GOST. Engines are not supported");
return false;
#endif
} }
void TerminateGost () void TerminateGost ()
{ {
if (g_GostPKEY) if (g_GostPKEY)
EVP_PKEY_free (g_GostPKEY); EVP_PKEY_free (g_GostPKEY);
#ifndef OPENSSL_NO_ENGINE
if (g_GostEngine) if (g_GostEngine)
{ {
ENGINE_finish (g_GostEngine); ENGINE_finish (g_GostEngine);
ENGINE_free (g_GostEngine); ENGINE_free (g_GostEngine);
#if OPENSSL_API_COMPAT < 0x10100000L #if (OPENSSL_VERSION_NUMBER < 0x010100000) || defined(LIBRESSL_VERSION_NUMBER)
ENGINE_cleanup(); ENGINE_cleanup();
#endif #endif
} }
#endif
} }
void InitCrypto (bool precomputation, bool withGost) void InitCrypto (bool precomputation, bool withGost)

Loading…
Cancel
Save