aboutsummaryrefslogtreecommitdiff
path: root/tests/pws.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pws.rs')
-rw-r--r--tests/pws.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/pws.rs b/tests/pws.rs
index 7805803..b0e5abe 100644
--- a/tests/pws.rs
+++ b/tests/pws.rs
@@ -7,13 +7,12 @@ use std::ffi::CStr;
use libc::{c_int, c_void, free};
use nitrokey::{
- CommandError, Device, Error, GetPasswordSafe, LibraryError, PasswordSafe, SLOT_COUNT,
+ CommandError, Device, Error, GetPasswordSafe, LibraryError, PasswordSafe, DEFAULT_ADMIN_PIN,
+ DEFAULT_USER_PIN, SLOT_COUNT,
};
use nitrokey_sys;
use nitrokey_test::test as test_device;
-use crate::util::{ADMIN_PASSWORD, USER_PASSWORD};
-
fn get_slot_name_direct(slot: u8) -> Result<String, Error> {
let ptr = unsafe { nitrokey_sys::NK_get_password_safe_slot_name(slot) };
if ptr.is_null() {
@@ -37,7 +36,7 @@ fn get_pws<T>(device: &mut T) -> PasswordSafe
where
T: Device,
{
- unwrap_ok!(device.get_password_safe(USER_PASSWORD))
+ unwrap_ok!(device.get_password_safe(DEFAULT_USER_PIN))
}
#[test_device]
@@ -45,14 +44,14 @@ fn enable(device: DeviceWrapper) {
let mut device = device;
assert_cmd_err!(
CommandError::WrongPassword,
- device.get_password_safe(&(USER_PASSWORD.to_owned() + "123"))
+ device.get_password_safe(&(DEFAULT_USER_PIN.to_owned() + "123"))
);
- assert_any_ok!(device.get_password_safe(USER_PASSWORD));
+ assert_any_ok!(device.get_password_safe(DEFAULT_USER_PIN));
assert_cmd_err!(
CommandError::WrongPassword,
- device.get_password_safe(ADMIN_PASSWORD)
+ device.get_password_safe(DEFAULT_ADMIN_PIN)
);
- assert_any_ok!(device.get_password_safe(USER_PASSWORD));
+ assert_any_ok!(device.get_password_safe(DEFAULT_USER_PIN));
}
#[test_device]