- When the application selected the EF, then the container DF, all
PIN info would be lost. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@495 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
b504fa0720
commit
01e506e5ed
|
@ -260,15 +260,21 @@ match_path(struct sc_card *card, unsigned short int **pathptr, size_t *pathlen,
|
|||
if (ptr[0] != GPK_FID_MF || curptr[0] != GPK_FID_MF)
|
||||
return 0;
|
||||
|
||||
/* You cannot select the parent with the GPK */
|
||||
if (len < curlen)
|
||||
return 0;
|
||||
|
||||
for (i = 1; i < curlen; i++) {
|
||||
for (i = 1; i < len && i < curlen; i++) {
|
||||
if (ptr[i] != curptr[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (len < curlen) {
|
||||
/* Caller asked us to select the DF, but the
|
||||
* current file is some EF within the DF we're
|
||||
* interested in. Say ACK */
|
||||
if (len == 2)
|
||||
goto okay;
|
||||
/* Anything else won't work */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* In the case of an exact match:
|
||||
* If the caller needs info on the file to be selected,
|
||||
* make sure we at least select the file itself.
|
||||
|
@ -284,6 +290,7 @@ match_path(struct sc_card *card, unsigned short int **pathptr, size_t *pathlen,
|
|||
return 0;
|
||||
}
|
||||
|
||||
okay:
|
||||
*pathptr = ptr + i;
|
||||
*pathlen = len - i;
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue