45 lines
1.6 KiB
Diff
45 lines
1.6 KiB
Diff
From aab75172b1f174daf68c401b6e350f994f14fad1 Mon Sep 17 00:00:00 2001
|
|
From: luoqing <luoqing@kylinsec.com.cn>
|
|
Date: Mon, 12 Jun 2023 15:23:30 +0800
|
|
Subject: [PATCH] fix(ukey):Fix the issue of duplicate binding of the same UKey
|
|
device
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
- 修复同一个UKey设备可以重复绑定的问题
|
|
|
|
Related #I78P3F
|
|
---
|
|
src/device/ukey/ukey-ft-device.cpp | 1 +
|
|
src/feature-db.cpp | 1 +
|
|
2 files changed, 2 insertions(+)
|
|
|
|
diff --git a/src/device/ukey/ukey-ft-device.cpp b/src/device/ukey/ukey-ft-device.cpp
|
|
index e8f5070..14f09ef 100644
|
|
--- a/src/device/ukey/ukey-ft-device.cpp
|
|
+++ b/src/device/ukey/ukey-ft-device.cpp
|
|
@@ -210,6 +210,7 @@ ULONG UKeyFTDevice::createContainer(const QString &pin, DEVHANDLE devHandle, HAP
|
|
bool UKeyFTDevice::isExistBinding()
|
|
{
|
|
QStringList featureIDs = FeatureDB::getInstance()->getFeatureIDs(deviceInfo().idVendor, deviceInfo().idProduct, deviceType(), deviceSerialNumber());
|
|
+ KLOG_DEBUG() << "Existing Binding featureIDs:" << featureIDs;
|
|
for (auto id : featureIDs)
|
|
{
|
|
FeatureInfo info = FeatureDB::getInstance()->getFeatureInfo(id);
|
|
diff --git a/src/feature-db.cpp b/src/feature-db.cpp
|
|
index a8aa883..6cf8735 100644
|
|
--- a/src/feature-db.cpp
|
|
+++ b/src/feature-db.cpp
|
|
@@ -166,6 +166,7 @@ QStringList FeatureDB::getFeatureIDs(const QString &idVendor, const QString &idP
|
|
sql.append(" AND deviceSerialNumber = :serialNumber");
|
|
}
|
|
|
|
+ query.prepare(sql);
|
|
query.bindValue(":Vid", idVendor);
|
|
query.bindValue(":Pid", idProduct);
|
|
query.bindValue(":devType", (int)deviceType);
|
|
--
|
|
2.33.0
|
|
|