Add common keyYs

Ideally this should be derived from safe mode firm. However that is complex as we don't have a filesystem like thing, and reading the firm requires some work.
This commit is contained in:
Pengfei
2021-07-27 15:20:37 +08:00
parent 79dfe4fc8b
commit 705dd646dd
+14 -2
View File
@@ -80,7 +80,20 @@ struct KeySlot {
};
std::array<KeySlot, KeySlotID::MaxKeySlotID> key_slots;
std::array<std::optional<AESKey>, 6> common_key_y_slots;
// clang-format off
// Retail common keys from https://github.com/profi200/Project_CTR/blob/master/makerom/pki/prod.h#L19
constexpr std::array<AESKey, 6> common_key_y_slots{{
{0xD0, 0x7B, 0x33, 0x7F, 0x9C, 0xA4, 0x38, 0x59, 0x32, 0xA2, 0xE2, 0x57, 0x23, 0x23, 0x2E, 0xB9},
{0x0C, 0x76, 0x72, 0x30, 0xF0, 0x99, 0x8F, 0x1C, 0x46, 0x82, 0x82, 0x02, 0xFA, 0xAC, 0xBE, 0x4C},
{0xC4, 0x75, 0xCB, 0x3A, 0xB8, 0xC7, 0x88, 0xBB, 0x57, 0x5E, 0x12, 0xA1, 0x09, 0x07, 0xB8, 0xA4},
{0xE4, 0x86, 0xEE, 0xE3, 0xD0, 0xC0, 0x9C, 0x90, 0x2F, 0x66, 0x86, 0xD4, 0xC0, 0x6F, 0x64, 0x9F},
{0xED, 0x31, 0xBA, 0x9C, 0x04, 0xB0, 0x67, 0x50, 0x6C, 0x44, 0x97, 0xA3, 0x5B, 0x78, 0x04, 0xFC},
{0x5E, 0x66, 0x99, 0x8A, 0xB4, 0xE8, 0x93, 0x16, 0x06, 0x85, 0x0F, 0xD7, 0xA1, 0x6D, 0xD7, 0x55},
}};
// clang-format on
} // namespace
@@ -211,7 +224,6 @@ void LoadMovableSedKeys(const std::string& path) {
void ClearKeys() {
key_slots = {};
common_key_y_slots = {};
}
void SetKeyX(std::size_t slot_id, const AESKey& key) {