How to write openssl engine

I want to write a dynamic openssl engine, but I can not find for this document.

My algorithm I want to write is a chopper algorithm (e.g. rsa) and a hash algorithm (e.g. md5).

Is there any simple kernel source that I can modify and use it?

+7
source share
2 answers

Is there any simple kernel source that I can modify and use it?

The Intel RDRAND processor RDRAND pretty easy to understand. You can find its sources:

 openssl-1.0.1f$ grep -R -i ENGINE_rdrand * crypto/engine/eng_rdrand.c:static ENGINE *ENGINE_rdrand(void) crypto/engine/eng_rdrand.c: ENGINE *toadd = ENGINE_rdrand(); 

Here you can download and install it as the default random number generator mechanism (from Random Numbers | Hardware ):

 unsigned long err = 0; int rc = 0; OPENSSL_cpuid_setup(); ENGINE_load_rdrand(); ENGINE* eng = ENGINE_by_id("rdrand"); err = ERR_get_error(); if(NULL == eng) { fprintf(stderr, "ENGINE_load_rdrand failed, err = 0x%lx\n", err); abort(); /* failed */ } rc = ENGINE_init(eng); err = ERR_get_error(); if(0 == rc) { fprintf(stderr, "ENGINE_init failed, err = 0x%lx\n", err); abort(); /* failed */ } rc = ENGINE_set_default(eng, ENGINE_METHOD_RAND); err = ERR_get_error(); if(0 == rc) { fprintf(stderr, "ENGINE_set_default failed, err = 0x%lx\n", err); abort(); /* failed */ } /* OK to proceed */ ... ENGINE_finish(eng); ENGINE_free(eng); 
+1
source

I suggest you do

 apt-get source openssl 

This will give you the openssl source code. Inside the tree you can find, for example, the crypto / rsa and crypto / md5 directories, which, I think, will be a good start for your project. It also comes with some documentation in the form of README, etc.

Good luck.

0
source

All Articles