Home GnuPG
Diffusion GnuPG 987b81686022

scd,pcsc: Use a single context.

Description

scd,pcsc: Use a single context.

* scd/apdu.c (pcsc): New variable.
(struct reader_table_s): Remove pcsc.context from member.
(pcsc_get_status, connect_pcsc_card): Use pcsc.context.
(close_pcsc_reader): Release pcsc.context here with reference count.
(apdu_open_one_reader): Move API loading to ...
(pcsc_init): new.
(apdu_open_one_reader): Remove.
(apdu_open_reader): Call open_pcsc_reader instead of
apdu_open_one_reader.
(open_pcsc_reader): Call pcsc_init if needed.  Call close_pcsc_reader
instead of pcsc_release_context.  Make reader parsing more robust.
(apdu_init): Initialize pcsc.count and pcsc.context.

Backported-from-master: 1080e91efd60cb41c2d6dbafaee810e5967a3161)

The backport also adds some other chnages as described above.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
gniibeAuthored on Sep 10 2019, 8:51 AM
wernerCommitted on May 7 2021, 9:53 AM
Parents
rG89e20c38c21f: po: auto updates
Branches
Unknown
Tags
Unknown