Skip to content

Commit 2cc2089

Browse files
committed
F-3274 follow-up - tests/fwtpm_unit_tests: gate ECC sign helper for FWTPM_NO_NV builds too
1 parent 4817e79 commit 2cc2089

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/fwtpm_unit_tests.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,11 +1096,13 @@ static UINT32 CreatePrimaryHelper(FWTPM_CTX* ctx, TPM_ALG_ID alg)
10961096
return GetU32BE(gRsp + TPM2_HEADER_SIZE);
10971097
}
10981098

1099-
#if defined(HAVE_ECC) && !defined(FWTPM_NO_ATTESTATION)
1099+
#if defined(HAVE_ECC) && !defined(FWTPM_NO_ATTESTATION) && \
1100+
!defined(FWTPM_NO_NV)
11001101
/* Build a non-restricted ECC-P256 sign-capable primary (for tests that
11011102
* require TPMA_OBJECT_sign and a key with no scheme bound at create time).
1102-
* Only consumed by the attestation tests, so gated to avoid
1103-
* -Werror=unused-function in FWTPM_NO_ATTESTATION builds. */
1103+
* Only consumed by the attestation tests nested inside the NV-tests
1104+
* section, so gated to avoid -Werror=unused-function in
1105+
* FWTPM_NO_ATTESTATION or FWTPM_NO_NV builds. */
11041106
static int BuildCreatePrimaryEccSignCmd(byte* buf)
11051107
{
11061108
int pos = 0;
@@ -1157,7 +1159,7 @@ static UINT32 CreatePrimaryEccSignHelper(FWTPM_CTX* ctx)
11571159
if (GetRspRC(gRsp) != TPM_RC_SUCCESS) return 0;
11581160
return GetU32BE(gRsp + TPM2_HEADER_SIZE);
11591161
}
1160-
#endif /* HAVE_ECC && !FWTPM_NO_ATTESTATION */
1162+
#endif /* HAVE_ECC && !FWTPM_NO_ATTESTATION && !FWTPM_NO_NV */
11611163

11621164
/* Helper: flush a handle */
11631165
static void FlushHandle(FWTPM_CTX* ctx, UINT32 handle)

0 commit comments

Comments
 (0)