Enter Master Password dialog not receiving keys

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Enter Master Password dialog not receiving keys

Post by *Hacker »

Hi,
Windows 10 x64 v1903, TC x64 9.50RC2, KeePass 2.44 portable.

1. In KeePass, define the password

Code: Select all

~="
for TC and set it to Auto-Type for the "Master Password" dialog using the sequence {PASSWORD} only.
2. Invoke the Master Password dialog in TC, e.g. by trying to open a connection whose credentials are protected by the master password.
3. Click Show: and click the password field again to make it focused.
4. Press the KeePass Auto-Type hotkey, Ctrl-Alt-A by default.
5. Only

Code: Select all

=
gets typed. The ~ and " are not typed.

KeePass types these characters into Notepad and TC's command line correctly, so I assume there is something special about the Master Password dialog.
I have tried with Allowhook=0, 1 and 2.
I have tried without any AutoHotkey scripts running, which might possibly interfere with the keyboard hook.
The keyboard layout in all windows is ENG US.
Pasting the password or typing it manually work fine.
Ideas appreciated.

TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
nsp
Power Member
Power Member
Posts: 1805
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Enter Master Password dialog not receiving keys

Post by *nsp »

Just a guess, (I do not use Keypass) :

In US Intl Keyboard " '`^~ key does not work alone !
Can you try to add a space just after each special char.

Also,do you have option in Keypass to send pasword...
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Enter Master Password dialog not receiving keys

Post by *Hacker »

nsp,
Well, it works in TC's command line without any special adjustments and in other programs (e.g. Notepad), too. So I assume it's a peculiarity of this one Master Password dialog.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Enter Master Password dialog not receiving keys

Post by *ghisler(Author) »

The master password dialog uses a special secure input method where I set a keyboard hook to catch the keyboard input before any other programs can access the input. You need to turn this off to use simulated typing.
To wcx_ftp.ini section [General], please add:
Allowhook=0
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Enter Master Password dialog not receiving keys

Post by *Hacker »

Christian,
ghisler(Author) wrote:To wcx_ftp.ini section [General], please add:
Allowhook=0
Hacker wrote:I have tried with Allowhook=0, 1 and 2.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Enter Master Password dialog not receiving keys

Post by *ghisler(Author) »

Do you see a button to the right of the edit box when using Allowhook=0 ?
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Enter Master Password dialog not receiving keys

Post by *Hacker »

Christian,
No, I don't - screenshot.

TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Enter Master Password dialog not receiving keys

Post by *ghisler(Author) »

Then you probably put it in the wrong ini or section.
1. It must go to wcx_ftp.ini
2. It must go to section [General]

I have just tried it again, it works will both with
AllowHook=1
and
AllowHook=0

Both show the button, with the first enabling the option, and the second disabling it.
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Enter Master Password dialog not receiving keys

Post by *Hacker »

Christian,
Configuration - Change Settings Files Directly opens wincmd.ini and wcx_ftp.ini. I close wincmd.ini and this is my wcx_ftp.ini - screenshot. I search (Ctrl-F) for "allow" and only this one instance under [General] is found.
After each change I saved the file and restarted TC. The screenshot shows the current status (after starting TC).
Not sure what I might be doing wrong.

Perhaps it is of relevance that I access the Cloud plugin using the Ctrl-D menu? I have a specific path to a dir shared with me by another Google Drive user saved there.
EDIT: I just tested and it is the same when I go through the Network Neighborhood.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Enter Master Password dialog not receiving keys

Post by *ghisler(Author) »

You have set it correctly. I have checked my code, TC really looks for AllowHook and nothing else. No idea what could be wrong. :(
Author of Total Commander
https://www.ghisler.com
User avatar
nsp
Power Member
Power Member
Posts: 1805
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Enter Master Password dialog not receiving keys

Post by *nsp »

ghisler(Author) wrote: 2020-02-04, 14:33 UTC You have set it correctly. I have checked my code, TC really looks for AllowHook and nothing else. No idea what could be wrong. :(
I've made a test and if i set AllowHook=0 in my wcx_ftp.ini. When TC is reloaded i got a lock button to enable/dissable secure hook in the Master Password dialog.

With my Intl keyboard and no hook, i add a space after ~"; No sure it is the same to get ~=" i have <~ =" > as key string...

Check in the registry HKEY_CURRENT_USER\Software\Ghisler\Total Commander\[FtpIniName] to get the real place of your wcx_ftp.ini file
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Enter Master Password dialog not receiving keys

Post by *Hacker »

Christian,
I found the issue. There are two [General] sections in my wcx_ftp.ini, which I am reasonably sure I have not added manually. As I noticed the AESVerify key differs between the two sections, could the second one perhaps have been added when I was changing my master password and followed your advice from the thread Changing Master Password?
ghisler(Author) wrote:Try unchecking the option to store the login credentials in the plugin and then re-enable it to save the creditials with the new password.
Back to the topic, AllowHook=0 (or 1 and disabling the hook) allows KeePass to type the password correctly. Any idea if there is anything that could be done on TC side, or do I have to live with the disabled keyboard hook?

TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9389
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Enter Master Password dialog not receiving keys

Post by *Dalai »

2Hacker
Does KeePass have different methods to input/type the passwords in other applications? Maybe switching that to another methods could work around that issue.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Enter Master Password dialog not receiving keys

Post by *Hacker »

Dalai,
Yes, I was looking just for that, but I found only two more complex ones:
1. interleaved typing of keys, which changes the order in which the keys are typed but does not affect the result
2. interleaved typing and clipboard pasting which successfully pastes the characters for which it uses the clipboard.

However, I found I could use a special key sequence which puts the password into the clipboard, pastes it and presses Enter:

Code: Select all

{CLIPBOARD-SET:/{PASSWORD}/}^v{ENTER}
and it works! Thank you for pushing me in the right direction! 8)

Now only to find a way to set a delay before clearing the clipboard again, but I guess that is a question for the KeePass forum.
For now, the workaround is workable, but I'd still love to know why some chars work and some don't in the Master Password dialog.

Thanks
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9389
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Enter Master Password dialog not receiving keys

Post by *Dalai »

Ugh, really ugly workaround...
Hacker wrote: 2020-02-05, 15:24 UTC[...] but I'd still love to know why some chars work and some don't in the Master Password dialog.
That would indeed be interesting to know. Hope that Ghisler can explain it or find out why this happens.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply