Skip to content

Commit d5b3597

Browse files
committed
Merged main to keep branch up-to-date.
Signed-off-by: Mike Smoot <[email protected]>
2 parents d59ecb0 + ade6f06 commit d5b3597

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

Cargo.lock

+14-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

psa-crypto-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repository = "https://github.com/parallaxsecond/rust-psa-crypto"
1212
rust-version = "1.66.0"
1313

1414
[build-dependencies]
15-
bindgen = { version = "0.66.1", optional = true }
15+
bindgen = { version = "0.69.4", optional = true }
1616
cc = "1.0.59"
1717
cmake = "0.1.44"
1818
regex = "1.9.1"

psa-crypto-sys/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#[allow(clippy::all)]
2424
#[cfg(feature = "interface")]
2525
mod psa_crypto_binding {
26+
#![allow(unused_imports)]
2627
include!(concat!(env!("OUT_DIR"), "/shim_bindings.rs"));
2728
}
2829

psa-crypto/src/operations/cipher.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ fn crypt(
3232

3333
let mut output_length = 0;
3434
let mut output_length_finish = 0;
35-
let mut inner_crypt = || {
35+
36+
let status = {
3637
Status::from(unsafe {
3738
psa_crypto_sys::psa_cipher_set_iv(&mut operation, iv.as_ptr(), iv.len())
3839
})
@@ -62,16 +63,15 @@ fn crypt(
6263

6364
Ok(())
6465
};
65-
match inner_crypt() {
66-
Ok(()) => (),
66+
67+
match status {
68+
Ok(()) => Ok(output_length + output_length_finish),
6769
Err(x) => {
6870
Status::from(unsafe { psa_crypto_sys::psa_cipher_abort(&mut operation) })
6971
.to_result()?;
70-
return Err(x);
72+
Err(x)
7173
}
7274
}
73-
74-
Ok(output_length + output_length_finish)
7575
}
7676

7777
/// Encrypt a short message with a key

psa-crypto/src/types/key_derivation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::key::Id;
88
#[cfg(feature = "operations")]
99
use super::status::{Error, Result, Status};
1010
#[cfg(feature = "operations")]
11-
use core::convert::{From, TryFrom};
11+
use core::convert::TryFrom;
1212

1313
/// Key derivation operation for deriving keys from existing sources
1414
#[derive(Debug, Clone, Copy)]

0 commit comments

Comments
 (0)