Re: [PATCH v2] crypto: rsa-pkcs1pad: export rsa1_asn_lookup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu May 16, 2024 at 7:14 AM EEST, Herbert Xu wrote:
> On Wed, May 15, 2024 at 06:02:10PM +0300, Jarkko Sakkinen wrote:
> > ASN.1 template is required for TPM2 asymmetric keys, as it needs to be
> > piggy-packed with the input data before applying TPM2_RSA_Decrypt. This
> > patch prepares crypto subsystem for the addition of those keys.
> > 
> > Later rsa_lookup_asn1() can be enabled in crypto/asymmetric_keys/Kconfig
> > by:
> > 
> > 	depends on CRYPTO_RSA >= <TPM2 asymmetric keys>
> > 
> > Cc: James Prestwood <prestwoj@xxxxxxxxx>
> > Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
> > ---
> > v2:
> > - Fix typo in the kdoc.
> > - Export also the template struct.
> > ---
> >  crypto/rsa-pkcs1pad.c         | 16 ++++++++++------
> >  include/crypto/rsa-pkcs1pad.h | 20 ++++++++++++++++++++
> >  2 files changed, 30 insertions(+), 6 deletions(-)
> >  create mode 100644 include/crypto/rsa-pkcs1pad.h
>
> Please provide a link to the patch that will make use of this.

OK, fair enough. Will be part of the full patch set.

Overally I can say that this will be used to make textbook RSA
to a proper RSA signature ASN.1 and appropriate padding. I.e.
breath new life to this patch, which has duplicate code:

https://lore.kernel.org/all/20200518172704.29608-18-prestwoj@xxxxxxxxx/

TPM2_RSA_Decrypt is exactly textbook RSA so it partially needs
the code from kernel's RSA implementation.

BR, Jarkko





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux