Martin Paljak wrote: > On Mar 6, 2010, at 23:11 , Viktor TARASOV wrote: > >> Hi. >> >> For some cards the reading of the private objects attributes is >> protected by User PIN. >> >> Afais, when using emulator, all card's pkcs15 content has to be parsed >> 'atomically' in the emulator's handler -- there is no possibility to >> postpone the parsing of some xDFs, as it's actually possible with the >> 'normal' processing. >> >> That's why my question - to get PIN value, can some callback mechanism >> be implemented in libopensc ? >> It can be done like in pkcs15init - static callback pointers. Otherwise >> (as for me it's better) some entry can be added to the 'sc_pkcs15_card' >> or to the 'sc_context' structure . >> >> In such a manner, the 'SECURITY_STATUS_NOT_SATISFIED' problem in the >> emulator's handler can be resolved. >> > > This would mean postponing the loading at least some or all objects (like > certificates and public keys?) ? > How would this relate to PKCS#11 and C_Login? >
Well, initially I thought to 'inject' PIN value into the emulator's 'init' handler with the help of 'get_pin' callback . But, you have a reason, it do not go well with PKCS#11 . Better is to implement the possibility to postpone the loading of the private objects. In the 'normal' pkcs15 processing this additional loading is initiated by the sc_pkcs15_find_xx procedure. From the PKCS#11 point of view it takes place in the C_FindObjects() (in the logged session). Afaiu how emulator works, approximately it can be implemented like following: * extension of the 'builtin_emulator' structure (pkcs15-syn.c) with additional handler 'emu_parse_df'; * keep the pointer to this handler (or to the emulator itself) in 'sc_pkcs15_card' structure; * call 'emu_parse_df' procedure somewhere inside the existing 'sc_pkcs15_parse_df' procedure (pkcs15.c) . Kind wishes, Viktor. -- Viktor Tarasov <[email protected]> _______________________________________________ opensc-devel mailing list [email protected] http://www.opensc-project.org/mailman/listinfo/opensc-devel
