From 6aba67fceb2bcc2ca97686d82cc9d2aaff720229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Wed, 31 Jan 2024 14:49:52 +0000 Subject: [PATCH 1/2] Cargo.lock: Bump shlex to version 1.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To fix RUSTSEC-2024-0006. shlex 1.3.0 is the patched version of the crate. Signed-off-by: Tomás González --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7e9ad8..4cdd73e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -565,9 +565,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "smallvec" From 4ce3f43a0765208973b3ad8c739b39104559ce69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Fri, 23 Feb 2024 15:18:53 +0000 Subject: [PATCH 2/2] operations/cipher: Simplify complex blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solves clippy issues: "In a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`" Signed-off-by: Tomás González --- psa-crypto/src/operations/cipher.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/psa-crypto/src/operations/cipher.rs b/psa-crypto/src/operations/cipher.rs index b61ada7..b7854f3 100644 --- a/psa-crypto/src/operations/cipher.rs +++ b/psa-crypto/src/operations/cipher.rs @@ -32,7 +32,7 @@ fn crypt( let mut output_length = 0; let mut output_length_finish = 0; - match (|| { + let status = { Status::from(unsafe { psa_crypto_sys::psa_cipher_set_iv(&mut operation, iv.as_ptr(), iv.len()) }) @@ -61,7 +61,9 @@ fn crypt( .to_result()?; Ok(()) - })() { + }; + + match status { Ok(()) => (), Err(x) => { Status::from(unsafe { psa_crypto_sys::psa_cipher_abort(&mut operation) })