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 <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,11 @@ public:
|
||||
};
|
||||
static constexpr bool kBootstrapRequireSignature = false;
|
||||
|
||||
/// True if sigFileContent (base64 ed25519 signature, as published in "<zip>.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 "<zip>.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);
|
||||
|
||||
Reference in New Issue
Block a user