Giter VIP home page Giter VIP logo

nitrokey-websmartcard-usbip's Introduction

USB/IP Simulation for Webcrypt

This is a modified USB/IP runner to use Nitrokey Webcrypt as an additional CTAP application. It is based on the older implementation of the PC USB/IP runner:

See nitrokey-webcrypt tag on GitHub for the associated projects:

Original README follows.


This runner allows using USB/IP as a means to simulate device connection to the OS, and should allow faster development of the embedded applications.

Platform and storage implementations are taken from the Trussed tutorial:

Remarks:

  • At the moment FIDO app only (to be extended with Admin and Provision apps);
  • Works with Chromium and pynitrokey (with a patched fido2.hid module) [2];
  • Written length returns "1", which confuse client HID applications (Chromium shows error in logs, but ignores it; pynitrokey fails);
  • It is not possible to set the FIDO certificate, thus x5c response is empty;
  • Does not work with Firefox at the moment;
  • Requires multiple usbip attach calls to make it work [1].

[1] https://github.com/Sawchord/usbip-device#known-bugs

[2] The change is rather simple: replace raise OSError("failed to write entire packet") with pass in FileCtapHidConnection.write_packet in fido2โ€™s hid/base.py. The patch is provided at [3].

[3] ./fido2-patch/0001-Ignore-difference-between-the-sent-data-size-and-rep.patch

Setup

USB/IP tools are required to work, as well as kernel supporting it.

On Fedora these could be installed with:

make setup-fedora

Run

Simulation starts USB/IP server, which can be connected to with the USB/IP tools.

  1. Make sure vhci-hcd module is loaded
  2. Run simulation app
  3. Attach to the simulated device (2 times if needed)

This series of steps is scripted in the Makefile, thus it is sufficient to call:

make 

Stop execution with:

make stop

Warning: in some cases simulation can sometimes cause kernel faults, which makes the system it is running unstable.

nitrokey-websmartcard-usbip's People

Contributors

szszszsz avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.