From c7c8eb8e09796cc30d543eeab57a1da335a79ea3 Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 20 Jan 2015 07:55:33 +0000 Subject: [PATCH] fix hostkeys in agent; ok markus@ --- usr.bin/ssh/kexc25519s.c | 9 ++++----- usr.bin/ssh/kexdhs.c | 9 ++++----- usr.bin/ssh/kexecdhs.c | 9 ++++----- usr.bin/ssh/kexgexs.c | 9 ++++----- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/usr.bin/ssh/kexc25519s.c b/usr.bin/ssh/kexc25519s.c index 7dd5bb82675..867b6e75516 100644 --- a/usr.bin/ssh/kexc25519s.c +++ b/usr.bin/ssh/kexc25519s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kexc25519s.c,v 1.6 2015/01/19 20:16:15 markus Exp $ */ +/* $OpenBSD: kexc25519s.c,v 1.7 2015/01/20 07:55:33 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved. @@ -73,10 +73,9 @@ input_kex_c25519_init(int type, u_int32_t seq, void *ctxt) r = SSH_ERR_INVALID_ARGUMENT; goto out; } - if ((server_host_public = kex->load_host_public_key(kex->hostkey_type, - ssh)) == NULL || - (server_host_private = kex->load_host_private_key(kex->hostkey_type, - ssh)) == NULL) { + server_host_public = kex->load_host_public_key(kex->hostkey_type, ssh); + server_host_private = kex->load_host_private_key(kex->hostkey_type, ssh); + if (server_host_public == NULL) { r = SSH_ERR_NO_HOSTKEY_LOADED; goto out; } diff --git a/usr.bin/ssh/kexdhs.c b/usr.bin/ssh/kexdhs.c index 1ac5a4e16d1..0ceea560c73 100644 --- a/usr.bin/ssh/kexdhs.c +++ b/usr.bin/ssh/kexdhs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kexdhs.c,v 1.20 2015/01/19 20:16:15 markus Exp $ */ +/* $OpenBSD: kexdhs.c,v 1.21 2015/01/20 07:55:33 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -96,10 +96,9 @@ input_kex_dh_init(int type, u_int32_t seq, void *ctxt) r = SSH_ERR_INVALID_ARGUMENT; goto out; } - if ((server_host_public = kex->load_host_public_key(kex->hostkey_type, - ssh)) == NULL || - (server_host_private = kex->load_host_private_key(kex->hostkey_type, - ssh)) == NULL) { + server_host_public = kex->load_host_public_key(kex->hostkey_type, ssh); + server_host_private = kex->load_host_private_key(kex->hostkey_type, ssh); + if (server_host_public == NULL) { r = SSH_ERR_NO_HOSTKEY_LOADED; goto out; } diff --git a/usr.bin/ssh/kexecdhs.c b/usr.bin/ssh/kexecdhs.c index e46e7a290f4..48e9226730e 100644 --- a/usr.bin/ssh/kexecdhs.c +++ b/usr.bin/ssh/kexecdhs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kexecdhs.c,v 1.12 2015/01/19 20:16:15 markus Exp $ */ +/* $OpenBSD: kexecdhs.c,v 1.13 2015/01/20 07:55:33 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved. @@ -91,10 +91,9 @@ input_kex_ecdh_init(int type, u_int32_t seq, void *ctxt) r = SSH_ERR_INVALID_ARGUMENT; goto out; } - if ((server_host_public = kex->load_host_public_key(kex->hostkey_type, - ssh)) == NULL || - (server_host_private = kex->load_host_private_key(kex->hostkey_type, - ssh)) == NULL) { + server_host_public = kex->load_host_public_key(kex->hostkey_type, ssh); + server_host_private = kex->load_host_private_key(kex->hostkey_type, ssh); + if (server_host_public == NULL) { r = SSH_ERR_NO_HOSTKEY_LOADED; goto out; } diff --git a/usr.bin/ssh/kexgexs.c b/usr.bin/ssh/kexgexs.c index c77403ba845..92a89d64f94 100644 --- a/usr.bin/ssh/kexgexs.c +++ b/usr.bin/ssh/kexgexs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kexgexs.c,v 1.21 2015/01/19 20:16:15 markus Exp $ */ +/* $OpenBSD: kexgexs.c,v 1.22 2015/01/20 07:55:33 djm Exp $ */ /* * Copyright (c) 2000 Niels Provos. All rights reserved. * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -155,10 +155,9 @@ input_kex_dh_gex_init(int type, u_int32_t seq, void *ctxt) r = SSH_ERR_INVALID_ARGUMENT; goto out; } - if ((server_host_public = kex->load_host_public_key(kex->hostkey_type, - ssh)) == NULL || - (server_host_private = kex->load_host_private_key(kex->hostkey_type, - ssh)) == NULL) { + server_host_public = kex->load_host_public_key(kex->hostkey_type, ssh); + server_host_private = kex->load_host_private_key(kex->hostkey_type, ssh); + if (server_host_public == NULL) { r = SSH_ERR_NO_HOSTKEY_LOADED; goto out; } -- 2.20.1