Home GnuPG
Diffusion GnuPG 901162579119

ssh: Improve key lookup for many keys.
901162579119Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

ssh: Improve key lookup for many keys.

* agent/command-ssh.c: Remove dirent.h.
(control_file_s): Add struct item.
(rewind_control_file): New.
(search_control_file): Factor code out to ...
(read_control_file_item): New.
(ssh_handler_request_identities): Change to iterate over entries in
sshcontrol.

Formerly we scanned the private key directory for matches of entries
in sshcontrol. This patch changes it to scan the sshcontrol file and
thus considers only keys configured there. The rationale for this is
that it is common to have only a few ssh keys but many private keys.
Even if that assumption does not hold true, the scanning of the
sshcontrol file is faster than reading the directory and only then
scanning the ssh control for each directory entry.

(cherry picked from commit d2777f84be0ded5906a9bec3bc23cfed0a9be02f)

Details

Provenance
wernerAuthored on Dec 10 2012, 6:27 PM
Parents
rG336112e51907: ssh: Cleanup sshcontrol file access code.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG901162579119: ssh: Improve key lookup for many keys. (authored by Werner Koch <wk@gnupg.org>).Jul 1 2013, 8:31 PM