Skip to content

Commit 2d14cd2

Browse files
committed
Fixes for building wolfCrypt with no RSA (--disable-rsa / NO_RSA).
1 parent 1041898 commit 2d14cd2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/pcr/policy_sign.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ static int PolicySign(TPM_ALG_ID alg, const char* keyFile, const char* password,
165165
wc_FreeRsaKey(&key.rsa);
166166
}
167167
#else
168+
(void)hashAlg;
168169
rc = NOT_COMPILED_IN;
169170
#endif
170171
}

wolftpm/tpm2_wrap.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,10 +1326,9 @@ WOLFTPM_API int wolfTPM2_RsaKey_WolfToTpm_ex(WOLFTPM2_DEV* dev,
13261326
WOLFTPM_API int wolfTPM2_RsaKey_PubPemToTpm(WOLFTPM2_DEV* dev,
13271327
WOLFTPM2_KEY* tpmKey, const byte* pem, word32 pemSz);
13281328

1329-
13301329
/*!
13311330
\ingroup wolfTPM2_Wrappers
1332-
\brief Import DER ECC private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
1331+
\brief Import DER RSA private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
13331332
13341333
\return TPM_RC_SUCCESS: successful
13351334
\return TPM_RC_FAILURE: generic failure (check TPM IO and TPM return code)
@@ -1343,9 +1342,9 @@ WOLFTPM_API int wolfTPM2_RsaKey_PubPemToTpm(WOLFTPM2_DEV* dev,
13431342
13441343
\sa wolfTPM2_ImportPublicKeyBuffer
13451344
\sa wolfTPM2_ImportPrivateKeyBuffer
1346-
\sa wolfTPM2_DecodeRsaDer
1345+
\sa wolfTPM2_DecodeEccDer
13471346
*/
1348-
WOLFTPM_API int wolfTPM2_DecodeEccDer(const byte* der, word32 derSz,
1347+
WOLFTPM_API int wolfTPM2_DecodeRsaDer(const byte* der, word32 derSz,
13491348
TPM2B_PUBLIC* pub, TPM2B_SENSITIVE* sens, TPMA_OBJECT attributes);
13501349
#endif /* !NO_RSA */
13511350

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

14271426
/*!
14281427
\ingroup wolfTPM2_Wrappers
1429-
\brief Import DER RSA private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
1428+
\brief Import DER ECC private or public key into TPM public and sensitive structures. This does not make any calls to TPM hardware.
14301429
14311430
\return TPM_RC_SUCCESS: successful
14321431
\return TPM_RC_FAILURE: generic failure (check TPM IO and TPM return code)
@@ -1440,9 +1439,9 @@ WOLFTPM_API int wolfTPM2_EccKey_WolfToPubPoint(WOLFTPM2_DEV* dev, ecc_key* wolfK
14401439
14411440
\sa wolfTPM2_ImportPublicKeyBuffer
14421441
\sa wolfTPM2_ImportPrivateKeyBuffer
1443-
\sa wolfTPM2_DecodeEccDer
1442+
\sa wolfTPM2_DecodeRsaDer
14441443
*/
1445-
WOLFTPM_API int wolfTPM2_DecodeRsaDer(const byte* der, word32 derSz,
1444+
WOLFTPM_API int wolfTPM2_DecodeEccDer(const byte* der, word32 derSz,
14461445
TPM2B_PUBLIC* pub, TPM2B_SENSITIVE* sens, TPMA_OBJECT attributes);
14471446
#endif /* HAVE_ECC */
14481447
#endif /* !WOLFTPM2_NO_WOLFCRYPT */

0 commit comments

Comments
 (0)