Git Product home page Git Product logo

nitrokey-websmartcard-rust's Introduction

Nitrokey Webcrypt Rust

This is a Nitrokey Webcrypt Rust-rewrite. See https://github.com/Nitrokey/nitrokey-webcrypt for the documentation of the commands and protocol.

Running UDP Simulation

cargo run --example udp_sim

To show logs:

env RUST_BACKTRACE=full RUST_LOG=debug run --example udp_sim --features enable-logs

Tests are here:

Running USB-IP Simulation

Check out nitrokey-webcrypt-usbip project for the USB-IP simulation:

Running on a hardware

Here is a working Nitrokey Webcrypt on a Nitrokey 3 firmware:

nitrokey-websmartcard-rust's People

Contributors

robin-nitrokey avatar sosthene-nitrokey avatar szszszsz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

nitrokey-websmartcard-rust's Issues

Initial review feedback

  • Why is everything in a lib directory and not directly in src?
  • Please run cargo clippy
  • use standard Rust idioms. For example the ERROR_ID) enum should be called Error, with PascalCase variants, and no need for the ERR prefix in each variant.
  • The default PIN should probably be 123456 and not 1234 for consistency with other apps
  • Why re-export heapless and heapless-bytes?
  • You import serde_cbor but don't use it
  • Not a fan of adding the peek method to ctaphid_dispatch just for that, but I'm not sure how we could do differently. It should also IMHO be documented why exactly it is there. The dispatch crates already support multiple apps, so the commit names are not clear. Thinking about it, could this be made as a form of "middleware" or a wrapper around the FIDO app? That way ctaphid_dispatch stays "clean"? -> We will talk about it in the trussed steering call
  • __MAX_SIZE: You can use #[doc(hidden)] instead of prefixing with __
  • Please use pub use transport::Webcrypt. Type alias don't show up properly in doc
  • Is the dependency on git-version really necessary? Can't we just use env!("CARGO_PKG_VERSION")?
  • You can get rid of the min helper by using value1.min(value2)
  • Please move the cbor helper to the helper module
  • Is having a send_input_to_output really necessary if it's only used for one (debug) command?
  • Please use constants to document "magic values" (for example why 3 in send_input_to_output?)
  • It might be good to have a WebcryptClient trait that unites all the trait bounds, which are a bit verbose.
  • Have you tested the OpenPGP import functionality? unsafe_inject_shared_key Doesn't work with anything other than symmetric keys.
  • Wouldn't we be better off reusing opcard somehow for the OpenPGP stuff? I think users would expect to be able to use their "native" openpgp keys with wecrypt. If no I don't see why the OpenPGP compatibility can't be built into the JS side.
  • In command.rs, a comment mention ChaCha20 but ChaCha8 is used

Edit: remaking this ticket into a task list

Running tests hang

$ pipenv run pytest test_comm.py
================================================ test session starts =================================================
platform linux -- Python 3.11.5, pytest-7.4.3, pluggy-1.3.0
rootdir: /mnt/bigdrive/soso-nitrokey/Code/nitrokey-websmartcard-tests
configfile: pytest.ini
plugins: reporter-0.5.2, repeat-0.9.3, reporter-html1-0.8.3
collected 71 items                                                                                                   

test_comm.py .

Then the test hang, even if the device is detached (tested with usbip).

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.