mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
[AES] Panic when no generator key is provided
This commit is contained in:
parent
e40b2c4b1a
commit
4c004ab028
2 changed files with 8 additions and 0 deletions
|
@ -105,6 +105,7 @@ namespace Crypto {
|
||||||
AESEngine() {}
|
AESEngine() {}
|
||||||
void loadKeys(const std::filesystem::path& path);
|
void loadKeys(const std::filesystem::path& path);
|
||||||
bool haveKeys() { return keysLoaded; }
|
bool haveKeys() { return keysLoaded; }
|
||||||
|
bool haveGenerator() { return m_generator.has_value(); }
|
||||||
|
|
||||||
constexpr bool hasKeyX(std::size_t slotId) {
|
constexpr bool hasKeyX(std::size_t slotId) {
|
||||||
if (slotId >= AesKeySlotCount) {
|
if (slotId >= AesKeySlotCount) {
|
||||||
|
|
|
@ -131,6 +131,13 @@ bool NCCH::loadFromHeader(Crypto::AESEngine &aesEngine, IOFile& file, const FSIn
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!aesEngine.haveGenerator()) {
|
||||||
|
Helpers::panic(
|
||||||
|
"Loading an encrypted ROM but your AES keys don't seem to provide the \"generator\" constant which Panda3DS requires for decryption\n"
|
||||||
|
"Please add it to your aes_keys.txt in a line like \"generator=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\" where the Xs are replaced with the actual generator constant value"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!gotCryptoKeys) {
|
if (!gotCryptoKeys) {
|
||||||
Helpers::panic("ROM is encrypted but it seems we couldn't get either the primary or the secondary key");
|
Helpers::panic("ROM is encrypted but it seems we couldn't get either the primary or the secondary key");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue