diff options
| author | 2018-09-29 11:48:51 -0400 | |
|---|---|---|
| committer | 2018-10-07 13:16:23 -0400 | |
| commit | 3ec054643e50f2845fb6a1a924b83bd71a0e2234 (patch) | |
| tree | 313f2bcfba3610aa9bad98c3a7995d475712adc2 /src/core/crypto/key_manager.h | |
| parent | qt: Add rederive keyset menu option (diff) | |
| download | yuzu-3ec054643e50f2845fb6a1a924b83bd71a0e2234.tar.gz yuzu-3ec054643e50f2845fb6a1a924b83bd71a0e2234.tar.xz yuzu-3ec054643e50f2845fb6a1a924b83bd71a0e2234.zip | |
partition_data_manager: Rename system files for hekate
x
Diffstat (limited to 'src/core/crypto/key_manager.h')
| -rw-r--r-- | src/core/crypto/key_manager.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h index d26aa59b6..a41abbdfc 100644 --- a/src/core/crypto/key_manager.h +++ b/src/core/crypto/key_manager.h | |||
| @@ -11,8 +11,8 @@ | |||
| 11 | #include <boost/optional.hpp> | 11 | #include <boost/optional.hpp> |
| 12 | #include <fmt/format.h> | 12 | #include <fmt/format.h> |
| 13 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 14 | #include "core/crypto/partition_data_manager.h" | ||
| 14 | #include "core/file_sys/vfs_types.h" | 15 | #include "core/file_sys/vfs_types.h" |
| 15 | #include "partition_data_manager.h" | ||
| 16 | 16 | ||
| 17 | namespace FileUtil { | 17 | namespace FileUtil { |
| 18 | class IOFile; | 18 | class IOFile; |
| @@ -154,11 +154,11 @@ public: | |||
| 154 | // 8*43 and the private file to exist. | 154 | // 8*43 and the private file to exist. |
| 155 | void DeriveSDSeedLazy(); | 155 | void DeriveSDSeedLazy(); |
| 156 | 156 | ||
| 157 | bool BaseDeriveNecessary(); | 157 | bool BaseDeriveNecessary() const; |
| 158 | void DeriveBase(); | 158 | void DeriveBase(); |
| 159 | void DeriveETicket(PartitionDataManager data); | 159 | void DeriveETicket(PartitionDataManager& data); |
| 160 | 160 | ||
| 161 | void PopulateFromPartitionData(PartitionDataManager data); | 161 | void PopulateFromPartitionData(PartitionDataManager& data); |
| 162 | 162 | ||
| 163 | private: | 163 | private: |
| 164 | std::map<KeyIndex<S128KeyType>, Key128> s128_keys; | 164 | std::map<KeyIndex<S128KeyType>, Key128> s128_keys; |
| @@ -175,6 +175,8 @@ private: | |||
| 175 | void WriteKeyToFile(KeyCategory category, std::string_view keyname, | 175 | void WriteKeyToFile(KeyCategory category, std::string_view keyname, |
| 176 | const std::array<u8, Size>& key); | 176 | const std::array<u8, Size>& key); |
| 177 | 177 | ||
| 178 | void DeriveGeneralPurposeKeys(u8 crypto_revision); | ||
| 179 | |||
| 178 | void SetKeyWrapped(S128KeyType id, Key128 key, u64 field1 = 0, u64 field2 = 0); | 180 | void SetKeyWrapped(S128KeyType id, Key128 key, u64 field1 = 0, u64 field2 = 0); |
| 179 | void SetKeyWrapped(S256KeyType id, Key256 key, u64 field1 = 0, u64 field2 = 0); | 181 | void SetKeyWrapped(S256KeyType id, Key256 key, u64 field1 = 0, u64 field2 = 0); |
| 180 | 182 | ||
| @@ -183,7 +185,11 @@ private: | |||
| 183 | }; | 185 | }; |
| 184 | 186 | ||
| 185 | Key128 GenerateKeyEncryptionKey(Key128 source, Key128 master, Key128 kek_seed, Key128 key_seed); | 187 | Key128 GenerateKeyEncryptionKey(Key128 source, Key128 master, Key128 kek_seed, Key128 key_seed); |
| 186 | Key128 DeriveKeyblobKey(Key128 sbk, Key128 tsec, Key128 source); | 188 | Key128 DeriveKeyblobKey(const Key128& sbk, const Key128& tsec, Key128 source); |
| 189 | Key128 DeriveKeyblobMACKey(const Key128& keyblob_key, const Key128& mac_source); | ||
| 190 | Key128 DeriveMasterKey(const std::array<u8, 0x90>& keyblob, const Key128& master_source); | ||
| 191 | std::array<u8, 0x90> DecryptKeyblob(const std::array<u8, 0xB0>& encrypted_keyblob, | ||
| 192 | const Key128& key); | ||
| 187 | 193 | ||
| 188 | boost::optional<Key128> DeriveSDSeed(); | 194 | boost::optional<Key128> DeriveSDSeed(); |
| 189 | Loader::ResultStatus DeriveSDKeys(std::array<Key256, 2>& sd_keys, KeyManager& keys); | 195 | Loader::ResultStatus DeriveSDKeys(std::array<Key256, 2>& sd_keys, KeyManager& keys); |