Skip to content

Commit db9a7dd

Browse files
committed
tests: Adjust inuque_id test for softokn
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent cb6eba1 commit db9a7dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cryptoki/tests/basic.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3740,8 +3740,9 @@ fn unique_id() -> TestResult {
37403740

37413741
// we can get the UniqueId attribute
37423742
let attrs = session.get_attributes(key, &[AttributeType::UniqueId])?;
3743-
if is_softhsm() {
3743+
if is_softhsm() || is_softokn() {
37443744
// SoftHSM does not support this attribute at all
3745+
// Softkn does not expose this attribute
37453746
assert_eq!(attrs.len(), 0);
37463747
} else {
37473748
assert!(matches!(attrs.first(), Some(Attribute::UniqueId(_))));
@@ -3751,8 +3752,9 @@ fn unique_id() -> TestResult {
37513752
let update_template = vec![Attribute::UniqueId(vec![0x01, 0x02, 0x03])];
37523753
let res = session.update_attributes(key, &update_template);
37533754
assert!(res.is_err());
3754-
if is_softhsm() {
3755+
if is_softhsm() || is_softokn() {
37553756
// SoftHSM does not support this attribute at all
3757+
// Softtokn supports it internally, but does not expose it
37563758
assert!(matches!(
37573759
res,
37583760
Err(Error::Pkcs11(

0 commit comments

Comments
 (0)