Skip to content

Conversation

@frankmorgner
Copy link
Member

@frankmorgner frankmorgner commented Jan 21, 2023

The onepin-opensc-pkcs11 constantly leads to confusion with users, because it is not obvious which opensc module to choose. This PR uses the running program's name to check whether the onepin configuration is needed, i.e. it checks whether the PKCS#11 module is running inside firefox.

The OpenSC tools are refactored so that they can output debug messages even before to a reader (i.e. directly after sc_context_create().

Checklist
  • Documentation updated
  • Tools tested
  • Windows Firefox tested
  • Linux Firefox tested
  • macOS Firefox tested
  • Windows minidriver is tested

@frankmorgner frankmorgner force-pushed the firefox branch 6 times, most recently from ebd6795 to e0d90c9 Compare January 24, 2023 08:34
@frankmorgner frankmorgner marked this pull request as ready for review January 24, 2023 08:45
@frankmorgner
Copy link
Member Author

I've now successfully tested all major platforms. Everything works as expected. I've noticed that the PKCS#11 module generates too many notifications for removal/insertion events. That's removed now as well.

@Jakuje, @dengert, please let me know if you think that removing onepin-opensc-pkcs11 may cause any trouble for users.

@metsma
Copy link
Contributor

metsma commented Jan 24, 2023

I will notifiy our test team

Copy link
Member

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, fix the typos. Otherwise it looks good.

@frankmorgner frankmorgner force-pushed the firefox branch 3 times, most recently from 08b57fa to e2569e8 Compare January 24, 2023 10:36
@frankmorgner
Copy link
Member Author

typos are fixed.

@Jakuje
Copy link
Member

Jakuje commented Jan 24, 2023

Please, remove also the onepin from the spec file in https://github.com/OpenSC/OpenSC/blob/master/packaging/opensc.spec#L164 so we can have the CI passing.

@dengert
Copy link
Member

dengert commented Jan 24, 2023

PIV should be fine. Only uses 1 pin

@frankmorgner
Copy link
Member Author

Let's still wait for @metsma 's feedback

@metsma
Copy link
Contributor

metsma commented Feb 6, 2023

Let's still wait for @metsma 's feedback

Can we filter Chrome to?

@henning-schild
Copy link

I did not look into the details, but this sounds like a user interface change that should not be ignored.

So i suggest a "symlink" or a "deprecation wrapper". If the module disappears ... we will have an issue with any config in any application that is configured to use it.

@frankmorgner
Copy link
Member Author

I did not look into the details, but this sounds like a user interface change that should not be ignored.

Indeed it is, that's why I asked for opinions above. We can surely implement some temporary workarounds, but I fear that those are hard to maintain given the different platforms we support and that I don't see them go away once they are in place. Hence, I personally would opt for a possible breaking change nevertheless.

@frankmorgner
Copy link
Member Author

Can we filter Chrome to?

With all the browser forks it could get crazy quickly, but it is possible, for sure. But, AFAIK, problems have only been reported for Firefox....

@metsma
Copy link
Contributor

metsma commented Feb 8, 2023

Can we filter Chrome to?

With all the browser forks it could get crazy quickly, but it is possible, for sure. But, AFAIK, problems have only been reported for Firefox....

We have only official chrome in testing matrix. Chromium uses SNAP in Ubuntu and we don't supprt this configuration.

@henning-schild
Copy link

Indeed it is, that's why I asked for opinions above. We can surely implement some temporary workarounds, but I fear that those are hard to maintain given the different platforms we support and that I don't see them go away once they are in place. Hence, I personally would opt for a possible breaking change nevertheless.

Indeed such things are hard to get rid of. But i would still like to ask for some help for end users and distributors.

But these modules are mentioned in all sorts of management scripts that configure browsers (many of them) and other applications, some of them proprietary ... Think of ansible or puppet and alike. These scripts will have to work over generations and flavors of Linux, and maybe other OSs. And they will have to deal with creating new configuration and updating old.

Not even to mention manual configuration that people have somewhere, did after reading whatever google did spit out ... a forum/blog.

I am afraid the user-interface change might be big and hard to handle for distros, admins, and "did something funny" end-users.

@frankmorgner
Copy link
Member Author

@henning-schild I've added the onepin module as link/copy to the installation. I need to verify the Windows installer, however.

@henning-schild
Copy link

@henning-schild I've added the onepin module as link/copy to the installation. I need to verify the Windows installer, however.

Thanks so much. If i read that last commit correctly it is only about compatibility and not about deprecation.

I sure hope the old name can be deprecated one day, or kept forever and not causing too much trouble over time.

@frankmorgner
Copy link
Member Author

@metsma , could you please elaborate what you mean by

Can we filter Chrome to?

Do you think OpenSC should behave like the onepin module in Chrome as well? If so, why?

@Jakuje
Copy link
Member

Jakuje commented Feb 22, 2023

@metsma , could you please elaborate what you mean by

Can we filter Chrome to?

Do you think OpenSC should behave like the onepin module in Chrome as well? If so, why?

Because chrome is using NSS for accessing hardware tokens as far as I know.

@metsma
Copy link
Contributor

metsma commented Feb 22, 2023

Yes. On linux Chrome uses NSS

@TheElectronWill
Copy link

TheElectronWill commented Mar 2, 2023

Thank you for the clarification!

Addendum: gnome evolution uses the SmartCard too, I think it does so via the NSS database (like Chrome). Maybe it should be handled as well? But who knows how many apps use the nssdb...

@frankmorgner
Copy link
Member Author

With #2733 being merged, I wonder if the special treatment of Firefox (or any other NSS powered app) is still needed. OpenSC now behaves friendly in terms of having publicly readable certificates! @metsma could you confirm this by testing master?

@frankmorgner
Copy link
Member Author

@metsma, do you have any updates regarding OpenSC's "friendlyness", especially with #2733 being merged?

@metsma
Copy link
Contributor

metsma commented Apr 14, 2023

@frankmorgner our test team reports that Firefox and Chrome still request 2 pins (PIN1, PIN2) on authentication.

@frankmorgner
Copy link
Member Author

@frankmorgner our test team reports that Firefox and Chrome still request 2 pins (PIN1, PIN2) on authentication.

I assume you mean that FF/Chrome are requesting the two PINs although only one would be needed for authenticating to a specific site. If so, it sseems that although OpenSC is considered to have the certificates friendly-ish readable, the user experience is still poor.

Then, I would try to extend this PR to also recognize chrome and chromium. Do you know (platform independant) names of other browsers, that are using NSS?

@metsma
Copy link
Contributor

metsma commented Apr 14, 2023

@frankmorgner our test team reports that Firefox and Chrome still request 2 pins (PIN1, PIN2) on authentication.

I assume you mean that FF/Chrome are requesting the two PINs although only one would be needed for authenticating to a specific site. If so, it sseems that although OpenSC is considered to have the certificates friendly-ish readable, the user experience is still poor.

Yes

Then, I would try to extend this PR to also recognize chrome and chromium. Do you know (platform independant) names of other browsers, that are using NSS?

I think this will cover most. Maybe add configure option to extend this list. There are other forks available (Tor, Opera etc)

@TheElectronWill
Copy link

Then, I would try to extend this PR to also recognize chrome and chromium. Do you know (platform independant) names of other browsers, that are using NSS?

Wouldn't the problem show up in a potentially unlimited number of applications that use NSS? E.g. opera, thunderbird, evolution, some vpn clients, electron-based apps, etc. Listing them all in opensc seems impossible, perhaps there could be a config somewhere :S

@fbezdeka
Copy link
Contributor

fbezdeka commented Apr 18, 2023

I have symlinked opensc-pkcs11.so to the onepin variant on my systems because too many applications had problems.

-rwxr-xr-x. 1 root root  258K  2. Dez 18:49 onepin-opensc-pkcs11.so
lrwxrwxrwx. 1 root root    23 16. Dez 08:23 opensc-pkcs11.so -> onepin-opensc-pkcs11.so

Applications I have in use:
Firefox, Chrome, Evolution

AFAIR all of those apps had the multipe-pin-requested problems.

@frankmorgner
Copy link
Member Author

I think a reasonable good default regular expression for matching the executable's name would work and could be made configurable.

Matching all NSS programs, would not make sense, because in E-Mail applications you want to do signing and encryption even if multiple PINs are involved.

@frankmorgner
Copy link
Member Author

  • resolved merge conflicts
  • extended one-slot configuration (onepin) to chrome and chromium
  • extended opensc.conf to use the apps path for a configuration block. Which allows setting slots_per_card to 1 also for other browsers while leaving the general PKCS#11 configuration alone.

@frankmorgner
Copy link
Member Author

@metsma , could you trigger your test team, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants