summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Merge branch 'hotfix-0.5.2' into nextRobin Krahl2020-01-28
|\
| * Release v0.5.2v0.5.2Robin Krahl2020-01-28
| | | | | | | | | | This patch release makes the handling of the randomly generated temporary passwords more robust.
| * Regenerate temporary passwords with null bytesRobin Krahl2020-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we silently cut off temporary passwords that contained a null byte. With the change to CString, we returned a LibraryError instead. With this patch, we change to generate_password function to continue generating passwords until we have a password without a null byte. The chance of generating a password with a null byte is ca. 10 % for our temporary password with 25 characters. Therefore the chance of having to re-generate the password multiple times is low enough that we don’t bother with re-generating only the null bytes of the password for the time being. This should be improved in the future.
| * Remove AuthenticatedDevice::temp_password_ptrRobin Krahl2020-01-28
| | | | | | | | | | | | | | | | We introduced the AuthenticatedDevice::temp_password_ptr function to reduce the number of casts needed in our code base. Since we switched from Vec<u8> to CString, we no longer have to cast the return value of as_ptr. Therefore we can remove the temp_password_ptr function to reduce code complexity.
| * Use CString to store temporary passwordsRobin Krahl2020-01-28
| | | | | | | | | | | | | | This patch changes the generate_password function and the User and Admin structs to use a CString instead of a Vec<u8> when storing temporary passwords. This makes sure that the strings that are passed to the C API are properly null-terminated.
| * Merge branch 'release-0.5.1'Robin Krahl2020-01-15
| |\
| * \ Merge branch 'release-0.5.0'Robin Krahl2020-01-14
| |\ \
| * \ \ Merge branch 'release-0.4.0'Robin Krahl2020-01-02
| |\ \ \
| * \ \ \ Merge branch 'hotfix-0.3.5'Robin Krahl2019-12-16
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch release changes the nitrokey-sys version specification to fix a compilation error if nitrokey-sys v3.5.0 is selected (which was legal with the previous specification).
* | | | | | Always store serial numbers as integersRobin Krahl2020-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consistently uses u32 integers to store and return the serial number of a Nitrokey device. This makes it easier to convert and compare the serial number, as it is a unique representation and as formatting an integer cannot fail. For more details, see this RFC: https://lists.sr.ht/~ireas/nitrokey-rs-dev/%3C20200126074816.GA1314%40ireas.org%3E
* | | | | | Add String value to the Error::UnexpectedError variantRobin Krahl2020-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make debugging of unexpected errors easier, this patch adds an associated String value with a description of the unexpected behavior to the UnexpectedError variant of the Error enum.
* | | | | | Merge branch 'release-0.5.1' into nextRobin Krahl2020-01-15
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | |
| * | | | | Release v0.5.1v0.5.1Robin Krahl2020-01-15
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | This patch release contains a fix for the serial number formatting in the list_devices function for Nitrokey Pro devices with firmware versions older than 0.9.
* | | | | Fix serial number for older Nitrokey Pro in list_devicesRobin Krahl2020-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we assumed that the serial number returned by hidapi contains the Nitrokey serial number as the least significant bytes. As disussed here [0], this is not true for Nitrokey Pro devices with firmware version 0.8 or older: They write the serial number to the most significant bytes instead. This patch update the get_hidapi_serial_number function so that list_devices now returns the correctly formatted and truncated serial number for all Nitrokey Pro devices. It also makes sure that the serial number is lowercase to be consistent with libnitrokey’s formatting.
* | | | | Fix link to examples in READMERobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs.rs seems to support only versioned links to source files. This patch replaces the link to docs.rs with a link to git.ireas.org to avoid having to update the link with every release. (Note that the last release already contained a link to the wrong version.)
* | | | | Fix license identifier in examples/*.rsRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the invalid license identifier CC-0 with the correct identifier CC0-1.0.
* | | | | Merge branch 'release-0.5.0' into nextRobin Krahl2020-01-14
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Release v0.5.0v0.5.0Robin Krahl2020-01-14
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This release adds support for these Nitrokey commands: For all devices: - Listing the connected devices and connecting to one of them (list_devices and Manager::connect_path). - Querying the status of a Nitrokey device (Device::get_status). For the Nitrokey Storage: - Getting the SD card usage (Storage::get_sd_card_usage). - Getting the status of a background operation (Storage::get_operation_status). - Filling the SD card with random data (Storage::fill_sd_card). With this release, we support all functions provided by libnitrokey – except those listed as unsupported in the readme file. Therefore we should be able to release a stable version 1.0.0 soon.
* | | | Update readme: usage, features, system libnitrokeyRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the readme with: - more usage information, especially a pointer to the examples and to nitrocli, - information about the supported features (= everything), - information on how to use the system libnitrokey instead of building it from source.
* | | | Remove multiple PWS item from todo listRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With commit f49e61589e32217f97c94aa86d826f6b65170fba, we changed the GetPasswordSafe::get_password_safe to take a mutable reference to a device. This makes sure that we cannot have two PWS instances for one device at the same time, so we can drop the corresponding item from the todo list.
* | | | Add basic usage examplesRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | This patch adds two basic usage examples: listing and connecting to Nitrokey devices, and generating a one-time password.
* | | | Document background operationsRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | This patch adds a new section about background operations to the crate documentation.
* | | | Add the fill_sd_card function to StorageRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for libnitrokey’s NK_fill_SD_card_with_random_data function. It is executed by the fill_sd_card function of the Storage struct. We also add a new test case that is set to ignore because it takes between 30 and 60 minutes to run.
* | | | Add the get_operation_status function to the Storage structRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the NK_get_progress_bar_value function: It adds the OperationStatus enum that stores the return value of this command and adds the get_operation_status function to the Storage struct that executes the command.
* | | | Derive Clone, Copy, Debug, PartialEq for StatusRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | Somehow I forgot to derive the common traits for the new Status struct. This patch adds the missing derive attribute for Clone, Copy, Debug and PartialEq.
* | | | Remove todo notes for Storage tests and refactoringRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes two items from the todo list: - Check timing in Storage tests: Since we introduced the two seconds timeout, no test failed due to timing issues. There is nothing we can do to check it more precisely, so we just have to live with it for now. - Consider restructuring `device::StorageStatus`: We already have structs for the volume status and firmware version. There is no need to extract more fields.
* | | | Add the get_sd_card_usage function to the Storage structRobin Krahl2020-01-14
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the NK_get_SD_usage_data function. It returns a range of the SD card that has not been accessed during this power cycle.
* | | | Rename Status::get_status to get_storage_statusRobin Krahl2020-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the last patch, we added the get_status function to the Device trait. This patch renames the Storage::get_status function to get_storage_status to resolve the name clash – though allowed by the compiler, it is rather confusing for the end user.
* | | | Add support for the GET_STATUS commandRobin Krahl2020-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the GET_STATUS command that returns the status information common to all Nitrokey devices. It can be accessed using the Device::get_status function and is stored in a Status struct. Due to a bug in the Storage firmware [0], the GET_STATUS command returns wrong firmware versions and serial numbers. Until this is fixed in libnitrokey [1], we have to manually execute the GET_DEVICE_STATUS command to fix these values for the Nitrokey Storage. Also, this leads to a name clash with the existing Storage::get_status function, which will be renamed in an upcoming patch. [0] https://github.com/Nitrokey/nitrokey-storage-firmware/issues/96 [1] https://github.com/Nitrokey/libnitrokey/issues/166
* | | | Merge branch 'connect_path' into nextRobin Krahl2020-01-07
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | This patch series adds the list_devices function that returns a list of available Nitrokey devices and the Manager::connect_path function that connects to one of the available devices.
| * | | | Add the connect_path function to the Manager structRobin Krahl2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the connect_path function to the Manager struct that uses NK_connect_with_path to connect to a Nitrokey device at a given USB path.
| * | | | Add list_devices functionRobin Krahl2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for libnitrokey’s NK_list_devices function by introducing the top-level list_devices function. It returns a vector of DeviceInfo structs with information about all connected Nitrokey devices.
| * | | | Add the DeviceInfo structRobin Krahl2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the next patch, we will add support for the NK_list_devices functions that returns a list of NK_device_info structs with information about the connected devices. This patch introduces the DeviceInfo struct that holds the information returned by NK_list_devices and that can be created from a NK_device_info struct.
| * | | | Implement conversion traits for Model and NK_device_modelRobin Krahl2020-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A nitrokey_sys::NK_device_model (= u32) value may correspond to a nitrokey::Model, and vice versa. This patch adds the appropriate From and TryFrom implementations.
| * | | | Add the Error::UnsupportedModelError variantRobin Krahl2020-01-07
|/ / / / | | | | | | | | | | | | | | | | | | | | This patch adds the UnsupportedModelError variant to the Error enum: When parsing the model returned by libnitrokey, we should provide a meaningful error message for unknown values.
* | | | Update the list of unsupported functionsRobin Krahl2020-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After some more research, I decided not to implement some of the methods provided by libnitrokey. This patch adds them to the list of unsupported functions in the readme, and removes them from the list of unimplemented functions in the todo list.
* | | | Merge branch 'release-0.4.0' into nextRobin Krahl2020-01-02
|\ \ \ \ | | |_|/ | |/| |
| * | | Release v0.4.0v0.4.0Robin Krahl2020-01-02
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This version contains these major changes: - Refactoring of the error handling. - Using mutability to represent changes to the device status. - Updating the nitrokey-sys/libnitrokey dependency to version 3.5. - Refactoring the connection management and introducing the Manager struct.
* | | Use dyn keyword for trait arguments in tests/otp.rsRobin Krahl2019-12-29
| | | | | | | | | | | | | | | To fix a compiler warning, we use the dyn keyword for trait arguments in the otp.rs instead of using the trait directly.
* | | Update and correct the readme fileRobin Krahl2019-12-27
| | | | | | | | | | | | | | | This patch updates the readme regarding the support by Nitrokey UG and fixes an editing error in the test section.
* | | Simplify doc tests with resultsRobin Krahl2019-12-27
| | | | | | | | | | | | | | | | | | Since Rust 1.34.0, we no longer need a `fn main` comment in doc tests that return results. It is sufficient to have an `Ok` return value with type annotations.
* | | Implement std::convert::TryFrom<Config> for RawConfigRobin Krahl2019-12-27
| | | | | | | | | | | | | | | | | | Previously, the RawConfig struct had a try_from function. As the TryFrom trait has been stabilized with Rust 1.34.0, we can use it instead.
* | | Replace rand_os::OsRng with rand_core::OsRngRobin Krahl2019-12-27
| | | | | | | | | | | | | | | rand_os::OsRng has been deprecated. Instead we can use rand_core with the getrandom feature.
* | | Add build for the MSRVRobin Krahl2019-12-27
| | | | | | | | | | | | | | | This patch adds a new archlinux-msrv build that compiles the code and the tests on the Minimum Supported Rust Version.
* | | Document Minium Supported Rust Version in readme fileRobin Krahl2019-12-27
| | | | | | | | | | | | | | | | | | The version 1.34.2 is picked arbitrarily as it is the Rust version in Debian buster and nitrocli is known to work with it. Earlier versions might work too, but they might break with any future release.
* | | Add verify task to lint buildRobin Krahl2019-12-27
| | | | | | | | | | | | | | | This patch adds a verify task to the lint build that checks the OpenPGP signature of the last commit.
* | | Use the AUR package for reuse in the lint buildRobin Krahl2019-12-27
| | | | | | | | | | | | | | | Previously, we used pip to manually install the fsfe-reuse package. Now we can use the new AUR package reuse.
* | | Move format and clippy checks to archlinux-*.ymlRobin Krahl2019-12-27
| | | | | | | | | | | | | | | | | | | | | The Rust package for Arch includes rustfmt and clippy, so we don’t have to use rustup for it. To make the builds simpler and faster, we move the format and clippy tasks to the archlinux-*.yml build that already has Rust installed.
* | | Change license for configuration and documentation to CC0-1.0Robin Krahl2019-12-27
| | |
* | | Comply with version 3.0 of the REUSE specificationRobin Krahl2019-12-27
| | | | | | | | | | | | | | | | | | To comply with the new version 3.0 of the REUSE specification, we have to add a copyright header to the .gitignore file and move the LICENSE file to LICENSES/MIT.txt.