Skip to content

Commit 2a252c0

Browse files
committed
Add helper function to get the version of the token's firmware.
Signed-off-by: Neal H. Walfield <neal@sequoia-pgp.org>
1 parent 524e072 commit 2a252c0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cryptoki/tests/common.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ pub fn init_pins() -> (Pkcs11, Slot) {
5050

5151
(pkcs11, slot)
5252
}
53+
54+
pub fn get_firmware_version(pkcs11: &Pkcs11, slot: Slot) -> (u8, u8) {
55+
let info = pkcs11.get_slot_info(slot).unwrap();
56+
57+
let v = info.firmware_version();
58+
(v.major(), v.minor())
59+
}

0 commit comments

Comments
 (0)