diff common-kex.c @ 1607:0bdbb9ecc403

avoid leak of ecdh public key
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Mar 2018 23:51:33 +0800
parents 2f64cb3d3007
children d32bcb5c557d
line wrap: on
line diff
--- a/common-kex.c	Thu Mar 08 23:23:19 2018 +0800
+++ b/common-kex.c	Thu Mar 08 23:51:33 2018 +0800
@@ -694,6 +694,9 @@
 	/* 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();
 }