mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Change from unix only implementation to all os and skip ENGINE_load_dynamic if oss is 1.1.0 or later
This commit is contained in:
parent
1e164ecc4e
commit
d1ad4196bb
@ -3114,11 +3114,11 @@ bool IsEncryptedK(BUF *b, bool private_key)
|
||||
|
||||
K *OpensslEngineToK(char *key_file_name, char *engine_name)
|
||||
{
|
||||
#ifdef UNIX_LINUX
|
||||
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||
K *k;
|
||||
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||
ENGINE_load_dynamic();
|
||||
ENGINE *engine = ENGINE_by_id("tpm2tss");
|
||||
#endif // OPENSSL_API_COMPAT >= 0x10100000L
|
||||
ENGINE *engine = ENGINE_by_id(engine_name);
|
||||
ENGINE_init(engine);
|
||||
EVP_PKEY *pkey;
|
||||
pkey = ENGINE_load_private_key(engine, key_file_name, NULL, NULL);
|
||||
@ -3126,10 +3126,6 @@ K *OpensslEngineToK(char *key_file_name, char *engine_name)
|
||||
k->pkey = pkey;
|
||||
k->private_key = true;
|
||||
return k;
|
||||
#endif // OPENSSL_API_COMPAT >= 0x10100000L
|
||||
#else
|
||||
return NULL;
|
||||
#endif // UNIX_LINUX
|
||||
}
|
||||
|
||||
// Convert the BUF to a K
|
||||
|
Loading…
Reference in New Issue
Block a user