JustinGrote / SecretManagement.KeePass

MIT License
116 stars 22 forks source link

Opening keepass with keyfile does not work: Composite Key is invalid although it is correct #8

Closed trir262 closed 3 years ago

trir262 commented 3 years ago

My environment:

I found an issue when opening a keepass file with keyfile. The private function Connect-KeePassDatabase tests a variable $KeyFile but that is not set anywhere in the function.

Example keepass & keyfile added dbwithkeyfile.zip

JustinGrote commented 3 years ago

Haven't actually tested the keyfile and usewindowsaccount fully yet, not surprised. I'll look into this.

trir262 commented 3 years ago

got it working, was just a typo: keyfile should be keypath

JustinGrote commented 3 years ago

@trir262 I plan to provide a Get-KeePassParams or something like that to produce an object to clearly structure the keyvault options since there's basically zero feedback.

@paulhigin another real-world user example of what I'm talking about :)

trir262 commented 3 years ago

I would think that the VaultParameters in Register-SecretVault would need to have the necessary information, like 'MasterPassword=$true' or 'KeyFileLocation=path', no? That way, both test-secretvault and get-secret can rely on that data to do their correct handling.

Test-SecretVault in itself can also - like you did - store a module script variable to store sensitive data like the credential password, required key, ....

Or am I missing something else?