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);