Skip to content

Commit

Permalink
fixing formatting issues reported by fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Devolder <[email protected]>
  • Loading branch information
keldonin committed Aug 28, 2024
1 parent 9fe0885 commit 1df9623
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 5 additions & 1 deletion cryptoki/src/session/object_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ impl Session {
///
/// This function will return a new [ObjectHandle] that references the newly created object.
///
pub fn copy_object(&self, object: ObjectHandle, template: &[Attribute]) -> Result<ObjectHandle> {
pub fn copy_object(
&self,
object: ObjectHandle,
template: &[Attribute],
) -> Result<ObjectHandle> {
let mut template: Vec<CK_ATTRIBUTE> = template.iter().map(|attr| attr.into()).collect();
let mut object_handle = 0;

Expand Down
13 changes: 5 additions & 8 deletions cryptoki/tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,13 +853,9 @@ fn session_copy_object() -> TestResult {
Attribute::Label("original".as_bytes().to_vec()),
];

let copy_template = vec![
Attribute::Label("copy".as_bytes().to_vec()),
];
let copy_template = vec![Attribute::Label("copy".as_bytes().to_vec())];

let insecure_copy_template = vec![
Attribute::Extractable(true),
];
let insecure_copy_template = vec![Attribute::Extractable(true)];

let (pkcs11, slot) = init_pins();

Expand All @@ -881,7 +877,9 @@ fn session_copy_object() -> TestResult {
rw_session.destroy_object(copy)?;

// try the copy with the insecure template. It should fail. Returning CKR_OK is considered a failure.
rw_session.copy_object(object, &insecure_copy_template).unwrap_err();
rw_session
.copy_object(object, &insecure_copy_template)
.unwrap_err();

// delete keys
rw_session.destroy_object(object)?;
Expand All @@ -890,7 +888,6 @@ fn session_copy_object() -> TestResult {
Ok(())
}


#[test]
#[serial]
fn aes_cbc_encrypt() -> TestResult {
Expand Down

0 comments on commit 1df9623

Please sign in to comment.