Changeset 1129


Ignore:
Timestamp:
01/29/09 22:51:44 (3 years ago)
Author:
alonbl
Message:

Fix for O2 Micro CCID SC Reader

Buggy O2 Micro CCID SC Reader has zero extra len
at interface level but not endpoint descriptor.
Patch the interface level field and proceed.
ProdID 7762 reader is in Dell Latitude D620 and
7772 is in D630.

By Andrey Jivsov

http://www.opensc-project.org/pipermail/opensc-devel/2009-January/011745.html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ifd/ifd-ccid.c

    r1115 r1129  
    591591                                continue; 
    592592                        if (!intf->extralen) { 
    593                                 intf = NULL; 
    594                                 continue; 
     593                                int i; 
     594                                /* Buggy O2 Micro CCID SC Reader has zero extra len at interface level but not endpoint descriptor. 
     595                                 * Patch the interface level field and proceed. 
     596                                 * ProdID 7762 reader is in Dell Latitude D620 and 7772 is in D630. 
     597                                 */ 
     598                                if( de.idVendor == 0x0b97 && (de.idProduct == 0x7762 || de.idProduct == 0x7772) )  { 
     599                                        ct_error("ccid: extra len is zero, patching O2 Micro support"); 
     600                                        for (i=0; i<intf->bNumEndpoints; i++)  { 
     601                                                /* find the extra[] array */ 
     602                                                if( intf->endpoint[i].extralen == 54 )  { 
     603                                                        /* get the extra[] from the endpoint */ 
     604                                                        intf->extralen = 54; 
     605                                                        /* avoid double free on close, allocate here */ 
     606                                                        intf->extra = malloc(54); 
     607                                                        if( intf->extra )  { 
     608                                                                memcpy( intf->extra, intf->endpoint[i].extra, 54 ); 
     609                                                                break; 
     610                                                        } 
     611                                                        else  { 
     612                                                                intf = NULL; 
     613                                                                continue; 
     614                                                        } 
     615                                                } 
     616                                        } 
     617                                } 
     618                                else  { 
     619                                        intf = NULL; 
     620                                        ct_error("ccid: extra len is zero, continuing"); 
     621                                        continue; 
     622                                } 
    595623                        } 
    596624 
Note: See TracChangeset for help on using the changeset viewer.