Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash after Get-KeePassEntry #208

Open
tikondrus opened this issue Jan 25, 2023 · 5 comments
Open

crash after Get-KeePassEntry #208

tikondrus opened this issue Jan 25, 2023 · 5 comments

Comments

@tikondrus
Copy link

tikondrus commented Jan 25, 2023

I have been using the powershell script for over a year and today I noticed that something is not working. after debugging found that the script crashes after Get-KeePassEntry. So I don't understand what the root cause of this behaviour. During this year I didn't change windows, powershell, ps module versions or something else.

my code is

` New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeePass' -DatabasePath $dbpath -UseMasterKey -Default

$keepasskey = Get-Content $global:masterpass -raw

$Securekeepasskey = ConvertTo-SecureString $keepasskey –asplaintext –force

Get-KeePassEntry -AsPlainText -DatabaseProfileName 'KeePass' -MasterKey $Securekeepasskey `

after that I get an error

@tikondrus
Copy link
Author

keepass error

after several times ignoring cmdlet get entries. but I cant ignore this error with -ErrorAction SilentlyContinue and can't catch it with try-catch construction

@tikondrus
Copy link
Author

I see than error is like in this issue #148 but I only get entry, not update

@ePaint
Copy link

ePaint commented Oct 9, 2023

I'm getting exactly the same issue on Get-KeePassEntry

@jberezanski-mdg
Copy link

jberezanski-mdg commented Feb 26, 2024

It looks like the old KeePassLib included in the module (2.39.1) is unable to handle some recent changes to the kdbx file format.
Here is a quick and dirty workaround:

  1. Download the newest KeePass portable release (2.56 as of today) and extract KeePass.exe (yes, the EXE, not any of the dlls!) from the zip.
    If you have KeePass installed on your machine, just take C:\Program Files\KeePass Password Safe 2\KeePass.exe.
  2. Save KeePass.exe as KeePassLib_2.39.1.dll in the bin subdirectory of the PoShKeePass module
    (usually $Env:UserProfile\Documents\WindowsPowerShell\Modules\PoShKeePass\2.1.3.0\bin\KeePassLib_2.39.1.dll when the module is installed at user profile scope and the Documents folder is not redirected).

A proper fix would be to obtain/create a build of KeePassLib.dll for the current KeePass version and release a new PoShKeePass version with this dll included.

@tikondrus
Copy link
Author

Thanks a lot, but I've tried to swap dll from Keepass portable and it didn't help. After weeks of misunderstanding and ignorance I've migrated my project from Keepass to Hashicorp vault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants