Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keyboard HID interface to Solo #446

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rgerganov
Copy link
Contributor

This patch adds a keyboard HID interface to the existing FIDO2 HID
interface. It allows injecting keystokes into the host when the Solo
button is pressed. For now it injects the hardcoded sequence "1234".

The new interface is enabled with the ENABLE_KBD macro. Right now it
doesn't work with the other additional interfaces (CCID and CDC).
Advertising a random combination of USB interfaces (FIDO2, kbd, CCID,
CDC) requires more work and could be addressed in the future.

Issue: #354

@rgerganov
Copy link
Contributor Author

My plan for moving this forward is to implement a CTAP vendor command (similar to PR #397) for programming a static sequence of keystrokes and then implement the corresponding support in solo-python.
If anyone with Solo Hacker key want to give this a try, these are the steps:

  1. download the PR
  2. uncomment #define ENABLE_KBD in targets/stm32l432/src/app.h
  3. make docker-build-all (building the debug versions of the firmware will fail, this is fine)
  4. solo program builds/firmware-4.0.0-11-<commit_hash>.hex

This patch adds a keyboard HID interface to the existing FIDO2 HID
interface. It allows injecting keystokes into the host when the Solo
button is pressed. For now it injects the hardcoded sequence "1234".

The new interface is enabled with the ENABLE_KBD macro. Right now it
doesn't work with the other additional interfaces (CCID and CDC).
Advertising a random combination of USB interfaces (FIDO2, kbd, CCID,
CDC) requires more work and could be addressed in the future.

Issue: solokeys#354
The command value is 0x51 and it accepts a single argument which is a
byte string.
@rgerganov
Copy link
Contributor Author

I have added a new solo-python command (solokeys/solo1-cli#84) for programming the keyboard interface. It works like this:

$ solo key keyboard 'hello, world!'

and then when you press the solo button it emits hello, world!

Demo here: https://twitter.com/rgerganov/status/1272817902496944128

@aozq aozq mentioned this pull request Jun 30, 2020
@My1
Copy link
Contributor

My1 commented Jul 14, 2020

My plan for moving this forward is to implement a CTAP vendor command

you might wanna add an extra element to getinfo tho because devices should have a way to know what of these commands are possible.

@slurdge
Copy link

slurdge commented Aug 29, 2022

I've tried this PR. I could apply the patch on 4.1.5, and can now use the keyboard command on a SOMU, however pressing the button does not send the keys, either on Windows or Linux. However I do see an additional keyboard when I connect the key. Is there anything additional that I should check ?

On Linux I see this appearing when connecting the key:

[ 4383.331968] usb 3-2: new full-speed USB device number 11 using xhci_hcd
[ 4383.673862] usb 3-2: New USB device found, idVendor=0483, idProduct=a2ca, bcdDevice= 1.00
[ 4383.673879] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4383.673890] usb 3-2: Product: Solo 4.1.5-4-gdaab393
[ 4383.673901] usb 3-2: Manufacturer: SoloKeys
[ 4383.673923] usb 3-2: SerialNumber: <redacted>
[ 4383.682358] hid-generic 0003:0483:A2CA.000B: hiddev0,hidraw2: USB HID v1.11 Device [SoloKeys Solo 4.1.5-4-gdaab393] on usb-0000:03:00.0-2/input0
[ 4383.686271] input: SoloKeys Solo 4.1.5-4-gdaab393 as /devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb3/3-2/3-2:1.1/0003:0483:A2CA.000C/input/input9
[ 4383.745101] hid-generic 0003:0483:A2CA.000C: input,hidraw3: USB HID v1.11 Keyboard [SoloKeys Solo 4.1.5-4-gdaab393] on usb-0000:03:00.0-2/input1

Using the key as normal still works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants