From 00d0586d1f2e1c9acb7989aee02fa8820c0a744a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Mon, 8 Feb 2021 12:20:45 +0000 Subject: [PATCH] Correctly set size in CtrEncryptedBacking This bug caused crashes with the improved error checking. --- app/src/main/cpp/skyline/vfs/ctr_encrypted_backing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/vfs/ctr_encrypted_backing.cpp b/app/src/main/cpp/skyline/vfs/ctr_encrypted_backing.cpp index 53f504f7..e539d7b9 100644 --- a/app/src/main/cpp/skyline/vfs/ctr_encrypted_backing.cpp +++ b/app/src/main/cpp/skyline/vfs/ctr_encrypted_backing.cpp @@ -6,7 +6,7 @@ namespace skyline::vfs { constexpr size_t SectorSize{0x10}; - CtrEncryptedBacking::CtrEncryptedBacking(crypto::KeyStore::Key128 ctr, crypto::KeyStore::Key128 key, std::shared_ptr backing, size_t baseOffset) : Backing({true, false, false}), ctr(ctr), cipher(key, MBEDTLS_CIPHER_AES_128_CTR), backing(std::move(backing)), baseOffset(baseOffset) { + CtrEncryptedBacking::CtrEncryptedBacking(crypto::KeyStore::Key128 ctr, crypto::KeyStore::Key128 key, std::shared_ptr backing, size_t baseOffset) : Backing({true, false, false}, backing->size), ctr(ctr), cipher(key, MBEDTLS_CIPHER_AES_128_CTR), backing(std::move(backing)), baseOffset(baseOffset) { if (mode.write || mode.append) throw exception("Cannot open a CtrEncryptedBacking as writable"); }