aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/FileSystem/EncryptedFileSystemCreator.cs
blob: 64b02a28221bb375d03e99b31cf0eace62e1ae52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using LibHac;
using LibHac.Common;
using LibHac.Fs;
using LibHac.Fs.Fsa;
using LibHac.FsSrv.FsCreator;

namespace Ryujinx.HLE.FileSystem
{
    public class EncryptedFileSystemCreator : IEncryptedFileSystemCreator
    {
        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)
            {
                return ResultFs.InvalidArgument.Log();
            }

            // TODO: Reenable when AesXtsFileSystem is fixed.
            outEncryptedFileSystem = SharedRef<IFileSystem>.CreateMove(ref baseFileSystem);

            return Result.Success;
        }
    }
}