Skip to content

Commit fff995b

Browse files
committed
tests: Generate larger keys for compatibility with FIPS Mode
Signed-off-by: Jakub Jelen <[email protected]>
1 parent b563e0d commit fff995b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cryptoki/tests/basic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn sign_verify() -> TestResult {
4545
let mechanism = Mechanism::RsaPkcsKeyPairGen;
4646

4747
let public_exponent: Vec<u8> = vec![0x01, 0x00, 0x01];
48-
let modulus_bits = 1024;
48+
let modulus_bits = 2048;
4949

5050
// pub key template
5151
let pub_key_template = vec![
@@ -231,7 +231,7 @@ fn sign_verify_multipart() -> TestResult {
231231

232232
// Define parameters for keypair
233233
let public_exponent = vec![0x01, 0x00, 0x01];
234-
let modulus_bits = 1024;
234+
let modulus_bits = 2048;
235235

236236
let pub_key_template = vec![
237237
Attribute::Token(true),
@@ -340,7 +340,7 @@ fn sign_verify_multipart_already_initialized() -> TestResult {
340340

341341
// Define parameters for keypair
342342
let public_exponent = vec![0x01, 0x00, 0x01];
343-
let modulus_bits = 1024;
343+
let modulus_bits = 2048;
344344

345345
let pub_key_template = vec![
346346
Attribute::Token(true),
@@ -405,7 +405,7 @@ fn encrypt_decrypt() -> TestResult {
405405
let mechanism = Mechanism::RsaPkcsKeyPairGen;
406406

407407
let public_exponent: Vec<u8> = vec![0x01, 0x00, 0x01];
408-
let modulus_bits = 1024;
408+
let modulus_bits = 2048;
409409

410410
// pub key template
411411
let pub_key_template = vec![
@@ -1025,7 +1025,7 @@ fn wrap_and_unwrap_key() {
10251025
Attribute::Token(true),
10261026
Attribute::Private(true),
10271027
Attribute::PublicExponent(vec![0x01, 0x00, 0x01]),
1028-
Attribute::ModulusBits(1024.into()),
1028+
Attribute::ModulusBits(2048.into()),
10291029
// key needs to have "wrap" attribute to wrap other keys
10301030
Attribute::Wrap(true),
10311031
];
@@ -1044,7 +1044,7 @@ fn wrap_and_unwrap_key() {
10441044
let wrapped_key = session
10451045
.wrap_key(&Mechanism::RsaPkcs, wrapping_key, key_to_be_wrapped)
10461046
.unwrap();
1047-
assert_eq!(wrapped_key.len(), 128);
1047+
assert_eq!(wrapped_key.len(), 256);
10481048

10491049
let unwrapped_key = session
10501050
.unwrap_key(
@@ -1665,7 +1665,7 @@ fn update_attributes_key() -> TestResult {
16651665
Attribute::Token(true),
16661666
Attribute::Private(true),
16671667
Attribute::PublicExponent(vec![0x01, 0x00, 0x01]),
1668-
Attribute::ModulusBits(1024.into()),
1668+
Attribute::ModulusBits(2048.into()),
16691669
];
16701670

16711671
// priv key template

0 commit comments

Comments
 (0)