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