aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/config.rs b/src/config.rs
index cb678d7..120a51b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -83,13 +83,13 @@ impl convert::TryFrom<Config> for RawConfig {
}
}
-impl From<[u8; 5]> for RawConfig {
- fn from(data: [u8; 5]) -> Self {
- RawConfig {
- numlock: data[0],
- capslock: data[1],
- scrollock: data[2],
- user_password: data[3] != 0,
+impl From<&nitrokey_sys::NK_status> for RawConfig {
+ fn from(status: &nitrokey_sys::NK_status) -> Self {
+ Self {
+ numlock: status.config_numlock,
+ capslock: status.config_capslock,
+ scrollock: status.config_scrolllock,
+ user_password: status.otp_user_password,
}
}
}