tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
148 stars 97 forks source link

rsa: fix OAEP padding decryption #267

Closed raghuncstate closed 1 year ago

raghuncstate commented 1 year ago

With OpenSSL 1.1.1, using RSA OAEP as rsa_padding_mode failed with error that the padding mode was unknown. This is because the OpenSSL EVP_PKEY_METH for decryption, pkey_rsa_decrypt(), calls the RSA decrypt method with RSA_NO_PADDING as padding, and then checks the OAEP padding after raw decryption. This patch fixes the use of OAEP decryption by allow RSA_NO_PADDING as an accepted padding value and uses inScheme to the TPM as TPM_ALG_NULL, allowing RSA OAEP decryption to work correctly.

Signed-off-by: Raghu Krishnamurthy raghupathyk@nvidia.com

williamcroberts commented 1 year ago

Manually checked whitespace errors since CI was hung