Remove usages of YKPIV_OBJ_MAX_SIZE

...replacing them with `CB_BUF_MAX`.

Both constants are 3072, however `CB_BUF_MAX` is what the original code
was using.

See discussion here:

https://github.com/tarcieri/yubikey-piv.rs/pull/17#discussion_r350166104
This commit is contained in:
Tony Arcieri
2019-11-25 08:49:29 -08:00
parent 67ed32cbf9
commit 79b1142f21
3 changed files with 4 additions and 7 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ impl MgmKey {
/// Set protected management key (MGM)
pub fn set_protected(&self, yubikey: &mut YubiKey) -> Result<(), Error> {
let mut data = Zeroizing::new(vec![0u8; YKPIV_OBJ_MAX_SIZE]);
let mut data = Zeroizing::new(vec![0u8; CB_BUF_MAX]);
let max_size = yubikey.obj_size_max();
let txn = yubikey.begin_transaction()?;
@@ -207,7 +207,7 @@ impl MgmKey {
}
// set the protected mgm flag in admin data
cb_data = YKPIV_OBJ_MAX_SIZE;
cb_data = data.len();
let mut flags_1 = [0u8; 1];