Michael
Michael

Reputation: 1383

Is it possible to port openssl into Linux driver?

I am using a cut-down embedded linux. Since I need to use SAE and I need openssl. However, I was asked to not implement it in userspace.. So I try to port openssl in linux driver. I know it sounds crazy..

Its very very painful. I am wondering if there are any alternative ways so I can use libcrypt.so in driver? I need to include some header file and use some functions to finish SAE encryption.

Upvotes: 0

Views: 1433

Answers (1)

Vlad
Vlad

Reputation: 9481

I've been asked to do that many times by many people who don't understand how OpenSSL is put together. It might be possible to do with very old versions of OpenSSL circa 2002, 2003.

Modern versions of OpenSSL rely on a lot of things that exist only in userspace such as use of PThreads library and custom memory allocation. It will be a giant undertaking to port these into kernel space.

Also, lot of code in OpenSSL has a lot of sequential IO. This stuff needs to be completely rewritten for the kernel space.

This is very hard to implement correctly with the same degree of paranoia that openSSL has. And paranoia is justified, there were numerous of exploits on openSSL throughout it's existence. Crypto code is very high value target, so taking any shortcuts is just asking for trouble.

If you need to crypto algorithms, use kernel crypto API. It's pretty much extraction of code from OpenSSL. For more complicated things having a daemon in user space that runs SSL protocols for you is the way to go.

Upvotes: 4

Related Questions