feat(cli): require trusted signatures when fetching binary variants
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 6s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 11s

This commit is contained in:
faumaray committed 2026-12-04 03:38:10 +03:00
1 parent f60c2708e8
commit 2c6b60453a
6 files changed
+70 -3

No files matched your search

+21
View File
@@ -1004,6 +1004,27 @@ target_include_directories(hello_pkg PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include
Void::Testing::require(fetched_bytes.has_value());
Void::Testing::expect(*fetched_bytes == "CLI_BINARY_VARIANT_BYTES");
// An unsigned variant cannot satisfy a trusted-key requirement.
Platform::ProcessRequest trusted_fetch;
trusted_fetch.executable = vbs_bin;
trusted_fetch.arguments = {"binaries",
"fetch",
"--registry",
reg_url,
"--name",
"hello-pkg",
"--version",
"1.1.0",
"--variant",
"cli-variant",
"--output",
(tmp / "trusted_binary.bin").string(),
"--trusted-public-key",
std::string(64, 'a')};
trusted_fetch.environment.set_vars["VBS_REGISTRY_TOKEN"] = *tok;
auto trusted_binary_res = Platform::run_supervised(trusted_fetch);
Void::Testing::expect(trusted_binary_res.has_value() && !trusted_binary_res->succeeded());
Platform::ProcessRequest releases_list;
releases_list.executable = vbs_bin;
releases_list.arguments = {"releases", "list", "--registry", reg_url, "--name", "hello-pkg"};