From 3ac1a9d3a018816233a855faff059b4e0657a0f1 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 4 Dec 2015 15:19:07 +0100 Subject: common: Support different digest algorithms for ssh fingerprints. * common/ssh-utils.c (get_fingerprint): Add and honor 'algo' parameter. (ssh_get_fingerprint{,_string}): Likewise. * common/ssh-utils.h (ssh_get_fingerprint{,_string}): Update prototypes. * common/t-ssh-utils.c (main): Adapt accordingly. * agent/command-ssh.c (agent_raw_key_from_file): Likewise. (ssh_identity_register): Likewise. * agent/command.c (do_one_keyinfo): Likewise. * agent/findkey.c (modify_description): Likewise. -- This lays the foundation to support other algorithms. GnuPG-bug-id: 2106 Signed-off-by: Justus Winter --- agent/command-ssh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'agent/command-ssh.c') diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 99c80c087..3dd3dd74c 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -2760,7 +2760,7 @@ data_sign (ctrl_t ctrl, ssh_key_type_spec_t *spec, err = agent_raw_key_from_file (ctrl, ctrl->keygrip, &key); if (err) goto out; - err = ssh_get_fingerprint_string (key, &fpr); + err = ssh_get_fingerprint_string (key, GCRY_MD_MD5, &fpr); if (!err) { gcry_sexp_t tmpsxp = gcry_sexp_find_token (key, "comment", 0); @@ -3038,7 +3038,7 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, bin2hex (key_grip_raw, 20, key_grip); - err = ssh_get_fingerprint_string (key, &key_fpr); + err = ssh_get_fingerprint_string (key, GCRY_MD_MD5, &key_fpr); if (err) goto out; -- cgit v1.2.3