Home GnuPG
Diffusion GnuPG d2777f84be0d

ssh: Improve key lookup for many keys.
d2777f84be0dUnpublished

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.

Details

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

Event Timeline

Werner Koch <wk@gnupg.org> committed rGd2777f84be0d: ssh: Improve key lookup for many keys. (authored by Werner Koch <wk@gnupg.org>).Dec 10 2012, 6:27 PM