Test Config::get
Tests reading configuration from a live device:
Config { protected_data_available: false, puk_blocked: false, puk_noblock_on_upgrade: false, pin_last_changed: 0, mgm_type: Manual }
This commit is contained in:
+24
-3
@@ -27,14 +27,23 @@ fn init_yubikey() -> Mutex<YubiKey> {
|
||||
Mutex::new(yubikey)
|
||||
}
|
||||
|
||||
//
|
||||
// Device config support
|
||||
//
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_verify_pin() {
|
||||
fn test_get_config() {
|
||||
let mut yubikey = YUBIKEY.lock().unwrap();
|
||||
assert!(yubikey.verify_pin(b"000000").is_err());
|
||||
assert!(yubikey.verify_pin(b"123456").is_ok());
|
||||
let config_result = yubikey.config();
|
||||
assert!(config_result.is_ok());
|
||||
trace!("config: {:?}", config_result.unwrap());
|
||||
}
|
||||
|
||||
//
|
||||
// Cryptographic key support
|
||||
//
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_list_keys() {
|
||||
@@ -43,3 +52,15 @@ fn test_list_keys() {
|
||||
assert!(keys_result.is_ok());
|
||||
trace!("keys: {:?}", keys_result.unwrap());
|
||||
}
|
||||
|
||||
//
|
||||
// PIN support
|
||||
//
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_verify_pin() {
|
||||
let mut yubikey = YUBIKEY.lock().unwrap();
|
||||
assert!(yubikey.verify_pin(b"000000").is_err());
|
||||
assert!(yubikey.verify_pin(b"123456").is_ok());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user