aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--Cargo.toml2
-rw-r--r--TODO.md12
-rw-r--r--src/device.rs8
4 files changed, 16 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e98e857..e471f9b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,7 @@ SPDX-License-Identifier: MIT
- Implement `DerefMut` for `User<T>` and `Admin<T>`.
- Add `device_mut` method to `DeviceWrapper`.
- Require a mutable `Device` reference if a method changes the device state.
+- Update the `nitrokey-sys` dependency to version 3.5.0.
# v0.3.4 (2019-01-20)
- Fix authentication methods that assumed that `char` is signed.
diff --git a/Cargo.toml b/Cargo.toml
index 355f001..83cfa9f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ exclude = [".builds/*"]
[dependencies]
libc = "0.2"
-nitrokey-sys = "~3.4"
+nitrokey-sys = "3.5"
rand_core = {version = "0.3", default-features = false, features = ["std"] }
rand_os = {version = "0.1"}
diff --git a/TODO.md b/TODO.md
index 1ff723d..d7c8874 100644
--- a/TODO.md
+++ b/TODO.md
@@ -10,6 +10,18 @@ SPDX-License-Identifier: MIT
- `NK_get_progress_bar_value`
- `NK_list_devices_by_cpuID`
- `NK_connect_with_ID`
+- Evaluate the changes in libnitrokey 3.5:
+ - `NK_get_SD_usage_data`
+ - `NK_get_status`
+ - `NK_get_status_as_string`
+ - `NK_list_devices`
+ - `NK_free_device_info`
+ - `NK_connect_with_path`
+ - `NK_enable_firmware_update_pro`
+ - `NK_change_firmware_password_pro`
+ - `NK_read_HOTP_slot`
+ - `NK_status` (deprecated)
+ - `NK_get_progress_bar_value` (return value)
- Clear passwords from memory.
- Lock password safe in `PasswordSafe::drop()` (see [nitrokey-storage-firmware
issue 65][]).
diff --git a/src/device.rs b/src/device.rs
index f6492cd..6597ba9 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -399,13 +399,9 @@ pub trait Device: Authenticate + GetPasswordSafe + GenerateOtp + fmt::Debug {
fn get_firmware_version(&self) -> Result<FirmwareVersion, Error> {
let major = result_or_error(unsafe { nitrokey_sys::NK_get_major_firmware_version() })?;
let minor = result_or_error(unsafe { nitrokey_sys::NK_get_minor_firmware_version() })?;
- let max = i32::from(u8::max_value());
- if major < 0 || minor < 0 || major > max || minor > max {
- return Err(Error::UnexpectedError);
- }
Ok(FirmwareVersion {
- major: major as u8,
- minor: minor as u8,
+ major,
+ minor,
})
}