]> git.proxmox.com Git - libtpms.git/commitdiff
tpm12: Use USE_FREEBL_CRYPTO_LIBRARY to enable function
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Tue, 13 Oct 2020 00:26:19 +0000 (20:26 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 13 Oct 2020 21:02:53 +0000 (17:02 -0400)
A tpm12 function that is only needed with freebl library can
be conditionally enabled with '#if USE_FREEBL_CRYPTO_LIBRARY'.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/tpm12/tpm_crypto.c
src/tpm12/tpm_crypto.h

index 682e114fa3fac01870010a3cbb5ad04b2d27a39b..a2b6c2f4d85315042b619a6933a58a93372e719b 100644 (file)
@@ -752,7 +752,7 @@ TPM_RESULT TPM_RSAPublicEncrypt(unsigned char* encrypt_data,    /* encrypted dat
     return rc;
 }
 
-#if 0
+#if USE_FREEBL_CRYPTO_LIBRARY
 /* TPM_RSAPublicEncryptRaw() does a raw public key operation without any padding.
 
 */
index f89b98577239afc889a6d5690710712ccf37acc3..f2d0701836ecbeb463a7ed307bad13b72b1d6b39 100644 (file)
@@ -40,6 +40,8 @@
 #ifndef TPM_CRYPTO_H
 #define TPM_CRYPTO_H
 
+#include "config.h"  /* libtpms added */
+
 #include "tpm_secret.h"
 #include "tpm_types.h"
 
@@ -129,7 +131,7 @@ TPM_RESULT TPM_RSAPublicEncrypt(unsigned char* encrypt_data,
                                 uint32_t nbytes,
                                 unsigned char *earr,
                                 uint32_t ebytes);
-#if 0
+#if USE_FREEBL_CRYPTO_LIBRARY
 TPM_RESULT TPM_RSAPublicEncryptRaw(unsigned char *encrypt_data,
                                   uint32_t encrypt_data_size,
                                   unsigned char *decrypt_data,