Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable tracing::instrument for C_Finalize/C_CloseAllSesssions #389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions native-pkcs11/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,17 @@ cryptoki_fn!(
}
);

cryptoki_fn!(
fn C_Finalize(pReserved: CK_VOID_PTR) {
pub extern "C" fn C_Finalize(pReserved: CK_VOID_PTR) -> CK_RV {
// TODO(bweeks): should this be `expr` instead of `block`?
result_to_rv(|| {
initialized!();
if !pReserved.is_null() {
return Err(Error::ArgumentsBad);
}
INITIALIZED.store(false, Ordering::SeqCst);
Ok(())
}
);
})
}

cryptoki_fn!(
unsafe fn C_GetInfo(pInfo: CK_INFO_PTR) {
Expand Down Expand Up @@ -474,14 +475,16 @@ cryptoki_fn!(
}
);

cryptoki_fn!(
fn C_CloseAllSessions(slotID: CK_SLOT_ID) {
#[no_mangle]
pub extern "C" fn C_CloseAllSessions(slotID: CK_SLOT_ID) -> CK_RV {
// TODO(bweeks): should this be `expr` instead of `block`?
result_to_rv(|| {
initialized!();
valid_slot!(slotID);
sessions::close_all();
Ok(())
}
);
})
}

cryptoki_fn!(
unsafe fn C_GetSessionInfo(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) {
Expand Down