google / pkcs11test

PKCS#11 Test Suite
Apache License 2.0
75 stars 51 forks source link

ReadOnlySessionTest.WrapUnwrap - Expected wrong return value #44

Closed metekesler closed 3 years ago

metekesler commented 3 years ago

"ReadOnlySessionTest.WrapUnwrap" In this test case, it is requested to create a Private Key during R / W Public operation. It is written that this operation should not be allowed in the section "2.6.4 Permitted object accesses by sessions". Therefore, the transaction cannot be expected to be successful here. The return value of the function should be "CKR_USER_NOT_LOGGED_IN" but the expected value is "CKR_OK". Could there be a bug in this testing process?

2.6.4 Permitted object accesses by sessions

OUTPUT:

key.cc:145: Failure
Value of: CK_RV_((g_fns->C_UnwrapKey(session_, &wrap_mechanism, k2.handle(), data, data_len, k3_attrs, 5, &k3)))
  Actual: CKR_USER_NOT_LOGGED_IN
Expected: CK_RV_(0x00000000)
Which is: CKR_OK
daviddrysdale commented 3 years ago

Would moving these tests to use the ROUserSessionTest fixture instead of ReadOnlySessionTest fix things?

metekesler commented 3 years ago

yes i think this change will fix it

metekesler commented 3 years ago

Would moving these tests to use the ROUserSessionTest fixture instead of ReadOnlySessionTest fix things?

Hi @daviddrysdale, any progress on this?

daviddrysdale commented 3 years ago

Does #51 cover it?

metekesler commented 3 years ago

Does #51 cover it?

Yes, it does.