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" 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) })