pcrextend: refuse empty measurement over Varlink

vl_method_extend() accepted an empty text/data value and measured an
empty word, bypassing the empty-word refusal the CLI path already
enforces. Measured words are joined with ":" in the record, so an empty
word is ambiguous. Reject it.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
This commit is contained in:
Paul Meyer
2026-06-23 07:38:32 +02:00
parent 662e02a5f8
commit e514dadd1c
+3
View File
@@ -463,6 +463,9 @@ static int vl_method_extend(sd_varlink *link, sd_json_variant *parameters, sd_va
else
return sd_varlink_error_invalid_parameter_name(link, "text");
if (!iovec_is_set(extend_iovec))
return sd_varlink_error_invalid_parameter_name(link, p.text ? "text" : "data");
if (p.nvpcr) {
r = extend_nvpcr_now(p.nvpcr, extend_iovec->iov_base, extend_iovec->iov_len, p.event_type);
if (IN_SET(r, -ENOENT, -ENODEV))