aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-07-05 22:59:27 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-07-05 23:03:37 +0000
commite923c8b1ddaeafc9494ae86738bed9ad0e0e6e8f (patch)
treefa1e771be72a5b6954b546e85e74d9859deb144f /src
parent381666ed17e0d85293f52493f852480bee70783b (diff)
downloadnitrokey-rs-e923c8b1ddaeafc9494ae86738bed9ad0e0e6e8f.tar.gz
nitrokey-rs-e923c8b1ddaeafc9494ae86738bed9ad0e0e6e8f.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/device.rs8
1 files changed, 2 insertions, 6 deletions
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,
})
}