Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cardmod reader driver with pcsc reader driver #892

Closed
frankmorgner opened this issue Oct 19, 2016 · 3 comments
Closed

Merge cardmod reader driver with pcsc reader driver #892

frankmorgner opened this issue Oct 19, 2016 · 3 comments
Assignees

Comments

@frankmorgner
Copy link
Member

Expected behaviour

PC/SC reader driver should be identical to the reader driver that's used in the minidriver ("cardmod").

Actual behaviour

  • cardmod reader driver searches for the almost undocumented "cardmod" block in opensc.conf.
  • Since e95b515 the user needs to configure max_send_size and max_recv_size for both, the pcsc reader and the cardmod reader (while the latter is undocumented, as said above) for a reader that doesn't announce dwMaxAPDUDataSize.
  • cardmod reader configuration and implementation misses features of what is already implemented in PC/SC (e.g. PACE)
  • there is a lot of code duplication in reader-pcsc.c
  • reader-pcsc.c contains comments about removing cardmod driver somewhere in the future.

How to proceed?

Merge cardmod and PC/SC driver! Remove some code and use the same configuration blocks.

Since the cardmod driver has been there for years, I'd like to know if the early maintainers are fine with this... @martinpaljak @dengert @viktorTarasov

@martinpaljak
Copy link
Member

Absolutely. I practically gave up on OpenSC after the merge of this one.

@dengert
Copy link
Member

dengert commented Oct 19, 2016

Maybe I am missing something here. The cardmod driver is in ./reader-pcsc.c.

The main difference is reader-pcsc.c looks at all readers PC/SC provides and presents all the readers to the calling application so the application can select a reader.

Cardmod driver is given a pcsc_context_handle and pcsc_card_handle Microsoft code has already selected the reader and opened a PC/SC connection and passed these to the minidriver. And while the minidriver is still running the Microsoft code can presents a new pcsc_context_handle and pcsc_card_handle. The Microsoft code also handles the PCSC locking as best I can tell.

The main difference is thus:
cardmod_ops.detect_readers = NULL;
cardmod_ops.use_reader = cardmod_use_reader;

"Merge cardmod and PC/SC driver! Remove some code and use the same configuration blocks." is a start.

@frankmorgner
Copy link
Member Author

OK, great! Thanks for the feedback.

frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Nov 15, 2016
With this commit the user doesn't need a special configuration block
for the PC/SC readers that are used by the minidriver ("cardmod
driver"). All user configuration is now done in the "pcsc" section.

Fixes OpenSC#892
frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Nov 16, 2016
With this commit the user doesn't need a special configuration block
for the PC/SC readers that are used by the minidriver ("cardmod
driver"). All user configuration is now done in the "pcsc" section.

Fixes OpenSC#892
frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Feb 23, 2017
- pcsc driver takes over all the functionality
- no dedicated reader driver config values for cardmod, use application
  specific blocks to define a different behavior for the pcsc reader if
  needed
- removes legacy code; requiring at least libpcsclite 1.6.5

Fixes OpenSC#892
frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Mar 1, 2017
- pcsc driver takes over all the functionality
- no dedicated reader driver config values for cardmod, use application
  specific blocks to define a different behavior for the pcsc reader if
  needed
- removes legacy code; requiring at least libpcsclite 1.6.5

Fixes OpenSC#892
@frankmorgner frankmorgner self-assigned this Mar 3, 2017
frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Apr 3, 2017
- pcsc driver takes over all the functionality
- no dedicated reader driver config values for cardmod, use application
  specific blocks to define a different behavior for the pcsc reader if
  needed
- removes legacy code; requiring at least libpcsclite 1.6.5

Fixes OpenSC#892
frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Apr 3, 2017
- pcsc driver takes over all the functionality
- no dedicated reader driver config values for cardmod, use application
  specific blocks to define a different behavior for the pcsc reader if
  needed
- removes legacy code; requiring at least libpcsclite 1.6.5

Fixes OpenSC#892
frankmorgner added a commit to frankmorgner/OpenSC that referenced this issue Apr 19, 2017
- pcsc driver takes over all the functionality
- no dedicated reader driver config values for cardmod, use application
  specific blocks to define a different behavior for the pcsc reader if
  needed
- removes legacy code; requiring at least libpcsclite 1.6.5

Fixes OpenSC#892
frankmorgner added a commit that referenced this issue Apr 20, 2017
- pcsc driver takes over all the functionality
- no dedicated reader driver config values for cardmod, use application
  specific blocks to define a different behavior for the pcsc reader if
  needed
- removes legacy code; requiring at least libpcsclite 1.6.5

Fixes #892
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants