dlech / KeeAgent

ssh agent plugin for KeePass 2.x
http://lechnology.com/software/keeagent
Other
522 stars 35 forks source link

Error/crash when removing keys from agent in mono #229

Open Sanaki opened 6 years ago

Sanaki commented 6 years ago

When manually removing keys from the agent under mono, whether singly or via remove all, after generally 2-3 key removals keepass2 will minimize itself on an error (see below), then crash hard if any further attempt is made to manipulate keys (add or remove). Interestingly, having the agent unload all keys on workspace lock doesn't cause any issues and can be done repeatedly with no errors.

The sample database I used for testing (locked via the key file in the archive, no password): KeeAgent bugtest database.zip

mono --version
Mono JIT compiler version 5.10.1.47 (tarball Tue Apr 17 15:12:35 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    Interpreter:   yes
    LLVM:          supported, not enabled.
    GC:            sgen (concurrent by default)

Keepass 2.8 installed via PPA, keepass2-plugin-tray-icon and KeeAgent 0.10.1.0 installed via Keebuntu PPA, all other plugins removed for testing process. Error tested on Linux Mint 18.3 using Cinnamon 3.6.7.

precrash.txt precrash2.txt postcrash.txt screenshot from 2018-04-26 15-35-28

dlech commented 6 years ago

assuming that you are running KeeAgent in client mode with external ssh-agent?

Sanaki commented 6 years ago

Agent mode. I couldn't get it to function properly as client (presumably due to my ssh-agent, not due to KeeAgent). Of note though, the keys themselves are not accessed at all (external to keepass of course) in triggering the error.

dmerillat commented 4 years ago

Just got this in latest stable (0.10.1) I'd try beta but it doesn't work in mono yet.

E: This isn't a crash, the operation fails. Probably should have opened a new issue.

dlech.SshAgentLib.AgentFailureException: Exception of type 'dlech.SshAgentLib.AgentFailureException' was thrown.
  at dlech.SshAgentLib.AgentClient.ListKeys (dlech.SshAgentLib.SshVersion aVersion) [0x0005d] in <5a6d6128151642fba0f92bc7c30a3ff8>:0 
  at dlech.SshAgentLib.AgentClient.RemoveAllKeys (dlech.SshAgentLib.SshVersion version) [0x00010] in <5a6d6128151642fba0f92bc7c30a3ff8>:0 
  at dlech.SshAgentLib.IAgentExt.RemoveAllKeys (dlech.SshAgentLib.IAgent aAgent) [0x00023] in <5a6d6128151642fba0f92bc7c30a3ff8>:0 
  at dlech.SshAgentLib.WinForms.KeyInfoView.removeAllButton_Click (System.Object sender, System.EventArgs e) [0x00000] in <c4d020b9aae64cc0b432980b0fdbfffc>:0 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x0001c] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00024] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00081] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x0007e] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x0016f] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x0004e] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x0000b] in <0e1823914d7643eeaf1207febb083a4a>:0 
  at System.Windows.Forms.NativeWindow.WndProc (System.IntPtr hWnd, System.Windows.Forms.Msg msg, System.IntPtr wParam, System.IntPtr lParam) [0x0008e] in <0e1823914d7643eeaf1207febb083a4a>:0