First letter of password becomes upper cased when using yubi key
-
Hello,
I'm having a strange issue with Qt5 on Ubuntu 20.04 in combination with a static password configured from a Yubi Key. When entering text in a text field, if you first press any key on the keyboard followed by press on the yubi key (which triggers entering the configured password), the first letter of the password could have incorrect letter casing. This happens if a password has a lower case as first letter followed by upper case letters (e.g. "qQQ"). Subsequent presses on the yubi key then do enter the correct password. It's only when first pressing a key on the keyboard followed by pressing the yubi key that converts the first lower case letter into an upper case.
I contacted Yubi support but they say that the yubi key always produces the same scan codes and that it's not aware of any keyboard modifiers. Because of this I did another test by connecting 2 usb keyboards to my computer. When randomly pressing keys on both keyboards, you clearly see at some point some freezes. This makes me think there might be some kind of race condition going on somewhere.
This issue only pops up in any Qt based application like QtCreator, KeepassXC, Wireshark, a custom application, ... It can be triggered in any text field of these applications. However I cannot trigger it in any non-Qt based application.
So far I tried some debugging with xtrace and evtest but without any result. What I did notice is that when first pressing a key on the keyboard followed by pressing the yubi key, xtrace reported some "DeviceChanged" events. Maybe there is an issue with handling that event? I don't know.
One more thing I'd like to add, after testing on different systems ( all Ubuntu 20.04 ), it turns out that the issue also depends on the load of the system. On one system the issue almost always happens. On another system it almost never happens unless we run the stress tool. Then it also happens almost always.
-
For anyone who encounters the same issue, it was a bug in the Qt QPA X11/XCB. See this issue: https://bugreports.qt.io/browse/QTBUG-95933 .
-
Hi and welcome to devnet,
Can you provide a minimal compilable example that shows this behaviour ?
Which version of Qt are you using ?
-
Hi SGaist,
I created a demo project which you can find here: https://github.com/S4mw1s3/YubiIssue
Not sure however if this is what you meant. In fact you can use any Qt application you want.Qt version is standard Ubuntu 20.04 version which is 5.12.8 (https://packages.ubuntu.com/focal/qt5-default)
-
For anyone who encounters the same issue, it was a bug in the Qt QPA X11/XCB. See this issue: https://bugreports.qt.io/browse/QTBUG-95933 .