[Spice-devel] RFC - Direct smart card support in libcacard/spice-gtk

Jeremy White jwhite at codeweavers.com
Fri Jan 9 12:29:01 PST 2015


>> After some discussion on irc, I decided to explore expanding libcacard to
>> support sending the apdus directly to the card, using the PC/SC (aka
>> pcsclite) library.
>>
>> I've attached a proof of concept set of patches - one for the client, and
>> the substantial one for qemu/libcacard.
>>
>> The basic approach is to add a parallel to the vcard_emul_nss.c stack, where
>> we add and remove readers and cards in response to pcsclite events.
>>
>> Note that I don't consider the code submission quality; it has quite a few
>> rough edges.  It does work for me in some limited test cases, though, and it
>> I think largely illustrates my proposed path.
>>
>> I am hoping to ask:
>>
>>    1.  Does this basic approach seem reasonable?
>
> I think VCardEmulType VCARD_EMUL_PASSTHRU was supposed to be used for
> this case, although the current code doesn't make it straightforward
> to add that, as it initializes nss in vcard_emul_init. It should be
> possible to change that though.
>
> It probably doesn't make much sense to push this in libcacard if you
> don't reuse any of the cacard framework.

Hi,

I've spun up v2 of this discussion patch set.  I struggled for a while; 
I made an attempt to rename the vcard_emul_init entry point, and in the 
end, I felt that it was a pointless ABI change, just to satisfy my need 
to feel that the name made sense.  (I'm bothered that I call an 
xxx_emul_xxx function to use a *non* emulated device).

Once I got over that, the change actually became fairly atomic, and 
seemed to connect up reasonably well.

Attached is a v2 that seems like a good approach to me.  Again, I may be 
being myopic.  I did remove the -p (passthru) option from vscclient; you 
can achieve that result with '-e "use_hw=yes hw_type=passthru"', so it 
seemed redundant to me.

Feedback appreciated.  If it doesn't seem offensive, I will likely 
polish it a bit and submit it properly.

Cheers,

Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spice-gtk-Implement-a-proof-of-concept-of-a-direct-smartcard-m.patch
Type: text/x-patch
Size: 6561 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150109/fdc3b431/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qemu-Proof-of-concept-of-a-VCARD_DIRECT-implementation.patch
Type: text/x-patch
Size: 23447 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150109/fdc3b431/attachment-0003.bin>


More information about the Spice-devel mailing list