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 133c0ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 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
3 changes: 1 addition & 2 deletions test/integration/esys-create-primary-hmac.int.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ test_esys_create_primary_hmac(ESYS_CONTEXT * esys_context)
&outPublic, &creationData, &creationHash,
&creationTicket);
goto_if_error(r, "Error esys create primary", error);

r = esys_GetResourceObject(esys_context, objectHandle,
&objectHandle_node);
goto_if_error(r, "Error Esys GetResourceObject", error);
Expand All @@ -187,7 +186,7 @@ test_esys_create_primary_hmac(ESYS_CONTEXT * esys_context)
goto_if_error(r, "Error during FlushContext", error);

LOG_INFO("Done with handle 0x%08x...", tpmHandle);

(void)(tpmHandle);
r = Esys_FlushContext(esys_context, session);
goto_if_error(r, "Flushing context", error);

Expand Down

0 comments on commit 133c0ca

Please sign in to comment.