On a third thought, it is better to not introduce any confusion at all :)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3272 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
eada3a7e1c
commit
780b4afe8a
|
@ -215,10 +215,10 @@ akis_process_fci(sc_card_t *card, sc_file_t *file,
|
|||
|
||||
if (file->type == SC_FILE_TYPE_DF) {
|
||||
if (perms & 0x04)
|
||||
sc_file_add_acl_entry(file, SC_AC_OP_LIST_FILES, SC_AC_CHV, 0);
|
||||
sc_file_add_acl_entry(file, SC_AC_OP_LIST_FILES, SC_AC_CHV, 0x80);
|
||||
} else {
|
||||
if (!(perms & 0x04))
|
||||
sc_file_add_acl_entry(file, SC_AC_OP_READ, SC_AC_CHV, 0);
|
||||
sc_file_add_acl_entry(file, SC_AC_OP_READ, SC_AC_CHV, 0x80);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -330,29 +330,24 @@ akis_delete_file(sc_card_t *card, const sc_path_t *path)
|
|||
static int
|
||||
akis_pin_cmd(struct sc_card *card, struct sc_pin_cmd_data *data, int *tries_left)
|
||||
{
|
||||
int r;
|
||||
sc_apdu_t apdu;
|
||||
u8 buf[64];
|
||||
int p1, p2;
|
||||
|
||||
p2 = data->pin_reference;
|
||||
|
||||
if (data->cmd == SC_PIN_CMD_VERIFY) {
|
||||
// Reverse the bit for compatibility with 0.11.4 release
|
||||
// pin_reference: 0x00 - 0x7f are Application PINs, 0x80 is SO PIN
|
||||
// on AKIS: 0x80 - 0xff are Application PINs, 0x00 is SO PIN
|
||||
p2 ^= 0x80;
|
||||
data->pin_reference = p2;
|
||||
// ISO7816 implementation works
|
||||
return iso_ops->pin_cmd(card, data, tries_left);
|
||||
}
|
||||
|
||||
if (data->cmd == SC_PIN_CMD_CHANGE) {
|
||||
// This is AKIS specific
|
||||
int r;
|
||||
sc_apdu_t apdu;
|
||||
u8 buf[64];
|
||||
int p1, p2;
|
||||
|
||||
p2 = data->pin_reference;
|
||||
if (p2 & 0x80) {
|
||||
p1 = 1;
|
||||
} else {
|
||||
p1 = 2;
|
||||
p2 &= 0x7f;
|
||||
} else {
|
||||
p1 = 1;
|
||||
}
|
||||
sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0x24, p1, p2);
|
||||
apdu.sensitive = 1;
|
||||
|
|
Loading…
Reference in New Issue