Skip to content

Commit 2a9de54

Browse files
committed
Update tests/basic.rs to reflect GcmParams::new error handling
Signed-off-by: Jason Parker <[email protected]>
1 parent 248b6a7 commit 2a9de54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cryptoki/tests/basic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ fn aes_gcm_no_aad() -> TestResult {
12951295
Attribute::Encrypt(true),
12961296
];
12971297
let key_handle = session.create_object(&template)?;
1298-
let mechanism = Mechanism::AesGcm(GcmParams::new(&mut iv, &aad, 96.into()));
1298+
let mechanism = Mechanism::AesGcm(GcmParams::new(&mut iv, &aad, 96.into()).unwrap());
12991299
let cipher_and_tag = session.encrypt(&mechanism, key_handle, &plain)?;
13001300
assert_eq!(expected_cipher_and_tag[..], cipher_and_tag[..]);
13011301
Ok(())
@@ -1326,7 +1326,7 @@ fn aes_gcm_with_aad() -> TestResult {
13261326
Attribute::Encrypt(true),
13271327
];
13281328
let key_handle = session.create_object(&template)?;
1329-
let mechanism = Mechanism::AesGcm(GcmParams::new(&mut iv, &aad, 96.into()));
1329+
let mechanism = Mechanism::AesGcm(GcmParams::new(&mut iv, &aad, 96.into()).unwrap());
13301330
let cipher_and_tag = session.encrypt(&mechanism, key_handle, &plain)?;
13311331
assert_eq!(expected_cipher_and_tag[..], cipher_and_tag[..]);
13321332
Ok(())

0 commit comments

Comments
 (0)