diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index 9ec45f3a15..50945eee91 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp @@ -1209,22 +1209,6 @@ void KeyManager::PopulateFromPartitionData(PartitionDataManager& data) { encrypted_keyblobs[i]); } - SetKeyWrapped(S128KeyType::Source, data.GetPackage2KeySource(), - static_cast(SourceKeyType::Package2)); - SetKeyWrapped(S128KeyType::Source, data.GetAESKekGenerationSource(), - static_cast(SourceKeyType::AESKekGeneration)); - SetKeyWrapped(S128KeyType::Source, data.GetTitlekekSource(), - static_cast(SourceKeyType::Titlekek)); - SetKeyWrapped(S128KeyType::Source, data.GetMasterKeySource(), - static_cast(SourceKeyType::Master)); - SetKeyWrapped(S128KeyType::Source, data.GetKeyblobMACKeySource(), - static_cast(SourceKeyType::KeyblobMAC)); - - for (size_t i = 0; i < PartitionDataManager::MAX_KEYBLOB_SOURCE_HASH; ++i) { - SetKeyWrapped(S128KeyType::Source, data.GetKeyblobKeySource(i), - static_cast(SourceKeyType::Keyblob), i); - } - if (data.HasFuses()) { SetKeyWrapped(S128KeyType::SecureBoot, data.GetSecureBootKey()); } @@ -1239,13 +1223,6 @@ void KeyManager::PopulateFromPartitionData(PartitionDataManager& data) { } } - const auto masters = data.GetTZMasterKeys(latest_master); - for (size_t i = 0; i < masters.size(); ++i) { - if (masters[i] != Key128{} && !HasKey(S128KeyType::Master, i)) { - SetKey(S128KeyType::Master, masters[i], i); - } - } - DeriveBase(); if (!data.HasPackage2()) @@ -1259,27 +1236,6 @@ void KeyManager::PopulateFromPartitionData(PartitionDataManager& data) { } data.DecryptPackage2(package2_keys, Package2Type::NormalMain); - SetKeyWrapped(S128KeyType::Source, data.GetKeyAreaKeyApplicationSource(), - static_cast(SourceKeyType::KeyAreaKey), - static_cast(KeyAreaKeyType::Application)); - SetKeyWrapped(S128KeyType::Source, data.GetKeyAreaKeyOceanSource(), - static_cast(SourceKeyType::KeyAreaKey), - static_cast(KeyAreaKeyType::Ocean)); - SetKeyWrapped(S128KeyType::Source, data.GetKeyAreaKeySystemSource(), - static_cast(SourceKeyType::KeyAreaKey), - static_cast(KeyAreaKeyType::System)); - SetKeyWrapped(S128KeyType::Source, data.GetSDKekSource(), - static_cast(SourceKeyType::SDKek)); - SetKeyWrapped(S256KeyType::SDKeySource, data.GetSDSaveKeySource(), - static_cast(SDKeyType::Save)); - SetKeyWrapped(S256KeyType::SDKeySource, data.GetSDNCAKeySource(), - static_cast(SDKeyType::NCA)); - SetKeyWrapped(S128KeyType::Source, data.GetHeaderKekSource(), - static_cast(SourceKeyType::HeaderKek)); - SetKeyWrapped(S256KeyType::HeaderSource, data.GetHeaderKeySource()); - SetKeyWrapped(S128KeyType::Source, data.GetAESKeyGenerationSource(), - static_cast(SourceKeyType::AESKeyGeneration)); - DeriveBase(); } diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index d2a123e60b..e185838e57 100644 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp @@ -111,47 +111,10 @@ std::vector PartitionDataManager::GetSecureMonitor() const { return secure_monitor_bytes; } -std::array PartitionDataManager::GetPackage2KeySource() const { - return {}; -} - -std::array PartitionDataManager::GetAESKekGenerationSource() const { - return {}; -} - -std::array PartitionDataManager::GetTitlekekSource() const { - return {}; -} - -std::array, 32> PartitionDataManager::GetTZMasterKeys( - std::array master_key) const { - return {}; -} - -std::array PartitionDataManager::GetRSAKekSeed3() const { - return {}; -} - -std::array PartitionDataManager::GetRSAKekMask0() const { - return {}; -} - std::vector PartitionDataManager::GetPackage1Decrypted() const { return package1_decrypted_bytes; } -std::array PartitionDataManager::GetMasterKeySource() const { - return {}; -} - -std::array PartitionDataManager::GetKeyblobMACKeySource() const { - return {}; -} - -std::array PartitionDataManager::GetKeyblobKeySource(std::size_t revision) const { - return {}; -} - bool PartitionDataManager::HasFuses() const { return fuses != nullptr; } @@ -263,46 +226,10 @@ const std::vector& PartitionDataManager::GetPackage2FSDecompressed(Package2T return package2_fs.at(static_cast(type)); } -std::array PartitionDataManager::GetKeyAreaKeyApplicationSource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetKeyAreaKeyOceanSource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetKeyAreaKeySystemSource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetSDKekSource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetSDSaveKeySource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetSDNCAKeySource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetHeaderKekSource(Package2Type type) const { - return {}; -} - -std::array PartitionDataManager::GetHeaderKeySource(Package2Type type) const { - return {}; -} - const std::vector& PartitionDataManager::GetPackage2SPLDecompressed(Package2Type type) const { return package2_spl.at(static_cast(type)); } -std::array PartitionDataManager::GetAESKeyGenerationSource(Package2Type type) const { - return {}; -} - bool PartitionDataManager::HasProdInfo() const { return prodinfo != nullptr; } diff --git a/src/core/crypto/partition_data_manager.h b/src/core/crypto/partition_data_manager.h index 97a8abb67b..1c53920ed4 100644 --- a/src/core/crypto/partition_data_manager.h +++ b/src/core/crypto/partition_data_manager.h @@ -36,16 +36,7 @@ public: EncryptedKeyBlob GetEncryptedKeyblob(std::size_t index) const; EncryptedKeyBlobs GetEncryptedKeyblobs() const; std::vector GetSecureMonitor() const; - std::array GetPackage2KeySource() const; - std::array GetAESKekGenerationSource() const; - std::array GetTitlekekSource() const; - std::array, 0x20> GetTZMasterKeys(std::array master_key) const; - std::array GetRSAKekSeed3() const; - std::array GetRSAKekMask0() const; std::vector GetPackage1Decrypted() const; - std::array GetMasterKeySource() const; - std::array GetKeyblobMACKeySource() const; - std::array GetKeyblobKeySource(std::size_t revision) const; // Fuses bool HasFuses() const; @@ -63,21 +54,8 @@ public: Package2Type type); const std::vector& GetPackage2FSDecompressed( Package2Type type = Package2Type::NormalMain) const; - std::array GetKeyAreaKeyApplicationSource( - Package2Type type = Package2Type::NormalMain) const; - std::array GetKeyAreaKeyOceanSource( - Package2Type type = Package2Type::NormalMain) const; - std::array GetKeyAreaKeySystemSource( - Package2Type type = Package2Type::NormalMain) const; - std::array GetSDKekSource(Package2Type type = Package2Type::NormalMain) const; - std::array GetSDSaveKeySource(Package2Type type = Package2Type::NormalMain) const; - std::array GetSDNCAKeySource(Package2Type type = Package2Type::NormalMain) const; - std::array GetHeaderKekSource(Package2Type type = Package2Type::NormalMain) const; - std::array GetHeaderKeySource(Package2Type type = Package2Type::NormalMain) const; const std::vector& GetPackage2SPLDecompressed( Package2Type type = Package2Type::NormalMain) const; - std::array GetAESKeyGenerationSource( - Package2Type type = Package2Type::NormalMain) const; // PRODINFO bool HasProdInfo() const;