mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
pki: Sanity-check signature matches base key type
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
968fdf4e18
commit
c79c33e224
@@ -1931,6 +1931,12 @@ int ssh_pki_signature_verify(ssh_session session,
|
|||||||
"Going to verify a %s type signature",
|
"Going to verify a %s type signature",
|
||||||
sig->type_c);
|
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 (key->type == SSH_KEYTYPE_ECDSA) {
|
||||||
#if HAVE_ECC
|
#if HAVE_ECC
|
||||||
|
Reference in New Issue
Block a user