mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
packet_cb: Properly verify the signature type
Issue reported by Tilo Eckert <tilo.eckert@flam.de>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit bc91fa98ea)
This commit is contained in:
committed by
Andreas Schneider
parent
c3a57fe2dc
commit
1df272c3cc
@@ -194,15 +194,15 @@ SSH_PACKET_CALLBACK(ssh_packet_newkeys){
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if public key from server matches user preferences */
|
/* Check if signature from server matches user preferences */
|
||||||
if (session->opts.wanted_methods[SSH_HOSTKEYS]) {
|
if (session->opts.wanted_methods[SSH_HOSTKEYS]) {
|
||||||
if (!ssh_match_group(session->opts.wanted_methods[SSH_HOSTKEYS],
|
if (!ssh_match_group(session->opts.wanted_methods[SSH_HOSTKEYS],
|
||||||
server_key->type_c)) {
|
sig->type_c)) {
|
||||||
ssh_set_error(session,
|
ssh_set_error(session,
|
||||||
SSH_FATAL,
|
SSH_FATAL,
|
||||||
"Public key from server (%s) doesn't match user "
|
"Public key from server (%s) doesn't match user "
|
||||||
"preference (%s)",
|
"preference (%s)",
|
||||||
server_key->type_c,
|
sig->type_c,
|
||||||
session->opts.wanted_methods[SSH_HOSTKEYS]);
|
session->opts.wanted_methods[SSH_HOSTKEYS]);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user