diff --git a/cryptoki/Cargo.toml b/cryptoki/Cargo.toml index 1fa727d2..aeb03458 100644 --- a/cryptoki/Cargo.toml +++ b/cryptoki/Cargo.toml @@ -15,7 +15,6 @@ documentation = "https://docs.rs/crate/cryptoki" bitflags = "1.3" libloading = "0.7.0" log = "0.4.14" -derivative = "2.2.0" psa-crypto = { version = "0.9.0", default-features = false, optional = true } cryptoki-sys = { path = "../cryptoki-sys", version = "0.1.4" } paste = "1.0.6" diff --git a/cryptoki/src/context/mod.rs b/cryptoki/src/context/mod.rs index ae2ddb29..5587a4fb 100644 --- a/cryptoki/src/context/mod.rs +++ b/cryptoki/src/context/mod.rs @@ -25,24 +25,29 @@ pub use locking::*; use crate::error::{Error, Result, Rv}; -use derivative::Derivative; use log::error; +use std::fmt; use std::mem; use std::path::Path; use std::ptr; use std::sync::Arc; -#[derive(Derivative)] -#[derivative(Debug)] // Implementation of Pkcs11 class that can be enclosed in a single Arc pub(crate) struct Pkcs11Impl { // Even if this field is never read, it is needed for the pointers in function_list to remain // valid. - #[derivative(Debug = "ignore")] _pkcs11_lib: cryptoki_sys::Pkcs11, pub(crate) function_list: cryptoki_sys::_CK_FUNCTION_LIST, } +impl fmt::Debug for Pkcs11Impl { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Pkcs11Impl") + .field("function_list", &self.function_list) + .finish() + } +} + impl Pkcs11Impl { // Private finalize call #[inline(always)]