Skip to content

Commit

Permalink
Fixes for building wolfCrypt with no RSA (--disable-rsa / NO_RSA).
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Oct 20, 2023
1 parent 24b7594 commit af410f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions examples/pcr/policy_sign.c
Expand Up @@ -165,6 +165,7 @@ static int PolicySign(TPM_ALG_ID alg, const char* keyFile, const char* password,
wc_FreeRsaKey(&key.rsa);
}
#else
(void)hashAlg;
rc = NOT_COMPILED_IN;
#endif
}
Expand Down
13 changes: 6 additions & 7 deletions wolftpm/tpm2_wrap.h
Expand Up @@ -1326,10 +1326,9 @@ WOLFTPM_API int wolfTPM2_RsaKey_WolfToTpm_ex(WOLFTPM2_DEV* dev,
WOLFTPM_API int wolfTPM2_RsaKey_PubPemToTpm(WOLFTPM2_DEV* dev,
WOLFTPM2_KEY* tpmKey, const byte* pem, word32 pemSz);


/*!
\ingroup wolfTPM2_Wrappers
\brief Import DER ECC private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
\brief Import DER RSA private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
\return TPM_RC_SUCCESS: successful
\return TPM_RC_FAILURE: generic failure (check TPM IO and TPM return code)
Expand All @@ -1343,9 +1342,9 @@ WOLFTPM_API int wolfTPM2_RsaKey_PubPemToTpm(WOLFTPM2_DEV* dev,
\sa wolfTPM2_ImportPublicKeyBuffer
\sa wolfTPM2_ImportPrivateKeyBuffer
\sa wolfTPM2_DecodeRsaDer
\sa wolfTPM2_DecodeEccDer
*/
WOLFTPM_API int wolfTPM2_DecodeEccDer(const byte* der, word32 derSz,
WOLFTPM_API int wolfTPM2_DecodeRsaDer(const byte* der, word32 derSz,
TPM2B_PUBLIC* pub, TPM2B_SENSITIVE* sens, TPMA_OBJECT attributes);
#endif /* !NO_RSA */

Expand Down Expand Up @@ -1426,7 +1425,7 @@ WOLFTPM_API int wolfTPM2_EccKey_WolfToPubPoint(WOLFTPM2_DEV* dev, ecc_key* wolfK

/*!
\ingroup wolfTPM2_Wrappers
\brief Import DER RSA private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
\brief Import DER ECC private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
\return TPM_RC_SUCCESS: successful
\return TPM_RC_FAILURE: generic failure (check TPM IO and TPM return code)
Expand All @@ -1440,9 +1439,9 @@ WOLFTPM_API int wolfTPM2_EccKey_WolfToPubPoint(WOLFTPM2_DEV* dev, ecc_key* wolfK
\sa wolfTPM2_ImportPublicKeyBuffer
\sa wolfTPM2_ImportPrivateKeyBuffer
\sa wolfTPM2_DecodeEccDer
\sa wolfTPM2_DecodeRsaDer
*/
WOLFTPM_API int wolfTPM2_DecodeRsaDer(const byte* der, word32 derSz,
WOLFTPM_API int wolfTPM2_DecodeEccDer(const byte* der, word32 derSz,
TPM2B_PUBLIC* pub, TPM2B_SENSITIVE* sens, TPMA_OBJECT attributes);
#endif /* HAVE_ECC */
#endif /* !WOLFTPM2_NO_WOLFCRYPT */
Expand Down

0 comments on commit af410f4

Please sign in to comment.