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