Watch
1
0
Fork
You've already forked PassKeeZ
0
mirror of https://codeberg.org/r4gus/PassKeeZ.git synced 2026-11-17 03:20:30 +00:00
1 Raspberry Pi Pico W 2 as Roaming Authenticator
David Sugar edited this page 2026-02-06 14:23:02 +01:00

WIP

Configuration

The first step is to configure the Raspberry Pi Pico W 2 as a USB gadget.

  1. Append dtoverlay=dwc2 to the end of /boot/firmware/config.txt
  2. Create a new file /etc/modules-load.d/usb.conf and add the following:
dwc2
libcomposite
  1. Create a new file /usr/bin/passkeez_usb and make it executable:
sudo touch /usr/bin/passkeez_usb
sudo chmod +x /usr/bin/passkeez_usb
  1. Append the following to /usr/bin/passkeez_usb:
#!/bin/bash
cd /sys/kernel/config/usb_gadget/
mkdir -p passkeez
cd passkeez

echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2

mkdir -p strings/0x409
echo "70 61 73 73 6b 65 65 7a 2d 30 30 2e 30 30 2e 30 31" > strings/0x409/serialnumber # passkeez-00.00.01
echo "David P. Sugar (r4gus)" > strings/0x409/manufacturer
echo "PassKeeZ USB Passkey Dongle" > strings/0x409/product

mkdir -p configs/c.1/strings/0x409
echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower

# Add functions here
mkdir -p functions/hid.usb0
echo 1 > functions/hid.usb0/protocol
echo 1 > functions/hid.usb0/subclass
echo 8 > functions/hid.usb0/report_length
echo -ne \\x06\\xD0\\xF1\\x09\\x01\\xA1\\x01\\x09\\x20\\x15\\x00\\x26\\xFF\\x00\\x75\\x08\\x95\\x40\\x81\\x02\\x09\\x21\\x15\\x00\\x26\\xFF\\x00\\x75\\x08\\x95\\x40\\x91\\x02\\xC0 > functions/hid.usb0/report_desc # https://nodeloop.org/tools/hid-report-descriptor-tool?d=BtDxCQGhAQkgFQAm_wB1CJVAgQIJIRUAJv8AdQiVQJECwA
ln -s functions/hid.usb0 configs/c.1/
# End functions

ls /sys/class/udc > UDC
  1. Create a new systemd service /etc/systemd/system/passkeez_usb.service:
[Unit]
Description=PassKeeZ USB device startup script
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
WorkingDirectory=/
ExecStart=/usr/bin/passkeez_usb
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
  1. Enable the service sudo systemctl enable passkeez_usb.service
  2. Restart

After the restart you should find the following folder on the system: /sys/kernel/config/usb_gadget/passkeez/. When listing connected USB devices on your host (e.g. by running ioreg -p IOUSB on macos) one should see a connected PassKeeZ USB Passkey Dongle.