leosac/keepassrfid

Error when unlocking

Closed this issue · 4 comments

When I try to unlock my database (which was successful before upgrading the KeePassRFID) the following error message comes up:
Initialising the type of LibLogicalAccess.liblogicalaccess_libraryPINVOKE caused exception.

Everything is up to date, liblogicalaccess-swig-binin Common Files (Windows 11).

Maxhy commented

The COM wrapper of LLA used on v1 version was previously installing files into Common Files and registered the COM components globally.
Now, with the new SWIG Wrapper LLA access layer is done through dll import. In practice it means liblogicalaccess-swig-bin dlls (either x86 or x64) need to be side by side to the KeePass plugins, or the folder on PATH.

I've read that note and certainly I have tried to unzip the content (liblogicalaccess-swig-bin.zip) in many ways into the Plugins folder. No luck. What do you mean by "side by side". Basically I unzipped all the files from x86 into the Plugins folder then tried to open my database. Same error message. Then deleted all the x86 files and tried the x86_64. Same result.
I unzipped the folders into the corresponding Common Files and added these in the PATH chain.
"C:\Program Files\Common Files\ISLOG\LibLogicalAccess\x86_64"
C:\Program Files (x86)\Common Files\ISLOG\LibLogicalAccess\x86"
Still no luck.
So I finally restarted the Windows and everything seems to be working APART FROM unlocking my database... the master key is invalid (password + NFC).
AND finally the solution, I just hope it will be sustainable:
Update process in Windows:

  1. BEFORE UPGRADE export your database without RFID (aka create a backup)
  2. keep the old version of the plugin (v1) just in case renaming it to something not plgx
  3. download the latest plgx and dll and copy to the Plugins folder
  4. download the liblogicalaccess-swig-bin.zip and unzip the content into a folder which is on the PATH or add that folder to the PATH
  5. reboot Windows
  6. open the exported database (without RFID)
  7. save again with the new RFID plugin
  8. delete your backup (if you want)
Maxhy commented

Thanks for the trials/investigation.

Restarting Windows shouldn't be required if you updated the user path, just restarting KeePass should have been enough since Windows 7.. I don't know why a reboot is required in your case...
I hope for better packaging to avoid manual extract + change of PATH at the same time of #1 resolution.

Now good point for the encryption key... I guess here you are not using NFC Tag (NDEF content) but Card Serial Number. The way the CSN is interpreted changed (from string to a byte vector which make more sense) and the backward compatibility wasn't respected here (also the reason why the major version was incremented because backward compatibility wasn't respected). Same goes with reader configuration, your previous reader selection from v1 may be discard and you may have to resetup the selection to your PC/SC reader. I will update the release note with that information thanks for the highlight.

Hi again,
The issue has come up again and I couldn't find a workaround it.
I have a clean install of all necessary files apart from the KeePassRFID.dll as it causes issues straight at the launch of KeePass (compatibility error). Without this DLL but with KeePassRFID.plgx, KeePass starts with no error.
But trying to use the plugin to unlock or set a master key, the "Initialising the type of LibLogicalAccess.liblogicalaccess_libraryPINVOKE caused exception." error comes up. I have a 64bit system installed and the latest KeePass is on the default path (c:\Program Files (x86)\KeePass Password Safe 2).
Updated liblogicalaccess-swig-bin files on environmental PATH:

  • c:\Program Files\Common Files\liblogicalaccess-swig-bin_x86_64
  • c:\Program Files (x86)\Common Files\liblogicalaccess-swig-bin_x86

Any idea where it could have gone wrong?