From 00b3cc3b09ba2525e6d66691ab18c87b69f37046 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 12 Oct 2014 15:05:11 -0400 Subject: [PATCH] VolumeCreator: Make master key arrays static Only used within this translation unit. --- Source/Core/DiscIO/VolumeCreator.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/DiscIO/VolumeCreator.cpp b/Source/Core/DiscIO/VolumeCreator.cpp index 0b6fc465e8..4e740554f6 100644 --- a/Source/Core/DiscIO/VolumeCreator.cpp +++ b/Source/Core/DiscIO/VolumeCreator.cpp @@ -59,8 +59,15 @@ private: IBlobReader& m_rReader; }; -const unsigned char g_MasterKey[16] = {0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4,0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7}; -const unsigned char g_MasterKeyK[16] = {0x63,0xb8,0x2b,0xb4,0xf4,0x61,0x4e,0x2e,0x13,0xf2,0xfe,0xfb,0xba,0x4c,0x9b,0x7e}; +static const unsigned char s_master_key[16] = { + 0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4, + 0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7 +}; + +static const unsigned char s_master_key_korean[16] = { + 0x63,0xb8,0x2b,0xb4,0xf4,0x61,0x4e,0x2e, + 0x13,0xf2,0xfe,0xfb,0xba,0x4c,0x9b,0x7e +}; static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _PartitionGroup, u32 _VolumeType, u32 _VolumeNum, bool Korean); EDiscType GetDiscType(IBlobReader& _rReader); @@ -195,7 +202,7 @@ static IVolume* CreateVolumeFromCryptedWiiImage(IBlobReader& _rReader, u32 _Part usingKoreanKey = true; aes_context AES_ctx; - aes_setkey_dec(&AES_ctx, (usingKoreanKey ? g_MasterKeyK : g_MasterKey), 128); + aes_setkey_dec(&AES_ctx, (usingKoreanKey ? s_master_key_korean : s_master_key), 128); u8 VolumeKey[16]; aes_crypt_cbc(&AES_ctx, AES_DECRYPT, 16, IV, SubKey, VolumeKey);