Address clippy lints

This commit is contained in:
Jack Grigg
2019-11-21 00:44:49 +00:00
parent 86fde50c2d
commit 35cc1bbf72
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -79,6 +79,7 @@ impl Drop for DesKey {
}
/// Encrypt with DES key
#[allow(clippy::trivially_copy_pass_by_ref)]
pub fn des_encrypt(key: &DesKey, input: &[u8; DES_LEN_DES], output: &mut [u8; DES_LEN_DES]) {
output.copy_from_slice(input);
TdesEde3::new(GenericArray::from_slice(&key.0))
@@ -86,6 +87,7 @@ pub fn des_encrypt(key: &DesKey, input: &[u8; DES_LEN_DES], output: &mut [u8; DE
}
/// Decrypt with DES key
#[allow(clippy::trivially_copy_pass_by_ref)]
pub fn des_decrypt(key: &DesKey, input: &[u8; DES_LEN_DES], output: &mut [u8; DES_LEN_DES]) {
output.copy_from_slice(input);
TdesEde3::new(GenericArray::from_slice(&key.0))
+1 -1
View File
@@ -844,7 +844,7 @@ pub unsafe fn ykpiv_authenticate(
des_encrypt(&mgm_key, &challenge, &mut response);
// TODO(tarcieri): constant time comparison!
if response == &data[4..12] {
if response == data[4..12] {
res = Ok(());
} else {
res = Err(ErrorKind::AuthenticationError);