Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build error with missing wc_RsaKeyToPublicDer_ex #323

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,8 @@ int wolfTPM2_ExportPublicKeyBuffer(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,

/* determine the type of key in WOLFTPM2_KEY */
if (tpmKey->pub.publicArea.type == TPM_ALG_ECC) {
#ifdef HAVE_ECC
#if defined(HAVE_ECC) && \
defined(HAVE_ECC_KEY_IMPORT) && defined(HAVE_ECC_KEY_EXPORT)
rc = wc_ecc_init(&key.ecc);
if (rc == 0) {
/* load public portion of key into wolf ECC Key */
Expand All @@ -2772,7 +2773,11 @@ int wolfTPM2_ExportPublicKeyBuffer(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* tpmKey,
#endif
}
else if (tpmKey->pub.publicArea.type == TPM_ALG_RSA) {
#ifndef NO_RSA
/* RSA public key export only enabled with:
* cert gen, key gen or openssl extra */
#if !defined(NO_RSA) && \
(defined(WOLFSSL_CERT_GEN) || defined(OPENSSL_EXTRA) || \
defined(WOLFSSL_KEY_GEN))
rc = wc_InitRsaKey(&key.rsa, NULL);
if (rc == 0) {
/* load public portion of key into wolf RSA Key */
Expand Down