GithubHelp home page GithubHelp logo

xaptum / tpm-proxy Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 39 KB

Kernel driver and USB gadget to expose a router card TPM on the host

License: GNU General Public License v2.0

Makefile 0.72% CMake 1.83% C 97.45%

tpm-proxy's People

Contributors

drbild avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zousenming

tpm-proxy's Issues

Use correct USB product ID

The 8B01 USB product id is reserved for the XAP-RC-001 router card. Let's use pid 7B01 for a TPM proxy device.

See our Master USB Product IDs sheet for details.

  • change PID in gadget driver to 7B01
  • change PID in host driver to 7B01.

Increase max transfer size for USB

Each TPM request or response (i.e., read or write from the device file) can be up to 4096 bytes long (in the Linux implementation). Currently the proxy artificially restricts this to 512 bytes (dev->bulk_in_size). We should lift this restriction.

  • Increase USBG_READ_MAX in gadget/tpm-proxy.h to 4096.
  • Replace min(dev->bulk_in_size, count) with just count in in host/tpmproxy-core.c.

Background

Why is the initial 512 limit there?

A USB bulk transfer consists of a sequence of packets. For USB 2.0, each packet is limited to 512 bytes. It's likely that this was assumed to be the limit for a transfer as well.

However, a transfer can be much larger (up to 2 GiB at least on 64-bit Linux). The Linux kernel bulk interfaces (host and gadget) operate on transfers, not packets, so the 512 byte packet limit is not relevant.

Further reading: https://stackoverflow.com/a/48982843

Change TPM device name prefix

Currently the TPM device is exposed on the host as a device file named /dev/rc_tpmX, where X is some integer.

Since we're calling this functionality "proxy TPM", I think the files should be named /dev/tpmpX. This fits with the in-kernel convention for resource-managed TPMs, which are exposed as /dev/tpmrmX.

  • change the device class name from rc_tpm to tpmp

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.