summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/dh.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-05-04 14:37:52 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-05-04 14:37:52 +0000
commit934fda8adaf04a4b4fc4f0efd441b9b5d3efb659 (patch)
treed6839409979ab65488a7549f3575369926887472 /sbin/isakmpd/dh.c
parent04ffe450ccdc05851f8a95806c9e4678e65266c5 (diff)
check for degenerate Diffie-Hellman public exponents;
ok markus@ hshoexer@ deraadt@
Diffstat (limited to 'sbin/isakmpd/dh.c')
-rw-r--r--sbin/isakmpd/dh.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/isakmpd/dh.c b/sbin/isakmpd/dh.c
index 46519b905aa..9a8ff6bff2c 100644
--- a/sbin/isakmpd/dh.c
+++ b/sbin/isakmpd/dh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.c,v 1.10 2005/04/08 22:32:09 cloder Exp $ */
+/* $OpenBSD: dh.c,v 1.11 2006/05/04 14:37:51 djm Exp $ */
/* $EOM: dh.c,v 1.5 1999/04/17 23:20:22 niklas Exp $ */
/*
@@ -59,6 +59,8 @@ dh_create_exchange(struct group *group, u_int8_t *buf)
return -1;
if (group->operation(group, group->a, group->gen, group->c))
return -1;
+ if (group->validate_public(group, group->a))
+ return -1;
group->getraw(group, group->a, buf);
return 0;
}
@@ -75,6 +77,8 @@ dh_create_shared(struct group *group, u_int8_t *secret, u_int8_t *exchange)
return -1;
if (group->operation(group, group->a, group->b, group->c))
return -1;
+ if (group->validate_public(group, group->a))
+ return -1;
group->getraw(group, group->a, secret);
return 0;
}