OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: [opensc-user] RE: [Muscle] Muscle card support for OpenSC - solved this problem

From: Andreas Jellinghaus (ajdungeon.inka.de)
Date: Sun Aug 27 2006 - 16:21:18 CDT


I looked at the code, and I am very confused. can you help me?

1.) why four bytes? all msc_* funcions only use the first two bytes
     anyway, so passing more looks wrong to me. also I'm not sure which
     if any functions in card-muscle or the muscle filesystem use more
     than this. so why four bytes?
2.) why int and u8[4] mix? why not keep only one? less converting,
     should be easier. or maybe best use two bytes where only two are
     looked at anyway, and more where more is actualy used?
3.) why not sc_path?

> It might be a good idea to fix the problem once and for all...
> -> Convert all object ids into 4-byte arrays as opposed to messing
> around with byte-swapping and integers.

I think so to and tried, but as most functions use only 2 bytes, I'm
confused. maybe two data types would be easier to understand.
(not: passing two bytes as two parameters is also fine with me.
optimize for readability :)

but some operations were really strange like that 16 bit shift of
objectId in one place.

> Originally I was trying to simplify the passing of the id's around...
> though now that I think of it, passing around a struct containing the
> 4-byte array would work good.

struct or direct array, both is fine with me. struct has the advantage,
that you can copy it in one simple line.

> It also looks like you aren't using the single-pin profile... which
> could potentially explain the last line of the log (that an unspecified
> PIN is required...)

ah, ok. is "+onepin" a requirement or a recommendation (i.e. should it
work without?).

thanks for your help.

Regards, Andreas
_______________________________________________
Muscle mailing list
Musclelists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle