From 9ab47eeb229761173ce5da5b4976d9ea9a7b75e4 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 5 Feb 2002 12:19:52 +1100 Subject: - markus@cvs.openbsd.org 2002/01/31 13:35:11 [kexdh.c kexgex.c] cross check announced key type and type from key blob --- kexdh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kexdh.c') diff --git a/kexdh.c b/kexdh.c index 60d13a8b9..f87d52952 100644 --- a/kexdh.c +++ b/kexdh.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdh.c,v 1.13 2002/01/25 22:07:40 markus Exp $"); +RCSID("$OpenBSD: kexdh.c,v 1.14 2002/01/31 13:35:11 markus Exp $"); #include #include @@ -121,7 +121,8 @@ kexdh_client(Kex *kex) server_host_key = key_from_blob(server_host_key_blob, sbloblen); if (server_host_key == NULL) fatal("cannot decode server_host_key_blob"); - + if (server_host_key->type != kex->hostkey_type) + fatal("type mismatch for decoded server_host_key_blob"); if (kex->verify_host_key == NULL) fatal("cannot verify server_host_key"); if (kex->verify_host_key(server_host_key) == -1) -- cgit v1.2.3