Nils fixed asn1 code to detect two byte "file name" versus

longer real paths.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1077 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2003-04-28 16:29:57 +00:00
parent f5bed52c76
commit a6e7fa3af9
1 changed files with 4 additions and 1 deletions

View File

@ -731,7 +731,10 @@ static int asn1_decode_path(struct sc_context *ctx, const u8 *in, size_t len,
r = asn1_decode(ctx, asn1_path, in, len, NULL, NULL, 0, depth + 1);
if (r)
return r;
path->type = SC_PATH_TYPE_PATH;
if (path->len == 2)
path->type = SC_PATH_TYPE_FILE_ID;
else
path->type = SC_PATH_TYPE_PATH;
if ((asn1_path[1].flags & SC_ASN1_PRESENT)
&& (asn1_path[2].flags & SC_ASN1_PRESENT)) {
path->index = idx;