On 2023/02/07 12:13, Paul de Weerd wrote: > Should yubikey really depend on the caps lock state of an (external) > keyboard? Would it make sense to lower the case of any password
there's complex code to handle 90 odd different keymaps, it would seem silly to go to that much trouble and not cope with capslock. > entered by the yubikey (I locked myself out with my first attempt at > toucing libexec/login_yubikey to achieve this, so I won't offer that > diff here ;) you could try this, untested as I don't have a private key handy and don't want to reset my yk, but I think it should work. Index: yubikey.c =================================================================== RCS file: /cvs/src/libexec/login_yubikey/yubikey.c,v retrieving revision 1.6 diff -u -p -r1.6 yubikey.c --- yubikey.c 16 Sep 2017 08:07:15 -0000 1.6 +++ yubikey.c 7 Feb 2023 12:33:29 -0000 @@ -308,10 +308,14 @@ uint8_t yubikey_keymap_decode(wchar_t *wpassword, char *token, int index) { int c, j, found; + wchar_t lower; for (j=0; j<YUBIKEY_TOKEN_SIZE; j++) { found = 0; for (c=0; c<16; c++) { - if (wpassword[j] == keymaps[index][c]) { + lower = wpassword[j]; + if (lower >= 0x41 && lower <= 0x5a) + lower |= 0x20; + if (lower == keymaps[index][c]) { token[j] = modhex_trans[c]; found++; break;