From 0523b49c72c0c4ec06fd67e73db1ef8ae2e59431 Mon Sep 17 00:00:00 2001 From: Michael Kuc Date: Wed, 26 Jun 2019 17:05:13 +0100 Subject: [PATCH] Added .report_length explanation. --- Readme.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 392211b..b2533c2 100644 --- a/Readme.md +++ b/Readme.md @@ -341,6 +341,23 @@ Run `make CROSS_COMPILE=`, using the cross-compiler-prefi # Warnings +## Logical issues + +This project requests a 512-byte USB HID packet size. This contravenes the specification, +which states that 64 bytes should be used instead. This was chosen as, at least on the test +hardware, it was found that perfect multiples of the packet size caused packets to be +cached, and the device unable to read them, until four times the packet size was sent. + +As a result, by maximising the packet size, unless a message of 512, 1024, 1536, ... +bytes needs to be sent, this caching issue will not arise. This obviously has a reduced +probability of occurring than with a 64-byte packet size. Additionally, 512 bytes is the +maximum limit of packet size on USB Version 2.0. Therefore, it cannot be made any larger. + +If this issue does not arise with your hardware (i.e., you change `.report_length = 512` +in `drivers/usb/gadget/f_hid_android_u2f.c` to `.report_length = 64`, and U2F still works +after you reinstall the kernel), this is probably even better, and more compatible with +client U2F libraries. + ## Security issues This project is intended solely for the use in experimentation of the use of @@ -374,10 +391,6 @@ See the [`Readme.AttestationCertificateGeneration.txt`](Readme.AttestationCertif # Running the program -## To run - -Run `sudo systemctl start U2FDevice.service` - At this point, the program should be tested using U2F demo websites. For example, [Yubico's U2F demo](https://demo.yubico.com/u2f?tab=register), [Yubico's WebAuthn demo](https://demo.yubico.com/webauthn-technical/registration),