2021-08-17 13:46:52 -04:00
|
|
|
|
using LibHac;
|
|
|
|
|
using LibHac.Common;
|
|
|
|
|
using LibHac.Fs;
|
|
|
|
|
using LibHac.Fs.Fsa;
|
|
|
|
|
using LibHac.FsSrv.FsCreator;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.FileSystem
|
|
|
|
|
{
|
|
|
|
|
public class EncryptedFileSystemCreator : IEncryptedFileSystemCreator
|
|
|
|
|
{
|
|
|
|
|
|
2021-12-23 11:55:50 -05:00
|
|
|
|
public Result Create(ref SharedRef<IFileSystem> outEncryptedFileSystem,
|
|
|
|
|
ref SharedRef<IFileSystem> baseFileSystem, IEncryptedFileSystemCreator.KeyId idIndex,
|
|
|
|
|
in EncryptionSeed encryptionSeed)
|
|
|
|
|
{
|
|
|
|
|
if (idIndex < IEncryptedFileSystemCreator.KeyId.Save || idIndex > IEncryptedFileSystemCreator.KeyId.CustomStorage)
|
2021-08-17 13:46:52 -04:00
|
|
|
|
{
|
|
|
|
|
return ResultFs.InvalidArgument.Log();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-23 11:55:50 -05:00
|
|
|
|
// Todo: Reenable when AesXtsFileSystem is fixed
|
|
|
|
|
outEncryptedFileSystem = SharedRef<IFileSystem>.CreateMove(ref baseFileSystem);
|
2021-08-17 13:46:52 -04:00
|
|
|
|
|
|
|
|
|
return Result.Success;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|