On Wednesday, October 31 at 03:53PM, B. Scott Michel wrote: > Could solve the problem two ways: > > #define SC_MAX_CARD_DRIVERS > (sizeof(internal_card_drivers)/sizeof(internal_card_drivers[0]))
This solution does not reflect the possibility of adding external
drivers, see my reply below.
> or detect the end of the array by the null card driver name pointer.
Yep, see below.
> Either way, you don't need a magic constant for the size of the array,
> which is also fairly dangerous for obvious reasons (like, oh, say, you
> increase it to 64 and there aren't 64 elements in the array...)
I would not be so critical. The wrong 'magic' value would simply lead to
an undetected card driver. It does not lead to a security hole...
> On 10/31/2012 2:10 PM, Frank Morgner wrote:
> > +1, I always wondered why I could got to the default driver anymore...
> >
> >
> > The quick fix would be to increase SC_MAX_CARD_DRIVERS
> >
> > A more generic solution, however, could be to change
> > `struct _sc_ctx_options.cdrv` to grow dynamically. Everywhere where
> > drivers are referenced a terminating NULL driver could be use to signal
> > the end of the list (just as it is done in `internal_card_drivers`).
> > Alternatively a `size_t` could indicate the length of the list.
> >
> >
> > AFAICS, this limitation is caused by allowing externally loaded card
> > drivers. Is this interface still supported? Does anyone use externally
> > loadable drivers?
> >
> >
> > On Wednesday, October 31 at 08:15PM, Leonardo Brondani Schenkel wrote:
> >> Hello,
> >>
> >> My cards used to work with OpenSC 0.12.2 but stopped working entirely
> >> after an upgrade to 0.13. After some investigation I found out that the
> >> default driver is disabled on 0.13 because there are more drivers listed
> >> in ctx.c:
> >>
> >> static const struct _sc_driver_entry internal_card_drivers[] = {
> >> { "cardos", (void *(*)(void)) sc_get_cardos_driver },
> >> { "flex", (void *(*)(void)) sc_get_cryptoflex_driver },
> >> { "cyberflex", (void *(*)(void)) sc_get_cyberflex_driver },
> >> #ifdef ENABLE_OPENSSL
> >> { "gpk", (void *(*)(void)) sc_get_gpk_driver },
> >> #endif
> >> { "gemsafeV1", (void *(*)(void)) sc_get_gemsafeV1_driver },
> >> { "miocos", (void *(*)(void)) sc_get_miocos_driver },
> >> { "mcrd", (void *(*)(void)) sc_get_mcrd_driver },
> >> { "asepcos", (void *(*)(void)) sc_get_asepcos_driver },
> >> { "starcos", (void *(*)(void)) sc_get_starcos_driver },
> >> { "tcos", (void *(*)(void)) sc_get_tcos_driver },
> >> { "openpgp", (void *(*)(void)) sc_get_openpgp_driver },
> >> { "jcop", (void *(*)(void)) sc_get_jcop_driver },
> >> #ifdef ENABLE_OPENSSL
> >> { "oberthur", (void *(*)(void)) sc_get_oberthur_driver },
> >> { "authentic", (void *(*)(void)) sc_get_authentic_driver },
> >> { "iasecc", (void *(*)(void)) sc_get_iasecc_driver },
> >> #endif
> >> { "belpic", (void *(*)(void)) sc_get_belpic_driver },
> >> { "ias", (void *(*)(void)) sc_get_ias_driver },
> >> { "incrypto34", (void *(*)(void)) sc_get_incrypto34_driver },
> >> { "acos5", (void *(*)(void)) sc_get_acos5_driver },
> >> { "akis", (void *(*)(void)) sc_get_akis_driver },
> >> #ifdef ENABLE_OPENSSL
> >> { "entersafe",(void *(*)(void)) sc_get_entersafe_driver },
> >> #ifdef ENABLE_SM
> >> { "epass2003",(void *(*)(void)) sc_get_epass2003_driver },
> >> #endif
> >> #endif
> >> { "rutoken", (void *(*)(void)) sc_get_rutoken_driver },
> >> { "rutoken_ecp",(void *(*)(void)) sc_get_rtecp_driver },
> >> { "westcos", (void *(*)(void)) sc_get_westcos_driver },
> >> { "myeid", (void *(*)(void)) sc_get_myeid_driver },
> >> { "sc-hsm", (void *(*)(void)) sc_get_sc_hsm_driver },
> >>
> >> /* Here should be placed drivers that need some APDU transactions to
> >> * recognise its cards. */
> >> { "setcos", (void *(*)(void)) sc_get_setcos_driver },
> >> { "muscle", (void *(*)(void)) sc_get_muscle_driver },
> >> { "atrust-acos",(void *(*)(void)) sc_get_atrust_acos_driver },
> >> { "PIV-II", (void *(*)(void)) sc_get_piv_driver },
> >> { "itacns", (void *(*)(void)) sc_get_itacns_driver },
> >> /* javacard without supported applet - last before default */
> >> { "javacard", (void *(*)(void)) sc_get_javacard_driver },
> >> /* The default driver should be last, as it handles all the
> >> * unrecognized cards. */
> >> { "default", (void *(*)(void)) sc_get_default_driver },
> >> { NULL, NULL }
> >> };
> >>
> >> than the limit defined in types.h:
> >>
> >> #define SC_MAX_CARD_DRIVERS 32
> >>
> >> So the binary from the website ignores all drivers that come after
> >> "PIV-II". Since my cards use the default driver, 0.13 is completely
> >> unusable to me.
> >>
> >> I filed a ticket:
> >> https://www.opensc-project.org/opensc/ticket/457
> >>
> >> Why is the limit so low? Shouldn't it be bumped to at least 64 or 128?
> >> _______________________________________________
> >> opensc-devel mailing list
> >> [email protected]
> >> http://www.opensc-project.org/mailman/listinfo/opensc-devel
> >>
> >
> >
> > _______________________________________________
> > opensc-devel mailing list
> > [email protected]
> > http://www.opensc-project.org/mailman/listinfo/opensc-devel
>
> _______________________________________________
> opensc-devel mailing list
> [email protected]
> http://www.opensc-project.org/mailman/listinfo/opensc-devel
--
Frank Morgner
Virtual Smart Card Architecture http://vsmartcard.sourceforge.net
OpenPACE http://openpace.sourceforge.net
IFD Handler for libnfc Devices http://sourceforge.net/projects/ifdnfc
pgpBWhcPOJ9CK.pgp
Description: PGP signature
_______________________________________________ opensc-devel mailing list [email protected] http://www.opensc-project.org/mailman/listinfo/opensc-devel
