Skip to content

f-311:C_WrapKey does not check CKA_EXTRACTABLE on the key being wrapped#165

Open
miyazakh wants to merge 1 commit intowolfSSL:masterfrom
miyazakh:f-311
Open

f-311:C_WrapKey does not check CKA_EXTRACTABLE on the key being wrapped#165
miyazakh wants to merge 1 commit intowolfSSL:masterfrom
miyazakh:f-311

Conversation

@miyazakh
Copy link
Contributor

C_WrapKey doesn't check CKA_EXTRACTABLE on the key being wrapped. Neither WP11_Generic_SerializeKey nor WP11_Rsa_SerializeKeyPTPKCS8 check the extractable flag before serializing key material. Per the PKCS#11 specification, C_Wrapkey has to return CKR_KEY_UNEXTRACTABLE when attempting to wrap a key with CKA_EXTRACTABLE=CK_FALSE. This allows an attacker with a valid session to export any key material through wrapping, even keys explicitly marked as non-extractable, defeating the fundamental key protection model.

Fix the issue and add regression test.
Fix the unit test which expected to be wrapping the key, but it didn't set CKA_ETRACTABLE to CK_TRUE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants