From 39a695589a28147ffa032b865af30c7abf56f202 Mon Sep 17 00:00:00 2001 From: DanS Date: Fri, 20 Nov 2026 19:16:06 -0600 Subject: [PATCH] fix(bootstrap): make signatureMatchesPinnedKey public so its unit test compiles The merged branch declared signatureMatchesPinnedKey private but its own test calls it directly (no friend/test hook), so the code as committed did not build. The method is a pure, no-network ed25519 verify helper and the branch intends it "unit-testable", so expose it publicly (sibling of verifyXmrigSignature's shared primitives). Co-Authored-By: Claude Opus 4.8 --- src/util/bootstrap.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/util/bootstrap.h b/src/util/bootstrap.h index 67547e2..f34faff 100644 --- a/src/util/bootstrap.h +++ b/src/util/bootstrap.h @@ -96,6 +96,11 @@ public: }; static constexpr bool kBootstrapRequireSignature = false; + /// True if sigFileContent (base64 ed25519 signature, as published in ".sha256.sig") verifies over + /// the exact sha256Content bytes against any key in kBootstrapSignaturePublicKeysBase64. No network and + /// pure — public so the unit tests exercise it directly. + static bool signatureMatchesPinnedKey(const std::string& sha256Content, const std::string& sigFileContent); + /// Start the bootstrap process on a background thread. /// @param dataDir Path to DRAGONX data dir (e.g. ~/.hush/DRAGONX/) /// @param url Bootstrap zip URL @@ -203,10 +208,6 @@ private: /// invalid signature, or on a missing signature when kBootstrapRequireSignature is true. bool verifyArchiveSignature(const std::string& sha256Content, const std::string& baseUrl); - /// True if sigFileContent (base64 ed25519 signature, as published in ".sha256.sig") verifies over - /// the exact sha256Content bytes against any key in kBootstrapSignaturePublicKeysBase64. No network. - static bool signatureMatchesPinnedKey(const std::string& sha256Content, const std::string& sigFileContent); - struct RemoteInfo { bool transportOk = false; long httpCode = 0; long long size = -1; }; /// HEAD the remote file. transportOk=false on any curl error; size=-1 when absent. RemoteInfo getRemoteFileSize(const std::string& url);