feat(provenance): probe built-in Ed25519 capability (VoidLibrary #52 follow-up)
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 9s

This commit is contained in:
faumaray committed 2026-12-03 18:16:36 +03:00
1 parent 55272d3e6b
commit a02d2b0d5d
6 files changed
+52 -16

No files matched your search

+5 -1
View File
@@ -84,9 +84,13 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B
- Added the `build` daemon request in `src/Daemon/Daemon.cpp`: graph evaluation is shared with `describe` (`evaluate_project_graph`), then executed in-process through `Execution::execute_graph` against the daemon's warm `StateStore`. The response is bounded JSON (`ok`, `profile`, `targets`, `actions`, `executed`, `cached`, `failed`, `diagnostic`, `failed_actions`). Requests accept `profile`, `compiler`, `targets` (≤ 64 bounded strings) and `jobs` (0–256).
- Wired `vbs daemon build [--profile] [--target]... [--jobs]` in `src/Main.cpp` with a long-running client timeout, plus `Daemon.build_executes_project_graph_and_reuses_cache` (cold build creates the binary, second request is fully cached, invalid `targets` type rejected) and a CLI help contract. Dependency materialization stays with `vbs build`/`vbs deps`; the daemon builds the already-describable graph.
- **Wave 17 (VoidLibrary #52 Follow-up: Built-in Ed25519 Capability Probe)**:
- Issue [#52](https://git.faumaray.com/Void/Library/issues/52) (built-in Ed25519 backend) was resolved upstream. `Provenance::signing_available()` in `src/Provenance/Signing.cpp` now probes an actual Ed25519 sign operation instead of assuming the OpenSSL backend, so a built-in backend is used automatically and the error message no longer claims OpenSSL specifically.
- Verified against upstream `main` exported to `/tmp/opencode/vl-main` **without OpenSSL**: `Signing` 4/4 (the crypto round-trip actually runs, 151.8 ms) and `SignatureEnforcement` 3/3. The pinned VoidLibrary remains `3e254055`; bumping the pin to a release containing #52 is a separate dependency decision.
## Remaining future scope
- **Post-v1 Expansion Roadmap ([21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md) & [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md))**: Live `conan` CLI verification (Track B3), Track C (macOS/Windows ports + dual-profile cross-compilation), Track D3 signing (SBOM, Ed25519 primitives, and trusted-key enforcement done; binary-variant signing and key distribution remain), Track E3 (daemon core, bounded `describe` and build-serving done; external editor plugins and dependency materialization inside the daemon remain), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.
- **Post-v1 Expansion Roadmap ([21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md) & [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md))**: Live `conan` CLI verification (Track B3), Track C (macOS/Windows ports + dual-profile cross-compilation), Track D3 signing (SBOM, Ed25519 primitives, trusted-key enforcement, and the #52 built-in-backend capability probe done; binary-variant signing, key distribution, and the VoidLibrary pin bump remain), Track E3 (daemon core, bounded `describe` and build-serving done; external editor plugins and dependency materialization inside the daemon remain), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.
## Environment notes & upstream boundaries
+1
View File
@@ -23,4 +23,5 @@ Base HEAD: `fe0d1a6`
| Wave 14 (Track E3 daemon core + bounded `describe` + Track C1 platform split) | Unix-socket `vbs daemon` holding warm `StateStore`/`InotifyWatcher` with `ping/status/gc/recover/describe/shutdown`, CLI + tests; bounded `describe` graph summary (`target_names` ≤ 128 × 200 bytes, `profile` ≤ 128 bytes, 10 s eval timeout); `src/Platform/Linux/` backend split with `HostOs` boundary; CMake 4.5 `@cmake_cxx_std@` feature-carrier translation fix | COMPLETE & VERIFIED (GCC 16.2, pinned VoidLibrary `3e25405`, 8/8 CTest suites; `Daemon` suite 6/6 under `dev cpp-gcc`; live `vbs daemon describe` CLI round-trip verified in `vbs_cli_contract`) | `include/Void/Build/Daemon/Daemon.hpp`, `src/Daemon/Daemon.cpp`, `tests/DaemonTests.cpp`, `include/Void/Build/Platform/Host.hpp`, `src/Platform/Linux/`, `src/Main.cpp`, `src/Provider/Translator.cpp`, `tests/CliContracts.cmake`, docs |
| Wave 15 (Track D3 signed-package enforcement) | Optional `signature`/`public_key` in `ReleaseRecord`/`SolvedPackage`/`LockedSourceEntry` + `vbs.lock`; `vbs publish --signing-key`; registry signature metadata storage/serving with hex validation; `vbs build\|test --trusted-public-key` fail-closed enforcement before extraction; `Provenance::verify_trusted_package_signature` trust policy | COMPLETE & VERIFIED (GCC 16.2, pinned VoidLibrary `3e25405`, 8/8 CTest; OpenSSL-enabled Signing 4/4, SignatureEnforcement 3/3, signed registry E2E) | `include/Void/Build/Provenance/Verification.hpp`, `src/Provenance/Verification.cpp`, `include/Void/Build/Package/{Solver,Lockfile,RegistryClient}.hpp`, `src/Package/{Solver,Lockfile,RegistryClient}.cpp`, `registry/`, `src/Main.cpp`, `tests/{SignatureEnforcementTests.cpp,RegistryTests.cpp}`, docs |
| Wave 16 (Track E3 daemon build serving) | In-process daemon `build` request reusing graph lowering + `Execution::execute_graph` against the warm `StateStore`; bounded `profile`/`targets`/`jobs`; `vbs daemon build` CLI; cache-reuse test | COMPLETE & VERIFIED (GCC 16.2; Daemon suite 7/7) | `src/Daemon/Daemon.cpp`, `include/Void/Build/Daemon/Daemon.hpp`, `src/Main.cpp`, `tests/DaemonTests.cpp`, `tests/CliContracts.cmake`, docs |
| Wave 17 (VoidLibrary #52 follow-up) | `signing_available()` probes the real Ed25519 capability instead of `has_openssl_backend()`; verified against upstream `main` without OpenSSL (Signing 4/4 crypto path, SignatureEnforcement 3/3); pin bump remains a dependency decision | COMPLETE & VERIFIED (GCC 16.2; pinned-library CTest 8/8) | `src/Provenance/Signing.cpp`, `include/Void/Build/Provenance/Signing.hpp`, `tests/SigningTests.cpp`, docs |
| Future (Plan 20 Slice 3 / Tracks C, D3 binary signing, E3 daemon dependency materialization/editor plugins, E4, live `conan`) | Live `conan` CLI verification; macOS/Windows/cross-compile; binary-variant signing and key distribution; daemon-side dependency materialization and editor plugins; `Void::Net`/`Void::Sqlite` alignment | PLANNED (unimplemented) | [21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md), [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md) |
+16
View File
@@ -312,6 +312,22 @@ dev cpp-gcc -c ctest --test-dir build/bootstrap --output-on-failure
- `clang-format --dry-run --Werror` passes after formatting `src/Daemon/Daemon.cpp`,
`src/Main.cpp`, and `tests/DaemonTests.cpp`.
## VoidLibrary #52 Follow-up: Built-in Ed25519 Capability Probe (2026-12-03)
Issue #52 was closed upstream with a portable built-in Ed25519 backend. VBS's
`Provenance::signing_available()` now probes a real Ed25519 sign operation instead of assuming
`has_openssl_backend()`.
- Against the pinned library (`3e25405`, no OpenSSL): `Signing` 4/4 (capability-gated path) and
full CTest **8 / 8 passed** in 189.12 s.
- Against upstream `main` exported read-only to `/tmp/opencode/vl-main` (commit `0002e74`) with
OpenSSL **not found** (`OPENSSL_CRYPTO_LIBRARY-NOTFOUND`): `vbs_v1_tests --suite Signing` is
**4 / 4 passed** including the real crypto round-trip (151.8 ms), and
`--suite SignatureEnforcement` is **3 / 3 passed** (crypto case 65.9 ms). The built-in backend is
therefore used automatically when OpenSSL is absent.
- The VoidLibrary pin was **not** changed: bumping it to a release containing #52 is a separate
dependency decision.
## Limits and Unrun Checks
1. **HTTPS git fetch**: the host shell is proxy-restricted, but the Docker container could clone `https://git.faumaray.com/Void/VoidLibrary.git`; the pinned commit `3e254055e081a104f08df68dde39711bc7813518` was fetched directly for the verification above. A separate configure against the local `/home/faumaray/Projects/Library` checkout via `VBS_VOID_SOURCE_DIR` also succeeded (development-only override, checkout unmodified).
+2 -1
View File
@@ -10,7 +10,8 @@
namespace Void::Build::Provenance {
// Ed25519 package-signing primitives. Every operation fails closed with an
// explicit error when Void::Crypto was built without its OpenSSL backend.
// explicit error when the linked Void::Crypto has no usable Ed25519 backend
// (OpenSSL or the built-in implementation).
[[nodiscard]] bool signing_available() noexcept;
// Writes a fresh random 32-byte Ed25519 seed as 64 lowercase hex characters
+24 -10
View File
@@ -33,16 +33,16 @@ constexpr std::size_t SeedHexLength = 64;
constexpr std::size_t PublicKeyHexLength = 64;
constexpr std::size_t SignatureHexLength = 128;
constexpr std::size_t MaxSeedFileBytes = 4096;
constexpr std::string_view OpenSslRequirement =
"Ed25519 package signing requires the OpenSSL backend of Void::Crypto";
constexpr std::string_view Ed25519Requirement =
"Ed25519 package signing is unavailable in the linked Void::Crypto backend";
Error make_error(ErrorKind kind, std::string message) { return Error{kind, std::move(message)}; }
Result<void, Error> require_openssl_backend() {
if (Void::Crypto::has_openssl_backend()) {
Result<void, Error> require_signing_backend() {
if (signing_available()) {
return {};
}
return std::unexpected{make_error(ErrorKind::unsupported, std::string{OpenSslRequirement})};
return std::unexpected{make_error(ErrorKind::unsupported, std::string{Ed25519Requirement})};
}
bool is_hex_digit(char c) noexcept {
@@ -256,10 +256,24 @@ Result<void, Error> write_private_file(const std::filesystem::path &path,
} // namespace
bool signing_available() noexcept { return Void::Crypto::has_openssl_backend(); }
bool signing_available() noexcept {
// Probe the actual Ed25519 capability instead of assuming OpenSSL: Void::Crypto may provide
// a built-in Ed25519 backend when OpenSSL is absent.
static const bool available = []() noexcept {
std::array<std::byte, Void::Crypto::Ed25519SeedSize> seed{};
seed.fill(std::byte{0x42});
auto key = Void::Crypto::Ed25519PrivateKey::from_raw_seed(seed);
if (!key) {
return false;
}
constexpr std::array<std::byte, 1> message{std::byte{0x01}};
return Void::Crypto::sign_ed25519(message, *key).has_value();
}();
return available;
}
Result<void, Error> generate_signing_seed(const std::filesystem::path &seed_path) {
if (auto backend = require_openssl_backend(); !backend) {
if (auto backend = require_signing_backend(); !backend) {
return backend;
}
@@ -279,7 +293,7 @@ Result<void, Error> generate_signing_seed(const std::filesystem::path &seed_path
}
Result<std::string, Error> public_key_from_seed(const std::filesystem::path &seed_path) {
if (auto backend = require_openssl_backend(); !backend) {
if (auto backend = require_signing_backend(); !backend) {
return std::unexpected{backend.error()};
}
@@ -315,7 +329,7 @@ std::string canonical_package_message(std::string_view name, std::string_view ve
Result<std::string, Error> sign_package(std::string_view name, std::string_view version,
std::string_view sha256_hex,
const std::filesystem::path &seed_path) {
if (auto backend = require_openssl_backend(); !backend) {
if (auto backend = require_signing_backend(); !backend) {
return std::unexpected{backend.error()};
}
@@ -340,7 +354,7 @@ Result<std::string, Error> sign_package(std::string_view name, std::string_view
Result<bool, Error> verify_package(std::string_view name, std::string_view version,
std::string_view sha256_hex, std::string_view signature_hex,
std::string_view public_key_hex) {
if (auto backend = require_openssl_backend(); !backend) {
if (auto backend = require_signing_backend(); !backend) {
return std::unexpected{backend.error()};
}
+4 -4
View File
@@ -176,7 +176,7 @@ VOID_TEST(Signing, malformed_hex_and_seed_files_are_rejected) {
!Provenance::public_key_from_seed(temp.path() / "missing.seed").has_value());
}
VOID_TEST(Signing, backend_gating_reports_openssl_requirement) {
VOID_TEST(Signing, backend_gating_reports_ed25519_requirement) {
namespace Provenance = Void::Build::Provenance;
if (Provenance::signing_available()) {
return;
@@ -188,20 +188,20 @@ VOID_TEST(Signing, backend_gating_reports_openssl_requirement) {
auto generated = Provenance::generate_signing_seed(seed_path);
Void::Testing::expect(!generated.has_value());
if (!generated) {
Void::Testing::expect(generated.error().message().find("OpenSSL") != std::string::npos);
Void::Testing::expect(generated.error().message().find("Ed25519") != std::string::npos);
}
auto signed_result = Provenance::sign_package("void-core", "1.2.3", kDigest, seed_path);
Void::Testing::expect(!signed_result.has_value());
if (!signed_result) {
Void::Testing::expect(signed_result.error().message().find("OpenSSL") != std::string::npos);
Void::Testing::expect(signed_result.error().message().find("Ed25519") != std::string::npos);
}
auto verified_result = Provenance::verify_package("void-core", "1.2.3", kDigest,
std::string(128, '0'), std::string(64, '0'));
Void::Testing::expect(!verified_result.has_value());
if (!verified_result) {
Void::Testing::expect(verified_result.error().message().find("OpenSSL") !=
Void::Testing::expect(verified_result.error().message().find("Ed25519") !=
std::string::npos);
}
}