mirror of https://github.com/wolfSSL/wolfTPM.git
Support for disabling ASN.1 (--disable-asn) and still provide parameter encryption support.
parent
4242f2f6cf
commit
382ff91eb3
|
@ -159,7 +159,8 @@ int TPM2_Keyimport_Example(void* userCtx, int argc, char *argv[])
|
||||||
|
|
||||||
if (alg == TPM_ALG_RSA) {
|
if (alg == TPM_ALG_RSA) {
|
||||||
if (derEncode == 1) {
|
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,
|
rc = wolfTPM2_RsaPrivateKeyImportDer(&dev, &storage, &impKey,
|
||||||
kRsaKeyPrivDer, sizeof(kRsaKeyPrivDer), TPM_ALG_NULL,
|
kRsaKeyPrivDer, sizeof(kRsaKeyPrivDer), TPM_ALG_NULL,
|
||||||
TPM_ALG_NULL);
|
TPM_ALG_NULL);
|
||||||
|
|
|
@ -111,7 +111,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
|
||||||
|
|
||||||
#ifndef WOLFTPM2_NO_WOLFCRYPT
|
#ifndef WOLFTPM2_NO_WOLFCRYPT
|
||||||
int tpmDevId = INVALID_DEVID;
|
int tpmDevId = INVALID_DEVID;
|
||||||
#if defined(HAVE_ECC) || !defined(NO_RSA)
|
#if defined(HAVE_ECC) || (!defined(NO_RSA) && !defined(NO_ASN))
|
||||||
word32 idx;
|
word32 idx;
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
|
@ -386,7 +386,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
/* RSA KEY LOADING TESTS */
|
/* 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 */
|
/* Extract an RSA public key from TPM */
|
||||||
/* Setup wolf RSA key with TPM deviceID */
|
/* Setup wolf RSA key with TPM deviceID */
|
||||||
/* crypto dev callbacks are used for private portion */
|
/* crypto dev callbacks are used for private portion */
|
||||||
|
|
|
@ -2390,7 +2390,8 @@ int wolfTPM2_RsaKey_PubPemToTpm(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
#if !defined(WOLFTPM2_NO_WOLFCRYPT) && defined(WOLFSSL_PEM_TO_DER) && \
|
#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 */
|
/* Prepare wolfCrypt key structure */
|
||||||
rc = wc_InitRsaKey(&rsaKey, NULL);
|
rc = wc_InitRsaKey(&rsaKey, NULL);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
|
|
Loading…
Reference in New Issue