mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 15:51:13 +02:00
refactor: rename OBFUSCATION_KEY_KEY
See: https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2216425882 Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
@@ -250,10 +250,10 @@ CDBWrapper::CDBWrapper(const DBParams& params)
|
||||
}
|
||||
|
||||
assert(!m_obfuscation); // Needed for unobfuscated Read()/Write() below
|
||||
if (!Read(OBFUSCATION_KEY_KEY, m_obfuscation) && params.obfuscate && IsEmpty()) {
|
||||
if (!Read(OBFUSCATION_KEY, m_obfuscation) && params.obfuscate && IsEmpty()) {
|
||||
// Generate, write and read back the new obfuscation key, making sure we don't obfuscate the key itself
|
||||
Write(OBFUSCATION_KEY_KEY, FastRandomContext{}.randbytes(Obfuscation::KEY_SIZE));
|
||||
Read(OBFUSCATION_KEY_KEY, m_obfuscation);
|
||||
Write(OBFUSCATION_KEY, FastRandomContext{}.randbytes(Obfuscation::KEY_SIZE));
|
||||
Read(OBFUSCATION_KEY, m_obfuscation);
|
||||
LogInfo("Wrote new obfuscation key for %s: %s", fs::PathToString(params.path), m_obfuscation.HexKey());
|
||||
}
|
||||
LogInfo("Using obfuscation key for %s: %s", fs::PathToString(params.path), m_obfuscation.HexKey());
|
||||
|
@@ -189,7 +189,7 @@ private:
|
||||
Obfuscation m_obfuscation;
|
||||
|
||||
//! obfuscation key storage key, null-prefixed to avoid collisions
|
||||
inline static const std::string OBFUSCATION_KEY_KEY{"\000obfuscate_key", 14}; // explicit size to avoid truncation at leading \0
|
||||
inline static const std::string OBFUSCATION_KEY{"\000obfuscate_key", 14}; // explicit size to avoid truncation at leading \0
|
||||
|
||||
//! path to filesystem storage
|
||||
const fs::path m_path;
|
||||
|
Reference in New Issue
Block a user