Merge branch 'master' into ctrtool-silence-output

This commit is contained in:
jakcron
2022-04-12 11:48:13 +08:00
3 changed files with 16 additions and 6 deletions
@@ -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)
};
+12 -4
View File
@@ -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())
{
@@ -548,8 +550,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";
+1 -1
View File
@@ -3,5 +3,5 @@
#define BIN_NAME "ctrtool"
#define VER_MAJOR 1
#define VER_MINOR 0
#define VER_PATCH 3
#define VER_PATCH 4
#define AUTHORS "jakcron"