From 9ccb472c7aac81a448c724f2edc9cd10b1e4e637 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 14 Jan 2020 12:31:10 +0900 Subject: [PATCH] Fix U2F --- BTCPayServer/U2F/U2FService.cs | 7 ++++--- Build/Version.csproj | 2 +- btcpayserver.sln | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/BTCPayServer/U2F/U2FService.cs b/BTCPayServer/U2F/U2FService.cs index e5d82b788..da8c42bf8 100644 --- a/BTCPayServer/U2F/U2FService.cs +++ b/BTCPayServer/U2F/U2FService.cs @@ -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; diff --git a/Build/Version.csproj b/Build/Version.csproj index 819faf265..0427c21c5 100644 --- a/Build/Version.csproj +++ b/Build/Version.csproj @@ -1,5 +1,5 @@ - 1.0.3.147 + 1.0.3.148 diff --git a/btcpayserver.sln b/btcpayserver.sln index ddbd0b626..8f134c67a 100644 --- a/btcpayserver.sln +++ b/btcpayserver.sln @@ -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