Re: TPM2_Sign vs TPM2_RSA_Decrypt

"Jarkko Sakkinen" <[email protected]> Thu, 16 May 2024 15:51:47 +0300
Newsgroups dev.linux.lists.tpm2
Message-ID <[email protected]>
On Thu May 16, 2024 at 3:01 PM EEST,  wrote:
> For the OpenSSL engines and also the GNU-TLS engine, we go ahead and
> use TPM2_RSA_Decrypt for RSA Signing but TPM2_Sign for ECDSA signing.

Yeah we get simplest and most understandable and most compatible
RSA because it is textbook style with no strings attached :-)
You can fit it to any scheme.

I can admit after reading TPM2_Sign documentation, my head hurts
and I still don't think I fully get the gist of it so better not
to use something that you don't get, right? :-)

If someone could really put TPM2_Sign into nutshell that'd be
awesome.

> The reason here was, that OpenSSL wants to perform SHA512 digests and
> padding, whilst the TPM only supported SHA384. And an OpenSSL engine
> could not tell the OpenSSL-TLS-module, which Hash-Algs are supported.
> If that restriction does not exist, I would also tend to use TPM2_Sign
> for RSA signing.

Maybe a dumb question but what I could possibly accomplish with
TPM2_Sign that I could not accomplish with TPM2_RSA_Decrypt and
appropraite ASN.1 heading and padding?

This connects to the not understanding TPM2_Sign (obviously).

Just trying to make sure that we make exactly right call for
kernel.

Thanks for responding!

>
> Cheers,
> Andreas

BR, Jarkko