PKCS#11 key handle uninitialized in crypto tests
Upstream of Joyent OS-7274.
Noticed during testing of OS-6576, the digest tests would sometimes crash during shutdown. Looking at the cores, they were crashing during
C_DestroyOject. The crypto test PKCS#11 version of
crypto_op_t structure contains a field for a handle to a key object. Unfortunately this is only initialized for the tests that use the key (i.e. the encryption tests), but not for the digest tests. This can cause a crash on deallocation if the value happens to contain something other than 0 (always an invalid handle value) due to OS-6601 (pkcs11softtoken should_ just fail with
CKR_OBJECT_HANDLE_INVALID if given an invalid handle to destroy, but OS-6601 prevents that). Regardless, we should explicitly initialize the key object to
CK_INVALID_HANDLE so we know if we've used it or not (and need to destroy it).
Updated by Electric Monk 5 months ago
- Status changed from Pending RTI to Closed
- % Done changed from 0 to 100
commit eed3be881cd8e53fe7187245b289da7106712dea Author: Jason King <email@example.com> Date: 2018-11-09T10:32:03.000Z 9948 PKCS#11 key handle uninitialized in crypto tests Reviewed by: Dan McDonald <firstname.lastname@example.org> Reviewed by: Toomas Soome <email@example.com> Approved by: Hans Rosenfeld <firstname.lastname@example.org>