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:
1 parent
298bf95105
commit
e5b1b7c557
2 files changed
+4
-4
No files matched your search
+3
-3
@@ -250,10 +250,10 @@ CDBWrapper::CDBWrapper(const DBParams& params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(!m_obfuscation); // Needed for unobfuscated Read()/Write() below
|
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
|
// 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));
|
Write(OBFUSCATION_KEY, FastRandomContext{}.randbytes(Obfuscation::KEY_SIZE));
|
||||||
Read(OBFUSCATION_KEY_KEY, m_obfuscation);
|
Read(OBFUSCATION_KEY, m_obfuscation);
|
||||||
LogInfo("Wrote new obfuscation key for %s: %s", fs::PathToString(params.path), m_obfuscation.HexKey());
|
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());
|
LogInfo("Using obfuscation key for %s: %s", fs::PathToString(params.path), m_obfuscation.HexKey());
|
||||||
|
|||||||
+1
-1
@@ -189,7 +189,7 @@ private:
|
|||||||
Obfuscation m_obfuscation;
|
Obfuscation m_obfuscation;
|
||||||
|
|
||||||
//! obfuscation key storage key, null-prefixed to avoid collisions
|
//! 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
|
//! path to filesystem storage
|
||||||
const fs::path m_path;
|
const fs::path m_path;
|
||||||
|
|||||||
Reference in new issue
Block a user