I created an engine in OpenSSL and I want to use it in OpenVPN. I made .so file and copied that to /usr/local/lib directory (this directory is fixed in OpenSSL configuration). I changed openssl.cnf. So OpenSSL recognized my engine. After that I changed option.c file in src directory in OpenVPN-2.3.2. I defined o->engine by my engine id. But that does not work...
this is my engine code:
Code: Select all
static int bind_fn(ENGINE * e, const char *id)
{
if (!ENGINE_set_id(e, "sample") ||
!ENGINE_set_name(e, "sample engine")) {
return 0;
} else {
return 1;
}
}
IMPLEMENT_DYNAMIC_CHECK_FN();
IMPLEMENT_DYNAMIC_BIND_FN(bind_fn);
Code: Select all
openssl_conf = openssl_def
[openssl_def]
engines = engines_section
[engines_section]
sample = sample_section
[sample_section]
engine_id = sample
dynamic_path = /path/sample_engine.so
init = 0
default_algorithms = ALL
[req]
distinguished_name = req_distinguished_name
[req_distinguished_name]
CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet
Code: Select all
const char * id = "sample";
o->engine = id;