-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patches from upstream repository master branch
There are a bunch of new devices added to the white list there. Fixes QubesOS/qubes-issues#5400
- Loading branch information
Showing
11 changed files
with
284 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From fbafa8fc169f64b4a55f1d110e12420ea6436840 Mon Sep 17 00:00:00 2001 | ||
From: Venkat Venkataraju <[email protected]> | ||
Date: Thu, 16 Aug 2018 11:36:45 -0700 | ||
Subject: [PATCH 1/8] handing write failures better | ||
|
||
--- | ||
u2flib_host/hid_transport.py | 11 +++++++++-- | ||
1 file changed, 9 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index 2031405..ec97d06 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -159,6 +159,13 @@ class HIDDevice(U2FDevice): | ||
def lock(self, lock_time=10): | ||
self.call(CMD_LOCK, lock_time) | ||
|
||
+ def _write_to_device(self, to_send): | ||
+ expected = len(to_send) | ||
+ actual = 0 | ||
+ while actual != expected: | ||
+ actual = self.handle.write(to_send) | ||
+ sleep(0.025) | ||
+ | ||
def _send_req(self, cid, cmd, data): | ||
size = len(data) | ||
bc_l = int2byte(size & 0xff) | ||
@@ -166,13 +173,13 @@ class HIDDevice(U2FDevice): | ||
payload = cid + int2byte(TYPE_INIT | cmd) + bc_h + bc_l + \ | ||
data[:HID_RPT_SIZE - 7] | ||
payload += b'\0' * (HID_RPT_SIZE - len(payload)) | ||
- self.handle.write([0] + [byte2int(c) for c in payload]) | ||
+ self._write_to_device([0] + [byte2int(c) for c in payload]) | ||
data = data[HID_RPT_SIZE - 7:] | ||
seq = 0 | ||
while len(data) > 0: | ||
payload = cid + int2byte(0x7f & seq) + data[:HID_RPT_SIZE - 5] | ||
payload += b'\0' * (HID_RPT_SIZE - len(payload)) | ||
- self.handle.write([0] + [byte2int(c) for c in payload]) | ||
+ self._write_to_device([0] + [byte2int(c) for c in payload]) | ||
data = data[HID_RPT_SIZE - 5:] | ||
seq += 1 | ||
|
||
-- | ||
2.21.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
From 59f98986a7ca52c2a9823db82c08bf73082c6268 Mon Sep 17 00:00:00 2001 | ||
From: Venkat Venkataraju <[email protected]> | ||
Date: Fri, 17 Aug 2018 15:26:38 -0700 | ||
Subject: [PATCH 2/8] fix test for test_init | ||
|
||
--- | ||
test/test_hid_transport.py | 1 + | ||
u2flib_host/hid_transport.py | 7 ++++++- | ||
2 files changed, 7 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/test/test_hid_transport.py b/test/test_hid_transport.py | ||
index 26bc715..b31aeff 100644 | ||
--- a/test/test_hid_transport.py | ||
+++ b/test/test_hid_transport.py | ||
@@ -15,6 +15,7 @@ class TestHIDDevice(object): | ||
self.cmd = payload[5] ^ hid_transport.TYPE_INIT | ||
self.size = (payload[6] << 8) + payload[7] | ||
self.data = list(map(int2byte, payload[8:(8 + self.size)])) | ||
+ return len(payload) | ||
|
||
def read(self, size): | ||
self.response += [0] * (hid_transport.HID_RPT_SIZE - len(self.response) + 1) | ||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index ec97d06..e16eb20 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -159,13 +159,18 @@ class HIDDevice(U2FDevice): | ||
def lock(self, lock_time=10): | ||
self.call(CMD_LOCK, lock_time) | ||
|
||
- def _write_to_device(self, to_send): | ||
+ def _write_to_device(self, to_send, timeout=2.0): | ||
expected = len(to_send) | ||
actual = 0 | ||
+ stop_at = time() + timeout | ||
while actual != expected: | ||
+ if (time() > stop_at): | ||
+ raise exc.DeviceError("Unable to send data to the device") | ||
+ | ||
actual = self.handle.write(to_send) | ||
sleep(0.025) | ||
|
||
+ | ||
def _send_req(self, cid, cmd, data): | ||
size = len(data) | ||
bc_l = int2byte(size & 0xff) | ||
-- | ||
2.21.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From bff89a63d567d6df8c941ad588b3b2cb92fff328 Mon Sep 17 00:00:00 2001 | ||
From: Devrandom <[email protected]> | ||
Date: Sun, 20 Oct 2019 04:17:16 +0200 | ||
Subject: [PATCH 3/8] add Google Titan (Feitian) devices | ||
|
||
--- | ||
u2flib_host/hid_transport.py | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index e16eb20..20562b4 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -50,6 +50,8 @@ DEVICES = [ | ||
(0x1050, 0x0406), # YubiKey 4 U2F+CCID | ||
(0x1050, 0x0407), # YubiKey 4 OTP+U2F+CCID | ||
(0x2581, 0xf1d0), # Plug-Up U2F Security Key | ||
+ (0x096e, 0x0858), # FT U2F | ||
+ (0x096e, 0x085b), # FS ePass FIDO | ||
] | ||
HID_RPT_SIZE = 64 | ||
|
||
-- | ||
2.21.3 | ||
|
24 changes: 24 additions & 0 deletions
24
0004-Add-Feitian-Technologies-Inc.-ePass-FIDO-to-devices.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 111ed8a8fa0da001ef16c942d37edcef33f80805 Mon Sep 17 00:00:00 2001 | ||
From: Bryce Larson <[email protected]> | ||
Date: Wed, 23 Oct 2019 00:11:35 -0600 | ||
Subject: [PATCH 4/8] Add Feitian Technologies, Inc. ePass FIDO to devices | ||
|
||
--- | ||
u2flib_host/hid_transport.py | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index e16eb20..8b9a220 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -38,6 +38,7 @@ from u2flib_host.yubicommon.compat import byte2int, int2byte | ||
from u2flib_host import exc | ||
|
||
DEVICES = [ | ||
+ (0x096e, 0x0850), # Feitian Technologies, Inc. ePass FIDO | ||
(0x1050, 0x0200), # Gnubby | ||
(0x1050, 0x0113), # YubiKey NEO U2F | ||
(0x1050, 0x0114), # YubiKey NEO OTP+U2F | ||
-- | ||
2.21.3 | ||
|
36 changes: 36 additions & 0 deletions
36
0005-Add-Thetis-and-JaCarta-devices-close-36-close-39.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 91d0eb292ebf7490a1631dc7993d071401c48357 Mon Sep 17 00:00:00 2001 | ||
From: Dain Nilsson <[email protected]> | ||
Date: Wed, 6 Nov 2019 09:49:20 +0100 | ||
Subject: [PATCH 5/8] Add Thetis and JaCarta devices (close #36, close #39). | ||
|
||
--- | ||
u2flib_host/hid_transport.py | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index adff200..eef954c 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -38,7 +38,6 @@ from u2flib_host.yubicommon.compat import byte2int, int2byte | ||
from u2flib_host import exc | ||
|
||
DEVICES = [ | ||
- (0x096e, 0x0850), # Feitian Technologies, Inc. ePass FIDO | ||
(0x1050, 0x0200), # Gnubby | ||
(0x1050, 0x0113), # YubiKey NEO U2F | ||
(0x1050, 0x0114), # YubiKey NEO OTP+U2F | ||
@@ -51,8 +50,11 @@ DEVICES = [ | ||
(0x1050, 0x0406), # YubiKey 4 U2F+CCID | ||
(0x1050, 0x0407), # YubiKey 4 OTP+U2F+CCID | ||
(0x2581, 0xf1d0), # Plug-Up U2F Security Key | ||
+ (0x096e, 0x0850), # Feitian Technologies, Inc. ePass FIDO | ||
(0x096e, 0x0858), # FT U2F | ||
(0x096e, 0x085b), # FS ePass FIDO | ||
+ (0x24dc, 0x0501), # JaCarta U2F | ||
+ (0x1ea8, 0xf025), # Thetis U2F | ||
] | ||
HID_RPT_SIZE = 64 | ||
|
||
-- | ||
2.21.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From e92c3cbd840b651ed4b9c50a9797393f6d3b0c70 Mon Sep 17 00:00:00 2001 | ||
From: Saswat Padhi <[email protected]> | ||
Date: Sun, 24 Nov 2019 03:33:51 -0800 | ||
Subject: [PATCH 6/8] Added OnlyKey device | ||
|
||
--- | ||
u2flib_host/hid_transport.py | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index eef954c..4014aac 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -55,6 +55,7 @@ DEVICES = [ | ||
(0x096e, 0x085b), # FS ePass FIDO | ||
(0x24dc, 0x0501), # JaCarta U2F | ||
(0x1ea8, 0xf025), # Thetis U2F | ||
+ (0x1d50, 0x60fc), # OnlyKey U2F | ||
] | ||
HID_RPT_SIZE = 64 | ||
|
||
-- | ||
2.21.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 11ddd13557f0fe8bfa09d5b54e2427204dd58b8e Mon Sep 17 00:00:00 2001 | ||
From: Dain Nilsson <[email protected]> | ||
Date: Thu, 5 Dec 2019 13:24:46 +0100 | ||
Subject: [PATCH 7/8] Add Trezor VID/PID (close #42). | ||
|
||
--- | ||
u2flib_host/hid_transport.py | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py | ||
index 4014aac..f7f71ca 100644 | ||
--- a/u2flib_host/hid_transport.py | ||
+++ b/u2flib_host/hid_transport.py | ||
@@ -56,6 +56,7 @@ DEVICES = [ | ||
(0x24dc, 0x0501), # JaCarta U2F | ||
(0x1ea8, 0xf025), # Thetis U2F | ||
(0x1d50, 0x60fc), # OnlyKey U2F | ||
+ (0x1209, 0x53c1), # Trezor U2F/FIDO2 | ||
] | ||
HID_RPT_SIZE = 64 | ||
|
||
-- | ||
2.21.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 27dc866368f96f071c9edb3ba90bd628f14ad21c Mon Sep 17 00:00:00 2001 | ||
From: Dain Nilsson <[email protected]> | ||
Date: Thu, 5 Dec 2019 13:29:39 +0100 | ||
Subject: [PATCH 8/8] Add reference to python-fido2 in README. | ||
|
||
--- | ||
README | 6 ++++-- | ||
1 file changed, 4 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/README b/README | ||
index 56a02dd..478522c 100644 | ||
--- a/README | ||
+++ b/README | ||
@@ -1,6 +1,8 @@ | ||
== u2flib-host == | ||
Provides library functionality for communicating with a U2F device over USB. | ||
|
||
+# NOTE: This project is superseded by https://github.com/Yubico/python-fido2 | ||
+ | ||
Two executables are provided, u2f-register and u2f-authenticate, which support | ||
the register and authenticated commands of U2F as defined in the | ||
http://fidoalliance.org/specifications/download[FIDO specifications]. | ||
@@ -58,8 +60,8 @@ for device in devices: | ||
|
||
==== Executable use ==== | ||
The examples below use the soft U2F device to register and authenticate against | ||
-the u2f_server example server from the | ||
-http://developers.yubico.com/python-u2flib-server[python-u2flib-server] project. | ||
+the u2f_server example server from the | ||
+http://developers.yubico.com/python-u2flib-server[python-u2flib-server] project. | ||
See that project for more details. | ||
The register step will create a new U2F key pair and store the credential in | ||
the soft_device.json file. The authenticate step will use this credential to | ||
-- | ||
2.21.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
0001-handing-write-failures-better.patch | ||
0002-fix-test-for-test_init.patch | ||
0003-add-Google-Titan-Feitian-devices.patch | ||
0004-Add-Feitian-Technologies-Inc.-ePass-FIDO-to-devices.patch | ||
0005-Add-Thetis-and-JaCarta-devices-close-36-close-39.patch | ||
0006-Added-OnlyKey-device.patch | ||
0007-Add-Trezor-VID-PID-close-42.patch | ||
0008-Add-reference-to-python-fido2-in-README.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters