Skip to content

Commit

Permalink
Test creation of public object too
Browse files Browse the repository at this point in the history
Signed-off-by: Simo Sorce <[email protected]>
  • Loading branch information
simo5 committed Dec 9, 2024
1 parent d5a3d48 commit 93ad186
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/nssdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,20 @@ fn test_nssdb_init_token() {
);
assert_eq!(ret, CKR_OK);

/* add a public object to ensure attributes are handled correctly
* CKA_VALUE is encrypted only for private objects */
let _ = ret_or_panic!(import_object(
session,
CKO_CERTIFICATE,
&[(CKA_CERTIFICATE_TYPE, CKC_X_509)],
&[
(CKA_CHECK_VALUE, "ignored".as_bytes()),
(CKA_SUBJECT, "subject".as_bytes()),
(CKA_VALUE, "value".as_bytes())
],
&[(CKA_TOKEN, true), (CKA_TRUSTED, false)],
));

let ret = fn_logout(session);
assert_eq!(ret, CKR_OK);

Expand Down

0 comments on commit 93ad186

Please sign in to comment.