From b88057d09dd84d8b8bba1af391d397ab28106d50 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 29 Aug 2022 11:28:31 +0100 Subject: [PATCH] ECDH kex: remove pointless NULL check. None of the constructors can fail and return NULL. I think this must have come in with a lot of other unnecessary null-pointer checks when ECC support was first added. I've got rid of most of them since then, but that one apparently escaped my notice. --- ssh/kex2-client.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ssh/kex2-client.c b/ssh/kex2-client.c index a437d92e..0f24881a 100644 --- a/ssh/kex2-client.c +++ b/ssh/kex2-client.c @@ -193,11 +193,6 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted) s->ppl.bpp->pls->kctx = SSH2_PKTCTX_ECDHKEX; s->ecdh_key = ecdh_key_new(s->kex_alg, false); - if (!s->ecdh_key) { - ssh_sw_abort(s->ppl.ssh, "Unable to generate key for ECDH"); - *aborted = true; - return; - } pktout = ssh_bpp_new_pktout(s->ppl.bpp, SSH2_MSG_KEX_ECDH_INIT); {