Skip to content

canokeys/canokey-ffs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canokey FunctionFS

FunctionFS is a Linux kernel feature that allows you to run a program in userspace and expose the whole device as a USB device.

For example, you can turn your RPi (RPi4/Pi Zero have UDC) into a CanoKey, or you can use usbip-vudc to expose a CanoKey at tcp port 3240, then other machine can connect to it via USB/IP (similar to canokey-usbip).

This is only for testing purpose and there is no warranty on security.

Compile

mkdir build; cd build
cmake ..
make -j`nproc`

Run

First you need to ensure you have a UDC, either virtual (usbip-vudc) or real (dwc2). You can modprobe them and check that /sys/class/udc is not empty.

Then you need to setup ConfigFS, there are two ways

  1. Use ffs.sh to manually setup all via configfs
  2. Use gt, see ffs.scheme. You can use this blog as tutorial.

Then mount the file system (you can use path other than /srv/canokey)

mount -t functionfs canokey /srv/canokey

Now you can see ep0 in /srv/canokey, then you should run canokey-ffs inside FunctionFS like this

cd /srv/canokey
/path/to/your/canokey-ffs

Known limitation

WebUSB does not work as WebUSB needs USB 2.1 (BOS descriptor) but ConfigFS does not support it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published