From d12eb770acd1cbaa04a45ba5d6837941b69a095e Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Fri, 12 Dec 2025 16:37:20 +0100 Subject: [PATCH] pki: Fix comparing public key of certificate When the first key object is a certificate object, this match will fall through to the generic key comparison that is unable to handle the ed25519 keys and fails. Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider (cherry picked from commit 38f3d158f663cef68e8f83d7713f3df571d3dfb8) --- src/pki.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pki.c b/src/pki.c index 17b4845d..cd0c4625 100644 --- a/src/pki.c +++ b/src/pki.c @@ -701,8 +701,8 @@ int ssh_key_cmp(const ssh_key k1, ssh_buffer_get_len(k1->cert)); } - if (k1->type == SSH_KEYTYPE_ED25519 || - k1->type == SSH_KEYTYPE_SK_ED25519) { + if (ssh_key_type_plain(k1->type) == SSH_KEYTYPE_ED25519 || + ssh_key_type_plain(k1->type) == SSH_KEYTYPE_SK_ED25519) { return pki_ed25519_key_cmp(k1, k2, what); }