Correctly set size in CtrEncryptedBacking

This bug caused crashes with the improved error checking.
This commit is contained in:
Billy Laws 2021-02-08 12:20:45 +00:00 committed by ◱ Mark
parent 5f942e2dff
commit 00d0586d1f

View File

@ -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> 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> 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");
}