Drop YubiKey NEO support (closes #18)
YubiKey NEOs are legacy YubiKey devices, most of which contain unpatchable security vulnerabilities. They have smaller buffer sizes than YK4 and YK5, which necessitates a whole bunch of conditional gating and buffer size calculations. Getting rid of them simplifies this logic and allows us to assume consistent buffer sizes everywhere. We never tested on NEOs anyway, and looking at the deleted code it seems it may have been miscalculating the NEO's buffer size! If someone *really* wants to support NEOs, it shouldn't be that hard to restore, but the codebase is definitely cleaner without it.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#![warn(missing_docs, rust_2018_idioms, trivial_casts, unused_qualifications)]
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use log::trace;
|
||||
use std::{env, sync::Mutex};
|
||||
use yubikey_piv::{key::Key, YubiKey};
|
||||
|
||||
@@ -19,7 +20,11 @@ fn init_yubikey() -> Mutex<YubiKey> {
|
||||
env_logger::builder().format_timestamp(None).init();
|
||||
}
|
||||
|
||||
Mutex::new(YubiKey::open().unwrap())
|
||||
let mut yubikey = YubiKey::open().unwrap();
|
||||
trace!("serial: {}", yubikey.serial());
|
||||
trace!("version: {}", yubikey.version());
|
||||
|
||||
Mutex::new(yubikey)
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -36,5 +41,5 @@ fn test_list_keys() {
|
||||
let mut yubikey = YUBIKEY.lock().unwrap();
|
||||
let keys_result = Key::list(&mut yubikey);
|
||||
assert!(keys_result.is_ok());
|
||||
dbg!(keys_result.unwrap());
|
||||
trace!("keys: {:?}", keys_result.unwrap());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user