Mastercard / pkcs11-tools

A set of tools to manage objects on PKCS#11 cryptographic tokens. Compatible with many PKCS#11 library, including major HSM brands, NSS and softoken.
Other
142 stars 29 forks source link

wrapped keys should have `CKA_EXRTACTABLE` set to `false` by default #16

Closed keldonin closed 4 years ago

keldonin commented 4 years ago

When wrapping a key using p11wrap, the attribute CKA_EXTRACTABLE is set to true, since that key must have this attribute set to be wrapped. There is however no reason to maintain this attribute to true; moreover, this creates a potential security issue since, without modifying the unwrap template manually, the recovered key will also feature this attribute, making it vulnerable to extraction.

It is recommended to set this attribute to false, irrespective of its value fetched from the wrapped key.