mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
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>
This commit is contained in:
@@ -903,9 +903,9 @@ int ssh_key_cmp(const ssh_key k1,
|
||||
}
|
||||
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
if (k1->type == SSH_KEYTYPE_ED25519) {
|
||||
if (ssh_key_type_plain(k1->type) == SSH_KEYTYPE_ED25519) {
|
||||
return pki_ed25519_key_cmp(k1, k2, what);
|
||||
} else if (k1->type == SSH_KEYTYPE_SK_ED25519) {
|
||||
} else if (ssh_key_type_plain(k1->type) == SSH_KEYTYPE_SK_ED25519) {
|
||||
return pki_ed25519_key_cmp(k1, k2, SSH_KEY_CMP_PUBLIC);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user