diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-09-24 02:31:00 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-10-07 19:15:11 +0200 |
commit | 721632fe6602c18cc7e143b62020cbf436ced606 (patch) | |
tree | 340ffca048c3a28204f4dd59a140c957e99e35ad | |
parent | externals/mbedtls: Enable CMAC module (diff) | |
download | yuzu-721632fe6602c18cc7e143b62020cbf436ced606.tar yuzu-721632fe6602c18cc7e143b62020cbf436ced606.tar.gz yuzu-721632fe6602c18cc7e143b62020cbf436ced606.tar.bz2 yuzu-721632fe6602c18cc7e143b62020cbf436ced606.tar.lz yuzu-721632fe6602c18cc7e143b62020cbf436ced606.tar.xz yuzu-721632fe6602c18cc7e143b62020cbf436ced606.tar.zst yuzu-721632fe6602c18cc7e143b62020cbf436ced606.zip |
-rw-r--r-- | src/core/crypto/key_manager.cpp | 11 | ||||
-rw-r--r-- | src/core/crypto/key_manager.h | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index bf3a70944..467eb423e 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -71,23 +71,24 @@ boost::optional<Key128> DeriveSDSeed() { return seed; } -Loader::ResultStatus DeriveSDKeys(std::array<Key256, 2>& sd_keys, const KeyManager& keys) { - if (!keys.HasKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::SDKEK))) +Loader::ResultStatus DeriveSDKeys(std::array<Key256, 2>& sd_keys, KeyManager& keys) { + if (!keys.HasKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::SDKek))) return Loader::ResultStatus::ErrorMissingSDKEKSource; - if (!keys.HasKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::AESKEKGeneration))) + if (!keys.HasKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::AESKekGeneration))) return Loader::ResultStatus::ErrorMissingAESKEKGenerationSource; if (!keys.HasKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::AESKeyGeneration))) return Loader::ResultStatus::ErrorMissingAESKeyGenerationSource; const auto sd_kek_source = - keys.GetKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::SDKEK)); + keys.GetKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::SDKek)); const auto aes_kek_gen = - keys.GetKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::AESKEKGeneration)); + keys.GetKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::AESKekGeneration)); const auto aes_key_gen = keys.GetKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::AESKeyGeneration)); const auto master_00 = keys.GetKey(S128KeyType::Master); const auto sd_kek = GenerateKeyEncryptionKey(sd_kek_source, master_00, aes_kek_gen, aes_key_gen); + keys.SetKey(S128KeyType::SDKek, sd_kek); if (!keys.HasKey(S128KeyType::SDSeed)) return Loader::ResultStatus::ErrorMissingSDSeed; diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h index 978eec8dc..8bd33840d 100644 --- a/src/core/crypto/key_manager.h +++ b/src/core/crypto/key_manager.h @@ -50,9 +50,9 @@ enum class KeyAreaKeyType : u8 { }; enum class SourceKeyType : u8 { - SDKEK, - AESKEKGeneration, - AESKeyGeneration, + SDKek, // + AESKekGeneration, // + AESKeyGeneration, // }; enum class SDKeyType : u8 { |