Skip to contentSkip to conversation

Support for EAP-TLS with openssl TPM2 engine

tpm2 David Woodhouse 1 participant 1 message Mar 14, 2019 1 message not in the archive

lore
Share & tools
lore

David Woodhouse

author
#1 lore raw
In reply to a message not in the archive
Quoted 14 lines · James Bottomley
Quoted 13 lines · David Woodhouse
Quoted 11 lines · James Bottomley
Quoted 6 lines · John
Quoted 5 lines · David Woodhouse

Here's a quick hack to make it work by abusing the OpenSC engine config, as a proof of concept. Making it work cleanly so that it can be merged is left as an exercise for the reader, or perhaps an interested party in one of the mailing lists I've added to Cc.

Well, you can't have the engine name hard coded ... that really needs to be some type of parameter, which is going to be 99% of the hassle making a proper patch ...

Quoted 5 lines
Quoted 3 lines

And of course, it shouldn't have to be specified at all. If given a PEM file which happens to look like a TPM2 engine key, then the appropriate engine should be invoked automatically.

Hey don't beat me on the sore spot ...

:)

This isn't really that hard to do in applications. For those using OpenSSL it's just a case of making them recognise the appropriate -----BEGIN string and invoke the engine appropriately.

Once my support gets merged into GnuTLS, it really can be automatic with the application not having to do anything at all. OpenSSL might get there too, once we have STORE support working in applications.

Quoted 8 lines
Quoted 5 lines

Although if you just wanted to use those keys with GnuTLS, you could have done that directly. I already ported it all except the new "importable" keys support.

http://git.infradead.org/users/dwmw2/openconnect.git/blob/HEAD:/gnutls_tpm2_ibm.c

Well, you know, using engines with gnutls does mean we don't have to write the same code twice over ...

I'm not convinced that an OpenSSL ENGINE is the right form for implementing this kind of thing in the general case. PKCS#11 is much better as an existing portable standard, although it doesn't fit the TPMv2 usage model very well.

Even OpenSSL is moving away from ENGINEs to a different plugin mechanism.