pkcs15init: in 'change-attribute' procedure use card specific 'update DF' handler ...

... when it's available. 
'Change-attribute' is used by pkcs15 framework for PKCS#11.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5389 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
vtarasov 2011-04-22 14:00:47 +00:00
parent 4fa9679463
commit 6b04ab7650
1 changed files with 15 additions and 9 deletions

View File

@ -2701,6 +2701,11 @@ sc_pkcs15init_change_attrib(struct sc_pkcs15_card *p15card,
return SC_ERROR_NOT_SUPPORTED;
}
if (profile->ops->emu_update_any_df) {
r = profile->ops->emu_update_any_df(profile, p15card, SC_AC_OP_CREATE, object);
LOG_TEST_RET(ctx, r, "Card specific DF update failed");
}
else {
r = sc_pkcs15_encode_df(card->ctx, p15card, df, &buf, &bufsize);
if (r >= 0) {
struct sc_file *file = NULL;
@ -2713,6 +2718,7 @@ sc_pkcs15init_change_attrib(struct sc_pkcs15_card *p15card,
free(buf);
sc_file_free(file);
}
}
return r < 0 ? r : 0;
}