Hi Hayden,
I have a couple questions about using wolfEngine from a config file.
I've set my /usr/local/ssl/openssl.cnf with the following:
openssl_conf = openssl_init
[ openssl_init ]
oid_section = new_oids
engines = engine_section
[ engine_section ]
wolfSSL = wolfssl_section
[ wolfssl_section ]
engine_id = libwolfengine
dynamic_path = /usr/local/lib/engines-1.1/libwolfengine.dylib
init = 1
enable_debug = 1
default_algorithms = ALL
Now this appears to work on the command line, as when I run "openssl engine" it prints multiple lines regarding wolfEngine, and running "openssl aes" commands on the CL also indicates that wolfEngine is being used.
However, when running this code:
int main() {
printf("Hello, World!\n");
ENGINE *e;
ENGINE_load_builtin_engines();
e = ENGINE_by_id("libwolfengine");
ENGINE_init(e);
//ENGINE_set_default(e, ENGINE_METHOD_ALL); // so far wolfEngine only outputs logs if this is set
//ENGINE_finish(e);
//ENGINE_free(e);
// print wolfEngine logs
ENGINE_ctrl_cmd(e, "enable_debug", 1, NULL, NULL, 0);
unsigned char buffer[128];
if (1 != RAND_bytes(buffer, sizeof(buffer))) {
fprintf(stderr, "error with RAND_bytes\n");
}
printf("Made it to end\n");
return 0;
}
It doesn't indicate that wolfEngine is being used unless I uncomment "ENGINE_set_default". But my questions are:
1. Is there a way to use wolfEngine without calling any ENGINE functions? For example, if I called RAND_bytes in my code without using any ENGINE calls, it would use wolfEngine. I would like to be able to use my existing OpenSSL code and not have to add to it.
2. if yes to 1, how can I verify OpenSSL is delegating the function calls to wolfEngine?
Thank you