From ce55e08af87216e1da3ee107ee2d7ce14cb8b92d Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 20 Nov 2019 12:35:38 +0000 Subject: [PATCH] Explicitly ignore _cache_pin errors The only error that _cache_pin can return is a memory allocation failure which will likely be removed during the refactor. --- src/yubikey.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/yubikey.rs b/src/yubikey.rs index 1e25ff4..25a1ef2 100644 --- a/src/yubikey.rs +++ b/src/yubikey.rs @@ -200,7 +200,7 @@ pub(crate) unsafe fn _ykpiv_done(state: &mut YubiKey, disconnect: bool) -> Resul ykpiv_disconnect(state); } - _cache_pin(state, ptr::null(), 0); + let _ = _cache_pin(state, ptr::null(), 0); Ok(()) } @@ -1527,7 +1527,7 @@ pub(crate) unsafe fn _verify( if !pin.is_null() && (pin_len != 0) { // Intentionally ignore errors. If the PIN fails to save, it will only // be a problem if a reconnect is attempted. Failure deferred until then. - _cache_pin(state, pin, pin_len); + let _ = _cache_pin(state, pin, pin_len); } Ok(sw & 0xf) @@ -1740,7 +1740,7 @@ pub unsafe fn ykpiv_change_pin( if res.is_ok() && !new_pin.is_null() { // Intentionally ignore errors. If the PIN fails to save, it will only // be a problem if a reconnect is attempted. Failure deferred until then. - _cache_pin(state, new_pin, new_pin_len); + let _ = _cache_pin(state, new_pin, new_pin_len); } }