Skip to content

Commit b0abb94

Browse files
committed
tests: Softokn (correctly) requires PublicExponent when generating a key
1 parent 554719f commit b0abb94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cryptoki/tests/basic.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,9 @@ fn rsa_pkcs_oaep_empty() -> TestResult {
19881988
let session = pkcs11.open_rw_session(slot)?;
19891989
session.login(UserType::User, Some(&AuthPin::new(USER_PIN.into())))?;
19901990

1991+
let public_exponent: Vec<u8> = vec![0x01, 0x00, 0x01];
19911992
let pub_key_template = [
1993+
Attribute::PublicExponent(public_exponent),
19921994
Attribute::ModulusBits(2048.into()),
19931995
Attribute::Encrypt(true),
19941996
];
@@ -2027,7 +2029,9 @@ fn rsa_pkcs_oaep_with_data() -> TestResult {
20272029
let session = pkcs11.open_rw_session(slot)?;
20282030
session.login(UserType::User, Some(&AuthPin::new(USER_PIN.into())))?;
20292031

2032+
let public_exponent: Vec<u8> = vec![0x01, 0x00, 0x01];
20302033
let pub_key_template = [
2034+
Attribute::PublicExponent(public_exponent),
20312035
Attribute::ModulusBits(2048.into()),
20322036
Attribute::Encrypt(true),
20332037
];
@@ -3737,7 +3741,7 @@ fn unique_id() -> TestResult {
37373741

37383742
// we can get the UniqueId attribute
37393743
let attrs = session.get_attributes(key, &[AttributeType::UniqueId])?;
3740-
if is_softhsm() {
3744+
if is_softhsm() || is_softokn() {
37413745
// SoftHSM does not support this attribute at all
37423746
assert_eq!(attrs.len(), 0);
37433747
} else {

0 commit comments

Comments
 (0)