aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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,
})
}