mirror of
https://github.com/bitwarden/mobile
synced 2026-01-18 00:13:16 +00:00
[PM-5731] feat: add first test
This commit is contained in:
@@ -7,12 +7,14 @@ namespace Bit.Core.Services
|
||||
{
|
||||
public Task<Fido2AuthenticatorGetAssertionResult> GetAssertionAsync(Fido2AuthenticatorGetAssertionParams assertionParams)
|
||||
{
|
||||
throw new NotAllowedError();
|
||||
|
||||
// TODO: IMPLEMENT this
|
||||
return Task.FromResult(new Fido2AuthenticatorGetAssertionResult
|
||||
{
|
||||
AuthenticatorData = new byte[32],
|
||||
Signature = new byte[8]
|
||||
});
|
||||
// return Task.FromResult(new Fido2AuthenticatorGetAssertionResult
|
||||
// {
|
||||
// AuthenticatorData = new byte[32],
|
||||
// Signature = new byte[8]
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
src/Core/Utilities/Fido2/Fido2AuthenticatorException.cs
Normal file
16
src/Core/Utilities/Fido2/Fido2AuthenticatorException.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Bit.Core.Utilities.Fido2
|
||||
{
|
||||
public class Fido2AuthenticatorException : Exception
|
||||
{
|
||||
public Fido2AuthenticatorException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class NotAllowedError : Fido2AuthenticatorException
|
||||
{
|
||||
public NotAllowedError() : base("NotAllowedError")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,22 +33,22 @@ namespace Bit.iOS.Autofill
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Generate the credential Signature and Auth data accordingly
|
||||
var fido2AssertionResult = await _fido2AuthService.Value.GetAssertionAsync(new Bit.Core.Utilities.Fido2.Fido2AuthenticatorGetAssertionParams
|
||||
{
|
||||
RpId = cipherView.Login.MainFido2Credential.RpId,
|
||||
Counter = cipherView.Login.MainFido2Credential.Counter,
|
||||
CredentialId = cipherView.Login.MainFido2Credential.CredentialId
|
||||
});
|
||||
// // TODO: Generate the credential Signature and Auth data accordingly
|
||||
// var fido2AssertionResult = await _fido2AuthService.Value.GetAssertionAsync(new Bit.Core.Utilities.Fido2.Fido2AuthenticatorGetAssertionParams
|
||||
// {
|
||||
// RpId = cipherView.Login.MainFido2Credential.RpId,
|
||||
// Counter = cipherView.Login.MainFido2Credential.Counter,
|
||||
// CredentialId = cipherView.Login.MainFido2Credential.CredentialId
|
||||
// });
|
||||
|
||||
CompleteAssertionRequest(new ASPasskeyAssertionCredential(
|
||||
cipherView.Login.MainFido2Credential.UserHandle,
|
||||
cipherView.Login.MainFido2Credential.RpId,
|
||||
NSData.FromArray(fido2AssertionResult.Signature),
|
||||
_context.PasskeyCredentialRequest?.ClientDataHash,
|
||||
NSData.FromArray(fido2AssertionResult.AuthenticatorData),
|
||||
cipherView.Login.MainFido2Credential.CredentialId
|
||||
));
|
||||
// CompleteAssertionRequest(new ASPasskeyAssertionCredential(
|
||||
// cipherView.Login.MainFido2Credential.UserHandle,
|
||||
// cipherView.Login.MainFido2Credential.RpId,
|
||||
// NSData.FromArray(fido2AssertionResult.Signature),
|
||||
// _context.PasskeyCredentialRequest?.ClientDataHash,
|
||||
// NSData.FromArray(fido2AssertionResult.AuthenticatorData),
|
||||
// cipherView.Login.MainFido2Credential.CredentialId
|
||||
// ));
|
||||
}
|
||||
|
||||
public void CompleteAssertionRequest(ASPasskeyAssertionCredential assertionCredential)
|
||||
|
||||
Reference in New Issue
Block a user