mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 08:14:58 +03:00
Openssl engine certificate authentication
TODO cert get, call finish engine, call init engine in another step, handle authentication, internatiolazion (help is needed)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// SoftEther VPN Source Code - Developer Edition Master Branch
|
||||
// Mayaqua Kernel
|
||||
|
||||
// © 2020 Nokia
|
||||
|
||||
// Encrypt.c
|
||||
// Encryption and digital certification routine
|
||||
@ -46,6 +46,7 @@
|
||||
#include <intrin.h> // For __cpuid()
|
||||
#else // _MSC_VER
|
||||
|
||||
|
||||
#ifndef SKIP_CPU_FEATURES
|
||||
#include "cpu_features_macros.h"
|
||||
#endif
|
||||
@ -3111,6 +3112,24 @@ bool IsEncryptedK(BUF *b, bool private_key)
|
||||
return true;
|
||||
}
|
||||
|
||||
K *OpensslEngineToK(char *key_file_name, char *engine_name)
|
||||
{
|
||||
#ifdef UNIX_LINUX
|
||||
K *k;
|
||||
ENGINE_load_dynamic();
|
||||
ENGINE *engine = ENGINE_by_id("tpm2tss");
|
||||
ENGINE_init(engine);
|
||||
EVP_PKEY *pkey;
|
||||
pkey = ENGINE_load_private_key(engine, key_file_name, NULL, NULL);
|
||||
k = ZeroMalloc(sizeof(K));
|
||||
k->pkey = pkey;
|
||||
k->private_key = true;
|
||||
return k;
|
||||
#else
|
||||
return NULL;
|
||||
#endif // UNIX_LINUX
|
||||
}
|
||||
|
||||
// Convert the BUF to a K
|
||||
K *BufToK(BUF *b, bool private_key, bool text, char *password)
|
||||
{
|
||||
|
Reference in New Issue
Block a user