diff --git a/src/tss2-fapi/api/Fapi_Import.c b/src/tss2-fapi/api/Fapi_Import.c index a4468f64d..7106e1ab9 100644 --- a/src/tss2-fapi/api/Fapi_Import.c +++ b/src/tss2-fapi/api/Fapi_Import.c @@ -186,6 +186,8 @@ Fapi_Import_Async( &extPubKey->public); goto_if_error(r, "Convert PEM public key into TPM public key.", cleanup_error); + extPubKey->public.publicArea.nameAlg = context->profiles.default_profile.nameAlg; + command->new_object = *object; if (strncmp("/", path, 1) == 0) pos = 1; diff --git a/src/tss2-fapi/fapi_crypto.c b/src/tss2-fapi/fapi_crypto.c index a237329d2..e56f72fa7 100644 --- a/src/tss2-fapi/fapi_crypto.c +++ b/src/tss2-fapi/fapi_crypto.c @@ -118,7 +118,7 @@ static const TPM2B_PUBLIC templateRsaSign = { .size = 0, .publicArea = { .type = TPM2_ALG_RSA, - .nameAlg = TPM2_ALG_SHA1, + .nameAlg = TPM2_ALG_SHA256, .objectAttributes = ( TPMA_OBJECT_SIGN_ENCRYPT ), .authPolicy = { .size = 0, @@ -149,7 +149,7 @@ static const TPM2B_PUBLIC templateEccSign = { .size = 0, .publicArea = { .type = TPM2_ALG_ECC, - .nameAlg = TPM2_ALG_SHA1, + .nameAlg = TPM2_ALG_SHA256, .objectAttributes = ( TPMA_OBJECT_SIGN_ENCRYPT ), .authPolicy = { .size = 0, diff --git a/src/tss2-fapi/ifapi_policy_callbacks.c b/src/tss2-fapi/ifapi_policy_callbacks.c index 3b5437214..a1228ea47 100644 --- a/src/tss2-fapi/ifapi_policy_callbacks.c +++ b/src/tss2-fapi/ifapi_policy_callbacks.c @@ -1362,8 +1362,10 @@ ifapi_exec_auth_policy( cleanup: SAFE_FREE(names); /* Check whether cleanup was executed. */ - if (fapi_ctx->policy.policyutil_stack) + if (fapi_ctx->policy.policyutil_stack) { cleanup_policy_list(current_policy->policy_list); + current_policy->policy_list = NULL; + } return r; }