This commit is contained in:
parent
a52c09bdf9
commit
6e17c058d6
3 changed files with 0 additions and 139 deletions
|
@ -1209,22 +1209,6 @@ void KeyManager::PopulateFromPartitionData(PartitionDataManager& data) {
|
||||||
encrypted_keyblobs[i]);
|
encrypted_keyblobs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetPackage2KeySource(),
|
|
||||||
static_cast<u64>(SourceKeyType::Package2));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetAESKekGenerationSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::AESKekGeneration));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetTitlekekSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::Titlekek));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetMasterKeySource(),
|
|
||||||
static_cast<u64>(SourceKeyType::Master));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetKeyblobMACKeySource(),
|
|
||||||
static_cast<u64>(SourceKeyType::KeyblobMAC));
|
|
||||||
|
|
||||||
for (size_t i = 0; i < PartitionDataManager::MAX_KEYBLOB_SOURCE_HASH; ++i) {
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetKeyblobKeySource(i),
|
|
||||||
static_cast<u64>(SourceKeyType::Keyblob), i);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.HasFuses()) {
|
if (data.HasFuses()) {
|
||||||
SetKeyWrapped(S128KeyType::SecureBoot, data.GetSecureBootKey());
|
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();
|
DeriveBase();
|
||||||
|
|
||||||
if (!data.HasPackage2())
|
if (!data.HasPackage2())
|
||||||
|
@ -1259,27 +1236,6 @@ void KeyManager::PopulateFromPartitionData(PartitionDataManager& data) {
|
||||||
}
|
}
|
||||||
data.DecryptPackage2(package2_keys, Package2Type::NormalMain);
|
data.DecryptPackage2(package2_keys, Package2Type::NormalMain);
|
||||||
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetKeyAreaKeyApplicationSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::KeyAreaKey),
|
|
||||||
static_cast<u64>(KeyAreaKeyType::Application));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetKeyAreaKeyOceanSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::KeyAreaKey),
|
|
||||||
static_cast<u64>(KeyAreaKeyType::Ocean));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetKeyAreaKeySystemSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::KeyAreaKey),
|
|
||||||
static_cast<u64>(KeyAreaKeyType::System));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetSDKekSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::SDKek));
|
|
||||||
SetKeyWrapped(S256KeyType::SDKeySource, data.GetSDSaveKeySource(),
|
|
||||||
static_cast<u64>(SDKeyType::Save));
|
|
||||||
SetKeyWrapped(S256KeyType::SDKeySource, data.GetSDNCAKeySource(),
|
|
||||||
static_cast<u64>(SDKeyType::NCA));
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetHeaderKekSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::HeaderKek));
|
|
||||||
SetKeyWrapped(S256KeyType::HeaderSource, data.GetHeaderKeySource());
|
|
||||||
SetKeyWrapped(S128KeyType::Source, data.GetAESKeyGenerationSource(),
|
|
||||||
static_cast<u64>(SourceKeyType::AESKeyGeneration));
|
|
||||||
|
|
||||||
DeriveBase();
|
DeriveBase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,47 +111,10 @@ std::vector<u8> PartitionDataManager::GetSecureMonitor() const {
|
||||||
return secure_monitor_bytes;
|
return secure_monitor_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetPackage2KeySource() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetAESKekGenerationSource() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetTitlekekSource() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<std::array<u8, 16>, 32> PartitionDataManager::GetTZMasterKeys(
|
|
||||||
std::array<u8, 0x10> master_key) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetRSAKekSeed3() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetRSAKekMask0() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<u8> PartitionDataManager::GetPackage1Decrypted() const {
|
std::vector<u8> PartitionDataManager::GetPackage1Decrypted() const {
|
||||||
return package1_decrypted_bytes;
|
return package1_decrypted_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetMasterKeySource() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetKeyblobMACKeySource() const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetKeyblobKeySource(std::size_t revision) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PartitionDataManager::HasFuses() const {
|
bool PartitionDataManager::HasFuses() const {
|
||||||
return fuses != nullptr;
|
return fuses != nullptr;
|
||||||
}
|
}
|
||||||
|
@ -263,46 +226,10 @@ const std::vector<u8>& PartitionDataManager::GetPackage2FSDecompressed(Package2T
|
||||||
return package2_fs.at(static_cast<size_t>(type));
|
return package2_fs.at(static_cast<size_t>(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetKeyAreaKeyApplicationSource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetKeyAreaKeyOceanSource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetKeyAreaKeySystemSource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetSDKekSource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 32> PartitionDataManager::GetSDSaveKeySource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 32> PartitionDataManager::GetSDNCAKeySource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetHeaderKekSource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::array<u8, 32> PartitionDataManager::GetHeaderKeySource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<u8>& PartitionDataManager::GetPackage2SPLDecompressed(Package2Type type) const {
|
const std::vector<u8>& PartitionDataManager::GetPackage2SPLDecompressed(Package2Type type) const {
|
||||||
return package2_spl.at(static_cast<size_t>(type));
|
return package2_spl.at(static_cast<size_t>(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<u8, 16> PartitionDataManager::GetAESKeyGenerationSource(Package2Type type) const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PartitionDataManager::HasProdInfo() const {
|
bool PartitionDataManager::HasProdInfo() const {
|
||||||
return prodinfo != nullptr;
|
return prodinfo != nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,16 +36,7 @@ public:
|
||||||
EncryptedKeyBlob GetEncryptedKeyblob(std::size_t index) const;
|
EncryptedKeyBlob GetEncryptedKeyblob(std::size_t index) const;
|
||||||
EncryptedKeyBlobs GetEncryptedKeyblobs() const;
|
EncryptedKeyBlobs GetEncryptedKeyblobs() const;
|
||||||
std::vector<u8> GetSecureMonitor() const;
|
std::vector<u8> GetSecureMonitor() const;
|
||||||
std::array<u8, 0x10> GetPackage2KeySource() const;
|
|
||||||
std::array<u8, 0x10> GetAESKekGenerationSource() const;
|
|
||||||
std::array<u8, 0x10> GetTitlekekSource() const;
|
|
||||||
std::array<std::array<u8, 0x10>, 0x20> GetTZMasterKeys(std::array<u8, 0x10> master_key) const;
|
|
||||||
std::array<u8, 0x10> GetRSAKekSeed3() const;
|
|
||||||
std::array<u8, 0x10> GetRSAKekMask0() const;
|
|
||||||
std::vector<u8> GetPackage1Decrypted() const;
|
std::vector<u8> GetPackage1Decrypted() const;
|
||||||
std::array<u8, 0x10> GetMasterKeySource() const;
|
|
||||||
std::array<u8, 0x10> GetKeyblobMACKeySource() const;
|
|
||||||
std::array<u8, 0x10> GetKeyblobKeySource(std::size_t revision) const;
|
|
||||||
|
|
||||||
// Fuses
|
// Fuses
|
||||||
bool HasFuses() const;
|
bool HasFuses() const;
|
||||||
|
@ -63,21 +54,8 @@ public:
|
||||||
Package2Type type);
|
Package2Type type);
|
||||||
const std::vector<u8>& GetPackage2FSDecompressed(
|
const std::vector<u8>& GetPackage2FSDecompressed(
|
||||||
Package2Type type = Package2Type::NormalMain) const;
|
Package2Type type = Package2Type::NormalMain) const;
|
||||||
std::array<u8, 0x10> GetKeyAreaKeyApplicationSource(
|
|
||||||
Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x10> GetKeyAreaKeyOceanSource(
|
|
||||||
Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x10> GetKeyAreaKeySystemSource(
|
|
||||||
Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x10> GetSDKekSource(Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x20> GetSDSaveKeySource(Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x20> GetSDNCAKeySource(Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x10> GetHeaderKekSource(Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
std::array<u8, 0x20> GetHeaderKeySource(Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
const std::vector<u8>& GetPackage2SPLDecompressed(
|
const std::vector<u8>& GetPackage2SPLDecompressed(
|
||||||
Package2Type type = Package2Type::NormalMain) const;
|
Package2Type type = Package2Type::NormalMain) const;
|
||||||
std::array<u8, 0x10> GetAESKeyGenerationSource(
|
|
||||||
Package2Type type = Package2Type::NormalMain) const;
|
|
||||||
|
|
||||||
// PRODINFO
|
// PRODINFO
|
||||||
bool HasProdInfo() const;
|
bool HasProdInfo() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue