Bug 2186

Summary: ssh-agent crashes when removing PKCS#11 library keys if non-PKCS#11 keys are present
Product: Portable OpenSSH Reporter: jay
Component: ssh-agentAssignee: Damien Miller <djm>
Status: CLOSED FIXED    
Severity: minor CC: djm, dtucker
Priority: P5    
Version: 6.3p1   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 2130    
Attachments:
Description Flags
openssh-6.3p1-agent.patch
none
tweaked patch dtucker: ok+

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