diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-02-27 22:42:48 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-02-27 22:42:48 +0000 |
commit | ff0f59e6b3c787cc8032e2adc01f9891dd812336 (patch) | |
tree | 9ff300298d5942df9e316911572828b8d9c794f7 /usr.bin | |
parent | ef6a769b8ff1a5576fd615367d1ed5c0ce8f88bb (diff) |
Prevent sshd from sending DH groups with a primitive generator of zero or
one, even if they are listed in /etc/moduli. ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/dh.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/dh.c b/usr.bin/ssh/dh.c index c7a3e18be82..b58b8bc28c0 100644 --- a/usr.bin/ssh/dh.c +++ b/usr.bin/ssh/dh.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: dh.c,v 1.26 2003/12/16 15:51:54 markus Exp $"); +RCSID("$OpenBSD: dh.c,v 1.27 2004/02/27 22:42:47 dtucker Exp $"); #include "xmalloc.h" @@ -91,6 +91,9 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg) if (BN_num_bits(dhg->p) != dhg->size) goto failclean; + if (BN_is_zero(dhg->g) || BN_is_one(dhg->g)) + goto failclean; + return (1); failclean: |