diff --git a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_crypto.c b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_crypto.c index e1cb6d3619..3abe2a6354 100755 --- a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_crypto.c +++ b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_crypto.c @@ -208,6 +208,7 @@ t_cose_crypto_hash_start(struct t_cose_crypto_hash *hash_ctx, } psa_hash_ctx = (struct t_cose_psa_crypto_hash *)hash_ctx; + memset(&psa_hash_ctx->operation, 0, sizeof(psa_hash_operation_t)); psa_ret = psa_hash_setup(&psa_hash_ctx->operation, cose_hash_alg_id_to_psa(cose_hash_alg_id)); diff --git a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_iat_claims_loader.c b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_iat_claims_loader.c index 80b40adde8..d7452668c7 100755 --- a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_iat_claims_loader.c +++ b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_iat_claims_loader.c @@ -70,7 +70,7 @@ static enum tfm_plat_err_t attest_public_key_sha256(uint32_t *size, uint8_t *buf psa_status_t crypto_ret; enum tfm_plat_err_t status = TFM_PLAT_ERR_SUCCESS; - psa_hash_operation_t hash_handle; + psa_hash_operation_t hash_handle = {0}; crypto_ret = psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle); if (crypto_ret != PSA_SUCCESS) { diff --git a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl/t_cose/src/t_cose_crypto.h b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl/t_cose/src/t_cose_crypto.h index b77af32b92..ab4faac185 100644 --- a/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl/t_cose/src/t_cose_crypto.h +++ b/components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl/t_cose/src/t_cose_crypto.h @@ -295,7 +295,7 @@ struct t_cose_crypto_hash { * actual hash implementation, so this is a fairly large and * accommodating size. */ - uint8_t bytes[128]; + uint8_t bytes[280]; };