-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c187b23
commit 593e457
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/ci/integration/tpm2_tools_patch/aws-lc-tpm2-tools.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/lib/tpm2_identity_util.c b/lib/tpm2_identity_util.c | ||
index fbf1e938..2c6448d3 100644 | ||
--- a/lib/tpm2_identity_util.c | ||
+++ b/lib/tpm2_identity_util.c | ||
@@ -91,7 +91,7 @@ static bool share_secret_with_tpm2_rsa_public_key(TPM2B_DIGEST *protection_seed, | ||
goto error; | ||
} | ||
|
||
- rc = EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, newlabel, label_len); | ||
+ rc = EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, (uint8_t*)newlabel, label_len); | ||
if (rc <= 0) { | ||
LOG_ERR("Failed EVP_PKEY_CTX_set0_rsa_oaep_label"); | ||
free(newlabel); | ||
diff --git a/lib/tpm2_openssl.c b/lib/tpm2_openssl.c | ||
index 516d8b63..48d75c7b 100644 | ||
--- a/lib/tpm2_openssl.c | ||
+++ b/lib/tpm2_openssl.c | ||
@@ -36,7 +36,7 @@ int tpm2_openssl_halgid_from_tpmhalg(TPMI_ALG_HASH algorithm) { | ||
return NID_sha384; | ||
case TPM2_ALG_SHA512: | ||
return NID_sha512; | ||
-#if OPENSSL_VERSION_NUMBER >= 0x10101000L | ||
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L && HAVE_EVP_SM3 | ||
case TPM2_ALG_SM3_256: | ||
return NID_sm3; | ||
#endif | ||
@@ -666,7 +666,7 @@ static const struct { | ||
{ TPM2_ECC_NIST_P256, NID_X9_62_prime256v1 }, | ||
{ TPM2_ECC_NIST_P384, NID_secp384r1 }, | ||
{ TPM2_ECC_NIST_P521, NID_secp521r1 }, | ||
-#if OPENSSL_VERSION_NUMBER >= 0x10101003L | ||
+#if OPENSSL_VERSION_NUMBER >= 0x10101003L && HAVE_EVP_SM3 | ||
{ TPM2_ECC_SM2_P256, NID_sm2 }, | ||
#endif | ||
/* | ||
diff --git a/tools/misc/tpm2_checkquote.c b/tools/misc/tpm2_checkquote.c | ||
index e5f8ef41..10847523 100644 | ||
--- a/tools/misc/tpm2_checkquote.c | ||
+++ b/tools/misc/tpm2_checkquote.c | ||
@@ -80,7 +80,7 @@ static bool verify(void) { | ||
return false; | ||
} | ||
|
||
-#if OPENSSL_VERSION_NUMBER >= 0x10101003L | ||
+#if OPENSSL_VERSION_NUMBER >= 0x10101003L && HAVE_EVP_SM3 | ||
#if OPENSSL_VERSION_MAJOR < 3 | ||
if (ctx.halg == TPM2_ALG_SM3_256) { | ||
ret = EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2); |