<div dir="ltr"><div><div><div>Matt, <br></div><br>Thank you very much for your response. I understand that the FIPS certified OpenSSL module is long awaited and the team was quite limited in time to complete all features.<br></div>I tried Windows certificates +Openssl because it implements the most common scenario: you can get a certificate to Openssl in DER format, but you can't get the private key. HSMs, KMIP servers or Windows don't let you export the private key.  It can be only virtualized (You sure know it, but I'm writing it also for our readers.)</div><div>So, when I load X509 from storage it is handled by OpenSSL directly and gets type "RSA".When the private key is supplied, it has type of "MYTYPE" and actually represents a handle. If I skip the key matching part, "openssl ca" works and a cert request can be signed with such a handle.<br></div><div>As I understand, Openssl doesn't handle it completely yet. But it was planned so and maybe we will see it in the future.</div><div>If ENGINE is now deprecated (is it?), what HSM vendors should do?</div><div></div><div>--</div><div>Alex Dankow</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br><br><br><br><div><br><div><div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 29, 2021 at 10:11 PM Matt Caswell <<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Alex,<br>
<br>
On 29/10/2021 14:32, Alex Dankow wrote:<br>
> Hi OpenSSL team!<br>
> <br>
> I wrote a provider for Windows certificates and implemented "openssl ca".<br>
> Now, I think it would be fun to see a HTTPS server using certificates <br>
> installed in Windows storage.<br>
Nice!<br>
<br>
> <br>
> Certificate is loaded using load_cert_pass (taken from apps.c) with <br>
> custom uri "wincert://11:22:33....",  private key is loaded with <br>
> load_key from apps.c too. It works, but ...<br>
> When I use  SSL_CTX_use_PrivateKey(ctx, myprivk)  the key is declined. <br>
> OpenSSL compares strings and expects "rsaEncryption", and so on instead <br>
> of "MYKEY". Why ?<br>
<br>
It's not entirely clear to me what you are attempting here. Are your <br>
certificates/keys stored in Windows storage standard RSA/ECDSA etc <br>
certs? Or are they using some custom algorithm?<br>
<br>
If they are standard RSA/ECSDA certs then you should be using the <br>
correct standard algorithm names in you keymgmt etc and it should all <br>
"just work".<br>
<br>
Unfortunately, in 3.0, libssl only supports standard algorithms. We have <br>
discussed a "pluggable" signature scheme mechanism which would enable <br>
plugging in arbitrary algorithms but it didn't make it for 3.0:<br>
<br>
<a href="https://github.com/openssl/openssl/issues/10512" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/issues/10512</a><br>
<br>
I'd still like to get back to that at some point but we don't have it <br>
yet. It should be entirely possible with the new provider architecture - <br>
and in fact we *did* add pluggable kex/kem support for libssl. But we <br>
just ran out of time with pluggable signatures.<br>
<br>
<a href="https://github.com/openssl/openssl/pull/11914" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/pull/11914</a><br>
<a href="https://github.com/openssl/openssl/pull/13018" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/pull/13018</a><br>
<br>
<br>
Matt<br>
<br>
> Maybe I'm missing something, but if you built a key management system, <br>
> sign interface, ciphers that allows key virtualization, why not go <br>
> further ? I'm ready to implement the encryption interface, but why <br>
> OpenSSL still care about key type name. In the new era of version 3, it <br>
> can check if the key provides necessary interfaces.<br>
> <br>
> --<br>
> Alex Dankow<br>
> <br>
> <br>
</blockquote></div>