Skip to content

Commit

Permalink
Merge pull request parallaxsecond#139 from a1ien/remove_derivative_crate
Browse files Browse the repository at this point in the history
Remove derivative crate
  • Loading branch information
wiktor-k authored May 5, 2023
2 parents d6daf6d + b3720e3 commit 2d1db88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion cryptoki/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 9 additions & 4 deletions cryptoki/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 2d1db88

Please sign in to comment.