_cleanup_(erase_and_freep) void *secret = NULL;
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL, *signature_json = NULL;
_cleanup_(erase_and_freep) char *base64_encoded = NULL;
- _cleanup_(freep) void *srk_buf = NULL;
+ _cleanup_free_ void *srk_buf = NULL;
size_t secret_size, blob_size, hash_size, pubkey_size = 0, srk_buf_size = 0;
_cleanup_free_ void *blob = NULL, *hash = NULL, *pubkey = NULL;
uint16_t pcr_bank, primary_alg;
le32toh(z->size));
}
- /*
- * TODO: Add the SRK data to the credential structure so it can be plumbed
- * through and used to verify the TPM session.
- */
+ // TODO: Add the SRK data to the credential structure so it can be plumbed
+ // through and used to verify the TPM session.
r = tpm2_unseal(tpm2_device,
le64toh(t->pcr_mask),
le16toh(t->pcr_bank),
if (use_srk_model) {
r = make_lock_file("/run/systemd/tpm2-srk-init", LOCK_EX, &srk_lock);
if (r < 0)
- return log_error_errno(r, "Failed to take network zone lock: %m");
+ return log_error_errno(r, "Failed to take TPM SRK lock: %m");
}
/* Find existing SRK and use it if present */
if (alg != 0 && alg != got_alg)
log_warning("Caller asked for specific algorithm %u, but existing SRK is %u, ignoring",
- alg, got_alg);
+ alg, got_alg);
if (ret_alg)
*ret_alg = alg;