Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Keefox (KeePassRPC) silently breaks if ProtectedData.Protect fails. #263

Closed
TobiX opened this issue Apr 21, 2014 · 4 comments
Closed

Keefox (KeePassRPC) silently breaks if ProtectedData.Protect fails. #263

TobiX opened this issue Apr 21, 2014 · 4 comments
Milestone

Comments

@TobiX
Copy link

TobiX commented Apr 21, 2014

Hi,

I wondered why I had to reauthorize the KeeFox connection on every Keepass2 restart and traced this back to KeePassRPC not saving the key to the config file (and not showing the key in the "Authorized clients" list), but it works for the current session. Setting the security level to "Low" also fixes this problem.

So I traced this back to KeePassRPCClient.cs around line 252, where the CryptographicException possibly thrown from ProtectedData.Protect is swallowed and never shown to the user. I wrote a small test program (well, copied the sample from here: http://msdn.microsoft.com/en-us/library/system.security.cryptography.protecteddata%28v=vs.110%29.aspx) and sure enough:

Data was not encrypted. An error occurred.
System.Security.Cryptography.CryptographicException: Data protection failed. ---> System.Security.Cryptography.CryptographicException: Improperly protected user's key pairs in '/home/tobias/.config/.mono/keypairs'.

Well. Thanks mono. Removing the '/home/tobias/.config/.mono/keypairs' directory (which is currently empty) fixed everything (Mono recreated the directory with the correct permissions and added a keypair there).

Please, at least add debug logging there (and maybe add this problem to your Troubleshooting guide?)

@luckyrat
Copy link
Member

Thanks for reporting the problem.

I've added some logging there for KeeFox 1.4.

Any idea why Mono got itself in this state? If this is a common issue then I'll gladly add it to the troubleshooting guide but I don't want to list every obscure problem that's ever happened in there or it will become too difficult to spot the things that are most likely to affect other users.

@luckyrat luckyrat added this to the 1.4 milestone Apr 22, 2014
@TobiX
Copy link
Author

TobiX commented Apr 23, 2014

Only happened on one Debian unstable (of 3), so not that common probably...

@slcpunk
Copy link

slcpunk commented Nov 21, 2014

This also fixed it for me. ( Ubuntu 14.04 ). Man it was driving me crazy. Going to reference this post from the few other places the issue was raised.

@dkebler
Copy link

dkebler commented Feb 18, 2015

Just reporting the same behavior ubuntu 14.10/mint 17.1.
I am running mono 3.12.0-0xamarin4
Like the others it "just started to happen :-)" a few days ago.
I followed @TobiX 's advice to remove the keypair but that did not resolve the issue.
I followed advice to set security to low but when I restart keepass the rpc has reset it back to medium and still the issue continues.
I did a minor update of mono from 3.12 marin3 to 3.12 marin4 but that did not resolve the issue.

The issue remains. Unfortunately I run three profiles of firefox so it's not particularly fun to reset the authorization three times each time I start keypass (which fortunately is only at boot)

If I can provide any logging which will help just let me know how.

FYI Running RPC plugin 1.4.4 and keefox 1.4.6.

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

No branches or pull requests

4 participants