mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-02 16:59:03 +00:00
Add support for processing InitialData CryptoTypes 1-2
This commit is contained in:
@@ -167,7 +167,9 @@ struct CciHeader
|
||||
|
||||
enum CryptoType
|
||||
{
|
||||
CryptoType_Secure = 0, // Secure initial data key (keyX bootrom, keyY initial data seed) (used in production ROMs)
|
||||
CryptoType_Secure0 = 0, // Secure initial data key (keyX bootrom, keyY initial data seed) (used in production ROMs)
|
||||
CryptoType_Secure1 = 1, // Secure initial data key (keyX bootrom, keyY initial data seed) (used in production ROMs)
|
||||
CryptoType_Secure2 = 2, // Secure initial data key (keyX bootrom, keyY initial data seed) (used in production ROMs)
|
||||
CryptoType_FixedKey = 3, // Zeros initial data key (used in non-HSM enviroments like development)
|
||||
};
|
||||
|
||||
|
||||
@@ -171,8 +171,10 @@ void ctrtool::CciProcess::importHeader()
|
||||
ctrtool::KeyBag::Aes128Key initial_data_key;
|
||||
bool initial_data_key_available = false;
|
||||
|
||||
// crypto_type 0 is the normal "secure" initial data key
|
||||
if (mHeader.card_info.flag.crypto_type == ntd::n3ds::CciHeader::CryptoType_Secure)
|
||||
// crypto_type 0-2 is the normal "secure" initial data key
|
||||
if (mHeader.card_info.flag.crypto_type == ntd::n3ds::CciHeader::CryptoType_Secure0 ||
|
||||
mHeader.card_info.flag.crypto_type == ntd::n3ds::CciHeader::CryptoType_Secure1 ||
|
||||
mHeader.card_info.flag.crypto_type == ntd::n3ds::CciHeader::CryptoType_Secure2)
|
||||
{
|
||||
if (mKeyBag.brom_static_key_x.find(mKeyBag.KEYSLOT_INITIAL_DATA) != mKeyBag.brom_static_key_x.end())
|
||||
{
|
||||
@@ -530,8 +532,14 @@ std::string ctrtool::CciProcess::getCryptoTypeString(byte_t crypto_type)
|
||||
|
||||
switch(crypto_type)
|
||||
{
|
||||
case ntd::n3ds::CciHeader::CryptoType_Secure :
|
||||
ret_str = "Secure";
|
||||
case ntd::n3ds::CciHeader::CryptoType_Secure0 :
|
||||
ret_str = "Secure0";
|
||||
break;
|
||||
case ntd::n3ds::CciHeader::CryptoType_Secure1 :
|
||||
ret_str = "Secure1";
|
||||
break;
|
||||
case ntd::n3ds::CciHeader::CryptoType_Secure2 :
|
||||
ret_str = "Secure2";
|
||||
break;
|
||||
case ntd::n3ds::CciHeader::CryptoType_FixedKey :
|
||||
ret_str = "FixedKey";
|
||||
|
||||
Reference in New Issue
Block a user