From 38c9408cf859525029f6eb4fe00b50259e08e3f2 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 8 Mar 2018 23:51:33 +0800 Subject: [PATCH] avoid leak of ecdh public key --- common-kex.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common-kex.c b/common-kex.c index 7da3fb7..d4933dd 100644 --- a/common-kex.c +++ b/common-kex.c @@ -694,6 +694,9 @@ void kexecdh_comb_key(struct kex_ecdh_param *param, buffer *pub_them, /* K, the shared secret */ buf_putmpint(ses.kexhashbuf, ses.dh_K); + ecc_free(Q_them); + m_free(Q_them); + /* calculate the hash H to sign */ finish_kexhashbuf(); }