feat(provenance): distribute trusted Ed25519 keys via files, vbs.keys, and environment
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 5s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 1m19s

This commit is contained in:
faumaray committed 2026-12-03 19:42:10 +03:00
1 parent f5c0c9f09d
commit ff59f6ff5c
13 files changed
+314 -7

No files matched your search

@@ -0,0 +1,30 @@
#pragma once
#include <Void/Functional/Error.hpp>
#include <Void/Functional/Result.hpp>
#include <filesystem>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <vector>
namespace Void::Build::Provenance {
// Validates a 64-hex-character Ed25519 public key and returns it lowercase.
[[nodiscard]] Void::Result::Result<std::string, Void::Result::Error>
normalize_public_key(std::string_view hex);
// Loads and validates trusted Ed25519 public keys for signed-package enforcement from:
// - each explicit key file (one key per line, '#' comments, blank lines ignored),
// - `<project_root>/vbs.keys` when it exists (implicit project key ring),
// - an optional comma/whitespace separated environment value.
// Duplicates are removed preserving first-seen order. Explicit files must exist; malformed
// keys or unreadable files are explicit errors (never silently ignored).
[[nodiscard]] Void::Result::Result<std::vector<std::string>, Void::Result::Error>
load_trusted_keys(std::span<const std::filesystem::path> explicit_files,
const std::filesystem::path &project_root,
std::optional<std::string_view> environment_value);
} // namespace Void::Build::Provenance