Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --usb-path option to select device #122

Closed
wants to merge 5 commits into from

Conversation

robinkrahl
Copy link
Collaborator

This patch adds the --usb-path option as an additional way to filter the
Nitrokey device to connect to. While the serial number is a better
identifier in theory, the Nitrokey Storage devices do not send their
serial number in the USB device descriptor. Having the --usb-path
options allows users to select one of multiple Nitrokey Storage devices.

While we could directly call the nitrokey::Manager::connect_path
function with the specified path, we integrate the --usb-path option
into the existing find_device function for consistent error messages and
to avoid having to duplicate the --model and --serial-number checks.

This patch adds the --usb-path option as an additional way to filter the
Nitrokey device to connect to.  While the serial number is a better
identifier in theory, the Nitrokey Storage devices do not send their
serial number in the USB device descriptor.  Having the --usb-path
options allows users to select one of multiple Nitrokey Storage devices.

While we could directly call the nitrokey::Manager::connect_path
function with the specified path, we integrate the --usb-path option
into the existing find_device function for consistent error messages and
to avoid having to duplicate the --model and --serial-number checks.
Copy link
Owner

@d-e-s-o d-e-s-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request, Robin! I have a few minor comments/questions.

doc/nitrocli.1 Show resolved Hide resolved
doc/nitrocli.1 Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
src/commands.rs Outdated Show resolved Hide resolved
src/tests/run.rs Show resolved Hide resolved
For consistency with the --usb-path option, this path renames the device
path column in the output of the list command to USB path.
@robinkrahl
Copy link
Collaborator Author

Thanks for the review! I added fixes for all issues.

@d-e-s-o d-e-s-o self-assigned this Sep 9, 2020
@d-e-s-o
Copy link
Owner

d-e-s-o commented Sep 9, 2020

Thanks for the review! I added fixes for all issues.

I'll merge it later today. Thanks!

@d-e-s-o
Copy link
Owner

d-e-s-o commented Sep 9, 2020

All in now! Thanks again Robin!

@d-e-s-o d-e-s-o closed this Sep 9, 2020
@robinkrahl robinkrahl deleted the usb-path branch September 10, 2020 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants