Support for disabling ASN.1 (--disable-asn) and still provide parameter encryption support.

pull/269/head
David Garske 2023-05-02 18:11:15 -07:00
parent 4242f2f6cf
commit 382ff91eb3
3 changed files with 6 additions and 4 deletions

View File

@ -159,7 +159,8 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
if (alg == TPM_ALG_RSA) {
if (derEncode == 1) {
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && !defined(NO_RSA)
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && !defined(NO_RSA) && \
!defined(NO_ASN)
rc = wolfTPM2_RsaPrivateKeyImportDer(&dev, &storage, &impKey,
kRsaKeyPrivDer, sizeof(kRsaKeyPrivDer), TPM_ALG_NULL,
TPM_ALG_NULL);

View File

@ -111,7 +111,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
#ifndef WOLFTPM2_NO_WOLFCRYPT
int tpmDevId = INVALID_DEVID;
#if defined(HAVE_ECC) || !defined(NO_RSA)
#if defined(HAVE_ECC) || (!defined(NO_RSA) && !defined(NO_ASN))
word32 idx;
#endif
#ifndef NO_RSA
@ -386,7 +386,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
/*------------------------------------------------------------------------*/
/* RSA KEY LOADING TESTS */
/*------------------------------------------------------------------------*/
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && !defined(NO_RSA)
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && !defined(NO_RSA) && !defined(NO_ASN)
/* Extract an RSA public key from TPM */
/* Setup wolf RSA key with TPM deviceID */
/* crypto dev callbacks are used for private portion */

View File

@ -2390,7 +2390,8 @@ int wolfTPM2_RsaKey_PubPemToTpm(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,
return BAD_FUNC_ARG;
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && defined(WOLFSSL_PEM_TO_DER) && \
(defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER))
(defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER)) && \
!defined(NO_ASN)
/* Prepare wolfCrypt key structure */
rc = wc_InitRsaKey(&rsaKey, NULL);
if (rc == 0) {