summaryrefslogtreecommitdiff
path: root/src/auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/auth.rs')
-rw-r--r--src/auth.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/auth.rs b/src/auth.rs
index f9f50fa..2ed7bfc 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -170,14 +170,14 @@ where
}
}
-fn authenticate_user_wrapper<T, C>(
+fn authenticate_user_wrapper<'a, T, C>(
device: T,
constructor: C,
password: &str,
-) -> Result<User<DeviceWrapper>, (DeviceWrapper, Error)>
+) -> Result<User<DeviceWrapper<'a>>, (DeviceWrapper<'a>, Error)>
where
T: Device,
- C: Fn(T) -> DeviceWrapper,
+ C: Fn(T) -> DeviceWrapper<'a>,
{
let result = device.authenticate_user(password);
match result {
@@ -186,14 +186,14 @@ where
}
}
-fn authenticate_admin_wrapper<T, C>(
+fn authenticate_admin_wrapper<'a, T, C>(
device: T,
constructor: C,
password: &str,
-) -> Result<Admin<DeviceWrapper>, (DeviceWrapper, Error)>
+) -> Result<Admin<DeviceWrapper<'a>>, (DeviceWrapper<'a>, Error)>
where
T: Device,
- C: Fn(T) -> DeviceWrapper,
+ C: Fn(T) -> DeviceWrapper<'a>,
{
let result = device.authenticate_admin(password);
match result {
@@ -377,7 +377,7 @@ impl<T: Device> AuthenticatedDevice<T> for Admin<T> {
}
}
-impl Authenticate for DeviceWrapper {
+impl<'a> Authenticate for DeviceWrapper<'a> {
fn authenticate_user(self, password: &str) -> Result<User<Self>, (Self, Error)> {
match self {
DeviceWrapper::Storage(storage) => {
@@ -399,7 +399,7 @@ impl Authenticate for DeviceWrapper {
}
}
-impl Authenticate for Pro {
+impl<'a> Authenticate for Pro<'a> {
fn authenticate_user(self, password: &str) -> Result<User<Self>, (Self, Error)> {
authenticate(self, password, |password_ptr, temp_password_ptr| unsafe {
nitrokey_sys::NK_user_authenticate(password_ptr, temp_password_ptr)
@@ -413,7 +413,7 @@ impl Authenticate for Pro {
}
}
-impl Authenticate for Storage {
+impl<'a> Authenticate for Storage<'a> {
fn authenticate_user(self, password: &str) -> Result<User<Self>, (Self, Error)> {
authenticate(self, password, |password_ptr, temp_password_ptr| unsafe {
nitrokey_sys::NK_user_authenticate(password_ptr, temp_password_ptr)