fix file descriptor byte and ef_structure type; patch supplied by richard.musil@bigfoot.com

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2396 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2005-07-11 21:28:55 +00:00
parent d0259f046c
commit eddd1e3ab6
2 changed files with 4 additions and 4 deletions

View File

@ -509,10 +509,10 @@ static int iso7816_construct_fci(sc_card_t *card, const sc_file_t *file,
} else {
buf[0] = file->shareable ? 0x40 : 0;
switch (file->type) {
case SC_FILE_TYPE_WORKING_EF:
break;
case SC_FILE_TYPE_INTERNAL_EF:
buf[0] |= 0x08;
case SC_FILE_TYPE_WORKING_EF:
buf[0] |= file->ef_structure & 7;
break;
case SC_FILE_TYPE_DF:
buf[0] |= 0x38;
@ -520,7 +520,6 @@ static int iso7816_construct_fci(sc_card_t *card, const sc_file_t *file,
default:
return SC_ERROR_NOT_SUPPORTED;
}
buf[0] |= file->ef_structure & 7;
sc_asn1_put_tag(0x82, buf, 1, p, 16, &p);
}
buf[0] = (file->id >> 8) & 0xFF;

View File

@ -236,7 +236,8 @@ init_file(unsigned int type)
}
file->type = type;
file->status = SC_FILE_STATUS_ACTIVATED;
file->ef_structure = SC_FILE_EF_TRANSPARENT;
if (file->type != SC_FILE_TYPE_DF)
file->ef_structure = SC_FILE_EF_TRANSPARENT;
return file;
}