From 3079578ece71268d3cbbabc1b26f1c97ff86ad8b Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 11 Oct 2023 11:03:17 -0700 Subject: [PATCH] exo/spl: Add new EsCommonKeyType --- exosphere/program/source/smc/secmon_smc_aes.cpp | 1 + exosphere/program/source/smc/secmon_smc_aes.hpp | 1 + exosphere/program/source/smc/secmon_smc_rsa.cpp | 4 ++-- .../libstratosphere/include/stratosphere/spl/spl_types.hpp | 1 + .../source/spl/smc/spl_secure_monitor_api.os.generic.cpp | 2 ++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/exosphere/program/source/smc/secmon_smc_aes.cpp b/exosphere/program/source/smc/secmon_smc_aes.cpp index 1d5f51ded..84999fd72 100644 --- a/exosphere/program/source/smc/secmon_smc_aes.cpp +++ b/exosphere/program/source/smc/secmon_smc_aes.cpp @@ -161,6 +161,7 @@ namespace ams::secmon::smc { constexpr const u8 EsCommonKeySources[EsCommonKeyType_Count][AesKeySize] = { [EsCommonKeyType_TitleKey] = { 0x1E, 0xDC, 0x7B, 0x3B, 0x60, 0xE6, 0xB4, 0xD8, 0x78, 0xB8, 0x17, 0x15, 0x98, 0x5E, 0x62, 0x9B }, [EsCommonKeyType_ArchiveKey] = { 0x3B, 0x78, 0xF2, 0x61, 0x0F, 0x9D, 0x5A, 0xE2, 0x7B, 0x4E, 0x45, 0xAF, 0xCB, 0x0B, 0x67, 0x4D }, + [EsCommonKeyType_Unknown2] = { 0x42, 0x64, 0x0B, 0xE3, 0x5F, 0xC6, 0xBE, 0x47, 0xC7, 0xB4, 0x84, 0xC5, 0xEB, 0x63, 0xAA, 0x02 }, }; constexpr const u8 EsSealKeySource[AesKeySize] = { diff --git a/exosphere/program/source/smc/secmon_smc_aes.hpp b/exosphere/program/source/smc/secmon_smc_aes.hpp index 3a570b09a..ce0d8390f 100644 --- a/exosphere/program/source/smc/secmon_smc_aes.hpp +++ b/exosphere/program/source/smc/secmon_smc_aes.hpp @@ -22,6 +22,7 @@ namespace ams::secmon::smc { enum EsCommonKeyType { EsCommonKeyType_TitleKey = 0, EsCommonKeyType_ArchiveKey = 1, + EsCommonKeyType_Unknown2 = 2, EsCommonKeyType_Count, }; diff --git a/exosphere/program/source/smc/secmon_smc_rsa.cpp b/exosphere/program/source/smc/secmon_smc_rsa.cpp index 34982bb8a..b321d27a1 100644 --- a/exosphere/program/source/smc/secmon_smc_rsa.cpp +++ b/exosphere/program/source/smc/secmon_smc_rsa.cpp @@ -32,8 +32,8 @@ namespace ams::secmon::smc { struct PrepareEsDeviceUniqueKeyOption { using KeyGeneration = util::BitPack32::Field<0, 6, int>; - using Type = util::BitPack32::Field<6, 1, EsCommonKeyType>; - using Reserved = util::BitPack32::Field<7, 25, u32>; + using Type = util::BitPack32::Field<6, 2, EsCommonKeyType>; + using Reserved = util::BitPack32::Field<8, 25, u32>; }; constexpr const u8 ModularExponentiateByStorageKeyTable[] = { diff --git a/libraries/libstratosphere/include/stratosphere/spl/spl_types.hpp b/libraries/libstratosphere/include/stratosphere/spl/spl_types.hpp index 08444261d..11c80ad48 100644 --- a/libraries/libstratosphere/include/stratosphere/spl/spl_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/spl/spl_types.hpp @@ -98,6 +98,7 @@ namespace ams::spl { enum class EsDeviceUniqueKeyType { TitleKey = 0, ArchiveKey = 1, + Unknown2 = 2, }; struct AsyncOperationKey { diff --git a/libraries/libstratosphere/source/spl/smc/spl_secure_monitor_api.os.generic.cpp b/libraries/libstratosphere/source/spl/smc/spl_secure_monitor_api.os.generic.cpp index fead3970e..966912ad9 100644 --- a/libraries/libstratosphere/source/spl/smc/spl_secure_monitor_api.os.generic.cpp +++ b/libraries/libstratosphere/source/spl/smc/spl_secure_monitor_api.os.generic.cpp @@ -50,6 +50,7 @@ namespace ams::spl::smc { enum EsCommonKeyType { EsCommonKeyType_TitleKey = 0, EsCommonKeyType_ArchiveKey = 1, + EsCommonKeyType_Unknown2 = 2, EsCommonKeyType_Count, }; @@ -86,6 +87,7 @@ namespace ams::spl::smc { constexpr const u8 EsCommonKeySources[EsCommonKeyType_Count][AesKeySize] = { [EsCommonKeyType_TitleKey] = { 0x1E, 0xDC, 0x7B, 0x3B, 0x60, 0xE6, 0xB4, 0xD8, 0x78, 0xB8, 0x17, 0x15, 0x98, 0x5E, 0x62, 0x9B }, [EsCommonKeyType_ArchiveKey] = { 0x3B, 0x78, 0xF2, 0x61, 0x0F, 0x9D, 0x5A, 0xE2, 0x7B, 0x4E, 0x45, 0xAF, 0xCB, 0x0B, 0x67, 0x4D }, + [EsCommonKeyType_Unknown2] = { 0x42, 0x64, 0x0B, 0xE3, 0x5F, 0xC6, 0xBE, 0x47, 0xC7, 0xB4, 0x84, 0xC5, 0xEB, 0x63, 0xAA, 0x02 }, }; constexpr u64 InvalidAsyncKey = 0;