Fedict / eid-mw

eID Middleware (main repository)
GNU Lesser General Public License v3.0
198 stars 79 forks source link

PIN entry dialog #170

Closed kvnhck closed 1 year ago

kvnhck commented 2 years ago

The pin entry dialog of the middleware does not support scaling on high dpi screens. This results in a really small dialog on a 4K resolution screen. Is this something that could be fixed in a future version?

yoe commented 2 years ago

The GTK-based PIN entry dialogs should no longer be used anymore; a pinentry-based one is available, for which multiple implementations exist as provided by GnuPG and/or the various desktops.

If you are using the GTK-based PIN entry dialogs, migrate to the pinentry implementation. The official packages supplied via eid.belgium.be should all be using the pinentry implementation. If you are using self-compiled packages, try installing libassuan before running configure (and optionally, passing the --enable-pinentry option, which should be autodetected normally).

If you are using the pinentry implementation and you have trouble with hidpi screens, talk to the maintainer of your pinentry application :-)

kvnhck commented 2 years ago

I am the maintainer :-)

Our application is a .NET based WPF application, so I am using the pkcs11net wrapper for signing. The Pkcs11 module is initiated by using the default "beidpkcs11.dll" which is installed in the windows/system32 folder by the official package. (version 5.0.17.5498c)

I don't know how to choose between the gtk or pinentry in this way. Could you point me in the right direction to find some more resources/documentation on this?

yoe commented 2 years ago

Whoops, sorry -- I (incorrectly) assumed you were using Linux.

The Windows PIN entry dialogs is a different story. Reopening.

kvnhck commented 2 years ago

Are there any updates on this issue?

Frederikus commented 2 years ago

Hello, we will have a look at this

Frederikus commented 2 years ago

Tried it with the eID Viewer (also uses the pkcs#11 PIN entry Windows), and there it seems to go fine.

Did you change some program settings in this area? https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows

kvnhck commented 2 years ago

I have also tested with the eID Viewer and even there I get a very small PIN Dialog.

This was tested using the current versions which are on eid.belgium.be (viewer https://eid.belgium.be/sites/default/files/software/Belgium%20eID%20Viewer%20Installer%205.1.2.5886.exe and middleware https://eid.belgium.be/sites/default/files/software/Belgium%20eID-QuickInstaller%205.0.17.5498c.exe)

Screen resolution = 3840x2160 and Scale = 150%

image

kvnhck commented 2 years ago

This full-screen screenshot might show the issue more clearly:

image

kvnhck commented 2 years ago

Did you have some time to look into this issue ?

Frederikus commented 2 years ago

But you also get a very small Viewer UI, no? The Text size on the PIN dialog is about the same as the text size on the eID Viewer, so is this screenshot not what you would expect?

kvnhck commented 2 years ago

Actually no, the screenshot doesn't really show it well, but the PIN dialog text is a lot smaller! Please verify for yourself on a 4K screen with dpi scale at 150%.

jleclanche commented 2 years ago

@yoe -- Apologies for barging in but you mention the gtk pinentry dialog no longer being used on Linux. I maintain eid-mw package on Arch Linux and I got this bug report about gtk2 being a soft dependency:

https://bugs.archlinux.org/task/75530

Is this related? I hesitated opening a new issue after searching and finding this one.

yoe commented 2 years ago

@yoe -- Apologies for barging in but you mention the gtk pinentry dialog no longer being used on Linux. I maintain eid-mw package on Arch Linux and I got this bug report about gtk2 being a soft dependency:

https://bugs.archlinux.org/task/75530

The eid software has a dialogs API, for which multiple implementations exist: Windows and macOS (irrelevant for Linux, obviously), an older qt implementation that is no longer maintained (and probably no longer works, either), a GTK implementation that should work with both gtk2 and gtk3 (but not gtk4, and that won't change), and an implementation that uses the pinentry protocol to use one of the many pinentry implementations available.

Pinentry has multiple implementations: a gtk one (which I believe compiles with gtk2 and gtk3), a gnome one (which is not the same), a qt/kde one, and a curses one. From the point of view of the eid software, they are all the same.

When I said earlier that the gtk implementation of the eid dialogs is discouraged, it means you should be using the pinentry implementation. The fact that your user sees the curses pinentry pop up shows that you are using the pinentry implementation for the dialogs, so you should be fine, although you may want to update your dependencies to either require or strongly suggest one of the graphical pinentry implementations. Your user should install another implementation of the pinentry server, not the gtk2 one, if they want a supported implementation. Which one is best depends on the GUI they prefer (e.g., don't use the gnome implementation is you don't use gnome)

Is this related? I hesitated opening a new issue after searching and finding this one.

In the future, please do not hesitate; I prefer not to conflate two issues. If necessary I can always redirect you to the correct issue.

kvnhck commented 1 year ago

Sorry for asking again, but are there any updates on the original issue?

Frederikus commented 1 year ago

We have been looking into this briefly, but it is not clear yet.

ignace-s commented 1 year ago

Hello, Would you have any update on this? Thank you

tocharl commented 1 year ago

Hello, The latest commit would fix the issue. Could you test it on your side to be sure?

levimigom commented 1 year ago

@tocharl I have tested this and it doesn't seem to be resolved completely. It seems only the size of the text has been changed to support scaling, the size of the window remains the same. Because the text now scales and the window doesn't, the text can become too big for the window.

In the following screenshot you can see the issue more clearly (3840x2160 300% scaling): 300edited

tocharl commented 1 year ago

Thanks for the feedback, I'll check that. Reopening this issue.

tocharl commented 1 year ago

Hello can you try if the size of pin entry windows are correctly scale with this version of the middleware https://dist.eid.belgium.be/releases/test.pinEntry/ ?

levimigom commented 1 year ago

There are still some issues with the "PIN" label and "Annuleren" button.

4k 100% scaling: 100 4k 200% scaling: 200 4k 300% scaling: 300

tocharl commented 1 year ago

Hello @levimigom I updated the files in https://dist.eid.belgium.be/releases/test.pinEntry/ that should fix remaining problems, can you test it and let me know?

levimigom commented 1 year ago

@tocharl the last issues have indeed been fixed. Thanks!

4k 300% scaling: image

tocharl commented 1 year ago

Good, these changes will be include in the next release. Closing this issue.