aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-11-22 10:45:20 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-30 16:21:52 +0100
commitbc91fa98eaafbe9b414c120044705fde441edeeb (patch)
tree2883223d700b183a8bb6d4fef4eb0912b4d959df
parentd2434c69c008aa1cd3bd488ca6bc524da0e4ca3a (diff)
downloadlibssh-bc91fa98eaafbe9b414c120044705fde441edeeb.tar.gz
libssh-bc91fa98eaafbe9b414c120044705fde441edeeb.tar.xz
libssh-bc91fa98eaafbe9b414c120044705fde441edeeb.zip
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>
-rw-r--r--src/packet_cb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/packet_cb.c b/src/packet_cb.c
index e655c88d..8e244cee 100644
--- a/src/packet_cb.c
+++ b/src/packet_cb.c
@@ -194,15 +194,15 @@ SSH_PACKET_CALLBACK(ssh_packet_newkeys){
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(!ssh_match_group(session->opts.wanted_methods[SSH_HOSTKEYS],
- server_key->type_c)) {
+ if (!ssh_match_group(session->opts.wanted_methods[SSH_HOSTKEYS],
+ sig->type_c)) {
ssh_set_error(session,
SSH_FATAL,
"Public key from server (%s) doesn't match user "
"preference (%s)",
- server_key->type_c,
+ sig->type_c,
session->opts.wanted_methods[SSH_HOSTKEYS]);
goto error;
}