CVE-2026-0966 doc: Update guided tour to use SHA256 fingerprints

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
This commit is contained in:
Jakub Jelen
2026-01-08 12:10:44 +01:00
parent 9be83584a5
commit 1b2a4f760b

View File

@@ -190,7 +190,6 @@ int verify_knownhost(ssh_session session)
ssh_key srv_pubkey = NULL; ssh_key srv_pubkey = NULL;
size_t hlen; size_t hlen;
char buf[10]; char buf[10];
char *hexa = NULL;
char *p = NULL; char *p = NULL;
int cmp; int cmp;
int rc; int rc;
@@ -201,7 +200,7 @@ int verify_knownhost(ssh_session session)
} }
rc = ssh_get_publickey_hash(srv_pubkey, rc = ssh_get_publickey_hash(srv_pubkey,
SSH_PUBLICKEY_HASH_SHA1, SSH_PUBLICKEY_HASH_SHA256,
&hash, &hash,
&hlen); &hlen);
ssh_key_free(srv_pubkey); ssh_key_free(srv_pubkey);
@@ -217,7 +216,7 @@ int verify_knownhost(ssh_session session)
break; break;
case SSH_KNOWN_HOSTS_CHANGED: case SSH_KNOWN_HOSTS_CHANGED:
fprintf(stderr, "Host key for server changed: it is now:\n"); fprintf(stderr, "Host key for server changed: it is now:\n");
ssh_print_hexa("Public key hash", hash, hlen); ssh_print_hash(SSH_PUBLICKEY_HASH_SHA256, hash, hlen);
fprintf(stderr, "For security reasons, connection will be stopped\n"); fprintf(stderr, "For security reasons, connection will be stopped\n");
ssh_clean_pubkey_hash(&hash); ssh_clean_pubkey_hash(&hash);
@@ -238,10 +237,9 @@ int verify_knownhost(ssh_session session)
/* FALL THROUGH to SSH_SERVER_NOT_KNOWN behavior */ /* FALL THROUGH to SSH_SERVER_NOT_KNOWN behavior */
case SSH_KNOWN_HOSTS_UNKNOWN: case SSH_KNOWN_HOSTS_UNKNOWN:
hexa = ssh_get_hexa(hash, hlen);
fprintf(stderr,"The server is unknown. Do you trust the host key?\n"); fprintf(stderr,"The server is unknown. Do you trust the host key?\n");
fprintf(stderr, "Public key hash: %s\n", hexa); fprintf(stderr, "Public key hash: ");
ssh_string_free_char(hexa); ssh_print_hash(SSH_PUBLICKEY_HASH_SHA256, hash, hlen);
ssh_clean_pubkey_hash(&hash); ssh_clean_pubkey_hash(&hash);
p = fgets(buf, sizeof(buf), stdin); p = fgets(buf, sizeof(buf), stdin);
if (p == NULL) { if (p == NULL) {