Show
Ignore:
Timestamp:
09/29/07 07:43:25 (16 months ago)
Author:
nils
Message:

ignore paths with a AID in it

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/libopensc/card-asepcos.c

    r3263 r3277  
    213213 
    214214        while (len != 0) { 
    215                 if (len < 4 || in[0] != 0x8b || in[1] != 0x02) 
     215                if (len < 4) 
    216216                        return SC_ERROR_INTERNAL; 
     217                if (in[0] != 0x8b || in[1] != 0x02) 
     218                        return SC_ERROR_INVALID_ASN1_OBJECT; 
    217219                /* append file id to the path */ 
    218220                r = sc_append_path_id(out, &in[2], 2); 
     
    269271 
    270272                r = asepcos_get_current_df_path(card, &tpath); 
    271                 if (r != SC_SUCCESS) 
    272                         return r; 
    273                 if (sc_compare_path_prefix(&tpath, &npath) != 0) { 
     273                /* workaround: as opensc can't handle paths with file id 
     274                 * and application names in it let's ignore the current 
     275                 * DF if the returned path contains a unsupported tag. 
     276                 */ 
     277                if (r != SC_ERROR_INVALID_ASN1_OBJECT && r != SC_SUCCESS) 
     278                        return r; 
     279                if (r == SC_SUCCESS && sc_compare_path_prefix(&tpath, &npath) != 0) { 
    274280                        /* remove the currently selected DF from the path */ 
    275281                        if (tpath.len == npath.len) {