fs: correct error result in AesCtrStorage

This commit is contained in:
Michael Scire 2020-04-06 04:56:49 -07:00
parent 0e9974e7b3
commit b2e86f5a1b
2 changed files with 3 additions and 2 deletions

View file

@ -64,7 +64,7 @@ namespace ams::fssystem {
/* Decrypt, ensure we decrypt correctly. */
auto dec_size = crypto::DecryptAes128Ctr(buffer, size, this->key, KeySize, ctr, IvSize, buffer, size);
AMS_ABORT_UNLESS(size == dec_size);
R_UNLESS(size == dec_size, fs::ResultUnexpectedInAesCtrStorageA());
return ResultSuccess();
}
@ -105,7 +105,7 @@ namespace ams::fssystem {
ScopedThreadPriorityChanger cp(+1, ScopedThreadPriorityChanger::Mode::Relative);
auto enc_size = crypto::EncryptAes128Ctr(write_buf, write_size, this->key, KeySize, ctr, IvSize, reinterpret_cast<const char *>(buffer) + cur_offset, write_size);
AMS_ABORT_UNLESS(enc_size == write_size);
R_UNLESS(enc_size == write_size, fs::ResultUnexpectedInAesCtrStorageA());
}
/* Write the encrypted data. */

View file

@ -214,6 +214,7 @@ namespace ams::fs {
R_DEFINE_ERROR_RESULT(GameCardLogoDataCorrupted, 4781);
R_DEFINE_ERROR_RANGE(Unexpected, 5000, 5999);
R_DEFINE_ERROR_RESULT(UnexpectedInAesCtrStorageA, 5315);
R_DEFINE_ERROR_RESULT(UnexpectedInFindFileSystemA, 5319);
R_DEFINE_ERROR_RANGE(PreconditionViolation, 6000, 6499);