From 0aef2b9c26fddf40b5f5283ba846f3415c5a65a1 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Fri, 19 Oct 2018 18:37:58 -0400 Subject: crypto: Use compressed sizes in offset calculation for KIP decompression Fixes a fatal crash on start when deriving keys. --- src/core/crypto/partition_data_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/crypto') diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index 25cee1f3a..ed0775444 100644 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp @@ -516,7 +516,8 @@ void PartitionDataManager::DecryptPackage2(const std::array& packa out.insert(out.end(), rodata.begin(), rodata.end()); out.insert(out.end(), data.begin(), data.end()); - offset += sizeof(KIPHeader) + out.size(); + offset += sizeof(KIPHeader) + kip.sections[0].size_compressed + + kip.sections[1].size_compressed + kip.sections[2].size_compressed; if (name == "FS") package2_fs[static_cast(type)] = std::move(out); -- cgit v1.2.3