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 <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 38f3d158f6)
This commit is contained in:
Jakub Jelen
2025-12-12 16:37:20 +01:00
parent 03b29a6874
commit d12eb770ac

View File

@@ -701,8 +701,8 @@ int ssh_key_cmp(const ssh_key k1,
ssh_buffer_get_len(k1->cert)); ssh_buffer_get_len(k1->cert));
} }
if (k1->type == SSH_KEYTYPE_ED25519 || if (ssh_key_type_plain(k1->type) == SSH_KEYTYPE_ED25519 ||
k1->type == SSH_KEYTYPE_SK_ED25519) { ssh_key_type_plain(k1->type) == SSH_KEYTYPE_SK_ED25519) {
return pki_ed25519_key_cmp(k1, k2, what); return pki_ed25519_key_cmp(k1, k2, what);
} }