summaryrefslogtreecommitdiffstats
path: root/src/cryptenroll/cryptenroll-tpm2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptenroll/cryptenroll-tpm2.c')
-rw-r--r--src/cryptenroll/cryptenroll-tpm2.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/cryptenroll/cryptenroll-tpm2.c b/src/cryptenroll/cryptenroll-tpm2.c
index d7f81ede3f..38920fb94e 100644
--- a/src/cryptenroll/cryptenroll-tpm2.c
+++ b/src/cryptenroll/cryptenroll-tpm2.c
@@ -211,12 +211,7 @@ int enroll_tpm2(struct crypt_device *cd,
if (r < 0)
return r;
- bool pcr_value_specified = false;
- for (size_t i = 0; i < n_hash_pcr_values; i++)
- if (hash_pcr_values[i].value.size > 0) {
- pcr_value_specified = true;
- break;
- }
+ bool pcr_value_specified = tpm2_pcr_values_has_any_values(hash_pcr_values, n_hash_pcr_values);
r = tpm2_pcr_read_missing_values(tpm2_context, hash_pcr_values, n_hash_pcr_values);
if (r < 0)