[14/17] include: linux: tpm: expose tpm2_rsa_decrypt
diff mbox series

Message ID 20200518172704.29608-15-prestwoj@gmail.com
State New
Headers show
Series
  • Asymmetric key operations on TPM2
Related show

Commit Message

James Prestwood May 18, 2020, 5:27 p.m. UTC
Expose these APIs so other modules can use them.
---
 include/linux/tpm.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch
diff mbox series

diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index b1c96ee7b672..7dd33f144bce 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -387,6 +387,9 @@  static inline u32 tpm2_rc_value(u32 rc)
        return (rc & BIT(7)) ? rc & 0xff : rc;
 }
 
+extern int tpm2_rsa_decrypt(struct tpm_chip *chip, u32 parent,
+			    const unsigned char *keyblob, size_t bloblen,
+			    const void *data, size_t len, void *out);
 #else
 static inline int tpm_is_tpm2(struct tpm_chip *chip)
 {
@@ -418,5 +421,11 @@  static inline struct tpm_chip *tpm_default_chip(void)
 {
 	return NULL;
 }
+static inline int tpm2_rsa_decrypt(struct tpm_chip *chip, u32 parent,
+				   const unsigned char *keyblob, size_t bloblen,
+				   const void *data, size_t len, void *out)
+{
+	return -ENODEV;
+}
 #endif
 #endif