From cb17a3698f6983fd1b8bfb9d311b9c2cbfa8e7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 18 Jan 2006 15:58:43 +0000 Subject: [PATCH] (DH_compute_key): check public key git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16588 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/dh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/des/dh.c b/lib/des/dh.c index a598ca72b..c12c2731c 100644 --- a/lib/des/dh.c +++ b/lib/des/dh.c @@ -199,6 +199,11 @@ int DH_compute_key(unsigned char *shared_key, const BIGNUM *peer_pub_key, DH *dh) { + int codes; + + if (!DH_check_pubkey(dh, peer_pub_key, &codes)) + return 0; + return dh->meth->compute_key(shared_key, peer_pub_key, dh); }