mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 20:30:38 +09:00
pki: Sanity-check signature matches base key type
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit c79c33e224)
This commit is contained in:
committed by
Andreas Schneider
parent
230a437288
commit
5ffe695c3c
@@ -1928,6 +1928,12 @@ int ssh_pki_signature_verify(ssh_session session,
|
||||
"Going to verify a %s type signature",
|
||||
sig->type_c);
|
||||
|
||||
if (key->type != sig->type) {
|
||||
SSH_LOG(SSH_LOG_WARN,
|
||||
"Can not verify %s signature with %s key",
|
||||
sig->type_c, key->type_c);
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
if (key->type == SSH_KEYTYPE_ECDSA) {
|
||||
#if HAVE_ECC
|
||||
|
||||
Reference in New Issue
Block a user