From 3ec054643e50f2845fb6a1a924b83bd71a0e2234 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 29 Sep 2018 11:48:51 -0400 Subject: partition_data_manager: Rename system files for hekate x --- src/core/crypto/key_manager.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/core/crypto/key_manager.h') 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 @@ #include #include #include "common/common_types.h" +#include "core/crypto/partition_data_manager.h" #include "core/file_sys/vfs_types.h" -#include "partition_data_manager.h" namespace FileUtil { class IOFile; @@ -154,11 +154,11 @@ public: // 8*43 and the private file to exist. void DeriveSDSeedLazy(); - bool BaseDeriveNecessary(); + bool BaseDeriveNecessary() const; void DeriveBase(); - void DeriveETicket(PartitionDataManager data); + void DeriveETicket(PartitionDataManager& data); - void PopulateFromPartitionData(PartitionDataManager data); + void PopulateFromPartitionData(PartitionDataManager& data); private: std::map, Key128> s128_keys; @@ -175,6 +175,8 @@ private: void WriteKeyToFile(KeyCategory category, std::string_view keyname, const std::array& key); + void DeriveGeneralPurposeKeys(u8 crypto_revision); + void SetKeyWrapped(S128KeyType id, Key128 key, u64 field1 = 0, u64 field2 = 0); void SetKeyWrapped(S256KeyType id, Key256 key, u64 field1 = 0, u64 field2 = 0); @@ -183,7 +185,11 @@ private: }; Key128 GenerateKeyEncryptionKey(Key128 source, Key128 master, Key128 kek_seed, Key128 key_seed); -Key128 DeriveKeyblobKey(Key128 sbk, Key128 tsec, Key128 source); +Key128 DeriveKeyblobKey(const Key128& sbk, const Key128& tsec, Key128 source); +Key128 DeriveKeyblobMACKey(const Key128& keyblob_key, const Key128& mac_source); +Key128 DeriveMasterKey(const std::array& keyblob, const Key128& master_source); +std::array DecryptKeyblob(const std::array& encrypted_keyblob, + const Key128& key); boost::optional DeriveSDSeed(); Loader::ResultStatus DeriveSDKeys(std::array& sd_keys, KeyManager& keys); -- cgit v1.2.3