summaryrefslogtreecommitdiff
path: root/moduli.c
diff options
context:
space:
mode:
authordtucker <dtucker>2003-12-09 13:54:38 +0000
committerdtucker <dtucker>2003-12-09 13:54:38 +0000
commit7eda8f4b57f342f7811184c55f6a6e1d1928a1ea (patch)
tree218c945c10818076b704d1d831846ce831b34106 /moduli.c
parent3ba854b6a24b6cd4abc4b781e45ba4e6ef3bfc51 (diff)
downloadopenssh-7eda8f4b57f342f7811184c55f6a6e1d1928a1ea.tar.gz
- dtucker@cvs.openbsd.org 2003/12/09 13:52:55
[moduli.c] Prevent ssh-keygen -T from outputting moduli with a generator of 0, since they can't be used for Diffie-Hellman. Assistance and ok djm@
Diffstat (limited to 'moduli.c')
-rw-r--r--moduli.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/moduli.c b/moduli.c
index 17c7281c..371319d0 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: moduli.c,v 1.3 2003/12/07 06:34:18 djm Exp $ */
+/* $OpenBSD: moduli.c,v 1.4 2003/12/09 13:52:55 dtucker Exp $ */
/*
* Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -550,6 +550,15 @@ prime_test(FILE *in, FILE *out, u_int32_t trials,
continue;
}
+ /*
+ * Primes with no known generator are useless for DH, so
+ * skip those.
+ */
+ if (generator_known == 0) {
+ debug2("%10u: no known generator", count_in);
+ continue;
+ }
+
count_possible++;
/*