aboutsummaryrefslogtreecommitdiff
path: root/src/device.rs
Commit message (Collapse)AuthorAge
* Add support for encrypted volumeRobin Krahl2018-06-07
| | | | | | | | | | | | | | | | | This patch adds support for the commands to enable or disable the encrypted volume on the Nitrokey Storage. To test these commands, the output of lsblk is parsed for the device model “Nitrokey Storage”. This is not perfect but seems to be the best solution for automated testing. As the effect of enabling and disabling volumes is not immediate, a delay of two seconds is added to the tests before checking lsblk. This is sufficient on my machine, yet it would be better to have a portable version of this check. This patch also adds a lock method to Device that executes the lock_device command. This command was previously only used to close the password safe. On the Nitrokey Storage, it also disables the encrypted and hidden volume.
* Add support for unlock_user_password commandRobin Krahl2018-05-31
|
* Fix formatting issuesRobin Krahl2018-05-31
|
* Add Authenticate to the common traits extended by DeviceRobin Krahl2018-05-29
| | | | | Authenticate is supported by both the Nitrokey Pro and the Nitrokey Storage. Therefore Device should extend it.
* Add support for password safesRobin Krahl2018-05-29
| | | | | | | | | A password safe (PWS) stores names, logins and passwords in slots. PWS are supported both by the Nitrokey Pro and the Nitrokey Storage. They are implemented as a struct wrapping a device as the device may not be disconnected while the password safe is alive. The creation of a password safe is handled by the GetPasswordSafe trait, implemented by DeviceWrapper, Pro and Storage.
* Add rudimentary support for the Nitrokey StorageRobin Krahl2018-05-29
| | | | | This patch adds the Storage struct and the test-storage feature. It also enables all currently supported Pro commands for the Storage.
* Move Admin, User and Authenticate to auth moduleRobin Krahl2018-05-28
|
* Restructure trait implementations for wrappersRobin Krahl2018-05-28
| | | | | | | For DeviceWrapper, the traits GenerateOtp and Device are now directly implemented instead of complicated template implementations. For User and Admin, the wrapper implementations are replaced with an implementation of the Deref trait for easier access.
* Move set_time from Device to GenerateOtpRobin Krahl2018-05-28
| | | | | | The set_time operation is only used with TOTP generation. Therefore it makes more sense to have it in the GenerateOtp trait than in the Device trait.
* Remove duplicated documentation commentRobin Krahl2018-05-28
| | | | | | The defnition of the ConfigureOtp trait already contains documentation comments, therefore the comments in the implementation for User<T> can be removed.
* Rewrap documentation comments to 100 charactersRobin Krahl2018-05-28
|
* Introduce DeviceWrapper to abstract over devicesRobin Krahl2018-05-28
| | | | | | | DeviceWrapper abstracts over the supported devices. It implements the traits that are implemented by all supported devices. The previous UnauthenticatedDevice is renamed to Pro to prepare Storage support. connect_model is moved to Pro::connect.
* Move the authenticate methods to a new Authenticate traitRobin Krahl2018-05-22
|
* Add an example for setting the current timeRobin Krahl2018-05-22
| | | | | The example uses the chrono crate and can therefore not be executed, but at least it shows how to set the Nitrokey device to the current time.
* Restructure code by functionalityRobin Krahl2018-05-22
In future versions, we want to support not only the Nitrokey Pro, but also the Nitrokey Storage. This requires a better code layout. This patch introduces two main changes: First, the OTP-specific methods are moved from the Device trait and the AdminAuthenticatedDevice struct to the functionality-based traits ConfigureOtp and GenerateOtp. This will hopefully make it easier to integrate the Nitrokey Storage. Secondly, the code is split into separate modules. These modules are currently all private and re-exported in the lib module, but we can consider making them public in the future.