mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
agent: Make digest algorithms for ssh fingerprints configurable.
* agent/agent.h (opt): New field 'ssh_fingerprint_digest'. * agent/command-ssh.c (data_sign, ssh_identity_register): Honor the option for strings used to communicate with the user. * agent/findkey.c (agent_modify_description): Likewise. * agent/gpg-agent.c (cmd_and_opt_values): New value. (opts): New option '--ssh-fingerprint-digest'. (parse_rereadable_options): Set the default to MD5 for now. (main): Handle the new option. * doc/gpg-agent.texi: Document the new option. -- OpenSSH has transitioned from using MD5 to compute key fingerprints to SHA256. This patch makes the digest used when communicating key fingerprints to the user (e.g. in pinentry dialogs) configurable. For now this patch conservatively defaults to MD5. GnuPG-bug-id: 2106 Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
a5f046d99a
commit
525f2c482a
5 changed files with 24 additions and 3 deletions
|
@ -129,6 +129,7 @@ enum cmd_and_opt_values
|
|||
oKeepTTY,
|
||||
oKeepDISPLAY,
|
||||
oSSHSupport,
|
||||
oSSHFingerprintDigest,
|
||||
oPuttySupport,
|
||||
oDisableScdaemon,
|
||||
oDisableCheckOwnSocket,
|
||||
|
@ -232,6 +233,8 @@ static ARGPARSE_OPTS opts[] = {
|
|||
/* */ N_("allow passphrase to be prompted through Emacs")),
|
||||
|
||||
ARGPARSE_s_n (oSSHSupport, "enable-ssh-support", N_("enable ssh support")),
|
||||
ARGPARSE_s_s (oSSHFingerprintDigest, "ssh-fingerprint-digest",
|
||||
N_("digest to use when communicating ssh fingerprints")),
|
||||
ARGPARSE_s_n (oPuttySupport, "enable-putty-support",
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
/* */ N_("enable putty support")
|
||||
|
@ -800,6 +803,7 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
|
|||
opt.allow_emacs_pinentry = 0;
|
||||
opt.disable_scdaemon = 0;
|
||||
disable_check_own_socket = 0;
|
||||
opt.ssh_fingerprint_digest = GCRY_MD_MD5;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1176,6 +1180,11 @@ main (int argc, char **argv )
|
|||
case oSSHSupport:
|
||||
ssh_support = 1;
|
||||
break;
|
||||
case oSSHFingerprintDigest:
|
||||
opt.ssh_fingerprint_digest = gcry_md_map_name (pargs.r.ret_str);
|
||||
if (opt.ssh_fingerprint_digest == 0)
|
||||
log_error ("Unknown digest algorithm: %s\n", pargs.r.ret_str);
|
||||
break;
|
||||
case oPuttySupport:
|
||||
# ifdef HAVE_W32_SYSTEM
|
||||
putty_support = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue