diff --git a/cryptoki/src/context/mod.rs b/cryptoki/src/context/mod.rs index 8bb7c268..c6f25e3a 100644 --- a/cryptoki/src/context/mod.rs +++ b/cryptoki/src/context/mod.rs @@ -174,14 +174,14 @@ impl Pkcs11 { /// /// Note: No callback is set when opening the session. pub fn open_ro_session(&self, slot_id: Slot) -> Result { - session_management::open_session_no_callback(self, slot_id, false) + session_management::open_session(self, slot_id, false) } /// Open a new Read/Write session /// /// Note: No callback is set when opening the session. pub fn open_rw_session(&self, slot_id: Slot) -> Result { - session_management::open_session_no_callback(self, slot_id, true) + session_management::open_session(self, slot_id, true) } /// Check whether a given PKCS11 spec-defined function is supported by this implementation diff --git a/cryptoki/src/context/session_management.rs b/cryptoki/src/context/session_management.rs index bf628312..dbe52e16 100644 --- a/cryptoki/src/context/session_management.rs +++ b/cryptoki/src/context/session_management.rs @@ -11,11 +11,7 @@ use crate::slot::Slot; use std::convert::TryInto; // See public docs on stub in parent mod.rs #[inline(always)] -pub(super) fn open_session_no_callback( - ctx: &Pkcs11, - slot_id: Slot, - read_write: bool, -) -> Result { +pub(super) fn open_session(ctx: &Pkcs11, slot_id: Slot, read_write: bool) -> Result { let mut session_handle = 0; let flags = if read_write { diff --git a/cryptoki/tests/basic.rs b/cryptoki/tests/basic.rs index ecb42666..b798c5db 100644 --- a/cryptoki/tests/basic.rs +++ b/cryptoki/tests/basic.rs @@ -751,7 +751,7 @@ fn ro_rw_session_test() -> Result<()> { ro_session.login(UserType::User, Some(USER_PIN))?; // generate a key pair - // This should NOT work using the Read/Write session + // This should NOT work using the Read-Only session let e = ro_session.create_object(&template).unwrap_err(); if let Error::Pkcs11(RvError::SessionReadOnly) = e {