From e923c8b1ddaeafc9494ae86738bed9ad0e0e6e8f Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 5 Jul 2019 22:59:27 +0000 Subject: Update nitrokey-sys to version 3.5 As the return type of the NK_get_{major,minor}_firmware_version methods changed with libnitrokey 3.5, we also have to adapt our get_firmware_version function in device.rs. This patch also updates the changelog and the todo list with the changes caused by the new libnitrokey version. --- src/device.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') 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 { 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, }) } -- cgit v1.2.1