Skip to content

Commit 72cb497

Browse files
committed
tests: Test coverage for #155
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent d7623cc commit 72cb497

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cryptoki/tests/basic.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,18 @@ fn is_fn_supported_test() {
947947
pkcs11.is_fn_supported(Function::DigestFinal),
948948
"C_DigestFinal function reports as not supported"
949949
);
950+
if is_softhsm() {
951+
// the SoftHSM does not have PKCS#11 3.0 API so this function is not present
952+
assert!(
953+
!pkcs11.is_fn_supported(Function::MessageEncryptInit),
954+
"C_MessageEncryptInit function reports supported for SoftHSM"
955+
);
956+
} else {
957+
assert!(
958+
pkcs11.is_fn_supported(Function::MessageEncryptInit),
959+
"C_MessageEncryptInit function reports as not supported"
960+
);
961+
}
950962
}
951963

952964
#[test]

0 commit comments

Comments
 (0)