This commit is contained in:
nicolas.dorier
2020-01-14 12:31:10 +09:00
parent c35afd5e9a
commit 9ccb472c7a
3 changed files with 6 additions and 5 deletions

View File

@@ -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;

View File

@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.0.3.147</Version>
<Version>1.0.3.148</Version>
</PropertyGroup>
</Project>

View File

@@ -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