Giter Club home page Giter Club logo

Comments (13)

llogar avatar llogar commented on July 3, 2024

Currently only one applet at a time can be active. I think this is an OpenSC limitation. To select an active applet, enable/disable the relevant application block in opensc.conf (either E828BD080F014E585031 or E828BD080F014E585030)`. However I think the pinless applet should, by default, be disabled, so I am not sure why you are only seeing the pinless applet/slot

from opensc.

frankmorgner avatar frankmorgner commented on July 3, 2024

I think this is a limitation of OpenSCToken, which expects all keys and certificates to be in the generic card application:
https://github.com/frankmorgner/OpenSCToken/blob/f860cabca2d99bd600eb2affb2a8ef0a2a9b4bc0/OpenSCToken/Token.m#L106-L108

Basically, that needs to be extended to the other applications on the card as well, which is similar to what is done in the PKCS#11 library:

OpenSC/src/pkcs11/slot.c

Lines 347 to 361 in c354501

/* Now bind the rest of applications that are not 'generic' */
for (j = 0; j < p11card->card->app_count; j++) {
struct sc_app_info *app_info = p11card->card->app[j];
char *app_name = app_info ? app_info->label : "<anonymous>";
if (app_generic && app_generic == p11card->card->app[j])
continue;
sc_log(context, "%s: Binding %s token.", reader->name, app_name);
rv = frameworks[i]->bind(p11card, app_info);
if (rv != CKR_OK) {
sc_log(context, "%s: bind %s token error Ox%lX",
reader->name, app_name, rv);
continue;
}

Interestingly, minidriver.c also only binds the generic application. Could you please check if this problem also occurs on Windows using certutil.exe -scinfo?

from opensc.

llogar avatar llogar commented on July 3, 2024

Yes, it's the same on Windows. As I've said before, the solution, or rather workaround, (at least on Windows, I have no experience with Macs) is to enable just the applet you need...

from opensc.

frankmorgner avatar frankmorgner commented on July 3, 2024

I added multi-app support into OpenSCToken. Unfortunately, I can only do some basic tests. Would you mind testing the macOS package from here https://github.com/OpenSC/OpenSC/actions/runs/7653681110 ?

from opensc.

frankmorgner avatar frankmorgner commented on July 3, 2024

Would someone please test the macOS artifacts linked above? This adds support for all applications on the card, without the need for the mentioned workaround. thank you

from opensc.

msetina avatar msetina commented on July 3, 2024

Should this work on Linux?

from opensc.

craftbyte avatar craftbyte commented on July 3, 2024

@frankmorgner Sorry for the late reply, I have been hit with life as a truck. I tested this and am having issues with basic OpenSC usage. MacOS doesnt detect any smartcards and pkcs11-tool takes a suspiciously long time to list slots. What kind of logs would be useful to you?

Here is a log of OPENSC_DEBUG=9 pkcs11-tool --list-slots: https://gist.github.com/craftbyte/02f689b04e8e45bfbb43b72e32c96f1b

from opensc.

llogar avatar llogar commented on July 3, 2024

Should this work on Linux?

It should... The pinless applet is disabled by default though and when/if enabled it erroneously asks for PIN, although it is not needed. See #2646 (comment)

from opensc.

msetina avatar msetina commented on July 3, 2024

Thank you @llogar. I was wondering about this modification @frankmorgner linked, because I was following this support and as I can see there are two features missing as "by desing as of now" in openSC:

  1. PINless is not there but with circumvention
  2. Support is there for just one app per card and the forementioned fix should add this. So all 3 apps on the card need to be enabled in config. One at a time.

from opensc.

llogar avatar llogar commented on July 3, 2024

There are only 2 applets of interest (well, the 3rd one is eMRTD applet, but I think it's irrelevant in this context). If both are enabled there are 3 virtual slots (1 slot for pinless applet and 2 slots for the signature applet (1 for NormPIN and 1 for SigPIN). I prefer to have only one applet enabled at a time, as If I remember correctly, firefox (or perhaps thunderbird) kept nagging me for PIN entry for the unneeded one. But ymmv.

from opensc.

frankmorgner avatar frankmorgner commented on July 3, 2024

I added multi-app support into OpenSCToken. Unfortunately, I can only do some basic tests. Would you mind testing the macOS package from here https://github.com/OpenSC/OpenSC/actions/runs/7653681110 ?

This modification should allow using all certificates from all applets in OpenSCToken at the same time without modifying the active applet in opensc.conf. To test this, download the build artifact (https://github.com/OpenSC/OpenSC/actions/runs/7653681110/artifacts/1194532843), install the dmg. sc_auth identities should now show all certificates.

from opensc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.