Fix in pkcs15_gen_keypair(): labels didnt work
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1184 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
5716f100cc
commit
c85913c5c7
|
@ -1231,13 +1231,13 @@ CK_RV pkcs15_gen_keypair(struct sc_pkcs11_card *p11card, struct sc_pkcs11_slot *
|
|||
|
||||
len = sizeof(priv_label);
|
||||
rv = attr_find(pPrivTpl, ulPrivCnt, CKA_LABEL, priv_label, &len);
|
||||
if (rv != CKR_OK) {
|
||||
if (rv == CKR_OK) {
|
||||
priv_label[SC_PKCS15_MAX_LABEL_SIZE - 1] = '\0';
|
||||
priv_args.label = priv_label;
|
||||
}
|
||||
len = sizeof(pub_label);
|
||||
rv = attr_find(pPubTpl, ulPubCnt, CKA_LABEL, pub_label, &len);
|
||||
if (rv != CKR_OK) {
|
||||
if (rv == CKR_OK) {
|
||||
pub_label[SC_PKCS15_MAX_LABEL_SIZE - 1] = '\0';
|
||||
pub_args.label = pub_label;
|
||||
}
|
||||
|
@ -1261,8 +1261,8 @@ CK_RV pkcs15_gen_keypair(struct sc_pkcs11_card *p11card, struct sc_pkcs11_slot *
|
|||
sc_pkcs15init_set_pin_data(profile, SC_PKCS15INIT_USER_PIN,
|
||||
p15_data->pin[CKU_USER].value, p15_data->pin[CKU_USER].len);
|
||||
|
||||
|
||||
/* 3.a Try on-card key pair generation */
|
||||
|
||||
rc = sc_pkcs15init_generate_key(fw_data->p15_card, profile,
|
||||
&priv_args, keybits, &priv_key_obj);
|
||||
if (rc >= 0) {
|
||||
|
|
Loading…
Reference in New Issue