From ef47e3f21498ec886508a344d7c0d5f739117a84 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Wed, 17 Jul 2019 19:14:03 -0700 Subject: Update nitrokey crate to 0.4.0-alpha.0 This is patch marks the first step in the process of updating the nitrokey dependency to version 0.4. In particular, it integrates with the first alpha version. The main change on the nitrocli side accompanying the version bump is that the nitrokey::CommandError got replaced by a more general nitrokey::Error which includes the former variant. Import subrepo nitrokey/:nitrokey at d433189caefe6bd6c88da7fbb1d6e9304353eb83 --- nitrokey/CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'nitrokey/CHANGELOG.md') diff --git a/nitrokey/CHANGELOG.md b/nitrokey/CHANGELOG.md index 04da117..24c79af 100644 --- a/nitrokey/CHANGELOG.md +++ b/nitrokey/CHANGELOG.md @@ -1,5 +1,36 @@ -# v0.3.5 (2019-12-16) -- Update the nitrokey-sys dependency version specification to ~3.4. + + +# Unreleased +- Remove the `test-pro` and `test-storage` features. +- Implement `Display` for `Version`. +- Introduce `DEFAULT_ADMIN_PIN` and `DEFAULT_USER_PIN` constants. +- Refactor the error handling code: + - Implement `std::error::Error` for `CommandError`. + - Add the `Error` enum. + - Add the `LibraryError` enum and move the library error variants from + `CommandError` to `LibraryError`. + - Add the `CommunicationError` enum and move the communication error variants + from `CommandError` to `CommunicationError`. + - Return `Error` instead of `CommandError` in all public functions. + - Move the `CommandError::RngError` variant to `Error::RandError` and the + `CommandError::Unknown` variant to `Error::UnknownError`. + - Return `CommunicationError::NotConnected` instead of + `CommandError::Undefined` from the connect functions. + - Remove the `CommandError::Undefined` variant. +- Add a private `PhantomData` field to `Pro` and `Storage` to make direct + instantiation impossible. +- Refactor and clean up internal code: + - Prefer using the `Into` trait over numeric casting. + - Add `Pro::new` and `Storage::new` functions. +- Implement `From` and `From` for `DeviceWrapper`. +- Add `Error::Utf8Error` variant. + - Return `Result` instead of `Version` from `get_library_version`. + - Return `Error::Utf8Error` if libnitrokey returns an invalid UTF-8 string. +- Implement `From<(T: Device, Error)>` for `Error`. +- Fix timing issues with the `totp_no_pin` and `totp_pin` test cases. # v0.3.4 (2019-01-20) - Fix authentication methods that assumed that `char` is signed. -- cgit v1.2.1