1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-18 16:33:15 +00:00

PM-5154 Added Fido2AuthenticationService to provide us a wrapper for the actual implementation

This commit is contained in:
Federico Maccaroni
2024-01-03 19:02:49 -03:00
parent 1eb9e5f8ea
commit dfb7a0621f
8 changed files with 68 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
using Bit.Core.Utilities.Fido2;
namespace Bit.Core.Abstractions
{
public interface IFido2AuthenticationService
{
Task<Fido2AuthenticatorGetAssertionResult> GetAssertionAsync(Fido2AuthenticatorGetAssertionParams assertionParams);
}
}

View File

@@ -73,6 +73,7 @@
<Folder Include="Utilities\Automation\" />
<Folder Include="Utilities\Prompts\" />
<Folder Include="Resources\Localization\" />
<Folder Include="Utilities\Fido2\" />
</ItemGroup>
<ItemGroup>
<MauiImage Include="Resources\Images\dotnet_bot.svg">
@@ -100,4 +101,7 @@
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<None Remove="Utilities\Fido2\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
using Bit.Core.Abstractions;
using Bit.Core.Utilities.Fido2;
namespace Bit.Core.Services
{
public class Fido2AuthenticationService : IFido2AuthenticationService
{
public Task<Fido2AuthenticatorGetAssertionResult> GetAssertionAsync(Fido2AuthenticatorGetAssertionParams assertionParams)
{
// TODO: IMPLEMENT this
return Task.FromResult(new Fido2AuthenticatorGetAssertionResult
{
AuthenticatorData = new byte[32],
Signature = new byte[8]
});
}
}
}

View File

@@ -0,0 +1,12 @@
namespace Bit.Core.Utilities.Fido2
{
public class Fido2AuthenticatorGetAssertionParams
{
public string RpId { get; set; }
public string CredentialId { get; set; }
public string Counter { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
using System;
namespace Bit.Core.Utilities.Fido2
{
public class Fido2AuthenticatorGetAssertionResult
{
public byte[] AuthenticatorData { get; set; }
public byte[] Signature { get; set; }
}
}

View File

@@ -1,9 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Globalization;
using System.Text;
using System.Threading.Tasks;
using Bit.Core.Abstractions;
using Bit.Core.Services;
@@ -118,6 +115,7 @@ namespace Bit.Core.Utilities
Register<IUsernameGenerationService>(usernameGenerationService);
Register<IDeviceTrustCryptoService>(deviceTrustCryptoService);
Register<IPasswordResetEnrollmentService>(passwordResetEnrollmentService);
Register<IFido2AuthenticationService>(new Fido2AuthenticationService());
}
public static void Register<T>(string serviceName, T obj)