mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-22 06:34:36 +01:00
Fix U2F
This commit is contained in:
@@ -109,7 +109,7 @@ namespace BTCPayServer.U2F
|
||||
using (var context = _contextFactory.CreateContext())
|
||||
{
|
||||
var duplicate = context.U2FDevices.Any(device =>
|
||||
device.ApplicationUserId.Equals(userId, StringComparison.InvariantCulture) &&
|
||||
device.ApplicationUserId == userId &&
|
||||
device.KeyHandle.Equals(registration.KeyHandle) &&
|
||||
device.PublicKey.Equals(registration.PublicKey));
|
||||
|
||||
@@ -120,6 +120,7 @@ namespace BTCPayServer.U2F
|
||||
|
||||
await context.U2FDevices.AddAsync(new U2FDevice()
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
AttestationCert = registration.AttestationCert,
|
||||
Counter = Convert.ToInt32(registration.Counter),
|
||||
Name = name,
|
||||
@@ -146,8 +147,8 @@ namespace BTCPayServer.U2F
|
||||
{
|
||||
var keyHandle = authenticateResponse.KeyHandle.Base64StringToByteArray();
|
||||
var device = await context.U2FDevices.Where(fDevice =>
|
||||
fDevice.ApplicationUserId.Equals(userId, StringComparison.InvariantCulture) &&
|
||||
fDevice.KeyHandle.SequenceEqual(keyHandle)).SingleOrDefaultAsync();
|
||||
fDevice.ApplicationUserId == userId &&
|
||||
fDevice.KeyHandle == keyHandle).SingleOrDefaultAsync();
|
||||
|
||||
if (device == null)
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>1.0.3.147</Version>
|
||||
<Version>1.0.3.148</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -11,10 +11,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{29290EC7-0
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
amd64.Dockerfile = amd64.Dockerfile
|
||||
arm32v7.Dockerfile = arm32v7.Dockerfile
|
||||
arm64v8.Dockerfile = arm64v8.Dockerfile
|
||||
Build\Common.csproj = Build\Common.csproj
|
||||
.circleci\config.yml = .circleci\config.yml
|
||||
docker-entrypoint.sh = docker-entrypoint.sh
|
||||
linuxarm64v8.Dockerfile = linuxarm64v8.Dockerfile
|
||||
Build\Version.csproj = Build\Version.csproj
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
||||
Reference in New Issue
Block a user