Skip to content

Commit a3312f6

Browse files
Jakujesimo5
authored andcommitted
tests: Test setting never settable attributes
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent c76703f commit a3312f6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/tests/attrs.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,22 @@ fn test_set_attr_rsa() {
204204
template.as_ptr() as *mut _,
205205
1,
206206
);
207-
assert_eq!(ret, CKR_ATTRIBUTE_READ_ONLY);
207+
assert_eq!(ret, CKR_ACTION_PROHIBITED);
208+
209+
let flag: CK_ULONG = 0x03;
210+
let template = make_ptrs_template(&[(
211+
CKA_OBJECT_VALIDATION_FLAGS,
212+
void_ptr!(std::ptr::addr_of!(flag)),
213+
std::mem::size_of::<CK_ULONG>(),
214+
)]);
215+
216+
let ret = fn_set_attribute_value(
217+
session2,
218+
handle,
219+
template.as_ptr() as *mut _,
220+
1,
221+
);
222+
assert_eq!(ret, CKR_ACTION_PROHIBITED);
208223

209224
let ret = fn_close_session(session2);
210225
assert_eq!(ret, CKR_OK);

0 commit comments

Comments
 (0)