summaryrefslogtreecommitdiff
path: root/src/pws.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pws.rs')
-rw-r--r--src/pws.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pws.rs b/src/pws.rs
index 87a71dd..85726c5 100644
--- a/src/pws.rs
+++ b/src/pws.rs
@@ -315,6 +315,14 @@ impl<'a> PasswordSafe<'a> {
}
}
+impl<'a> Drop for PasswordSafe<'a> {
+ fn drop(&mut self) {
+ unsafe {
+ nitrokey_sys::NK_lock_device();
+ }
+ }
+}
+
impl GetPasswordSafe for Pro {
fn get_password_safe(&self, user_pin: &str) -> Result<PasswordSafe, CommandError> {
get_password_safe(self, user_pin)