Skip to content

Commit 133c0ca

Browse files
Andreas Fuchststruk
authored andcommitted
Enable lower maxlog levels
This patch fixed the setting of maxloglevel during configure wrt unused variables throughout the stack. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
1 parent 9288970 commit 133c0ca

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/tss2-fapi/fapi_crypto.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,8 +2019,7 @@ ifapi_verify_ek_cert(
20192019
"Failed to initialize X509 context.", cleanup);
20202020
}
20212021
if (1 != X509_verify_cert(ctx)) {
2022-
int rc = X509_STORE_CTX_get_error(ctx);
2023-
LOG_ERROR("%s", X509_verify_cert_error_string(rc));
2022+
LOG_ERROR("%s", X509_verify_cert_error_string(X509_STORE_CTX_get_error(ctx)));
20242023
goto_error(r, TSS2_FAPI_RC_GENERAL_FAILURE,
20252024
"Failed to verify intermediate certificate", cleanup);
20262025
}
@@ -2042,8 +2041,7 @@ ifapi_verify_ek_cert(
20422041
}
20432042
/* Verify the EK certificate. */
20442043
if (1 != X509_verify_cert(ctx)) {
2045-
int rc = X509_STORE_CTX_get_error(ctx);
2046-
LOG_ERROR("%s", X509_verify_cert_error_string(rc));
2044+
LOG_ERROR("%s", X509_verify_cert_error_string(X509_STORE_CTX_get_error(ctx)));
20472045
goto_error(r, TSS2_FAPI_RC_GENERAL_FAILURE,
20482046
"Failed to verify EK certificate", cleanup);
20492047
}

src/tss2-fapi/ifapi_policy_calculate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static void
3838
copy_policy_digest(TPML_DIGEST_VALUES *dest, TPML_DIGEST_VALUES *src,
3939
size_t digest_idx, size_t hash_size, char *txt)
4040
{
41+
(void)(txt); /* If max log-leve < debug, this param is unused */
4142
memcpy(&dest->digests[digest_idx].digest, &src->digests[digest_idx].digest,
4243
hash_size);
4344
dest->digests[digest_idx].hashAlg = src->digests[digest_idx].hashAlg;
@@ -57,6 +58,8 @@ static void
5758
log_policy_digest(TPML_DIGEST_VALUES *dest, size_t digest_idx, size_t hash_size,
5859
char *txt)
5960
{
61+
(void)(dest);(void)(digest_idx);(void)(hash_size);(void)(txt);
62+
/* If max log-leve < debug, this param is unused */
6063
LOGBLOB_DEBUG((uint8_t *)&dest->digests[digest_idx].digest, hash_size,
6164
"Digest %s", txt);
6265
}

src/tss2-tcti/tcti-swtpm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ TSS2_RC tcti_control_command (
112112
uint32_t *resp_code, void *resp_sdu, size_t *resp_sdu_len)
113113
{
114114
TSS2_TCTI_SWTPM_CONTEXT *tcti_swtpm = tcti_swtpm_context_cast(tctiContext);
115-
UINT32 rsp = 0;
116115
TSS2_RC rc = TSS2_RC_SUCCESS;
117116
int ret;
118117
uint32_t response_code;
@@ -220,7 +219,7 @@ TSS2_RC tcti_control_command (
220219
}
221220

222221
if (response_code != 0) {
223-
LOG_ERROR ("Control command failed with error: %" PRIu32, rsp);
222+
LOG_ERROR ("Control command failed with error: %" PRIu32, response_code);
224223
rc = TSS2_TCTI_RC_IO_ERROR;
225224
goto out;
226225
}

test/integration/esys-create-primary-hmac.int.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ test_esys_create_primary_hmac(ESYS_CONTEXT * esys_context)
176176
&outPublic, &creationData, &creationHash,
177177
&creationTicket);
178178
goto_if_error(r, "Error esys create primary", error);
179-
180179
r = esys_GetResourceObject(esys_context, objectHandle,
181180
&objectHandle_node);
182181
goto_if_error(r, "Error Esys GetResourceObject", error);
@@ -187,7 +186,7 @@ test_esys_create_primary_hmac(ESYS_CONTEXT * esys_context)
187186
goto_if_error(r, "Error during FlushContext", error);
188187

189188
LOG_INFO("Done with handle 0x%08x...", tpmHandle);
190-
189+
(void)(tpmHandle);
191190
r = Esys_FlushContext(esys_context, session);
192191
goto_if_error(r, "Flushing context", error);
193192

0 commit comments

Comments
 (0)