2021-08-17 17:46:52 +00: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 16:55:50 +00: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 17:46:52 +00:00
|
|
|
|
{
|
|
|
|
|
return ResultFs.InvalidArgument.Log();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-23 16:55:50 +00:00
|
|
|
|
// Todo: Reenable when AesXtsFileSystem is fixed
|
|
|
|
|
outEncryptedFileSystem = SharedRef<IFileSystem>.CreateMove(ref baseFileSystem);
|
2021-08-17 17:46:52 +00:00
|
|
|
|
|
|
|
|
|
return Result.Success;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|