all the keys

This commit is contained in:
AzaharPlus 2025-04-07 23:48:00 +02:00
parent 3407850895
commit f5eac522db

View File

@ -217,7 +217,6 @@ void LoadBootromKeys() {
} }
} }
#ifndef todotodo
void LoadPresetKeys() { void LoadPresetKeys() {
auto s = GetKeysStream(); auto s = GetKeysStream();
@ -226,6 +225,8 @@ void LoadPresetKeys() {
while (!s.eof()) { while (!s.eof()) {
std::string line; std::string line;
std::getline(s, line); std::getline(s, line);
// LOG_ERROR(HW_AES, "Dump key '{}'", line);
// Ignore empty or commented lines. // Ignore empty or commented lines.
if (line.empty() || line.starts_with("#")) { if (line.empty() || line.starts_with("#")) {
@ -351,19 +352,8 @@ void LoadPresetKeys() {
} }
} }
} }
#else
void LoadPresetKeys() {
/* key dumping code
auto s = GetKeysStream();
std::string mode = ""; void LoadPresetAesKeys() {
while (!s.eof()) {
std::string line;
std::getline(s, line);
LOG_ERROR(HW_AES, "Secret key '{}'", line);
}
*/
const std::string filepath = FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir) + AES_KEYS; const std::string filepath = FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir) + AES_KEYS;
FileUtil::CreateFullPath(filepath); // Create path if not already created FileUtil::CreateFullPath(filepath); // Create path if not already created
@ -467,7 +457,6 @@ void LoadPresetKeys() {
} }
} }
} }
#endif
} // namespace } // namespace
@ -615,7 +604,9 @@ void InitKeys(bool force) {
initialized = true; initialized = true;
HW::RSA::InitSlots(); HW::RSA::InitSlots();
LoadBootromKeys(); LoadBootromKeys();
generator_constant = HexToKey("1ff9e9aac5fe0408024591dc5d52768a");
LoadPresetKeys(); LoadPresetKeys();
LoadPresetAesKeys();
movable_key.SetKeyX(key_slots[0x35].x); movable_key.SetKeyX(key_slots[0x35].x);
movable_cmac.SetKeyX(key_slots[0x35].x); movable_cmac.SetKeyX(key_slots[0x35].x);