Bug 2186 - ssh-agent crashes when removing PKCS#11 library keys if non-PKCS#11 keys are present
Summary: ssh-agent crashes when removing PKCS#11 library keys if non-PKCS#11 keys are ...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-agent (show other bugs)
Version: 6.3p1
Hardware: All All
: P5 minor
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_6_5
  Show dependency treegraph
 
Reported: 2013-12-18 09:10 AEDT by jay
Modified: 2015-08-11 23:04 AEST (History)
2 users (show)

See Also:


Attachments
openssh-6.3p1-agent.patch (468 bytes, text/plain)
2013-12-18 09:10 AEDT, jay
no flags Details
tweaked patch (648 bytes, patch)
2013-12-19 11:07 AEDT, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jay 2013-12-18 09:10:11 AEDT
Created attachment 2391 [details]
openssh-6.3p1-agent.patch

When removing a PKCS#11 key from the agent, the agent crashes if file-based keys are present in the agent.  I discovered this was because strcmp() is called on the provider of each key, but the provider is NULL for file keys.  The attached patch remedies this by checking for a NULL provider first.
Comment 1 Damien Miller 2013-12-19 11:07:37 AEDT
Created attachment 2394 [details]
tweaked patch

Nice catch - thanks.

I think a comment is in order here (implemented in tweaked patch).
Comment 2 jay 2014-02-13 02:27:08 AEDT
Does anything else need to be done to get this patch applied?
Comment 3 Damien Miller 2014-02-13 09:05:58 AEDT
oops. This was committed back in December and made it into the 6.5 release, but unfortunately not the release notes.

https://anongit.mindrot.org/openssh.git/commit/?h=V_6_5&id=0b36c83148976c7c8268f4f41497359e2fb26251
Comment 4 Damien Miller 2014-02-13 09:30:23 AEDT
oops, added to wrong tracking bug; should have been 6.5
Comment 5 Damien Miller 2015-08-11 23:04:36 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1