According to PKCS#11 standard, public key should not have the

attribute CKA_SENSITIVE set to TRUE. This attribute is for
private and secret keys only.
This commit is contained in:
Uri Blumenthal 2015-12-21 12:11:48 -05:00
parent 25dae28ab5
commit 2b6b0ee05a
1 changed files with 2 additions and 1 deletions

View File

@ -3879,8 +3879,9 @@ pkcs15_pubkey_get_attribute(struct sc_pkcs11_session *session, void *object, CK_
break;
case CKA_TOKEN:
case CKA_SENSITIVE:
/* By PKCS#11 v2.20 public key cannot have SENSITIVE attr TRUE */
check_attribute_buffer(attr, sizeof(CK_BBOOL));
*(CK_BBOOL*)attr->pValue = TRUE;
*(CK_BBOOL*)attr->pValue = FALSE;
break;
case CKA_LOCAL:
check_attribute_buffer(attr, sizeof(CK_BBOOL));