Skip to content

Commit bb7f1c1

Browse files
committed
Update to rust-cryptoki 0.11
The API break happened in the following commit 926c43e200e0a98d992edd8db0ead37633be443a Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 7b0e689 commit bb7f1c1

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

tools/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ required-features = ["profiles"]
2929
[dependencies]
3030
clap = { version = "4.5.26", default-features = false, features = ["cargo", "derive", "help", "std", "usage"] }
3131
kryoptic-lib.workspace = true
32-
cryptoki = "0.10.0"
32+
cryptoki = "0.11.0"
3333
hex = "0.4.3"
3434
libc = "0.2.151"
3535
serde = { version = "1.0.180", features = ["derive"] }

tools/softhsm/test_init.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::process::ExitCode;
22

33
use clap::Parser;
4-
use cryptoki::context::{CInitializeArgs, Pkcs11};
4+
use cryptoki::context::{CInitializeArgs, CInitializeFlags, Pkcs11};
55
use cryptoki::session::UserType;
66
use cryptoki::types::AuthPin;
77

@@ -27,7 +27,9 @@ fn main() -> ExitCode {
2727
let pkcs11 = Pkcs11::new(args.pkcs11_module).unwrap();
2828

2929
// initialize the library
30-
pkcs11.initialize(CInitializeArgs::OsThreads).unwrap();
30+
pkcs11
31+
.initialize(CInitializeArgs::new(CInitializeFlags::OS_LOCKING_OK))
32+
.unwrap();
3133

3234
// find a slot, get the first one
3335
let slot = pkcs11.get_slots_with_token().unwrap().remove(0);

tools/softhsm/test_signature.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::process::ExitCode;
22

33
use clap::Parser;
4-
use cryptoki::context::{CInitializeArgs, Pkcs11};
4+
use cryptoki::context::{CInitializeArgs, CInitializeFlags, Pkcs11};
55
use cryptoki::mechanism::Mechanism;
66
use cryptoki::object::{Attribute, ObjectClass};
77
use cryptoki::session::UserType;
@@ -23,7 +23,9 @@ fn main() -> ExitCode {
2323
let pkcs11 = Pkcs11::new(args.pkcs11_module).unwrap();
2424

2525
// initialize the library
26-
pkcs11.initialize(CInitializeArgs::OsThreads).unwrap();
26+
pkcs11
27+
.initialize(CInitializeArgs::new(CInitializeFlags::OS_LOCKING_OK))
28+
.unwrap();
2729

2830
// find a slot, get the first one
2931
let slot = pkcs11.get_slots_with_token().unwrap().remove(0);

0 commit comments

Comments
 (0)