Skip to content

Commit

Permalink
Enable lower maxlog levels
Browse files Browse the repository at this point in the history
This patch fixed the setting of maxloglevel during configure
wrt unused variables throughout the stack.

Signed-off-by: Andreas Fuchs <[email protected]>
  • Loading branch information
Andreas Fuchs authored and tstruk committed Mar 24, 2021
1 parent 9288970 commit 4c2cdd7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/tss2-fapi/fapi_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,8 +2019,7 @@ ifapi_verify_ek_cert(
"Failed to initialize X509 context.", cleanup);
}
if (1 != X509_verify_cert(ctx)) {
int rc = X509_STORE_CTX_get_error(ctx);
LOG_ERROR("%s", X509_verify_cert_error_string(rc));
LOG_ERROR("%s", X509_verify_cert_error_string(X509_STORE_CTX_get_error(ctx)));
goto_error(r, TSS2_FAPI_RC_GENERAL_FAILURE,
"Failed to verify intermediate certificate", cleanup);
}
Expand All @@ -2042,8 +2041,7 @@ ifapi_verify_ek_cert(
}
/* Verify the EK certificate. */
if (1 != X509_verify_cert(ctx)) {
int rc = X509_STORE_CTX_get_error(ctx);
LOG_ERROR("%s", X509_verify_cert_error_string(rc));
LOG_ERROR("%s", X509_verify_cert_error_string(X509_STORE_CTX_get_error(ctx)));
goto_error(r, TSS2_FAPI_RC_GENERAL_FAILURE,
"Failed to verify EK certificate", cleanup);
}
Expand Down
3 changes: 3 additions & 0 deletions src/tss2-fapi/ifapi_policy_calculate.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static void
copy_policy_digest(TPML_DIGEST_VALUES *dest, TPML_DIGEST_VALUES *src,
size_t digest_idx, size_t hash_size, char *txt)
{
(void)(txt); /* If max log-leve < debug, this param is unused */
memcpy(&dest->digests[digest_idx].digest, &src->digests[digest_idx].digest,
hash_size);
dest->digests[digest_idx].hashAlg = src->digests[digest_idx].hashAlg;
Expand All @@ -57,6 +58,8 @@ static void
log_policy_digest(TPML_DIGEST_VALUES *dest, size_t digest_idx, size_t hash_size,
char *txt)
{
(void)(dest);(void)(digest_idx);(void)(hash_size);(void)(txt);
/* If max log-leve < debug, this param is unused */
LOGBLOB_DEBUG((uint8_t *)&dest->digests[digest_idx].digest, hash_size,
"Digest %s", txt);
}
Expand Down
3 changes: 1 addition & 2 deletions src/tss2-tcti/tcti-swtpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ TSS2_RC tcti_control_command (
uint32_t *resp_code, void *resp_sdu, size_t *resp_sdu_len)
{
TSS2_TCTI_SWTPM_CONTEXT *tcti_swtpm = tcti_swtpm_context_cast(tctiContext);
UINT32 rsp = 0;
TSS2_RC rc = TSS2_RC_SUCCESS;
int ret;
uint32_t response_code;
Expand Down Expand Up @@ -220,7 +219,7 @@ TSS2_RC tcti_control_command (
}

if (response_code != 0) {
LOG_ERROR ("Control command failed with error: %" PRIu32, rsp);
LOG_ERROR ("Control command failed with error: %" PRIu32, response_code);
rc = TSS2_TCTI_RC_IO_ERROR;
goto out;
}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/esys-create-primary-hmac.int.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ test_esys_create_primary_hmac(ESYS_CONTEXT * esys_context)
r = esys_GetResourceObject(esys_context, objectHandle,
&objectHandle_node);
goto_if_error(r, "Error Esys GetResourceObject", error);
ESYS_TR tpmHandle = objectHandle_node->rsrc.handle;
LOG_INFO("Created Primary with TPM handle 0x%08x...", tpmHandle);
LOG_INFO("Created Primary with TPM handle 0x%08x...",
objectHandle_node->rsrc.handle);

r = Esys_FlushContext(esys_context, objectHandle);
goto_if_error(r, "Error during FlushContext", error);

LOG_INFO("Done with handle 0x%08x...", tpmHandle);
LOG_INFO("Done with handle 0x%08x...", objectHandle_node->rsrc.handle);

r = Esys_FlushContext(esys_context, session);
goto_if_error(r, "Flushing context", error);
Expand Down

0 comments on commit 4c2cdd7

Please sign in to comment.