Hello,

Benoit Ferson wrote:
> Correct me if I'm wrong, but my understanding of the C_FindObjectsInit 
> function in opensc is that it solely relies on the in-memory data 
> structures for the card content, which are built by the PKCS15 
> operations (either emulated or native) during C_Initialize. In other 
> words, C_FindObjectsInit never reads off the file list from the card 
> after initialization.
>
> The card I am working on is not PKCS15 compliant and requires the user 
> to be authenticated before the card content can be enumerated. I wrote 
> a PKCS15 emulation plugin (inspired from PIV), but I am facing a 
> problem : as C_FindObjectsInit only relies on the file enumeration 
> performed during C_Initialize (before user authentication), I cannot 
> know the actual card content, even after the user has authenticated.
>
> Is there a way to force a "late" file enumeration? Does the only way 
> to solve this consists in hard coding the hypothetical card content 
> (as it seems to be done in PIV plugin)? Should I call 
> C_FindObjectInit() when the user authenticates (i.e., in 
> mycard_pin_cmd), although it looks ugly? Did I miss something?

The similar problem I've had with the emulator of the native Oberthur card.

The problem is in the pkcs15 emulation.

All pkcs15 objects are discovered and linked in the 'init' handler of 
emulator.
The 'init' handler is called before the card is binded,
and there is no 'easy' way to supply PIN, to discover the objects that 
have PIN protected attributes.

To resolve this problem the 'postponed xDF parsing' was implemented.

In your pkcs15 card driver you have to implement 'parse_df' handler.
Look src/libopensc/pkcs15.h +403 and oberthur's pkcs15 emulator.

>
> Thanks in advance for your help,
>
> Best regards,
>
> Benoit

Kind wishes,
Viktor.

> ------------------------------------------------------------------------
>
> _______________________________________________
> opensc-devel mailing list
> opensc-devel@lists.opensc-project.org
> http://www.opensc-project.org/mailman/listinfo/opensc-devel


-- 
Viktor Tarasov  <viktor.tara...@opentrust.com>

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to