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

src: Check if NID_sm2 is defined #2602

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/tss2-esys/esys_crypto_ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ iesys_cryptossl_get_ecdh_point(TPM2B_PUBLIC *key,
curveId = NID_secp521r1;
key_size = 66;
break;
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#ifdef NID_sm2
case TPM2_ECC_SM2_P256:
curveId = NID_sm2;
key_size = 32;
Expand Down
4 changes: 2 additions & 2 deletions src/tss2-fapi/fapi_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ ossl_ecc_pub_from_tpm(const TPM2B_PUBLIC *tpmPublicKey, EVP_PKEY **evpPublicKey)
case TPM2_ECC_NIST_P521:
curveId = NID_secp521r1;
break;
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#ifdef NID_sm2
case TPM2_ECC_SM2_P256:
curveId = NID_sm2;
break;
Expand Down Expand Up @@ -1195,7 +1195,7 @@ get_ecc_tpm2b_public_from_evp(
case NID_secp521r1:
tpmCurveId = TPM2_ECC_NIST_P521;
break;
#if OPENSSL_VERSION_NUMBER >= 0x10101000L
#ifdef NID_sm2
case NID_sm2:
tpmCurveId = TPM2_ECC_SM2_P256;
break;
Expand Down