Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openssl engine support #202

Closed
wants to merge 2 commits into from

Conversation

nicopernas
Copy link
Contributor

These two commits enable OpenSSL engine support on both libmosquitto and broker code paths.

An OpenSSL engine can be used to offload CPU intensive cryptographic operations to a dedicated hardware. The main goal behind these patches though is to being able to access to a TPM module (Trusted Platform Module) from mosquitto clients.

Taken from the Wikipedia

Trusted Platform Module (TPM) is an international standard for a secure cryptoprocessor, which is a dedicated microcontroller designed to secure hardware by integrating cryptographic keys into devices. TPM's technical specification was written by a computer industry consortium called Trusted Computing Group (TCG). International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC) standardized the specification as ISO/IEC 11889 in 2009

The patches add two new options to libmosquitto and mosquitto.conf.

  • tls-engine: specifies the ID of the OpenSSL engine to be used. These can be listed by running openssl engine -t
  • keyform: specifies the key format. It can be pem (default) or engine.

All existent tests are still passing but no new ones have been added. The setup I've used to test the patches is quite complex and didn't think it would be a good idea to incorporate it as an automated test. It involves using a TPM emulator, TrouSerS and an OpenSSL TPM engine. I have a detailed guide of how to set it up and the results I got in case you are wondering.

Nico.

Nicolás Pernas Maradei added 2 commits July 2, 2016 15:19
- Clients can now offload crypto tasks to an external crypto device through
  the OpenSSL ENGINE API.
- The keyfiles can now be treated as PEM or ENGINE keys.
- Two new functions were added to libmosquitto to set up the previously
  mentioned features.
- Both mosquitto_sub and mosquitto_pub include support to turn on the mentioned
  features through command line options.

Signed-off-by: Nicolás Pernas Maradei <[email protected]>
Add same OpenSSL engine support to mosquitto (server side) previously added to
client side only.

Signed-off-by: Nicolás Pernas Maradei <[email protected]>
@ralight
Copy link
Contributor

ralight commented Jul 5, 2016

Thanks for this, I'm looking at it and will get back to you.

@nicopernas
Copy link
Contributor Author

Hi Roger, did you get a chance to look into the patch? It looks like the branch which I forked from has changed quite a lot since July and the patch does not apply anymore. Should I upload a new version of it?

Thanks,
Nico.

@perrettecl
Copy link

Hello,
Is possible to know when this future will be integrated ? Thank you.

@ralight
Copy link
Contributor

ralight commented Aug 9, 2018

This is a worthwhile PR. It wasn't included in version 1.5, but I'd be keen on getting it into the next features release. Are you willing to take a look at it again? If you are, please base it on the develop branch. I plan to release version 1.5.1 next week, then will merge what is currently the fixes branch into it, but there shouldn't be much trouble with it.

@nicopernas
Copy link
Contributor Author

It's going to be hard to test but let me see what I can do. I used to have the environment set up and a guide on how to do it again, but that stayed with my previous job :)
Maybe someone else is willing to help with the testing part?

I'll try to send something over the weekend.

Nico.

@nicopernas
Copy link
Contributor Author

I've rebased my changes from develop and they build, so that's a good first step. I am going to give the testing a try.
Bad news is I don't have permissions to push to my original fork, so I think I'd have to create a new PR, not sure if I can re-write this one.

@ralight
Copy link
Contributor

ralight commented Aug 9, 2018

If it means having to create a new PR, that's no problem for me. Good work on the fast response.

@nicopernas
Copy link
Contributor Author

I've created #915 with a revisited version of these changes. Feel free to close this one.

@ralight
Copy link
Contributor

ralight commented Aug 13, 2018

Closing as requested, I'll be looking at the new one tomorrow hopefully.

@ralight ralight closed this Aug 13, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants