Add option to configure to download system files from Nintendo Update Service (#6269)
Co-authored-by: B3n30 <benediktthomas@gmail.com>
This commit is contained in:
@@ -88,7 +88,7 @@ struct KeySlot {
|
||||
};
|
||||
|
||||
std::array<KeySlot, KeySlotID::MaxKeySlotID> key_slots;
|
||||
std::array<std::optional<AESKey>, 6> common_key_y_slots;
|
||||
std::array<std::optional<AESKey>, MaxCommonKeySlot> common_key_y_slots;
|
||||
|
||||
enum class FirmwareType : u32 {
|
||||
ARM9 = 0, // uses NDMA
|
||||
@@ -494,9 +494,9 @@ void LoadPresetKeys() {
|
||||
|
||||
} // namespace
|
||||
|
||||
void InitKeys() {
|
||||
void InitKeys(bool force) {
|
||||
static bool initialized = false;
|
||||
if (initialized)
|
||||
if (initialized && !force)
|
||||
return;
|
||||
initialized = true;
|
||||
HW::RSA::InitSlots();
|
||||
|
@@ -48,11 +48,13 @@ enum KeySlotID : std::size_t {
|
||||
MaxKeySlotID = 0x40,
|
||||
};
|
||||
|
||||
constexpr std::size_t MaxCommonKeySlot = 6;
|
||||
|
||||
constexpr std::size_t AES_BLOCK_SIZE = 16;
|
||||
|
||||
using AESKey = std::array<u8, AES_BLOCK_SIZE>;
|
||||
|
||||
void InitKeys();
|
||||
void InitKeys(bool force = false);
|
||||
|
||||
void SetGeneratorConstant(const AESKey& key);
|
||||
void SetKeyX(std::size_t slot_id, const AESKey& key);
|
||||
|
Reference in New Issue
Block a user