From 7cbbf023ffa493e03b1e431f5a360b37e8388bc2 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 6 Jul 2021 15:58:04 -0700 Subject: [PATCH] Add new key sources for key generation 12 --- build/CodeGen/IncludedKeys.txt | 3 +++ src/LibHac/Common/Keys/KeyDerivation.cs | 6 ++++-- src/LibHac/Utilities.cs | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build/CodeGen/IncludedKeys.txt b/build/CodeGen/IncludedKeys.txt index a028cd7d..db7d7cc6 100644 --- a/build/CodeGen/IncludedKeys.txt +++ b/build/CodeGen/IncludedKeys.txt @@ -11,6 +11,7 @@ master_kek_source_07 = 9A3EA9ABFD56461C9BF6487F5CFA095C master_kek_source_08 = DEDCE339308816F8AE97ADEC642D4141 master_kek_source_09 = 1AEC11822B32387A2BEDBA01477E3B67 master_kek_source_0a = 303F027ED838ECD7932534B530EBCA7A +master_kek_source_0b = 8467B67F1311AEE6589B19AF136C807A mariko_master_kek_source_05 = 77605AD2EE6EF83C3F72E2599DAC5E56 mariko_master_kek_source_06 = 1E80B8173EC060AA11BE1A4AA66FE4AE @@ -18,6 +19,7 @@ mariko_master_kek_source_07 = 940867BD0A00388411D31ADBDD8DF18A mariko_master_kek_source_08 = 5C24E3B8B4F700C23CFD0ACE13C3DC23 mariko_master_kek_source_09 = 8669F00987C805AEB57B4874DE62A613 mariko_master_kek_source_0a = 0E440CEDB436C03FAA1DAEBF62B10982 +mariko_master_kek_source_0b = E541ACECD1A7D1ABED0377F127CAF8F1 mariko_master_kek_source_dev_05 = 32C0976B636D4464F23AA5C0DE46CCE9 mariko_master_kek_source_dev_06 = CC974C462A0CB0A6C9C0B7BE302EC368 @@ -25,6 +27,7 @@ mariko_master_kek_source_dev_07 = 86BD1D7650DF6DFA2C7D3322ABF18218 mariko_master_kek_source_dev_08 = A3B1E0A958A2267F40BF5BBB87330B66 mariko_master_kek_source_dev_09 = 82729165403B9D6660D01B3D4DA570E1 mariko_master_kek_source_dev_0a = F937CF9ABD86BBA99C9E03C4FCBC3BCE +mariko_master_kek_source_dev_0b = 752D2EF32F3FFE65F4A983B4ED4263BA master_key_source = D8A2410AC6C59001C61D6A267C513F3C diff --git a/src/LibHac/Common/Keys/KeyDerivation.cs b/src/LibHac/Common/Keys/KeyDerivation.cs index 22c3b77d..07c8d02d 100644 --- a/src/LibHac/Common/Keys/KeyDerivation.cs +++ b/src/LibHac/Common/Keys/KeyDerivation.cs @@ -216,7 +216,8 @@ namespace LibHac.Common.Keys 0x37, 0xAF, 0xAB, 0x35, 0x79, 0x09, 0xD9, 0x48, 0x29, 0xD2, 0xDB, 0xA5, 0xA5, 0xF5, 0x30, 0x19, // Master key 06 encrypted with Master key 07. 0xEC, 0xE1, 0x46, 0x89, 0x37, 0xFD, 0xD2, 0x15, 0x8C, 0x3F, 0x24, 0x82, 0xEF, 0x49, 0x68, 0x04, // Master key 07 encrypted with Master key 08. 0x43, 0x3D, 0xC5, 0x3B, 0xEF, 0x91, 0x02, 0x21, 0x61, 0x54, 0x63, 0x8A, 0x35, 0xE7, 0xCA, 0xEE, // Master key 08 encrypted with Master key 09. - 0x6C, 0x2E, 0xCD, 0xB3, 0x34, 0x61, 0x77, 0xF5, 0xF9, 0xB1, 0xDD, 0x61, 0x98, 0x19, 0x3E, 0xD4 // Master key 09 encrypted with Master key 0A. + 0x6C, 0x2E, 0xCD, 0xB3, 0x34, 0x61, 0x77, 0xF5, 0xF9, 0xB1, 0xDD, 0x61, 0x98, 0x19, 0x3E, 0xD4, // Master key 09 encrypted with Master key 0A. + 0x21, 0x88, 0x6B, 0x10, 0x9E, 0x83, 0xD6, 0x52, 0xAB, 0x08, 0xDB, 0x6D, 0x39, 0xFF, 0x1C, 0x9C // Master key 0A encrypted with Master key 0B. }; private static ReadOnlySpan MasterKeyVectorsProd => new byte[] @@ -231,7 +232,8 @@ namespace LibHac.Common.Keys 0xA4, 0xD4, 0x52, 0x6F, 0xD1, 0xE4, 0x36, 0xAA, 0x9F, 0xCB, 0x61, 0x27, 0x1C, 0x67, 0x65, 0x1F, // Master key 06 encrypted with Master key 07. 0xEA, 0x60, 0xB3, 0xEA, 0xCE, 0x8F, 0x24, 0x46, 0x7D, 0x33, 0x9C, 0xD1, 0xBC, 0x24, 0x98, 0x29, // Master key 07 encrypted with Master key 08. 0x4D, 0xD9, 0x98, 0x42, 0x45, 0x0D, 0xB1, 0x3C, 0x52, 0x0C, 0x9A, 0x44, 0xBB, 0xAD, 0xAF, 0x80, // Master key 08 encrypted with Master key 09. - 0xB8, 0x96, 0x9E, 0x4A, 0x00, 0x0D, 0xD6, 0x28, 0xB3, 0xD1, 0xDB, 0x68, 0x5F, 0xFB, 0xE1, 0x2A // Master key 09 encrypted with Master key 0A. + 0xB8, 0x96, 0x9E, 0x4A, 0x00, 0x0D, 0xD6, 0x28, 0xB3, 0xD1, 0xDB, 0x68, 0x5F, 0xFB, 0xE1, 0x2A, // Master key 09 encrypted with Master key 0A. + 0xC1, 0x8D, 0x16, 0xBB, 0x2A, 0xE4, 0x1D, 0xD4, 0xC2, 0xC1, 0xB6, 0x40, 0x94, 0x35, 0x63, 0x98 // Master key 0A encrypted with Master key 0B. }; private static void DerivePerConsoleKeys(KeySet s) diff --git a/src/LibHac/Utilities.cs b/src/LibHac/Utilities.cs index 598a2986..a358671c 100644 --- a/src/LibHac/Utilities.cs +++ b/src/LibHac/Utilities.cs @@ -288,7 +288,8 @@ namespace LibHac 7 => "7.0.0-8.0.1", 8 => "8.1.0-8.1.1", 9 => "9.0.0-9.0.1", - 0xA => "9.1.0-", + 0xA => "9.1.0-12.0.3", + 0xB => "12.1.0-", _ => "Unknown" };